From 789e033f54ad52b6a7fab9726eeddf7b60a260fe Mon Sep 17 00:00:00 2001 From: "Benjamin T. Johnson" Date: Thu, 22 Jan 2026 17:20:50 -0500 Subject: [PATCH] first push to ensure netcdf defaults toward v3.2.0 --- .gitignore | 1 + src/CRTM_LifeCycle.f90 | 122 +++++++++++++----- src/Coefficients/ACCoeff/ACCoeff_IO.f90 | 30 ++--- .../AerosolCoeff/AerosolCoeff_IO.f90 | 12 +- src/Coefficients/CloudCoeff/CloudCoeff_IO.f90 | 12 +- .../EmisCoeff/IR_Snow/IRsnowCoeff_IO.f90 | 12 +- .../EmisCoeff/IR_Water/IRwaterCoeff_IO.f90 | 12 +- .../EmisCoeff/SEcategory/SEcategory_IO.f90 | 12 +- src/Coefficients/NLTECoeff/NLTECoeff_IO.f90 | 30 ++--- src/Coefficients/SpcCoeff/SpcCoeff_IO.f90 | 30 ++--- .../test_SpcCoeff/test_spc_io.f90 | 1 + 11 files changed, 170 insertions(+), 104 deletions(-) diff --git a/.gitignore b/.gitignore index 62f2735a..62ab614b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,6 @@ fix/ **/Build/ build.bash rebuild.bash +conductor/ .gitignore *~ diff --git a/src/CRTM_LifeCycle.f90 b/src/CRTM_LifeCycle.f90 index 15682c21..4fcc2036 100644 --- a/src/CRTM_LifeCycle.f90 +++ b/src/CRTM_LifeCycle.f90 @@ -35,6 +35,7 @@ MODULE CRTM_LifeCycle ! ----------------- ! Module usage USE Message_Handler + USE File_Utility, ONLY: File_Exists USE CRTM_ChannelInfo_Define, ONLY: CRTM_ChannelInfo_type, & CRTM_ChannelInfo_Associated, & CRTM_ChannelInfo_Destroy, & @@ -630,6 +631,7 @@ FUNCTION CRTM_Init( & CHARACTER(SL) :: Default_VISsnowCoeff_Format CHARACTER(SL) :: Default_VISiceCoeff_Format CHARACTER(SL) :: Default_File_Path + CHARACTER(SL) :: fname_nc, fname_bin INTEGER :: l, n, n_Sensors @@ -680,33 +682,33 @@ FUNCTION CRTM_Init( & Default_File_Path = '' ! ...Default filenames Default_Aerosol_Model = 'CRTM' - Default_AerosolCoeff_File = 'AerosolCoeff.bin' + Default_AerosolCoeff_File = 'AerosolCoeff.nc4' Default_Cloud_Model = 'CRTM' - Default_CloudCoeff_File = 'CloudCoeff.bin' - Default_IRwaterCoeff_File = 'Nalli.IRwater.EmisCoeff.bin' - Default_IRlandCoeff_File = 'NPOESS.IRland.EmisCoeff.bin' + Default_CloudCoeff_File = 'CloudCoeff.nc4' + Default_IRwaterCoeff_File = 'Nalli.IRwater.EmisCoeff.nc4' + Default_IRlandCoeff_File = 'NPOESS.IRland.EmisCoeff.nc4' Default_IRsnow_Model = 'SEcategory' - Default_IRsnowCoeff_File = 'NPOESS.IRsnow.EmisCoeff.bin' - Default_IRiceCoeff_File = 'NPOESS.IRice.EmisCoeff.bin' - Default_VISwaterCoeff_File = 'NPOESS.VISwater.EmisCoeff.bin' - Default_VISlandCoeff_File = 'NPOESS.VISland.EmisCoeff.bin' - Default_VISsnowCoeff_File = 'NPOESS.VISsnow.EmisCoeff.bin' - Default_VISiceCoeff_File = 'NPOESS.VISice.EmisCoeff.bin' + Default_IRsnowCoeff_File = 'NPOESS.IRsnow.EmisCoeff.nc4' + Default_IRiceCoeff_File = 'NPOESS.IRice.EmisCoeff.nc4' + Default_VISwaterCoeff_File = 'NPOESS.VISwater.EmisCoeff.nc4' + Default_VISlandCoeff_File = 'NPOESS.VISland.EmisCoeff.nc4' + Default_VISsnowCoeff_File = 'NPOESS.VISsnow.EmisCoeff.nc4' + Default_VISiceCoeff_File = 'NPOESS.VISice.EmisCoeff.nc4' Default_MWwaterCoeff_File = 'FASTEM6.MWwater.EmisCoeff.bin' Default_MWwaterCoeff_Scheme = 'FASTEM6' ! ... Default file formats - Default_AerosolCoeff_Format = 'Binary' - Default_CloudCoeff_Format = 'Binary' - Default_SpcCoeff_Format = 'Binary' - Default_TauCoeff_Format = 'Binary' - Default_IRwaterCoeff_Format = 'Binary' - Default_IRlandCoeff_Format = 'Binary' - Default_IRsnowCoeff_Format = 'Binary' - Default_IRiceCoeff_Format = 'Binary' - Default_VISwaterCoeff_Format= 'Binary' - Default_VISlandCoeff_Format = 'Binary' - Default_VISsnowCoeff_Format = 'Binary' - Default_VISiceCoeff_Format = 'Binary' + Default_AerosolCoeff_Format = 'netCDF' + Default_CloudCoeff_Format = 'netCDF' + Default_SpcCoeff_Format = 'netCDF' + Default_TauCoeff_Format = 'netCDF' + Default_IRwaterCoeff_Format = 'netCDF' + Default_IRlandCoeff_Format = 'netCDF' + Default_IRsnowCoeff_Format = 'netCDF' + Default_IRiceCoeff_Format = 'netCDF' + Default_VISwaterCoeff_Format= 'netCDF' + Default_VISlandCoeff_Format = 'netCDF' + Default_VISsnowCoeff_Format = 'netCDF' + Default_VISiceCoeff_Format = 'netCDF' ! ...Were coefficient models specified? IF ( PRESENT(Aerosol_Model ) ) Default_Aerosol_Model = TRIM(ADJUSTL(Aerosol_Model)) IF ( PRESENT(Cloud_Model ) ) Default_Cloud_Model = TRIM(ADJUSTL(Cloud_Model)) @@ -744,6 +746,40 @@ FUNCTION CRTM_Init( & Default_MWwaterCoeff_File = TRIM(ADJUSTL(File_Path)) // TRIM(Default_MWwaterCoeff_File) END IF + ! Smart detect SpcCoeff format if not specified + IF ( .NOT. PRESENT(SpcCoeff_Format) .AND. SIZE(Sensor_ID) > 0 ) THEN + fname_nc = TRIM(ADJUSTL(Sensor_ID(1))) // '.SpcCoeff.nc' + fname_bin = TRIM(ADJUSTL(Sensor_ID(1))) // '.SpcCoeff.bin' + IF ( PRESENT(File_Path) ) THEN + IF ( LEN_TRIM(File_Path) > 0 ) THEN + fname_nc = TRIM(File_Path) // fname_nc + fname_bin = TRIM(File_Path) // fname_bin + END IF + END IF + IF ( File_Exists(fname_nc) ) THEN + Default_SpcCoeff_Format = 'netCDF' + ELSE IF ( File_Exists(fname_bin) ) THEN + Default_SpcCoeff_Format = 'Binary' + END IF + END IF + + ! Smart detect TauCoeff format if not specified + IF ( .NOT. PRESENT(TauCoeff_Format) .AND. SIZE(Sensor_ID) > 0 ) THEN + fname_nc = TRIM(ADJUSTL(Sensor_ID(1))) // '.TauCoeff.nc' + fname_bin = TRIM(ADJUSTL(Sensor_ID(1))) // '.TauCoeff.bin' + IF ( PRESENT(File_Path) ) THEN + IF ( LEN_TRIM(File_Path) > 0 ) THEN + fname_nc = TRIM(File_Path) // fname_nc + fname_bin = TRIM(File_Path) // fname_bin + END IF + END IF + IF ( File_Exists(fname_nc) ) THEN + Default_TauCoeff_Format = 'netCDF' + ELSE IF ( File_Exists(fname_bin) ) THEN + Default_TauCoeff_Format = 'Binary' + END IF + END IF + ! Load the spectral coefficients netCDF = .FALSE. IF (Default_SpcCoeff_Format == 'netCDF' ) THEN @@ -790,7 +826,11 @@ FUNCTION CRTM_Init( & IF ( Local_Load_CloudCoeff ) THEN IF ( Default_CloudCoeff_Format == 'netCDF' ) THEN netCDF = .TRUE. - IF ( PRESENT(NC_File_Path) ) Default_File_Path = NC_File_Path + IF ( PRESENT(NC_File_Path) ) THEN + Default_File_Path = NC_File_Path + ELSEIF ( PRESENT(File_Path) ) THEN + Default_File_Path = File_Path + END IF ELSE netCDF = .FALSE. IF ( PRESENT(File_Path) ) Default_File_Path = File_Path @@ -819,7 +859,11 @@ FUNCTION CRTM_Init( & IF ( Local_Load_AerosolCoeff ) THEN IF ( Default_AerosolCoeff_Format == 'netCDF' ) THEN netCDF = .TRUE. - IF ( PRESENT(NC_File_Path) ) Default_File_Path = NC_File_Path + IF ( PRESENT(NC_File_Path) ) THEN + Default_File_Path = NC_File_Path + ELSEIF ( PRESENT(File_Path) ) THEN + Default_File_Path = File_Path + END IF ELSE netCDF = .FALSE. IF ( PRESENT(File_Path) ) Default_File_Path = File_Path @@ -849,7 +893,11 @@ FUNCTION CRTM_Init( & ! ...IR land IF ( Default_IRlandCoeff_Format == 'netCDF' ) THEN netCDF = .TRUE. - IF ( PRESENT(NC_File_Path) ) Default_File_Path = NC_File_Path + IF ( PRESENT(NC_File_Path) ) THEN + Default_File_Path = NC_File_Path + ELSEIF ( PRESENT(File_Path) ) THEN + Default_File_Path = File_Path + END IF ELSE netCDF = .FALSE. IF ( PRESENT(File_Path) ) Default_File_Path = File_Path @@ -872,7 +920,11 @@ FUNCTION CRTM_Init( & ! ...IR Water IF ( Default_IRwaterCoeff_Format == 'netCDF' ) THEN netCDF = .TRUE. - IF ( PRESENT(NC_File_Path) ) Default_File_Path = NC_File_Path + IF ( PRESENT(NC_File_Path) ) THEN + Default_File_Path = NC_File_Path + ELSEIF ( PRESENT(File_Path) ) THEN + Default_File_Path = File_Path + END IF ELSE netCDF = .FALSE. IF ( PRESENT(File_Path) ) Default_File_Path = File_Path @@ -895,7 +947,11 @@ FUNCTION CRTM_Init( & ! ...IR snow IF ( Default_IRsnowCoeff_Format == 'netCDF' ) THEN netCDF = .TRUE. - IF ( PRESENT(NC_File_Path) ) Default_File_Path = NC_File_Path + IF ( PRESENT(NC_File_Path) ) THEN + Default_File_Path = NC_File_Path + ELSEIF ( PRESENT(File_Path) ) THEN + Default_File_Path = File_Path + END IF ELSE netCDF = .FALSE. IF ( PRESENT(File_Path) ) Default_File_Path = File_Path @@ -924,7 +980,11 @@ FUNCTION CRTM_Init( & ! ...IR ice IF ( Default_IRiceCoeff_Format == 'netCDF' ) THEN netCDF = .TRUE. - IF ( PRESENT(NC_File_Path) ) Default_File_Path = NC_File_Path + IF ( PRESENT(NC_File_Path) ) THEN + Default_File_Path = NC_File_Path + ELSEIF ( PRESENT(File_Path) ) THEN + Default_File_Path = File_Path + END IF ELSE netCDF = .FALSE. IF ( PRESENT(File_Path) ) Default_File_Path = File_Path @@ -951,7 +1011,11 @@ FUNCTION CRTM_Init( & ! ...VIS land IF ( Default_VISlandCoeff_Format == 'netCDF' ) THEN netCDF = .TRUE. - IF ( PRESENT(NC_File_Path) ) Default_File_Path = NC_File_Path + IF ( PRESENT(NC_File_Path) ) THEN + Default_File_Path = NC_File_Path + ELSEIF ( PRESENT(File_Path) ) THEN + Default_File_Path = File_Path + END IF ELSE netCDF = .FALSE. IF ( PRESENT(File_Path) ) Default_File_Path = File_Path diff --git a/src/Coefficients/ACCoeff/ACCoeff_IO.f90 b/src/Coefficients/ACCoeff/ACCoeff_IO.f90 index c8e47a1d..c77f7b4b 100644 --- a/src/Coefficients/ACCoeff/ACCoeff_IO.f90 +++ b/src/Coefficients/ACCoeff/ACCoeff_IO.f90 @@ -94,9 +94,9 @@ MODULE ACCoeff_IO ! OPTIONAL INPUTS: ! netCDF: Set this logical argument to access netCDF format ! ACCoeff datafiles. -! If == .FALSE., file format is BINARY [DEFAULT]. -! == .TRUE., file format is NETCDF. -! If not specified, default is .FALSE. +! If == .FALSE., file format is BINARY. +! == .TRUE., file format is NETCDF [DEFAULT]. +! If not specified, default is .TRUE. ! UNITS: N/A ! TYPE: LOGICAL ! DIMENSION: Scalar @@ -213,17 +213,17 @@ FUNCTION ACCoeff_InquireFile( & ! Function result INTEGER :: err_stat ! Function variables - LOGICAL :: binary + LOGICAL :: Binary ! Set up err_stat = SUCCESS ! ...Check netCDF argument - binary = .TRUE. - IF ( PRESENT(netCDF) ) binary = .NOT. netCDF + Binary = .FALSE. + IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function - IF ( binary ) THEN + IF ( Binary ) THEN err_stat = ACCoeff_Binary_InquireFile( & Filename, & n_FOVs = n_FOVs , & @@ -367,16 +367,16 @@ FUNCTION ACCoeff_ReadFile( & ! Function result INTEGER :: err_stat ! Function variables - LOGICAL :: binary + LOGICAL :: Binary ! Set up err_stat = SUCCESS ! ...Check netCDF argument - binary = .TRUE. - IF ( PRESENT(netCDF) ) binary = .NOT. netCDF + Binary = .FALSE. + IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function - IF ( binary ) THEN + IF ( Binary ) THEN err_stat = ACCoeff_Binary_ReadFile( & Filename, & ACCoeff , & @@ -508,16 +508,16 @@ FUNCTION ACCoeff_WriteFile( & ! Function result INTEGER :: err_stat ! Local variables - LOGICAL :: binary + LOGICAL :: Binary ! Set up err_stat = SUCCESS ! ...Check netCDF argument - binary = .TRUE. - IF ( PRESENT(netCDF) ) binary = .NOT. netCDF + Binary = .FALSE. + IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function - IF ( binary ) THEN + IF ( Binary ) THEN err_stat = ACCoeff_Binary_WriteFile( & Filename, & ACCoeff , & diff --git a/src/Coefficients/AerosolCoeff/AerosolCoeff_IO.f90 b/src/Coefficients/AerosolCoeff/AerosolCoeff_IO.f90 index 11ab2760..7cb806b4 100644 --- a/src/Coefficients/AerosolCoeff/AerosolCoeff_IO.f90 +++ b/src/Coefficients/AerosolCoeff/AerosolCoeff_IO.f90 @@ -103,9 +103,9 @@ MODULE AerosolCoeff_IO ! OPTIONAL INPUTS: ! netCDF: Set this logical argument to access netCDF format ! AerosolCoeff datafiles. -! If == .FALSE., file format is BINARY [DEFAULT]. -! == .TRUE., file format is NETCDF. -! If not specified, default is .FALSE. +! If == .FALSE., file format is BINARY. +! == .TRUE., file format is NETCDF [DEFAULT]. +! If not specified, default is .TRUE. ! UNITS: N/A ! TYPE: LOGICAL ! DIMENSION: Scalar @@ -255,7 +255,7 @@ FUNCTION AerosolCoeff_InquireFile( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF @@ -430,7 +430,7 @@ FUNCTION AerosolCoeff_ReadFile( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function @@ -586,7 +586,7 @@ FUNCTION AerosolCoeff_WriteFile( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function diff --git a/src/Coefficients/CloudCoeff/CloudCoeff_IO.f90 b/src/Coefficients/CloudCoeff/CloudCoeff_IO.f90 index ac31429b..4a028574 100644 --- a/src/Coefficients/CloudCoeff/CloudCoeff_IO.f90 +++ b/src/Coefficients/CloudCoeff/CloudCoeff_IO.f90 @@ -99,9 +99,9 @@ MODULE CloudCoeff_IO ! OPTIONAL INPUTS: ! netCDF: Set this logical argument to access netCDF format ! CloudCoeff datafiles. -! If == .FALSE., file format is BINARY [DEFAULT]. -! == .TRUE., file format is NETCDF. -! If not specified, default is .FALSE. +! If == .FALSE., file format is BINARY. +! == .TRUE., file format is NETCDF [DEFAULT]. +! If not specified, default is .TRUE. ! UNITS: N/A ! TYPE: LOGICAL ! DIMENSION: Scalar @@ -262,7 +262,7 @@ FUNCTION CloudCoeff_InquireFile( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF @@ -423,7 +423,7 @@ FUNCTION CloudCoeff_ReadFile( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function @@ -563,7 +563,7 @@ FUNCTION CloudCoeff_WriteFile( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function diff --git a/src/Coefficients/EmisCoeff/IR_Snow/IRsnowCoeff_IO.f90 b/src/Coefficients/EmisCoeff/IR_Snow/IRsnowCoeff_IO.f90 index 9e0b515b..28b5ac71 100644 --- a/src/Coefficients/EmisCoeff/IR_Snow/IRsnowCoeff_IO.f90 +++ b/src/Coefficients/EmisCoeff/IR_Snow/IRsnowCoeff_IO.f90 @@ -84,9 +84,9 @@ MODULE IRsnowCoeff_IO ! OPTIONAL INPUTS: ! netCDF: Set this logical argument to access netCDF format ! IRsnowCoeff datafiles. -! If == .FALSE., file format is BINARY [DEFAULT]. -! == .TRUE., file format is NETCDF. -! If not specified, default is .FALSE. +! If == .FALSE., file format is BINARY. +! == .TRUE., file format is NETCDF [DEFAULT]. +! If not specified, default is .TRUE. ! UNITS: N/A ! TYPE: LOGICAL ! DIMENSION: Scalar @@ -203,7 +203,7 @@ FUNCTION IRsnowCoeff_InquireFile( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF @@ -355,7 +355,7 @@ FUNCTION IRsnowCoeff_ReadFile( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function @@ -511,7 +511,7 @@ FUNCTION IRsnowCoeff_WriteFile( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function diff --git a/src/Coefficients/EmisCoeff/IR_Water/IRwaterCoeff_IO.f90 b/src/Coefficients/EmisCoeff/IR_Water/IRwaterCoeff_IO.f90 index 55c8dfe4..f052c178 100644 --- a/src/Coefficients/EmisCoeff/IR_Water/IRwaterCoeff_IO.f90 +++ b/src/Coefficients/EmisCoeff/IR_Water/IRwaterCoeff_IO.f90 @@ -86,9 +86,9 @@ MODULE IRwaterCoeff_IO ! OPTIONAL INPUTS: ! netCDF: Set this logical argument to access netCDF format ! IRwaterCoeff datafiles. -! If == .FALSE., file format is BINARY [DEFAULT]. -! == .TRUE., file format is NETCDF. -! If not specified, default is .FALSE. +! If == .FALSE., file format is BINARY. +! == .TRUE., file format is NETCDF [DEFAULT]. +! If not specified, default is .TRUE. ! UNITS: N/A ! TYPE: LOGICAL ! DIMENSION: Scalar @@ -205,7 +205,7 @@ FUNCTION IRwaterCoeff_InquireFile_IO( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF @@ -357,7 +357,7 @@ FUNCTION IRwaterCoeff_ReadFile_IO( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF !Call the appropriate function @@ -513,7 +513,7 @@ FUNCTION IRwaterCoeff_WriteFile_IO( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function diff --git a/src/Coefficients/EmisCoeff/SEcategory/SEcategory_IO.f90 b/src/Coefficients/EmisCoeff/SEcategory/SEcategory_IO.f90 index 6cdd28c0..f73dec9f 100644 --- a/src/Coefficients/EmisCoeff/SEcategory/SEcategory_IO.f90 +++ b/src/Coefficients/EmisCoeff/SEcategory/SEcategory_IO.f90 @@ -81,9 +81,9 @@ MODULE SEcategory_IO ! OPTIONAL INPUTS: ! netCDF: Set this logical argument to access netCDF format ! SEcategory datafiles. -! If == .FALSE., file format is BINARY [DEFAULT]. -! == .TRUE., file format is NETCDF. -! If not specified, default is .FALSE. +! If == .FALSE., file format is BINARY. +! == .TRUE., file format is NETCDF [DEFAULT]. +! If not specified, default is .TRUE. ! UNITS: N/A ! TYPE: LOGICAL ! DIMENSION: Scalar @@ -183,7 +183,7 @@ FUNCTION SEcategory_InquireFile_IO( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF @@ -331,7 +331,7 @@ FUNCTION SEcategory_ReadFile_IO( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF !Call the appropriate function @@ -486,7 +486,7 @@ FUNCTION SEcategory_WriteFile_IO( & ! Set up err_stat = SUCCESS ! ...Check netCDF argument - Binary = .TRUE. + Binary = .FALSE. IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function diff --git a/src/Coefficients/NLTECoeff/NLTECoeff_IO.f90 b/src/Coefficients/NLTECoeff/NLTECoeff_IO.f90 index 8e579a55..0bd69dca 100644 --- a/src/Coefficients/NLTECoeff/NLTECoeff_IO.f90 +++ b/src/Coefficients/NLTECoeff/NLTECoeff_IO.f90 @@ -99,9 +99,9 @@ MODULE NLTECoeff_IO ! OPTIONAL INPUTS: ! netCDF: Set this logical argument to access netCDF format ! NLTECoeff datafiles. -! If == .FALSE., file format is BINARY [DEFAULT]. -! == .TRUE., file format is NETCDF. -! If not specified, default is .FALSE. +! If == .FALSE., file format is BINARY. +! == .TRUE., file format is NETCDF [DEFAULT]. +! If not specified, default is .TRUE. ! UNITS: N/A ! TYPE: LOGICAL ! DIMENSION: Scalar @@ -243,17 +243,17 @@ FUNCTION NLTECoeff_InquireFile( & ! Function result INTEGER :: err_stat ! Function variables - LOGICAL :: binary + LOGICAL :: Binary ! Set up err_stat = SUCCESS ! ...Check netCDF argument - binary = .TRUE. - IF ( PRESENT(netCDF) ) binary = .NOT. netCDF + Binary = .FALSE. + IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function - IF ( binary ) THEN + IF ( Binary ) THEN err_stat = NLTECoeff_Binary_InquireFile( & Filename, & n_Predictors = n_Predictors , & @@ -403,16 +403,16 @@ FUNCTION NLTECoeff_ReadFile( & ! Function result INTEGER :: err_stat ! Function variables - LOGICAL :: binary + LOGICAL :: Binary ! Set up err_stat = SUCCESS ! ...Check netCDF argument - binary = .TRUE. - IF ( PRESENT(netCDF) ) binary = .NOT. netCDF + Binary = .FALSE. + IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function - IF ( binary ) THEN + IF ( Binary ) THEN err_stat = NLTECoeff_Binary_ReadFile( & Filename , & NLTECoeff, & @@ -544,16 +544,16 @@ FUNCTION NLTECoeff_WriteFile( & ! Function result INTEGER :: err_stat ! Local variables - LOGICAL :: binary + LOGICAL :: Binary ! Set up err_stat = SUCCESS ! ...Check netCDF argument - binary = .TRUE. - IF ( PRESENT(netCDF) ) binary = .NOT. netCDF + Binary = .FALSE. + IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function - IF ( binary ) THEN + IF ( Binary ) THEN err_stat = NLTECoeff_Binary_WriteFile( & Filename , & NLTECoeff, & diff --git a/src/Coefficients/SpcCoeff/SpcCoeff_IO.f90 b/src/Coefficients/SpcCoeff/SpcCoeff_IO.f90 index ead7e498..ce5846aa 100644 --- a/src/Coefficients/SpcCoeff/SpcCoeff_IO.f90 +++ b/src/Coefficients/SpcCoeff/SpcCoeff_IO.f90 @@ -97,9 +97,9 @@ MODULE SpcCoeff_IO ! OPTIONAL INPUTS: ! netCDF: Set this logical argument to access netCDF format ! SpcCoeff datafiles. -! If == .FALSE., file format is BINARY [DEFAULT]. -! == .TRUE., file format is NETCDF. -! If not specified, default is .FALSE. +! If == .FALSE., file format is BINARY. +! == .TRUE., file format is NETCDF [DEFAULT]. +! If not specified, default is .TRUE. ! UNITS: N/A ! TYPE: LOGICAL ! DIMENSION: Scalar @@ -208,17 +208,17 @@ FUNCTION SpcCoeff_InquireFile( & ! Function result INTEGER :: err_stat ! Function variables - LOGICAL :: binary + LOGICAL :: Binary ! Set up err_stat = SUCCESS ! ...Check netCDF argument - binary = .TRUE. - IF ( PRESENT(netCDF) ) binary = .NOT. netCDF + Binary = .FALSE. + IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function - IF ( binary ) THEN + IF ( Binary ) THEN err_stat = SpcCoeff_Binary_InquireFile( & Filename, & n_Channels = n_Channels , & @@ -360,16 +360,16 @@ FUNCTION SpcCoeff_ReadFile( & ! Function result INTEGER :: err_stat ! Function variables - LOGICAL :: binary + LOGICAL :: Binary ! Set up err_stat = SUCCESS ! ...Check netCDF argument - binary = .TRUE. - IF ( PRESENT(netCDF) ) binary = .NOT. netCDF + Binary = .FALSE. + IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function - IF ( binary ) THEN + IF ( Binary ) THEN err_stat = SpcCoeff_Binary_ReadFile( & Filename, & SpcCoeff, & @@ -501,16 +501,16 @@ FUNCTION SpcCoeff_WriteFile( & ! Function result INTEGER :: err_stat ! Local variables - LOGICAL :: binary + LOGICAL :: Binary ! Set up err_stat = SUCCESS ! ...Check netCDF argument - binary = .TRUE. - IF ( PRESENT(netCDF) ) binary = .NOT. netCDF + Binary = .FALSE. + IF ( PRESENT(netCDF) ) Binary = .NOT. netCDF ! Call the appropriate function - IF ( binary ) THEN + IF ( Binary ) THEN err_stat = SpcCoeff_Binary_WriteFile( & Filename, & SpcCoeff, & diff --git a/test/mains/unit/input_output/test_SpcCoeff/test_spc_io.f90 b/test/mains/unit/input_output/test_SpcCoeff/test_spc_io.f90 index af823477..2ca0fa09 100644 --- a/test/mains/unit/input_output/test_SpcCoeff/test_spc_io.f90 +++ b/test/mains/unit/input_output/test_SpcCoeff/test_spc_io.f90 @@ -58,6 +58,7 @@ PROGRAM test_spc_io err_stat = CRTM_SpcCoeff_Load( & Sensor_ID = Sensor_ID , & File_Path = File_Path , & + netCDF = .FALSE. , & Quiet = Quiet ) CALL UnitTest_Assert(ioTest, (err_stat==SUCCESS) ) testPassed = UnitTest_Passed(ioTest)