Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
!-----------------------------------------------------------------
!--------------- special set of characters for RCS information
!-----------------------------------------------------------------
! $Source$ $Revision$
! masdev4_7 BUG1 2007/06/22 10:53:31
!-----------------------------------------------------------------
! ##############
PROGRAM MESONH
! ##############
!
!!**** *MESONH * -general monitor of the model
!!
!! PURPOSE
!! -------
!!
!! This program is the general monitor of the model. Firstly, it calls the
!! subroutine INIT, which performs the sequential initialization of the
!! nested models. Then, the program calls the temporal loops of all the
!! models, by calling a recursive function which make the temporal nesting
!! of the different nested models.
!!
!!** METHOD
!! ------
!!
!! The initialization is a sequentially performed together with the
!! temporal loop of all the nested models. The spatial nesting can be
!! performed in an arbitrary way, the only constrainst is for the first model
!! which must contain all the others. For the moment, only 8 models can be
!! runned at the time and the imbriquation level can also go to this upper
!! value.
!!
!!
!!
!! EXTERNAL
!! --------
!!
!! subroutine INIT : performs the sequential initialization of the nested
!! models
!! subroutine MODEL: choose the right MODELn to be called
!!
!! subroutine KID_MODEL: recursive function which calls the kid models
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!!
!! MODD_CONF: NMODEL, NMASDEV, CPROGRAM
!! MODD_CONF_n: CSTORAGE_TYPE
!!
!!
!! REFERENCE
!! ---------
!!
!! NONE
!!
!! AUTHOR
!! ------
!!
!! J. STEIN * METEO-FRANCE *
!!
!! MODIFICATIONS
!! -------------
!!
!! Original 20/10/94
!! J.Stein 08/12/94 clean the code and add the modules
!! J.Stein and P.Jabouille 30/04/96 add the storage_type
!! J.P.Lafore 11/07/96 multi-tasking introduction for nesting
!! J.P.Lafore 01/08/96 events implementation
!! J.P.Lafore 17/11/97 events modification for two-way nesting
!! J.Stein 08/07/98 sequential form for the nesting
!! J.Stein 08/04/99 general case of the sequential form
!! V. Masson 15/03/99 MASDEV number and PROGRAM name
!! J.P. Chaboureau 15/03/04 loop limited to 100000 iterations
!! remplaced by infinite loop
!! J.Escobar 19/03/2008 rename INIT to INIT_MNH --> grib problem
!-------------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
USE MODD_CONF
USE MODD_NESTING
USE MODD_CONF_n
!
USE MODI_MODEL_n
USE MODI_KID_MODEL
!
USE MODE_ll
USE MODE_IO_ll
USE MODE_MODELN_HANDLER
!
USE MODI_VERSION
USE MODI_INIT_MNH
USE MODI_DEALLOC_SURFEX
!
IMPLICIT NONE
!
!* 0.1 declarations of local variables
!
INTEGER :: JMODEL ! loop index
INTEGER :: ITEMP_MODEL1 ! loop increment
LOGICAL :: GEXIT ! flag for the end of the
! temporal loop
INTEGER :: IINFO_ll ! return code of // routines
!
!-------------------------------------------------------------------------------
!
!* 1. INITIALIZATION
! --------------
! Switch to model 1 variables
CALL GOTO_MODEL(1)
!
CALL INITIO_ll()
!
CALL VERSION
CPROGRAM='MESONH'
!
CALL INIT_MNH
!
!
GEXIT=.FALSE.
!
!-------------------------------------------------------------------------------
!
!* 2. TEMPORAL LOOP
! -------------
!
DO JMODEL=1,NMODEL
CALL GO_TOMODEL_ll(JMODEL,IINFO_ll)
CALL GOTO_MODEL(JMODEL)
CSTORAGE_TYPE='MT'
CALL MODEL_n(1,GEXIT)
END DO
!
IF(GEXIT) THEN
!callabortstop
CALL ABORT
STOP
ENDIF
!
ITEMP_MODEL1=1
DO
ITEMP_MODEL1=ITEMP_MODEL1+1
!
CALL GO_TOMODEL_ll(1,IINFO_ll)
CALL GOTO_MODEL(1)
CALL MODEL_n(ITEMP_MODEL1,GEXIT)
!
CALL KID_MODEL(1,ITEMP_MODEL1,GEXIT)
!
IF(GEXIT) EXIT
!
END DO
!
!-------------------------------------------------------------------------------
!
!* 3. FINALIZE THE PARALLEL SESSION
! -----------------------------
!
CALL END_PARA_ll(IINFO_ll)
!
!
CALL DEALLOC_SURFEX
!
!-------------------------------------------------------------------------------
!
!callabortstop
!CALL ABORT
STOP
!
END PROGRAM MESONH