1 |
C $Header: /u/gcmpack/MITgcm/model/src/load_fields_driver.F,v 1.8 2009/02/13 21:56:48 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
|
5 |
#include "PACKAGES_CONFIG.h" |
6 |
#include "CPP_OPTIONS.h" |
7 |
|
8 |
c#ifdef ALLOW_GMREDI |
9 |
c# include "GMREDI_OPTIONS.h" |
10 |
c#endif |
11 |
c#ifdef ALLOW_OBCS |
12 |
c# include "OBCS_OPTIONS.h" |
13 |
c#endif |
14 |
|
15 |
CBOP |
16 |
C !ROUTINE: LOAD_FIELDS_DRIVER |
17 |
C !INTERFACE: |
18 |
SUBROUTINE LOAD_FIELDS_DRIVER( myTime, myIter, myThid ) |
19 |
|
20 |
C !DESCRIPTION: \bv |
21 |
C *================================================================== |
22 |
C | SUBROUTINE LOAD_FIELDS_DRIVER |
23 |
C | o Load external forcing fields from file |
24 |
C *================================================================== |
25 |
C *================================================================== |
26 |
C \ev |
27 |
|
28 |
C !CALLING SEQUENCE: |
29 |
C LOAD_FIELDS_DRIVER |
30 |
C | |
31 |
C |-- BULKF_FIELDS_LOAD |
32 |
C | |
33 |
C |-- EXF_GETFORCING |
34 |
C | |
35 |
C |-- EXTERNAL_FIELDS_LOAD |
36 |
C | |
37 |
C |-- OFFLINE_FIELDS_LOAD |
38 |
C | |
39 |
C |-- GCHEM_FIELDS_LOAD |
40 |
C | |
41 |
C |-- RBCS_FIELDS_LOAD |
42 |
C | |
43 |
C |-- AIM_FIELDS_LOAD |
44 |
C | |
45 |
C |-- CHEAPAML_FIELDS_LOAD |
46 |
|
47 |
|
48 |
C !USES: |
49 |
IMPLICIT NONE |
50 |
C == Global variables == |
51 |
#include "SIZE.h" |
52 |
#include "EEPARAMS.h" |
53 |
#include "PARAMS.h" |
54 |
c#include "DYNVARS.h" |
55 |
|
56 |
c#ifdef ALLOW_SHAP_FILT |
57 |
c# include "SHAP_FILT.h" |
58 |
c#endif |
59 |
c#ifdef ALLOW_ZONAL_FILT |
60 |
c# include "ZONAL_FILT.h" |
61 |
c#endif |
62 |
c#ifdef COMPONENT_MODULE |
63 |
c# include "CPL_PARAMS.h" |
64 |
c#endif |
65 |
|
66 |
#ifdef ALLOW_AUTODIFF_TAMC |
67 |
|
68 |
# include "tamc.h" |
69 |
# include "ctrl.h" |
70 |
# include "ctrl_dummy.h" |
71 |
# include "cost.h" |
72 |
# include "FFIELDS.h" |
73 |
# include "EOS.h" |
74 |
c# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
75 |
c# include "GRID.h" |
76 |
c# endif |
77 |
# ifdef ALLOW_EXF |
78 |
# include "EXF_FIELDS.h" |
79 |
# ifdef ALLOW_BULKFORMULAE |
80 |
# include "EXF_CONSTANTS.h" |
81 |
# endif |
82 |
# endif |
83 |
c# ifdef ALLOW_OBCS |
84 |
c# include "OBCS.h" |
85 |
c# ifdef ALLOW_PTRACERS |
86 |
c# include "PTRACERS_SIZE.h" |
87 |
c# include "OBCS_PTRACERS.h" |
88 |
c# endif |
89 |
c# endif |
90 |
c# ifdef ALLOW_CD_CODE |
91 |
c# include "CD_CODE_VARS.h" |
92 |
c# endif |
93 |
c# ifdef ALLOW_THSICE |
94 |
c# include "THSICE_VARS.h" |
95 |
c# endif |
96 |
c# ifdef ALLOW_EBM |
97 |
c# include "EBM.h" |
98 |
c# endif |
99 |
c# ifdef EXACT_CONSERV |
100 |
c# include "SURFACE.h" |
101 |
c# endif |
102 |
c# ifdef ALLOW_KPP |
103 |
c# include "KPP.h" |
104 |
c# endif |
105 |
c# ifdef ALLOW_GMREDI |
106 |
c# include "GMREDI.h" |
107 |
c# endif |
108 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
109 |
|
110 |
C !LOCAL VARIABLES: |
111 |
C == Routine arguments == |
112 |
C myTime :: time counter for this thread |
113 |
C myIter :: iteration counter for this thread |
114 |
C myThid :: thread number for this instance of the routine. |
115 |
_RL myTime |
116 |
INTEGER myIter |
117 |
INTEGER myThid |
118 |
|
119 |
C == Local variables == |
120 |
CEOP |
121 |
|
122 |
#ifdef ALLOW_DEBUG |
123 |
IF (debugMode) CALL DEBUG_ENTER( 'LOAD_FIELDS_DRIVER', myThid ) |
124 |
#endif |
125 |
|
126 |
#ifdef ALLOW_BULK_FORCE |
127 |
IF ( useBulkForce ) THEN |
128 |
C-- Bulk-Formulae pkg: load all forcing fields at current time |
129 |
#ifdef ALLOW_DEBUG |
130 |
IF (debugMode) CALL DEBUG_CALL('BULKF_FIELDS_LOAD',myThid) |
131 |
#endif |
132 |
CALL TIMER_START('BULKF_FIELDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
133 |
CALL BULKF_FIELDS_LOAD( myTime, myIter, myThid ) |
134 |
CALL TIMER_STOP ('BULKF_FIELDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
135 |
ENDIF |
136 |
#endif /* ALLOW_BULK_FORCE */ |
137 |
|
138 |
C-- Call external forcing package |
139 |
#ifdef ALLOW_EXF |
140 |
IF (useEXF) THEN |
141 |
# ifdef ALLOW_DEBUG |
142 |
IF (debugMode) CALL DEBUG_CALL('EXF_GETFORCING',myThid) |
143 |
# endif |
144 |
CALL TIMER_START('EXF_GETFORCING [LOAD_FLDS_DRIVER]',myThid) |
145 |
CALL EXF_GETFORCING( myTime, myIter, myThid ) |
146 |
CALL TIMER_STOP ('EXF_GETFORCING [LOAD_FLDS_DRIVER]',myThid) |
147 |
ENDIF |
148 |
#endif /* ALLOW_EXF */ |
149 |
|
150 |
C-- Call external CheapAML forcing package |
151 |
#ifdef ALLOW_CHEAPAML |
152 |
IF ( useCheapAML ) THEN |
153 |
#ifdef ALLOW_DEBUG |
154 |
IF (debugMode) CALL DEBUG_CALL('CHEAPAML_FIELDS_LOAD',myThid) |
155 |
#endif |
156 |
CALL CHEAPAML_FIELDS_LOAD( myTime, myIter, myThid ) |
157 |
ENDIF |
158 |
#endif /*ALLOW_CHEAPAML */ |
159 |
|
160 |
c IF ( .NOT.useEXF ) THEN |
161 |
C- note (useEBM): needs modifications to be compatible with this call |
162 |
IF ( .NOT.(useEXF.OR.useEBM) ) THEN |
163 |
#ifdef ALLOW_DEBUG |
164 |
IF (debugMode) CALL DEBUG_CALL('EXTERNAL_FIELDS_LOAD',myThid) |
165 |
#endif |
166 |
CALL TIMER_START('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
167 |
CALL EXTERNAL_FIELDS_LOAD( myTime, myIter, myThid ) |
168 |
CALL TIMER_STOP ('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
169 |
#ifdef NONLIN_FRSURF |
170 |
CADJ STORE SST = comlev1, key = ikey_dynamics, kind = isbyte |
171 |
CADJ STORE SSS = comlev1, key = ikey_dynamics, kind = isbyte |
172 |
# ifdef SHORTWAVE_HEATING |
173 |
CADJ STORE Qsw = comlev1, key = ikey_dynamics, kind = isbyte |
174 |
# endif |
175 |
#endif |
176 |
ENDIF |
177 |
|
178 |
#ifdef ALLOW_OFFLINE |
179 |
IF ( useOffLine ) THEN |
180 |
#ifdef ALLOW_DEBUG |
181 |
IF (debugMode) CALL DEBUG_CALL('OFFLINE_FIELDS_LOAD',myThid) |
182 |
#endif /* ALLOW_DEBUG */ |
183 |
CALL TIMER_START('OFFLINE_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
184 |
CALL OFFLINE_FIELDS_LOAD( myTime, myIter, myThid ) |
185 |
CALL TIMER_STOP ('OFFLINE_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
186 |
ENDIF |
187 |
#endif /* ALLOW_OFFLINE */ |
188 |
|
189 |
#ifdef ALLOW_GCHEM |
190 |
IF ( useGCHEM ) THEN |
191 |
#ifdef ALLOW_DEBUG |
192 |
IF (debugMode) CALL DEBUG_CALL('GCHEM_FIELDS_LOAD',myThid) |
193 |
#endif /* ALLOW_DEBUG */ |
194 |
CALL GCHEM_FIELDS_LOAD( myTime, myIter, myThid ) |
195 |
ENDIF |
196 |
#endif /* ALLOW_GCHEM */ |
197 |
|
198 |
#ifdef ALLOW_RBCS |
199 |
IF ( useRBCS ) THEN |
200 |
CALL RBCS_FIELDS_LOAD( myTime, myIter, myThid ) |
201 |
ENDIF |
202 |
#endif |
203 |
|
204 |
#ifdef ALLOW_AIM |
205 |
IF ( useAIM ) THEN |
206 |
C- Update AIM bottom boundary data |
207 |
CALL AIM_FIELDS_LOAD( myTime, myIter, myThid ) |
208 |
ENDIF |
209 |
#endif |
210 |
|
211 |
#ifdef ALLOW_DEBUG |
212 |
IF (debugMode) CALL DEBUG_LEAVE( 'LOAD_FIELDS_DRIVER', myThid ) |
213 |
#endif |
214 |
|
215 |
RETURN |
216 |
END |