/[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.27 - (hide annotations) (download)
Thu Jul 28 13:53:31 2005 UTC (18 years, 11 months ago) by heimbach
Branch: MAIN
Changes since 1.26: +8 -1 lines
Adding precip control

1 edhill 1.18 C
2 heimbach 1.27 C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_getffields.F,v 1.26 2005/04/27 14:10:06 jmc 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     #ifdef ALLOW_UWIND_CONTROL
119 dimitri 1.20 call ctrl_get_gen (
120 heimbach 1.14 & xx_uwind_file, xx_uwindstartdate, xx_uwindperiod,
121 heimbach 1.25 & maskc, uwind, xx_uwind0, xx_uwind1, xx_uwind_dummy,
122 heimbach 1.14 & mycurrenttime, mycurrentiter, mythid )
123 dimitri 1.20 #endif /* ALLOW_UWIND_CONTROL */
124 dimitri 1.8
125     #ifdef ALLOW_VWIND_CONTROL
126 dimitri 1.20 call ctrl_get_gen (
127 heimbach 1.14 & xx_vwind_file, xx_vwindstartdate, xx_vwindperiod,
128 heimbach 1.25 & maskc, vwind, xx_vwind0, xx_vwind1, xx_vwind_dummy,
129 heimbach 1.14 & mycurrenttime, mycurrentiter, mythid )
130 dimitri 1.20 #endif /* ALLOW_VWIND_CONTROL */
131 dimitri 1.8
132 dimitri 1.22 #endif /* ALLOW_ATM_WIND */
133 dimitri 1.8
134 dimitri 1.22 c Atmospheric heat flux.
135     call exf_set_gen (
136 heimbach 1.23 & hfluxfile, hfluxstartdate, hfluxperiod,
137     & hfluxstartdate1, hfluxstartdate2,
138     & exf_inscal_hflux,
139 dimitri 1.22 & hflux, hflux0, hflux1, hfluxmask,
140     #ifdef USE_EXF_INTERPOLATION
141     & hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc,
142 dimitri 1.24 & hflux_nlon, hflux_nlat, xC, yC, interp_method,
143 dimitri 1.22 #endif
144     & mycurrenttime, mycurrentiter, mythid )
145 dimitri 1.20
146 dimitri 1.22 c Salt flux.
147     call exf_set_gen (
148 heimbach 1.23 & sfluxfile, sfluxstartdate, sfluxperiod,
149     & sfluxstartdate1, sfluxstartdate2,
150     & exf_inscal_sflux,
151 dimitri 1.22 & sflux, sflux0, sflux1, sfluxmask,
152 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
153 dimitri 1.22 & sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc,
154 dimitri 1.24 & sflux_nlon, sflux_nlat, xC, yC, interp_method,
155 dimitri 1.22 #endif
156 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
157 dimitri 1.8
158 heimbach 1.1 #ifdef ALLOW_ATM_TEMP
159 dimitri 1.8
160 heimbach 1.1 c Atmospheric temperature.
161 heimbach 1.13 call exf_set_gen(
162     & atempfile, atempstartdate, atempperiod,
163 heimbach 1.23 & atempstartdate1, atempstartdate2,
164 heimbach 1.13 & exf_inscal_atemp,
165     & atemp, atemp0, atemp1, atempmask,
166 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
167     & atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc,
168 dimitri 1.24 & atemp_nlon, atemp_nlat, xC, yC, interp_method,
169 dimitri 1.15 #endif
170 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
171 dimitri 1.21 do bj = mybylo(mythid),mybyhi(mythid)
172     do bi = mybxlo(mythid),mybxhi(mythid)
173     do j = 1,sny
174     do i = 1,snx
175     atemp(i,j,bi,bj) = atemp(i,j,bi,bj) + exf_offset_atemp
176     enddo
177     enddo
178     enddo
179     enddo
180 heimbach 1.1
181     c Atmospheric humidity.
182 heimbach 1.13 call exf_set_gen(
183     & aqhfile, aqhstartdate, aqhperiod,
184 heimbach 1.23 & aqhstartdate1, aqhstartdate2,
185 heimbach 1.13 & exf_inscal_aqh,
186     & aqh, aqh0, aqh1, aqhmask,
187 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
188     & aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc,
189 dimitri 1.24 & aqh_nlon, aqh_nlat, xC, yC, interp_method,
190 dimitri 1.15 #endif
191 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
192 heimbach 1.1
193     c Net long wave radiative flux.
194 heimbach 1.13 call exf_set_gen(
195     & lwfluxfile, lwfluxstartdate, lwfluxperiod,
196 heimbach 1.23 & lwfluxstartdate1, lwfluxstartdate2,
197 heimbach 1.13 & exf_inscal_lwflux,
198     & lwflux, lwflux0, lwflux1, lwfluxmask,
199 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
200     & lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc,
201 dimitri 1.24 & lwflux_nlon, lwflux_nlat, xC, yC, interp_method,
202 dimitri 1.15 #endif
203 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
204 heimbach 1.1
205     c Precipitation.
206 heimbach 1.13 call exf_set_gen(
207     & precipfile, precipstartdate, precipperiod,
208 heimbach 1.23 & precipstartdate1, precipstartdate2,
209 heimbach 1.13 & exf_inscal_precip,
210     & precip, precip0, precip1, precipmask,
211 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
212     & precip_lon0, precip_lon_inc, precip_lat0, precip_lat_inc,
213 dimitri 1.24 & precip_nlon, precip_nlat, xC, yC, interp_method,
214 dimitri 1.15 #endif
215 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
216 heimbach 1.1
217 heimbach 1.3 #ifdef ALLOW_ATEMP_CONTROL
218 heimbach 1.14 call ctrl_get_gen (
219     & xx_atemp_file, xx_atempstartdate, xx_atempperiod,
220     & maskc, atemp, xx_atemp0, xx_atemp1, xx_atemp_dummy,
221     & mycurrenttime, mycurrentiter, mythid )
222 heimbach 1.3 #endif
223    
224     #ifdef ALLOW_AQH_CONTROL
225 heimbach 1.14 call ctrl_get_gen (
226     & xx_aqh_file, xx_aqhstartdate, xx_aqhperiod,
227     & maskc, aqh, xx_aqh0, xx_aqh1, xx_aqh_dummy,
228     & mycurrenttime, mycurrentiter, mythid )
229 heimbach 1.3 #endif
230 heimbach 1.1
231 heimbach 1.27 #ifdef ALLOW_PRECIP_CONTROL
232     call ctrl_get_gen (
233     & xx_precip_file, xx_precipstartdate, xx_precipperiod,
234     & maskc, precip, xx_precip0, xx_precip1, xx_precip_dummy,
235     & mycurrenttime, mycurrentiter, mythid )
236     #endif
237    
238 dimitri 1.22 #endif /* ALLOW_ATM_TEMP */
239 heimbach 1.1
240 dimitri 1.8 #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
241 heimbach 1.1 c Net short wave radiative flux.
242 heimbach 1.13 call exf_set_gen (
243 heimbach 1.23 & swfluxfile, swfluxstartdate, swfluxperiod,
244     & swfluxstartdate1, swfluxstartdate2,
245     & exf_inscal_swflux,
246 heimbach 1.13 & swflux, swflux0, swflux1, swfluxmask,
247 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
248     & swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc,
249 dimitri 1.24 & swflux_nlon, swflux_nlat, xC, yC, interp_method,
250 dimitri 1.15 #endif
251 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
252 heimbach 1.3 #endif
253    
254 dimitri 1.8 #ifdef EXF_READ_EVAP
255     c Evaporation
256 heimbach 1.13 call exf_set_gen (
257 heimbach 1.23 & evapfile, evapstartdate, evapperiod,
258     & evapstartdate1, evapstartdate2,
259     & exf_inscal_evap,
260 heimbach 1.13 & evap, evap0, evap1, evapmask,
261 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
262     & evap_lon0, evap_lon_inc, evap_lat0, evap_lat_inc,
263 dimitri 1.24 & evap_nlon, evap_nlat, xC, yC, interp_method,
264 dimitri 1.15 #endif
265 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
266 heimbach 1.3 #endif
267 heimbach 1.1
268 dimitri 1.8 #ifdef ALLOW_DOWNWARD_RADIATION
269 heimbach 1.1
270 dimitri 1.8 c Downward shortwave radiation.
271 heimbach 1.13 call exf_set_gen (
272 heimbach 1.23 & swdownfile, swdownstartdate, swdownperiod,
273     & swdownstartdate1, swdownstartdate2,
274     & exf_inscal_swdown,
275 heimbach 1.13 & swdown, swdown0, swdown1, swdownmask,
276 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
277     & swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc,
278 dimitri 1.24 & swdown_nlon, swdown_nlat, xC, yC, interp_method,
279 dimitri 1.15 #endif
280 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
281 heimbach 1.1
282 dimitri 1.8 c Downward longwave radiation.
283 heimbach 1.13 call exf_set_gen (
284 heimbach 1.23 & lwdownfile, lwdownstartdate, lwdownperiod,
285     & lwdownstartdate1, lwdownstartdate2,
286     & exf_inscal_lwdown,
287 heimbach 1.13 & lwdown, lwdown0, lwdown1, lwdownmask,
288 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
289     & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,
290 dimitri 1.24 & lwdown_nlon, lwdown_nlat, xC, yC, interp_method,
291 dimitri 1.15 #endif
292 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
293 heimbach 1.1
294 heimbach 1.3 #endif
295 heimbach 1.1
296 heimbach 1.12 #ifdef ATMOSPHERIC_LOADING
297     c Atmos. pressure forcing
298 heimbach 1.13 call exf_set_gen (
299     & apressurefile, apressurestartdate, apressureperiod,
300 heimbach 1.23 & apressurestartdate1, apressurestartdate2,
301 heimbach 1.13 & exf_inscal_apressure,
302     & apressure, apressure0, apressure1, apressuremask,
303 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
304     & apressure_lon0, apressure_lon_inc, apressure_lat0,
305 dimitri 1.16 & apressure_lat_inc, apressure_nlon, apressure_nlat, xC, yC,
306 dimitri 1.24 & interp_method,
307 dimitri 1.15 #endif
308 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
309 heimbach 1.3 #endif
310 heimbach 1.1
311     end

  ViewVC Help
Powered by ViewVC 1.1.22