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

Philippe 30/06/2017: IO: use IO_READ_FIELD for several fields in initialisation

parent d21ec0a2
No related branches found
No related tags found
No related merge requests found
...@@ -14,15 +14,16 @@ ...@@ -14,15 +14,16 @@
! !
INTERFACE INTERFACE
! !
SUBROUTINE INI_SEG_n(KMI,HLUOUT,HINIFILE,HINIFILEPGD,PTSTEP_ALL) SUBROUTINE INI_SEG_n(KMI,HLUOUT,TPINIFILE,HINIFILEPGD,PTSTEP_ALL)
INTEGER, INTENT(IN) :: KMI ! Model index !
USE MODD_IO_ll, ONLY : TFILEDATA
CHARACTER(LEN=16), INTENT(OUT) :: HLUOUT ! name of the listing- !
! output of nested models INTEGER, INTENT(IN) :: KMI !Model index
CHARACTER (LEN=28), INTENT(OUT) :: HINIFILE! name of CHARACTER (LEN=*), INTENT(OUT) :: HLUOUT !Name for output-listing of nested models
! the initial file TYPE(TFILEDATA), INTENT(OUT) :: TPINIFILE !Initial file
CHARACTER (LEN=28), INTENT(OUT) :: HINIFILEPGD CHARACTER (LEN=28), INTENT(OUT) :: HINIFILEPGD
REAL,DIMENSION(:), INTENT(INOUT) :: PTSTEP_ALL ! Time STEP of ALL models REAL,DIMENSION(:), INTENT(INOUT) :: PTSTEP_ALL ! Time STEP of ALL models
!
END SUBROUTINE INI_SEG_n END SUBROUTINE INI_SEG_n
! !
END INTERFACE END INTERFACE
...@@ -33,7 +34,7 @@ END MODULE MODI_INI_SEG_n ...@@ -33,7 +34,7 @@ END MODULE MODI_INI_SEG_n
! !
! !
! ############################################################# ! #############################################################
SUBROUTINE INI_SEG_n(KMI,HLUOUT,HINIFILE,HINIFILEPGD,PTSTEP_ALL) SUBROUTINE INI_SEG_n(KMI,HLUOUT,TPINIFILE,HINIFILEPGD,PTSTEP_ALL)
! ############################################################# ! #############################################################
! !
!!**** *INI_SEG_n * - routine to read and update the descriptor files for !!**** *INI_SEG_n * - routine to read and update the descriptor files for
...@@ -200,14 +201,11 @@ IMPLICIT NONE ...@@ -200,14 +201,11 @@ IMPLICIT NONE
! !
!* 0.1 declarations of arguments !* 0.1 declarations of arguments
! !
INTEGER, INTENT(IN) :: KMI ! Model index INTEGER, INTENT(IN) :: KMI !Model index
CHARACTER (LEN=*), INTENT(OUT) :: HLUOUT !Name for output-listing of nested models
CHARACTER(LEN=16), INTENT(OUT) :: HLUOUT ! name of the listing- TYPE(TFILEDATA), INTENT(OUT) :: TPINIFILE !Initial file
! output of nested models CHARACTER (LEN=28), INTENT(OUT) :: HINIFILEPGD
CHARACTER (LEN=28), INTENT(OUT) :: HINIFILE! name of REAL,DIMENSION(:), INTENT(INOUT) :: PTSTEP_ALL ! Time STEP of ALL models
! the initial file
CHARACTER (LEN=28), INTENT(OUT) :: HINIFILEPGD
REAL,DIMENSION(:), INTENT(INOUT) :: PTSTEP_ALL ! Time STEP of ALL models
! !
!* 0.1 declarations of local variables !* 0.1 declarations of local variables
! !
...@@ -220,10 +218,6 @@ INTEGER :: ILUOUT ! Logical unit number ...@@ -220,10 +218,6 @@ INTEGER :: ILUOUT ! Logical unit number
! associated with CLUOUT ! associated with CLUOUT
! !
INTEGER :: IRESP,ILUSEG,ININAR ! File management variables INTEGER :: IRESP,ILUSEG,ININAR ! File management variables
INTEGER :: IGRID,ILENCH ! "
CHARACTER(LEN=100) :: YCOMMENT ! "
CHARACTER(LEN=2) :: YDIR ! Type of the data field in LFIFM file
CHARACTER (LEN=16) :: YRECFM ! Name of the desired field in LFIFM file
CHARACTER (LEN=5) :: YCONF ! Local variables which have CHARACTER (LEN=5) :: YCONF ! Local variables which have
LOGICAL :: GFLAT ! the same definition as the LOGICAL :: GFLAT ! the same definition as the
LOGICAL :: GUSERV,GUSERC,GUSERR,GUSERI ! variables in module MODD_CONF, LOGICAL :: GUSERV,GUSERC,GUSERR,GUSERI ! variables in module MODD_CONF,
...@@ -259,13 +253,12 @@ CHARACTER (LEN=4) :: YSCONV ...@@ -259,13 +253,12 @@ CHARACTER (LEN=4) :: YSCONV
CHARACTER (LEN=4) :: YCLOUD CHARACTER (LEN=4) :: YCLOUD
CHARACTER (LEN=4) :: YELEC CHARACTER (LEN=4) :: YELEC
CHARACTER (LEN=3) :: YEQNSYS CHARACTER (LEN=3) :: YEQNSYS
TYPE(TFILEDATA) :: TZFILE
TYPE(FD_ll), POINTER :: TZFD TYPE(FD_ll), POINTER :: TZFD
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
!* 1. OPEN OUPUT-LISTING FILE AND EXSEG FILE !* 1. OPEN OUPTUT-LISTING FILE AND EXSEG FILE
! -------------------------------------- ! ---------------------------------------
! !
WRITE(YMI,'(I2.0)') KMI WRITE(YMI,'(I2.0)') KMI
HLUOUT='OUTPUT_LISTING'//ADJUSTL(YMI) HLUOUT='OUTPUT_LISTING'//ADJUSTL(YMI)
...@@ -287,7 +280,6 @@ IF (CPROGRAM=='MESONH') THEN ...@@ -287,7 +280,6 @@ IF (CPROGRAM=='MESONH') THEN
! !
ELSE IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='REAL '.OR. CPROGRAM=='SPEC ') THEN ELSE IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='REAL '.OR. CPROGRAM=='SPEC ') THEN
YINIFILE = CINIFILE_n YINIFILE = CINIFILE_n
HINIFILE = CINIFILE_n
HINIFILEPGD = CINIFILEPGD_n HINIFILEPGD = CINIFILEPGD_n
YEXSEG=TRIM(ADJUSTL(CINIFILE_n))//'.des' YEXSEG=TRIM(ADJUSTL(CINIFILE_n))//'.des'
CALL FMOPEN_ll(CINIFILE_n,'READ',HLUOUT,0,2,NVERB,ININAR,IRESP) CALL FMOPEN_ll(CINIFILE_n,'READ',HLUOUT,0,2,NVERB,ININAR,IRESP)
...@@ -297,7 +289,6 @@ ELSE IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='REAL '.OR. CPROGRAM=='SPEC ') THEN ...@@ -297,7 +289,6 @@ ELSE IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='REAL '.OR. CPROGRAM=='SPEC ') THEN
! !
ELSE IF (CPROGRAM=='DIAG ') THEN ELSE IF (CPROGRAM=='DIAG ') THEN
YINIFILE = CINIFILE_n YINIFILE = CINIFILE_n
HINIFILE = CINIFILE_n
YEXSEG=TRIM(ADJUSTL(CINIFILE_n))//'.des' YEXSEG=TRIM(ADJUSTL(CINIFILE_n))//'.des'
CALL FMOPEN_ll(CINIFILE_n,'READ',HLUOUT,0,2,NVERB,ININAR,IRESP) CALL FMOPEN_ll(CINIFILE_n,'READ',HLUOUT,0,2,NVERB,ININAR,IRESP)
CALL FMLOOK_ll(YEXSEG,CLUOUT0,ILUSEG,IRESP) CALL FMLOOK_ll(YEXSEG,CLUOUT0,ILUSEG,IRESP)
...@@ -350,8 +341,8 @@ IF (CPROGRAM=='MESONH') THEN ...@@ -350,8 +341,8 @@ IF (CPROGRAM=='MESONH') THEN
CALL SET_CONFIO_ll() CALL SET_CONFIO_ll()
END IF END IF
HINIFILEPGD=CINIFILEPGD_n HINIFILEPGD=CINIFILEPGD_n
HINIFILE=CINIFILE_n YINIFILE=CINIFILE_n
CALL FMOPEN_ll(HINIFILE,'READ',HLUOUT,0,2,NVERB,ININAR,IRESP) CALL FMOPEN_ll(YINIFILE,'READ',HLUOUT,0,2,NVERB,ININAR,IRESP)
END IF END IF
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
...@@ -359,7 +350,7 @@ END IF ...@@ -359,7 +350,7 @@ END IF
!* 4. READ DESFM FILE !* 4. READ DESFM FILE
! --------------- ! ---------------
! !
YDESFM=TRIM(ADJUSTL(HINIFILE))//'.des' YDESFM=TRIM(ADJUSTL(YINIFILE))//'.des'
! !
CALL READ_DESFM_n(KMI,YDESFM,HLUOUT,YCONF,GFLAT,GUSERV,GUSERC, & CALL READ_DESFM_n(KMI,YDESFM,HLUOUT,YCONF,GFLAT,GUSERV,GUSERC, &
GUSERR,GUSERI,GUSECI,GUSERS,GUSERG,GUSERH,GUSECHEM,GUSECHAQ,& GUSERR,GUSERI,GUSECI,GUSERS,GUSERG,GUSERH,GUSECHEM,GUSECHAQ,&
...@@ -394,30 +385,30 @@ END IF ...@@ -394,30 +385,30 @@ END IF
!* 6. READ in the LFI file SOME VARIABLES of MODD_CONF !* 6. READ in the LFI file SOME VARIABLES of MODD_CONF
! ------------------------------------------------ ! ------------------------------------------------
! !
TZFILE%CNAME = HINIFILE TPINIFILE%CNAME = YINIFILE
!TZFILE%CTYPE = '' !TPINIFILE%CTYPE = ''
CALL PRINT_MSG(NVERB_WARNING,'IO','INI_SEG_n','filetype not (yet) set') CALL PRINT_MSG(NVERB_WARNING,'IO','INI_SEG_n','filetype not (yet) set')
TZFD=>GETFD(TRIM(ADJUSTL(TZFILE%CNAME))//'.lfi') TZFD=>GETFD(TRIM(ADJUSTL(TPINIFILE%CNAME))//'.lfi')
IF (.NOT.ASSOCIATED(TZFD)) CALL PRINT_MSG(NVERB_FATAL,'IO','INI_SEG_n','file '//TRIM(TZFILE%CNAME)//' not found') IF (.NOT.ASSOCIATED(TZFD)) CALL PRINT_MSG(NVERB_FATAL,'IO','INI_SEG_n','file '//TRIM(TPINIFILE%CNAME)//' not found')
IF (LIOCDF4 .AND. .NOT.LLFIREAD) THEN IF (LIOCDF4 .AND. .NOT.LLFIREAD) THEN
TZFILE%CFORMAT = 'NETCDF4' TPINIFILE%CFORMAT = 'NETCDF4'
IF (ISP == TZFD%OWNER) TZFILE%NNCID = TZFD%CDF%NCID IF (ISP == TZFD%OWNER) TPINIFILE%NNCID = TZFD%CDF%NCID
ELSE ELSE
TZFILE%CFORMAT = 'LFI' TPINIFILE%CFORMAT = 'LFI'
TZFILE%NLFINPRAR = 0 TPINIFILE%NLFINPRAR = 0
IF (ISP == TZFD%OWNER) TZFILE%NLFIFLU = TZFD%FLU IF (ISP == TZFD%OWNER) TPINIFILE%NLFIFLU = TZFD%FLU
ENDIF ENDIF
TZFILE%CMODE = 'READ' TPINIFILE%CMODE = 'READ'
TZFILE%NLFITYPE = 2 TPINIFILE%NLFITYPE = 2
TZFILE%NLFIVERB = NVERB TPINIFILE%NLFIVERB = NVERB
CALL IO_READ_FIELD(TZFILE,'MASDEV',IMASDEV) CALL IO_READ_FIELD(TPINIFILE,'MASDEV',IMASDEV)
! !
IF (CPROGRAM=='MESONH' .OR. CPROGRAM=='SPAWN ') THEN IF (CPROGRAM=='MESONH' .OR. CPROGRAM=='SPAWN ') THEN
IF (IMASDEV > 49) THEN IF (IMASDEV > 49) THEN
CALL IO_READ_FIELD(TZFILE,'COUPLING',LCOUPLING) CALL IO_READ_FIELD(TPINIFILE,'COUPLING',LCOUPLING)
IF (LCOUPLING) THEN IF (LCOUPLING) THEN
WRITE(ILUOUT,*) 'Error with the initial file' WRITE(ILUOUT,*) 'Error with the initial file'
WRITE(ILUOUT,*) 'The file',HINIFILE,' was created with LCOUPLING=.TRUE.' WRITE(ILUOUT,*) 'The file',YINIFILE,' was created with LCOUPLING=.TRUE.'
WRITE(ILUOUT,*) 'You can not use it as initial file, only as coupling file' WRITE(ILUOUT,*) 'You can not use it as initial file, only as coupling file'
WRITE(ILUOUT,*) 'Run PREP_REAL_CASE with LCOUPLING=.FALSE.' WRITE(ILUOUT,*) 'Run PREP_REAL_CASE with LCOUPLING=.FALSE.'
!callabortstop !callabortstop
...@@ -429,9 +420,9 @@ IF (CPROGRAM=='MESONH' .OR. CPROGRAM=='SPAWN ') THEN ...@@ -429,9 +420,9 @@ IF (CPROGRAM=='MESONH' .OR. CPROGRAM=='SPAWN ') THEN
END IF END IF
! !
! Read the storage type ! Read the storage type
CALL IO_READ_FIELD(TZFILE,'STORAGE_TYPE',CSTORAGE_TYPE) CALL IO_READ_FIELD(TPINIFILE,'STORAGE_TYPE',CSTORAGE_TYPE)
IF (IRESP /= 0) THEN IF (IRESP /= 0) THEN
WRITE(ILUOUT,FMT=9002) YRECFM,IRESP WRITE(ILUOUT,FMT=9002) 'STORAGE_TYPE',IRESP
!callabortstop !callabortstop
CALL CLOSE_ll(HLUOUT,IOSTAT=IRESP) CALL CLOSE_ll(HLUOUT,IOSTAT=IRESP)
CALL ABORT CALL ABORT
...@@ -439,18 +430,18 @@ END IF ...@@ -439,18 +430,18 @@ END IF
END IF END IF
IF (KMI == 1) THEN IF (KMI == 1) THEN
! Read the geometry kind ! Read the geometry kind
CALL IO_READ_FIELD(TZFILE,'CARTESIAN',LCARTESIAN) CALL IO_READ_FIELD(TPINIFILE,'CARTESIAN',LCARTESIAN)
! Read the thinshell approximation ! Read the thinshell approximation
CALL IO_READ_FIELD(TZFILE,'THINSHELL',LTHINSHELL) CALL IO_READ_FIELD(TPINIFILE,'THINSHELL',LTHINSHELL)
! !
IF (IMASDEV>=46) THEN IF (IMASDEV>=46) THEN
CALL IO_READ_FIELD(TZFILE,'L1D',L1D) CALL IO_READ_FIELD(TPINIFILE,'L1D',L1D)
IF (IRESP/=0) L1D=.FALSE. IF (IRESP/=0) L1D=.FALSE.
! !
CALL IO_READ_FIELD(TZFILE,'L2D',L2D) CALL IO_READ_FIELD(TPINIFILE,'L2D',L2D)
IF (IRESP/=0) L2D=.FALSE. IF (IRESP/=0) L2D=.FALSE.
! !
CALL IO_READ_FIELD(TZFILE,'PACK',LPACK) CALL IO_READ_FIELD(TPINIFILE,'PACK',LPACK)
IF (IRESP/=0) LPACK=.TRUE. IF (IRESP/=0) LPACK=.TRUE.
ELSE ELSE
L1D=.FALSE. L1D=.FALSE.
...@@ -458,7 +449,7 @@ IF (KMI == 1) THEN ...@@ -458,7 +449,7 @@ IF (KMI == 1) THEN
LPACK=.TRUE. LPACK=.TRUE.
END IF END IF
IF (IMASDEV>=410) THEN IF (IMASDEV>=410) THEN
CALL IO_READ_FIELD(TZFILE,'LBOUSS',LBOUSS) CALL IO_READ_FIELD(TPINIFILE,'LBOUSS',LBOUSS)
END IF END IF
! !
END IF END IF
...@@ -488,7 +479,6 @@ CALL READ_EXSEG_n(KMI,YEXSEG,HLUOUT,YCONF,GFLAT,GUSERV,GUSERC, & ...@@ -488,7 +479,6 @@ CALL READ_EXSEG_n(KMI,YEXSEG,HLUOUT,YCONF,GFLAT,GUSERV,GUSERC, &
IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='DIAG ' .OR. CPROGRAM=='SPEC ' & IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='DIAG ' .OR. CPROGRAM=='SPEC ' &
.OR. CPROGRAM=='REAL ') THEN .OR. CPROGRAM=='REAL ') THEN
CINIFILE_n = YINIFILE CINIFILE_n = YINIFILE
HINIFILE = YINIFILE
CCPLFILE(:) = ' ' CCPLFILE(:) = ' '
NMODEL=1 NMODEL=1
LSTEADYLS=.TRUE. LSTEADYLS=.TRUE.
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
! !
INTERFACE INTERFACE
! !
SUBROUTINE INI_SIZE_n(KMI,HLUOUT,HINIFILE,HINIFILEPGD) SUBROUTINE INI_SIZE_n(KMI,HLUOUT,TPINIFILE,HINIFILEPGD)
! !
INTEGER, INTENT(IN) :: KMI ! Model Index USE MODD_IO_ll, ONLY : TFILEDATA
CHARACTER (LEN=*), INTENT(IN) :: HLUOUT ! name for output-listing !
! of nested models INTEGER, INTENT(IN) :: KMI !Model Index
CHARACTER (LEN=*), INTENT(IN) :: HINIFILE ! name of CHARACTER (LEN=*), INTENT(IN) :: HLUOUT !Name for output-listing of nested models
! the initial file TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE !Initial file
CHARACTER (LEN=*), INTENT(IN) :: HINIFILEPGD CHARACTER (LEN=*), INTENT(IN) :: HINIFILEPGD
! !
END SUBROUTINE INI_SIZE_n END SUBROUTINE INI_SIZE_n
! !
...@@ -28,9 +28,9 @@ END INTERFACE ...@@ -28,9 +28,9 @@ END INTERFACE
! !
END MODULE MODI_INI_SIZE_n END MODULE MODI_INI_SIZE_n
!----------------------------------------------------------------- !-----------------------------------------------------------------
! ########################################## ! #######################################################
SUBROUTINE INI_SIZE_n(KMI,HLUOUT,HINIFILE,HINIFILEPGD) SUBROUTINE INI_SIZE_n(KMI,HLUOUT,TPINIFILE,HINIFILEPGD)
! ########################################## ! #######################################################
! !
!! !!
!!**** *INI_SIZE_n* - routine to initialize the sizes ratio positions of nested model _n !!**** *INI_SIZE_n* - routine to initialize the sizes ratio positions of nested model _n
...@@ -118,7 +118,7 @@ USE MODD_NESTING, ONLY: CMY_NAME, CDAD_NAME, NDAD, NDXRATIO_ALL, NDYRATIO_ALL, & ...@@ -118,7 +118,7 @@ USE MODD_NESTING, ONLY: CMY_NAME, CDAD_NAME, NDAD, NDXRATIO_ALL, NDYRATIO_ALL, &
USE MODD_DIM_n, ONLY: NIMAX_ll, NJMAX_ll, NKMAX USE MODD_DIM_n, ONLY: NIMAX_ll, NJMAX_ll, NKMAX
USE MODD_LBC_n, ONLY: CLBCX, CLBCY USE MODD_LBC_n, ONLY: CLBCX, CLBCY
USE MODD_LUNIT_n, ONLY: CLUOUT, CINIFILE,CINIFILEPGD USE MODD_LUNIT_n, ONLY: CLUOUT, CINIFILE,CINIFILEPGD
USE MODD_IO_ll, ONLY : GSMONOPROC USE MODD_IO_ll, ONLY : GSMONOPROC, TFILEDATA
! !
USE MODE_ll USE MODE_ll
USE MODE_IO_ll USE MODE_IO_ll
...@@ -135,22 +135,15 @@ IMPLICIT NONE ...@@ -135,22 +135,15 @@ IMPLICIT NONE
! !
!* 0.1 declarations of arguments !* 0.1 declarations of arguments
! !
INTEGER, INTENT(IN) :: KMI ! Model Index INTEGER, INTENT(IN) :: KMI !Model Index
CHARACTER (LEN=*), INTENT(IN) :: HLUOUT ! name for output-listing CHARACTER (LEN=*), INTENT(IN) :: HLUOUT !Name for output-listing of nested models
! of nested models TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE !Initial file
CHARACTER (LEN=*), INTENT(IN) :: HINIFILE ! name of CHARACTER (LEN=*), INTENT(IN) :: HINIFILEPGD
! the initial file
CHARACTER (LEN=*), INTENT(IN) :: HINIFILEPGD
! !
!* 0.2 declarations of local variables !* 0.2 declarations of local variables
! !
INTEGER :: IRESP ! Return code of FM routines INTEGER :: IRESP ! Return code of FM routines
INTEGER :: ILUOUT ! Logical unit number of output-listing INTEGER :: ILUOUT ! Logical unit number of output-listing
CHARACTER(LEN=2) :: YDIR ! Type of the data field in LFIFM file
INTEGER :: IGRID ! C-grid indicator in LFIFM file
INTEGER :: ILENCH ! Length of comment string in LFIFM file
CHARACTER (LEN=100) :: YCOMMENT! comment string in LFIFM file
CHARACTER (LEN=16) :: YRECFM ! Name of the desired field in LFIFM file
INTEGER :: IJPHEXT INTEGER :: IJPHEXT
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
...@@ -160,7 +153,7 @@ INTEGER :: IJPHEXT ...@@ -160,7 +153,7 @@ INTEGER :: IJPHEXT
! !
CALL FMLOOK_ll(HLUOUT,HLUOUT,ILUOUT,IRESP) CALL FMLOOK_ll(HLUOUT,HLUOUT,ILUOUT,IRESP)
CLUOUT = HLUOUT CLUOUT = HLUOUT
CINIFILE=HINIFILE CINIFILE=TPINIFILE%CNAME
CINIFILEPGD=HINIFILEPGD CINIFILEPGD=HINIFILEPGD
! !
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
...@@ -170,22 +163,18 @@ CINIFILEPGD=HINIFILEPGD ...@@ -170,22 +163,18 @@ CINIFILEPGD=HINIFILEPGD
! !
!* 2.0 Retrieve DAD_NAME and MY_NAME to check the DAD model identity !* 2.0 Retrieve DAD_NAME and MY_NAME to check the DAD model identity
! !
YRECFM = 'MY_NAME' CALL IO_READ_FIELD(TPINIFILE,'MY_NAME',CMY_NAME(KMI),IRESP)
YDIR='--'
CALL FMREAD(HINIFILE,YRECFM,HLUOUT,YDIR,CMY_NAME(KMI),IGRID,ILENCH,YCOMMENT,IRESP)
IF (IRESP /= 0) THEN IF (IRESP /= 0) THEN
WRITE(ILUOUT,FMT=9000) YRECFM,IRESP WRITE(ILUOUT,FMT=9000) 'MY_NAME',IRESP
!callabortstop !callabortstop
CALL CLOSE_ll(CLUOUT,IOSTAT=IRESP) CALL CLOSE_ll(CLUOUT,IOSTAT=IRESP)
CALL ABORT CALL ABORT
STOP STOP
END IF END IF
! !
YRECFM = 'DAD_NAME' CALL IO_READ_FIELD(TPINIFILE,'DAD_NAME',CDAD_NAME(KMI),IRESP)
YDIR='--'
CALL FMREAD(HINIFILE,YRECFM,HLUOUT,YDIR,CDAD_NAME(KMI),IGRID,ILENCH,YCOMMENT,IRESP)
IF (IRESP /= 0) THEN IF (IRESP /= 0) THEN
WRITE(ILUOUT,FMT=9000) YRECFM,IRESP WRITE(ILUOUT,FMT=9000) 'DAD_NAME',IRESP
!callabortstop !callabortstop
CALL CLOSE_ll(CLUOUT,IOSTAT=IRESP) CALL CLOSE_ll(CLUOUT,IOSTAT=IRESP)
CALL ABORT CALL ABORT
...@@ -215,26 +204,15 @@ END IF ...@@ -215,26 +204,15 @@ END IF
!* 3.1 Read dimensions in initial file and initialize subdomain !* 3.1 Read dimensions in initial file and initialize subdomain
! dimensions and parallel variables ! dimensions and parallel variables
! !
YRECFM='IMAX' CALL IO_READ_FIELD(TPINIFILE,'IMAX', NIMAX_ll)
YDIR='--' CALL IO_READ_FIELD(TPINIFILE,'JMAX', NJMAX_ll)
CALL FMREAD(HINIFILE,YRECFM,HLUOUT,YDIR,NIMAX_ll,IGRID,ILENCH,YCOMMENT,IRESP) CALL IO_READ_FIELD(TPINIFILE,'KMAX', NKMAX)
! CALL IO_READ_FIELD(TPINIFILE,'JPHEXT',IJPHEXT)
YRECFM='JMAX'
YDIR='--'
CALL FMREAD(HINIFILE,YRECFM,HLUOUT,YDIR,NJMAX_ll,IGRID,ILENCH,YCOMMENT,IRESP)
!
YRECFM='KMAX'
YDIR='--'
CALL FMREAD(HINIFILE,YRECFM,HLUOUT,YDIR,NKMAX,IGRID,ILENCH,YCOMMENT,IRESP)
!
YRECFM='JPHEXT'
YDIR='--'
CALL FMREAD(HINIFILE,YRECFM,HLUOUT,YDIR,IJPHEXT,IGRID,ILENCH,YCOMMENT,IRESP)
! !
IF ( IJPHEXT .NE. JPHEXT ) THEN IF ( IJPHEXT .NE. JPHEXT ) THEN
WRITE(ILUOUT,FMT=*) ' INI_SIZE_N : JPHEXT in namelist NAM_CONF ( or default or .des value )& WRITE(ILUOUT,FMT=*) ' INI_SIZE_N : JPHEXT in namelist NAM_CONF ( or default or .des value )&
& JPHEXT=',JPHEXT & JPHEXT=',JPHEXT
WRITE(ILUOUT,FMT=*)' different from LFI file=',HINIFILE ,' value JPHEXT=',IJPHEXT WRITE(ILUOUT,FMT=*)' different from LFI file=',TPINIFILE%CNAME ,' value JPHEXT=',IJPHEXT
WRITE(ILUOUT,FMT=*) '-> JOB ABORTED' WRITE(ILUOUT,FMT=*) '-> JOB ABORTED'
CALL CLOSE_ll(CLUOUT,IOSTAT=IRESP) CALL CLOSE_ll(CLUOUT,IOSTAT=IRESP)
CALL ABORT CALL ABORT
...@@ -261,11 +239,10 @@ ENDIF ...@@ -261,11 +239,10 @@ ENDIF
! read the nested model location in its father's grid ! read the nested model location in its father's grid
! and compute the coordinates of the corner points ! and compute the coordinates of the corner points
IF (LEN_TRIM(CDAD_NAME(KMI))>0) THEN IF (LEN_TRIM(CDAD_NAME(KMI))>0) THEN
YDIR='--' CALL IO_READ_FIELD(TPINIFILE,'DXRATIO',NDXRATIO_ALL(KMI))
CALL FMREAD(HINIFILE,'DXRATIO',HLUOUT,YDIR,NDXRATIO_ALL(KMI),IGRID,ILENCH,YCOMMENT,IRESP) CALL IO_READ_FIELD(TPINIFILE,'DYRATIO',NDYRATIO_ALL(KMI))
CALL FMREAD(HINIFILE,'DYRATIO',HLUOUT,YDIR,NDYRATIO_ALL(KMI),IGRID,ILENCH,YCOMMENT,IRESP) CALL IO_READ_FIELD(TPINIFILE,'XOR',NXOR_ALL(KMI))
CALL FMREAD(HINIFILE,'XOR',HLUOUT,YDIR,NXOR_ALL(KMI),IGRID,ILENCH,YCOMMENT,IRESP) CALL IO_READ_FIELD(TPINIFILE,'YOR',NYOR_ALL(KMI))
CALL FMREAD(HINIFILE,'YOR',HLUOUT,YDIR,NYOR_ALL(KMI),IGRID,ILENCH,YCOMMENT,IRESP)
NXEND_ALL(KMI)=NXOR_ALL(KMI)-1 + NIMAX_ll/NDXRATIO_ALL(KMI) +2*JPHEXT NXEND_ALL(KMI)=NXOR_ALL(KMI)-1 + NIMAX_ll/NDXRATIO_ALL(KMI) +2*JPHEXT
NYEND_ALL(KMI)=NYOR_ALL(KMI)-1 + NJMAX_ll/NDYRATIO_ALL(KMI) +2*JPHEXT NYEND_ALL(KMI)=NYOR_ALL(KMI)-1 + NJMAX_ll/NDYRATIO_ALL(KMI) +2*JPHEXT
ELSE ELSE
......
...@@ -80,11 +80,12 @@ ...@@ -80,11 +80,12 @@
! !
!* 0. DECLARATIONS !* 0. DECLARATIONS
! ------------ ! ------------
USE MODD_PARAMETERS
USE MODD_CONF USE MODD_CONF
USE MODD_LUNIT
USE MODD_LBC_n, ONLY: CLBCX,CLBCY ! only for spawning purpose
USE MODD_DYN_n, ONLY: CPRESOPT,NITR ! only for spawning purpose USE MODD_DYN_n, ONLY: CPRESOPT,NITR ! only for spawning purpose
USE MODD_IO_ll, ONLY: TFILEDATA
USE MODD_LBC_n, ONLY: CLBCX,CLBCY ! only for spawning purpose
USE MODD_LUNIT
USE MODD_PARAMETERS
! !
USE MODE_IO_ll USE MODE_IO_ll
USE MODE_ll USE MODE_ll
...@@ -112,11 +113,10 @@ IMPLICIT NONE ...@@ -112,11 +113,10 @@ IMPLICIT NONE
!* 0.1 Local variables !* 0.1 Local variables
! !
INTEGER :: JMI ! Loop index INTEGER :: JMI ! Loop index
CHARACTER (LEN=16), DIMENSION(JPMODELMAX) :: YLUOUT ! Name for output-listing CHARACTER(LEN=16), DIMENSION(JPMODELMAX) :: YLUOUT ! Name for output-listing
! of nested models ! of nested models
CHARACTER (LEN=28), DIMENSION(JPMODELMAX) :: YINIFILE ! names of TYPE(TFILEDATA), DIMENSION(JPMODELMAX) :: TZINIFILE ! Initial files
! the initial files CHARACTER (LEN=28),DIMENSION(JPMODELMAX) :: YINIFILEPGD
CHARACTER (LEN=28), DIMENSION(JPMODELMAX) :: YINIFILEPGD
INTEGER :: ILUOUT0,IRESP ! Logical unit number for INTEGER :: ILUOUT0,IRESP ! Logical unit number for
! output-listing common ! output-listing common
! to all models and return ! to all models and return
...@@ -174,11 +174,11 @@ IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='DIAG ' .OR. CPROGRAM=='SPEC ' .OR. CPRO ...@@ -174,11 +174,11 @@ IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='DIAG ' .OR. CPROGRAM=='SPEC ' .OR. CPRO
END IF END IF
! !
CALL GOTO_MODEL(1) CALL GOTO_MODEL(1)
CALL INI_SEG_n(1,YLUOUT(1),YINIFILE(1),YINIFILEPGD(1),ZTSTEP_ALL) CALL INI_SEG_n(1,YLUOUT(1),TZINIFILE(1),YINIFILEPGD(1),ZTSTEP_ALL)
! !
DO JMI=2,NMODEL DO JMI=2,NMODEL
CALL GOTO_MODEL(JMI) CALL GOTO_MODEL(JMI)
CALL INI_SEG_n(JMI,YLUOUT(JMI),YINIFILE(JMI),YINIFILEPGD(JMI),ZTSTEP_ALL) CALL INI_SEG_n(JMI,YLUOUT(JMI),TZINIFILE(JMI),YINIFILEPGD(JMI),ZTSTEP_ALL)
END DO END DO
! !
IF (CPROGRAM=='SPAWN ') THEN IF (CPROGRAM=='SPAWN ') THEN
...@@ -196,14 +196,14 @@ IF (CPROGRAM=='DIAG') CALL RESET_EXSEG(YLUOUT(1)) ...@@ -196,14 +196,14 @@ IF (CPROGRAM=='DIAG') CALL RESET_EXSEG(YLUOUT(1))
! !
DO JMI=1,NMODEL DO JMI=1,NMODEL
CALL GOTO_MODEL(JMI) CALL GOTO_MODEL(JMI)
CALL INI_SIZE_n(JMI,YLUOUT(JMI),YINIFILE(JMI),YINIFILEPGD(JMI)) CALL INI_SIZE_n(JMI,YLUOUT(JMI),TZINIFILE(JMI),YINIFILEPGD(JMI))
END DO END DO
! !
IF (CPROGRAM=='SPAWN ') THEN IF (CPROGRAM=='SPAWN ') THEN
DPTR_CLBCX=>CLBCX DPTR_CLBCX=>CLBCX
DPTR_CLBCY=>CLBCY DPTR_CLBCY=>CLBCY
CALL INI_PARAZ_ll(IINFO_ll) CALL INI_PARAZ_ll(IINFO_ll)
CALL INI_SIZE_SPAWN(DPTR_CLBCX,DPTR_CLBCY,CPRESOPT,NITR,YINIFILE(1)) CALL INI_SIZE_SPAWN(DPTR_CLBCX,DPTR_CLBCY,CPRESOPT,NITR,TZINIFILE(1)%CNAME)
END IF END IF
! !
! INITIALIZE data structures of ComLib ! INITIALIZE data structures of ComLib
...@@ -237,11 +237,11 @@ DO JMI=1,NMODEL ...@@ -237,11 +237,11 @@ DO JMI=1,NMODEL
CALL GO_TOMODEL_ll(JMI,IINFO_ll) CALL GO_TOMODEL_ll(JMI,IINFO_ll)
CALL GOTO_MODEL(JMI) CALL GOTO_MODEL(JMI)
IF (CPROGRAM/='SPEC ') THEN IF (CPROGRAM/='SPEC ') THEN
CALL INI_MODEL_n(JMI,YLUOUT(JMI),YINIFILE(JMI),YINIFILEPGD(JMI)) CALL INI_MODEL_n(JMI,YLUOUT(JMI),TZINIFILE(JMI)%CNAME,YINIFILEPGD(JMI))
!Call necessary to update the TFIELDLIST pointers to the data !Call necessary to update the TFIELDLIST pointers to the data
CALL FIELDLIST_GOTO_MODEL(JMI,JMI) CALL FIELDLIST_GOTO_MODEL(JMI,JMI)
ELSE ELSE
CALL INI_SPECTRE_n(JMI,YLUOUT(JMI),YINIFILE(JMI)) CALL INI_SPECTRE_n(JMI,YLUOUT(JMI),TZINIFILE(JMI)%CNAME)
END IF END IF
END DO END DO
! !
......
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