/[MITgcm]/MITgcm/pkg/exf/exf_getffields.F
ViewVC logotype

Annotation of /MITgcm/pkg/exf/exf_getffields.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.24 - (hide annotations) (download)
Mon Dec 20 23:32:52 2004 UTC (19 years, 5 months ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint57d_post, checkpoint57c_post, checkpoint57c_pre
Changes since 1.23: +14 -12 lines
o exf_getffields interpolation defaults to bilinear for all scalar forcing
  fields (remains bicubic for wind velocity and stress).  This avoids, e.g.,
  spurious negative numbers for precipitation and humidity.  Will cause
  some small numerical differences for integrations using
  pkg/exf/exf_interp.F.

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

  ViewVC Help
Powered by ViewVC 1.1.22