| 3 |
|
|
| 4 |
#include "DIC_OPTIONS.h" |
#include "DIC_OPTIONS.h" |
| 5 |
#include "PTRACERS_OPTIONS.h" |
#include "PTRACERS_OPTIONS.h" |
|
#include "GCHEM_OPTIONS.h" |
|
| 6 |
|
|
| 7 |
CBOP |
CBOP |
| 8 |
C !ROUTINE: DIC_SURFFORCING |
C !ROUTINE: DIC_SURFFORCING |
| 9 |
|
|
| 10 |
C !INTERFACE: ========================================================== |
C !INTERFACE: ========================================================== |
| 11 |
SUBROUTINE DIC_SURFFORCING( PTR_CO2 , PTR_ALK, PTR_PO4, GDC, |
SUBROUTINE DIC_SURFFORCING( PTR_CO2 , PTR_ALK, PTR_PO4, GDC, |
| 12 |
I bi,bj,imin,imax,jmin,jmax, |
I bi,bj,imin,imax,jmin,jmax, |
| 13 |
I myIter,myTime,myThid) |
I myIter,myTime,myThid) |
| 14 |
|
|
| 15 |
C !DESCRIPTION: |
C !DESCRIPTION: |
| 16 |
C Calculate the carbon air-sea flux terms |
C Calculate the carbon air-sea flux terms |
| 17 |
C following external_forcing_dic.F (OCMIP run) from Mick |
C following external_forcing_dic.F (OCMIP run) from Mick |
| 18 |
|
|
| 19 |
C !USES: =============================================================== |
C !USES: =============================================================== |
| 20 |
IMPLICIT NONE |
IMPLICIT NONE |
| 24 |
#include "PARAMS.h" |
#include "PARAMS.h" |
| 25 |
#include "GRID.h" |
#include "GRID.h" |
| 26 |
#include "FFIELDS.h" |
#include "FFIELDS.h" |
| 27 |
#include "DIC_ABIOTIC.h" |
#include "DIC_VARS.h" |
| 28 |
|
|
| 29 |
C !INPUT PARAMETERS: =================================================== |
C !INPUT PARAMETERS: =================================================== |
| 30 |
C myThid :: thread number |
C myThid :: thread number |
| 45 |
#ifdef ALLOW_PTRACERS |
#ifdef ALLOW_PTRACERS |
| 46 |
|
|
| 47 |
C !LOCAL VARIABLES: ==================================================== |
C !LOCAL VARIABLES: ==================================================== |
| 48 |
INTEGER I,J, kLev, it |
INTEGER i,j, kLev |
| 49 |
|
_RL co3dummy |
| 50 |
C Number of iterations for pCO2 solvers... |
C Number of iterations for pCO2 solvers... |
| 51 |
C Solubility relation coefficients |
C Solubility relation coefficients |
| 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 |
|
_RL surftemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 61 |
|
_RL surfsalt(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 62 |
|
_RL surfdic(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 63 |
|
#ifdef ALLOW_OLD_VIRTUALFLUX |
| 64 |
_RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 65 |
|
#endif |
| 66 |
CEOP |
CEOP |
| 67 |
|
|
| 68 |
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
| 69 |
|
|
| 70 |
kLev=1 |
kLev=1 |
| 71 |
|
|
| 72 |
C PRE-INDUSTRIAL STEADY STATE pCO2 = 278.0 ppmv |
cc if coupled to atmsopheric model, use the |
| 73 |
DO j=1-OLy,sNy+OLy |
cc Co2 value passed from the coupler |
| 74 |
DO i=1-OLx,sNx+OLx |
c#ifndef USE_ATMOSCO2 |
| 75 |
AtmospCO2(i,j,bi,bj)=278.0d-6 |
cC PRE-INDUSTRIAL STEADY STATE pCO2 = 278.0 ppmv |
| 76 |
ENDDO |
c DO j=1-OLy,sNy+OLy |
| 77 |
ENDDO |
c DO i=1-OLx,sNx+OLx |
| 78 |
|
c AtmospCO2(i,j,bi,bj)=278.0 _d -6 |
| 79 |
|
c ENDDO |
| 80 |
|
c ENDDO |
| 81 |
|
c#endif |
| 82 |
|
|
| 83 |
|
|
| 84 |
C ================================================================= |
C ================================================================= |
| 88 |
|
|
| 89 |
#ifdef DIC_BIOTIC |
#ifdef DIC_BIOTIC |
| 90 |
cQQQQ check ptracer numbers |
cQQQQ check ptracer numbers |
| 91 |
|
#ifdef DIC_BOUNDS |
| 92 |
|
surfalk(i,j) = max(0.4 _d 0, |
| 93 |
|
& min(10. _d 0,PTR_ALK(i,j,klev))) |
| 94 |
|
& * maskC(i,j,kLev,bi,bj) |
| 95 |
|
surfphos(i,j) = max(1.0 _d -11, |
| 96 |
|
& min(1._d -1, PTR_PO4(i,j,klev))) |
| 97 |
|
& * maskC(i,j,kLev,bi,bj) |
| 98 |
|
#else |
| 99 |
surfalk(i,j) = PTR_ALK(i,j,klev) |
surfalk(i,j) = PTR_ALK(i,j,klev) |
| 100 |
& * maskC(i,j,kLev,bi,bj) |
& * maskC(i,j,kLev,bi,bj) |
| 101 |
surfphos(i,j) = PTR_PO4(i,j,klev) |
surfphos(i,j) = PTR_PO4(i,j,klev) |
| 102 |
& * maskC(i,j,kLev,bi,bj) |
& * maskC(i,j,kLev,bi,bj) |
| 103 |
|
#endif |
| 104 |
#else |
#else |
| 105 |
surfalk(i,j) = 2.366595 * salt(i,j,kLev,bi,bj)/gsm_s |
surfalk(i,j) = 2.366595 _d 0 * salt(i,j,kLev,bi,bj)/gsm_s |
| 106 |
& * maskC(i,j,kLev,bi,bj) |
& * maskC(i,j,kLev,bi,bj) |
| 107 |
surfphos(i,j) = 5.1225e-4 * maskC(i,j,kLev,bi,bj) |
surfphos(i,j) = 5.1225 _d -4 * maskC(i,j,kLev,bi,bj) |
| 108 |
#endif |
#endif |
| 109 |
C FOR NON-INTERACTIVE Si |
C FOR NON-INTERACTIVE Si |
| 110 |
surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj) |
surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj) |
| 111 |
|
#ifdef DIC_BOUNDS |
| 112 |
|
surftemp(i,j) = max(-4. _d 0, |
| 113 |
|
& min(50. _d 0, theta(i,j,kLev,bi,bj))) |
| 114 |
|
surfsalt(i,j) = max(4. _d 0, |
| 115 |
|
& min(50. _d 0, salt(i,j,kLev,bi,bj))) |
| 116 |
|
surfdic(i,j) = max(0.4 _d 0, |
| 117 |
|
& min(10. _d 0, PTR_CO2(i,j,kLev))) |
| 118 |
|
#else |
| 119 |
|
surftemp(i,j) = theta(i,j,kLev,bi,bj) |
| 120 |
|
surfsalt(i,j) = salt(i,j,kLev,bi,bj) |
| 121 |
|
surfdic(i,j) = PTR_CO2(i,j,kLev) |
| 122 |
|
#endif |
| 123 |
ENDDO |
ENDDO |
| 124 |
ENDDO |
ENDDO |
| 125 |
|
|
| 126 |
CALL CARBON_COEFFS( |
CALL CARBON_COEFFS( |
| 127 |
I theta,salt, |
I surftemp,surfsalt, |
| 128 |
I bi,bj,iMin,iMax,jMin,jMax) |
I bi,bj,iMin,iMax,jMin,jMax,myThid) |
| 129 |
C==================================================================== |
C==================================================================== |
| 130 |
|
|
| 131 |
|
DO j=jmin,jmax |
| 132 |
|
DO i=imin,imax |
| 133 |
|
C Compute AtmosP and Kwexch_Pre which are re-used for flux of O2 |
| 134 |
|
|
| 135 |
|
#ifdef USE_PLOAD |
| 136 |
|
C Convert anomalous pressure pLoad (in Pa) from atmospheric model |
| 137 |
|
C to total pressure (in Atm) |
| 138 |
|
C Note: it is assumed the reference atmospheric pressure is 1Atm=1013mb |
| 139 |
|
C rather than the actual ref. pressure from Atm. model so that on |
| 140 |
|
C average AtmosP is about 1 Atm. |
| 141 |
|
AtmosP(i,j,bi,bj)= 1. _d 0 + pLoad(i,j,bi,bj)/Pa2Atm |
| 142 |
|
#endif |
| 143 |
|
|
| 144 |
|
C Pre-compute part of exchange coefficient: pisvel*(1-fice) |
| 145 |
|
C Schmidt number is accounted for later |
| 146 |
|
pisvel(i,j)=0.337 _d 0 *wind(i,j,bi,bj)**2/3.6 _d 5 |
| 147 |
|
Kwexch_Pre(i,j,bi,bj) = pisvel(i,j) |
| 148 |
|
& * (1. _d 0 - FIce(i,j,bi,bj)) |
| 149 |
|
|
| 150 |
|
ENDDO |
| 151 |
|
ENDDO |
| 152 |
|
|
| 153 |
c pCO2 solver... |
c pCO2 solver... |
| 154 |
C$TAF LOOP = parallel |
C$TAF LOOP = parallel |
| 155 |
DO j=jmin,jmax |
DO j=jmin,jmax |
| 156 |
C$TAF LOOP = parallel |
C$TAF LOOP = parallel |
| 157 |
DO i=imin,imax |
DO i=imin,imax |
| 158 |
|
|
| 159 |
IF(maskC(i,j,kLev,bi,bj) .NE. 0.)THEN |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
| 160 |
CALL CALC_PCO2_APPROX( |
CALL CALC_PCO2_APPROX( |
| 161 |
I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj), |
I surftemp(i,j),surfsalt(i,j), |
| 162 |
I PTR_CO2(i,j,kLev), surfphos(i,j), |
I surfdic(i,j), surfphos(i,j), |
| 163 |
I surfsi(i,j),surfalk(i,j), |
I surfsi(i,j),surfalk(i,j), |
| 164 |
I ak1(i,j,bi,bj),ak2(i,j,bi,bj), |
I ak1(i,j,bi,bj),ak2(i,j,bi,bj), |
| 165 |
I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj), |
I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj), |
| 166 |
I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj), |
I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj), |
| 167 |
I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj), |
I aksi(i,j,bi,bj),akf(i,j,bi,bj), |
| 168 |
|
I ak0(i,j,bi,bj), fugf(i,j,bi,bj), |
| 169 |
|
I ff(i,j,bi,bj), |
| 170 |
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), |
| 171 |
U pH(i,j,bi,bj),pCO2(i,j,bi,bj) ) |
U pH(i,j,bi,bj),pCO2(i,j,bi,bj),co3dummy, |
| 172 |
|
I i,j,kLev,bi,bj,myIter,myThid ) |
| 173 |
ELSE |
ELSE |
| 174 |
pCO2(i,j,bi,bj)=0. _d 0 |
pCO2(i,j,bi,bj)=0. _d 0 |
| 175 |
END IF |
ENDIF |
| 176 |
ENDDO |
ENDDO |
| 177 |
ENDDO |
ENDDO |
| 178 |
|
|
| 179 |
DO j=jmin,jmax |
DO j=jmin,jmax |
| 180 |
DO i=imin,imax |
DO i=imin,imax |
| 181 |
|
|
| 182 |
IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
| 183 |
C calculate SCHMIDT NO. for CO2 |
C calculate SCHMIDT NO. for CO2 |
| 184 |
SchmidtNoDIC(i,j) = |
SchmidtNoDIC(i,j) = |
| 185 |
& sca1 |
& sca1 |
| 186 |
& + sca2 * theta(i,j,kLev,bi,bj) |
& + sca2 * theta(i,j,kLev,bi,bj) |
| 187 |
& + sca3 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj) |
& + sca3 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj) |
| 188 |
& + 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) |
| 189 |
& *theta(i,j,kLev,bi,bj) |
& *theta(i,j,kLev,bi,bj) |
| 190 |
|
c make sure Schmidt number is not negative (will happen if temp>39C) |
| 191 |
|
SchmidtNoDIC(i,j)=max(1.0 _d -2, SchmidtNoDIC(i,j)) |
| 192 |
|
|
| 193 |
C Determine surface flux (FDIC) |
C Determine surface flux (FDIC) |
| 194 |
C first correct pCO2at for surface atmos pressure |
C first correct pCO2at for surface atmos pressure |
| 195 |
pCO2sat(i,j) = |
pCO2sat(i,j) = |
| 196 |
& 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*wind(i,j,bi,bj)**2/3.6d5 |
|
|
Kwexch(i,j) = |
|
|
& pisvel(i,j,bi,bj) |
|
|
& / sqrt(SchmidtNoDIC(i,j)/660.0) |
|
|
c OR use a constant coeff |
|
|
c Kwexch(i,j) = 5e-5 |
|
|
c ice influence |
|
|
Kwexch(i,j) =(1.d0-Fice(i,j,bi,bj))*Kwexch(i,j) |
|
| 197 |
|
|
| 198 |
|
C then account for Schmidt number |
| 199 |
|
Kwexch(i,j) = Kwexch_Pre(i,j,bi,bj) |
| 200 |
|
& / sqrt(SchmidtNoDIC(i,j)/660.0 _d 0) |
| 201 |
|
|
| 202 |
|
#ifdef WATERVAP_BUG |
| 203 |
C Calculate flux in terms of DIC units using K0, solubility |
C Calculate flux in terms of DIC units using K0, solubility |
| 204 |
C Flux = Vp * ([CO2sat] - [CO2]) |
C Flux = Vp * ([CO2sat] - [CO2]) |
| 205 |
C CO2sat = K0*pCO2atmos*P/P0 |
C CO2sat = K0*pCO2atmos*P/P0 |
| 206 |
C Converting pCO2 to [CO2] using ff, as in CALC_PCO2 |
C Converting pCO2 to [CO2] using ff, as in CALC_PCO2 |
| 207 |
FluxCO2(i,j,bi,bj) = |
FluxCO2(i,j,bi,bj) = |
| 208 |
& maskC(i,j,kLev,bi,bj)*Kwexch(i,j)*( |
& Kwexch(i,j)*( |
| 209 |
& ak0(i,j,bi,bj)*pCO2sat(i,j) - |
& ak0(i,j,bi,bj)*pCO2sat(i,j) - |
| 210 |
& ff(i,j,bi,bj)*pCO2(i,j,bi,bj) |
& ff(i,j,bi,bj)*pCO2(i,j,bi,bj) |
| 211 |
& ) |
& ) |
| 212 |
ELSE |
#else |
| 213 |
FluxCO2(i,j,bi,bj) = 0. |
C Corrected by Val Bennington Nov 2010 per G.A. McKinley s finding |
| 214 |
ENDIF |
C of error in application of water vapor correction |
| 215 |
|
c Flux = kw*rho*(ff*pCO2atm-k0*FugFac*pCO2ocean) |
| 216 |
|
FluxCO2(i,j,bi,bj) = |
| 217 |
|
& Kwexch(i,j)*( |
| 218 |
|
& ff(i,j,bi,bj)*pCO2sat(i,j) - |
| 219 |
|
& pCO2(i,j,bi,bj)*fugf(i,j,bi,bj) |
| 220 |
|
& *ak0(i,j,bi,bj) ) |
| 221 |
|
& |
| 222 |
|
#endif |
| 223 |
|
ELSE |
| 224 |
|
FluxCO2(i,j,bi,bj) = 0. _d 0 |
| 225 |
|
ENDIF |
| 226 |
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) |
| 227 |
FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil |
FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil |
| 228 |
|
|
| 229 |
IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN |
#ifdef ALLOW_OLD_VIRTUALFLUX |
| 230 |
|
IF (maskC(i,j,kLev,bi,bj).NE.0. _d 0) THEN |
| 231 |
c calculate virtual flux |
c calculate virtual flux |
| 232 |
c EminusPforV = dS/dt*(1/Sglob) |
c EminusPforV = dS/dt*(1/Sglob) |
| 233 |
C NOTE: Be very careful with signs here! |
C NOTE: Be very careful with signs here! |
| 243 |
ELSE |
ELSE |
| 244 |
VirtualFlux(i,j)=0. _d 0 |
VirtualFlux(i,j)=0. _d 0 |
| 245 |
ENDIF |
ENDIF |
| 246 |
|
#endif /* ALLOW_OLD_VIRTUALFLUX */ |
| 247 |
ENDDO |
ENDDO |
| 248 |
ENDDO |
ENDDO |
| 249 |
|
|
| 250 |
C update tendency |
C update tendency |
| 251 |
DO j=jmin,jmax |
DO j=jmin,jmax |
| 252 |
DO i=imin,imax |
DO i=imin,imax |
| 253 |
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) |
| 254 |
& recip_hFacC(i,j,kLev,bi,bj)*( |
& *(FluxCO2(i,j,bi,bj) |
| 255 |
& FluxCO2(i,j,bi,bj) + VirtualFlux(i,j) |
#ifdef ALLOW_OLD_VIRTUALFLUX |
| 256 |
& ) |
& + VirtualFlux(i,j) |
| 257 |
|
#endif |
| 258 |
|
& ) |
| 259 |
ENDDO |
ENDDO |
| 260 |
ENDDO |
ENDDO |
| 261 |
|
|