diff --git a/LIBTOOLS/tools/lfi2cdf/src/lfi2cdf.f90 b/LIBTOOLS/tools/lfi2cdf/src/lfi2cdf.f90 index 1068048830601efb23f77363874bc2d493a6f58f..bfaaa85123b4371e03d4ac2929b6020c27f5ba4e 100644 --- a/LIBTOOLS/tools/lfi2cdf/src/lfi2cdf.f90 +++ b/LIBTOOLS/tools/lfi2cdf/src/lfi2cdf.f90 @@ -17,6 +17,7 @@ program LFI2CDF use mode_field, only: Ini_field_list USE MODE_IO, ONLY: IO_Init, IO_Config_set use mode_ll + use mode_modeln_handler, only: Goto_model USE mode_options USE MODE_SPLITTINGZ_ll, ONLY: INI_PARAZ_ll USE mode_util @@ -48,6 +49,8 @@ program LFI2CDF CPROGRAM = 'LFICDF' + CALL Goto_model(1) + CALL IO_Init() CALL VERSION CALL INI_CST diff --git a/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90 b/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90 index d60a7fc7915b113d992c374768bf389b3c719d82..7c4b22d80ad6807f0c09bdcb67bba4cadd547c4a 100644 --- a/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90 +++ b/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90 @@ -1375,6 +1375,7 @@ END DO INTEGER(KIND=CDFINT) :: IVAR_ID INTEGER(KIND=CDFINT),DIMENSION(NF90_MAX_VAR_DIMS) :: IDIMS_ID LOGICAL :: GSPLIT_AT_ENTRY + LOGICAL :: GSPLIT_INFO_AVAILABLE CALL PRINT_MSG(NVERB_DEBUG,'IO','IO_Metadata_get_nc4','called') @@ -1390,8 +1391,11 @@ END DO if ( istatus /= NF90_NOERR ) call IO_Err_handle_nc4( istatus, 'IO_Metadata_get_nc4', 'NF90_INQUIRE_VARIABLE', '' ) !split_variable and other attributes were added in MesoNH > 5.4.2 + GSPLIT_INFO_AVAILABLE = .FALSE. ISTATUS = NF90_INQUIRE_ATTRIBUTE(IFILE_ID, KVAR_ID, 'split_variable', LEN=ILENG) IF (ISTATUS == NF90_NOERR) THEN + GSPLIT_INFO_AVAILABLE = .TRUE. + IF (GSPLIT_AT_ENTRY) CALL PRINT_MSG(NVERB_ERROR,'IO','IO_Metadata_get_nc4','split variable delcaration inside a split file') ALLOCATE(CHARACTER(LEN=ILENG) :: YSPLIT) @@ -1552,8 +1556,15 @@ END DO END IF IF (TPREC%LSPLIT) THEN +#if 0 IF( (.NOT.TPREC%TFIELD%LTIMEDEP .AND. TPREC%NDIMS_FILE/=2) & .OR. ( TPREC%TFIELD%LTIMEDEP .AND. TPREC%NDIMS_FILE/=3) ) & +#else + IF( ( GSPLIT_INFO_AVAILABLE .AND. TPREC%NDIMS_FILE/=3 ) & + .OR. ( .NOT.GSPLIT_INFO_AVAILABLE .AND. & + ( (.NOT.TPREC%TFIELD%LTIMEDEP .AND. TPREC%NDIMS_FILE/=2) & + .OR. ( TPREC%TFIELD%LTIMEDEP .AND. TPREC%NDIMS_FILE/=3) ) ) ) & +#endif CALL PRINT_MSG(NVERB_FATAL,'IO','IO_Metadata_get_nc4',trim(TPREC%NAME)//': split variables can only be 3D') !Split variables are Z-split !Move time dimension to last (4th) position