| 1 |
#include "CPP_OPTIONS.h" |
C $Header$ |
| 2 |
|
C $Name$ |
| 3 |
|
|
| 4 |
|
#include "DIC_OPTIONS.h" |
| 5 |
#include "PTRACERS_OPTIONS.h" |
#include "PTRACERS_OPTIONS.h" |
| 6 |
#include "GCHEM_OPTIONS.h" |
#include "GCHEM_OPTIONS.h" |
| 7 |
|
|
| 8 |
CStartOfInterFace |
CBOP |
| 9 |
|
C !ROUTINE: DIC_SURFFORCING |
| 10 |
|
|
| 11 |
|
C !INTERFACE: ========================================================== |
| 12 |
SUBROUTINE DIC_SURFFORCING( PTR_CO2 , GDC, |
SUBROUTINE DIC_SURFFORCING( PTR_CO2 , GDC, |
| 13 |
I bi,bj,imin,imax,jmin,jmax, |
I bi,bj,imin,imax,jmin,jmax, |
| 14 |
I myIter,myTime,myThid) |
I myIter,myTime,myThid) |
| 15 |
|
|
| 16 |
C /==========================================================\ |
C !DESCRIPTION: |
| 17 |
C | SUBROUTINE DIC_SURFFORCING | |
C Calculate the carbon air-sea flux terms |
| 18 |
C | o Calculate the carbon air-sea flux terms | |
C following external_forcing_dic.F (OCMIP run) from Mick |
|
C | o following external_forcing_dic.F from Mick | |
|
|
C |==========================================================| |
|
|
IMPLICIT NONE |
|
| 19 |
|
|
| 20 |
C == GLobal variables == |
C !USES: =============================================================== |
| 21 |
|
IMPLICIT NONE |
| 22 |
#include "SIZE.h" |
#include "SIZE.h" |
| 23 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
| 24 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
| 27 |
#include "FFIELDS.h" |
#include "FFIELDS.h" |
| 28 |
#include "DIC_ABIOTIC.h" |
#include "DIC_ABIOTIC.h" |
| 29 |
#ifdef DIC_BIOTIC |
#ifdef DIC_BIOTIC |
| 30 |
|
#include "PTRACERS_SIZE.h" |
| 31 |
#include "PTRACERS.h" |
#include "PTRACERS.h" |
| 32 |
#endif |
#endif |
| 33 |
|
|
| 34 |
C == Routine arguments == |
C !INPUT PARAMETERS: =================================================== |
| 35 |
|
C myThid :: thread number |
| 36 |
|
C myIter :: current timestep |
| 37 |
|
C myTime :: current time |
| 38 |
|
c PTR_CO2 :: DIC tracer field |
| 39 |
INTEGER myIter, myThid |
INTEGER myIter, myThid |
| 40 |
_RL myTime |
_RL myTime |
| 41 |
_RL PTR_CO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL PTR_CO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
|
_RL GDC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
| 42 |
INTEGER iMin,iMax,jMin,jMax, bi, bj |
INTEGER iMin,iMax,jMin,jMax, bi, bj |
| 43 |
|
|
| 44 |
|
C !OUTPUT PARAMETERS: =================================================== |
| 45 |
|
c GDC :: tendency due to air-sea exchange |
| 46 |
|
_RL GDC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 47 |
|
|
| 48 |
#ifdef ALLOW_PTRACERS |
#ifdef ALLOW_PTRACERS |
| 49 |
#ifdef DIC_ABIOTIC |
|
| 50 |
C == Local variables == |
C !LOCAL VARIABLES: ==================================================== |
| 51 |
INTEGER I,J, kLev |
INTEGER I,J, kLev, it |
| 52 |
C Number of iterations for pCO2 solvers... |
C Number of iterations for pCO2 solvers... |
|
INTEGER inewtonmax |
|
|
INTEGER ibrackmax |
|
|
INTEGER donewt |
|
| 53 |
C Solubility relation coefficients |
C Solubility relation coefficients |
| 54 |
_RL SchmidtNoDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL SchmidtNoDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 55 |
_RL pCO2sat(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL pCO2sat(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 59 |
_RL surfphos(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL surfphos(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 60 |
_RL surfsi(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL surfsi(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 61 |
_RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 62 |
_RL FluxCO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
CEOP |
| 63 |
|
|
| 64 |
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
| 65 |
|
|
| 75 |
|
|
| 76 |
C ================================================================= |
C ================================================================= |
| 77 |
C determine inorganic carbon chem coefficients |
C determine inorganic carbon chem coefficients |
| 78 |
DO j=1-OLy,sNy+OLy |
DO j=jmin,jmax |
| 79 |
DO i=1-OLx,sNx+OLx |
DO i=imin,imax |
| 80 |
|
|
| 81 |
#ifdef DIC_BIOTIC |
#ifdef DIC_BIOTIC |
| 82 |
cQQQQ check ptracer numbers |
cQQQQ check ptracer numbers |
| 90 |
surfphos(i,j) = 5.1225e-4 * maskC(i,j,kLev,bi,bj) |
surfphos(i,j) = 5.1225e-4 * maskC(i,j,kLev,bi,bj) |
| 91 |
#endif |
#endif |
| 92 |
C FOR NON-INTERACTIVE Si |
C FOR NON-INTERACTIVE Si |
| 93 |
surfsi(i,j) = 7.6838e-3 * maskC(i,j,kLev,bi,bj) |
surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj) |
| 94 |
ENDDO |
ENDDO |
| 95 |
ENDDO |
ENDDO |
| 96 |
|
|
| 99 |
I bi,bj,iMin,iMax,jMin,jMax) |
I bi,bj,iMin,iMax,jMin,jMax) |
| 100 |
C==================================================================== |
C==================================================================== |
| 101 |
|
|
|
#define PH_APPROX |
|
|
c set number of iterations for [H+] solvers |
|
|
#ifdef PH_APPROX |
|
|
inewtonmax = 1 |
|
|
#else |
|
|
inewtonmax = 10 |
|
|
#endif |
|
|
ibrackmax = 30 |
|
|
C determine pCO2 in surface ocean |
|
|
C set guess of pH for first step here |
|
|
C IF first step THEN use bracket-bisection for first step, |
|
|
C and determine carbon coefficients for safety |
|
|
C ELSE use newton-raphson with previous H+(x,y) as first guess |
|
|
|
|
|
donewt=1 |
|
|
|
|
|
c for first few timesteps |
|
|
IF(myIter .le. (nIter0+inewtonmax) )then |
|
|
donewt=0 |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
pH(i,j,bi,bj) = 8.0 |
|
|
ENDDO |
|
|
ENDDO |
|
|
#ifdef PH_APPROX |
|
|
print*,'QQ: pCO2 approximation method' |
|
|
c first approxmation |
|
|
DO j=1-OLy,sNy+OLy |
|
|
DO i=1-OLx,sNx+OLx |
|
|
CALL CALC_PCO2_APPROX( |
|
|
I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj), |
|
|
I PTR_CO2(i,j,kLev), surfphos(i,j), |
|
|
I surfsi(i,j),surfalk(i,j), |
|
|
I ak1(i,j,bi,bj),ak2(i,j,bi,bj), |
|
|
I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj), |
|
|
I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj), |
|
|
I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj), |
|
|
I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj), |
|
|
U pH(i,j,bi,bj),pCO2(i,j,bi,bj) ) |
|
|
ENDDO |
|
|
ENDDO |
|
|
#else |
|
|
print*,'QQ: pCO2 full method' |
|
|
#endif |
|
|
ENDIF |
|
|
|
|
|
|
|
| 102 |
c pCO2 solver... |
c pCO2 solver... |
| 103 |
DO j=1-OLy,sNy+OLy |
C$TAF LOOP = parallel |
| 104 |
DO i=1-OLx,sNx+OLx |
DO j=jmin,jmax |
| 105 |
|
C$TAF LOOP = parallel |
| 106 |
|
DO i=imin,imax |
| 107 |
|
|
| 108 |
IF(maskC(i,j,kLev,bi,bj) .NE. 0.)THEN |
IF(maskC(i,j,kLev,bi,bj) .NE. 0.)THEN |
|
#ifdef PH_APPROX |
|
| 109 |
CALL CALC_PCO2_APPROX( |
CALL CALC_PCO2_APPROX( |
| 110 |
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), |
| 111 |
I PTR_CO2(i,j,kLev), surfphos(i,j), |
I PTR_CO2(i,j,kLev), surfphos(i,j), |
| 116 |
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),ff(i,j,bi,bj), |
| 117 |
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), |
| 118 |
U pH(i,j,bi,bj),pCO2(i,j,bi,bj) ) |
U pH(i,j,bi,bj),pCO2(i,j,bi,bj) ) |
|
#else |
|
|
CALL CALC_PCO2(donewt,inewtonmax,ibrackmax, |
|
|
I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj), |
|
|
I PTR_CO2(i,j,kLev), surfphos(i,j), |
|
|
I surfsi(i,j),surfalk(i,j), |
|
|
I ak1(i,j,bi,bj),ak2(i,j,bi,bj), |
|
|
I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj), |
|
|
I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj), |
|
|
I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj), |
|
|
I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj), |
|
|
U pH(i,j,bi,bj),pCO2(i,j,bi,bj) ) |
|
|
#endif |
|
| 119 |
ELSE |
ELSE |
| 120 |
pCO2(i,j,bi,bj)=0. _d 0 |
pCO2(i,j,bi,bj)=0. _d 0 |
| 121 |
END IF |
END IF |
| 122 |
ENDDO |
ENDDO |
| 123 |
ENDDO |
ENDDO |
| 124 |
|
|
| 125 |
DO j=1-OLy,sNy+OLy |
DO j=jmin,jmax |
| 126 |
DO i=1-OLx,sNx+OLx |
DO i=imin,imax |
| 127 |
|
|
| 128 |
IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN |
IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN |
| 129 |
C calculate SCHMIDT NO. for CO2 |
C calculate SCHMIDT NO. for CO2 |
| 140 |
& AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj) |
& AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj) |
| 141 |
c find exchange coefficient |
c find exchange coefficient |
| 142 |
c account for schmidt number and and varible piston velocity |
c account for schmidt number and and varible piston velocity |
| 143 |
|
pisvel(i,j,bi,bj) =0.337*wind(i,j,bi,bj)**2/3.6d5 |
| 144 |
Kwexch(i,j) = |
Kwexch(i,j) = |
| 145 |
& pisvel(i,j,bi,bj) |
& pisvel(i,j,bi,bj) |
| 146 |
& / sqrt(SchmidtNoDIC(i,j)/660.0) |
& / sqrt(SchmidtNoDIC(i,j)/660.0) |
| 147 |
c OR use a constant coeff |
c OR use a constant coeff |
| 148 |
c Kwexch(i,j) = 5e-5 |
c Kwexch(i,j) = 5e-5 |
| 149 |
c ice influence |
c ice influence |
| 150 |
cQQ Kwexch(i,j) =(1.d0-Fice(i,j,bi,bj))*Kwexch(i,j) |
Kwexch(i,j) =(1.d0-Fice(i,j,bi,bj))*Kwexch(i,j) |
| 151 |
|
|
| 152 |
|
|
| 153 |
C Calculate flux in terms of DIC units using K0, solubility |
C Calculate flux in terms of DIC units using K0, solubility |
| 154 |
C Flux = Vp * ([CO2sat] - [CO2]) |
C Flux = Vp * ([CO2sat] - [CO2]) |
| 155 |
C CO2sat = K0*pCO2atmos*P/P0 |
C CO2sat = K0*pCO2atmos*P/P0 |
| 156 |
C Converting pCO2 to [CO2] using ff, as in CALC_PCO2 |
C Converting pCO2 to [CO2] using ff, as in CALC_PCO2 |
| 157 |
FluxCO2(i,j) = |
FluxCO2(i,j,bi,bj) = |
| 158 |
& maskC(i,j,kLev,bi,bj)*Kwexch(i,j)*( |
& maskC(i,j,kLev,bi,bj)*Kwexch(i,j)*( |
| 159 |
& ak0(i,j,bi,bj)*pCO2sat(i,j) - |
& ak0(i,j,bi,bj)*pCO2sat(i,j) - |
| 160 |
& ff(i,j,bi,bj)*pCO2(i,j,bi,bj) |
& ff(i,j,bi,bj)*pCO2(i,j,bi,bj) |
| 161 |
& ) |
& ) |
| 162 |
ELSE |
ELSE |
| 163 |
FluxCO2(i,j) = 0. |
FluxCO2(i,j,bi,bj) = 0. |
| 164 |
ENDIF |
ENDIF |
| 165 |
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) |
| 166 |
FluxCO2(i,j) = FluxCO2(i,j)/permil |
FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil |
| 167 |
|
|
| 168 |
IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN |
IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN |
| 169 |
c calculate virtual flux |
c calculate virtual flux |
| 173 |
C in salinity. Thus, also increase in other surface tracers |
C in salinity. Thus, also increase in other surface tracers |
| 174 |
C (i.e. positive virtual flux into surface layer) |
C (i.e. positive virtual flux into surface layer) |
| 175 |
C ...so here, VirtualFLux = dC/dt! |
C ...so here, VirtualFLux = dC/dt! |
| 176 |
VirtualFlux(i,j)=gsm_DIC*surfaceTendencyS(i,j,bi,bj)/gsm_s |
VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s |
| 177 |
c OR |
c OR |
| 178 |
c let virtual flux be zero |
c let virtual flux be zero |
| 179 |
c VirtualFlux(i,j)=0.d0 |
c VirtualFlux(i,j)=0.d0 |
| 185 |
ENDDO |
ENDDO |
| 186 |
|
|
| 187 |
C update tendency |
C update tendency |
| 188 |
DO j=1-OLy,sNy+OLy |
DO j=jmin,jmax |
| 189 |
DO i=1-OLx,sNx+OLx |
DO i=imin,imax |
| 190 |
GDC(i,j)= maskC(i,j,kLev,bi,bj)*( |
GDC(i,j)= maskC(i,j,kLev,bi,bj)*recip_drF(kLev)* |
| 191 |
& FluxCO2(i,j)*recip_drF(kLev) |
& recip_hFacC(i,j,kLev,bi,bj)*( |
| 192 |
& + VirtualFlux(i,j) |
& FluxCO2(i,j,bi,bj) + VirtualFlux(i,j) |
| 193 |
& ) |
& ) |
| 194 |
ENDDO |
ENDDO |
| 195 |
ENDDO |
ENDDO |
| 196 |
|
|
| 197 |
#endif |
#endif |
|
#endif |
|
| 198 |
RETURN |
RETURN |
| 199 |
END |
END |