Skip to content
Snippets Groups Projects
Commit 583588cf authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 07/06/2018: lfi2cdf: added -V/--verbose option

parent 2ab38db0
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment