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

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

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


Revision 1.21 - (hide annotations) (download)
Thu Nov 8 20:57:51 2001 UTC (22 years, 6 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint43a-release1mods, release1-branch_tutorials, release1-branch-end, checkpoint44, release1-branch_branchpoint
Branch point for: release1-branch
Changes since 1.20: +8 -2 lines
Preparing adjoint of Held-Suarez:
- bugfix for storing in absence of CD code
- adding EXACT_CONSERV to AD list
- new routine ini_autodiff to add TAMC-specific initialisations
- adding Shapiro filter to AD list

1 heimbach 1.21 C $Header: /u/gcmpack/models/MITgcmUV/model/src/initialise_varia.F,v 1.20 2001/09/26 18:09:15 cnh Exp $
2     C $Name: checkpoint43 $
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 heimbach 1.21 _BARRIER
115     #endif
116    
117     #ifdef ALLOW_AUTODIFF_TAMC
118     C-- Initialise active fields to help TAMC
119     CALL INI_AUTODIFF( myThid )
120 heimbach 1.13 _BARRIER
121 heimbach 1.15 #endif
122 heimbach 1.13
123 heimbach 1.18 #ifndef ALLOW_AUTODIFF_TAMC
124 heimbach 1.11 IF ( usePickupBeforeC35 ) THEN
125 jmc 1.8 C-- IMPORTANT : Need to activate the following call to restart from
126     C a pickup file written by MITgcmUV_checkpoint34 or earlier.
127 heimbach 1.11 IF ( startTime .NE. 0. ) THEN
128     CALL THE_CORRECTION_STEP(startTime, nIter0, myThid)
129     ENDIF
130     ENDIF
131 heimbach 1.18 #endif
132 adcroft 1.1
133 adcroft 1.5 C-- Initial conditions are convectively adjusted (for historical reasons)
134 heimbach 1.3 IF ( startTime .EQ. 0. ) THEN
135 heimbach 1.13 CADJ loop = parallel
136 adcroft 1.1 DO bj = myByLo(myThid), myByHi(myThid)
137 heimbach 1.13 CADJ loop = parallel
138 adcroft 1.1 DO bi = myBxLo(myThid), myBxHi(myThid)
139 adcroft 1.5 iMin=1-Olx
140     iMax=sNx+Olx
141     jMin=1-Oly
142     jMax=sNy+Oly
143 heimbach 1.11 CALL CONVECTIVE_ADJUSTMENT_INI(
144 adcroft 1.5 I bi, bj, iMin, iMax, jMin, jMax,
145 jmc 1.7 I startTime, nIter0, myThid )
146 adcroft 1.1 ENDDO
147     ENDDO
148 adcroft 1.5 _BARRIER
149     END IF
150    
151     C-- Initialize variable data for packages
152     CALL PACKAGES_INIT_VARIABLES( myThid )
153 jmc 1.17
154     #ifdef NONLIN_FRSURF
155 jmc 1.19 C-- Compute the surface level thickness <-- function of etaH(n)
156 jmc 1.17 C and modify hFac(C,W,S) accordingly :
157     IF (nonlinFreeSurf.GT.0) THEN
158 jmc 1.19 CALL CALC_SURF_DR(etaH, startTime, nIter0, myThid )
159 jmc 1.17 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 adcroft 1.1
167     C-- Finally summarise the model state
168     CALL STATE_SUMMARY( myThid )
169    
170 jmc 1.9 #ifdef ALLOW_TIMEAVE
171 jmc 1.7 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 jmc 1.9 CALL TIMEAVE_STATVARS(startTime, nIter0, bi, bj, myThid)
176 jmc 1.7 ENDDO
177     ENDDO
178     ENDIF
179 jmc 1.9 #endif /* ALLOW_TIMEAVE */
180 jmc 1.7
181     RETURN
182 adcroft 1.1 END

  ViewVC Help
Powered by ViewVC 1.1.22