52 |
_RL SchmidtNoDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL SchmidtNoDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
53 |
_RL pCO2sat(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL pCO2sat(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
54 |
_RL Kwexch(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL Kwexch(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
55 |
|
_RL pisvel(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
56 |
C local variables for carbon chem |
C local variables for carbon chem |
57 |
_RL surfalk(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL surfalk(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
58 |
_RL surfphos(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL surfphos(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
59 |
_RL surfsi(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL surfsi(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
60 |
|
#ifdef ALLOW_OLD_VIRTUALFLUX |
61 |
_RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
62 |
|
#endif |
63 |
CEOP |
CEOP |
64 |
|
|
65 |
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
104 |
I bi,bj,iMin,iMax,jMin,jMax) |
I bi,bj,iMin,iMax,jMin,jMax) |
105 |
C==================================================================== |
C==================================================================== |
106 |
|
|
107 |
|
DO j=jmin,jmax |
108 |
|
DO i=imin,imax |
109 |
|
C Compute AtmosP and Kwexch_Pre which are re-used for flux of O2 |
110 |
|
|
111 |
|
#ifdef USE_PLOAD |
112 |
|
C Convert anomalous pressure pLoad (in Pa) from atmospheric model |
113 |
|
C to total pressure (in Atm) |
114 |
|
C Note: it is assumed the reference atmospheric pressure is 1Atm=1013mb |
115 |
|
C rather than the actual ref. pressure from Atm. model so that on |
116 |
|
C average AtmosP is about 1 Atm. |
117 |
|
AtmosP(i,j,bi,bj)= 1. _d 0 + pLoad(i,j,bi,bj)/Pa2Atm |
118 |
|
#endif |
119 |
|
|
120 |
|
C Pre-compute part of exchange coefficient: pisvel*(1-fice) |
121 |
|
C Schmidt number is accounted for later |
122 |
|
pisvel(i,j)=0.337 _d 0 *wind(i,j,bi,bj)**2/3.6 _d 5 |
123 |
|
Kwexch_Pre(i,j,bi,bj) = pisvel(i,j) |
124 |
|
& * (1. _d 0 - FIce(i,j,bi,bj)) |
125 |
|
|
126 |
|
ENDDO |
127 |
|
ENDDO |
128 |
|
|
129 |
c pCO2 solver... |
c pCO2 solver... |
130 |
C$TAF LOOP = parallel |
C$TAF LOOP = parallel |
131 |
DO j=jmin,jmax |
DO j=jmin,jmax |
132 |
C$TAF LOOP = parallel |
C$TAF LOOP = parallel |
133 |
DO i=imin,imax |
DO i=imin,imax |
134 |
|
|
135 |
IF(maskC(i,j,kLev,bi,bj) .NE. 0.)THEN |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
136 |
CALL CALC_PCO2_APPROX( |
CALL CALC_PCO2_APPROX( |
137 |
I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj), |
I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj), |
138 |
I PTR_CO2(i,j,kLev), surfphos(i,j), |
I PTR_CO2(i,j,kLev), surfphos(i,j), |
144 |
I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj), |
I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj), |
145 |
U pH(i,j,bi,bj),pCO2(i,j,bi,bj) ) |
U pH(i,j,bi,bj),pCO2(i,j,bi,bj) ) |
146 |
ELSE |
ELSE |
147 |
pCO2(i,j,bi,bj)=0. _d 0 |
pCO2(i,j,bi,bj)=0. _d 0 |
148 |
END IF |
ENDIF |
149 |
ENDDO |
ENDDO |
150 |
ENDDO |
ENDDO |
151 |
|
|
152 |
DO j=jmin,jmax |
DO j=jmin,jmax |
153 |
DO i=imin,imax |
DO i=imin,imax |
154 |
|
|
155 |
IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
156 |
C calculate SCHMIDT NO. for CO2 |
C calculate SCHMIDT NO. for CO2 |
157 |
SchmidtNoDIC(i,j) = |
SchmidtNoDIC(i,j) = |
158 |
& sca1 |
& sca1 |
161 |
& + sca4 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj) |
& + sca4 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj) |
162 |
& *theta(i,j,kLev,bi,bj) |
& *theta(i,j,kLev,bi,bj) |
163 |
|
|
|
c |
|
|
#ifdef USE_PLOAD |
|
|
C Convert anomalous pressure pLoad (in Pa) from atmospheric model |
|
|
C to total pressure (in Atm) |
|
|
C Note: it is assumed the reference atmospheric pressure is 1Atm=1013mb |
|
|
C rather than the actual ref. pressure from Atm. model so that on |
|
|
C average AtmosP is about 1 Atm. |
|
|
AtmosP(i,j,bi,bj)= 1. _d 0 + pLoad(i,j,bi,bj)/Pa2Atm |
|
|
#endif |
|
|
|
|
164 |
C Determine surface flux (FDIC) |
C Determine surface flux (FDIC) |
165 |
C first correct pCO2at for surface atmos pressure |
C first correct pCO2at for surface atmos pressure |
166 |
pCO2sat(i,j) = |
pCO2sat(i,j) = |
167 |
& AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj) |
& AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj) |
|
c find exchange coefficient |
|
|
c account for schmidt number and and varible piston velocity |
|
|
pisvel(i,j,bi,bj)=0.337 _d 0 *wind(i,j,bi,bj)**2/3.6 _d 5 |
|
|
Kwexch(i,j) = |
|
|
& pisvel(i,j,bi,bj) |
|
|
& / sqrt(SchmidtNoDIC(i,j)/660.0 _d 0) |
|
|
c OR use a constant coeff |
|
|
c Kwexch(i,j) = 5e-5 |
|
|
c ice influence |
|
|
Kwexch(i,j) =(1. _d 0 - FIce(i,j,bi,bj))*Kwexch(i,j) |
|
168 |
|
|
169 |
|
C then account for Schmidt number |
170 |
|
Kwexch(i,j) = Kwexch_Pre(i,j,bi,bj) |
171 |
|
& / sqrt(SchmidtNoDIC(i,j)/660.0 _d 0) |
172 |
|
|
173 |
C Calculate flux in terms of DIC units using K0, solubility |
C Calculate flux in terms of DIC units using K0, solubility |
174 |
C Flux = Vp * ([CO2sat] - [CO2]) |
C Flux = Vp * ([CO2sat] - [CO2]) |
175 |
C CO2sat = K0*pCO2atmos*P/P0 |
C CO2sat = K0*pCO2atmos*P/P0 |
176 |
C Converting pCO2 to [CO2] using ff, as in CALC_PCO2 |
C Converting pCO2 to [CO2] using ff, as in CALC_PCO2 |
177 |
FluxCO2(i,j,bi,bj) = |
FluxCO2(i,j,bi,bj) = |
178 |
& maskC(i,j,kLev,bi,bj)*Kwexch(i,j)*( |
& Kwexch(i,j)*( |
179 |
& ak0(i,j,bi,bj)*pCO2sat(i,j) - |
& ak0(i,j,bi,bj)*pCO2sat(i,j) - |
180 |
& ff(i,j,bi,bj)*pCO2(i,j,bi,bj) |
& ff(i,j,bi,bj)*pCO2(i,j,bi,bj) |
181 |
& ) |
& ) |
182 |
ELSE |
ELSE |
183 |
FluxCO2(i,j,bi,bj) = 0. _d 0 |
FluxCO2(i,j,bi,bj) = 0. _d 0 |
184 |
ENDIF |
ENDIF |
185 |
C convert flux (mol kg-1 m s-1) to (mol m-2 s-1) |
C convert flux (mol kg-1 m s-1) to (mol m-2 s-1) |
186 |
FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil |
FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil |
187 |
|
|
188 |
IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN |
#ifdef ALLOW_OLD_VIRTUALFLUX |
189 |
|
IF (maskC(i,j,kLev,bi,bj).NE.0. _d 0) THEN |
190 |
c calculate virtual flux |
c calculate virtual flux |
191 |
c EminusPforV = dS/dt*(1/Sglob) |
c EminusPforV = dS/dt*(1/Sglob) |
192 |
C NOTE: Be very careful with signs here! |
C NOTE: Be very careful with signs here! |
202 |
ELSE |
ELSE |
203 |
VirtualFlux(i,j)=0. _d 0 |
VirtualFlux(i,j)=0. _d 0 |
204 |
ENDIF |
ENDIF |
205 |
|
#endif /* ALLOW_OLD_VIRTUALFLUX */ |
206 |
ENDDO |
ENDDO |
207 |
ENDDO |
ENDDO |
208 |
|
|
209 |
C update tendency |
C update tendency |
210 |
DO j=jmin,jmax |
DO j=jmin,jmax |
211 |
DO i=imin,imax |
DO i=imin,imax |
212 |
GDC(i,j)= maskC(i,j,kLev,bi,bj)*recip_drF(kLev)* |
GDC(i,j)= recip_drF(kLev)*recip_hFacC(i,j,kLev,bi,bj) |
213 |
& recip_hFacC(i,j,kLev,bi,bj)*( |
& *(FluxCO2(i,j,bi,bj) |
214 |
& FluxCO2(i,j,bi,bj) + VirtualFlux(i,j) |
#ifdef ALLOW_OLD_VIRTUALFLUX |
215 |
& ) |
& + VirtualFlux(i,j) |
216 |
|
#endif |
217 |
|
& ) |
218 |
ENDDO |
ENDDO |
219 |
ENDDO |
ENDDO |
220 |
|
|