1 |
C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_biotic_forcing.F,v 1.14 2007/05/01 21:45:33 stephd Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "DIC_OPTIONS.h" |
5 |
#include "GCHEM_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: DIC_BIOTIC_FORCING |
9 |
|
10 |
C !INTERFACE: ========================================================== |
11 |
SUBROUTINE DIC_BIOTIC_FORCING( PTR_DIC, PTR_ALK, PTR_PO4, |
12 |
& PTR_DOP, |
13 |
#ifdef ALLOW_O2 |
14 |
& PTR_O2, |
15 |
#endif |
16 |
#ifdef ALLOW_FE |
17 |
& PTR_FE, |
18 |
#endif |
19 |
& bi,bj,imin,imax,jmin,jmax, |
20 |
& myIter,myTime,myThid) |
21 |
|
22 |
C !DESCRIPTION: |
23 |
C updates all the tracers for the effects of air-sea exchange, biological |
24 |
c activity and remineralization |
25 |
|
26 |
C !USES: =============================================================== |
27 |
IMPLICIT NONE |
28 |
#include "SIZE.h" |
29 |
#include "DYNVARS.h" |
30 |
#include "EEPARAMS.h" |
31 |
#include "PARAMS.h" |
32 |
#include "GRID.h" |
33 |
#include "DIC_BIOTIC.h" |
34 |
#include "DIC_ABIOTIC.h" |
35 |
|
36 |
C !INPUT PARAMETERS: =================================================== |
37 |
C myThid :: thread number |
38 |
C myIter :: current timestep |
39 |
C myTime :: current time |
40 |
C PTR_DIC :: dissolced inorganic carbon |
41 |
C PTR_ALK :: alkalinity |
42 |
C PTR_PO4 :: phosphate |
43 |
c PTR_DOP :: dissolve organic phosphurous |
44 |
c PTR_O2 :: oxygen |
45 |
C PTR_FE :: iron |
46 |
INTEGER myIter |
47 |
_RL myTime |
48 |
INTEGER myThid |
49 |
_RL PTR_DIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
50 |
_RL PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
51 |
_RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
52 |
_RL PTR_DOP(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
53 |
#ifdef ALLOW_O2 |
54 |
_RL PTR_O2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
55 |
#endif |
56 |
#ifdef ALLOW_FE |
57 |
_RL PTR_FE(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
58 |
#endif |
59 |
INTEGER bi, bj, imin, imax, jmin, jmax |
60 |
|
61 |
#ifdef ALLOW_PTRACERS |
62 |
#ifdef DIC_BIOTIC |
63 |
|
64 |
C !LOCAL VARIABLES: ==================================================== |
65 |
C i,j,k :: loop indices |
66 |
C G* :: tendency term for the tracers |
67 |
C SURA :: tendency of alkalinity due to freshwater |
68 |
C SURC :: tendency of DIC due to air-sea exchange |
69 |
C and virtual flux |
70 |
C SURO :: tendency of O2 due to air-sea exchange |
71 |
C BIO :: tendency of PO4 due to biological productivity, |
72 |
C exchange with DOP pool and reminerization |
73 |
C CAR :: carbonate changes due to biological |
74 |
C productivity and reminerization |
75 |
C BIOac :: biological productivity |
76 |
C pflux :: changes to PO4 due to flux and reminerlization |
77 |
c cflux :: carbonate changes due to flux and reminerlization |
78 |
c freefe :: iron not bound to ligand |
79 |
_RL GDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
80 |
_RL GALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
81 |
_RL GPO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
82 |
_RL GDOP(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
83 |
_RL SURA(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
84 |
_RL SURC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
85 |
_RL SURO(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
86 |
_RL BIO(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
87 |
_RL BIO_kar(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
88 |
_RL CAR(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
89 |
_RL BIOac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
90 |
_RL pflux(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
91 |
_RL exportflux(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
92 |
_RL cflux(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
93 |
#ifdef ALLOW_O2 |
94 |
_RL GO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
95 |
#endif |
96 |
#ifdef ALLOW_FE |
97 |
_RL GFE(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
98 |
_RL freefe(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
99 |
#endif |
100 |
INTEGER I,J,k |
101 |
INTEGER nCALCITEstep |
102 |
CEOP |
103 |
jmin=1 |
104 |
jmax=sNy |
105 |
imin=1 |
106 |
imax=sNx |
107 |
|
108 |
DO k=1,Nr |
109 |
DO j=1-OLy,sNy+OLy |
110 |
DO i=1-OLx,sNx+OLx |
111 |
GDIC(i,j,k) =0. _d 0 |
112 |
GALK(i,j,k) =0. _d 0 |
113 |
GPO4(i,j,k) =0. _d 0 |
114 |
GDOP(i,j,k) =0. _d 0 |
115 |
SURA(i,j) =0. _d 0 |
116 |
SURC(i,j) =0. _d 0 |
117 |
CAR(i,j,k) =0. _d 0 |
118 |
BIO(i,j,k) =0. _d 0 |
119 |
BIO_kar(i,j,k) =0. _d 0 |
120 |
BIOac(i,j,k) =0. _d 0 |
121 |
pflux(i,j,k) =0. _d 0 |
122 |
exportflux(i,j,k)=0. _d 0 |
123 |
cflux(i,j,k) =0. _d 0 |
124 |
#ifdef ALLOW_O2 |
125 |
GO2(i,j,k) =0. _d 0 |
126 |
#endif |
127 |
#ifdef ALLOW_FE |
128 |
GFE(i,j,k) =0. _d 0 |
129 |
freefe(i,j,k) =0. _d 0 |
130 |
#endif |
131 |
ENDDO |
132 |
ENDDO |
133 |
ENDDO |
134 |
|
135 |
c carbon air-sea interaction |
136 |
CALL DIC_SURFFORCING( PTR_DIC, PTR_ALK, PTR_PO4, SURC, |
137 |
& bi,bj,imin,imax,jmin,jmax, |
138 |
& myIter,myTime,myThid) |
139 |
|
140 |
c alkalinity air-sea interaction |
141 |
CALL ALK_SURFFORCING( PTR_ALK, SURA, |
142 |
& bi,bj,imin,imax,jmin,jmax, |
143 |
& myIter,myTime,myThid) |
144 |
|
145 |
#ifdef ALLOW_O2 |
146 |
c oxygen air-sea interaction |
147 |
CALL O2_SURFFORCING( PTR_O2, SURO, |
148 |
& bi,bj,imin,imax,jmin,jmax, |
149 |
& myIter,myTime,myThid) |
150 |
#endif |
151 |
|
152 |
#ifdef ALLOW_FE |
153 |
c find free iron |
154 |
call fe_chem(bi,bj,iMin,iMax,jMin,jMax, PTR_FE, freefe, |
155 |
& myIter, mythid) |
156 |
#endif |
157 |
|
158 |
|
159 |
c biological activity |
160 |
CALL BIO_EXPORT( PTR_PO4 , |
161 |
#ifdef ALLOW_FE |
162 |
I PTR_FE, |
163 |
#endif |
164 |
I BIOac, |
165 |
I bi,bj,imin,imax,jmin,jmax, |
166 |
I myIter,myTime,myThid) |
167 |
|
168 |
c flux of po4 from layers with biological activity |
169 |
CALL PHOS_FLUX( BIOac, pflux, exportflux, |
170 |
& bi,bj,imin,imax,jmin,jmax, |
171 |
& myIter,myTime,myThid) |
172 |
|
173 |
c carbonate |
174 |
#ifdef CAR_DISS |
175 |
c dissolution only below saturation horizon |
176 |
c code following methid by Karsten Friis |
177 |
nCALCITEstep = 3600 |
178 |
IF(myIter .lt. (nIter0+5) .or. |
179 |
& mod(myIter,nCALCITEstep) .eq. 0)THEN |
180 |
CALL CALCITE_SATURATION(PTR_DIC, PTR_ALK, PTR_PO4, |
181 |
I bi,bj,imin,imax,jmin,jmax, |
182 |
I myIter,myTime,myThid) |
183 |
ENDIF |
184 |
c |
185 |
CALL CAR_FLUX_OMEGA_TOP( BIOac, cflux, |
186 |
& bi,bj,imin,imax,jmin,jmax, |
187 |
& myIter,myTime,myThid) |
188 |
#else |
189 |
c old OCMIP way |
190 |
CALL CAR_FLUX( BIOac, cflux, |
191 |
& bi,bj,imin,imax,jmin,jmax, |
192 |
& myIter,myTime,myThid) |
193 |
#endif |
194 |
|
195 |
c add all tendencies for PO4, DOP, ALK, DIC |
196 |
DO k=1,Nr |
197 |
DO j=jmin,jmax |
198 |
DO i=imin,imax |
199 |
bio(i,j,k)=-BIOac(i,j,k)+pflux(i,j,k) |
200 |
& + maskC(i,j,k,bi,bj)*Kdopremin*PTR_DOP(i,j,k) |
201 |
car(i,j,k)=-BIOac(i,j,k)* R_cp*rain_ratio(i,j,bi,bj)* |
202 |
& (1.0-DOPfraction)+cflux(i,j,k) |
203 |
GPO4(i,j,k)=bio(i,j,k) |
204 |
GDOP(i,j,k)=+BIOac(i,j,k)*DOPfraction |
205 |
& - maskC(i,j,k,bi,bj)*Kdopremin*PTR_DOP(i,j,k) |
206 |
GALK(i,j,k)=+2.d0*car(i,j,k)-R_NP*bio(i,j,k) |
207 |
BIO_kar(i,j,k)=R_NP*bio(i,j,k) |
208 |
GDIC(i,j,k)=car(i,j,k)+R_CP*bio(i,j,k) |
209 |
#ifdef ALLOW_O2 |
210 |
if (PTR_O2(i,j,k).gt.o2crit) then |
211 |
GO2(i,j,k)=R_OP*bio(i,j,k) |
212 |
else |
213 |
GO2(i,j,k)=0.d0 |
214 |
endif |
215 |
#endif |
216 |
#ifdef ALLOW_FE |
217 |
GFE(i,j,k)=R_FeP*bio(i,j,k) |
218 |
& -Kscav*freefe(i,j,k) |
219 |
#endif |
220 |
IF (K.eq.1) then |
221 |
GALK(i,j,1)=GALK(i,j,1)+SURA(i,j) |
222 |
GDIC(i,j,1)=GDIC(i,j,1)+SURC(i,j) |
223 |
#ifdef ALLOW_O2 |
224 |
GO2(i,j,1)=GO2(i,j,1)+SURO(i,j) |
225 |
#endif |
226 |
#ifdef ALLOW_FE |
227 |
GFE(i,j,1)=GFE(i,j,1)+alpfe* |
228 |
& InputFe(i,j,bi,bj)*recip_drF(1) |
229 |
& *recip_hFacC(i,j,1,bi,bj) |
230 |
#endif |
231 |
ENDIF |
232 |
ENDDO |
233 |
ENDDO |
234 |
ENDDO |
235 |
|
236 |
|
237 |
C update |
238 |
DO k=1,Nr |
239 |
DO j=jmin,jmax |
240 |
DO i=imin,imax |
241 |
PTR_DIC(i,j,k)= |
242 |
& PTR_DIC(i,j,k)+GDIC(i,j,k)*dTtracerLev(k) |
243 |
PTR_ALK(i,j,k)= |
244 |
& PTR_ALK(i,j,k)+GALK(i,j,k)*dTtracerLev(k) |
245 |
PTR_PO4(i,j,k)= |
246 |
& PTR_PO4(i,j,k)+GPO4(i,j,k)*dTtracerLev(k) |
247 |
PTR_DOP(i,j,k)= |
248 |
& PTR_DOP(i,j,k)+GDOP(i,j,k)*dTtracerLev(k) |
249 |
#ifdef ALLOW_O2 |
250 |
PTR_O2(i,j,k)= |
251 |
& PTR_O2(i,j,k)+GO2(i,j,k)*dTtracerLev(k) |
252 |
#endif |
253 |
#ifdef ALLOW_FE |
254 |
PTR_FE(i,j,k)= |
255 |
& PTR_FE(i,j,k)+GFE(i,j,k)*dTtracerLev(k) |
256 |
#endif |
257 |
ENDDO |
258 |
ENDDO |
259 |
ENDDO |
260 |
|
261 |
#ifdef ALLOW_FE |
262 |
#ifdef MINFE |
263 |
c find free iron and get rid of insoluble part |
264 |
call fe_chem(bi,bj,iMin,iMax,jMin,jMax, PTR_FE, freefe, |
265 |
& myIter, mythid) |
266 |
#endif |
267 |
#endif |
268 |
|
269 |
|
270 |
#ifdef ALLOW_TIMEAVE |
271 |
c save averages |
272 |
IF ( taveFreq.GT.0. ) THEN |
273 |
DO k=1,Nr |
274 |
DO j=jmin,jmax |
275 |
DO i=imin,imax |
276 |
BIOave(i,j,k,bi,bj) =BIOave(i,j,k,bi,bj)+ |
277 |
& BIOac(i,j,k)*deltaTclock |
278 |
CARave(i,j,k,bi,bj) =CARave(i,j,k,bi,bj)+ |
279 |
& CAR(i,j,k)*deltaTclock |
280 |
OmegaCave(i,j,k,bi,bj)=OmegaCave(i,j,k,bi,bj)+ |
281 |
& OmegaC(i,j,k,bi,bj)*deltaTclock |
282 |
pfluxave(i,j,k,bi,bj) =pfluxave(i,j,k,bi,bj) + |
283 |
& pflux(i,j,k)*deltaTclock |
284 |
epfluxave(i,j,k,bi,bj)=epfluxave(i,j,k,bi,bj) + |
285 |
& exportflux(i,j,k)*deltaTclock |
286 |
cfluxave(i,j,k,bi,bj) =cfluxave(i,j,k,bi,bj) + |
287 |
& cflux(i,j,k)*deltaTclock |
288 |
ENDDO |
289 |
ENDDO |
290 |
ENDDO |
291 |
DO j=jmin,jmax |
292 |
DO i=imin,imax |
293 |
SURave(i,j,bi,bj) =SURave(i,j,bi,bj)+ |
294 |
& SURC(i,j)*deltaTclock |
295 |
#ifdef ALLOW_O2 |
296 |
SUROave(i,j,bi,bj) =SUROave(i,j,bi,bj)+ |
297 |
& SURO(i,j)*deltaTclock |
298 |
#endif |
299 |
pCO2ave(i,j,bi,bj) =pCO2ave(i,j,bi,bj)+ |
300 |
& pCO2(i,j,bi,bj)*deltaTclock |
301 |
pHave(i,j,bi,bj) =pHave(i,j,bi,bj)+ |
302 |
& pH(i,j,bi,bj)*deltaTclock |
303 |
fluxCO2ave(i,j,bi,bj)=fluxCO2ave(i,j,bi,bj)+ |
304 |
& fluxCO2(i,j,bi,bj)*deltaTclock |
305 |
ENDDO |
306 |
ENDDO |
307 |
do k=1,Nr |
308 |
dic_timeave(bi,bj,k)=dic_timeave(bi,bj,k)+deltaTclock |
309 |
enddo |
310 |
ENDIF |
311 |
#endif /* ALLOW_TIMEAVE*/ |
312 |
|
313 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
314 |
|
315 |
#ifdef ALLOW_DIAGNOSTICS |
316 |
|
317 |
IF ( useDiagnostics ) THEN |
318 |
|
319 |
CALL DIAGNOSTICS_FILL(BIOac ,'DICBIOA ',0,Nr,2,bi,bj,myThid) |
320 |
CALL DIAGNOSTICS_FILL(CAR ,'DICCARB ',0,Nr,2,bi,bj,myThid) |
321 |
CALL DIAGNOSTICS_FILL(pCO2 ,'DICPCO2 ',0,1 ,1,bi,bj,myThid) |
322 |
CALL DIAGNOSTICS_FILL(fluxCO2,'DICCFLX ',0,1 ,1,bi,bj,myThid) |
323 |
CALL DIAGNOSTICS_FILL(pH ,'DICPHAV ',0,1 ,1,bi,bj,myThid) |
324 |
CALL DIAGNOSTICS_FILL(SURC ,'DICTFLX ',0,1 ,2,bi,bj,myThid) |
325 |
#ifdef ALLOW_O2 |
326 |
CALL DIAGNOSTICS_FILL(SURO ,'DICOFLX ',0,1 ,2,bi,bj,myThid) |
327 |
#endif |
328 |
|
329 |
ENDIF |
330 |
|
331 |
#endif /* ALLOW_DIAGNOSTICS */ |
332 |
|
333 |
#endif /* DIC_BIOTIC */ |
334 |
#endif /* ALLOW_PTRACERS */ |
335 |
|
336 |
c |
337 |
RETURN |
338 |
END |