7 |
CBOP |
CBOP |
8 |
C !ROUTINE: INITIALISE_FIXED |
C !ROUTINE: INITIALISE_FIXED |
9 |
C !INTERFACE: |
C !INTERFACE: |
10 |
SUBROUTINE INITIALISE_FIXED(myThid) |
SUBROUTINE INITIALISE_FIXED( myThid ) |
11 |
|
|
12 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
13 |
C *==========================================================* |
C *==========================================================* |
29 |
C | |
C | |
30 |
C |-- INI_PARMS |
C |-- INI_PARMS |
31 |
C | |
C | |
32 |
|
C |-- PACKAGES_BOOT |
33 |
|
C | |
34 |
|
C |-- PACKAGES_READPARMS |
35 |
|
C | | |
36 |
|
C | | - MNC_INIT + MNC_CW_INIT |
37 |
|
C | | |
38 |
|
C | | - ${PKG}_READPARMS |
39 |
|
C | |
40 |
|
C |-- SET_PARMS |
41 |
|
C | |
42 |
|
C |-- INI_MODEL_IO |
43 |
|
C | |
44 |
C |-- MON_INIT |
C |-- MON_INIT |
45 |
C | |
C | |
46 |
C |-- INI_GRID |
C |-- INI_GRID |
47 |
C | |
C | |
48 |
C |-- INI_EOS |
C |-- INI_EOS |
49 |
C | |
C | |
50 |
|
C |-- INI_PHIREF |
51 |
|
C | |
52 |
C |-- INI_DEPTHS |
C |-- INI_DEPTHS |
53 |
C | |
C | |
54 |
C |-- INI_MASKS_ETC |
C |-- INI_MASKS_ETC |
55 |
C | |
C | |
|
C |-- PACKAGES_BOOT |
|
|
C | |
|
|
C |-- PACKAGES_READPARMS |
|
|
C | |
|
56 |
C |-- PACKAGES_INIT_FIXED |
C |-- PACKAGES_INIT_FIXED |
57 |
C | |
C | |
|
C |-- PACKAGES_CHECK |
|
|
C | |
|
58 |
C |-- INI_LINEAR_PHSURF |
C |-- INI_LINEAR_PHSURF |
59 |
C | |
C | |
60 |
C |-- INI_CORI |
C |-- INI_CORI |
63 |
C | |
C | |
64 |
C |-- INI_CG3D |
C |-- INI_CG3D |
65 |
C | |
C | |
66 |
|
C |-- CONFIG_SUMMARY |
67 |
|
C | |
68 |
|
C |-- PACKAGES_CHECK |
69 |
|
C | |
70 |
C |-- CONFIG_CHECK |
C |-- CONFIG_CHECK |
71 |
C | |
C | |
72 |
C |-- CONFIG_SUMMARY |
C |-- WRITE_GRID |
73 |
|
C | |
74 |
|
C |-- CPL_EXCH_CONFIGS |
75 |
|
|
76 |
C !USES: |
C !USES: |
77 |
IMPLICIT NONE |
IMPLICIT NONE |
85 |
INTEGER myThid |
INTEGER myThid |
86 |
CEOP |
CEOP |
87 |
|
|
88 |
|
C- here is a way to deliberately break the barrier syncronization |
89 |
|
C by adding a BARRIER on thread XXX only ; Used to test BAR_CHECK. |
90 |
|
c IF ( myThid.EQ.XXX ) THEN |
91 |
|
c _BARRIER |
92 |
|
c CALL SYSTEM('sleep 1') |
93 |
|
c ENDIF |
94 |
|
C-- Check barrier synchronization: |
95 |
|
CALL BAR_CHECK( 2, myThid ) |
96 |
|
|
97 |
C-- Set model parameters. |
C-- Set model parameters. |
98 |
C Parameters are set to defaults and then updates are read from |
C Parameters are set to defaults and then updates are read from |
99 |
C an input file called data. |
C an input file called data. |
100 |
CALL INI_PARMS( myThid ) |
CALL INI_PARMS( myThid ) |
|
_BARRIER |
|
101 |
|
|
102 |
#ifdef ALLOW_MNC |
C-- Configure packages |
103 |
C Initialize MNC look-up tables |
CALL PACKAGES_BOOT( myThid ) |
104 |
write(*,*) 'INITIALISE_FIXED: useMNC = ',useMNC |
|
105 |
IF (useMNC) THEN |
C-- Read configuration parameters for packages |
106 |
CALL MNC_INIT(myThid) |
CALL PACKAGES_READPARMS( myThid ) |
107 |
CALL MNC_CW_INIT(sNx,sNy,OLx,OLy,nSx,nSy,nPx,nPy,Nr, myThid) |
|
108 |
CALL INI_MNC_IO(myThid) |
C-- Set (or reset) parameters (at this point, know which packages are used); |
109 |
IF ( mnc_echo_gtypes ) THEN |
C after this call, main model parameters are not supposed to be modified. |
110 |
CALL MNC_CW_DUMP( myThid ) |
CALL SET_PARMS( myThid ) |
111 |
ENDIF |
|
112 |
ENDIF |
C-- Write units/set precision/etc for I/O of variables/arrays belonging |
113 |
#endif |
C to the core dynamical model |
114 |
|
CALL INI_MODEL_IO( myThid ) |
115 |
|
|
116 |
#ifdef ALLOW_MONITOR |
#ifdef ALLOW_MONITOR |
117 |
C-- Initialise MONITOR I/O streams so we can report config. info |
C-- Initialise MONITOR I/O streams so we can report config. info |
118 |
CALL MON_INIT( myThid ) |
CALL MON_INIT( myThid ) |
|
_BARRIER |
|
119 |
#endif |
#endif |
120 |
|
|
121 |
C-- Set model grid. |
C-- Set model grid. |
122 |
C Variables defining model grid spacing are defined. |
C Variables defining model grid spacing are defined. |
123 |
CALL INI_GRID( myThid ) |
CALL INI_GRID( myThid ) |
|
_BARRIER |
|
124 |
|
|
125 |
C-- Set equation of state parameters. |
C-- Set equation of state parameters. |
126 |
CALL INI_EOS( myThid ) |
CALL INI_EOS( myThid ) |
127 |
_BARRIER |
|
128 |
|
C-- Set pressure/geopotential reference profile |
129 |
|
CALL INI_PHIREF( myThid ) |
130 |
|
|
131 |
C-- Initialise map of depths |
C-- Initialise map of depths |
132 |
CALL INI_DEPTHS( myThid ) |
CALL INI_DEPTHS( myThid ) |
|
_BARRIER |
|
133 |
|
|
134 |
C-- Derive masks, lopping factors and recipricols of quantities. |
C-- Derive masks, lopping factors and recipricols of quantities. |
135 |
C Volumes and areas are set according to grid and depth map. |
C Volumes and areas are set according to grid and depth map. |
136 |
CALL INI_MASKS_ETC( myThid ) |
CALL INI_MASKS_ETC( myThid ) |
|
_BARRIER |
|
|
|
|
|
C-- Configure packages |
|
|
CALL PACKAGES_BOOT( myThid ) |
|
137 |
|
|
138 |
C-- Read configuration parameters for packages |
C-- Synchronize all threads after setting masks and before pkgs init. |
139 |
CALL PACKAGES_READPARMS( myThid ) |
_BARRIER |
140 |
|
|
141 |
C-- Call fixed data initialization phase of packages |
C-- Call fixed data initialization phase of packages |
142 |
CALL PACKAGES_INIT_FIXED( myThid ) |
CALL PACKAGES_INIT_FIXED( myThid ) |
143 |
|
|
|
C-- Check dependances between packages |
|
|
CALL PACKAGES_CHECK( myThid ) |
|
|
|
|
144 |
C-- Set Bo_surf => define the Linear Relation: Phi_surf(eta) |
C-- Set Bo_surf => define the Linear Relation: Phi_surf(eta) |
145 |
CALL INI_LINEAR_PHISURF( myThid ) |
CALL INI_LINEAR_PHISURF( myThid ) |
146 |
|
|
152 |
|
|
153 |
#ifdef ALLOW_NONHYDROSTATIC |
#ifdef ALLOW_NONHYDROSTATIC |
154 |
C-- Set laplace operators for use in 3D conjugate gradient solver. |
C-- Set laplace operators for use in 3D conjugate gradient solver. |
|
ceh3 needs an IF ( useNONHYDROSTATIC ) THEN |
|
155 |
CALL INI_CG3D( myThid ) |
CALL INI_CG3D( myThid ) |
156 |
#endif |
#endif |
157 |
|
|
158 |
C-- Check parameters and model cofiguration |
C-- Finally summarise the model configuration |
159 |
|
CALL CONFIG_SUMMARY( myThid ) |
160 |
|
|
161 |
|
C-- Check packages configuration (& print summary) |
162 |
|
CALL PACKAGES_CHECK( myThid ) |
163 |
|
|
164 |
|
C-- Check parameters and model configuration |
165 |
CALL CONFIG_CHECK( myThid ) |
CALL CONFIG_CHECK( myThid ) |
166 |
|
|
167 |
C-- Finally summarise the model cofiguration |
C-- Write grid data and geometry arrays |
168 |
CALL CONFIG_SUMMARY( myThid ) |
IF ( debugLevel.GE.debLevA .OR. |
169 |
|
& startTime.EQ.baseTime ) CALL WRITE_GRID( myThid ) |
170 |
|
|
171 |
#ifdef COMPONENT_MODULE |
#ifdef COMPONENT_MODULE |
172 |
C-- Post component-model configuration information to coupler |
C-- Post component-model configuration information to coupler |
174 |
IF ( useCoupler ) CALL CPL_EXCH_CONFIGS( myThid ) |
IF ( useCoupler ) CALL CPL_EXCH_CONFIGS( myThid ) |
175 |
#endif |
#endif |
176 |
|
|
177 |
|
C-- Check barrier synchronization: |
178 |
|
CALL BAR_CHECK( 3, myThid ) |
179 |
|
|
180 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
181 |
|
|
182 |
RETURN |
RETURN |