From 31e2df5206085fab339d6e4f0d1d7bb776b0eae9 Mon Sep 17 00:00:00 2001 From: Scott Charlton Date: Mon, 28 Oct 2019 11:25:17 -0600 Subject: [PATCH] updated for fortran --- iric_ftoc.c | 160 ++++++++++++++++++++++++++++++++++++++++++++--- iriclib.h | 12 +++- iriclib_single.c | 28 +++++++-- 3 files changed, 186 insertions(+), 14 deletions(-) diff --git a/iric_ftoc.c b/iric_ftoc.c index 651412d..182d8ca 100644 --- a/iric_ftoc.c +++ b/iric_ftoc.c @@ -791,22 +791,40 @@ void IRICLIBDLL FMNAME(cg_iric_read_sol_integer_mul_f, CG_IRIC_READ_SOL_INTEGER_ *ier = cg_iRIC_Read_Sol_Integer_Mul(*fid, *step, c_name, data); } -void IRICLIBDLL FMNAME(cg_iric_read_sol_real_mul_f, CG_IRIC_READ_SOL_REAL_MUL_F) (int *fid, int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { +void IRICLIBDLL FMNAME(cg_iric_read_sol_cell_integer_mul_f, CG_IRIC_READ_SOL_CELL_INTEGER_MUL_F) (int *fid, int *step, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { char c_name[CGIO_MAX_NAME_LENGTH+1]; string_2_C_string(STR_PTR(name), STR_LEN(name), c_name, CGIO_MAX_NAME_LENGTH, ier); if (*ier) return; - *ier = cg_iRIC_Read_Sol_Real_Mul(*fid, *step, c_name, data); + *ier = cg_iRIC_Read_Sol_Cell_Integer_Mul(*fid, *step, c_name, data); } -void IRICLIBDLL FMNAME(cg_iric_read_sol_cell_integer_mul_f, CG_IRIC_READ_SOL_CELL_INTEGER_MUL_F) (int *fid, int *step, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { +void IRICLIBDLL FMNAME(cg_iric_read_sol_iface_integer_mul_f, CG_IRIC_READ_SOL_IFACE_INTEGER_MUL_F) (int *fid, int *step, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { char c_name[CGIO_MAX_NAME_LENGTH+1]; string_2_C_string(STR_PTR(name), STR_LEN(name), c_name, CGIO_MAX_NAME_LENGTH, ier); if (*ier) return; - *ier = cg_iRIC_Read_Sol_Cell_Integer_Mul(*fid, *step, c_name, data); + *ier = cg_iRIC_Read_Sol_IFace_Integer_Mul(*fid, *step, c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_read_sol_jface_integer_mul_f, CG_IRIC_READ_SOL_JFACE_INTEGER_MUL_F) (int *fid, int *step, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Read_Sol_JFace_Integer_Mul(*fid, *step, c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_read_sol_real_mul_f, CG_IRIC_READ_SOL_REAL_MUL_F) (int *fid, int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Read_Sol_Real_Mul(*fid, *step, c_name, data); } void IRICLIBDLL FMNAME(cg_iric_read_sol_cell_real_mul_f, CG_IRIC_READ_SOL_CELL_REAL_MUL_F) (int *fid, int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { @@ -818,6 +836,24 @@ void IRICLIBDLL FMNAME(cg_iric_read_sol_cell_real_mul_f, CG_IRIC_READ_SOL_CELL_R *ier = cg_iRIC_Read_Sol_Cell_Real_Mul(*fid, *step, c_name, data); } +void IRICLIBDLL FMNAME(cg_iric_read_sol_iface_real_mul_f, CG_IRIC_READ_SOL_IFACE_REAL_MUL_F) (int *fid, int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Read_Sol_IFace_Real_Mul(*fid, *step, c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_read_sol_jface_real_mul_f, CG_IRIC_READ_SOL_JFACE_REAL_MUL_F) (int *fid, int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Read_Sol_JFace_Real_Mul(*fid, *step, c_name, data); +} + void IRICLIBDLL FMNAME(cg_iric_write_sol_time_mul_f, CG_IRIC_WRITE_SOL_TIME_MUL_F) (int *fid, double *time, int *ier) { *ier = cg_iRIC_Write_Sol_Time_Mul(*fid, *time); } @@ -870,6 +906,24 @@ void IRICLIBDLL FMNAME(cg_iric_write_sol_cell_integer_mul_f, CG_IRIC_WRITE_SOL_C *ier = cg_iRIC_Write_Sol_Cell_Integer_Mul(*fid, c_name, data); } +void IRICLIBDLL FMNAME(cg_iric_write_sol_iface_integer_mul_f, CG_IRIC_WRITE_SOL_IFACE_INTEGER_MUL_F) (int *fid, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Write_Sol_IFace_Integer_Mul(*fid, c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_write_sol_jface_integer_mul_f, CG_IRIC_WRITE_SOL_JFACE_INTEGER_MUL_F) (int *fid, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Write_Sol_JFace_Integer_Mul(*fid, c_name, data); +} + void IRICLIBDLL FMNAME(cg_iric_write_sol_real_mul_f, CG_IRIC_WRITE_SOL_REAL_MUL_F) (int *fid, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { char c_name[CGIO_MAX_NAME_LENGTH+1]; string_2_C_string(STR_PTR(name), STR_LEN(name), @@ -888,6 +942,24 @@ void IRICLIBDLL FMNAME(cg_iric_write_sol_cell_real_mul_f, CG_IRIC_WRITE_SOL_CELL *ier = cg_iRIC_Write_Sol_Cell_Real_Mul(*fid, c_name, data); } +void IRICLIBDLL FMNAME(cg_iric_write_sol_iface_real_mul_f, CG_IRIC_WRITE_SOL_IFACE_REAL_MUL_F) (int *fid, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Write_Sol_IFace_Real_Mul(*fid, c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_write_sol_jface_real_mul_f, CG_IRIC_WRITE_SOL_JFACE_REAL_MUL_F) (int *fid, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Write_Sol_JFace_Real_Mul(*fid, c_name, data); +} + void IRICLIBDLL FMNAME(cg_iric_write_errorcode_mul_f, CG_IRIC_WRITE_ERRORCODE_MUL_F) (int *fid, int *errorcode, int *ier) { *ier = cg_iRIC_Write_ErrorCode_Mul(*fid, *errorcode); } @@ -1979,22 +2051,40 @@ void IRICLIBDLL FMNAME(cg_iric_read_sol_integer_f, CG_IRIC_READ_SOL_INTEGER_F) ( *ier = cg_iRIC_Read_Sol_Integer(*step, c_name, data); } -void IRICLIBDLL FMNAME(cg_iric_read_sol_real_f, CG_IRIC_READ_SOL_REAL_F) (int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { +void IRICLIBDLL FMNAME(cg_iric_read_sol_cell_integer_f, CG_IRIC_READ_SOL_CELL_INTEGER_F) (int *step, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { char c_name[CGIO_MAX_NAME_LENGTH+1]; string_2_C_string(STR_PTR(name), STR_LEN(name), c_name, CGIO_MAX_NAME_LENGTH, ier); if (*ier) return; - *ier = cg_iRIC_Read_Sol_Real(*step, c_name, data); + *ier = cg_iRIC_Read_Sol_Cell_Integer(*step, c_name, data); } -void IRICLIBDLL FMNAME(cg_iric_read_sol_cell_integer_f, CG_IRIC_READ_SOL_CELL_INTEGER_F) (int *step, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { +void IRICLIBDLL FMNAME(cg_iric_read_sol_iface_integer_f, CG_IRIC_READ_SOL_IFACE_INTEGER_F) (int *step, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { char c_name[CGIO_MAX_NAME_LENGTH+1]; string_2_C_string(STR_PTR(name), STR_LEN(name), c_name, CGIO_MAX_NAME_LENGTH, ier); if (*ier) return; - *ier = cg_iRIC_Read_Sol_Cell_Integer(*step, c_name, data); + *ier = cg_iRIC_Read_Sol_IFace_Integer(*step, c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_read_sol_jface_integer_f, CG_IRIC_READ_SOL_JFACE_INTEGER_F) (int *step, STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Read_Sol_JFace_Integer(*step, c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_read_sol_real_f, CG_IRIC_READ_SOL_REAL_F) (int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Read_Sol_Real(*step, c_name, data); } void IRICLIBDLL FMNAME(cg_iric_read_sol_cell_real_f, CG_IRIC_READ_SOL_CELL_REAL_F) (int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { @@ -2006,6 +2096,24 @@ void IRICLIBDLL FMNAME(cg_iric_read_sol_cell_real_f, CG_IRIC_READ_SOL_CELL_REAL_ *ier = cg_iRIC_Read_Sol_Cell_Real(*step, c_name, data); } +void IRICLIBDLL FMNAME(cg_iric_read_sol_iface_real_f, CG_IRIC_READ_SOL_IFACE_REAL_F) (int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Read_Sol_IFace_Real(*step, c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_read_sol_jface_real_f, CG_IRIC_READ_SOL_JFACE_REAL_F) (int *step, STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Read_Sol_JFace_Real(*step, c_name, data); +} + void IRICLIBDLL FMNAME(cg_iric_write_sol_time_f, CG_IRIC_WRITE_SOL_TIME_F) (double *time, int *ier) { *ier = cg_iRIC_Write_Sol_Time(*time); } @@ -2058,6 +2166,24 @@ void IRICLIBDLL FMNAME(cg_iric_write_sol_cell_integer_f, CG_IRIC_WRITE_SOL_CELL_ *ier = cg_iRIC_Write_Sol_Cell_Integer(c_name, data); } +void IRICLIBDLL FMNAME(cg_iric_write_sol_iface_integer_f, CG_IRIC_WRITE_SOL_IFACE_INTEGER_F) (STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Write_Sol_IFace_Integer(c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_write_sol_jface_integer_f, CG_IRIC_WRITE_SOL_JFACE_INTEGER_F) (STR_PSTR(name), int *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Write_Sol_JFace_Integer(c_name, data); +} + void IRICLIBDLL FMNAME(cg_iric_write_sol_real_f, CG_IRIC_WRITE_SOL_REAL_F) (STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { char c_name[CGIO_MAX_NAME_LENGTH+1]; string_2_C_string(STR_PTR(name), STR_LEN(name), @@ -2076,6 +2202,24 @@ void IRICLIBDLL FMNAME(cg_iric_write_sol_cell_real_f, CG_IRIC_WRITE_SOL_CELL_REA *ier = cg_iRIC_Write_Sol_Cell_Real(c_name, data); } +void IRICLIBDLL FMNAME(cg_iric_write_sol_iface_real_f, CG_IRIC_WRITE_SOL_IFACE_REAL_F) (STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Write_Sol_IFace_Real(c_name, data); +} + +void IRICLIBDLL FMNAME(cg_iric_write_sol_jface_real_f, CG_IRIC_WRITE_SOL_JFACE_REAL_F) (STR_PSTR(name), double *data, int *ier STR_PLEN(name)) { + char c_name[CGIO_MAX_NAME_LENGTH+1]; + string_2_C_string(STR_PTR(name), STR_LEN(name), + c_name, CGIO_MAX_NAME_LENGTH, ier); + if (*ier) return; + + *ier = cg_iRIC_Write_Sol_JFace_Real(c_name, data); +} + void IRICLIBDLL FMNAME(cg_iric_write_errorcode_f, CG_IRIC_WRITE_ERRORCODE_F) (int *errorcode, int *ier) { *ier = cg_iRIC_Write_ErrorCode(*errorcode); } diff --git a/iriclib.h b/iriclib.h index 5da43ce..025d175 100644 --- a/iriclib.h +++ b/iriclib.h @@ -580,12 +580,20 @@ int IRICLIBDLL cg_iRIC_Read_Sol_GridCoord3d(int step, double* x, double* y, doub int IRICLIBDLL cg_iRIC_Read_Sol_Integer(int step, const char *name, int* data); -int IRICLIBDLL cg_iRIC_Read_Sol_Real(int step, const char *name, double* data); - int IRICLIBDLL cg_iRIC_Read_Sol_Cell_Integer(int step, const char *name, int* data); +int IRICLIBDLL cg_iRIC_Read_Sol_IFace_Integer(int step, const char *name, int* data); + +int IRICLIBDLL cg_iRIC_Read_Sol_JFace_Integer(int step, const char *name, int* data); + +int IRICLIBDLL cg_iRIC_Read_Sol_Real(int step, const char *name, double* data); + int IRICLIBDLL cg_iRIC_Read_Sol_Cell_Real(int step, const char *name, double* data); +int IRICLIBDLL cg_iRIC_Read_Sol_IFace_Real(int step, const char *name, double* data); + +int IRICLIBDLL cg_iRIC_Read_Sol_JFace_Real(int step, const char *name, double* data); + int IRICLIBDLL cg_iRIC_Write_Sol_Time(double time); int IRICLIBDLL cg_iRIC_Write_Sol_Iteration(int index); diff --git a/iriclib_single.c b/iriclib_single.c index e1521c2..88b3e56 100644 --- a/iriclib_single.c +++ b/iriclib_single.c @@ -387,14 +387,24 @@ int cg_iRIC_Read_Sol_Integer(int step, const char* name, int* data) return cg_iRIC_Read_Sol_Integer_Mul(lastfileid, step, name, data); } -int cg_iRIC_Read_Sol_Real(int step, const char* name, double* data) +int cg_iRIC_Read_Sol_Cell_Integer(int step, const char* name, int* data) { - return cg_iRIC_Read_Sol_Real_Mul(lastfileid, step, name, data); + return cg_iRIC_Read_Sol_Cell_Integer_Mul(lastfileid, step, name, data); } -int cg_iRIC_Read_Sol_Cell_Integer(int step, const char* name, int* data) +int cg_iRIC_Read_Sol_IFace_Integer(int step, const char* name, int* data) { - return cg_iRIC_Read_Sol_Cell_Integer_Mul(lastfileid, step, name, data); + return cg_iRIC_Read_Sol_IFace_Integer_Mul(lastfileid, step, name, data); +} + +int cg_iRIC_Read_Sol_JFace_Integer(int step, const char* name, int* data) +{ + return cg_iRIC_Read_Sol_JFace_Integer_Mul(lastfileid, step, name, data); +} + +int cg_iRIC_Read_Sol_Real(int step, const char* name, double* data) +{ + return cg_iRIC_Read_Sol_Real_Mul(lastfileid, step, name, data); } int cg_iRIC_Read_Sol_Cell_Real(int step, const char* name, double* data) @@ -402,6 +412,16 @@ int cg_iRIC_Read_Sol_Cell_Real(int step, const char* name, double* data) return cg_iRIC_Read_Sol_Cell_Real_Mul(lastfileid, step, name, data); } +int cg_iRIC_Read_Sol_IFace_Real(int step, const char* name, double* data) +{ + return cg_iRIC_Read_Sol_IFace_Real_Mul(lastfileid, step, name, data); +} + +int cg_iRIC_Read_Sol_JFace_Real(int step, const char* name, double* data) +{ + return cg_iRIC_Read_Sol_JFace_Real_Mul(lastfileid, step, name, data); +} + int cg_iRIC_Write_Sol_Time(double time) { return cg_iRIC_Write_Sol_Time_Mul(lastfileid, time);