1 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/initialise_varia.F,v 1.13 2001/07/13 14:26:57 heimbach Exp $ |
2 |
C $Name: checkpoint40pre2 $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CStartOfInterface |
7 |
SUBROUTINE INITIALISE_VARIA(myThid) |
8 |
C /==========================================================\ |
9 |
C | SUBROUTINE INITIALISE_VARIA | |
10 |
C | o Set the initial conditions for dynamics variables | |
11 |
C | and time dependent arrays | |
12 |
C |==========================================================| |
13 |
C | This routine reads/writes data from an input file and | |
14 |
C | from various binary files. | |
15 |
C | Each thread invokes an instance of this routine as does | |
16 |
C | each process in a multi-process parallel environment like| |
17 |
C | MPI. | |
18 |
C \==========================================================/ |
19 |
IMPLICIT NONE |
20 |
|
21 |
C == Global variables == |
22 |
#include "SIZE.h" |
23 |
#include "EEPARAMS.h" |
24 |
#include "PARAMS.h" |
25 |
#include "DYNVARS.h" |
26 |
|
27 |
C == Routine arguments == |
28 |
INTEGER myThid |
29 |
CEndOfInterface |
30 |
|
31 |
C == Local variables == |
32 |
INTEGER bi,bj,K,iMin,iMax,jMin,jMax |
33 |
|
34 |
#ifdef ALLOW_TAMC_CHECKPOINTING |
35 |
nIter0 = INT( startTime/deltaTClock ) |
36 |
#endif |
37 |
|
38 |
_BARRIER |
39 |
C-- Initialize DYNVARS arrays (state fields + G terms: Gu,Gv,...) to zero [always] |
40 |
CALL INI_DYNVARS( myThid ) |
41 |
|
42 |
C-- Initialise model fields. |
43 |
C Starting values of U, V, W, temp., salt. and tendency terms |
44 |
C are set here. Fields are either set to default or read from |
45 |
C stored files. |
46 |
CALL INI_FIELDS( myThid ) |
47 |
_BARRIER |
48 |
|
49 |
C-- Initialise passive tracer(s) |
50 |
CALL INI_TR1( myThid ) |
51 |
_BARRIER |
52 |
|
53 |
IF ( usePickupBeforeC35 ) THEN |
54 |
C-- IMPORTANT : Need to activate the following call to restart from |
55 |
C a pickup file written by MITgcmUV_checkpoint34 or earlier. |
56 |
IF ( startTime .NE. 0. ) THEN |
57 |
CALL THE_CORRECTION_STEP(startTime, nIter0, myThid) |
58 |
ENDIF |
59 |
ENDIF |
60 |
|
61 |
C-- Initial conditions are convectively adjusted (for historical reasons) |
62 |
IF ( startTime .EQ. 0. ) THEN |
63 |
CADJ loop = parallel |
64 |
DO bj = myByLo(myThid), myByHi(myThid) |
65 |
CADJ loop = parallel |
66 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
67 |
iMin=1-Olx |
68 |
iMax=sNx+Olx |
69 |
jMin=1-Oly |
70 |
jMax=sNy+Oly |
71 |
CALL CONVECTIVE_ADJUSTMENT_INI( |
72 |
I bi, bj, iMin, iMax, jMin, jMax, |
73 |
I startTime, nIter0, myThid ) |
74 |
ENDDO |
75 |
ENDDO |
76 |
_BARRIER |
77 |
END IF |
78 |
|
79 |
C-- Initialize variable data for packages |
80 |
CALL PACKAGES_INIT_VARIABLES( myThid ) |
81 |
|
82 |
C-- Finally summarise the model state |
83 |
CALL STATE_SUMMARY( myThid ) |
84 |
|
85 |
#ifdef ALLOW_TIMEAVE |
86 |
C-- initialise time-average arrays with initial state values |
87 |
IF (taveFreq.GT.0.) THEN |
88 |
DO bj=myByLo(myThid),myByHi(myThid) |
89 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
90 |
CALL TIMEAVE_STATVARS(startTime, nIter0, bi, bj, myThid) |
91 |
ENDDO |
92 |
ENDDO |
93 |
ENDIF |
94 |
#endif /* ALLOW_TIMEAVE */ |
95 |
|
96 |
#ifdef EXACT_CONSERV |
97 |
IF (exactConserv) THEN |
98 |
C-- Compute the initial Barotropic Flow Divergence : |
99 |
DO bj=myByLo(myThid),myByHi(myThid) |
100 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
101 |
CALL CALC_EXACT_ETA( bi,bj, uVel,vVel, |
102 |
I startTime, nIter0, myThid ) |
103 |
ENDDO |
104 |
ENDDO |
105 |
ENDIF |
106 |
#endif /* EXACT_CONSERV */ |
107 |
|
108 |
RETURN |
109 |
END |