Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Méso-NH code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Méso-NH
Méso-NH code
Commits
d5d6211f
Commit
d5d6211f
authored
7 years ago
by
WAUTELET Philippe
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/MNH/ini_segn.f90
+44
-54
44 additions, 54 deletions
src/MNH/ini_segn.f90
src/MNH/ini_sizen.f90
+29
-52
29 additions, 52 deletions
src/MNH/ini_sizen.f90
src/MNH/init_mnh.f90
+13
-13
13 additions, 13 deletions
src/MNH/init_mnh.f90
with
86 additions
and
119 deletions
src/MNH/ini_segn.f90
+
44
−
54
View file @
d5d6211f
...
@@ -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
,
H
INIFILE
,
HINIFILEPGD
,
PTSTEP_ALL
)
SUBROUTINE
INI_SEG_n
(
KMI
,
HLUOUT
,
TP
INIFILE
,
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 OUP
T
UT-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
H
INIFILE
=
CINIFILE_n
Y
INIFILE
=
CINIFILE_n
CALL
FMOPEN_ll
(
H
INIFILE
,
'READ'
,
HLUOUT
,
0
,
2
,
NVERB
,
ININAR
,
IRESP
)
CALL
FMOPEN_ll
(
Y
INIFILE
,
'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
(
H
INIFILE
))//
'.des'
YDESFM
=
TRIM
(
ADJUSTL
(
Y
INIFILE
))//
'.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
! ------------------------------------------------
! ------------------------------------------------
!
!
T
Z
FILE
%
CNAME
=
H
INIFILE
T
PINI
FILE
%
CNAME
=
Y
INIFILE
!T
Z
FILE%CTYPE = ''
!T
PINI
FILE%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
(
T
Z
FILE
%
CNAME
))//
'.lfi'
)
TZFD
=>
GETFD
(
TRIM
(
ADJUSTL
(
T
PINI
FILE
%
CNAME
))//
'.lfi'
)
IF
(
.NOT.
ASSOCIATED
(
TZFD
))
CALL
PRINT_MSG
(
NVERB_FATAL
,
'IO'
,
'INI_SEG_n'
,
'file '
//
TRIM
(
T
Z
FILE
%
CNAME
)//
' not found'
)
IF
(
.NOT.
ASSOCIATED
(
TZFD
))
CALL
PRINT_MSG
(
NVERB_FATAL
,
'IO'
,
'INI_SEG_n'
,
'file '
//
TRIM
(
T
PINI
FILE
%
CNAME
)//
' not found'
)
IF
(
LIOCDF4
.AND.
.NOT.
LLFIREAD
)
THEN
IF
(
LIOCDF4
.AND.
.NOT.
LLFIREAD
)
THEN
T
Z
FILE
%
CFORMAT
=
'NETCDF4'
T
PINI
FILE
%
CFORMAT
=
'NETCDF4'
IF
(
ISP
==
TZFD
%
OWNER
)
T
Z
FILE
%
NNCID
=
TZFD
%
CDF
%
NCID
IF
(
ISP
==
TZFD
%
OWNER
)
T
PINI
FILE
%
NNCID
=
TZFD
%
CDF
%
NCID
ELSE
ELSE
T
Z
FILE
%
CFORMAT
=
'LFI'
T
PINI
FILE
%
CFORMAT
=
'LFI'
T
Z
FILE
%
NLFINPRAR
=
0
T
PINI
FILE
%
NLFINPRAR
=
0
IF
(
ISP
==
TZFD
%
OWNER
)
T
Z
FILE
%
NLFIFLU
=
TZFD
%
FLU
IF
(
ISP
==
TZFD
%
OWNER
)
T
PINI
FILE
%
NLFIFLU
=
TZFD
%
FLU
ENDIF
ENDIF
T
Z
FILE
%
CMODE
=
'READ'
T
PINI
FILE
%
CMODE
=
'READ'
T
Z
FILE
%
NLFITYPE
=
2
T
PINI
FILE
%
NLFITYPE
=
2
T
Z
FILE
%
NLFIVERB
=
NVERB
T
PINI
FILE
%
NLFIVERB
=
NVERB
CALL
IO_READ_FIELD
(
T
Z
FILE
,
'MASDEV'
,
IMASDEV
)
CALL
IO_READ_FIELD
(
T
PINI
FILE
,
'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
(
T
Z
FILE
,
'COUPLING'
,
LCOUPLING
)
CALL
IO_READ_FIELD
(
T
PINI
FILE
,
'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'
,
H
INIFILE
,
' was created with LCOUPLING=.TRUE.'
WRITE
(
ILUOUT
,
*
)
'The file'
,
Y
INIFILE
,
' 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
(
T
Z
FILE
,
'STORAGE_TYPE'
,
CSTORAGE_TYPE
)
CALL
IO_READ_FIELD
(
T
PINI
FILE
,
'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
(
T
Z
FILE
,
'CARTESIAN'
,
LCARTESIAN
)
CALL
IO_READ_FIELD
(
T
PINI
FILE
,
'CARTESIAN'
,
LCARTESIAN
)
! Read the thinshell approximation
! Read the thinshell approximation
CALL
IO_READ_FIELD
(
T
Z
FILE
,
'THINSHELL'
,
LTHINSHELL
)
CALL
IO_READ_FIELD
(
T
PINI
FILE
,
'THINSHELL'
,
LTHINSHELL
)
!
!
IF
(
IMASDEV
>=
46
)
THEN
IF
(
IMASDEV
>=
46
)
THEN
CALL
IO_READ_FIELD
(
T
Z
FILE
,
'L1D'
,
L1D
)
CALL
IO_READ_FIELD
(
T
PINI
FILE
,
'L1D'
,
L1D
)
IF
(
IRESP
/
=
0
)
L1D
=
.FALSE.
IF
(
IRESP
/
=
0
)
L1D
=
.FALSE.
!
!
CALL
IO_READ_FIELD
(
T
Z
FILE
,
'L2D'
,
L2D
)
CALL
IO_READ_FIELD
(
T
PINI
FILE
,
'L2D'
,
L2D
)
IF
(
IRESP
/
=
0
)
L2D
=
.FALSE.
IF
(
IRESP
/
=
0
)
L2D
=
.FALSE.
!
!
CALL
IO_READ_FIELD
(
T
Z
FILE
,
'PACK'
,
LPACK
)
CALL
IO_READ_FIELD
(
T
PINI
FILE
,
'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
(
T
Z
FILE
,
'LBOUSS'
,
LBOUSS
)
CALL
IO_READ_FIELD
(
T
PINI
FILE
,
'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.
...
...
This diff is collapsed.
Click to expand it.
src/MNH/ini_sizen.f90
+
29
−
52
View file @
d5d6211f
...
@@ -13,14 +13,14 @@
...
@@ -13,14 +13,14 @@
!
!
INTERFACE
INTERFACE
!
!
SUBROUTINE
INI_SIZE_n
(
KMI
,
HLUOUT
,
H
INIFILE
,
HINIFILEPGD
)
SUBROUTINE
INI_SIZE_n
(
KMI
,
HLUOUT
,
TP
INIFILE
,
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
)
::
H
INIFILE
! name of
CHARACTER
(
LEN
=*
),
INTENT
(
IN
)
::
H
LUOUT
!Name for output-listing of nested models
! the i
nitial file
TYPE
(
TFILEDATA
),
INTENT
(
IN
)
::
TPINIFILE
!I
nitial 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
,
H
INIFILE
,
HINIFILEPGD
)
SUBROUTINE
INI_SIZE_n
(
KMI
,
HLUOUT
,
TP
INIFILE
,
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
=
H
INIFILE
CINIFILE
=
TP
INIFILE
%
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='
,
H
INIFILE
,
' value JPHEXT='
,
IJPHEXT
WRITE
(
ILUOUT
,
FMT
=*
)
' different from LFI file='
,
TP
INIFILE
%
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
...
...
This diff is collapsed.
Click to expand it.
src/MNH/init_mnh.f90
+
13
−
13
View file @
d5d6211f
...
@@ -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
),
Y
INIFILE
(
1
),
YINIFILEPGD
(
1
),
ZTSTEP_ALL
)
CALL
INI_SEG_n
(
1
,
YLUOUT
(
1
),
TZ
INIFILE
(
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
),
Y
INIFILE
(
JMI
),
YINIFILEPGD
(
JMI
),
ZTSTEP_ALL
)
CALL
INI_SEG_n
(
JMI
,
YLUOUT
(
JMI
),
TZ
INIFILE
(
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
),
Y
INIFILE
(
JMI
),
YINIFILEPGD
(
JMI
))
CALL
INI_SIZE_n
(
JMI
,
YLUOUT
(
JMI
),
TZ
INIFILE
(
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
,
Y
INIFILE
(
1
))
CALL
INI_SIZE_SPAWN
(
DPTR_CLBCX
,
DPTR_CLBCY
,
CPRESOPT
,
NITR
,
TZ
INIFILE
(
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
),
Y
INIFILE
(
JMI
),
YINIFILEPGD
(
JMI
))
CALL
INI_MODEL_n
(
JMI
,
YLUOUT
(
JMI
),
TZ
INIFILE
(
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
),
Y
INIFILE
(
JMI
))
CALL
INI_SPECTRE_n
(
JMI
,
YLUOUT
(
JMI
),
TZ
INIFILE
(
JMI
)
%
CNAME
)
END
IF
END
IF
END
DO
END
DO
!
!
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment