1 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_getffields.F,v 1.2.6.12 2003/06/19 15:31:51 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 |
#if (defined (ALLOW_ADJOINT_RUN) || \ |
34 |
defined (ALLOW_TANGENTLINEAR_RUN) || \ |
35 |
defined (ALLOW_ECCO_OPTIMIZATION)) |
36 |
# include "ctrl.h" |
37 |
# include "ctrl_dummy.h" |
38 |
#endif |
39 |
|
40 |
c == routine arguments == |
41 |
|
42 |
integer mythid |
43 |
integer mycurrentiter |
44 |
_RL mycurrenttime |
45 |
|
46 |
c == local variables == |
47 |
|
48 |
c == end of interface == |
49 |
|
50 |
c-- read forcing fields from files and temporal interpolation |
51 |
|
52 |
#ifdef ALLOW_ATM_WIND |
53 |
|
54 |
c Zonal wind. |
55 |
call exf_set_gen( |
56 |
& uwindfile, uwindstartdate, uwindperiod, |
57 |
& exf_inscal_uwind, |
58 |
& uwind, uwind0, uwind1, uwindmask, |
59 |
& mycurrenttime, mycurrentiter, mythid ) |
60 |
|
61 |
c Meridional wind. |
62 |
call exf_set_gen( |
63 |
& vwindfile, vwindstartdate, vwindperiod, |
64 |
& exf_inscal_vwind, |
65 |
& vwind, vwind0, vwind1, vwindmask, |
66 |
& mycurrenttime, mycurrentiter, mythid ) |
67 |
|
68 |
#ifdef ALLOW_UWIND_CONTROL |
69 |
call ctrl_get_gen ( |
70 |
& xx_uwind_file, xx_uwindstartdate, xx_uwindperiod, |
71 |
& maskw, uwind, xx_uwind0, xx_uwind1, xx_uwind_dummy, |
72 |
& mycurrenttime, mycurrentiter, mythid ) |
73 |
#endif |
74 |
|
75 |
#ifdef ALLOW_VWIND_CONTROL |
76 |
call ctrl_get_gen ( |
77 |
& xx_vwind_file, xx_vwindstartdate, xx_vwindperiod, |
78 |
& masks, vwind, xx_vwind0, xx_vwind1, xx_vwind_dummy, |
79 |
& mycurrenttime, mycurrentiter, mythid ) |
80 |
#endif |
81 |
|
82 |
#else /* ifndef ALLOW_ATM_WIND */ |
83 |
|
84 |
c Zonal wind stress. |
85 |
call exf_set_gen( |
86 |
& ustressfile, ustressstartdate, ustressperiod, |
87 |
& exf_inscal_ustress, |
88 |
& ustress, ustress0, ustress1, ustressmask, |
89 |
& mycurrenttime, mycurrentiter, mythid ) |
90 |
|
91 |
c Meridional wind stress. |
92 |
call exf_set_gen( |
93 |
& vstressfile, vstressstartdate, vstressperiod, |
94 |
& exf_inscal_vstress, |
95 |
& vstress, vstress0, vstress1, vstressmask, |
96 |
& mycurrenttime, mycurrentiter, mythid ) |
97 |
|
98 |
#endif /* ifndef ALLOW_ATM_WIND */ |
99 |
|
100 |
#ifdef ALLOW_ATM_TEMP |
101 |
|
102 |
c Atmospheric temperature. |
103 |
call exf_set_gen( |
104 |
& atempfile, atempstartdate, atempperiod, |
105 |
& exf_inscal_atemp, |
106 |
& atemp, atemp0, atemp1, atempmask, |
107 |
& mycurrenttime, mycurrentiter, mythid ) |
108 |
|
109 |
c Atmospheric humidity. |
110 |
call exf_set_gen( |
111 |
& aqhfile, aqhstartdate, aqhperiod, |
112 |
& exf_inscal_aqh, |
113 |
& aqh, aqh0, aqh1, aqhmask, |
114 |
& mycurrenttime, mycurrentiter, mythid ) |
115 |
|
116 |
c Net long wave radiative flux. |
117 |
call exf_set_gen( |
118 |
& lwfluxfile, lwfluxstartdate, lwfluxperiod, |
119 |
& exf_inscal_lwflux, |
120 |
& lwflux, lwflux0, lwflux1, lwfluxmask, |
121 |
& mycurrenttime, mycurrentiter, mythid ) |
122 |
|
123 |
c Precipitation. |
124 |
call exf_set_gen( |
125 |
& precipfile, precipstartdate, precipperiod, |
126 |
& exf_inscal_precip, |
127 |
& precip, precip0, precip1, precipmask, |
128 |
& mycurrenttime, mycurrentiter, mythid ) |
129 |
|
130 |
#ifdef ALLOW_ATEMP_CONTROL |
131 |
call ctrl_get_gen ( |
132 |
& xx_atemp_file, xx_atempstartdate, xx_atempperiod, |
133 |
& maskc, atemp, xx_atemp0, xx_atemp1, xx_atemp_dummy, |
134 |
& mycurrenttime, mycurrentiter, mythid ) |
135 |
#endif |
136 |
|
137 |
#ifdef ALLOW_AQH_CONTROL |
138 |
call ctrl_get_gen ( |
139 |
& xx_aqh_file, xx_aqhstartdate, xx_aqhperiod, |
140 |
& maskc, aqh, xx_aqh0, xx_aqh1, xx_aqh_dummy, |
141 |
& mycurrenttime, mycurrentiter, mythid ) |
142 |
#endif |
143 |
|
144 |
#else /* ifndef ALLOW_ATM_TEMP */ |
145 |
|
146 |
c Atmospheric heat flux. |
147 |
call exf_set_gen ( |
148 |
& hfluxfile, hfluxstartdate, hfluxperiod, exf_inscal_hflux, |
149 |
& hflux, hflux0, hflux1, hfluxmask, |
150 |
& mycurrenttime, mycurrentiter, mythid ) |
151 |
|
152 |
c Salt flux. |
153 |
call exf_set_gen ( |
154 |
& sfluxfile, sfluxstartdate, sfluxperiod, exf_inscal_sflux, |
155 |
& sflux, sflux0, sflux1, sfluxmask, |
156 |
& mycurrenttime, mycurrentiter, mythid ) |
157 |
|
158 |
#endif /* ifndef ALLOW_ATM_TEMP */ |
159 |
|
160 |
#if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING) |
161 |
c Net short wave radiative flux. |
162 |
call exf_set_gen ( |
163 |
& swfluxfile, swfluxstartdate, swfluxperiod, exf_inscal_swflux, |
164 |
& swflux, swflux0, swflux1, swfluxmask, |
165 |
& mycurrenttime, mycurrentiter, mythid ) |
166 |
#endif |
167 |
|
168 |
#ifdef EXF_READ_EVAP |
169 |
c Evaporation |
170 |
call exf_set_gen ( |
171 |
& evapfile, evapstartdate, evapperiod, exf_inscal_evap, |
172 |
& evap, evap0, evap1, evapmask, |
173 |
& mycurrenttime, mycurrentiter, mythid ) |
174 |
#endif |
175 |
|
176 |
#ifdef ALLOW_DOWNWARD_RADIATION |
177 |
|
178 |
c Downward shortwave radiation. |
179 |
call exf_set_gen ( |
180 |
& swdownfile, swdownstartdate, swdownperiod, exf_inscal_swdown, |
181 |
& swdown, swdown0, swdown1, swdownmask, |
182 |
& mycurrenttime, mycurrentiter, mythid ) |
183 |
|
184 |
c Downward longwave radiation. |
185 |
call exf_set_gen ( |
186 |
& lwdownfile, lwdownstartdate, lwdownperiod, exf_inscal_lwdown, |
187 |
& lwdown, lwdown0, lwdown1, lwdownmask, |
188 |
& mycurrenttime, mycurrentiter, mythid ) |
189 |
|
190 |
#endif |
191 |
|
192 |
#ifdef ATMOSPHERIC_LOADING |
193 |
c Atmos. pressure forcing |
194 |
call exf_set_gen ( |
195 |
& apressurefile, apressurestartdate, apressureperiod, |
196 |
& exf_inscal_apressure, |
197 |
& apressure, apressure0, apressure1, apressuremask, |
198 |
& mycurrenttime, mycurrentiter, mythid ) |
199 |
#endif |
200 |
|
201 |
|
202 |
end |