diff --git a/LIBTOOLS/tools/lfi2cdf/src/lfi2cdf.f90 b/LIBTOOLS/tools/lfi2cdf/src/lfi2cdf.f90 index 38125a23e4125f1a8c89780c404ebb46373053dc..cf047fba4d9a0542d1af9c6eb744bde637a1616c 100644 --- a/LIBTOOLS/tools/lfi2cdf/src/lfi2cdf.f90 +++ b/LIBTOOLS/tools/lfi2cdf/src/lfi2cdf.f90 @@ -58,6 +58,11 @@ program LFI2CDF call read_commandline(options,hinfile,houtfile,runmode) + if (options(OPTVERBOSE)%set) then + NIO_VERB = NVERB_DEBUG + NGEN_VERB = NVERB_DEBUG + end if + IF (options(OPTMERGE)%set) THEN NB_PROCIO_R = options(OPTMERGE)%ivalue ELSE diff --git a/LIBTOOLS/tools/lfi2cdf/src/mode_options.f90 b/LIBTOOLS/tools/lfi2cdf/src/mode_options.f90 index 709a8726607baa869440e81adcadc9358d55fbc7..bc087c5c298f6ce59c408c3c1776b537ba74fb3e 100644 --- a/LIBTOOLS/tools/lfi2cdf/src/mode_options.f90 +++ b/LIBTOOLS/tools/lfi2cdf/src/mode_options.f90 @@ -8,12 +8,13 @@ module mode_options implicit none - integer,parameter :: nbavailoptions = 9 + integer,parameter :: nbavailoptions = 10 integer,parameter :: MODEUNDEF = -11, MODECDF2CDF = 11, MODELFI2CDF = 12, MODECDF2LFI = 13 integer,parameter :: OPTCOMPRESS = 1, OPTHELP = 2, OPTLIST = 3 integer,parameter :: OPTMERGE = 4, OPTOUTPUT = 5, OPTREDUCE = 6 - integer,parameter :: OPTSPLIT = 7, OPTVAR = 8, OPTMODE = 9 + integer,parameter :: OPTMODE = 7, OPTSPLIT = 8, OPTVAR = 9 + integer,parameter :: OPTVERBOSE = 10 type option logical :: set = .false. @@ -135,6 +136,11 @@ subroutine init_options(options) options(OPTREDUCE)%short_name = 'r' options(OPTREDUCE)%has_argument = .false. + options(OPTMODE)%long_name = "runmode" + options(OPTMODE)%short_name = 'R' + options(OPTMODE)%has_argument = .true. + options(OPTMODE)%type = TYPECHAR + options(OPTSPLIT)%long_name = "split" options(OPTSPLIT)%short_name = 's' options(OPTSPLIT)%has_argument = .false. @@ -144,11 +150,9 @@ subroutine init_options(options) options(OPTVAR)%has_argument = .true. options(OPTVAR)%type = TYPECHAR - options(OPTMODE)%long_name = "runmode" - options(OPTMODE)%short_name = 'R' - options(OPTMODE)%has_argument = .true. - options(OPTMODE)%type = TYPECHAR - + options(OPTVERBOSE)%long_name = "verbose" + options(OPTVERBOSE)%short_name = 'V' + options(OPTVERBOSE)%has_argument = .false. end subroutine init_options subroutine get_option(options,finished) @@ -325,13 +329,13 @@ subroutine help() !TODO: -l option for cdf2cdf and cdf2lfi print *,"Usage : lfi2cdf [-h --help] [-l] [-v --var var1[,...]] [-r --reduce-precision]" print *," [-m --merge number_of_z_levels] [-s --split] [-o --output output-file.nc]" - print *," [-R --runmode mode]" + print *," [-R --runmode mode] [-V --verbose]" print *," [-c --compress compression_level] input-file.lfi" print *," cdf2cdf [-h --help] [-v --var var1[,...]] [-r --reduce-precision]" print *," [-m --merge number_of_split_files] [-s --split] [-o --output output-file.nc]" - print *," [-R --runmode mode]" + print *," [-R --runmode mode] [-V --verbose]" print *," [-c --compress compression_level] input-file.nc" - print *," cdf2lfi [-o --output output-file.lfi] [-R --runmode mode] input-file.nc" + print *," cdf2lfi [-o --output output-file.lfi] [-R --runmode mode] [-V --verbose] input-file.nc" print *,"" print *,"Options:" print *," --compress, -c compression_level" @@ -355,6 +359,8 @@ subroutine help() print *," List of the variable to write in the output file. Variables names have to be separated by commas (,)." print *," A variable can be computed from the sum of existing variables (format: new_var=var1+var2[+...])" print *," (cdf2cdf and lfi2cdf only)" + print *," --verbose, -V" + print *," Be verbose (for debugging purpose)" print *,"" stop diff --git a/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90 b/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90 index 3f0c42c8bbe8b0796502e234e72f4418bea678b9..ef577be080a8c4e5e459476cfda1d772a01d6499 100644 --- a/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90 +++ b/LIBTOOLS/tools/lfi2cdf/src/mode_util.f90 @@ -89,6 +89,8 @@ CONTAINS LOGICAL :: GOK TYPE(TLFIDATE),DIMENSION(MAXDATES) :: TLFIDATES + CALL PRINT_MSG(NVERB_DEBUG,'IO','parse_infiles','called') + IF (options(OPTSPLIT)%set) THEN idx_out = 0 ELSE @@ -626,6 +628,8 @@ END DO INTEGER(KIND=IDCDF_KIND) :: kcdf_id + CALL PRINT_MSG(NVERB_DEBUG,'IO','def_ncdf','called') + DO ji = 1,KNFILES_OUT kcdf_id = outfiles(ji)%TFILE%NNCID @@ -665,6 +669,8 @@ END DO TYPE(DATE_TIME) :: TZDATE + CALL PRINT_MSG(NVERB_DEBUG,'IO','fill_files','called') + idx = 1 DO ji=1,knaf IF (.NOT.tpreclist(ji)%tbw) CYCLE @@ -908,6 +914,8 @@ END DO INTEGER(KIND=LFI_INT) :: ilu,iresp + CALL PRINT_MSG(NVERB_DEBUG,'IO','OPEN_FILES','called') + KNFILES_OUT = 0 ! ! Infiles @@ -1056,6 +1064,8 @@ END DO INTEGER(KIND=IDCDF_KIND) :: status INTEGER(KIND=IDCDF_KIND) :: omode + CALL PRINT_MSG(NVERB_DEBUG,'IO','OPEN_SPLIT_NCFILES_OUT','called') + KNFILES_OUT = nbvar YLIST = TRIM(options(OPTVAR)%cvalue) @@ -1110,6 +1120,8 @@ END DO INTEGER :: ji + CALL PRINT_MSG(NVERB_DEBUG,'IO','CLOSE_FILES','called') + DO ji=1,KNFILES IF (filelist(ji)%TFILE%LOPENED) CALL IO_FILE_CLOSE_ll(filelist(ji)%TFILE,HPROGRAM_ORIG=CPROGRAM_ORIG) END DO @@ -1130,6 +1142,8 @@ END DO INTEGER(KIND=IDCDF_KIND) :: ISTATUS INTEGER(KIND=IDCDF_KIND),DIMENSION(NF90_MAX_VAR_DIMS) :: IDIMS_ID + CALL PRINT_MSG(NVERB_DEBUG,'IO','IO_GET_METADATA_NC4','called') + ISTATUS = NF90_INQUIRE_VARIABLE(KFILE_ID,KVAR_ID,NDIMS = TPREC%NDIMS_FILE, & XTYPE = TPREC%NTYPE_FILE, DIMIDS = IDIMS_ID) IF (ISTATUS /= NF90_NOERR) CALL HANDLE_ERR(ISTATUS,__LINE__) @@ -1204,6 +1218,8 @@ END DO INTEGER :: JJ TYPE(DIMCDF),POINTER :: TZDIMPTR + CALL PRINT_MSG(NVERB_DEBUG,'IO','IO_FILL_DIMS_NC4','called') + KRESP = 0 ALLOCATE(TPREC%TDIMS(TPREC%TFIELD%NDIMS))