/[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.28 - (hide annotations) (download)
Thu Jul 28 19:52:33 2005 UTC (18 years, 11 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint57n_post, checkpoint57p_post, checkpoint57o_post
Changes since 1.27: +52 -36 lines
Adding swflux control

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

  ViewVC Help
Powered by ViewVC 1.1.22