1 |
C $Header: /u/gcmpack/MITgcm_contrib/ecco_darwin/v4_llc270/code_darwin/darwin_fields_load.F,v 1.3 2019/08/26 05:33:09 dcarroll Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
#include "PTRACERS_OPTIONS.h" |
6 |
#include "DARWIN_OPTIONS.h" |
7 |
|
8 |
#ifdef ALLOW_PTRACERS |
9 |
#ifdef ALLOW_DARWIN |
10 |
|
11 |
CStartOfInterFace |
12 |
SUBROUTINE DARWIN_FIELDS_LOAD ( |
13 |
I myIter,myTime,myThid) |
14 |
|
15 |
C /==========================================================\ |
16 |
C | SUBROUTINE DARWIN_FIELDS_LOAD | |
17 |
C | o Read in fields needed for ice fraction and | |
18 |
C | iron aeolian flux terms, PAR and nut_wvel | |
19 |
C | adapted from NPZD2Fe - Stephanie Dutkiewicz 2005 | |
20 |
C |==========================================================| |
21 |
IMPLICIT NONE |
22 |
|
23 |
C == GLobal variables == |
24 |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
#include "GRID.h" |
28 |
#include "DARWIN_SIZE.h" |
29 |
#include "SPECTRAL_SIZE.h" |
30 |
#include "DARWIN_IO.h" |
31 |
#include "DARWIN_FLUX.h" |
32 |
c#include "GCHEM.h" |
33 |
#ifdef ALLOW_SEAICE |
34 |
#include "SEAICE_SIZE.h" |
35 |
#include "SEAICE.h" |
36 |
#endif |
37 |
#ifdef ALLOW_THSICE |
38 |
#include "THSICE_VARS.h" |
39 |
#endif |
40 |
#ifdef ALLOW_OFFLINE |
41 |
#include "OFFLINE.h" |
42 |
#endif |
43 |
#ifdef OASIM |
44 |
#include "SPECTRAL.h" |
45 |
#endif |
46 |
|
47 |
C == Routine arguments == |
48 |
INTEGER myIter |
49 |
_RL myTime |
50 |
INTEGER myThid |
51 |
C == Local variables == |
52 |
C msgBuf - Informational/error meesage buffer |
53 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
54 |
COMMON/ darwin_load / |
55 |
& fice0, fice1, featmos0, featmos1, sur_par0, sur_par1 |
56 |
#ifdef ALLOW_CARBON |
57 |
& ,dicwind0, dicwind1,atmosp0, atmosp1 |
58 |
#endif |
59 |
#ifdef NUT_SUPPLY |
60 |
& , nut_wvel0, nut_wvel1 |
61 |
#endif |
62 |
#ifdef RELAX_NUTS |
63 |
& , po4_obs0, po4_obs1, no3_obs0, no3_obs1 |
64 |
& , fet_obs0, fet_obs1, si_obs0, si_obs1 |
65 |
#endif |
66 |
#ifdef FLUX_NUTS |
67 |
& , po4_flx0, po4_flx1, no3_flx0, no3_flx1 |
68 |
& , fet_flx0, fet_flx1, si_flx0, si_flx1 |
69 |
#endif |
70 |
#ifdef ADKINNS_SURF_FLUX |
71 |
& , dicSurf_flx0, dicSurf_flx1 |
72 |
& , alkSurf_flx0, alkSurf_flx1 |
73 |
& , caSurf_flx0, caSurf_flx1 |
74 |
#endif |
75 |
#ifdef ALLOW_SED_DISS_FLUX |
76 |
& , BBLThickness |
77 |
#endif |
78 |
#ifdef OASIM |
79 |
& , oasim_ed0, oasim_ed1, oasim_es0, oasim_es1 |
80 |
#endif |
81 |
_RS fice0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
82 |
_RS fice1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
83 |
_RS featmos0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
84 |
_RS featmos1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
85 |
_RS sur_par0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
86 |
_RS sur_par1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
87 |
#ifdef ALLOW_CARBON |
88 |
_RS dicwind0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
89 |
_RS dicwind1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
90 |
_RS atmosp0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
91 |
_RS atmosp1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
92 |
#endif |
93 |
#ifdef NUT_SUPPLY |
94 |
_RS nut_wvel0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
95 |
_RS nut_wvel1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
96 |
#endif |
97 |
#ifdef RELAX_NUTS |
98 |
_RS po4_obs0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
99 |
_RS po4_obs1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
100 |
_RS no3_obs0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
101 |
_RS no3_obs1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
102 |
_RS fet_obs0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
103 |
_RS fet_obs1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
104 |
_RS si_obs0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
105 |
_RS si_obs1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
106 |
#endif |
107 |
#ifdef FLUX_NUTS |
108 |
_RS po4_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
109 |
_RS po4_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
110 |
_RS no3_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
111 |
_RS no3_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
112 |
_RS fet_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
113 |
_RS fet_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
114 |
_RS si_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
115 |
_RS si_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
116 |
#endif |
117 |
#ifdef ADKINS_SURF_FLUX |
118 |
_RS dicSurf_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
119 |
_RS dicSurf_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
120 |
_RS alkSurf_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
121 |
_RS alkSurf_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
122 |
_RS caSurf_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
123 |
_RS caSurf_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
124 |
#endif |
125 |
#ifdef OASIM |
126 |
_RS oasim_ed0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,tlam,nSx,nSy) |
127 |
_RS oasim_ed1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,tlam,nSx,nSy) |
128 |
_RS oasim_es0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,tlam,nSx,nSy) |
129 |
_RS oasim_es1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,tlam,nSx,nSy) |
130 |
_RS tmp1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
131 |
_RS tmp2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
132 |
INTEGER ilam, fp, nj0, nj1 |
133 |
#endif |
134 |
INTEGER bi,bj,i,j,k,intime0,intime1 |
135 |
_RL aWght,bWght,rdt |
136 |
_RL tmp1Wght, tmp2Wght |
137 |
INTEGER nForcingPeriods,Imytm,Ifprd,Ifcyc,Iftm |
138 |
c |
139 |
c |
140 |
|
141 |
#ifdef ALLOW_SED_DISS_FLUX |
142 |
|
143 |
C initialize BBL thickness |
144 |
DO bj = myByLo(myThid), myByHi(myThid) |
145 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
146 |
DO j=1-OLy,sNy+OLy |
147 |
DO i=1-OLx,sNx+OLx |
148 |
BBLThickness(i,j,bi,bj) = 0. _d 0 |
149 |
ENDDO |
150 |
ENDDO |
151 |
ENDDO |
152 |
ENDDO |
153 |
|
154 |
if (darwin_BBLFile .NE. ' ') then |
155 |
CALL READ_REC_XY_RS(darwin_BBLFile,BBLThickness, |
156 |
& 1,0,myThid) |
157 |
endif |
158 |
|
159 |
_EXCH_XY_RS(BBLThickness, myThid) |
160 |
|
161 |
#endif /* ALLOW_SED_DISS_FLUX */ |
162 |
|
163 |
IF ( darwin_ForcingPeriod .NE. 0. _d 0 ) THEN |
164 |
|
165 |
C First call requires that we initialize everything to zero for safety |
166 |
cQQQ need to check timing |
167 |
IF ( myIter .EQ. nIter0 ) THEN |
168 |
CALL LEF_ZERO( fice0,myThid ) |
169 |
CALL LEF_ZERO( fice1,myThid ) |
170 |
CALL LEF_ZERO( featmos0,myThid ) |
171 |
CALL LEF_ZERO( featmos1,myThid ) |
172 |
CALL LEF_ZERO( sur_par0,myThid ) |
173 |
CALL LEF_ZERO( sur_par1,myThid ) |
174 |
#ifdef ALLOW_CARBON |
175 |
CALL LEF_ZERO( dicwind0,myThid ) |
176 |
CALL LEF_ZERO( dicwind1,myThid ) |
177 |
CALL LEF_ZERO( atmosp0,myThid ) |
178 |
CALL LEF_ZERO( atmosp1,myThid ) |
179 |
#endif |
180 |
#ifdef NUT_SUPPLY |
181 |
DO bj = myByLo(myThid), myByHi(myThid) |
182 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
183 |
DO j=1-Oly,sNy+Oly |
184 |
DO i=1-Olx,sNx+Olx |
185 |
DO k=1,nR |
186 |
nut_wvel0(i,j,k,bi,bj) = 0. _d 0 |
187 |
nut_wvel1(i,j,k,bi,bj) = 0. _d 0 |
188 |
ENDDO |
189 |
ENDDO |
190 |
ENDDO |
191 |
ENDDO |
192 |
ENDDO |
193 |
#endif |
194 |
#ifdef RELAX_NUTS |
195 |
DO bj = myByLo(myThid), myByHi(myThid) |
196 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
197 |
DO j=1-Oly,sNy+Oly |
198 |
DO i=1-Olx,sNx+Olx |
199 |
DO k=1,nR |
200 |
po4_obs0(i,j,k,bi,bj) = 0. _d 0 |
201 |
po4_obs1(i,j,k,bi,bj) = 0. _d 0 |
202 |
no3_obs0(i,j,k,bi,bj) = 0. _d 0 |
203 |
no3_obs1(i,j,k,bi,bj) = 0. _d 0 |
204 |
fet_obs0(i,j,k,bi,bj) = 0. _d 0 |
205 |
fet_obs1(i,j,k,bi,bj) = 0. _d 0 |
206 |
si_obs0(i,j,k,bi,bj) = 0. _d 0 |
207 |
si_obs1(i,j,k,bi,bj) = 0. _d 0 |
208 |
ENDDO |
209 |
ENDDO |
210 |
ENDDO |
211 |
ENDDO |
212 |
ENDDO |
213 |
#endif |
214 |
#ifdef FLUX_NUTS |
215 |
DO bj = myByLo(myThid), myByHi(myThid) |
216 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
217 |
DO j=1-Oly,sNy+Oly |
218 |
DO i=1-Olx,sNx+Olx |
219 |
DO k=1,nR |
220 |
po4_flx0(i,j,k,bi,bj) = 0. _d 0 |
221 |
po4_flx1(i,j,k,bi,bj) = 0. _d 0 |
222 |
no3_flx0(i,j,k,bi,bj) = 0. _d 0 |
223 |
no3_flx1(i,j,k,bi,bj) = 0. _d 0 |
224 |
fet_flx0(i,j,k,bi,bj) = 0. _d 0 |
225 |
fet_flx1(i,j,k,bi,bj) = 0. _d 0 |
226 |
si_flx0(i,j,k,bi,bj) = 0. _d 0 |
227 |
si_flx1(i,j,k,bi,bj) = 0. _d 0 |
228 |
ENDDO |
229 |
ENDDO |
230 |
ENDDO |
231 |
ENDDO |
232 |
ENDDO |
233 |
#endif |
234 |
#ifdef ADKINS_SURF_FLUX |
235 |
DO bj = myByLo(myThid), myByHi(myThid) |
236 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
237 |
DO j=1-Oly,sNy+Oly |
238 |
DO i=1-Olx,sNx+Olx |
239 |
dicSurf_flx0(i,j,bi,bj) = 0. _d 0 |
240 |
dicSurf_flx1(i,j,bi,bj) = 0. _d 0 |
241 |
alkSurf_flx0(i,j,bi,bj) = 0. _d 0 |
242 |
alkSurf_flx1(i,j,bi,bj) = 0. _d 0 |
243 |
caSurf_flx0(i,j,bi,bj) = 0. _d 0 |
244 |
caSurf_flx1(i,j,bi,bj) = 0. _d 0 |
245 |
ENDDO |
246 |
ENDDO |
247 |
ENDDO |
248 |
ENDDO |
249 |
#endif |
250 |
#ifdef OASIM |
251 |
DO bj = myByLo(myThid), myByHi(myThid) |
252 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
253 |
DO j=1-Oly,sNy+Oly |
254 |
DO i=1-Olx,sNx+Olx |
255 |
tmp1(i,j,bi,bj) = 0. _d 0 |
256 |
tmp2(i,j,bi,bj) = 0. _d 0 |
257 |
DO ilam=1,tlam |
258 |
oasim_ed0(i,j,ilam,bi,bj) = 0. _d 0 |
259 |
oasim_ed1(i,j,ilam,bi,bj) = 0. _d 0 |
260 |
oasim_es0(i,j,ilam,bi,bj) = 0. _d 0 |
261 |
oasim_es1(i,j,ilam,bi,bj) = 0. _d 0 |
262 |
ENDDO |
263 |
ENDDO |
264 |
ENDDO |
265 |
ENDDO |
266 |
ENDDO |
267 |
#endif |
268 |
|
269 |
|
270 |
|
271 |
ENDIF |
272 |
|
273 |
|
274 |
C Now calculate whether it is time to update the forcing arrays |
275 |
rdt=1. _d 0 / deltaTclock |
276 |
nForcingPeriods= |
277 |
& int(darwin_ForcingCycle/darwin_ForcingPeriod+0.5 _d 0) |
278 |
Imytm=int(myTime*rdt+0.5 _d 0) |
279 |
Ifprd=int(darwin_ForcingPeriod*rdt+0.5 _d 0) |
280 |
Ifcyc=int(darwin_ForcingCycle*rdt+0.5 _d 0) |
281 |
Iftm=mod( Imytm+Ifcyc-Ifprd/2,Ifcyc) |
282 |
|
283 |
intime0=int(Iftm/Ifprd) |
284 |
intime1=mod(intime0+1,nForcingPeriods) |
285 |
tmp1Wght = FLOAT( Iftm-Ifprd*intime0 ) |
286 |
tmp2Wght = FLOAT( Ifprd ) |
287 |
aWght = tmp1Wght / tmp2Wght |
288 |
bWght = 1. _d 0 - aWght |
289 |
|
290 |
intime0=intime0+1 |
291 |
intime1=intime1+1 |
292 |
|
293 |
|
294 |
cQQ something funny about timing here - need nIter0+1 |
295 |
c but seems okay for remaining timesteps |
296 |
IF ( |
297 |
& Iftm-Ifprd*(intime0-1) .EQ. 0 |
298 |
& .OR. myIter .EQ. nIter0 |
299 |
& ) THEN |
300 |
|
301 |
|
302 |
_BEGIN_MASTER(myThid) |
303 |
|
304 |
C If the above condition is met then we need to read in |
305 |
C data for the period ahead and the period behind myTime. |
306 |
WRITE(msgBuf,'(A,1P1E20.12,X,I10)') |
307 |
& 'S/R DARWIN_FIELDS_LOAD: Reading forcing data', |
308 |
& myTime,myIter |
309 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
310 |
& SQUEEZE_RIGHT, myThid ) |
311 |
|
312 |
IF ( darwin_iceFile .NE. ' ' ) THEN |
313 |
CALL READ_REC_XY_RS( darwin_iceFile,fice0,intime0, |
314 |
& myIter,myThid ) |
315 |
CALL READ_REC_XY_RS( darwin_IceFile,fice1,intime1, |
316 |
& myIter,myThid ) |
317 |
ENDIF |
318 |
IF ( darwin_ironFile .NE. ' ' ) THEN |
319 |
CALL READ_REC_XY_RS( darwin_ironFile,featmos0,intime0, |
320 |
& myIter,myThid ) |
321 |
CALL READ_REC_XY_RS( darwin_ironFile,featmos1,intime1, |
322 |
& myIter,myThid ) |
323 |
ENDIF |
324 |
IF ( darwin_PARFile .NE. ' ' ) THEN |
325 |
CALL READ_REC_XY_RS( darwin_PARFile,sur_par0,intime0, |
326 |
& myIter,myThid ) |
327 |
CALL READ_REC_XY_RS( darwin_PARFile,sur_par1,intime1, |
328 |
& myIter,myThid ) |
329 |
ENDIF |
330 |
#ifdef ALLOW_CARBON |
331 |
IF ( DIC_windFile .NE. ' ' ) THEN |
332 |
CALL READ_REC_XY_RS( DIC_windFile,dicwind0,intime0, |
333 |
& myIter,myThid ) |
334 |
CALL READ_REC_XY_RS( DIC_windFile,dicwind1,intime1, |
335 |
& myIter,myThid ) |
336 |
ENDIF |
337 |
IF ( DIC_atmospFile .NE. ' ' ) THEN |
338 |
CALL READ_REC_XY_RS( DIC_atmospFile,atmosp0,intime0, |
339 |
& myIter,myThid ) |
340 |
CALL READ_REC_XY_RS( DIC_atmospFile,atmosp1,intime1, |
341 |
& myIter,myThid ) |
342 |
ENDIF |
343 |
#endif |
344 |
#ifdef NUT_SUPPLY |
345 |
IF ( darwin_nutWVelFile .NE. ' ' ) THEN |
346 |
CALL READ_REC_XYZ_RS( darwin_nutWVelFile,nut_wvel0,intime0, |
347 |
& myIter,myThid ) |
348 |
CALL READ_REC_XYZ_RS( darwin_nutWVelFile,nut_wvel1,intime1, |
349 |
& myIter,myThid ) |
350 |
ENDIF |
351 |
#endif |
352 |
#ifdef RELAX_NUTS |
353 |
IF ( darwin_PO4_RelaxFile .NE. ' ' ) THEN |
354 |
CALL READ_REC_XYZ_RS( darwin_PO4_RelaxFile,po4_obs0,intime0, |
355 |
& myIter,myThid ) |
356 |
CALL READ_REC_XYZ_RS( darwin_PO4_RelaxFile,po4_obs1,intime1, |
357 |
& myIter,myThid ) |
358 |
ENDIF |
359 |
IF ( darwin_NO3_RelaxFile .NE. ' ' ) THEN |
360 |
CALL READ_REC_XYZ_RS( darwin_NO3_RelaxFile,no3_obs0,intime0, |
361 |
& myIter,myThid ) |
362 |
CALL READ_REC_XYZ_RS( darwin_NO3_RelaxFile,no3_obs1,intime1, |
363 |
& myIter,myThid ) |
364 |
ENDIF |
365 |
IF ( darwin_Fet_RelaxFile .NE. ' ' ) THEN |
366 |
CALL READ_REC_XYZ_RS( darwin_Fet_RelaxFile,fet_obs0,intime0, |
367 |
& myIter,myThid ) |
368 |
CALL READ_REC_XYZ_RS( darwin_Fet_RelaxFile,fet_obs1,intime1, |
369 |
& myIter,myThid ) |
370 |
ENDIF |
371 |
IF ( darwin_Si_RelaxFile .NE. ' ' ) THEN |
372 |
CALL READ_REC_XYZ_RS( darwin_Si_RelaxFile,si_obs0,intime0, |
373 |
& myIter,myThid ) |
374 |
CALL READ_REC_XYZ_RS( darwin_Si_RelaxFile,si_obs1,intime1, |
375 |
& myIter,myThid ) |
376 |
ENDIF |
377 |
#endif |
378 |
#ifdef FLUX_NUTS |
379 |
IF ( darwin_PO4_FluxFile .NE. ' ' ) THEN |
380 |
CALL READ_REC_XYZ_RS( darwin_PO4_FluxFile,po4_flx0,intime0, |
381 |
& myIter,myThid ) |
382 |
CALL READ_REC_XYZ_RS( darwin_PO4_FluxFile,po4_flx1,intime1, |
383 |
& myIter,myThid ) |
384 |
ENDIF |
385 |
IF ( darwin_NO3_FluxFile .NE. ' ' ) THEN |
386 |
CALL READ_REC_XYZ_RS( darwin_NO3_FluxFile,no3_flx0,intime0, |
387 |
& myIter,myThid ) |
388 |
CALL READ_REC_XYZ_RS( darwin_NO3_FluxFile,no3_flx1,intime1, |
389 |
& myIter,myThid ) |
390 |
ENDIF |
391 |
IF ( darwin_Fet_FluxFile .NE. ' ' ) THEN |
392 |
CALL READ_REC_XYZ_RS( darwin_Fet_FluxFile,fet_flx0,intime0, |
393 |
& myIter,myThid ) |
394 |
CALL READ_REC_XYZ_RS( darwin_Fet_FluxFile,fet_flx1,intime1, |
395 |
& myIter,myThid ) |
396 |
ENDIF |
397 |
IF ( darwin_Si_FluxFile .NE. ' ' ) THEN |
398 |
CALL READ_REC_XYZ_RS( darwin_Si_FluxFile,si_flx0,intime0, |
399 |
& myIter,myThid ) |
400 |
CALL READ_REC_XYZ_RS( darwin_Si_FluxFile,si_flx1,intime1, |
401 |
& myIter,myThid ) |
402 |
ENDIF |
403 |
#endif |
404 |
#ifdef ADKINS_SURF_FLUX |
405 |
IF ( darwin_dicSurfFluxFile .NE. ' ' ) THEN |
406 |
CALL READ_REC_XY_RS( darwin_dicSurfFluxFile,dicSurf_flx0, |
407 |
& intime0,myIter,myThid ) |
408 |
CALL READ_REC_XY_RS( darwin_dicSurfFluxFile,dicSurf_flx1, |
409 |
& intime1,myIter,myThid ) |
410 |
ENDIF |
411 |
IF ( darwin_alkSurfFluxFile .NE. ' ' ) THEN |
412 |
CALL READ_REC_XY_RS( darwin_alkSurfFluxFile,alkSurf_flx0, |
413 |
& intime0,myIter,myThid ) |
414 |
CALL READ_REC_XY_RS( darwin_alkSurfFluxFile,alkSurf_flx1, |
415 |
& intime1,myIter,myThid ) |
416 |
ENDIF |
417 |
IF ( darwin_caSurfFluxFile .NE. ' ' ) THEN |
418 |
CALL READ_REC_XY_RS( darwin_caSurfFluxFile,caSurf_flx0, |
419 |
& intime0,myIter,myThid ) |
420 |
CALL READ_REC_XY_RS( darwin_caSurfFluxFile,caSurf_flx1, |
421 |
& intime1,myIter,myThid ) |
422 |
ENDIF |
423 |
#endif |
424 |
#ifdef OASIM |
425 |
IF ( darwin_oasim_edFile .NE. ' ' ) THEN |
426 |
nj0= (intime0-1)*tlam |
427 |
nj1= (intime1-1)*tlam |
428 |
c print*,'ZZ nj0,nj1',nj0, nj1, intime0, intime1 |
429 |
do ilam=1,tlam |
430 |
nj0=nj0+1 |
431 |
CALL READ_REC_XY_RS( darwin_oasim_edFile, tmp1,nj0, |
432 |
& myIter,myThid ) |
433 |
nj1=nj1+1 |
434 |
CALL READ_REC_XY_RS( darwin_oasim_edFile, tmp2,nj1, |
435 |
& myIter,myThid ) |
436 |
DO bj = myByLo(myThid), myByHi(myThid) |
437 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
438 |
DO j=1-Oly,sNy+Oly |
439 |
DO i=1-Olx,sNx+Olx |
440 |
oasim_ed0(i,j,ilam,bi,bj) = tmp1(i,j,bi,bj) |
441 |
oasim_ed1(i,j,ilam,bi,bj) = tmp2(i,j,bi,bj) |
442 |
ENDDO |
443 |
ENDDO |
444 |
ENDDO |
445 |
ENDDO |
446 |
c print*,oasim_ed0(1,1,ilam,1,1), oasim_ed1(1,1,ilam,1,1) |
447 |
enddo |
448 |
c CALL READ_MFLDS_3D_RS( darwin_oasim_edFile, oasim_ed0, |
449 |
c & nj0, fp, tlam, myIter,myThid ) |
450 |
c CALL READ_MFLDS_3D_RS( darwin_oasim_edFile, oasim_ed1, |
451 |
c & nj1, fp, tlam, myIter,myThid ) |
452 |
ENDIF |
453 |
IF ( darwin_oasim_esFile .NE. ' ' ) THEN |
454 |
nj0= (intime0-1)*tlam |
455 |
nj1= (intime1-1)*tlam |
456 |
do ilam=1,tlam |
457 |
nj0=nj0+1 |
458 |
CALL READ_REC_XY_RS( darwin_oasim_esFile, tmp1,nj0, |
459 |
& myIter,myThid ) |
460 |
nj1=nj1+1 |
461 |
CALL READ_REC_XY_RS( darwin_oasim_esFile, tmp2,nj1, |
462 |
& myIter,myThid ) |
463 |
DO bj = myByLo(myThid), myByHi(myThid) |
464 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
465 |
DO j=1-Oly,sNy+Oly |
466 |
DO i=1-Olx,sNx+Olx |
467 |
oasim_es0(i,j,ilam,bi,bj) = tmp1(i,j,bi,bj) |
468 |
oasim_es1(i,j,ilam,bi,bj) = tmp2(i,j,bi,bj) |
469 |
ENDDO |
470 |
ENDDO |
471 |
ENDDO |
472 |
ENDDO |
473 |
enddo |
474 |
c CALL READ_MFLDS_3D_RS( darwin_oasim_esFile, oasim_es0, |
475 |
c & nj0, fp, tlam, myIter,myThid ) |
476 |
c CALL READ_MFLDS_3D_RS( darwin_oasim_esFile, oasim_es1, |
477 |
c & nj1, fp, tlam, myIter,myThid ) |
478 |
ENDIF |
479 |
#endif |
480 |
|
481 |
_END_MASTER(myThid) |
482 |
C |
483 |
_EXCH_XY_RS(fice0, myThid ) |
484 |
_EXCH_XY_RS(fice1, myThid ) |
485 |
_EXCH_XY_RS(featmos0, myThid ) |
486 |
_EXCH_XY_RS(featmos1, myThid ) |
487 |
_EXCH_XY_RS(sur_par0, myThid ) |
488 |
_EXCH_XY_RS(sur_par1, myThid ) |
489 |
#ifdef ALLOW_CARBON |
490 |
_EXCH_XY_RS(dicwind0, myThid ) |
491 |
_EXCH_XY_RS(dicwind1, myThid ) |
492 |
_EXCH_XY_RS(atmosp0, myThid ) |
493 |
_EXCH_XY_RS(atmosp1, myThid ) |
494 |
#endif |
495 |
#ifdef NUT_SUPPLY |
496 |
_EXCH_XYZ_RS(nut_wvel0, myThid ) |
497 |
_EXCH_XYZ_RS(nut_wvel1, myThid ) |
498 |
#endif |
499 |
#ifdef RELAX_NUTS |
500 |
_EXCH_XYZ_RS(po4_obs0, myThid ) |
501 |
_EXCH_XYZ_RS(po4_obs1, myThid ) |
502 |
_EXCH_XYZ_RS(no3_obs0, myThid ) |
503 |
_EXCH_XYZ_RS(no3_obs1, myThid ) |
504 |
_EXCH_XYZ_RS(fet_obs0, myThid ) |
505 |
_EXCH_XYZ_RS(fet_obs1, myThid ) |
506 |
_EXCH_XYZ_RS(si_obs0, myThid ) |
507 |
_EXCH_XYZ_RS(si_obs1, myThid ) |
508 |
#endif |
509 |
#ifdef FLUX_NUTS |
510 |
_EXCH_XYZ_RS(po4_flx0, myThid ) |
511 |
_EXCH_XYZ_RS(po4_flx1, myThid ) |
512 |
_EXCH_XYZ_RS(no3_flx0, myThid ) |
513 |
_EXCH_XYZ_RS(no3_flx1, myThid ) |
514 |
_EXCH_XYZ_RS(fet_flx0, myThid ) |
515 |
_EXCH_XYZ_RS(fet_flx1, myThid ) |
516 |
_EXCH_XYZ_RS(si_flx0, myThid ) |
517 |
_EXCH_XYZ_RS(si_flx1, myThid ) |
518 |
#endif |
519 |
#ifdef ADKINS_SURF_FLUX |
520 |
_EXCH_XY_RS(dicSurf_flx0, myThid ) |
521 |
_EXCH_XY_RS(dicSurf_flx1, myThid ) |
522 |
_EXCH_XY_RS(alkSurf_flx0, myThid ) |
523 |
_EXCH_XY_RS(alkSurf_flx1, myThid ) |
524 |
_EXCH_XY_RS(caSurf_flx0, myThid ) |
525 |
_EXCH_XY_RS(caSurf_flx1, myThid ) |
526 |
#endif |
527 |
#ifdef OASIM |
528 |
CALL EXCH_3D_RS (oasim_ed0, tlam, myThid) |
529 |
CALL EXCH_3D_RS (oasim_ed1, tlam, myThid) |
530 |
CALL EXCH_3D_RS (oasim_es0, tlam, myThid) |
531 |
CALL EXCH_3D_RS (oasim_es1, tlam, myThid) |
532 |
#endif |
533 |
|
534 |
|
535 |
C |
536 |
ENDIF |
537 |
|
538 |
DO bj = myByLo(myThid), myByHi(myThid) |
539 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
540 |
DO j=1-Oly,sNy+Oly |
541 |
DO i=1-Olx,sNx+Olx |
542 |
cQQ need to include ice model here, if used |
543 |
#ifdef ALLOW_THSICE |
544 |
FIce(i,j,bi,bj) = iceMask(i,j,bi,bj) |
545 |
#else |
546 |
#ifdef ALLOW_SEAICE |
547 |
FIce(i,j,bi,bj) = AREA(i,j,bi,bj) |
548 |
#else |
549 |
IF ( darwin_iceFile .NE. ' ' ) THEN |
550 |
fice(i,j,bi,bj) = bWght*fice0(i,j,bi,bj) |
551 |
& +aWght*fice1(i,j,bi,bj) |
552 |
ELSE |
553 |
fice(i,j,bi,bj) = 0. _d 0 |
554 |
ENDIF |
555 |
#endif |
556 |
#endif |
557 |
c or use offline fields if provided |
558 |
#ifdef ALLOW_OFFLINE |
559 |
IF (IceFile .NE. ' ') THEN |
560 |
fice(i,j,bi,bj) = ICEM(i,j,bi,bj) |
561 |
ENDIF |
562 |
#endif |
563 |
|
564 |
IF ( darwin_ironFile .NE. ' ' ) THEN |
565 |
inputFe(i,j,bi,bj) = bWght*featmos0(i,j,bi,bj) |
566 |
& +aWght*featmos1(i,j,bi,bj) |
567 |
c convert to mmol/m2/s |
568 |
inputFe(i,j,bi,bj) = 1000.d0*inputFe(i,j,bi,bj) |
569 |
ELSE |
570 |
inputFe(i,j,bi,bj) = 0. _d 0 |
571 |
ENDIF |
572 |
c light (load as Ein/m2/d; convert to uEin/m2/s) |
573 |
IF ( darwin_PARFile .NE. ' ' ) THEN |
574 |
sur_par(i,j,bi,bj) = bWght*sur_par0(i,j,bi,bj) |
575 |
& +aWght*sur_par1(i,j,bi,bj) |
576 |
sur_par(i,j,bi,bj) = sur_par(i,j,bi,bj)*1. _d 6/86400. _d 0 |
577 |
ELSE |
578 |
sur_par(i,j,bi,bj) = 200. _d 0*maskC(i,j,1,bi,bj) |
579 |
ENDIF |
580 |
#ifdef ALLOW_CARBON |
581 |
IF ( DIC_windFile .NE. ' ' ) THEN |
582 |
WIND(i,j,bi,bj) = bWght*dicwind0(i,j,bi,bj) |
583 |
& + aWght*dicwind1(i,j,bi,bj) |
584 |
ELSE |
585 |
WIND(i,j,bi,bj) = 5. _d 0 |
586 |
ENDIF |
587 |
#ifndef USE_PLOAD |
588 |
IF ( DIC_atmospFile .NE. ' ' ) THEN |
589 |
AtmosP(i,j,bi,bj) = bWght*atmosp0(i,j,bi,bj) |
590 |
& + aWght*atmosp1(i,j,bi,bj) |
591 |
ELSE |
592 |
AtmosP(i,j,bi,bj) = 1. _d 0 |
593 |
ENDIF |
594 |
#endif |
595 |
#endif |
596 |
#ifdef NUT_SUPPLY |
597 |
c artificial wvel for nutrient supply in 1-d and 2-d models |
598 |
IF ( darwin_nutWVelFile .NE. ' ' ) THEN |
599 |
DO k=1,nR |
600 |
nut_wvel(i,j,k,bi,bj) = bWght*nut_wvel0(i,j,k,bi,bj) |
601 |
& +aWght*nut_wvel1(i,j,k,bi,bj) |
602 |
ENDDO |
603 |
ENDIF |
604 |
#endif |
605 |
#ifdef RELAX_NUTS |
606 |
IF ( darwin_PO4_RelaxFile .NE. ' ' ) THEN |
607 |
DO k=1,nR |
608 |
po4_obs(i,j,k,bi,bj) = bWght*po4_obs0(i,j,k,bi,bj) |
609 |
& +aWght*po4_obs1(i,j,k,bi,bj) |
610 |
ENDDO |
611 |
ENDIF |
612 |
IF ( darwin_NO3_RelaxFile .NE. ' ' ) THEN |
613 |
DO k=1,nR |
614 |
no3_obs(i,j,k,bi,bj) = bWght*no3_obs0(i,j,k,bi,bj) |
615 |
& +aWght*no3_obs1(i,j,k,bi,bj) |
616 |
ENDDO |
617 |
ENDIF |
618 |
IF ( darwin_Fet_RelaxFile .NE. ' ' ) THEN |
619 |
DO k=1,nR |
620 |
fet_obs(i,j,k,bi,bj) = bWght*fet_obs0(i,j,k,bi,bj) |
621 |
& +aWght*fet_obs1(i,j,k,bi,bj) |
622 |
ENDDO |
623 |
ENDIF |
624 |
IF ( darwin_Si_RelaxFile .NE. ' ' ) THEN |
625 |
DO k=1,nR |
626 |
si_obs(i,j,k,bi,bj) = bWght*si_obs0(i,j,k,bi,bj) |
627 |
& +aWght*si_obs1(i,j,k,bi,bj) |
628 |
ENDDO |
629 |
ENDIF |
630 |
#endif |
631 |
#ifdef FLUX_NUTS |
632 |
IF ( darwin_PO4_FluxFile .NE. ' ' ) THEN |
633 |
DO k=1,nR |
634 |
po4_flx(i,j,k,bi,bj) = bWght*po4_flx0(i,j,k,bi,bj) |
635 |
& +aWght*po4_flx1(i,j,k,bi,bj) |
636 |
ENDDO |
637 |
ENDIF |
638 |
IF ( darwin_NO3_FluxFile .NE. ' ' ) THEN |
639 |
DO k=1,nR |
640 |
no3_flx(i,j,k,bi,bj) = bWght*no3_flx0(i,j,k,bi,bj) |
641 |
& +aWght*no3_flx1(i,j,k,bi,bj) |
642 |
ENDDO |
643 |
ENDIF |
644 |
IF ( darwin_Fet_FluxFile .NE. ' ' ) THEN |
645 |
DO k=1,nR |
646 |
fet_flx(i,j,k,bi,bj) = bWght*fet_flx0(i,j,k,bi,bj) |
647 |
& +aWght*fet_flx1(i,j,k,bi,bj) |
648 |
ENDDO |
649 |
ENDIF |
650 |
IF ( darwin_Si_FluxFile .NE. ' ' ) THEN |
651 |
DO k=1,nR |
652 |
si_flx(i,j,k,bi,bj) = bWght*si_flx0(i,j,k,bi,bj) |
653 |
& +aWght*si_flx1(i,j,k,bi,bj) |
654 |
ENDDO |
655 |
ENDIF |
656 |
#endif |
657 |
|
658 |
#ifdef ADKINS_SURF_FLUX |
659 |
IF ( darwin_dicSurfFluxFile .NE. ' ' ) THEN |
660 |
dicSurf_flx(i,j,bi,bj) = bWght*dicSurf_flx0(i,j,bi,bj) |
661 |
& +aWght*dicSurf_flx1(i,j,bi,bj) |
662 |
ENDIF |
663 |
IF ( darwin_alkSurfFluxFile .NE. ' ' ) THEN |
664 |
alkSurf_flx(i,j,bi,bj) = bWght*alkSurf_flx0(i,j,bi,bj) |
665 |
& +aWght*alkSurf_flx1(i,j,bi,bj) |
666 |
ENDIF |
667 |
IF ( darwin_caSurfFluxFile .NE. ' ' ) THEN |
668 |
caSurf_flx(i,j,bi,bj) = bWght*caSurf_flx0(i,j,bi,bj) |
669 |
& +aWght*caSurf_flx1(i,j,bi,bj) |
670 |
ENDIF |
671 |
#endif |
672 |
|
673 |
#ifdef OASIM |
674 |
IF ( darwin_oasim_edFile .NE. ' ' ) THEN |
675 |
c oasim data (load as W/m2 per band) |
676 |
DO ilam=1,tlam |
677 |
oasim_ed(i,j,ilam,bi,bj) = |
678 |
& bWght*oasim_ed0(i,j,ilam,bi,bj) |
679 |
& +aWght*oasim_ed1(i,j,ilam,bi,bj) |
680 |
c oasim_ed(i,j,ilam,bi,bj) = |
681 |
c & oasim_ed(i,j,ilam,bi,bj)*1. _d 6/86400. _d 0 |
682 |
ENDDO |
683 |
ENDIF |
684 |
IF ( darwin_oasim_esFile .NE. ' ' ) THEN |
685 |
DO ilam=1,tlam |
686 |
oasim_es(i,j,ilam,bi,bj) = |
687 |
& bWght*oasim_es0(i,j,ilam,bi,bj) |
688 |
& +aWght*oasim_es1(i,j,ilam,bi,bj) |
689 |
c oasim_es(i,j,ilam,bi,bj) = |
690 |
c & oasim_es(i,j,ilam,bi,bj)*1. _d 6/86400. _d 0 |
691 |
ENDDO |
692 |
ENDIF |
693 |
#ifndef WAVEBANDS |
694 |
c if not spectral add wavebands to give a single surface PAR |
695 |
c and convert to uEin/m2/s |
696 |
sur_par(i,j,bi,bj)= 0. _d 0 |
697 |
DO ilam=1,tlam |
698 |
sur_par(i,j,bi,bj)=sur_par(i,j,bi,bj)+WtouEins(ilam) |
699 |
& *(oasim_ed(i,j,ilam,bi,bj)+ |
700 |
& oasim_es(i,j,ilam,bi,bj)) |
701 |
ENDDO |
702 |
#endif |
703 |
#endif |
704 |
c |
705 |
ENDDO |
706 |
ENDDO |
707 |
ENDDO |
708 |
ENDDO |
709 |
|
710 |
C endif for periodicForcing |
711 |
ENDIF |
712 |
|
713 |
RETURN |
714 |
END |
715 |
#endif |
716 |
#endif |
717 |
|