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