1 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_getffields.F,v 1.14 2003/06/24 16:07:32 heimbach Exp $ |
2 |
|
3 |
#include "EXF_CPPOPTIONS.h" |
4 |
|
5 |
subroutine exf_getffields( mycurrenttime, mycurrentiter, mythid ) |
6 |
|
7 |
c ================================================================== |
8 |
c SUBROUTINE exf_getffields |
9 |
c ================================================================== |
10 |
c |
11 |
c o Read-in atmospheric state and/or surface fluxes from files. |
12 |
c |
13 |
c heimbach@mit.edu, 23-May-2003 totally re-structured |
14 |
c |
15 |
c ================================================================== |
16 |
c SUBROUTINE exf_getffields |
17 |
c ================================================================== |
18 |
|
19 |
implicit none |
20 |
|
21 |
c == global variables == |
22 |
|
23 |
#include "EEPARAMS.h" |
24 |
#include "SIZE.h" |
25 |
#include "PARAMS.h" |
26 |
#include "DYNVARS.h" |
27 |
#include "GRID.h" |
28 |
|
29 |
#include "exf_param.h" |
30 |
#include "exf_fields.h" |
31 |
#include "exf_constants.h" |
32 |
|
33 |
#if (defined (ALLOW_ADJOINT_RUN) || \ |
34 |
defined (ALLOW_TANGENTLINEAR_RUN) || \ |
35 |
defined (ALLOW_ECCO_OPTIMIZATION)) |
36 |
# include "ctrl.h" |
37 |
# include "ctrl_dummy.h" |
38 |
#endif |
39 |
|
40 |
c == routine arguments == |
41 |
|
42 |
integer mythid |
43 |
integer mycurrentiter |
44 |
_RL mycurrenttime |
45 |
|
46 |
c == local variables == |
47 |
|
48 |
c == end of interface == |
49 |
|
50 |
c-- read forcing fields from files and temporal interpolation |
51 |
|
52 |
#ifdef ALLOW_ATM_WIND |
53 |
|
54 |
c Zonal wind. |
55 |
call exf_set_gen( |
56 |
& uwindfile, uwindstartdate, uwindperiod, |
57 |
& exf_inscal_uwind, |
58 |
& uwind, uwind0, uwind1, uwindmask, |
59 |
#ifdef USE_EXF_INTERPOLATION |
60 |
& uwind_lon0, uwind_lon_inc, uwind_lat0, uwind_lat_inc, |
61 |
& uwind_nlon, uwind_nlat, |
62 |
#endif |
63 |
& mycurrenttime, mycurrentiter, mythid ) |
64 |
|
65 |
c Meridional wind. |
66 |
call exf_set_gen( |
67 |
& vwindfile, vwindstartdate, vwindperiod, |
68 |
& exf_inscal_vwind, |
69 |
& vwind, vwind0, vwind1, vwindmask, |
70 |
#ifdef USE_EXF_INTERPOLATION |
71 |
& vwind_lon0, vwind_lon_inc, vwind_lat0, vwind_lat_inc, |
72 |
& vwind_nlon, vwind_nlat, |
73 |
#endif |
74 |
& mycurrenttime, mycurrentiter, mythid ) |
75 |
|
76 |
#ifdef ALLOW_UWIND_CONTROL |
77 |
call ctrl_get_gen ( |
78 |
& xx_uwind_file, xx_uwindstartdate, xx_uwindperiod, |
79 |
& maskw, uwind, xx_uwind0, xx_uwind1, xx_uwind_dummy, |
80 |
& mycurrenttime, mycurrentiter, mythid ) |
81 |
#endif |
82 |
|
83 |
#ifdef ALLOW_VWIND_CONTROL |
84 |
call ctrl_get_gen ( |
85 |
& xx_vwind_file, xx_vwindstartdate, xx_vwindperiod, |
86 |
& masks, vwind, xx_vwind0, xx_vwind1, xx_vwind_dummy, |
87 |
& mycurrenttime, mycurrentiter, mythid ) |
88 |
#endif |
89 |
|
90 |
#else /* ifndef ALLOW_ATM_WIND */ |
91 |
|
92 |
c Zonal wind stress. |
93 |
call exf_set_gen( |
94 |
& ustressfile, ustressstartdate, ustressperiod, |
95 |
& exf_inscal_ustress, |
96 |
& ustress, ustress0, ustress1, ustressmask, |
97 |
#ifdef USE_EXF_INTERPOLATION |
98 |
& ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc, |
99 |
& ustress_nlon, ustress_nlat, |
100 |
#endif |
101 |
& mycurrenttime, mycurrentiter, mythid ) |
102 |
|
103 |
c Meridional wind stress. |
104 |
call exf_set_gen( |
105 |
& vstressfile, vstressstartdate, vstressperiod, |
106 |
& exf_inscal_vstress, |
107 |
& vstress, vstress0, vstress1, vstressmask, |
108 |
#ifdef USE_EXF_INTERPOLATION |
109 |
& vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc, |
110 |
& vstress_nlon, vstress_nlat, |
111 |
#endif |
112 |
& mycurrenttime, mycurrentiter, mythid ) |
113 |
|
114 |
#endif /* ifndef ALLOW_ATM_WIND */ |
115 |
|
116 |
#ifdef ALLOW_ATM_TEMP |
117 |
|
118 |
c Atmospheric temperature. |
119 |
call exf_set_gen( |
120 |
& atempfile, atempstartdate, atempperiod, |
121 |
& exf_inscal_atemp, |
122 |
& atemp, atemp0, atemp1, atempmask, |
123 |
#ifdef USE_EXF_INTERPOLATION |
124 |
& atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc, |
125 |
& atemp_nlon, atemp_nlat, |
126 |
#endif |
127 |
& mycurrenttime, mycurrentiter, mythid ) |
128 |
|
129 |
c Atmospheric humidity. |
130 |
call exf_set_gen( |
131 |
& aqhfile, aqhstartdate, aqhperiod, |
132 |
& exf_inscal_aqh, |
133 |
& aqh, aqh0, aqh1, aqhmask, |
134 |
#ifdef USE_EXF_INTERPOLATION |
135 |
& aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc, |
136 |
& aqh_nlon, aqh_nlat, |
137 |
#endif |
138 |
& mycurrenttime, mycurrentiter, mythid ) |
139 |
|
140 |
c Net long wave radiative flux. |
141 |
call exf_set_gen( |
142 |
& lwfluxfile, lwfluxstartdate, lwfluxperiod, |
143 |
& exf_inscal_lwflux, |
144 |
& lwflux, lwflux0, lwflux1, lwfluxmask, |
145 |
#ifdef USE_EXF_INTERPOLATION |
146 |
& lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc, |
147 |
& lwflux_nlon, lwflux_nlat, |
148 |
#endif |
149 |
& mycurrenttime, mycurrentiter, mythid ) |
150 |
|
151 |
c Precipitation. |
152 |
call exf_set_gen( |
153 |
& precipfile, precipstartdate, precipperiod, |
154 |
& exf_inscal_precip, |
155 |
& precip, precip0, precip1, precipmask, |
156 |
#ifdef USE_EXF_INTERPOLATION |
157 |
& precip_lon0, precip_lon_inc, precip_lat0, precip_lat_inc, |
158 |
& precip_nlon, precip_nlat, |
159 |
#endif |
160 |
& mycurrenttime, mycurrentiter, mythid ) |
161 |
|
162 |
#ifdef ALLOW_ATEMP_CONTROL |
163 |
call ctrl_get_gen ( |
164 |
& xx_atemp_file, xx_atempstartdate, xx_atempperiod, |
165 |
& maskc, atemp, xx_atemp0, xx_atemp1, xx_atemp_dummy, |
166 |
& mycurrenttime, mycurrentiter, mythid ) |
167 |
#endif |
168 |
|
169 |
#ifdef ALLOW_AQH_CONTROL |
170 |
call ctrl_get_gen ( |
171 |
& xx_aqh_file, xx_aqhstartdate, xx_aqhperiod, |
172 |
& maskc, aqh, xx_aqh0, xx_aqh1, xx_aqh_dummy, |
173 |
& mycurrenttime, mycurrentiter, mythid ) |
174 |
#endif |
175 |
|
176 |
#else /* ifndef ALLOW_ATM_TEMP */ |
177 |
|
178 |
c Atmospheric heat flux. |
179 |
call exf_set_gen ( |
180 |
& hfluxfile, hfluxstartdate, hfluxperiod, exf_inscal_hflux, |
181 |
& hflux, hflux0, hflux1, hfluxmask, |
182 |
#ifdef USE_EXF_INTERPOLATION |
183 |
& hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc, |
184 |
& hflux_nlon, hflux_nlat, |
185 |
#endif |
186 |
& mycurrenttime, mycurrentiter, mythid ) |
187 |
|
188 |
c Salt flux. |
189 |
call exf_set_gen ( |
190 |
& sfluxfile, sfluxstartdate, sfluxperiod, exf_inscal_sflux, |
191 |
& sflux, sflux0, sflux1, sfluxmask, |
192 |
#ifdef USE_EXF_INTERPOLATION |
193 |
& sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc, |
194 |
& sflux_nlon, sflux_nlat, |
195 |
#endif |
196 |
& mycurrenttime, mycurrentiter, mythid ) |
197 |
|
198 |
#endif /* ifndef ALLOW_ATM_TEMP */ |
199 |
|
200 |
#if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING) |
201 |
c Net short wave radiative flux. |
202 |
call exf_set_gen ( |
203 |
& swfluxfile, swfluxstartdate, swfluxperiod, exf_inscal_swflux, |
204 |
& swflux, swflux0, swflux1, swfluxmask, |
205 |
#ifdef USE_EXF_INTERPOLATION |
206 |
& swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc, |
207 |
& swflux_nlon, swflux_nlat, |
208 |
#endif |
209 |
& mycurrenttime, mycurrentiter, mythid ) |
210 |
#endif |
211 |
|
212 |
#ifdef EXF_READ_EVAP |
213 |
c Evaporation |
214 |
call exf_set_gen ( |
215 |
& evapfile, evapstartdate, evapperiod, exf_inscal_evap, |
216 |
& evap, evap0, evap1, evapmask, |
217 |
#ifdef USE_EXF_INTERPOLATION |
218 |
& evap_lon0, evap_lon_inc, evap_lat0, evap_lat_inc, |
219 |
& evap_nlon, evap_nlat, |
220 |
#endif |
221 |
& mycurrenttime, mycurrentiter, mythid ) |
222 |
#endif |
223 |
|
224 |
#ifdef ALLOW_DOWNWARD_RADIATION |
225 |
|
226 |
c Downward shortwave radiation. |
227 |
call exf_set_gen ( |
228 |
& swdownfile, swdownstartdate, swdownperiod, exf_inscal_swdown, |
229 |
& swdown, swdown0, swdown1, swdownmask, |
230 |
#ifdef USE_EXF_INTERPOLATION |
231 |
& swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc, |
232 |
& swdown_nlon, swdown_nlat, |
233 |
#endif |
234 |
& mycurrenttime, mycurrentiter, mythid ) |
235 |
|
236 |
c Downward longwave radiation. |
237 |
call exf_set_gen ( |
238 |
& lwdownfile, lwdownstartdate, lwdownperiod, exf_inscal_lwdown, |
239 |
& lwdown, lwdown0, lwdown1, lwdownmask, |
240 |
#ifdef USE_EXF_INTERPOLATION |
241 |
& lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc, |
242 |
& lwdown_nlon, lwdown_nlat, |
243 |
#endif |
244 |
& mycurrenttime, mycurrentiter, mythid ) |
245 |
|
246 |
#endif |
247 |
|
248 |
#ifdef ATMOSPHERIC_LOADING |
249 |
c Atmos. pressure forcing |
250 |
call exf_set_gen ( |
251 |
& apressurefile, apressurestartdate, apressureperiod, |
252 |
& exf_inscal_apressure, |
253 |
& apressure, apressure0, apressure1, apressuremask, |
254 |
#ifdef USE_EXF_INTERPOLATION |
255 |
& apressure_lon0, apressure_lon_inc, apressure_lat0, |
256 |
& apressure_lat_inc, apressure_nlon, apressure_nlat, |
257 |
#endif |
258 |
& mycurrenttime, mycurrentiter, mythid ) |
259 |
#endif |
260 |
|
261 |
|
262 |
end |