From 5c8f4cb52ed6a9e49e2aab46a4e92ef868efb111 Mon Sep 17 00:00:00 2001 From: Nick Gould Date: Mon, 13 Jan 2025 09:46:26 +0000 Subject: [PATCH] revise preprcessing for C interfaces to arc and trb remove excess printing from glrt --- include/galahad_cfunctions.h | 23 ++++++++++++++++++++++- src/arc/C/arc_ciface.F90 | 30 +++++++++++++++--------------- src/glrt/C/glrtt.c | 3 +-- src/trb/C/trb_ciface.F90 | 28 ++++++++++++++-------------- 4 files changed, 52 insertions(+), 32 deletions(-) diff --git a/include/galahad_cfunctions.h b/include/galahad_cfunctions.h index e9a1f75950..84dd6e554f 100644 --- a/include/galahad_cfunctions.h +++ b/include/galahad_cfunctions.h @@ -511,9 +511,11 @@ #define llsr_control_type llsr_control_type_s_64 #define llsr_inform_type llsr_inform_type_s_64 #define llsr_time_type llsr_time_type_s_64 +#define llsr_history_type llsr_history_type_s_64 #define llst_control_type llst_control_type_s_64 #define llst_inform_type llst_inform_type_s_64 #define llst_time_type llst_time_type_s_64 +#define llst_history_type llst_history_type_s_64 #define lms_control_type lms_control_type_s_64 #define lms_inform_type lms_inform_type_s_64 #define lms_time_type lms_time_type_s_64 @@ -553,6 +555,7 @@ #define rqs_control_type rqs_control_type_s_64 #define rqs_inform_type rqs_inform_type_s_64 #define rqs_time_type rqs_time_type_s_64 +#define rqs_history_type rqs_history_type_s_64 #define sbls_control_type sbls_control_type_s_64 #define sbls_inform_type sbls_inform_type_s_64 #define sbls_time_type sbls_time_type_s_64 @@ -575,6 +578,7 @@ #define trs_control_type trs_control_type_s_64 #define trs_inform_type trs_inform_type_s_64 #define trs_time_type trs_time_type_s_64 +#define trs_history_type trs_history_type_s_64 #define tru_control_type tru_control_type_s_64 #define tru_inform_type tru_inform_type_s_64 #define tru_time_type tru_time_type_s_64 @@ -1050,9 +1054,11 @@ #define llsr_control_type llsr_control_type_q_64 #define llsr_inform_type llsr_inform_type_q_64 #define llsr_time_type llsr_time_type_q_64 +#define llsr_history_type llsr_history_type_q_64 #define llst_control_type llst_control_type_q_64 #define llst_inform_type llst_inform_type_q_64 #define llst_time_type llst_time_type_q_64 +#define llst_history_type llst_history_type_q_64 #define lms_control_type lms_control_type_q_64 #define lms_inform_type lms_inform_type_q_64 #define lms_time_type lms_time_type_q_64 @@ -1092,6 +1098,7 @@ #define rqs_control_type rqs_control_type_q_64 #define rqs_inform_type rqs_inform_type_q_64 #define rqs_time_type rqs_time_type_q_64 +#define rqs_history_type rqs_history_type_q_64 #define sbls_control_type sbls_control_type_q_64 #define sbls_inform_type sbls_inform_type_q_64 #define sbls_time_type sbls_time_type_q_64 @@ -1114,6 +1121,7 @@ #define trs_control_type trs_control_type_q_64 #define trs_inform_type trs_inform_type_q_64 #define trs_time_type trs_time_type_q_64 +#define trs_history_type trs_history_type_q_64 #define tru_control_type tru_control_type_q_64 #define tru_inform_type tru_inform_type_q_64 #define tru_time_type tru_time_type_q_64 @@ -1589,9 +1597,11 @@ #define llsr_control_type llsr_control_type_64 #define llsr_inform_type llsr_inform_type_64 #define llsr_time_type llsr_time_type_64 +#define llsr_history_type llsr_history_type_64 #define llst_control_type llst_control_type_64 #define llst_inform_type llst_inform_type_64 #define llst_time_type llst_time_type_64 +#define llst_history_type llst_history_type_64 #define lms_control_type lms_control_type_64 #define lms_inform_type lms_inform_type_64 #define lms_time_type lms_time_type_64 @@ -1631,6 +1641,7 @@ #define rqs_control_type rqs_control_type_64 #define rqs_inform_type rqs_inform_type_64 #define rqs_time_type rqs_time_type_64 +#define rqs_history_type rqs_history_type_64 #define sbls_control_type sbls_control_type_64 #define sbls_inform_type sbls_inform_type_64 #define sbls_time_type sbls_time_type_64 @@ -1653,6 +1664,7 @@ #define trs_control_type trs_control_type_64 #define trs_inform_type trs_inform_type_64 #define trs_time_type trs_time_type_64 +#define trs_history_type trs_history_type_64 #define tru_control_type tru_control_type_64 #define tru_inform_type tru_inform_type_64 #define tru_time_type tru_time_type_64 @@ -2130,9 +2142,11 @@ #define llsr_control_type llsr_control_type_s #define llsr_inform_type llsr_inform_type_s #define llsr_time_type llsr_time_type_s -#define llst_control_type llst_control_type_s +#define llsr_history_type llsr_history_type_s +#define llst_history_type llst_history_type_s #define llst_inform_type llst_inform_type_s #define llst_time_type llst_time_type_s +#define llst_control_type llst_control_type_s #define lms_control_type lms_control_type_s #define lms_inform_type lms_inform_type_s #define lms_time_type lms_time_type_s @@ -2172,6 +2186,7 @@ #define rqs_control_type rqs_control_type_s #define rqs_inform_type rqs_inform_type_s #define rqs_time_type rqs_time_type_s +#define rqs_history_type rqs_history_type_s #define sbls_control_type sbls_control_type_s #define sbls_inform_type sbls_inform_type_s #define sbls_time_type sbls_time_type_s @@ -2194,6 +2209,7 @@ #define trs_control_type trs_control_type_s #define trs_inform_type trs_inform_type_s #define trs_time_type trs_time_type_s +#define trs_history_type trs_history_type_s #define tru_control_type tru_control_type_s #define tru_inform_type tru_inform_type_s #define tru_time_type tru_time_type_s @@ -2669,9 +2685,11 @@ #define llsr_control_type llsr_control_type_q #define llsr_inform_type llsr_inform_type_q #define llsr_time_type llsr_time_type_q +#define llsr_history_type llsr_history_type_q #define llst_control_type llst_control_type_q #define llst_inform_type llst_inform_type_q #define llst_time_type llst_time_type_q +#define llst_history_type llst_history_type_q #define lms_control_type lms_control_type_q #define lms_inform_type lms_inform_type_q #define lms_time_type lms_time_type_q @@ -2711,6 +2729,7 @@ #define rqs_control_type rqs_control_type_q #define rqs_inform_type rqs_inform_type_q #define rqs_time_type rqs_time_type_q +#define rqs_history_type rqs_history_type_q #define sbls_control_type sbls_control_type_q #define sbls_inform_type sbls_inform_type_q #define sbls_time_type sbls_time_type_q @@ -2733,6 +2752,7 @@ #define trs_control_type trs_control_type_q #define trs_inform_type trs_inform_type_q #define trs_time_type trs_time_type_q +#define trs_history_type trs_history_type_q #define tru_control_type tru_control_type_q #define tru_inform_type tru_inform_type_q #define tru_time_type tru_time_type_q @@ -2747,3 +2767,4 @@ #endif #endif #endif + diff --git a/src/arc/C/arc_ciface.F90 b/src/arc/C/arc_ciface.F90 index 492e2915d5..6d8383fe22 100644 --- a/src/arc/C/arc_ciface.F90 +++ b/src/arc/C/arc_ciface.F90 @@ -1,4 +1,4 @@ -! THIS VERSION: GALAHAD 4.1 - 2023-01-24 AT 09:30 GMT. +! THIS VERSION: GALAHAD 5.2 - 2025-01-12 AT 09:20 GMT. #include "galahad_modules.h" #include "galahad_cfunctions.h" @@ -138,13 +138,13 @@ MODULE GALAHAD_ARC_precision_ciface LOGICAL ( KIND = C_BOOL ) :: space_critical LOGICAL ( KIND = C_BOOL ) :: deallocate_error_fatal CHARACTER ( KIND = C_CHAR ), DIMENSION( 31 ) :: prefix - TYPE ( RQS_control_type ) :: rqs_control - TYPE ( GLRT_control_type ) :: glrt_control - TYPE ( DPS_control_type ) :: dps_control - TYPE ( PSLS_control_type ) :: psls_control - TYPE ( LMS_control_type ) :: lms_control - TYPE ( LMS_control_type ) :: lms_control_prec - TYPE ( SHA_control_type ) :: sha_control + TYPE ( rqs_control_type ) :: rqs_control + TYPE ( glrt_control_type ) :: glrt_control + TYPE ( dps_control_type ) :: dps_control + TYPE ( psls_control_type ) :: psls_control + TYPE ( lms_control_type ) :: lms_control + TYPE ( lms_control_type ) :: lms_control_prec + TYPE ( sha_control_type ) :: sha_control END TYPE arc_control_type TYPE, BIND( C ) :: arc_time_type @@ -179,13 +179,13 @@ MODULE GALAHAD_ARC_precision_ciface REAL ( KIND = rpc_ ) :: norm_g REAL ( KIND = rpc_ ) :: weight TYPE ( arc_time_type ) :: time - TYPE ( RQS_inform_type ) :: rqs_inform - TYPE ( GLRT_inform_type ) :: glrt_inform - TYPE ( DPS_inform_type ) :: dps_inform - TYPE ( PSLS_inform_type ) :: psls_inform - TYPE ( LMS_inform_type ) :: lms_inform - TYPE ( LMS_inform_type ) :: lms_inform_prec - TYPE ( SHA_inform_type ) :: sha_inform + TYPE ( rqs_inform_type ) :: rqs_inform + TYPE ( glrt_inform_type ) :: glrt_inform + TYPE ( dps_inform_type ) :: dps_inform + TYPE ( psls_inform_type ) :: psls_inform + TYPE ( lms_inform_type ) :: lms_inform + TYPE ( lms_inform_type ) :: lms_inform_prec + TYPE ( sha_inform_type ) :: sha_inform END TYPE arc_inform_type !---------------------- diff --git a/src/glrt/C/glrtt.c b/src/glrt/C/glrtt.c index fe1021fd8a..6e0da82b99 100644 --- a/src/glrt/C/glrtt.c +++ b/src/glrt/C/glrtt.c @@ -38,7 +38,7 @@ int main(void) { } else { control.unitm = true; } - control.print_level = 1; + // control.print_level = 1; glrt_import_control( &control, &data, &status ); // resolve with a larger weight ? for( ipc_ new_weight=0; new_weight <= 1; new_weight++){ @@ -49,7 +49,6 @@ int main(void) { weight = 10.0; status = 6; } - printf("MR = %1" i_ipc_ "%1" i_ipc_ "\n", unit_m, new_weight ); for( ipc_ i = 0; i < n; i++) r[i] = 1.0; // iteration loop to find the minimizer diff --git a/src/trb/C/trb_ciface.F90 b/src/trb/C/trb_ciface.F90 index 2f561dee18..7e64ad0ca0 100644 --- a/src/trb/C/trb_ciface.F90 +++ b/src/trb/C/trb_ciface.F90 @@ -1,4 +1,4 @@ -! THIS VERSION: GALAHAD 4.1 - 2023-01-24 AT 09:30 GMT. +! THIS VERSION: GALAHAD 5.2 - 2025-01-12 AT 09:10 GMT. #include "galahad_modules.h" #include "galahad_cfunctions.h" @@ -132,12 +132,12 @@ MODULE GALAHAD_TRB_precision_ciface LOGICAL ( KIND = C_BOOL ) :: space_critical LOGICAL ( KIND = C_BOOL ) :: deallocate_error_fatal CHARACTER ( KIND = C_CHAR ), DIMENSION( 31 ) :: prefix - TYPE ( TRS_control_type ) :: trs_control - TYPE ( GLTR_control_type ) :: gltr_control - TYPE ( PSLS_control_type ) :: psls_control - TYPE ( LMS_control_type ) :: lms_control - TYPE ( LMS_control_type ) :: lms_control_prec - TYPE ( SHA_control_type ) :: sha_control + TYPE ( trs_control_type ) :: trs_control + TYPE ( gltr_control_type ) :: gltr_control + TYPE ( psls_control_type ) :: psls_control + TYPE ( lms_control_type ) :: lms_control + TYPE ( lms_control_type ) :: lms_control_prec + TYPE ( sha_control_type ) :: sha_control END TYPE TRB_control_type TYPE, BIND( C ) :: TRB_time_type @@ -172,13 +172,13 @@ MODULE GALAHAD_TRB_precision_ciface REAL ( KIND = rpc_ ) :: obj REAL ( KIND = rpc_ ) :: norm_pg REAL ( KIND = rpc_ ) :: radius - TYPE ( TRB_time_type ) :: time - TYPE ( TRS_inform_type ) :: trs_inform - TYPE ( GLTR_inform_type ) :: gltr_inform - TYPE ( PSLS_inform_type ) :: psls_inform - TYPE ( LMS_inform_type ) :: lms_inform - TYPE ( LMS_inform_type ) :: lms_inform_prec - TYPE ( SHA_inform_type ) :: sha_inform + TYPE ( trb_time_type ) :: time + TYPE ( trs_inform_type ) :: trs_inform + TYPE ( gltr_inform_type ) :: gltr_inform + TYPE ( psls_inform_type ) :: psls_inform + TYPE ( lms_inform_type ) :: lms_inform + TYPE ( lms_inform_type ) :: lms_inform_prec + TYPE ( sha_inform_type ) :: sha_inform END TYPE TRB_inform_type !----------------------