1 |
edhill |
1.4 |
#include "DIC_OPTIONS.h" |
2 |
stephd |
1.1 |
#include "GCHEM_OPTIONS.h" |
3 |
|
|
|
4 |
stephd |
1.6 |
CBOP |
5 |
|
|
C !ROUTINE: DIC_BIOTIC_FORCING |
6 |
|
|
|
7 |
|
|
C !INTERFACE: ========================================================== |
8 |
stephd |
1.1 |
SUBROUTINE DIC_BIOTIC_FORCING( PTR_DIC, PTR_ALK, PTR_PO4, |
9 |
|
|
& PTR_DOP, PTR_O2, |
10 |
|
|
#ifdef ALLOW_FE |
11 |
|
|
& PTR_FE, |
12 |
|
|
#endif |
13 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
14 |
|
|
& myIter,myTime,myThid) |
15 |
|
|
|
16 |
stephd |
1.6 |
C !DESCRIPTION: |
17 |
|
|
C updates all the tracers for the effects of air-sea exchange, biological |
18 |
|
|
c activity and remineralization |
19 |
|
|
|
20 |
|
|
C !USES: =============================================================== |
21 |
stephd |
1.1 |
IMPLICIT NONE |
22 |
|
|
#include "SIZE.h" |
23 |
|
|
#include "DYNVARS.h" |
24 |
|
|
#include "EEPARAMS.h" |
25 |
|
|
#include "PARAMS.h" |
26 |
|
|
#include "GRID.h" |
27 |
|
|
#include "DIC_BIOTIC.h" |
28 |
|
|
#include "DIC_ABIOTIC.h" |
29 |
|
|
|
30 |
stephd |
1.6 |
C !INPUT PARAMETERS: =================================================== |
31 |
|
|
C myThid :: thread number |
32 |
|
|
C myIter :: current timestep |
33 |
|
|
C myTime :: current time |
34 |
|
|
C PTR_DIC :: dissolced inorganic carbon |
35 |
|
|
C PTR_ALK :: alkalinity |
36 |
|
|
C PTR_PO4 :: phosphate |
37 |
|
|
c PTR_DOP :: dissolve organic phosphurous |
38 |
|
|
c PTR_O2 :: oxygen |
39 |
|
|
C PTR_FE :: iron |
40 |
stephd |
1.1 |
INTEGER myIter |
41 |
|
|
_RL myTime |
42 |
|
|
INTEGER myThid |
43 |
|
|
_RL PTR_DIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
44 |
|
|
_RL PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
45 |
|
|
_RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
46 |
|
|
_RL PTR_DOP(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
47 |
|
|
_RL PTR_O2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
48 |
|
|
#ifdef ALLOW_FE |
49 |
|
|
_RL PTR_FE(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
50 |
|
|
#endif |
51 |
|
|
INTEGER bi, bj, imin, imax, jmin, jmax |
52 |
|
|
|
53 |
|
|
#ifdef ALLOW_PTRACERS |
54 |
|
|
#ifdef DIC_BIOTIC |
55 |
stephd |
1.6 |
|
56 |
|
|
C !LOCAL VARIABLES: ==================================================== |
57 |
|
|
C i,j,k :: loop indices |
58 |
|
|
C G* :: tendency term for the tracers |
59 |
|
|
C SURA :: tendency of alkalinity due to freshwater |
60 |
|
|
C SURC :: tendency of DIC due to air-sea exchange |
61 |
|
|
C and virtual flux |
62 |
|
|
C SURO :: tendency of O2 due to air-sea exchange |
63 |
|
|
C BIO :: tendency of PO4 due to biological productivity, |
64 |
|
|
C exchange with DOP pool and reminerization |
65 |
|
|
C CAR :: carbonate changes due to biological |
66 |
|
|
C productivity and reminerization |
67 |
|
|
C bioac :: biological productivity |
68 |
|
|
C pflux :: changes to PO4 due to flux and reminerlization |
69 |
|
|
c cflux :: carbonate changes due to flux and reminerlization |
70 |
|
|
c freefe :: iron not bound to ligand |
71 |
stephd |
1.1 |
_RL GDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
72 |
|
|
_RL GALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
73 |
|
|
_RL GPO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
74 |
|
|
_RL GDOP(1-OLx:sNx+OLx,1-OLy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|
|
#ifdef ALLOW_FE |
107 |
|
|
GFE(i,j,k)=0.d0 |
108 |
|
|
freefe(i,j,k)=0.d0 |
109 |
|
|
#endif |
110 |
|
|
ENDDO |
111 |
|
|
ENDDO |
112 |
|
|
ENDDO |
113 |
|
|
|
114 |
|
|
c carbon air-sea interaction |
115 |
|
|
CALL DIC_SURFFORCING( PTR_DIC, SURC, |
116 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
117 |
|
|
& myIter,myTime,myThid) |
118 |
|
|
|
119 |
|
|
c alkalinity air-sea interaction |
120 |
|
|
CALL ALK_SURFFORCING( PTR_ALK, SURA, |
121 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
122 |
|
|
& myIter,myTime,myThid) |
123 |
|
|
|
124 |
|
|
c carbon air-sea interaction |
125 |
|
|
CALL O2_SURFFORCING( PTR_O2, SURO, |
126 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
127 |
|
|
& myIter,myTime,myThid) |
128 |
|
|
|
129 |
|
|
#ifdef ALLOW_FE |
130 |
|
|
c find free iron |
131 |
|
|
call fe_chem(bi,bj,iMin,iMax,jMin,jMax, PTR_FE, freefe, |
132 |
|
|
& myIter, mythid) |
133 |
|
|
#endif |
134 |
|
|
|
135 |
|
|
|
136 |
|
|
c biological activity |
137 |
|
|
CALL BIO_EXPORT( PTR_PO4 , |
138 |
|
|
#ifdef ALLOW_FE |
139 |
|
|
I PTR_FE, |
140 |
|
|
#endif |
141 |
|
|
I bioac, |
142 |
|
|
I bi,bj,imin,imax,jmin,jmax, |
143 |
|
|
I myIter,myTime,myThid) |
144 |
|
|
|
145 |
|
|
c flux of po4 from layers with biological activity |
146 |
|
|
CALL PHOS_FLUX( bioac, pflux, |
147 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
148 |
|
|
& myIter,myTime,myThid) |
149 |
|
|
|
150 |
|
|
c carbonate |
151 |
|
|
CALL CAR_FLUX( bioac, cflux, |
152 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
153 |
|
|
& myIter,myTime,myThid) |
154 |
|
|
|
155 |
|
|
c add all tendencies for PO4, DOP, ALK, DIC |
156 |
|
|
DO k=1,Nr |
157 |
|
|
DO j=1-OLy,sNy+OLy |
158 |
|
|
DO i=1-OLx,sNx+OLx |
159 |
|
|
bio(i,j,k)=-bioac(i,j,k)+pflux(i,j,k) |
160 |
|
|
& + maskC(i,j,k,bi,bj)*Kdopremin*PTR_DOP(i,j,k) |
161 |
|
|
car(i,j,k)=-bioac(i,j,k)* R_cp*rain_ratio(i,j,bi,bj)* |
162 |
|
|
& (1.0-DOPfraction)+cflux(i,j,k) |
163 |
|
|
GPO4(i,j,k)=bio(i,j,k) |
164 |
|
|
GDOP(i,j,k)=+bioac(i,j,k)*DOPfraction |
165 |
|
|
& - maskC(i,j,k,bi,bj)*Kdopremin*PTR_DOP(i,j,k) |
166 |
|
|
GALK(i,j,k)=+2.d0*car(i,j,k)-R_NP*bio(i,j,k) |
167 |
|
|
GDIC(i,j,k)=car(i,j,k)+R_CP*bio(i,j,k) |
168 |
|
|
if (PTR_O2(i,j,k).gt.o2crit) then |
169 |
|
|
GO2(i,j,k)=R_OP*bio(i,j,k) |
170 |
|
|
else |
171 |
|
|
GO2(i,j,k)=0.d0 |
172 |
|
|
endif |
173 |
|
|
#ifdef ALLOW_FE |
174 |
|
|
GFE(i,j,k)=R_FeP*bio(i,j,k) |
175 |
|
|
& -Kscav*freefe(i,j,k) |
176 |
|
|
#endif |
177 |
|
|
IF (K.eq.1) then |
178 |
|
|
GALK(i,j,1)=GALK(i,j,1)+SURA(i,j) |
179 |
|
|
GDIC(i,j,1)=GDIC(i,j,1)+SURC(i,j) |
180 |
|
|
GO2(i,j,1)=GO2(i,j,1)+SURO(i,j) |
181 |
|
|
#ifdef ALLOW_FE |
182 |
|
|
GFE(i,j,1)=GFE(i,j,1)+alpfe* |
183 |
jmc |
1.5 |
& InputFe(i,j,bi,bj)/drF(1) |
184 |
stephd |
1.1 |
#endif |
185 |
|
|
ENDIF |
186 |
|
|
ENDDO |
187 |
|
|
ENDDO |
188 |
|
|
ENDDO |
189 |
|
|
|
190 |
|
|
|
191 |
|
|
C update |
192 |
|
|
DO k=1,Nr |
193 |
|
|
DO j=1-OLy,sNy+OLy |
194 |
|
|
DO i=1-OLx,sNx+OLx |
195 |
|
|
PTR_DIC(i,j,k)= |
196 |
|
|
& PTR_DIC(i,j,k)+GDIC(i,j,k)*deltaTtracer |
197 |
|
|
PTR_ALK(i,j,k)= |
198 |
|
|
& PTR_ALK(i,j,k)+GALK(i,j,k)*deltaTtracer |
199 |
|
|
PTR_PO4(i,j,k)= |
200 |
|
|
& PTR_PO4(i,j,k)+GPO4(i,j,k)*deltaTtracer |
201 |
|
|
PTR_DOP(i,j,k)= |
202 |
|
|
& PTR_DOP(i,j,k)+GDOP(i,j,k)*deltaTtracer |
203 |
|
|
PTR_O2(i,j,k)= |
204 |
|
|
& PTR_O2(i,j,k)+GO2(i,j,k)*deltaTtracer |
205 |
|
|
#ifdef ALLOW_FE |
206 |
|
|
PTR_FE(i,j,k)= |
207 |
|
|
& PTR_FE(i,j,k)+GFE(i,j,k)*deltaTtracer |
208 |
|
|
#endif |
209 |
|
|
ENDDO |
210 |
|
|
ENDDO |
211 |
|
|
ENDDO |
212 |
|
|
|
213 |
|
|
#ifdef ALLOW_TIMEAVE |
214 |
|
|
c save averages |
215 |
|
|
DO k=1,Nr |
216 |
|
|
DO j=1-OLy,sNy+OLy |
217 |
|
|
DO i=1-OLx,sNx+OLx |
218 |
|
|
BIOave(i,j,k,bi,bj)=BIOave(i,j,k,bi,bj)+ |
219 |
|
|
& BIOac(i,j,k)*deltaTclock |
220 |
|
|
CARave(i,j,k,bi,bj)=CARave(i,j,k,bi,bj)+ |
221 |
|
|
& CAR(i,j,k)*deltaTclock |
222 |
|
|
if (k.eq.1) then |
223 |
|
|
SURave(i,j,bi,bj)=SURave(i,j,bi,bj)+ |
224 |
|
|
& SURC(i,j)*deltaTclock |
225 |
|
|
SUROave(i,j,bi,bj)=SUROave(i,j,bi,bj)+ |
226 |
|
|
& SURO(i,j)*deltaTclock |
227 |
|
|
pCO2ave(i,j,bi,bj)=pCO2ave(i,j,bi,bj)+ |
228 |
|
|
& pCO2(i,j,bi,bj)*deltaTclock |
229 |
|
|
pHave(i,j,bi,bj)=pHave(i,j,bi,bj)+ |
230 |
|
|
& pH(i,j,bi,bj)*deltaTclock |
231 |
stephd |
1.2 |
fluxCO2ave(i,j,bi,bj)=fluxCO2ave(i,j,bi,bj)+ |
232 |
|
|
& fluxCO2(i,j,bi,bj)*deltaTclock |
233 |
stephd |
1.1 |
endif |
234 |
|
|
ENDDO |
235 |
|
|
ENDDO |
236 |
|
|
ENDDO |
237 |
|
|
do k=1,Nr |
238 |
|
|
dic_timeave(bi,bj,k)=dic_timeave(bi,bj,k)+deltaTclock |
239 |
|
|
enddo |
240 |
|
|
#endif |
241 |
|
|
|
242 |
|
|
#endif |
243 |
|
|
#endif |
244 |
|
|
|
245 |
|
|
c |
246 |
|
|
RETURN |
247 |
|
|
END |