1 |
C $Header: /u/gcmpack/MITgcm_contrib/darwin2/pkg/darwin/darwin_fields_load.F,v 1.5 2012/03/17 22:20:17 jahn 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 OASIM |
71 |
& , oasim_ed0, oasim_ed1, oasim_es0, oasim_es1 |
72 |
#endif |
73 |
_RS fice0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
74 |
_RS fice1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
75 |
_RS featmos0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
76 |
_RS featmos1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
77 |
_RS sur_par0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
78 |
_RS sur_par1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
79 |
#ifdef ALLOW_CARBON |
80 |
_RS dicwind0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
81 |
_RS dicwind1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
82 |
_RS atmosp0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
83 |
_RS atmosp1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
84 |
#endif |
85 |
#ifdef NUT_SUPPLY |
86 |
_RS nut_wvel0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
87 |
_RS nut_wvel1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
88 |
#endif |
89 |
#ifdef RELAX_NUTS |
90 |
_RS po4_obs0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
91 |
_RS po4_obs1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
92 |
_RS no3_obs0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
93 |
_RS no3_obs1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
94 |
_RS fet_obs0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
95 |
_RS fet_obs1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
96 |
_RS si_obs0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
97 |
_RS si_obs1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
98 |
#endif |
99 |
#ifdef FLUX_NUTS |
100 |
_RS po4_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
101 |
_RS po4_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
102 |
_RS no3_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
103 |
_RS no3_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
104 |
_RS fet_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
105 |
_RS fet_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
106 |
_RS si_flx0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
107 |
_RS si_flx1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
108 |
#endif |
109 |
#ifdef OASIM |
110 |
_RS oasim_ed0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,tlam,nSx,nSy) |
111 |
_RS oasim_ed1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,tlam,nSx,nSy) |
112 |
_RS oasim_es0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,tlam,nSx,nSy) |
113 |
_RS oasim_es1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,tlam,nSx,nSy) |
114 |
_RS tmp1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
115 |
_RS tmp2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
116 |
INTEGER ilam, fp, nj0, nj1 |
117 |
#endif |
118 |
INTEGER bi,bj,i,j,k,intime0,intime1 |
119 |
_RL aWght,bWght,rdt |
120 |
_RL tmp1Wght, tmp2Wght |
121 |
INTEGER nForcingPeriods,Imytm,Ifprd,Ifcyc,Iftm |
122 |
c |
123 |
c |
124 |
IF ( darwin_ForcingPeriod .NE. 0. _d 0 ) THEN |
125 |
|
126 |
C First call requires that we initialize everything to zero for safety |
127 |
cQQQ need to check timing |
128 |
IF ( myIter .EQ. nIter0 ) THEN |
129 |
CALL LEF_ZERO( fice0,myThid ) |
130 |
CALL LEF_ZERO( fice1,myThid ) |
131 |
CALL LEF_ZERO( featmos0,myThid ) |
132 |
CALL LEF_ZERO( featmos1,myThid ) |
133 |
CALL LEF_ZERO( sur_par0,myThid ) |
134 |
CALL LEF_ZERO( sur_par1,myThid ) |
135 |
#ifdef ALLOW_CARBON |
136 |
CALL LEF_ZERO( dicwind0,myThid ) |
137 |
CALL LEF_ZERO( dicwind1,myThid ) |
138 |
CALL LEF_ZERO( atmosp0,myThid ) |
139 |
CALL LEF_ZERO( atmosp1,myThid ) |
140 |
#endif |
141 |
#ifdef NUT_SUPPLY |
142 |
DO bj = myByLo(myThid), myByHi(myThid) |
143 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
144 |
DO j=1-Oly,sNy+Oly |
145 |
DO i=1-Olx,sNx+Olx |
146 |
DO k=1,nR |
147 |
nut_wvel0(i,j,k,bi,bj) = 0. _d 0 |
148 |
nut_wvel1(i,j,k,bi,bj) = 0. _d 0 |
149 |
ENDDO |
150 |
ENDDO |
151 |
ENDDO |
152 |
ENDDO |
153 |
ENDDO |
154 |
#endif |
155 |
#ifdef RELAX_NUTS |
156 |
DO bj = myByLo(myThid), myByHi(myThid) |
157 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
158 |
DO j=1-Oly,sNy+Oly |
159 |
DO i=1-Olx,sNx+Olx |
160 |
DO k=1,nR |
161 |
po4_obs0(i,j,k,bi,bj) = 0. _d 0 |
162 |
po4_obs1(i,j,k,bi,bj) = 0. _d 0 |
163 |
no3_obs0(i,j,k,bi,bj) = 0. _d 0 |
164 |
no3_obs1(i,j,k,bi,bj) = 0. _d 0 |
165 |
fet_obs0(i,j,k,bi,bj) = 0. _d 0 |
166 |
fet_obs1(i,j,k,bi,bj) = 0. _d 0 |
167 |
si_obs0(i,j,k,bi,bj) = 0. _d 0 |
168 |
si_obs1(i,j,k,bi,bj) = 0. _d 0 |
169 |
ENDDO |
170 |
ENDDO |
171 |
ENDDO |
172 |
ENDDO |
173 |
ENDDO |
174 |
#endif |
175 |
#ifdef FLUX_NUTS |
176 |
DO bj = myByLo(myThid), myByHi(myThid) |
177 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
178 |
DO j=1-Oly,sNy+Oly |
179 |
DO i=1-Olx,sNx+Olx |
180 |
DO k=1,nR |
181 |
po4_flx0(i,j,k,bi,bj) = 0. _d 0 |
182 |
po4_flx1(i,j,k,bi,bj) = 0. _d 0 |
183 |
no3_flx0(i,j,k,bi,bj) = 0. _d 0 |
184 |
no3_flx1(i,j,k,bi,bj) = 0. _d 0 |
185 |
fet_flx0(i,j,k,bi,bj) = 0. _d 0 |
186 |
fet_flx1(i,j,k,bi,bj) = 0. _d 0 |
187 |
si_flx0(i,j,k,bi,bj) = 0. _d 0 |
188 |
si_flx1(i,j,k,bi,bj) = 0. _d 0 |
189 |
ENDDO |
190 |
ENDDO |
191 |
ENDDO |
192 |
ENDDO |
193 |
ENDDO |
194 |
#endif |
195 |
#ifdef OASIM |
196 |
DO bj = myByLo(myThid), myByHi(myThid) |
197 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
198 |
DO j=1-Oly,sNy+Oly |
199 |
DO i=1-Olx,sNx+Olx |
200 |
tmp1(i,j,bi,bj) = 0. _d 0 |
201 |
tmp2(i,j,bi,bj) = 0. _d 0 |
202 |
DO ilam=1,tlam |
203 |
oasim_ed0(i,j,ilam,bi,bj) = 0. _d 0 |
204 |
oasim_ed1(i,j,ilam,bi,bj) = 0. _d 0 |
205 |
oasim_es0(i,j,ilam,bi,bj) = 0. _d 0 |
206 |
oasim_es1(i,j,ilam,bi,bj) = 0. _d 0 |
207 |
ENDDO |
208 |
ENDDO |
209 |
ENDDO |
210 |
ENDDO |
211 |
ENDDO |
212 |
#endif |
213 |
|
214 |
|
215 |
|
216 |
ENDIF |
217 |
|
218 |
|
219 |
C Now calculate whether it is time to update the forcing arrays |
220 |
rdt=1. _d 0 / deltaTclock |
221 |
nForcingPeriods= |
222 |
& int(darwin_ForcingCycle/darwin_ForcingPeriod+0.5 _d 0) |
223 |
Imytm=int(myTime*rdt+0.5 _d 0) |
224 |
Ifprd=int(darwin_ForcingPeriod*rdt+0.5 _d 0) |
225 |
Ifcyc=int(darwin_ForcingCycle*rdt+0.5 _d 0) |
226 |
Iftm=mod( Imytm+Ifcyc-Ifprd/2,Ifcyc) |
227 |
|
228 |
intime0=int(Iftm/Ifprd) |
229 |
intime1=mod(intime0+1,nForcingPeriods) |
230 |
tmp1Wght = FLOAT( Iftm-Ifprd*intime0 ) |
231 |
tmp2Wght = FLOAT( Ifprd ) |
232 |
aWght = tmp1Wght / tmp2Wght |
233 |
bWght = 1. _d 0 - aWght |
234 |
|
235 |
intime0=intime0+1 |
236 |
intime1=intime1+1 |
237 |
|
238 |
|
239 |
cQQ something funny about timing here - need nIter0+1 |
240 |
c but seems okay for remaining timesteps |
241 |
IF ( |
242 |
& Iftm-Ifprd*(intime0-1) .EQ. 0 |
243 |
& .OR. myIter .EQ. nIter0 |
244 |
& ) THEN |
245 |
|
246 |
|
247 |
_BEGIN_MASTER(myThid) |
248 |
|
249 |
C If the above condition is met then we need to read in |
250 |
C data for the period ahead and the period behind myTime. |
251 |
WRITE(msgBuf,'(A,1P1E20.12,X,I10)') |
252 |
& 'S/R DARWIN_FIELDS_LOAD: Reading forcing data', |
253 |
& myTime,myIter |
254 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
255 |
& SQUEEZE_RIGHT, myThid ) |
256 |
|
257 |
_END_MASTER(myThid) |
258 |
|
259 |
IF ( darwin_iceFile .NE. ' ' ) THEN |
260 |
CALL READ_REC_XY_RS( darwin_iceFile,fice0,intime0, |
261 |
& myIter,myThid ) |
262 |
CALL READ_REC_XY_RS( darwin_IceFile,fice1,intime1, |
263 |
& myIter,myThid ) |
264 |
ENDIF |
265 |
IF ( darwin_ironFile .NE. ' ' ) THEN |
266 |
CALL READ_REC_XY_RS( darwin_ironFile,featmos0,intime0, |
267 |
& myIter,myThid ) |
268 |
CALL READ_REC_XY_RS( darwin_ironFile,featmos1,intime1, |
269 |
& myIter,myThid ) |
270 |
ENDIF |
271 |
IF ( darwin_PARFile .NE. ' ' ) THEN |
272 |
CALL READ_REC_XY_RS( darwin_PARFile,sur_par0,intime0, |
273 |
& myIter,myThid ) |
274 |
CALL READ_REC_XY_RS( darwin_PARFile,sur_par1,intime1, |
275 |
& myIter,myThid ) |
276 |
ENDIF |
277 |
#ifdef ALLOW_CARBON |
278 |
IF ( DIC_windFile .NE. ' ' ) THEN |
279 |
CALL READ_REC_XY_RS( DIC_windFile,dicwind0,intime0, |
280 |
& myIter,myThid ) |
281 |
CALL READ_REC_XY_RS( DIC_windFile,dicwind1,intime1, |
282 |
& myIter,myThid ) |
283 |
ENDIF |
284 |
IF ( DIC_atmospFile .NE. ' ' ) THEN |
285 |
CALL READ_REC_XY_RS( DIC_atmospFile,atmosp0,intime0, |
286 |
& myIter,myThid ) |
287 |
CALL READ_REC_XY_RS( DIC_atmospFile,atmosp1,intime1, |
288 |
& myIter,myThid ) |
289 |
ENDIF |
290 |
#endif |
291 |
#ifdef NUT_SUPPLY |
292 |
IF ( darwin_nutWVelFile .NE. ' ' ) THEN |
293 |
CALL READ_REC_XYZ_RS( darwin_nutWVelFile,nut_wvel0,intime0, |
294 |
& myIter,myThid ) |
295 |
CALL READ_REC_XYZ_RS( darwin_nutWVelFile,nut_wvel1,intime1, |
296 |
& myIter,myThid ) |
297 |
ENDIF |
298 |
#endif |
299 |
#ifdef RELAX_NUTS |
300 |
IF ( darwin_PO4_RelaxFile .NE. ' ' ) THEN |
301 |
CALL READ_REC_XYZ_RS( darwin_PO4_RelaxFile,po4_obs0,intime0, |
302 |
& myIter,myThid ) |
303 |
CALL READ_REC_XYZ_RS( darwin_PO4_RelaxFile,po4_obs1,intime1, |
304 |
& myIter,myThid ) |
305 |
ENDIF |
306 |
IF ( darwin_NO3_RelaxFile .NE. ' ' ) THEN |
307 |
CALL READ_REC_XYZ_RS( darwin_NO3_RelaxFile,no3_obs0,intime0, |
308 |
& myIter,myThid ) |
309 |
CALL READ_REC_XYZ_RS( darwin_NO3_RelaxFile,no3_obs1,intime1, |
310 |
& myIter,myThid ) |
311 |
ENDIF |
312 |
IF ( darwin_Fet_RelaxFile .NE. ' ' ) THEN |
313 |
CALL READ_REC_XYZ_RS( darwin_Fet_RelaxFile,fet_obs0,intime0, |
314 |
& myIter,myThid ) |
315 |
CALL READ_REC_XYZ_RS( darwin_Fet_RelaxFile,fet_obs1,intime1, |
316 |
& myIter,myThid ) |
317 |
ENDIF |
318 |
IF ( darwin_Si_RelaxFile .NE. ' ' ) THEN |
319 |
CALL READ_REC_XYZ_RS( darwin_Si_RelaxFile,si_obs0,intime0, |
320 |
& myIter,myThid ) |
321 |
CALL READ_REC_XYZ_RS( darwin_Si_RelaxFile,si_obs1,intime1, |
322 |
& myIter,myThid ) |
323 |
ENDIF |
324 |
#endif |
325 |
#ifdef FLUX_NUTS |
326 |
IF ( darwin_PO4_FluxFile .NE. ' ' ) THEN |
327 |
CALL READ_REC_XYZ_RS( darwin_PO4_FluxFile,po4_flx0,intime0, |
328 |
& myIter,myThid ) |
329 |
CALL READ_REC_XYZ_RS( darwin_PO4_FluxFile,po4_flx1,intime1, |
330 |
& myIter,myThid ) |
331 |
ENDIF |
332 |
IF ( darwin_NO3_FluxFile .NE. ' ' ) THEN |
333 |
CALL READ_REC_XYZ_RS( darwin_NO3_FluxFile,no3_flx0,intime0, |
334 |
& myIter,myThid ) |
335 |
CALL READ_REC_XYZ_RS( darwin_NO3_FluxFile,no3_flx1,intime1, |
336 |
& myIter,myThid ) |
337 |
ENDIF |
338 |
IF ( darwin_Fet_FluxFile .NE. ' ' ) THEN |
339 |
CALL READ_REC_XYZ_RS( darwin_Fet_FluxFile,fet_flx0,intime0, |
340 |
& myIter,myThid ) |
341 |
CALL READ_REC_XYZ_RS( darwin_Fet_FluxFile,fet_flx1,intime1, |
342 |
& myIter,myThid ) |
343 |
ENDIF |
344 |
IF ( darwin_Si_FluxFile .NE. ' ' ) THEN |
345 |
CALL READ_REC_XYZ_RS( darwin_Si_FluxFile,si_flx0,intime0, |
346 |
& myIter,myThid ) |
347 |
CALL READ_REC_XYZ_RS( darwin_Si_FluxFile,si_flx1,intime1, |
348 |
& myIter,myThid ) |
349 |
ENDIF |
350 |
#endif |
351 |
#ifdef OASIM |
352 |
IF ( darwin_oasim_edFile .NE. ' ' ) THEN |
353 |
nj0= (intime0-1)*tlam |
354 |
nj1= (intime1-1)*tlam |
355 |
c print*,'ZZ nj0,nj1',nj0, nj1, intime0, intime1 |
356 |
do ilam=1,tlam |
357 |
nj0=nj0+1 |
358 |
CALL READ_REC_XY_RS( darwin_oasim_edFile, tmp1,nj0, |
359 |
& myIter,myThid ) |
360 |
nj1=nj1+1 |
361 |
CALL READ_REC_XY_RS( darwin_oasim_edFile, tmp2,nj1, |
362 |
& myIter,myThid ) |
363 |
DO bj = myByLo(myThid), myByHi(myThid) |
364 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
365 |
DO j=1-Oly,sNy+Oly |
366 |
DO i=1-Olx,sNx+Olx |
367 |
oasim_ed0(i,j,ilam,bi,bj) = tmp1(i,j,bi,bj) |
368 |
oasim_ed1(i,j,ilam,bi,bj) = tmp2(i,j,bi,bj) |
369 |
ENDDO |
370 |
ENDDO |
371 |
ENDDO |
372 |
ENDDO |
373 |
c print*,oasim_ed0(1,1,ilam,1,1), oasim_ed1(1,1,ilam,1,1) |
374 |
enddo |
375 |
c CALL READ_MFLDS_3D_RS( darwin_oasim_edFile, oasim_ed0, |
376 |
c & nj0, fp, tlam, myIter,myThid ) |
377 |
c CALL READ_MFLDS_3D_RS( darwin_oasim_edFile, oasim_ed1, |
378 |
c & nj1, fp, tlam, myIter,myThid ) |
379 |
ENDIF |
380 |
IF ( darwin_oasim_esFile .NE. ' ' ) THEN |
381 |
nj0= (intime0-1)*tlam |
382 |
nj1= (intime1-1)*tlam |
383 |
do ilam=1,tlam |
384 |
nj0=nj0+1 |
385 |
CALL READ_REC_XY_RS( darwin_oasim_esFile, tmp1,nj0, |
386 |
& myIter,myThid ) |
387 |
nj1=nj1+1 |
388 |
CALL READ_REC_XY_RS( darwin_oasim_esFile, tmp2,nj1, |
389 |
& myIter,myThid ) |
390 |
DO bj = myByLo(myThid), myByHi(myThid) |
391 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
392 |
DO j=1-Oly,sNy+Oly |
393 |
DO i=1-Olx,sNx+Olx |
394 |
oasim_es0(i,j,ilam,bi,bj) = tmp1(i,j,bi,bj) |
395 |
oasim_es1(i,j,ilam,bi,bj) = tmp2(i,j,bi,bj) |
396 |
ENDDO |
397 |
ENDDO |
398 |
ENDDO |
399 |
ENDDO |
400 |
enddo |
401 |
c CALL READ_MFLDS_3D_RS( darwin_oasim_esFile, oasim_es0, |
402 |
c & nj0, fp, tlam, myIter,myThid ) |
403 |
c CALL READ_MFLDS_3D_RS( darwin_oasim_esFile, oasim_es1, |
404 |
c & nj1, fp, tlam, myIter,myThid ) |
405 |
ENDIF |
406 |
#endif |
407 |
C |
408 |
_EXCH_XY_RS(fice0, myThid ) |
409 |
_EXCH_XY_RS(fice1, myThid ) |
410 |
_EXCH_XY_RS(featmos0, myThid ) |
411 |
_EXCH_XY_RS(featmos1, myThid ) |
412 |
_EXCH_XY_RS(sur_par0, myThid ) |
413 |
_EXCH_XY_RS(sur_par1, myThid ) |
414 |
#ifdef ALLOW_CARBON |
415 |
_EXCH_XY_RS(dicwind0, myThid ) |
416 |
_EXCH_XY_RS(dicwind1, myThid ) |
417 |
_EXCH_XY_RS(atmosp0, myThid ) |
418 |
_EXCH_XY_RS(atmosp1, myThid ) |
419 |
#endif |
420 |
#ifdef NUT_SUPPLY |
421 |
_EXCH_XYZ_RS(nut_wvel0, myThid ) |
422 |
_EXCH_XYZ_RS(nut_wvel1, myThid ) |
423 |
#endif |
424 |
#ifdef RELAX_NUTS |
425 |
_EXCH_XYZ_RS(po4_obs0, myThid ) |
426 |
_EXCH_XYZ_RS(po4_obs1, myThid ) |
427 |
_EXCH_XYZ_RS(no3_obs0, myThid ) |
428 |
_EXCH_XYZ_RS(no3_obs1, myThid ) |
429 |
_EXCH_XYZ_RS(fet_obs0, myThid ) |
430 |
_EXCH_XYZ_RS(fet_obs1, myThid ) |
431 |
_EXCH_XYZ_RS(si_obs0, myThid ) |
432 |
_EXCH_XYZ_RS(si_obs1, myThid ) |
433 |
#endif |
434 |
#ifdef FLUX_NUTS |
435 |
_EXCH_XYZ_RS(po4_flx0, myThid ) |
436 |
_EXCH_XYZ_RS(po4_flx1, myThid ) |
437 |
_EXCH_XYZ_RS(no3_flx0, myThid ) |
438 |
_EXCH_XYZ_RS(no3_flx1, myThid ) |
439 |
_EXCH_XYZ_RS(fet_flx0, myThid ) |
440 |
_EXCH_XYZ_RS(fet_flx1, myThid ) |
441 |
_EXCH_XYZ_RS(si_flx0, myThid ) |
442 |
_EXCH_XYZ_RS(si_flx1, myThid ) |
443 |
#endif |
444 |
#ifdef OASIM |
445 |
CALL EXCH_3D_RS (oasim_ed0, tlam, myThid) |
446 |
CALL EXCH_3D_RS (oasim_ed1, tlam, myThid) |
447 |
CALL EXCH_3D_RS (oasim_es0, tlam, myThid) |
448 |
CALL EXCH_3D_RS (oasim_es1, tlam, myThid) |
449 |
#endif |
450 |
|
451 |
|
452 |
C |
453 |
ENDIF |
454 |
|
455 |
DO bj = myByLo(myThid), myByHi(myThid) |
456 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
457 |
DO j=1-Oly,sNy+Oly |
458 |
DO i=1-Olx,sNx+Olx |
459 |
cQQ need to include ice model here, if used |
460 |
#ifdef ALLOW_THSICE |
461 |
FIce(i,j,bi,bj) = iceMask(i,j,bi,bj) |
462 |
#else |
463 |
#ifdef ALLOW_SEAICE |
464 |
FIce(i,j,bi,bj) = AREA(i,j,bi,bj) |
465 |
#else |
466 |
IF ( darwin_iceFile .NE. ' ' ) THEN |
467 |
fice(i,j,bi,bj) = bWght*fice0(i,j,bi,bj) |
468 |
& +aWght*fice1(i,j,bi,bj) |
469 |
ELSE |
470 |
fice(i,j,bi,bj) = 0. _d 0 |
471 |
ENDIF |
472 |
#endif |
473 |
#endif |
474 |
c or use offline fields if provided |
475 |
#ifdef ALLOW_OFFLINE |
476 |
IF (IceFile .NE. ' ') THEN |
477 |
fice(i,j,bi,bj) = ICEM(i,j,bi,bj) |
478 |
ENDIF |
479 |
#endif |
480 |
|
481 |
IF ( darwin_ironFile .NE. ' ' ) THEN |
482 |
inputFe(i,j,bi,bj) = bWght*featmos0(i,j,bi,bj) |
483 |
& +aWght*featmos1(i,j,bi,bj) |
484 |
c convert to mmol/m2/s |
485 |
inputFe(i,j,bi,bj) = inputFe(i,j,bi,bj)*darwin_ironFileConv |
486 |
ELSE |
487 |
inputFe(i,j,bi,bj) = 0. _d 0 |
488 |
ENDIF |
489 |
c light |
490 |
IF ( darwin_PARFile .NE. ' ' ) THEN |
491 |
sur_par(i,j,bi,bj) = bWght*sur_par0(i,j,bi,bj) |
492 |
& +aWght*sur_par1(i,j,bi,bj) |
493 |
c convert to uEin/m2/s |
494 |
sur_par(i,j,bi,bj) = sur_par(i,j,bi,bj)*darwin_PARFileConv |
495 |
ELSE |
496 |
sur_par(i,j,bi,bj) = 200. _d 0*maskC(i,j,1,bi,bj) |
497 |
ENDIF |
498 |
#ifdef ALLOW_CARBON |
499 |
IF ( DIC_windFile .NE. ' ' ) THEN |
500 |
WIND(i,j,bi,bj) = bWght*dicwind0(i,j,bi,bj) |
501 |
& + aWght*dicwind1(i,j,bi,bj) |
502 |
ELSE |
503 |
WIND(i,j,bi,bj) = 5. _d 0 |
504 |
ENDIF |
505 |
#ifndef USE_PLOAD |
506 |
IF ( DIC_atmospFile .NE. ' ' ) THEN |
507 |
AtmosP(i,j,bi,bj) = bWght*atmosp0(i,j,bi,bj) |
508 |
& + aWght*atmosp1(i,j,bi,bj) |
509 |
ELSE |
510 |
AtmosP(i,j,bi,bj) = 1. _d 0 |
511 |
ENDIF |
512 |
#endif |
513 |
#endif |
514 |
#ifdef NUT_SUPPLY |
515 |
c artificial wvel for nutrient supply in 1-d and 2-d models |
516 |
IF ( darwin_nutWVelFile .NE. ' ' ) THEN |
517 |
DO k=1,nR |
518 |
nut_wvel(i,j,k,bi,bj) = bWght*nut_wvel0(i,j,k,bi,bj) |
519 |
& +aWght*nut_wvel1(i,j,k,bi,bj) |
520 |
ENDDO |
521 |
ENDIF |
522 |
#endif |
523 |
#ifdef RELAX_NUTS |
524 |
IF ( darwin_PO4_RelaxFile .NE. ' ' ) THEN |
525 |
DO k=1,nR |
526 |
po4_obs(i,j,k,bi,bj) = bWght*po4_obs0(i,j,k,bi,bj) |
527 |
& +aWght*po4_obs1(i,j,k,bi,bj) |
528 |
ENDDO |
529 |
ENDIF |
530 |
IF ( darwin_NO3_RelaxFile .NE. ' ' ) THEN |
531 |
DO k=1,nR |
532 |
no3_obs(i,j,k,bi,bj) = bWght*no3_obs0(i,j,k,bi,bj) |
533 |
& +aWght*no3_obs1(i,j,k,bi,bj) |
534 |
ENDDO |
535 |
ENDIF |
536 |
IF ( darwin_Fet_RelaxFile .NE. ' ' ) THEN |
537 |
DO k=1,nR |
538 |
fet_obs(i,j,k,bi,bj) = bWght*fet_obs0(i,j,k,bi,bj) |
539 |
& +aWght*fet_obs1(i,j,k,bi,bj) |
540 |
ENDDO |
541 |
ENDIF |
542 |
IF ( darwin_Si_RelaxFile .NE. ' ' ) THEN |
543 |
DO k=1,nR |
544 |
si_obs(i,j,k,bi,bj) = bWght*si_obs0(i,j,k,bi,bj) |
545 |
& +aWght*si_obs1(i,j,k,bi,bj) |
546 |
ENDDO |
547 |
ENDIF |
548 |
#endif |
549 |
#ifdef FLUX_NUTS |
550 |
IF ( darwin_PO4_FluxFile .NE. ' ' ) THEN |
551 |
DO k=1,nR |
552 |
po4_flx(i,j,k,bi,bj) = bWght*po4_flx0(i,j,k,bi,bj) |
553 |
& +aWght*po4_flx1(i,j,k,bi,bj) |
554 |
ENDDO |
555 |
ENDIF |
556 |
IF ( darwin_NO3_FluxFile .NE. ' ' ) THEN |
557 |
DO k=1,nR |
558 |
no3_flx(i,j,k,bi,bj) = bWght*no3_flx0(i,j,k,bi,bj) |
559 |
& +aWght*no3_flx1(i,j,k,bi,bj) |
560 |
ENDDO |
561 |
ENDIF |
562 |
IF ( darwin_Fet_FluxFile .NE. ' ' ) THEN |
563 |
DO k=1,nR |
564 |
fet_flx(i,j,k,bi,bj) = bWght*fet_flx0(i,j,k,bi,bj) |
565 |
& +aWght*fet_flx1(i,j,k,bi,bj) |
566 |
ENDDO |
567 |
ENDIF |
568 |
IF ( darwin_Si_FluxFile .NE. ' ' ) THEN |
569 |
DO k=1,nR |
570 |
si_flx(i,j,k,bi,bj) = bWght*si_flx0(i,j,k,bi,bj) |
571 |
& +aWght*si_flx1(i,j,k,bi,bj) |
572 |
ENDDO |
573 |
ENDIF |
574 |
#endif |
575 |
#ifdef OASIM |
576 |
IF ( darwin_oasim_edFile .NE. ' ' ) THEN |
577 |
c oasim data (load as W/m2 per band) |
578 |
DO ilam=1,tlam |
579 |
oasim_ed(i,j,ilam,bi,bj) = |
580 |
& bWght*oasim_ed0(i,j,ilam,bi,bj) |
581 |
& +aWght*oasim_ed1(i,j,ilam,bi,bj) |
582 |
c oasim_ed(i,j,ilam,bi,bj) = |
583 |
c & oasim_ed(i,j,ilam,bi,bj)*1. _d 6/86400. _d 0 |
584 |
ENDDO |
585 |
ENDIF |
586 |
IF ( darwin_oasim_esFile .NE. ' ' ) THEN |
587 |
DO ilam=1,tlam |
588 |
oasim_es(i,j,ilam,bi,bj) = |
589 |
& bWght*oasim_es0(i,j,ilam,bi,bj) |
590 |
& +aWght*oasim_es1(i,j,ilam,bi,bj) |
591 |
c oasim_es(i,j,ilam,bi,bj) = |
592 |
c & oasim_es(i,j,ilam,bi,bj)*1. _d 6/86400. _d 0 |
593 |
ENDDO |
594 |
ENDIF |
595 |
#ifndef WAVEBANDS |
596 |
c if not spectral add wavebands to give a single surface PAR |
597 |
c and convert to uEin/m2/s |
598 |
sur_par(i,j,bi,bj)= 0. _d 0 |
599 |
DO ilam=1,tlam |
600 |
sur_par(i,j,bi,bj)=sur_par(i,j,bi,bj)+WtouEins(ilam) |
601 |
& *(oasim_ed(i,j,ilam,bi,bj)+ |
602 |
& oasim_es(i,j,ilam,bi,bj)) |
603 |
ENDDO |
604 |
#endif |
605 |
#endif |
606 |
c |
607 |
ENDDO |
608 |
ENDDO |
609 |
ENDDO |
610 |
ENDDO |
611 |
|
612 |
C endif for periodicForcing |
613 |
ENDIF |
614 |
|
615 |
RETURN |
616 |
END |
617 |
#endif |
618 |
#endif |
619 |
|