1 |
C $Header$ |
C $Header$ |
2 |
|
C $Name$ |
3 |
|
|
4 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
5 |
|
|
22 |
#include "SIZE.h" |
#include "SIZE.h" |
23 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
24 |
#include "PARAMS.h" |
#include "PARAMS.h" |
25 |
|
#include "DYNVARS.h" |
26 |
|
|
27 |
C == Routine arguments == |
C == Routine arguments == |
28 |
INTEGER myThid |
INTEGER myThid |
29 |
CEndOfInterface |
CEndOfInterface |
30 |
|
|
31 |
C == Local variables == |
C == Local variables == |
32 |
#ifdef ALLOW_OBCS |
INTEGER bi,bj,K,iMin,iMax,jMin,jMax |
33 |
INTEGER bi,bj,K |
|
34 |
|
#ifdef ALLOW_TAMC_CHECKPOINTING |
35 |
|
|
36 |
|
nIter0 = INT( startTime/deltaTClock ) |
37 |
|
|
38 |
|
C-- Set Bo_surf => define the Linear Relation: Phi_surf(eta) |
39 |
|
CALL INI_LINEAR_PHISURF( myThid ) |
40 |
|
|
41 |
|
C-- Set coriolis operators |
42 |
|
CALL INI_CORI( myThid ) |
43 |
|
|
44 |
|
C-- Set laplace operators for use in 2D conjugate gradient solver. |
45 |
|
CALL INI_CG2D( myThid ) |
46 |
|
|
47 |
|
#ifdef ALLOW_NONHYDROSTATIC |
48 |
|
C-- Set laplace operators for use in 3D conjugate gradient solver. |
49 |
|
CALL INI_CG3D( myThid ) |
50 |
#endif |
#endif |
51 |
|
|
52 |
#ifdef ALLOW_KPP |
#endif /* ALLOW_TAMC_CHECKPOINTING */ |
53 |
C-- Initialize kppmix vertical mixing scheme. |
_BARRIER |
54 |
CALL KMIXINIT( myThid ) |
|
55 |
|
C-- Initialise 3-dim. diffusivities |
56 |
|
CALL INI_MIXING( myThid ) |
57 |
_BARRIER |
_BARRIER |
58 |
#endif |
|
59 |
|
C-- Initialize DYNVARS arrays (state fields + G terms: Gu,Gv,...) to zero [always] |
60 |
|
CALL INI_DYNVARS( myThid ) |
61 |
|
|
62 |
C-- Initialise model fields. |
C-- Initialise model fields. |
63 |
C Starting values of U, V, W, temp., salt. and tendency terms |
C Starting values of U, V, W, temp., salt. and tendency terms |
66 |
CALL INI_FIELDS( myThid ) |
CALL INI_FIELDS( myThid ) |
67 |
_BARRIER |
_BARRIER |
68 |
|
|
69 |
C-- Initialise time-stepping (predictor variables are carried in G) |
#ifdef ALLOW_PASSIVE_TRACER |
70 |
IF ( startTime .EQ. 0. ) |
C-- Initialise passive tracer(s) |
71 |
& CALL INI_PREDICTOR( myThid ) |
CALL INI_TR1( myThid ) |
72 |
_BARRIER |
_BARRIER |
73 |
|
#endif |
74 |
|
|
75 |
C-- Custom routine to set forcing fields |
#ifndef ALLOW_AUTODIFF_TAMC |
76 |
CALL INI_FORCING( myThid ) |
IF ( usePickupBeforeC35 ) THEN |
77 |
|
C-- IMPORTANT : Need to activate the following call to restart from |
78 |
|
C a pickup file written by MITgcmUV_checkpoint34 or earlier. |
79 |
|
IF ( startTime .NE. 0. ) THEN |
80 |
|
CALL THE_CORRECTION_STEP(startTime, nIter0, myThid) |
81 |
|
ENDIF |
82 |
|
ENDIF |
83 |
|
#endif |
84 |
|
|
85 |
#ifdef ALLOW_OBCS |
C-- Initial conditions are convectively adjusted (for historical reasons) |
86 |
C-- Calculate values on open boundaries at iter=nIter0 |
IF ( startTime .EQ. 0. ) THEN |
87 |
IF (openBoundaries) THEN |
CADJ loop = parallel |
88 |
DO bj = myByLo(myThid), myByHi(myThid) |
DO bj = myByLo(myThid), myByHi(myThid) |
89 |
|
CADJ loop = parallel |
90 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
DO bi = myBxLo(myThid), myBxHi(myThid) |
91 |
DO K=1,Nr |
iMin=1-Olx |
92 |
CALL SET_OBCS( K, bi, bj, startTime, myThid ) |
iMax=sNx+Olx |
93 |
Caja CALL CYCLE_OBCS( K, bi, bj, myThid ) |
jMin=1-Oly |
94 |
ENDDO |
jMax=sNy+Oly |
95 |
|
CALL CONVECTIVE_ADJUSTMENT_INI( |
96 |
|
I bi, bj, iMin, iMax, jMin, jMax, |
97 |
|
I startTime, nIter0, myThid ) |
98 |
ENDDO |
ENDDO |
99 |
ENDDO |
ENDDO |
100 |
|
_BARRIER |
101 |
|
END IF |
102 |
|
|
103 |
|
C-- Initialize variable data for packages |
104 |
|
CALL PACKAGES_INIT_VARIABLES( myThid ) |
105 |
|
|
106 |
|
#ifdef NONLIN_FRSURF |
107 |
|
C-- Compute the surface level thickness, function of eta_n-1 |
108 |
|
C and modify hFac(C,W,S) accordingly : |
109 |
|
IF (nonlinFreeSurf.GT.0) THEN |
110 |
|
CALL CALC_SURF_DR(etaNm1, startTime, nIter0, myThid ) |
111 |
|
CALL UPDATE_SURF_DR( startTime, nIter0, myThid ) |
112 |
|
ENDIF |
113 |
|
C- update also CG2D matrix (and preconditioner) |
114 |
|
IF ( nonlinFreeSurf.GT.2) THEN |
115 |
|
CALL UPDATE_CG2D( startTime, nIter0, myThid ) |
116 |
ENDIF |
ENDIF |
117 |
#endif |
#endif |
118 |
|
|
119 |
C-- Finally summarise the model state |
C-- Finally summarise the model state |
120 |
CALL STATE_SUMMARY( myThid ) |
CALL STATE_SUMMARY( myThid ) |
121 |
|
|
122 |
|
#ifdef ALLOW_TIMEAVE |
123 |
|
C-- initialise time-average arrays with initial state values |
124 |
|
IF (taveFreq.GT.0.) THEN |
125 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
126 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
127 |
|
CALL TIMEAVE_STATVARS(startTime, nIter0, bi, bj, myThid) |
128 |
|
ENDDO |
129 |
|
ENDDO |
130 |
|
ENDIF |
131 |
|
#endif /* ALLOW_TIMEAVE */ |
132 |
|
|
133 |
|
#ifdef EXACT_CONSERV |
134 |
|
IF (exactConserv) THEN |
135 |
|
C-- Compute the initial Barotropic Flow Divergence : |
136 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
137 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
138 |
|
CALL CALC_EXACT_ETA( bi,bj, uVel,vVel, |
139 |
|
I startTime, nIter0, myThid ) |
140 |
|
ENDDO |
141 |
|
ENDDO |
142 |
|
ENDIF |
143 |
|
#endif /* EXACT_CONSERV */ |
144 |
|
|
145 |
|
RETURN |
146 |
END |
END |