1 |
jmc |
1.51 |
C $Header: /u/gcmpack/MITgcm/model/src/initialise_fixed.F,v 1.50 2009/07/08 22:10:01 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 |
jmc |
1.48 |
SUBROUTINE INITIALISE_FIXED( myThid ) |
11 |
cnh |
1.8 |
|
12 |
|
|
C !DESCRIPTION: \bv |
13 |
|
|
C *==========================================================* |
14 |
jmc |
1.49 |
C | SUBROUTINE INITIALISE_FIXED |
15 |
|
|
C | o Routine for setting fixed model arrays such as |
16 |
|
|
C | topography, grid, solver matrices, etc. |
17 |
cnh |
1.8 |
C *==========================================================* |
18 |
jmc |
1.49 |
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 |
cnh |
1.8 |
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.50 |
C | |- ${PKG}_READPARMS |
36 |
edhill |
1.32 |
C | |
37 |
jmc |
1.45 |
C |-- SET_PARMS |
38 |
|
|
C | |
39 |
jmc |
1.43 |
C |-- INI_MODEL_IO |
40 |
jmc |
1.50 |
C | |- MNC_INIT + MNC_CW_INIT |
41 |
|
|
C | |- MON_INIT |
42 |
cnh |
1.8 |
C | |
43 |
|
|
C |-- INI_GRID |
44 |
|
|
C | |
45 |
jmc |
1.49 |
C |-- LOAD_REF_FILES |
46 |
|
|
C | |
47 |
jmc |
1.44 |
C |-- INI_EOS |
48 |
|
|
C | |
49 |
jmc |
1.49 |
C |-- SET_REF_STATE |
50 |
|
|
C | |
51 |
|
|
C |-- SET_GRID_FACTORS |
52 |
jmc |
1.44 |
C | |
53 |
jmc |
1.38 |
C |-- INI_DEPTHS |
54 |
|
|
C | |
55 |
cnh |
1.8 |
C |-- INI_MASKS_ETC |
56 |
|
|
C | |
57 |
jmc |
1.15 |
C |-- PACKAGES_INIT_FIXED |
58 |
jmc |
1.50 |
C | |- ${PKG}_INIT_FIXED |
59 |
jmc |
1.15 |
C | |
60 |
jmc |
1.51 |
C |-- INI_LINEAR_PHISURF |
61 |
jmc |
1.12 |
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.48 |
C |-- CONFIG_SUMMARY |
69 |
|
|
C | |
70 |
|
|
C |-- PACKAGES_CHECK |
71 |
jmc |
1.51 |
C | |- ${PKG}_CHECK |
72 |
jmc |
1.48 |
C | |
73 |
jmc |
1.9 |
C |-- CONFIG_CHECK |
74 |
|
|
C | |
75 |
adcroft |
1.33 |
C |-- WRITE_GRID |
76 |
jmc |
1.38 |
C | |
77 |
|
|
C |-- CPL_EXCH_CONFIGS |
78 |
cnh |
1.8 |
|
79 |
|
|
C !USES: |
80 |
adcroft |
1.1 |
IMPLICIT NONE |
81 |
|
|
C == Global variables == |
82 |
|
|
#include "SIZE.h" |
83 |
|
|
#include "EEPARAMS.h" |
84 |
|
|
#include "PARAMS.h" |
85 |
|
|
|
86 |
cnh |
1.8 |
C !INPUT/OUTPUT PARAMETERS: |
87 |
adcroft |
1.1 |
C == Routine arguments == |
88 |
|
|
INTEGER myThid |
89 |
cnh |
1.8 |
CEOP |
90 |
adcroft |
1.1 |
|
91 |
jmc |
1.46 |
C- here is a way to deliberately break the barrier syncronization |
92 |
|
|
C by adding a BARRIER on thread XXX only ; Used to test BAR_CHECK. |
93 |
|
|
c IF ( myThid.EQ.XXX ) THEN |
94 |
|
|
c _BARRIER |
95 |
|
|
c CALL SYSTEM('sleep 1') |
96 |
|
|
c ENDIF |
97 |
|
|
C-- Check barrier synchronization: |
98 |
|
|
CALL BAR_CHECK( 2, myThid ) |
99 |
|
|
|
100 |
adcroft |
1.1 |
C-- Set model parameters. |
101 |
|
|
C Parameters are set to defaults and then updates are read from |
102 |
|
|
C an input file called data. |
103 |
adcroft |
1.2 |
CALL INI_PARMS( myThid ) |
104 |
cnh |
1.6 |
|
105 |
edhill |
1.37 |
C-- Configure packages |
106 |
|
|
CALL PACKAGES_BOOT( myThid ) |
107 |
|
|
|
108 |
|
|
C-- Read configuration parameters for packages |
109 |
|
|
CALL PACKAGES_READPARMS( myThid ) |
110 |
edhill |
1.26 |
|
111 |
jmc |
1.45 |
C-- Set (or reset) parameters (at this point, know which packages are used); |
112 |
|
|
C after this call, main model parameters are not supposed to be modified. |
113 |
|
|
CALL SET_PARMS( myThid ) |
114 |
|
|
|
115 |
jmc |
1.50 |
C-- Write units/set precision/etc for I/O (pickup, MDS/RW, MNC, MONITOR): |
116 |
jmc |
1.43 |
CALL INI_MODEL_IO( myThid ) |
117 |
|
|
|
118 |
adcroft |
1.1 |
C-- Set model grid. |
119 |
|
|
C Variables defining model grid spacing are defined. |
120 |
|
|
CALL INI_GRID( myThid ) |
121 |
edhill |
1.29 |
|
122 |
jmc |
1.49 |
C-- Load reference profiles from files |
123 |
|
|
CALL LOAD_REF_FILES( myThid ) |
124 |
|
|
|
125 |
mlosch |
1.10 |
C-- Set equation of state parameters. |
126 |
|
|
CALL INI_EOS( myThid ) |
127 |
adcroft |
1.1 |
|
128 |
jmc |
1.49 |
C-- Set reference state (vertical reference profiles) |
129 |
|
|
CALL SET_REF_STATE( myThid ) |
130 |
|
|
|
131 |
|
|
C-- Set remaining grid factors |
132 |
|
|
CALL SET_GRID_FACTORS( myThid ) |
133 |
jmc |
1.44 |
|
134 |
adcroft |
1.1 |
C-- Initialise map of depths |
135 |
|
|
CALL INI_DEPTHS( myThid ) |
136 |
|
|
|
137 |
|
|
C-- Derive masks, lopping factors and recipricols of quantities. |
138 |
|
|
C Volumes and areas are set according to grid and depth map. |
139 |
|
|
CALL INI_MASKS_ETC( myThid ) |
140 |
jmc |
1.47 |
|
141 |
|
|
C-- Synchronize all threads after setting masks and before pkgs init. |
142 |
adcroft |
1.1 |
_BARRIER |
143 |
jmc |
1.7 |
|
144 |
jmc |
1.15 |
C-- Call fixed data initialization phase of packages |
145 |
|
|
CALL PACKAGES_INIT_FIXED( myThid ) |
146 |
|
|
|
147 |
jmc |
1.12 |
C-- Set Bo_surf => define the Linear Relation: Phi_surf(eta) |
148 |
|
|
CALL INI_LINEAR_PHISURF( myThid ) |
149 |
|
|
|
150 |
|
|
C-- Set coriolis operators |
151 |
|
|
CALL INI_CORI( myThid ) |
152 |
|
|
|
153 |
adcroft |
1.1 |
C-- Set laplace operators for use in 2D conjugate gradient solver. |
154 |
|
|
CALL INI_CG2D( myThid ) |
155 |
|
|
|
156 |
|
|
#ifdef ALLOW_NONHYDROSTATIC |
157 |
|
|
C-- Set laplace operators for use in 3D conjugate gradient solver. |
158 |
|
|
CALL INI_CG3D( myThid ) |
159 |
|
|
#endif |
160 |
jmc |
1.9 |
|
161 |
jmc |
1.48 |
C-- Finally summarise the model configuration |
162 |
|
|
CALL CONFIG_SUMMARY( myThid ) |
163 |
|
|
|
164 |
|
|
C-- Check packages configuration (& print summary) |
165 |
|
|
CALL PACKAGES_CHECK( myThid ) |
166 |
|
|
|
167 |
|
|
C-- Check parameters and model configuration |
168 |
jmc |
1.9 |
CALL CONFIG_CHECK( myThid ) |
169 |
heimbach |
1.3 |
|
170 |
adcroft |
1.30 |
C-- Write grid data and geometry arrays |
171 |
jmc |
1.43 |
IF ( debugLevel.GE.debLevA .OR. |
172 |
jmc |
1.41 |
& startTime.EQ.baseTime ) CALL WRITE_GRID( myThid ) |
173 |
jmc |
1.16 |
|
174 |
|
|
#ifdef COMPONENT_MODULE |
175 |
|
|
C-- Post component-model configuration information to coupler |
176 |
|
|
C and get config. info for other component(s). |
177 |
|
|
IF ( useCoupler ) CALL CPL_EXCH_CONFIGS( myThid ) |
178 |
edhill |
1.17 |
#endif |
179 |
|
|
|
180 |
jmc |
1.46 |
C-- Check barrier synchronization: |
181 |
|
|
CALL BAR_CHECK( 3, myThid ) |
182 |
|
|
|
183 |
edhill |
1.23 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
184 |
adcroft |
1.1 |
|
185 |
jmc |
1.12 |
RETURN |
186 |
adcroft |
1.1 |
END |