diff --git a/src/LIB/SURCOUCHE/src/mode_io.f90 b/src/LIB/SURCOUCHE/src/mode_io.f90 index 110b48cd84be954702ab8202fc0d5634ea8119ca..79ea2978f7f8398066f17ebb13d8d428419fedae 100644 --- a/src/LIB/SURCOUCHE/src/mode_io.f90 +++ b/src/LIB/SURCOUCHE/src/mode_io.f90 @@ -119,44 +119,40 @@ CONTAINS END FUNCTION UPCASE - SUBROUTINE SET_CONFIO_ll(OIOCDF4, OFORCELFIOUT, OFORCELFIREAD) - USE MODD_IO_ll, ONLY : LIOCDF4, LLFIOUT, LLFIREAD - LOGICAL, INTENT(IN) :: OIOCDF4 - LOGICAL, INTENT(IN), OPTIONAL :: OFORCELFIOUT, OFORCELFIREAD + SUBROUTINE SET_CONFIO_ll() + USE MODN_CONFIO - LOGICAL :: GFORCELFIOUT, GFORCELFIREAD + !Use MODN_CONFIO namelist variables + CALL SET_CONFIO_INTERN_ll(LCDF4, LLFIOUT, LLFIREAD) + END SUBROUTINE SET_CONFIO_ll + + SUBROUTINE SET_CONFIO_INTERN_ll(OIOCDF4, OLFIOUT, OLFIREAD) + USE MODD_IO_ll, ONLY : LIOCDF4, LLFIOUT, LLFIREAD + LOGICAL, INTENT(IN) :: OIOCDF4, OLFIOUT, OLFIREAD CALL PRINT_MSG(NVERB_DEBUG,'IO','SET_CONFIO_ll','called') IF (GCONFIO) THEN CALL PRINT_MSG(NVERB_WARNING,'IO','SET_CONFIO_ll','already called (ignoring this call)') ELSE - IF (PRESENT(OFORCELFIOUT)) THEN - GFORCELFIOUT = OFORCELFIOUT - ELSE - GFORCELFIOUT = .FALSE. - END IF - IF (PRESENT(OFORCELFIREAD)) THEN - GFORCELFIREAD = OFORCELFIREAD - ELSE - GFORCELFIREAD = .FALSE. - END IF - #if defined(MNH_IOCDF4) - !PRINT *, 'SET_CONFIO_ll : sources compiled WITH IOCDF4 support.' - LIOCDF4 = OIOCDF4 - LLFIOUT = (.NOT. OIOCDF4 .OR. GFORCELFIOUT) - LLFIREAD = GFORCELFIREAD + LIOCDF4 = OIOCDF4 + LLFIOUT = OLFIOUT + LLFIREAD = OLFIREAD + + IF (.NOT.LIOCDF4 .AND. .NOT.LLFIOUT) THEN + CALL PRINT_MSG(NVERB_WARNING,'IO','SET_CONFIO_ll','output format forced to netCDF') + LIOCDF4 = .TRUE. + END IF #else - !PRINT *, 'SET_CONFIO_ll : sources compiled WITHOUT IOCDF4 support.' - LIOCDF4 = .FALSE. - LLFIOUT = .TRUE. - LLFIREAD = .TRUE. + LIOCDF4 = .FALSE. + LLFIOUT = .TRUE. + LLFIREAD = .TRUE. #endif - GCONFIO = .TRUE. + GCONFIO = .TRUE. END IF - END SUBROUTINE SET_CONFIO_ll + END SUBROUTINE SET_CONFIO_INTERN_ll SUBROUTINE INITIO_ll() USE MODE_MNH_WORLD , ONLY : INIT_NMNH_COMM_WORLD diff --git a/src/MNH/diag.f90 b/src/MNH/diag.f90 index e03bc386041ceb23a3c0bb4a510ab8785b039d21..1629b965115a423fa81119c37fee4def3df4e8e8 100644 --- a/src/MNH/diag.f90 +++ b/src/MNH/diag.f90 @@ -124,7 +124,7 @@ USE MODD_LES_BUDGET USE MODD_BUDGET USE MODD_RADAR USE MODD_PARAM_LIMA, ONLY : LLIMA_DIAG -USE MODD_IO_ll, ONLY: TFILEDATA,TFILE_SURFEX +USE MODD_IO_ll, ONLY: LIOCDF4,LLFIOUT,TFILEDATA,TFILE_SURFEX ! USE MODN_DIAG_BLANK ! @@ -151,7 +151,6 @@ USE MODD_STATION_n USE MODE_MNH_TIMING USE MODE_FMREAD USE MODN_CONFZ -USE MODN_CONFIO ! USE MODI_MNHGET_SURF_PARAM_n ! @@ -164,6 +163,7 @@ USE MODI_WRITE_DIAG_SURF_ATM_N USE MODD_MNH_SURFEX_n ! USE MODN_CONF, ONLY : JPHEXT , NHALO +USE MODN_CONFIO, ONLY : NAM_CONFIO ! IMPLICIT NONE ! @@ -405,7 +405,7 @@ CALL POSNAM(ILUNAM,'NAM_CONFIO',GFOUND) IF (GFOUND) THEN READ(UNIT=ILUNAM,NML=NAM_CONFIO) END IF -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() ! CALL CLOSE_ll(YNAM) ! @@ -450,7 +450,7 @@ COUTFMFILE=TRIM(CINIFILE)//YSUFFIX ! TZFILE%CNAME = TRIM(CINIFILE)//YSUFFIX TZFILE%CTYPE = 'DIAG' -IF (LCDF4) THEN +IF (LIOCDF4) THEN IF (.NOT.LLFIOUT) THEN TZFILE%CFORMAT='NETCDF4' ELSE @@ -532,7 +532,7 @@ IF ( LAIRCRAFT_BALLOON ) THEN ! TZDIACFILE%CNAME = TRIM(CINIFILE)//'BAL' TZDIACFILE%CTYPE = 'DIACHRONIC' - IF (LCDF4) THEN + IF (LIOCDF4) THEN IF (.NOT.LLFIOUT) THEN TZDIACFILE%CFORMAT = 'NETCDF4' ELSE diff --git a/src/MNH/ini_segn.f90 b/src/MNH/ini_segn.f90 index 503eebc7247e3a16cc2f6c5c4974a614aae97e1f..d6f594f44b3457dcfbf52a02986f52ffeec2f564 100644 --- a/src/MNH/ini_segn.f90 +++ b/src/MNH/ini_segn.f90 @@ -172,7 +172,6 @@ END MODULE MODI_INI_SEG_n USE MODD_LUNIT USE MODD_CONF USE MODN_CONFZ -USE MODN_CONFIO USE MODD_CONF_n, ONLY : CSTORAGE_TYPE USE MODD_LUNIT_n, ONLY : CINIFILE_n=> CINIFILE,CINIFILEPGD_n=> CINIFILEPGD USE MODN_LUNIT_n @@ -192,6 +191,8 @@ USE MODI_READ_DESFM_n USE MODI_READ_EXSEG_n USE MODI_WRITE_DESFM_n ! +USE MODN_CONFIO, ONLY : NAM_CONFIO +! IMPLICIT NONE ! !* 0.1 declarations of arguments @@ -341,7 +342,7 @@ IF (CPROGRAM=='MESONH') THEN IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CONFZ) CALL POSNAM(ILUSEG,'NAM_CONFIO',GFOUND,ILUOUT) IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CONFIO) - CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) + CALL SET_CONFIO_ll() END IF HINIFILEPGD=CINIFILEPGD_n HINIFILE=CINIFILE_n diff --git a/src/MNH/latlon_to_xy.f90 b/src/MNH/latlon_to_xy.f90 index 5158ae4a66d37a33fd5e9cdd3f52eb04f88f40ec..bedc9f9003e510cfcc058acb513acff86bed9b80 100644 --- a/src/MNH/latlon_to_xy.f90 +++ b/src/MNH/latlon_to_xy.f90 @@ -81,7 +81,7 @@ USE MODE_GRIDPROJ USE MODI_INI_CST USE MODI_READ_HGRID ! -USE MODN_CONFIO +USE MODN_CONFIO, ONLY : NAM_CONFIO ! IMPLICIT NONE ! @@ -130,7 +130,7 @@ CALL OPEN_ll(UNIT=INAM,FILE='LATLON2XY1.nam',IOSTAT=IRESP,ACTION='READ', & READ(INAM,NAM_INIFILE) ! READ(INAM,NAM_CONFIO) -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() CALL CLOSE_ll('LATLON2XY1.nam',IOSTAT=IRESP) ! !* 1. Opening of MESONH file diff --git a/src/MNH/open_nestpgd_files.f90 b/src/MNH/open_nestpgd_files.f90 index 39024a02fa650b15c1d39ee8e37415b4f8a7371d..67c4420e53b9ef5318176a61e02accccf3701d0b 100644 --- a/src/MNH/open_nestpgd_files.f90 +++ b/src/MNH/open_nestpgd_files.f90 @@ -81,7 +81,7 @@ USE MODD_LUNIT USE MODD_CONF USE MODD_NESTING USE MODD_PARAMETERS -USE MODD_IO_ll, ONLY : TFILEDATA +USE MODD_IO_ll, ONLY : LIOCDF4,LLFIOUT,TFILEDATA ! USE MODI_OPEN_LUOUTn ! @@ -93,12 +93,11 @@ USE MODE_MSG ! USE MODE_MODELN_HANDLER ! -USE MODN_CONFIO -! USE MODD_PARAMETERS, ONLY : JPHEXT USE MODD_CONF, ONLY : NHALO_CONF_MNH => NHALO ! -USE MODN_CONFZ +USE MODN_CONFZ +USE MODN_CONFIO, ONLY : NAM_CONFIO ! IMPLICIT NONE ! @@ -289,7 +288,7 @@ IF (GFOUND) READ(UNIT=IPRE_NEST_PGD,NML=NAM_NEST_PGD) ! CALL POSNAM(IPRE_NEST_PGD,'NAM_CONFIO',GFOUND,ILUOUT0) IF (GFOUND) READ(UNIT=IPRE_NEST_PGD,NML=NAM_CONFIO) -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() ! ALLOCATE(TPFILEPGD (NMODEL)) ALLOCATE(TPFILENESTPGD(NMODEL)) @@ -314,7 +313,7 @@ END DO ! TPFILEPGD(:) %CTYPE = 'PREPPGD' TPFILENESTPGD(:)%CTYPE = 'PREPNESTPGD' -IF (LCDF4) THEN +IF (LIOCDF4) THEN IF (.NOT.LLFIOUT) THEN TPFILEPGD(:) %CFORMAT = 'NETCDF4' TPFILENESTPGD(:)%CFORMAT = 'NETCDF4' diff --git a/src/MNH/open_prc_files.f90 b/src/MNH/open_prc_files.f90 index 9b9025d8d29a19c20cb4dfb58ace00eac63571fc..0b37a6c07e6562b4a88bd3c9ea12b7f6870f8977 100644 --- a/src/MNH/open_prc_files.f90 +++ b/src/MNH/open_prc_files.f90 @@ -105,12 +105,13 @@ USE MODD_LUNIT_n, CINIFILE_n=>CINIFILE , CINIFILEPGD_n=>CINIFILEPGD !JUAN Z_SPLITTING USE MODN_CONFZ !JUAN Z_SPLITTING -USE MODN_CONFIO ! USE MODE_POS USE MODE_FM USE MODE_IO_ll ! +USE MODN_CONFIO, ONLY : NAM_CONFIO +! IMPLICIT NONE ! !* 0.1 Declaration of arguments @@ -193,7 +194,7 @@ IF (GFOUND) READ(UNIT=IPRE_REAL1,NML=NAM_CONFZ) !JUANZ CALL POSNAM(IPRE_REAL1,'NAM_CONFIO',GFOUND,ILUOUT0) IF (GFOUND) READ(UNIT=IPRE_REAL1,NML=NAM_CONFIO) -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() ! CINIFILE = CINIFILE_n CALL POSNAM(IPRE_REAL1,'NAM_FILE_NAMES',GFOUND,ILUOUT0) diff --git a/src/MNH/prep_ideal_case.f90 b/src/MNH/prep_ideal_case.f90 index 509bbcd2ba7ea808568914c73bead389546a2f1e..edaa146d6b1af55f45afb58e3cd2068fcc0f2da9 100644 --- a/src/MNH/prep_ideal_case.f90 +++ b/src/MNH/prep_ideal_case.f90 @@ -403,7 +403,6 @@ USE MODD_SUB_MODEL_n USE MODE_MNH_TIMING USE MODN_CONFZ !JUAN -USE MODN_CONFIO USE MODI_TH_R_FROM_THL_RT_3D ! USE MODI_VERSION @@ -423,12 +422,14 @@ USE MODE_FMWRIT USE MODI_WRITE_HGRID USE MODD_MPIF USE MODD_VAR_ll -USE MODD_IO_ll, ONLY: TFILEDATA,TFILE_SURFEX +USE MODD_IO_ll, ONLY: LIOCDF4,LLFIOUT,TFILEDATA,TFILE_SURFEX ! USE MODE_MPPDB ! USE MODD_GET_n ! +USE MODN_CONFIO, ONLY : NAM_CONFIO +! IMPLICIT NONE ! !* 0.1 Declarations of global variables not declared in the modules @@ -692,7 +693,7 @@ IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_CONFZ) !JUANZ CALL POSNAM(NLUPRE,'NAM_CONFIO',GFOUND,NLUOUT) IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_CONFIO) -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() CALL POSNAM(NLUPRE,'NAM_GRID_PRE',GFOUND,NLUOUT) IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_GRID_PRE) CALL POSNAM(NLUPRE,'NAM_GRIDH_PRE',GFOUND,NLUOUT) @@ -1762,7 +1763,7 @@ CDESFM=ADJUSTL(ADJUSTR(CINIFILE)//'.des') ! TZFILE%CNAME = CINIFILE TZFILE%CTYPE = 'PREPIDEALCASE' -IF (LCDF4) THEN +IF (LIOCDF4) THEN IF (.NOT.LLFIOUT) THEN TZFILE%CFORMAT='NETCDF4' ELSE @@ -1840,7 +1841,7 @@ IF (CSURF =='EXTE') THEN ! TZINIFILEPGD%CNAME = CINIFILEPGD TZINIFILEPGD%CTYPE = 'PREPIDEALCASE' - IF (LCDF4) THEN + IF (LIOCDF4) THEN IF (.NOT.LLFIOUT) THEN TZINIFILEPGD%CFORMAT='NETCDF4' ELSE diff --git a/src/MNH/prep_pgd.f90 b/src/MNH/prep_pgd.f90 index bba967b2659c5967e980fe93170e9de3e3595f7a..2418d89bf432b06af2909a74fb029ea512d161e4 100644 --- a/src/MNH/prep_pgd.f90 +++ b/src/MNH/prep_pgd.f90 @@ -79,7 +79,7 @@ USE MODD_CONF, ONLY : CPROGRAM, L1D, L2D, LPACK, LCARTESIAN USE MODD_CONF_n,ONLY : CSTORAGE_TYPE USE MODD_LUNIT, ONLY : CLUOUT0 USE MODD_PARAMETERS, ONLY : XUNDEF -USE MODD_IO_ll, ONLY : GSMONOPROC, TFILEDATA, TFILE_SURFEX +USE MODD_IO_ll, ONLY : GSMONOPROC,LIOCDF4,LLFIOUT,TFILEDATA,TFILE_SURFEX USE MODD_IO_SURF_MNH, ONLY : NHALO USE MODD_SPAWN, ONLY : NDXRATIO,NDYRATIO,NXSIZE,NYSIZE,NXOR,NYOR ! @@ -98,7 +98,6 @@ USE MODN_CONFZ USE MODD_PARAMETERS, ONLY : JPHEXT USE MODD_CONF, ONLY : NHALO_CONF_MNH => NHALO !JUAN -USE MODN_CONFIO ! USE MODI_READ_ALL_NAMELISTS USE MODI_VERSION @@ -111,6 +110,8 @@ USE MODD_MNH_SURFEX_n USE MODE_MPPDB USE MODI_EXTEND_GRID_ON_HALO ! +USE MODN_CONFIO, ONLY : NAM_CONFIO +! IMPLICIT NONE ! ! @@ -195,7 +196,7 @@ ENDIF !JUANZ CALL POSNAM(ILUNAM,'NAM_CONFIO',GFOUND) IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_CONFIO) -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() ! CALL CLOSE_ll('PRE_PGD1.nam') ! @@ -239,7 +240,7 @@ CALL PGD_SURF_ATM(YSURF_CUR,'MESONH',' ',' ',.FA ! TZFILE%CNAME = CPGDFILE TZFILE%CTYPE = 'PREPPGD' -IF (LCDF4) THEN +IF (LIOCDF4) THEN IF (.NOT.LLFIOUT) THEN TZFILE%CFORMAT= 'NETCDF4' ELSE diff --git a/src/MNH/read_exspa.f90 b/src/MNH/read_exspa.f90 index 48cf1d5ef63bd0a0023eaf1b2649f65a319affaf..14719eb7f0f5f5a0aa16c2ba16b11b0ba059855f 100644 --- a/src/MNH/read_exspa.f90 +++ b/src/MNH/read_exspa.f90 @@ -111,7 +111,7 @@ USE MODE_IO_ll USE MODE_POS USE MODE_MODELN_HANDLER ! -USE MODN_CONFIO +USE MODN_CONFIO, ONLY : NAM_CONFIO ! IMPLICIT NONE ! @@ -224,7 +224,7 @@ CINIFILEPGD_n=CINIFILEPGD !! CALL POSNAM(ILUSPA,'NAM_CONFIO',GFOUND,ILUOUT) IF (GFOUND) READ(ILUSPA,NAM_CONFIO) -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() CALL CLOSE_ll(YEXSPA) ! ! diff --git a/src/MNH/spectre.f90 b/src/MNH/spectre.f90 index 1e09822c4b77f8c83942e546467d237d90a664e4..d342be18efa51cc8c937ff8b0e93dd91936f6f3e 100644 --- a/src/MNH/spectre.f90 +++ b/src/MNH/spectre.f90 @@ -39,9 +39,8 @@ USE MODE_FM USE MODI_VERSION ! USE MODN_CONFZ +USE MODN_CONFIO, ONLY : NAM_CONFIO ! -USE MODN_CONFIO -! IMPLICIT NONE ! !* 0.1 declarations of local variables @@ -161,7 +160,7 @@ IF (GFOUND) THEN READ(UNIT=ILUNAM,NML=NAM_CONFIO) PRINT*, ' namelist NAM_CONFIO read' END IF -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() ! CALL CLOSE_ll(YNAM) ! diff --git a/src/MNH/xy_to_latlon.f90 b/src/MNH/xy_to_latlon.f90 index 64fe4a02021353d8aab711a08ae2976c3edcd645..3bce1fdeb75b5657ce39b9fedab792454b7cc998 100644 --- a/src/MNH/xy_to_latlon.f90 +++ b/src/MNH/xy_to_latlon.f90 @@ -80,7 +80,7 @@ USE MODE_GRIDPROJ USE MODI_INI_CST USE MODI_READ_HGRID ! -USE MODN_CONFIO +USE MODN_CONFIO, ONLY : NAM_CONFIO ! IMPLICIT NONE ! @@ -127,7 +127,7 @@ CALL OPEN_ll(UNIT=INAM,FILE='XY2LATLON1.nam',IOSTAT=IRESP,ACTION='READ', & DELIM='QUOTE',MODE=GLOBAL) READ(INAM,NAM_INIFILE) READ(INAM,NAM_CONFIO) -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() CALL CLOSE_ll('XY2LATLON1.nam',IOSTAT=IRESP) ! !* 1. Opening of MESONH file diff --git a/src/MNH/zoom_pgd.f90 b/src/MNH/zoom_pgd.f90 index c53d85feca81ee3dd96a01a10f443daf6b8527aa..d3289e3c6497c5c74e661975d6a06937d049f686 100644 --- a/src/MNH/zoom_pgd.f90 +++ b/src/MNH/zoom_pgd.f90 @@ -52,7 +52,7 @@ ! USE MODD_CONF, ONLY : CPROGRAM, NMASDEV, NBUGFIX, CBIBUSER, & L1D, L2D, LPACK -USE MODD_IO_ll, ONLY: TFILEDATA +USE MODD_IO_ll, ONLY: LIOCDF4,LLFIOUT,TFILEDATA USE MODD_LUNIT, ONLY : CLUOUT0, COUTFMFILE, CPGDFILE USE MODD_PARAMETERS, ONLY : XUNDEF, NUNDEF, JPVEXT, JPHEXT, JPMODELMAX USE MODD_PARAM_n, ONLY : CSURF @@ -81,7 +81,7 @@ USE MODI_ZOOM_PGD_SURF_ATM USE MODI_WRITE_PGD_SURF_ATM_N USE MODD_MNH_SURFEX_n ! -USE MODN_CONFIO +USE MODN_CONFIO, ONLY : NAM_CONFIO ! IMPLICIT NONE ! @@ -145,7 +145,7 @@ CALL POSNAM(ILUNAM,'NAM_PGDFILE',GFOUND,ILUOUT0) IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_PGDFILE) CALL POSNAM(ILUNAM,'NAM_CONFIO',GFOUND,ILUOUT0) IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_CONFIO) -CALL SET_CONFIO_ll(LCDF4, LLFIOUT, LLFIREAD) +CALL SET_CONFIO_ll() ! CALL CLOSE_ll(YNAMELIST,IOSTAT=IRESP) ! @@ -203,7 +203,7 @@ END IF ! TZZOOMFILE%CNAME = YZOOMFILE TZZOOMFILE%CTYPE = 'ZOOMPGD' -IF (LCDF4) THEN +IF (LIOCDF4) THEN IF (.NOT.LLFIOUT) THEN TZZOOMFILE%CFORMAT='NETCDF4' ELSE