1 |
heimbach |
1.13 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/initialise_varia.F,v 1.12 2001/05/29 14:01:37 adcroft Exp $ |
2 |
|
|
C $Name: checkpoint40pre1 $ |
3 |
adcroft |
1.1 |
|
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 |
adcroft |
1.5 |
#include "DYNVARS.h" |
26 |
adcroft |
1.1 |
|
27 |
|
|
C == Routine arguments == |
28 |
|
|
INTEGER myThid |
29 |
|
|
CEndOfInterface |
30 |
|
|
|
31 |
|
|
C == Local variables == |
32 |
adcroft |
1.5 |
INTEGER bi,bj,K,iMin,iMax,jMin,jMax |
33 |
adcroft |
1.1 |
|
34 |
adcroft |
1.5 |
_BARRIER |
35 |
adcroft |
1.12 |
C-- Initialize DYNVARS arrays (state fields + G terms: Gu,Gv,...) to zero [always] |
36 |
|
|
CALL INI_DYNVARS( myThid ) |
37 |
|
|
|
38 |
adcroft |
1.1 |
C-- Initialise model fields. |
39 |
|
|
C Starting values of U, V, W, temp., salt. and tendency terms |
40 |
|
|
C are set here. Fields are either set to default or read from |
41 |
|
|
C stored files. |
42 |
|
|
CALL INI_FIELDS( myThid ) |
43 |
|
|
_BARRIER |
44 |
jmc |
1.8 |
|
45 |
heimbach |
1.13 |
C-- Initialise passive tracer(s) |
46 |
|
|
CALL INI_TR1( myThid ) |
47 |
|
|
_BARRIER |
48 |
|
|
|
49 |
heimbach |
1.11 |
IF ( usePickupBeforeC35 ) THEN |
50 |
jmc |
1.8 |
C-- IMPORTANT : Need to activate the following call to restart from |
51 |
|
|
C a pickup file written by MITgcmUV_checkpoint34 or earlier. |
52 |
heimbach |
1.11 |
IF ( startTime .NE. 0. ) THEN |
53 |
|
|
CALL THE_CORRECTION_STEP(startTime, nIter0, myThid) |
54 |
|
|
ENDIF |
55 |
|
|
ENDIF |
56 |
adcroft |
1.1 |
|
57 |
adcroft |
1.5 |
C-- Initial conditions are convectively adjusted (for historical reasons) |
58 |
heimbach |
1.3 |
IF ( startTime .EQ. 0. ) THEN |
59 |
heimbach |
1.13 |
CADJ loop = parallel |
60 |
adcroft |
1.1 |
DO bj = myByLo(myThid), myByHi(myThid) |
61 |
heimbach |
1.13 |
CADJ loop = parallel |
62 |
adcroft |
1.1 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
63 |
adcroft |
1.5 |
iMin=1-Olx |
64 |
|
|
iMax=sNx+Olx |
65 |
|
|
jMin=1-Oly |
66 |
|
|
jMax=sNy+Oly |
67 |
heimbach |
1.11 |
CALL CONVECTIVE_ADJUSTMENT_INI( |
68 |
adcroft |
1.5 |
I bi, bj, iMin, iMax, jMin, jMax, |
69 |
jmc |
1.7 |
I startTime, nIter0, myThid ) |
70 |
adcroft |
1.1 |
ENDDO |
71 |
|
|
ENDDO |
72 |
adcroft |
1.5 |
_BARRIER |
73 |
|
|
END IF |
74 |
|
|
|
75 |
|
|
C-- Initialize variable data for packages |
76 |
|
|
CALL PACKAGES_INIT_VARIABLES( myThid ) |
77 |
adcroft |
1.1 |
|
78 |
|
|
C-- Finally summarise the model state |
79 |
|
|
CALL STATE_SUMMARY( myThid ) |
80 |
|
|
|
81 |
jmc |
1.9 |
#ifdef ALLOW_TIMEAVE |
82 |
jmc |
1.7 |
C-- initialise time-average arrays with initial state values |
83 |
|
|
IF (taveFreq.GT.0.) THEN |
84 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
85 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
86 |
jmc |
1.9 |
CALL TIMEAVE_STATVARS(startTime, nIter0, bi, bj, myThid) |
87 |
jmc |
1.7 |
ENDDO |
88 |
|
|
ENDDO |
89 |
|
|
ENDIF |
90 |
jmc |
1.9 |
#endif /* ALLOW_TIMEAVE */ |
91 |
jmc |
1.7 |
|
92 |
adcroft |
1.12 |
#ifdef EXACT_CONSERV |
93 |
|
|
IF (exactConserv) THEN |
94 |
|
|
C-- Compute the initial Barotropic Flow Divergence : |
95 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
96 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
97 |
|
|
CALL CALC_EXACT_ETA( bi,bj, uVel,vVel, |
98 |
|
|
I startTime, nIter0, myThid ) |
99 |
|
|
ENDDO |
100 |
|
|
ENDDO |
101 |
|
|
ENDIF |
102 |
|
|
#endif /* EXACT_CONSERV */ |
103 |
|
|
|
104 |
jmc |
1.7 |
RETURN |
105 |
adcroft |
1.1 |
END |