3 |
|
|
4 |
#include "PACKAGES_CONFIG.h" |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
6 |
|
#ifdef ALLOW_AUTODIFF |
7 |
c#ifdef ALLOW_GMREDI |
# include "AUTODIFF_OPTIONS.h" |
8 |
c# include "GMREDI_OPTIONS.h" |
#endif |
9 |
c#endif |
#ifdef ALLOW_COST |
10 |
c#ifdef ALLOW_OBCS |
# include "COST_OPTIONS.h" |
11 |
c# include "OBCS_OPTIONS.h" |
#endif |
12 |
c#endif |
#ifdef ALLOW_CTRL |
13 |
|
# include "CTRL_OPTIONS.h" |
14 |
|
#endif |
15 |
|
#ifdef ALLOW_EXF |
16 |
|
# include "EXF_OPTIONS.h" |
17 |
|
#endif |
18 |
|
|
19 |
CBOP |
CBOP |
20 |
C !ROUTINE: LOAD_FIELDS_DRIVER |
C !ROUTINE: LOAD_FIELDS_DRIVER |
36 |
C | |
C | |
37 |
C |-- EXF_GETFORCING |
C |-- EXF_GETFORCING |
38 |
C | |
C | |
39 |
|
C |-- CHEAPAML_FIELDS_LOAD |
40 |
|
C | |
41 |
C |-- EXTERNAL_FIELDS_LOAD |
C |-- EXTERNAL_FIELDS_LOAD |
42 |
C | |
C | |
43 |
C |-- OFFLINE_FIELDS_LOAD |
C |-- OFFLINE_FIELDS_LOAD |
48 |
C | |
C | |
49 |
C |-- AIM_FIELDS_LOAD |
C |-- AIM_FIELDS_LOAD |
50 |
|
|
|
|
|
51 |
C !USES: |
C !USES: |
52 |
IMPLICIT NONE |
IMPLICIT NONE |
53 |
C == Global variables == |
C == Global variables == |
54 |
#include "SIZE.h" |
#include "SIZE.h" |
55 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
56 |
#include "PARAMS.h" |
#include "PARAMS.h" |
57 |
c#include "DYNVARS.h" |
#include "FFIELDS.h" |
|
|
|
|
c#ifdef ALLOW_SHAP_FILT |
|
|
c# include "SHAP_FILT.h" |
|
|
c#endif |
|
|
c#ifdef ALLOW_ZONAL_FILT |
|
|
c# include "ZONAL_FILT.h" |
|
|
c#endif |
|
|
c#ifdef COMPONENT_MODULE |
|
|
c# include "CPL_PARAMS.h" |
|
|
c#endif |
|
|
|
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
|
58 |
|
|
59 |
|
#ifdef ALLOW_AUTODIFF |
60 |
# include "tamc.h" |
# include "tamc.h" |
61 |
|
# include "CTRL_SIZE.h" |
62 |
# include "ctrl.h" |
# include "ctrl.h" |
63 |
# include "ctrl_dummy.h" |
# include "ctrl_dummy.h" |
64 |
# include "cost.h" |
# include "cost.h" |
|
# include "FFIELDS.h" |
|
65 |
# include "EOS.h" |
# include "EOS.h" |
|
c# if (defined NONLIN_FRSURF) || (defined ALLOW_DEPTH_CONTROL) |
|
|
c# include "GRID.h" |
|
|
c# endif |
|
66 |
# ifdef ALLOW_EXF |
# ifdef ALLOW_EXF |
67 |
# include "EXF_FIELDS.h" |
# include "EXF_FIELDS.h" |
68 |
# ifdef ALLOW_BULKFORMULAE |
# include "EXF_CONSTANTS.h" |
|
# include "EXF_CONSTANTS.h" |
|
|
# endif |
|
69 |
# endif |
# endif |
70 |
c# ifdef ALLOW_OBCS |
#endif /* ALLOW_AUTODIFF */ |
|
c# include "OBCS.h" |
|
|
c# ifdef ALLOW_PTRACERS |
|
|
c# include "PTRACERS_SIZE.h" |
|
|
c# include "OBCS_PTRACERS.h" |
|
|
c# endif |
|
|
c# endif |
|
|
c# ifdef ALLOW_CD_CODE |
|
|
c# include "CD_CODE_VARS.h" |
|
|
c# endif |
|
|
c# ifdef ALLOW_THSICE |
|
|
c# include "THSICE_VARS.h" |
|
|
c# endif |
|
|
c# ifdef ALLOW_EBM |
|
|
c# include "EBM.h" |
|
|
c# endif |
|
|
c# ifdef EXACT_CONSERV |
|
|
c# include "SURFACE.h" |
|
|
c# endif |
|
|
c# ifdef ALLOW_KPP |
|
|
c# include "KPP.h" |
|
|
c# endif |
|
|
c# ifdef ALLOW_GMREDI |
|
|
c# include "GMREDI.h" |
|
|
c# endif |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
|
71 |
|
|
72 |
C !LOCAL VARIABLES: |
C !INPUT/OUTPUT PARAMETERS: |
|
C == Routine arguments == |
|
73 |
C myTime :: time counter for this thread |
C myTime :: time counter for this thread |
74 |
C myIter :: iteration counter for this thread |
C myIter :: iteration counter for this thread |
75 |
C myThid :: thread number for this instance of the routine. |
C myThid :: thread number for this instance of the routine. |
77 |
INTEGER myIter |
INTEGER myIter |
78 |
INTEGER myThid |
INTEGER myThid |
79 |
|
|
80 |
C == Local variables == |
C !LOCAL VARIABLES: |
81 |
|
#if (defined ALLOW_ADDFLUID) || (defined ALLOW_FRICTION_HEATING) |
82 |
|
INTEGER i,j,k,bi,bj |
83 |
|
#endif |
84 |
CEOP |
CEOP |
85 |
|
|
86 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
87 |
IF ( debugLevel .GE. debLevB ) |
IF (debugMode) CALL DEBUG_ENTER( 'LOAD_FIELDS_DRIVER', myThid ) |
88 |
& CALL DEBUG_ENTER( 'LOAD_FIELDS_DRIVER', myThid ) |
#endif |
89 |
|
|
90 |
|
C-- Initialise forcing arrays that may receive multiple contributions |
91 |
|
#ifdef ALLOW_ADDFLUID |
92 |
|
IF ( selectAddFluid.NE.0 .AND. addMassFile.EQ.' ' ) THEN |
93 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
94 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
95 |
|
DO k=1,Nr |
96 |
|
DO j=1-OLy,sNy+OLy |
97 |
|
DO i=1-OLx,sNx+OLx |
98 |
|
addMass(i,j,k,bi,bj) = 0. _d 0 |
99 |
|
ENDDO |
100 |
|
ENDDO |
101 |
|
ENDDO |
102 |
|
ENDDO |
103 |
|
ENDDO |
104 |
|
ENDIF |
105 |
|
#endif /* ALLOW_ADDFLUID */ |
106 |
|
|
107 |
|
#ifdef ALLOW_FRICTION_HEATING |
108 |
|
IF ( addFrictionHeating .AND. staggerTimeStep ) THEN |
109 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
110 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
111 |
|
DO k=1,Nr |
112 |
|
DO j=1-OLy,sNy+OLy |
113 |
|
DO i=1-OLx,sNx+OLx |
114 |
|
frictionHeating(i,j,k,bi,bj) = 0. _d 0 |
115 |
|
ENDDO |
116 |
|
ENDDO |
117 |
|
ENDDO |
118 |
|
ENDDO |
119 |
|
ENDDO |
120 |
|
ENDIF |
121 |
|
#endif /* ALLOW_FRICTION_HEATING */ |
122 |
|
|
123 |
|
C-- Map generic time varying controls to xx_gentim2d |
124 |
|
#ifdef ALLOW_CTRL |
125 |
|
if (useCTRL) CALL CTRL_MAP_GENTIM2D( myTime, myIter, myThid ) |
126 |
#endif |
#endif |
127 |
|
|
128 |
#ifdef ALLOW_BULK_FORCE |
#ifdef ALLOW_BULK_FORCE |
129 |
IF ( useBulkForce ) THEN |
IF ( useBulkForce ) THEN |
130 |
C-- Bulk-Formulae pkg: load all forcing fields at current time |
C-- Bulk-Formulae pkg: load all forcing fields at current time |
131 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
132 |
IF ( debugLevel .GE. debLevB ) |
IF (debugMode) CALL DEBUG_CALL('BULKF_FIELDS_LOAD',myThid) |
|
& CALL DEBUG_CALL('BULKF_FIELDS_LOAD',myThid) |
|
133 |
#endif |
#endif |
134 |
CALL TIMER_START('BULKF_FIELDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
CALL TIMER_START('BULKF_FIELDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
135 |
CALL BULKF_FIELDS_LOAD( myTime, myIter, myThid ) |
CALL BULKF_FIELDS_LOAD( myTime, myIter, myThid ) |
141 |
#ifdef ALLOW_EXF |
#ifdef ALLOW_EXF |
142 |
IF (useEXF) THEN |
IF (useEXF) THEN |
143 |
# ifdef ALLOW_DEBUG |
# ifdef ALLOW_DEBUG |
144 |
IF ( debugLevel .GE. debLevB ) |
IF (debugMode) CALL DEBUG_CALL('EXF_GETFORCING',myThid) |
|
& CALL DEBUG_CALL('EXF_GETFORCING',myThid) |
|
145 |
# endif |
# endif |
146 |
CALL TIMER_START('EXF_GETFORCING [LOAD_FLDS_DRIVER]',myThid) |
CALL TIMER_START('EXF_GETFORCING [LOAD_FLDS_DRIVER]',myThid) |
147 |
CALL EXF_GETFORCING( myTime, myIter, myThid ) |
CALL EXF_GETFORCING( myTime, myIter, myThid ) |
149 |
ENDIF |
ENDIF |
150 |
#endif /* ALLOW_EXF */ |
#endif /* ALLOW_EXF */ |
151 |
|
|
152 |
c IF ( .NOT.useEXF ) THEN |
C-- Call external CheapAML forcing package |
153 |
C- note (useEBM): needs modifications to be compatible with this call |
#ifdef ALLOW_CHEAPAML |
154 |
IF ( .NOT.(useEXF.OR.useEBM) ) THEN |
IF ( useCheapAML ) THEN |
155 |
|
#ifdef ALLOW_DEBUG |
156 |
|
IF (debugMode) CALL DEBUG_CALL('CHEAPAML_FIELDS_LOAD',myThid) |
157 |
|
#endif |
158 |
|
CALL CHEAPAML_FIELDS_LOAD( myTime, myIter, myThid ) |
159 |
|
ENDIF |
160 |
|
#endif /*ALLOW_CHEAPAML */ |
161 |
|
|
162 |
|
IF ( .NOT.useCheapAML ) THEN |
163 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
164 |
IF ( debugLevel .GE. debLevB ) |
IF (debugMode) CALL DEBUG_CALL('EXTERNAL_FIELDS_LOAD',myThid) |
|
& CALL DEBUG_CALL('EXTERNAL_FIELDS_LOAD',myThid) |
|
165 |
#endif |
#endif |
166 |
CALL TIMER_START('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
CALL TIMER_START('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
167 |
CALL EXTERNAL_FIELDS_LOAD( myTime, myIter, myThid ) |
CALL EXTERNAL_FIELDS_LOAD( myTime, myIter, myThid ) |
168 |
CALL TIMER_STOP ('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
CALL TIMER_STOP ('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
169 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
170 |
CADJ STORE SST = comlev1, key = ikey_dynamics |
CADJ STORE SST = comlev1, key = ikey_dynamics, kind = isbyte |
171 |
CADJ STORE SSS = comlev1, key = ikey_dynamics |
CADJ STORE SSS = comlev1, key = ikey_dynamics, kind = isbyte |
172 |
# ifdef SHORTWAVE_HEATING |
# ifdef SHORTWAVE_HEATING |
173 |
CADJ STORE Qsw = comlev1, key = ikey_dynamics |
CADJ STORE Qsw = comlev1, key = ikey_dynamics, kind = isbyte |
174 |
# endif |
# endif |
175 |
#endif |
#endif |
176 |
ENDIF |
ENDIF |
178 |
#ifdef ALLOW_OFFLINE |
#ifdef ALLOW_OFFLINE |
179 |
IF ( useOffLine ) THEN |
IF ( useOffLine ) THEN |
180 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
181 |
IF ( debugLevel .GE. debLevB ) |
IF (debugMode) CALL DEBUG_CALL('OFFLINE_FIELDS_LOAD',myThid) |
|
& CALL DEBUG_CALL('OFFLINE_FIELDS_LOAD',myThid) |
|
182 |
#endif /* ALLOW_DEBUG */ |
#endif /* ALLOW_DEBUG */ |
183 |
CALL TIMER_START('OFFLINE_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
CALL TIMER_START('OFFLINE_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) |
184 |
CALL OFFLINE_FIELDS_LOAD( myTime, myIter, myThid ) |
CALL OFFLINE_FIELDS_LOAD( myTime, myIter, myThid ) |
189 |
#ifdef ALLOW_GCHEM |
#ifdef ALLOW_GCHEM |
190 |
IF ( useGCHEM ) THEN |
IF ( useGCHEM ) THEN |
191 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
192 |
IF ( debugLevel .GE. debLevB ) |
IF (debugMode) CALL DEBUG_CALL('GCHEM_FIELDS_LOAD',myThid) |
|
& CALL DEBUG_CALL('GCHEM_FIELDS_LOAD',myThid) |
|
193 |
#endif /* ALLOW_DEBUG */ |
#endif /* ALLOW_DEBUG */ |
194 |
CALL GCHEM_FIELDS_LOAD( myTime, myIter, myThid ) |
CALL GCHEM_FIELDS_LOAD( myTime, myIter, myThid ) |
195 |
ENDIF |
ENDIF |
209 |
#endif |
#endif |
210 |
|
|
211 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
212 |
IF ( debugLevel .GE. debLevB ) |
IF (debugMode) CALL DEBUG_LEAVE( 'LOAD_FIELDS_DRIVER', myThid ) |
|
& CALL DEBUG_LEAVE( 'LOAD_FIELDS_DRIVER', myThid ) |
|
213 |
#endif |
#endif |
214 |
|
|
215 |
RETURN |
RETURN |