1 |
jmc |
1.46 |
C $Header: /u/gcmpack/MITgcm/model/src/initialise_fixed.F,v 1.45 2006/03/17 16:12:55 jmc Exp $ |
2 |
jmc |
1.11 |
C $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
edhill |
1.13 |
#include "PACKAGES_CONFIG.h" |
5 |
adcroft |
1.1 |
#include "CPP_OPTIONS.h" |
6 |
|
|
|
7 |
cnh |
1.8 |
CBOP |
8 |
|
|
C !ROUTINE: INITIALISE_FIXED |
9 |
|
|
C !INTERFACE: |
10 |
adcroft |
1.1 |
SUBROUTINE INITIALISE_FIXED(myThid) |
11 |
cnh |
1.8 |
|
12 |
|
|
C !DESCRIPTION: \bv |
13 |
|
|
C *==========================================================* |
14 |
|
|
C | SUBROUTINE INITIALISE_FIXED |
15 |
|
|
C | o Routine for setting fixed model arrays such as |
16 |
|
|
C | topography, grid, solver matrices, etc. |
17 |
|
|
C *==========================================================* |
18 |
|
|
C | INITIALISE_FIXED is invoked at the start of the model to |
19 |
|
|
C | set fixed model arrays. It reads data from an input file |
20 |
|
|
C | and from various binary files. |
21 |
|
|
C | Each thread invokes an instance of this routine as does |
22 |
|
|
C | each process in a multi-process parallel environment like |
23 |
|
|
C | MPI. |
24 |
|
|
C *==========================================================* |
25 |
|
|
C \ev |
26 |
|
|
|
27 |
|
|
C !CALLING SEQUENCE: |
28 |
|
|
C INITIALISE_FIXED |
29 |
|
|
C | |
30 |
jmc |
1.38 |
C |-- INI_PARMS |
31 |
|
|
C | |
32 |
edhill |
1.37 |
C |-- PACKAGES_BOOT |
33 |
|
|
C | |
34 |
|
|
C |-- PACKAGES_READPARMS |
35 |
jmc |
1.38 |
C | | |
36 |
jmc |
1.43 |
C | | - MNC_INIT + MNC_CW_INIT |
37 |
jmc |
1.38 |
C | | |
38 |
|
|
C | | - ${PKG}_READPARMS |
39 |
edhill |
1.32 |
C | |
40 |
jmc |
1.45 |
C |-- SET_PARMS |
41 |
|
|
C | |
42 |
jmc |
1.43 |
C |-- INI_MODEL_IO |
43 |
|
|
C | |
44 |
cnh |
1.8 |
C |-- MON_INIT |
45 |
|
|
C | |
46 |
|
|
C |-- INI_GRID |
47 |
|
|
C | |
48 |
jmc |
1.44 |
C |-- INI_EOS |
49 |
|
|
C | |
50 |
|
|
C |-- INI_PHIREF |
51 |
|
|
C | |
52 |
jmc |
1.38 |
C |-- INI_DEPTHS |
53 |
|
|
C | |
54 |
cnh |
1.8 |
C |-- INI_MASKS_ETC |
55 |
|
|
C | |
56 |
jmc |
1.15 |
C |-- PACKAGES_INIT_FIXED |
57 |
|
|
C | |
58 |
cnh |
1.8 |
C |-- PACKAGES_CHECK |
59 |
|
|
C | |
60 |
jmc |
1.12 |
C |-- INI_LINEAR_PHSURF |
61 |
|
|
C | |
62 |
|
|
C |-- INI_CORI |
63 |
cnh |
1.8 |
C | |
64 |
|
|
C |-- INI_CG2D |
65 |
|
|
C | |
66 |
|
|
C |-- INI_CG3D |
67 |
|
|
C | |
68 |
jmc |
1.9 |
C |-- CONFIG_CHECK |
69 |
|
|
C | |
70 |
cnh |
1.8 |
C |-- CONFIG_SUMMARY |
71 |
adcroft |
1.33 |
C | |
72 |
|
|
C |-- WRITE_GRID |
73 |
jmc |
1.38 |
C | |
74 |
|
|
C |-- CPL_EXCH_CONFIGS |
75 |
cnh |
1.8 |
|
76 |
|
|
C !USES: |
77 |
adcroft |
1.1 |
IMPLICIT NONE |
78 |
|
|
C == Global variables == |
79 |
|
|
#include "SIZE.h" |
80 |
|
|
#include "EEPARAMS.h" |
81 |
|
|
#include "PARAMS.h" |
82 |
|
|
|
83 |
cnh |
1.8 |
C !INPUT/OUTPUT PARAMETERS: |
84 |
adcroft |
1.1 |
C == Routine arguments == |
85 |
|
|
INTEGER myThid |
86 |
cnh |
1.8 |
CEOP |
87 |
adcroft |
1.1 |
|
88 |
jmc |
1.46 |
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 |
adcroft |
1.1 |
C-- Set model parameters. |
98 |
|
|
C Parameters are set to defaults and then updates are read from |
99 |
|
|
C an input file called data. |
100 |
adcroft |
1.2 |
CALL INI_PARMS( myThid ) |
101 |
adcroft |
1.1 |
_BARRIER |
102 |
cnh |
1.6 |
|
103 |
edhill |
1.37 |
C-- Configure packages |
104 |
|
|
CALL PACKAGES_BOOT( myThid ) |
105 |
|
|
|
106 |
|
|
C-- Read configuration parameters for packages |
107 |
|
|
CALL PACKAGES_READPARMS( myThid ) |
108 |
edhill |
1.26 |
|
109 |
jmc |
1.45 |
C-- Set (or reset) parameters (at this point, know which packages are used); |
110 |
|
|
C after this call, main model parameters are not supposed to be modified. |
111 |
|
|
CALL SET_PARMS( myThid ) |
112 |
|
|
|
113 |
jmc |
1.43 |
C-- Write units/set precision/etc for I/O of variables/arrays belonging |
114 |
|
|
C to the core dynamical model |
115 |
|
|
CALL INI_MODEL_IO( myThid ) |
116 |
|
|
|
117 |
edhill |
1.14 |
#ifdef ALLOW_MONITOR |
118 |
cnh |
1.6 |
C-- Initialise MONITOR I/O streams so we can report config. info |
119 |
|
|
CALL MON_INIT( myThid ) |
120 |
|
|
_BARRIER |
121 |
|
|
#endif |
122 |
adcroft |
1.1 |
|
123 |
|
|
C-- Set model grid. |
124 |
|
|
C Variables defining model grid spacing are defined. |
125 |
|
|
CALL INI_GRID( myThid ) |
126 |
mlosch |
1.10 |
_BARRIER |
127 |
edhill |
1.29 |
|
128 |
mlosch |
1.10 |
C-- Set equation of state parameters. |
129 |
|
|
CALL INI_EOS( myThid ) |
130 |
adcroft |
1.1 |
_BARRIER |
131 |
|
|
|
132 |
jmc |
1.44 |
C-- Set pressure/geopotential reference profile |
133 |
|
|
CALL INI_PHIREF( myThid ) |
134 |
|
|
_BARRIER |
135 |
|
|
|
136 |
adcroft |
1.1 |
C-- Initialise map of depths |
137 |
|
|
CALL INI_DEPTHS( myThid ) |
138 |
|
|
_BARRIER |
139 |
|
|
|
140 |
|
|
C-- Derive masks, lopping factors and recipricols of quantities. |
141 |
|
|
C Volumes and areas are set according to grid and depth map. |
142 |
|
|
CALL INI_MASKS_ETC( myThid ) |
143 |
|
|
_BARRIER |
144 |
jmc |
1.7 |
|
145 |
jmc |
1.15 |
C-- Call fixed data initialization phase of packages |
146 |
|
|
CALL PACKAGES_INIT_FIXED( myThid ) |
147 |
|
|
|
148 |
adcroft |
1.4 |
C-- Check dependances between packages |
149 |
|
|
CALL PACKAGES_CHECK( myThid ) |
150 |
adcroft |
1.1 |
|
151 |
jmc |
1.12 |
C-- Set Bo_surf => define the Linear Relation: Phi_surf(eta) |
152 |
|
|
CALL INI_LINEAR_PHISURF( myThid ) |
153 |
|
|
|
154 |
|
|
C-- Set coriolis operators |
155 |
|
|
CALL INI_CORI( myThid ) |
156 |
|
|
|
157 |
adcroft |
1.1 |
C-- Set laplace operators for use in 2D conjugate gradient solver. |
158 |
|
|
CALL INI_CG2D( myThid ) |
159 |
|
|
|
160 |
|
|
#ifdef ALLOW_NONHYDROSTATIC |
161 |
|
|
C-- Set laplace operators for use in 3D conjugate gradient solver. |
162 |
edhill |
1.13 |
ceh3 needs an IF ( useNONHYDROSTATIC ) THEN |
163 |
adcroft |
1.1 |
CALL INI_CG3D( myThid ) |
164 |
|
|
#endif |
165 |
jmc |
1.9 |
|
166 |
|
|
C-- Check parameters and model cofiguration |
167 |
|
|
CALL CONFIG_CHECK( myThid ) |
168 |
heimbach |
1.3 |
|
169 |
adcroft |
1.1 |
C-- Finally summarise the model cofiguration |
170 |
|
|
CALL CONFIG_SUMMARY( myThid ) |
171 |
adcroft |
1.30 |
|
172 |
|
|
C-- Write grid data and geometry arrays |
173 |
jmc |
1.43 |
IF ( debugLevel.GE.debLevA .OR. |
174 |
jmc |
1.41 |
& startTime.EQ.baseTime ) CALL WRITE_GRID( myThid ) |
175 |
jmc |
1.16 |
|
176 |
|
|
#ifdef COMPONENT_MODULE |
177 |
|
|
C-- Post component-model configuration information to coupler |
178 |
|
|
C and get config. info for other component(s). |
179 |
|
|
IF ( useCoupler ) CALL CPL_EXCH_CONFIGS( myThid ) |
180 |
edhill |
1.17 |
#endif |
181 |
|
|
|
182 |
jmc |
1.46 |
C-- Check barrier synchronization: |
183 |
|
|
CALL BAR_CHECK( 3, myThid ) |
184 |
|
|
|
185 |
edhill |
1.23 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
186 |
adcroft |
1.1 |
|
187 |
jmc |
1.12 |
RETURN |
188 |
adcroft |
1.1 |
END |