1 |
cnh |
1.20 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/initialise_varia.F,v 1.19 2001/09/19 13:58:08 jmc Exp $ |
2 |
jmc |
1.17 |
C $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
cnh |
1.20 |
CBOP |
7 |
|
|
C !ROUTINE: INITIALISE_VARIA |
8 |
|
|
C !INTERFACE: |
9 |
adcroft |
1.1 |
SUBROUTINE INITIALISE_VARIA(myThid) |
10 |
cnh |
1.20 |
C !DESCRIPTION: \bv |
11 |
|
|
C *==========================================================* |
12 |
|
|
C | SUBROUTINE INITIALISE_VARIA |
13 |
|
|
C | o Set the initial conditions for dynamics variables |
14 |
|
|
C | and time dependent arrays |
15 |
|
|
C *==========================================================* |
16 |
|
|
C | This routine reads/writes data from an input file and |
17 |
|
|
C | from various binary files. |
18 |
|
|
C | Each thread invokes an instance of this routine as does |
19 |
|
|
C | each process in a multi-process parallel environment like |
20 |
|
|
C | MPI. |
21 |
|
|
C *==========================================================* |
22 |
|
|
C \ev |
23 |
|
|
|
24 |
|
|
C !CALLING SEQUENCE: |
25 |
|
|
C INITIALISE_VARIA |
26 |
|
|
C | |
27 |
|
|
C |-- INI_LINEAR_PHISURF |
28 |
|
|
C | |
29 |
|
|
C |-- INI_CORI |
30 |
|
|
C | |
31 |
|
|
C |-- INI_CG2D |
32 |
|
|
C | |
33 |
|
|
C |-- INI_CG3D |
34 |
|
|
C | |
35 |
|
|
C |-- INI_MIXING |
36 |
|
|
C | |
37 |
|
|
C |-- INI_DYNVARS |
38 |
|
|
C | |
39 |
|
|
C |-- INI_FIELDS |
40 |
|
|
C | |
41 |
|
|
C |-- INI_TR1 |
42 |
|
|
C | |
43 |
|
|
C |-- THE_CORRECTION_STEP |
44 |
|
|
C | |
45 |
|
|
C |-- CALL CONVECTIVE_ADJUSTMENT_INI |
46 |
|
|
C | |
47 |
|
|
C |-- PACKAGES_INIT_VARIABLES |
48 |
|
|
C | |
49 |
|
|
C |-- CALC_SURF_DR |
50 |
|
|
C | |
51 |
|
|
C |-- UPDATE_SURF_DR |
52 |
|
|
C | |
53 |
|
|
C |-- UPDATE_CG2D |
54 |
|
|
C | |
55 |
|
|
C |-- STATE_SUMMARY |
56 |
|
|
C | |
57 |
|
|
C |-- TIMEAVE_STATVARS |
58 |
|
|
|
59 |
|
|
C !USES: |
60 |
adcroft |
1.1 |
IMPLICIT NONE |
61 |
|
|
C == Global variables == |
62 |
|
|
#include "SIZE.h" |
63 |
|
|
#include "EEPARAMS.h" |
64 |
|
|
#include "PARAMS.h" |
65 |
adcroft |
1.5 |
#include "DYNVARS.h" |
66 |
adcroft |
1.1 |
|
67 |
cnh |
1.20 |
C !INPUT/OUTPUT PARAMETERS: |
68 |
adcroft |
1.1 |
C == Routine arguments == |
69 |
|
|
INTEGER myThid |
70 |
|
|
|
71 |
cnh |
1.20 |
C !LOCAL VARIABLES: |
72 |
adcroft |
1.1 |
C == Local variables == |
73 |
adcroft |
1.5 |
INTEGER bi,bj,K,iMin,iMax,jMin,jMax |
74 |
cnh |
1.20 |
CEOP |
75 |
heimbach |
1.14 |
|
76 |
|
|
#ifdef ALLOW_TAMC_CHECKPOINTING |
77 |
heimbach |
1.15 |
|
78 |
|
|
nIter0 = INT( startTime/deltaTClock ) |
79 |
|
|
|
80 |
|
|
C-- Set Bo_surf => define the Linear Relation: Phi_surf(eta) |
81 |
|
|
CALL INI_LINEAR_PHISURF( myThid ) |
82 |
|
|
|
83 |
|
|
C-- Set coriolis operators |
84 |
|
|
CALL INI_CORI( myThid ) |
85 |
|
|
|
86 |
|
|
C-- Set laplace operators for use in 2D conjugate gradient solver. |
87 |
|
|
CALL INI_CG2D( myThid ) |
88 |
|
|
|
89 |
|
|
#ifdef ALLOW_NONHYDROSTATIC |
90 |
|
|
C-- Set laplace operators for use in 3D conjugate gradient solver. |
91 |
|
|
CALL INI_CG3D( myThid ) |
92 |
heimbach |
1.14 |
#endif |
93 |
adcroft |
1.1 |
|
94 |
heimbach |
1.15 |
#endif /* ALLOW_TAMC_CHECKPOINTING */ |
95 |
heimbach |
1.16 |
_BARRIER |
96 |
heimbach |
1.15 |
|
97 |
heimbach |
1.16 |
C-- Initialise 3-dim. diffusivities |
98 |
|
|
CALL INI_MIXING( myThid ) |
99 |
adcroft |
1.5 |
_BARRIER |
100 |
heimbach |
1.16 |
|
101 |
adcroft |
1.12 |
C-- Initialize DYNVARS arrays (state fields + G terms: Gu,Gv,...) to zero [always] |
102 |
|
|
CALL INI_DYNVARS( myThid ) |
103 |
|
|
|
104 |
adcroft |
1.1 |
C-- Initialise model fields. |
105 |
|
|
C Starting values of U, V, W, temp., salt. and tendency terms |
106 |
|
|
C are set here. Fields are either set to default or read from |
107 |
|
|
C stored files. |
108 |
|
|
CALL INI_FIELDS( myThid ) |
109 |
|
|
_BARRIER |
110 |
jmc |
1.8 |
|
111 |
heimbach |
1.15 |
#ifdef ALLOW_PASSIVE_TRACER |
112 |
heimbach |
1.13 |
C-- Initialise passive tracer(s) |
113 |
|
|
CALL INI_TR1( myThid ) |
114 |
|
|
_BARRIER |
115 |
heimbach |
1.15 |
#endif |
116 |
heimbach |
1.13 |
|
117 |
heimbach |
1.18 |
#ifndef ALLOW_AUTODIFF_TAMC |
118 |
heimbach |
1.11 |
IF ( usePickupBeforeC35 ) THEN |
119 |
jmc |
1.8 |
C-- IMPORTANT : Need to activate the following call to restart from |
120 |
|
|
C a pickup file written by MITgcmUV_checkpoint34 or earlier. |
121 |
heimbach |
1.11 |
IF ( startTime .NE. 0. ) THEN |
122 |
|
|
CALL THE_CORRECTION_STEP(startTime, nIter0, myThid) |
123 |
|
|
ENDIF |
124 |
|
|
ENDIF |
125 |
heimbach |
1.18 |
#endif |
126 |
adcroft |
1.1 |
|
127 |
adcroft |
1.5 |
C-- Initial conditions are convectively adjusted (for historical reasons) |
128 |
heimbach |
1.3 |
IF ( startTime .EQ. 0. ) THEN |
129 |
heimbach |
1.13 |
CADJ loop = parallel |
130 |
adcroft |
1.1 |
DO bj = myByLo(myThid), myByHi(myThid) |
131 |
heimbach |
1.13 |
CADJ loop = parallel |
132 |
adcroft |
1.1 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
133 |
adcroft |
1.5 |
iMin=1-Olx |
134 |
|
|
iMax=sNx+Olx |
135 |
|
|
jMin=1-Oly |
136 |
|
|
jMax=sNy+Oly |
137 |
heimbach |
1.11 |
CALL CONVECTIVE_ADJUSTMENT_INI( |
138 |
adcroft |
1.5 |
I bi, bj, iMin, iMax, jMin, jMax, |
139 |
jmc |
1.7 |
I startTime, nIter0, myThid ) |
140 |
adcroft |
1.1 |
ENDDO |
141 |
|
|
ENDDO |
142 |
adcroft |
1.5 |
_BARRIER |
143 |
|
|
END IF |
144 |
|
|
|
145 |
|
|
C-- Initialize variable data for packages |
146 |
|
|
CALL PACKAGES_INIT_VARIABLES( myThid ) |
147 |
jmc |
1.17 |
|
148 |
|
|
#ifdef NONLIN_FRSURF |
149 |
jmc |
1.19 |
C-- Compute the surface level thickness <-- function of etaH(n) |
150 |
jmc |
1.17 |
C and modify hFac(C,W,S) accordingly : |
151 |
|
|
IF (nonlinFreeSurf.GT.0) THEN |
152 |
jmc |
1.19 |
CALL CALC_SURF_DR(etaH, startTime, nIter0, myThid ) |
153 |
jmc |
1.17 |
CALL UPDATE_SURF_DR( startTime, nIter0, myThid ) |
154 |
|
|
ENDIF |
155 |
|
|
C- update also CG2D matrix (and preconditioner) |
156 |
|
|
IF ( nonlinFreeSurf.GT.2) THEN |
157 |
|
|
CALL UPDATE_CG2D( startTime, nIter0, myThid ) |
158 |
|
|
ENDIF |
159 |
|
|
#endif |
160 |
adcroft |
1.1 |
|
161 |
|
|
C-- Finally summarise the model state |
162 |
|
|
CALL STATE_SUMMARY( myThid ) |
163 |
|
|
|
164 |
jmc |
1.9 |
#ifdef ALLOW_TIMEAVE |
165 |
jmc |
1.7 |
C-- initialise time-average arrays with initial state values |
166 |
|
|
IF (taveFreq.GT.0.) THEN |
167 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
168 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
169 |
jmc |
1.9 |
CALL TIMEAVE_STATVARS(startTime, nIter0, bi, bj, myThid) |
170 |
jmc |
1.7 |
ENDDO |
171 |
|
|
ENDDO |
172 |
|
|
ENDIF |
173 |
jmc |
1.9 |
#endif /* ALLOW_TIMEAVE */ |
174 |
jmc |
1.7 |
|
175 |
|
|
RETURN |
176 |
adcroft |
1.1 |
END |