1 |
stephd |
1.1 |
C modified for external_forcing_DIC.F August 1999 |
2 |
|
|
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
3 |
|
|
c |
4 |
|
|
c modified swd Oct 01 and Feb 02, for use as package for c40_patch1 |
5 |
|
|
c modified to use with c44 and ptracers: swd May 2002 |
6 |
|
|
c modified to have carbonate and biological influences: swd June 2002 |
7 |
|
|
C |
8 |
|
|
|
9 |
edhill |
1.4 |
#include "DIC_OPTIONS.h" |
10 |
stephd |
1.1 |
#include "GCHEM_OPTIONS.h" |
11 |
|
|
|
12 |
|
|
CStartOfInterFace |
13 |
|
|
SUBROUTINE DIC_BIOTIC_FORCING( PTR_DIC, PTR_ALK, PTR_PO4, |
14 |
|
|
& PTR_DOP, PTR_O2, |
15 |
|
|
#ifdef ALLOW_FE |
16 |
|
|
& PTR_FE, |
17 |
|
|
#endif |
18 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
19 |
|
|
& myIter,myTime,myThid) |
20 |
|
|
|
21 |
|
|
C /==========================================================\ |
22 |
|
|
C | SUBROUTINE DIC_BIOTIC_FORCING | |
23 |
|
|
C | o Calculate the changes to DIC through air-sea fluxes | |
24 |
|
|
C | carbonates, and biology (parameterizes by PO4) | |
25 |
|
|
C |==========================================================| |
26 |
|
|
IMPLICIT NONE |
27 |
|
|
|
28 |
|
|
C == GLobal variables == |
29 |
|
|
#include "SIZE.h" |
30 |
|
|
#include "DYNVARS.h" |
31 |
|
|
#include "EEPARAMS.h" |
32 |
|
|
#include "PARAMS.h" |
33 |
|
|
#include "GRID.h" |
34 |
|
|
#include "DIC_BIOTIC.h" |
35 |
|
|
#include "DIC_ABIOTIC.h" |
36 |
|
|
|
37 |
|
|
C == Routine arguments == |
38 |
|
|
INTEGER myIter |
39 |
|
|
_RL myTime |
40 |
|
|
INTEGER myThid |
41 |
|
|
_RL PTR_DIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
42 |
|
|
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y,Nr) |
67 |
|
|
#ifdef ALLOW_FE |
68 |
|
|
_RL GFE(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
69 |
|
|
_RL freefe(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
70 |
|
|
#endif |
71 |
|
|
INTEGER I,J,k |
72 |
|
|
|
73 |
|
|
DO k=1,Nr |
74 |
|
|
DO j=1-OLy,sNy+OLy |
75 |
|
|
DO i=1-OLx,sNx+OLx |
76 |
|
|
GDIC(i,j,k)=0.d0 |
77 |
|
|
GALK(i,j,k)=0.d0 |
78 |
|
|
GPO4(i,j,k)=0.d0 |
79 |
|
|
GDOP(i,j,k)=0.d0 |
80 |
|
|
GO2(i,j,k)=0.d0 |
81 |
|
|
SURA(i,j)=0.d0 |
82 |
|
|
SURC(i,j)=0.d0 |
83 |
|
|
CAR(i,j,k)=0.d0 |
84 |
|
|
BIO(i,j,k)=0.d0 |
85 |
|
|
bioac(i,j,k)=0.d0 |
86 |
|
|
pflux(i,j,k)=0.d0 |
87 |
|
|
cflux(i,j,k)=0.d0 |
88 |
|
|
#ifdef ALLOW_FE |
89 |
|
|
GFE(i,j,k)=0.d0 |
90 |
|
|
freefe(i,j,k)=0.d0 |
91 |
|
|
#endif |
92 |
|
|
ENDDO |
93 |
|
|
ENDDO |
94 |
|
|
ENDDO |
95 |
|
|
|
96 |
|
|
c carbon air-sea interaction |
97 |
|
|
CALL DIC_SURFFORCING( PTR_DIC, SURC, |
98 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
99 |
|
|
& myIter,myTime,myThid) |
100 |
|
|
|
101 |
|
|
c alkalinity air-sea interaction |
102 |
|
|
CALL ALK_SURFFORCING( PTR_ALK, SURA, |
103 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
104 |
|
|
& myIter,myTime,myThid) |
105 |
|
|
|
106 |
|
|
c carbon air-sea interaction |
107 |
|
|
CALL O2_SURFFORCING( PTR_O2, SURO, |
108 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
109 |
|
|
& myIter,myTime,myThid) |
110 |
|
|
|
111 |
|
|
#ifdef ALLOW_FE |
112 |
|
|
c find free iron |
113 |
|
|
call fe_chem(bi,bj,iMin,iMax,jMin,jMax, PTR_FE, freefe, |
114 |
|
|
& myIter, mythid) |
115 |
|
|
#endif |
116 |
|
|
|
117 |
|
|
|
118 |
|
|
c biological activity |
119 |
|
|
CALL BIO_EXPORT( PTR_PO4 , |
120 |
|
|
#ifdef ALLOW_FE |
121 |
|
|
I PTR_FE, |
122 |
|
|
#endif |
123 |
|
|
I bioac, |
124 |
|
|
I bi,bj,imin,imax,jmin,jmax, |
125 |
|
|
I myIter,myTime,myThid) |
126 |
|
|
|
127 |
|
|
c flux of po4 from layers with biological activity |
128 |
|
|
CALL PHOS_FLUX( bioac, pflux, |
129 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
130 |
|
|
& myIter,myTime,myThid) |
131 |
|
|
|
132 |
|
|
c carbonate |
133 |
|
|
CALL CAR_FLUX( bioac, cflux, |
134 |
|
|
& bi,bj,imin,imax,jmin,jmax, |
135 |
|
|
& myIter,myTime,myThid) |
136 |
|
|
|
137 |
|
|
c add all tendencies for PO4, DOP, ALK, DIC |
138 |
|
|
DO k=1,Nr |
139 |
|
|
DO j=1-OLy,sNy+OLy |
140 |
|
|
DO i=1-OLx,sNx+OLx |
141 |
|
|
bio(i,j,k)=-bioac(i,j,k)+pflux(i,j,k) |
142 |
|
|
& + maskC(i,j,k,bi,bj)*Kdopremin*PTR_DOP(i,j,k) |
143 |
|
|
car(i,j,k)=-bioac(i,j,k)* R_cp*rain_ratio(i,j,bi,bj)* |
144 |
|
|
& (1.0-DOPfraction)+cflux(i,j,k) |
145 |
|
|
GPO4(i,j,k)=bio(i,j,k) |
146 |
|
|
GDOP(i,j,k)=+bioac(i,j,k)*DOPfraction |
147 |
|
|
& - maskC(i,j,k,bi,bj)*Kdopremin*PTR_DOP(i,j,k) |
148 |
|
|
GALK(i,j,k)=+2.d0*car(i,j,k)-R_NP*bio(i,j,k) |
149 |
|
|
GDIC(i,j,k)=car(i,j,k)+R_CP*bio(i,j,k) |
150 |
|
|
if (PTR_O2(i,j,k).gt.o2crit) then |
151 |
|
|
GO2(i,j,k)=R_OP*bio(i,j,k) |
152 |
|
|
else |
153 |
|
|
GO2(i,j,k)=0.d0 |
154 |
|
|
endif |
155 |
|
|
#ifdef ALLOW_FE |
156 |
|
|
GFE(i,j,k)=R_FeP*bio(i,j,k) |
157 |
|
|
& -Kscav*freefe(i,j,k) |
158 |
|
|
#endif |
159 |
|
|
IF (K.eq.1) then |
160 |
|
|
GALK(i,j,1)=GALK(i,j,1)+SURA(i,j) |
161 |
|
|
GDIC(i,j,1)=GDIC(i,j,1)+SURC(i,j) |
162 |
|
|
GO2(i,j,1)=GO2(i,j,1)+SURO(i,j) |
163 |
|
|
#ifdef ALLOW_FE |
164 |
|
|
GFE(i,j,1)=GFE(i,j,1)+alpfe* |
165 |
|
|
& InputFe(i,j,bi,bj)/delz(1) |
166 |
|
|
#endif |
167 |
|
|
ENDIF |
168 |
|
|
ENDDO |
169 |
|
|
ENDDO |
170 |
|
|
ENDDO |
171 |
|
|
|
172 |
|
|
|
173 |
|
|
C update |
174 |
|
|
DO k=1,Nr |
175 |
|
|
DO j=1-OLy,sNy+OLy |
176 |
|
|
DO i=1-OLx,sNx+OLx |
177 |
|
|
PTR_DIC(i,j,k)= |
178 |
|
|
& PTR_DIC(i,j,k)+GDIC(i,j,k)*deltaTtracer |
179 |
|
|
PTR_ALK(i,j,k)= |
180 |
|
|
& PTR_ALK(i,j,k)+GALK(i,j,k)*deltaTtracer |
181 |
|
|
PTR_PO4(i,j,k)= |
182 |
|
|
& PTR_PO4(i,j,k)+GPO4(i,j,k)*deltaTtracer |
183 |
|
|
PTR_DOP(i,j,k)= |
184 |
|
|
& PTR_DOP(i,j,k)+GDOP(i,j,k)*deltaTtracer |
185 |
|
|
PTR_O2(i,j,k)= |
186 |
|
|
& PTR_O2(i,j,k)+GO2(i,j,k)*deltaTtracer |
187 |
|
|
#ifdef ALLOW_FE |
188 |
|
|
PTR_FE(i,j,k)= |
189 |
|
|
& PTR_FE(i,j,k)+GFE(i,j,k)*deltaTtracer |
190 |
|
|
#endif |
191 |
|
|
ENDDO |
192 |
|
|
ENDDO |
193 |
|
|
ENDDO |
194 |
|
|
|
195 |
|
|
#ifdef ALLOW_TIMEAVE |
196 |
|
|
c save averages |
197 |
|
|
DO k=1,Nr |
198 |
|
|
DO j=1-OLy,sNy+OLy |
199 |
|
|
DO i=1-OLx,sNx+OLx |
200 |
|
|
BIOave(i,j,k,bi,bj)=BIOave(i,j,k,bi,bj)+ |
201 |
|
|
& BIOac(i,j,k)*deltaTclock |
202 |
|
|
CARave(i,j,k,bi,bj)=CARave(i,j,k,bi,bj)+ |
203 |
|
|
& CAR(i,j,k)*deltaTclock |
204 |
|
|
if (k.eq.1) then |
205 |
|
|
SURave(i,j,bi,bj)=SURave(i,j,bi,bj)+ |
206 |
|
|
& SURC(i,j)*deltaTclock |
207 |
|
|
SUROave(i,j,bi,bj)=SUROave(i,j,bi,bj)+ |
208 |
|
|
& SURO(i,j)*deltaTclock |
209 |
|
|
pCO2ave(i,j,bi,bj)=pCO2ave(i,j,bi,bj)+ |
210 |
|
|
& pCO2(i,j,bi,bj)*deltaTclock |
211 |
|
|
pHave(i,j,bi,bj)=pHave(i,j,bi,bj)+ |
212 |
|
|
& pH(i,j,bi,bj)*deltaTclock |
213 |
stephd |
1.2 |
fluxCO2ave(i,j,bi,bj)=fluxCO2ave(i,j,bi,bj)+ |
214 |
|
|
& fluxCO2(i,j,bi,bj)*deltaTclock |
215 |
stephd |
1.1 |
endif |
216 |
|
|
ENDDO |
217 |
|
|
ENDDO |
218 |
|
|
ENDDO |
219 |
|
|
do k=1,Nr |
220 |
|
|
dic_timeave(bi,bj,k)=dic_timeave(bi,bj,k)+deltaTclock |
221 |
|
|
enddo |
222 |
|
|
#endif |
223 |
|
|
|
224 |
|
|
#endif |
225 |
|
|
#endif |
226 |
|
|
|
227 |
|
|
c |
228 |
|
|
RETURN |
229 |
|
|
END |