/[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.23 - (hide annotations) (download)
Mon Oct 11 16:41:01 2004 UTC (19 years, 11 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint57b_post, checkpoint56b_post, checkpoint57, checkpoint56, checkpoint55i_post, checkpoint57a_post, checkpoint55g_post, checkpoint55d_post, checkpoint55j_post, checkpoint55h_post, checkpoint55f_post, checkpoint56a_post, checkpoint56c_post, checkpoint57a_pre, checkpoint55e_post
Changes since 1.22: +34 -7 lines
o enable to read exf forcing fields as either
  single file or yearly files (flag useExfYearlyFields)

1 edhill 1.18 C
2 heimbach 1.23 C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_getffields.F,v 1.22 2004/03/17 23:08:09 dimitri 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.21 integer i, j, bi, bj
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     & maskw, uwind, xx_uwind0, xx_uwind1, xx_uwind_dummy,
122     & 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     & masks, vwind, xx_vwind0, xx_vwind1, xx_vwind_dummy,
129     & 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     & hflux_nlon, hflux_nlat, xC, yC,
143     #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     & sflux_nlon, sflux_nlat, xC, yC,
155     #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.16 & atemp_nlon, atemp_nlat, xC, yC,
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.16 & aqh_nlon, aqh_nlat, xC, yC,
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.16 & lwflux_nlon, lwflux_nlat, xC, yC,
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.16 & precip_nlon, precip_nlat, xC, yC,
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 dimitri 1.22 #endif /* ALLOW_ATM_TEMP */
232 heimbach 1.1
233 dimitri 1.8 #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
234 heimbach 1.1 c Net short wave radiative flux.
235 heimbach 1.13 call exf_set_gen (
236 heimbach 1.23 & swfluxfile, swfluxstartdate, swfluxperiod,
237     & swfluxstartdate1, swfluxstartdate2,
238     & exf_inscal_swflux,
239 heimbach 1.13 & swflux, swflux0, swflux1, swfluxmask,
240 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
241     & swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc,
242 dimitri 1.16 & swflux_nlon, swflux_nlat, xC, yC,
243 dimitri 1.15 #endif
244 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
245 heimbach 1.3 #endif
246    
247 dimitri 1.8 #ifdef EXF_READ_EVAP
248     c Evaporation
249 heimbach 1.13 call exf_set_gen (
250 heimbach 1.23 & evapfile, evapstartdate, evapperiod,
251     & evapstartdate1, evapstartdate2,
252     & exf_inscal_evap,
253 heimbach 1.13 & evap, evap0, evap1, evapmask,
254 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
255     & evap_lon0, evap_lon_inc, evap_lat0, evap_lat_inc,
256 dimitri 1.16 & evap_nlon, evap_nlat, xC, yC,
257 dimitri 1.15 #endif
258 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
259 heimbach 1.3 #endif
260 heimbach 1.1
261 dimitri 1.8 #ifdef ALLOW_DOWNWARD_RADIATION
262 heimbach 1.1
263 dimitri 1.8 c Downward shortwave radiation.
264 heimbach 1.13 call exf_set_gen (
265 heimbach 1.23 & swdownfile, swdownstartdate, swdownperiod,
266     & swdownstartdate1, swdownstartdate2,
267     & exf_inscal_swdown,
268 heimbach 1.13 & swdown, swdown0, swdown1, swdownmask,
269 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
270     & swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc,
271 dimitri 1.16 & swdown_nlon, swdown_nlat, xC, yC,
272 dimitri 1.15 #endif
273 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
274 heimbach 1.1
275 dimitri 1.8 c Downward longwave radiation.
276 heimbach 1.13 call exf_set_gen (
277 heimbach 1.23 & lwdownfile, lwdownstartdate, lwdownperiod,
278     & lwdownstartdate1, lwdownstartdate2,
279     & exf_inscal_lwdown,
280 heimbach 1.13 & lwdown, lwdown0, lwdown1, lwdownmask,
281 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
282     & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,
283 dimitri 1.16 & lwdown_nlon, lwdown_nlat, xC, yC,
284 dimitri 1.15 #endif
285 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
286 heimbach 1.1
287 heimbach 1.3 #endif
288 heimbach 1.1
289 heimbach 1.12 #ifdef ATMOSPHERIC_LOADING
290     c Atmos. pressure forcing
291 heimbach 1.13 call exf_set_gen (
292     & apressurefile, apressurestartdate, apressureperiod,
293 heimbach 1.23 & apressurestartdate1, apressurestartdate2,
294 heimbach 1.13 & exf_inscal_apressure,
295     & apressure, apressure0, apressure1, apressuremask,
296 dimitri 1.15 #ifdef USE_EXF_INTERPOLATION
297     & apressure_lon0, apressure_lon_inc, apressure_lat0,
298 dimitri 1.16 & apressure_lat_inc, apressure_nlon, apressure_nlat, xC, yC,
299 dimitri 1.15 #endif
300 heimbach 1.13 & mycurrenttime, mycurrentiter, mythid )
301 heimbach 1.3 #endif
302 heimbach 1.1
303     end

  ViewVC Help
Powered by ViewVC 1.1.22