1 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_getffields.F,v 1.2.6.11 2003/05/23 16:18:57 heimbach Exp $ |
2 |
|
3 |
#include "EXF_CPPOPTIONS.h" |
4 |
|
5 |
subroutine exf_getffields( mycurrenttime, mycurrentiter, mythid ) |
6 |
|
7 |
c ================================================================== |
8 |
c SUBROUTINE exf_getffields |
9 |
c ================================================================== |
10 |
c |
11 |
c o Read-in atmospheric state and/or surface fluxes from files. |
12 |
c |
13 |
c heimbach@mit.edu, 23-May-2003 totally re-structured |
14 |
c |
15 |
c ================================================================== |
16 |
c SUBROUTINE exf_getffields |
17 |
c ================================================================== |
18 |
|
19 |
implicit none |
20 |
|
21 |
c == global variables == |
22 |
|
23 |
#include "EEPARAMS.h" |
24 |
#include "SIZE.h" |
25 |
#include "PARAMS.h" |
26 |
#include "DYNVARS.h" |
27 |
#include "GRID.h" |
28 |
|
29 |
#include "exf_param.h" |
30 |
#include "exf_fields.h" |
31 |
#include "exf_constants.h" |
32 |
|
33 |
c == routine arguments == |
34 |
|
35 |
integer mythid |
36 |
integer mycurrentiter |
37 |
_RL mycurrenttime |
38 |
|
39 |
c == local variables == |
40 |
|
41 |
c == end of interface == |
42 |
|
43 |
c-- read forcing fields from files and temporal interpolation |
44 |
|
45 |
#ifdef ALLOW_ATM_WIND |
46 |
|
47 |
c Zonal wind. |
48 |
cgen call exf_set_uwind( mycurrenttime, mycurrentiter, mythid ) |
49 |
call exf_set_gen( |
50 |
& uwindfile, uwindstartdate, uwindperiod, |
51 |
& exf_inscal_uwind, |
52 |
& uwind, uwind0, uwind1, uwindmask, |
53 |
& mycurrenttime, mycurrentiter, mythid ) |
54 |
|
55 |
c Meridional wind. |
56 |
cgen call exf_set_vwind( mycurrenttime, mycurrentiter, mythid ) |
57 |
call exf_set_gen( |
58 |
& vwindfile, vwindstartdate, vwindperiod, |
59 |
& exf_inscal_vwind, |
60 |
& vwind, vwind0, vwind1, vwindmask, |
61 |
& mycurrenttime, mycurrentiter, mythid ) |
62 |
|
63 |
#ifdef ALLOW_UWIND_CONTROL |
64 |
call ctrl_getuwind ( mycurrenttime, mycurrentiter, mythid ) |
65 |
#endif |
66 |
|
67 |
#ifdef ALLOW_VWIND_CONTROL |
68 |
call ctrl_getvwind ( mycurrenttime, mycurrentiter, mythid ) |
69 |
#endif |
70 |
|
71 |
#else /* ifndef ALLOW_ATM_WIND */ |
72 |
|
73 |
c Zonal wind stress. |
74 |
call exf_set_gen( |
75 |
& ustressfile, ustressstartdate, ustressperiod, |
76 |
& exf_inscal_ustress, |
77 |
& ustress, ustress0, ustress1, ustressmask, |
78 |
& mycurrenttime, mycurrentiter, mythid ) |
79 |
|
80 |
c Meridional wind stress. |
81 |
call exf_set_gen( |
82 |
& vstressfile, vstressstartdate, vstressperiod, |
83 |
& exf_inscal_vstress, |
84 |
& vstress, vstress0, vstress1, vstressmask, |
85 |
& mycurrenttime, mycurrentiter, mythid ) |
86 |
|
87 |
#endif /* ifndef ALLOW_ATM_WIND */ |
88 |
|
89 |
#ifdef ALLOW_ATM_TEMP |
90 |
|
91 |
c Atmospheric temperature. |
92 |
cgen call exf_set_atemp ( mycurrenttime, mycurrentiter, mythid ) |
93 |
call exf_set_gen( |
94 |
& atempfile, atempstartdate, atempperiod, |
95 |
& exf_inscal_atemp, |
96 |
& atemp, atemp0, atemp1, atempmask, |
97 |
& mycurrenttime, mycurrentiter, mythid ) |
98 |
|
99 |
c Atmospheric humidity. |
100 |
cgen call exf_set_aqh ( mycurrenttime, mycurrentiter, mythid ) |
101 |
call exf_set_gen( |
102 |
& aqhfile, aqhstartdate, aqhperiod, |
103 |
& exf_inscal_aqh, |
104 |
& aqh, aqh0, aqh1, aqhmask, |
105 |
& mycurrenttime, mycurrentiter, mythid ) |
106 |
|
107 |
c Net long wave radiative flux. |
108 |
cgen call exf_set_lwflux ( mycurrenttime, mycurrentiter, mythid ) |
109 |
call exf_set_gen( |
110 |
& lwfluxfile, lwfluxstartdate, lwfluxperiod, |
111 |
& exf_inscal_lwflux, |
112 |
& lwflux, lwflux0, lwflux1, lwfluxmask, |
113 |
& mycurrenttime, mycurrentiter, mythid ) |
114 |
|
115 |
c Precipitation. |
116 |
cgen call exf_set_precip ( mycurrenttime, mycurrentiter, mythid ) |
117 |
call exf_set_gen( |
118 |
& precipfile, precipstartdate, precipperiod, |
119 |
& exf_inscal_precip, |
120 |
& precip, precip0, precip1, precipmask, |
121 |
& mycurrenttime, mycurrentiter, mythid ) |
122 |
|
123 |
#ifdef ALLOW_ATEMP_CONTROL |
124 |
call ctrl_getatemp ( mycurrenttime, mycurrentiter, mythid ) |
125 |
#endif |
126 |
|
127 |
#ifdef ALLOW_AQH_CONTROL |
128 |
call ctrl_getaqh ( mycurrenttime, mycurrentiter, mythid ) |
129 |
#endif |
130 |
|
131 |
#else /* ifndef ALLOW_ATM_TEMP */ |
132 |
|
133 |
c Atmospheric heat flux. |
134 |
call exf_set_gen ( |
135 |
& hfluxfile, hfluxstartdate, hfluxperiod, exf_inscal_hflux, |
136 |
& hflux, hflux0, hflux1, hfluxmask, |
137 |
& mycurrenttime, mycurrentiter, mythid ) |
138 |
|
139 |
c Salt flux. |
140 |
call exf_set_gen ( |
141 |
& sfluxfile, sfluxstartdate, sfluxperiod, exf_inscal_sflux, |
142 |
& sflux, sflux0, sflux1, sfluxmask, |
143 |
& mycurrenttime, mycurrentiter, mythid ) |
144 |
|
145 |
#endif /* ifndef ALLOW_ATM_TEMP */ |
146 |
|
147 |
#if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING) |
148 |
c Net short wave radiative flux. |
149 |
cgen call exf_set_swflux ( mycurrenttime, mycurrentiter, mythid ) |
150 |
call exf_set_gen ( |
151 |
& swfluxfile, swfluxstartdate, swfluxperiod, exf_inscal_swflux, |
152 |
& swflux, swflux0, swflux1, swfluxmask, |
153 |
& mycurrenttime, mycurrentiter, mythid ) |
154 |
#endif |
155 |
|
156 |
#ifdef EXF_READ_EVAP |
157 |
c Evaporation |
158 |
cgen call exf_set_evap ( mycurrenttime, mycurrentiter, mythid ) |
159 |
call exf_set_gen ( |
160 |
& evapfile, evapstartdate, evapperiod, exf_inscal_evap, |
161 |
& evap, evap0, evap1, evapmask, |
162 |
& mycurrenttime, mycurrentiter, mythid ) |
163 |
#endif |
164 |
|
165 |
#ifdef ALLOW_DOWNWARD_RADIATION |
166 |
|
167 |
c Downward shortwave radiation. |
168 |
cgen call exf_set_swdown ( mycurrenttime, mycurrentiter, mythid ) |
169 |
call exf_set_gen ( |
170 |
& swdownfile, swdownstartdate, swdownperiod, exf_inscal_swdown, |
171 |
& swdown, swdown0, swdown1, swdownmask, |
172 |
& mycurrenttime, mycurrentiter, mythid ) |
173 |
|
174 |
c Downward longwave radiation. |
175 |
cgen call exf_set_lwdown ( mycurrenttime, mycurrentiter, mythid ) |
176 |
call exf_set_gen ( |
177 |
& lwdownfile, lwdownstartdate, lwdownperiod, exf_inscal_lwdown, |
178 |
& lwdown, lwdown0, lwdown1, lwdownmask, |
179 |
& mycurrenttime, mycurrentiter, mythid ) |
180 |
|
181 |
#endif |
182 |
|
183 |
#ifdef ATMOSPHERIC_LOADING |
184 |
c Atmos. pressure forcing |
185 |
cgen call exf_set_apressure ( mycurrenttime, mycurrentiter, mythid ) |
186 |
call exf_set_gen ( |
187 |
& apressurefile, apressurestartdate, apressureperiod, |
188 |
& exf_inscal_apressure, |
189 |
& apressure, apressure0, apressure1, apressuremask, |
190 |
& mycurrenttime, mycurrentiter, mythid ) |
191 |
#endif |
192 |
|
193 |
|
194 |
end |