/[MITgcm]/MITgcm/model/src/initialise_varia.F
ViewVC logotype

Contents of /MITgcm/model/src/initialise_varia.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.22 - (show annotations) (download)
Wed Jan 30 04:12:12 2002 UTC (22 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint44e_post, chkpt44d_post, checkpoint44e_pre, chkpt44a_post, chkpt44c_pre, release1_final_v1, checkpoint44b_post, chkpt44a_pre, checkpoint44b_pre, chkpt44c_post, checkpoint44f_pre
Branch point for: release1_final
Changes since 1.21: +3 -3 lines
small changes associated with NonLin_FreeSurf option :
* initialization (ini_psurf.F);
* dump hFac fields (write_state.F);
* avoid unnecessary re-computation (forward_step.F initialise_varia.F calc_surf_dr.F);

1 C $Header: /u/gcmpack/models/MITgcmUV/model/src/initialise_varia.F,v 1.21 2001/11/08 20:57:51 heimbach Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INITIALISE_VARIA
8 C !INTERFACE:
9 SUBROUTINE INITIALISE_VARIA(myThid)
10 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 IMPLICIT NONE
61 C == Global variables ==
62 #include "SIZE.h"
63 #include "EEPARAMS.h"
64 #include "PARAMS.h"
65 #include "DYNVARS.h"
66
67 C !INPUT/OUTPUT PARAMETERS:
68 C == Routine arguments ==
69 INTEGER myThid
70
71 C !LOCAL VARIABLES:
72 C == Local variables ==
73 INTEGER bi,bj,K,iMin,iMax,jMin,jMax
74 CEOP
75
76 #ifdef ALLOW_TAMC_CHECKPOINTING
77
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 #endif
93
94 #endif /* ALLOW_TAMC_CHECKPOINTING */
95 _BARRIER
96
97 C-- Initialise 3-dim. diffusivities
98 CALL INI_MIXING( myThid )
99 _BARRIER
100
101 C-- Initialize DYNVARS arrays (state fields + G terms: Gu,Gv,...) to zero [always]
102 CALL INI_DYNVARS( myThid )
103
104 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
111 #ifdef ALLOW_PASSIVE_TRACER
112 C-- Initialise passive tracer(s)
113 CALL INI_TR1( myThid )
114 _BARRIER
115 #endif
116
117 #ifdef ALLOW_AUTODIFF_TAMC
118 C-- Initialise active fields to help TAMC
119 CALL INI_AUTODIFF( myThid )
120 _BARRIER
121 #endif
122
123 #ifndef ALLOW_AUTODIFF_TAMC
124 IF ( usePickupBeforeC35 ) THEN
125 C-- IMPORTANT : Need to activate the following call to restart from
126 C a pickup file written by MITgcmUV_checkpoint34 or earlier.
127 IF ( startTime .NE. 0. ) THEN
128 CALL THE_CORRECTION_STEP(startTime, nIter0, myThid)
129 ENDIF
130 ENDIF
131 #endif
132
133 C-- Initial conditions are convectively adjusted (for historical reasons)
134 IF ( startTime .EQ. 0. ) THEN
135 CADJ loop = parallel
136 DO bj = myByLo(myThid), myByHi(myThid)
137 CADJ loop = parallel
138 DO bi = myBxLo(myThid), myBxHi(myThid)
139 iMin=1-Olx
140 iMax=sNx+Olx
141 jMin=1-Oly
142 jMax=sNy+Oly
143 CALL CONVECTIVE_ADJUSTMENT_INI(
144 I bi, bj, iMin, iMax, jMin, jMax,
145 I startTime, nIter0, myThid )
146 ENDDO
147 ENDDO
148 _BARRIER
149 END IF
150
151 C-- Initialize variable data for packages
152 CALL PACKAGES_INIT_VARIABLES( myThid )
153
154 #ifdef NONLIN_FRSURF
155 C-- Compute the surface level thickness <-- function of etaH(n)
156 C and modify hFac(C,W,S) accordingly :
157 IF (nonlinFreeSurf.GT.0) THEN
158 CALL CALC_SURF_DR(etaH, startTime, -1 , myThid )
159 CALL UPDATE_SURF_DR( startTime, nIter0, myThid )
160 ENDIF
161 C- update also CG2D matrix (and preconditioner)
162 IF ( nonlinFreeSurf.GT.2) THEN
163 CALL UPDATE_CG2D( startTime, nIter0, myThid )
164 ENDIF
165 #endif
166
167 C-- Finally summarise the model state
168 CALL STATE_SUMMARY( myThid )
169
170 #ifdef ALLOW_TIMEAVE
171 C-- initialise time-average arrays with initial state values
172 IF (taveFreq.GT.0.) THEN
173 DO bj=myByLo(myThid),myByHi(myThid)
174 DO bi=myBxLo(myThid),myBxHi(myThid)
175 CALL TIMEAVE_STATVARS(startTime, nIter0, bi, bj, myThid)
176 ENDDO
177 ENDDO
178 ENDIF
179 #endif /* ALLOW_TIMEAVE */
180
181 RETURN
182 END

  ViewVC Help
Powered by ViewVC 1.1.22