1 |
C $Header: /u/gcmpack/MITgcm/model/src/load_fields_driver.F,v 1.3 2007/04/18 19:54:06 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
|
7 |
c#ifdef ALLOW_GMREDI |
8 |
c# include "GMREDI_OPTIONS.h" |
9 |
c#endif |
10 |
c#ifdef ALLOW_OBCS |
11 |
c# include "OBCS_OPTIONS.h" |
12 |
c#endif |
13 |
|
14 |
CBOP |
15 |
C !ROUTINE: LOAD_FIELDS_DRIVER |
16 |
C !INTERFACE: |
17 |
SUBROUTINE LOAD_FIELDS_DRIVER( myTime, myIter, myThid ) |
18 |
|
19 |
C !DESCRIPTION: \bv |
20 |
C *================================================================== |
21 |
C | SUBROUTINE LOAD_FIELDS_DRIVER |
22 |
C | o Load external forcing fields from file |
23 |
C *================================================================== |
24 |
C *================================================================== |
25 |
C \ev |
26 |
|
27 |
C !CALLING SEQUENCE: |
28 |
C LOAD_FIELDS_DRIVER |
29 |
C | |
30 |
C |-- BULKF_FIELDS_LOAD |
31 |
C | |
32 |
C |-- EXF_GETFORCING |
33 |
C | |
34 |
C |-- EXTERNAL_FIELDS_LOAD |
35 |
C | |
36 |
C |-- OFFLINE_FIELDS_LOAD |
37 |
C | |
38 |
C |-- GCHEM_FIELDS_LOAD |
39 |
C | |
40 |
C |-- RBCS_FIELDS_LOAD |
41 |
C | |
42 |
C |-- AIM_FIELDS_LOAD |
43 |
|
44 |
|
45 |
C !USES: |
46 |
IMPLICIT NONE |
47 |
C == Global variables == |
48 |
#include "SIZE.h" |
49 |
#include "EEPARAMS.h" |
50 |
#include "PARAMS.h" |
51 |
c#include "DYNVARS.h" |
52 |
|
53 |
c#ifdef ALLOW_SHAP_FILT |
54 |
c# include "SHAP_FILT.h" |
55 |
c#endif |
56 |
c#ifdef ALLOW_ZONAL_FILT |
57 |
c# include "ZONAL_FILT.h" |
58 |
c#endif |
59 |
c#ifdef COMPONENT_MODULE |
60 |
c# include "CPL_PARAMS.h" |
61 |
c#endif |
62 |
|
63 |
#ifdef ALLOW_AUTODIFF_TAMC |
64 |
|
65 |
# include "tamc.h" |
66 |
# include "ctrl.h" |
67 |
# include "ctrl_dummy.h" |
68 |
# include "cost.h" |
69 |
# include "FFIELDS.h" |
70 |
# include "EOS.h" |
71 |
c# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
72 |
c# include "GRID.h" |
73 |
c# endif |
74 |
# ifdef ALLOW_EXF |
75 |
# include "EXF_FIELDS.h" |
76 |
# ifdef ALLOW_BULKFORMULAE |
77 |
# include "EXF_CONSTANTS.h" |
78 |
# endif |
79 |
# endif |
80 |
c# ifdef ALLOW_PTRACERS |
81 |
c# include "PTRACERS_SIZE.h" |
82 |
c# include "PTRACERS.h" |
83 |
c# endif |
84 |
c# ifdef ALLOW_OBCS |
85 |
c# include "OBCS.h" |
86 |
c# ifdef ALLOW_PTRACERS |
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 ( debugLevel .GE. debLevB ) |
124 |
& CALL DEBUG_ENTER( 'LOAD_FIELDS_DRIVER', myThid ) |
125 |
#endif |
126 |
|
127 |
#ifdef ALLOW_BULK_FORCE |
128 |
IF ( useBulkForce ) THEN |
129 |
C-- Bulk-Formulae pkg: load all forcing fields at current time |
130 |
#ifdef ALLOW_DEBUG |
131 |
IF ( debugLevel .GE. debLevB ) |
132 |
& CALL DEBUG_CALL('BULKF_FIELDS_LOAD',myThid) |
133 |
#endif |
134 |
CALL TIMER_START('BULKF_FIELDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
135 |
CALL BULKF_FIELDS_LOAD( myTime, myIter, myThid ) |
136 |
CALL TIMER_STOP ('BULKF_FIELDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
137 |
ENDIF |
138 |
#endif /* ALLOW_BULK_FORCE */ |
139 |
|
140 |
C-- Call external forcing package |
141 |
#ifdef ALLOW_EXF |
142 |
IF (useEXF) THEN |
143 |
# ifdef ALLOW_DEBUG |
144 |
IF ( debugLevel .GE. debLevB ) |
145 |
& CALL DEBUG_CALL('EXF_GETFORCING',myThid) |
146 |
# endif |
147 |
CALL TIMER_START('EXF_GETFORCING [LOAD_FLDS_DRIVER]',myThid) |
148 |
CALL EXF_GETFORCING( myTime, myIter, myThid ) |
149 |
CALL TIMER_STOP ('EXF_GETFORCING [LOAD_FLDS_DRIVER]',myThid) |
150 |
ENDIF |
151 |
#else /* ALLOW_EXF undef */ |
152 |
IF ( .NOT. useSEAICE .AND. .NOT. useEBM ) THEN |
153 |
# ifdef ALLOW_DEBUG |
154 |
IF ( debugLevel .GE. debLevB ) |
155 |
& CALL DEBUG_CALL('EXTERNAL_FIELDS_LOAD',myThid) |
156 |
# endif |
157 |
CALL TIMER_START('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
158 |
CALL EXTERNAL_FIELDS_LOAD( myTime, myIter, myThid ) |
159 |
CALL TIMER_STOP ('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
160 |
# ifdef NONLIN_FRSURF |
161 |
CADJ STORE SST = comlev1, key = ikey_dynamics |
162 |
CADJ STORE SSS = comlev1, key = ikey_dynamics |
163 |
# ifdef SHORTWAVE_HEATING |
164 |
CADJ STORE Qsw = comlev1, key = ikey_dynamics |
165 |
# endif |
166 |
# endif |
167 |
ENDIF |
168 |
#endif /* ALLOW_EXF */ |
169 |
|
170 |
#ifdef ALLOW_OFFLINE |
171 |
IF ( useOffLine ) THEN |
172 |
#ifdef ALLOW_DEBUG |
173 |
IF ( debugLevel .GE. debLevB ) |
174 |
& CALL DEBUG_CALL('OFFLINE_FIELDS_LOAD',myThid) |
175 |
#endif /* ALLOW_DEBUG */ |
176 |
CALL TIMER_START('OFFLINE_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
177 |
CALL OFFLINE_FIELDS_LOAD( myTime, myIter, myThid ) |
178 |
CALL TIMER_STOP ('OFFLINE_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
179 |
ENDIF |
180 |
#endif /* ALLOW_OFFLINE */ |
181 |
|
182 |
#ifdef ALLOW_GCHEM |
183 |
IF ( useGCHEM ) THEN |
184 |
#ifdef ALLOW_DEBUG |
185 |
IF ( debugLevel .GE. debLevB ) |
186 |
& CALL DEBUG_CALL('GCHEM_FIELDS_LOAD',myThid) |
187 |
#endif /* ALLOW_DEBUG */ |
188 |
CALL GCHEM_FIELDS_LOAD( myTime, myIter, myThid ) |
189 |
ENDIF |
190 |
#endif /* ALLOW_GCHEM */ |
191 |
|
192 |
#ifdef ALLOW_RBCS |
193 |
IF ( useRBCS ) THEN |
194 |
CALL RBCS_FIELDS_LOAD( myTime, myIter, myThid ) |
195 |
ENDIF |
196 |
#endif |
197 |
|
198 |
#ifdef ALLOW_AIM |
199 |
IF ( useAIM ) THEN |
200 |
C- Update AIM bottom boundary data |
201 |
CALL AIM_FIELDS_LOAD( myTime, myIter, myThid ) |
202 |
ENDIF |
203 |
#endif |
204 |
|
205 |
#ifdef ALLOW_DEBUG |
206 |
IF ( debugLevel .GE. debLevB ) |
207 |
& CALL DEBUG_LEAVE( 'LOAD_FIELDS_DRIVER', myThid ) |
208 |
#endif |
209 |
|
210 |
RETURN |
211 |
END |