1 |
dfer |
1.20 |
C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_surfforcing.F,v 1.19 2007/11/05 21:01:37 stephd Exp $ |
2 |
jmc |
1.6 |
C $Name: $ |
3 |
|
|
|
4 |
edhill |
1.4 |
#include "DIC_OPTIONS.h" |
5 |
stephd |
1.1 |
#include "PTRACERS_OPTIONS.h" |
6 |
|
|
#include "GCHEM_OPTIONS.h" |
7 |
|
|
|
8 |
stephd |
1.5 |
CBOP |
9 |
|
|
C !ROUTINE: DIC_SURFFORCING |
10 |
|
|
|
11 |
|
|
C !INTERFACE: ========================================================== |
12 |
stephd |
1.12 |
SUBROUTINE DIC_SURFFORCING( PTR_CO2 , PTR_ALK, PTR_PO4, GDC, |
13 |
stephd |
1.1 |
I bi,bj,imin,imax,jmin,jmax, |
14 |
|
|
I myIter,myTime,myThid) |
15 |
|
|
|
16 |
stephd |
1.5 |
C !DESCRIPTION: |
17 |
|
|
C Calculate the carbon air-sea flux terms |
18 |
|
|
C following external_forcing_dic.F (OCMIP run) from Mick |
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 "FFIELDS.h" |
28 |
dfer |
1.20 |
#include "DIC_VARS.h" |
29 |
stephd |
1.1 |
|
30 |
stephd |
1.5 |
C !INPUT PARAMETERS: =================================================== |
31 |
|
|
C myThid :: thread number |
32 |
|
|
C myIter :: current timestep |
33 |
|
|
C myTime :: current time |
34 |
|
|
c PTR_CO2 :: DIC tracer field |
35 |
stephd |
1.1 |
INTEGER myIter, myThid |
36 |
|
|
_RL myTime |
37 |
|
|
_RL PTR_CO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
38 |
stephd |
1.12 |
_RL PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
39 |
|
|
_RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
40 |
stephd |
1.5 |
INTEGER iMin,iMax,jMin,jMax, bi, bj |
41 |
|
|
|
42 |
|
|
C !OUTPUT PARAMETERS: =================================================== |
43 |
stephd |
1.8 |
c GDC :: tendency due to air-sea exchange |
44 |
stephd |
1.1 |
_RL GDC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
45 |
|
|
|
46 |
|
|
#ifdef ALLOW_PTRACERS |
47 |
stephd |
1.5 |
|
48 |
|
|
C !LOCAL VARIABLES: ==================================================== |
49 |
stephd |
1.2 |
INTEGER I,J, kLev, it |
50 |
stephd |
1.1 |
C Number of iterations for pCO2 solvers... |
51 |
|
|
C Solubility relation coefficients |
52 |
|
|
_RL SchmidtNoDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
53 |
|
|
_RL pCO2sat(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
54 |
|
|
_RL Kwexch(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
55 |
dfer |
1.17 |
_RL pisvel(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
56 |
stephd |
1.1 |
C local variables for carbon chem |
57 |
|
|
_RL surfalk(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
58 |
|
|
_RL surfphos(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
59 |
|
|
_RL surfsi(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
60 |
dfer |
1.16 |
#ifdef ALLOW_OLD_VIRTUALFLUX |
61 |
stephd |
1.1 |
_RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
62 |
dfer |
1.16 |
#endif |
63 |
stephd |
1.5 |
CEOP |
64 |
stephd |
1.1 |
|
65 |
|
|
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
66 |
|
|
|
67 |
|
|
kLev=1 |
68 |
|
|
|
69 |
stephd |
1.19 |
cc if coupled to atmsopheric model, use the |
70 |
|
|
cc Co2 value passed from the coupler |
71 |
|
|
c#ifndef USE_ATMOSCO2 |
72 |
|
|
cC PRE-INDUSTRIAL STEADY STATE pCO2 = 278.0 ppmv |
73 |
|
|
c DO j=1-OLy,sNy+OLy |
74 |
|
|
c DO i=1-OLx,sNx+OLx |
75 |
|
|
c AtmospCO2(i,j,bi,bj)=278.0 _d -6 |
76 |
|
|
c ENDDO |
77 |
|
|
c ENDDO |
78 |
|
|
c#endif |
79 |
stephd |
1.1 |
|
80 |
|
|
|
81 |
|
|
C ================================================================= |
82 |
|
|
C determine inorganic carbon chem coefficients |
83 |
stephd |
1.10 |
DO j=jmin,jmax |
84 |
|
|
DO i=imin,imax |
85 |
stephd |
1.1 |
|
86 |
|
|
#ifdef DIC_BIOTIC |
87 |
|
|
cQQQQ check ptracer numbers |
88 |
stephd |
1.12 |
surfalk(i,j) = PTR_ALK(i,j,klev) |
89 |
stephd |
1.1 |
& * maskC(i,j,kLev,bi,bj) |
90 |
stephd |
1.12 |
surfphos(i,j) = PTR_PO4(i,j,klev) |
91 |
stephd |
1.1 |
& * maskC(i,j,kLev,bi,bj) |
92 |
|
|
#else |
93 |
dfer |
1.15 |
surfalk(i,j) = 2.366595 _d 0 * salt(i,j,kLev,bi,bj)/gsm_s |
94 |
stephd |
1.1 |
& * maskC(i,j,kLev,bi,bj) |
95 |
dfer |
1.15 |
surfphos(i,j) = 5.1225 _d -4 * maskC(i,j,kLev,bi,bj) |
96 |
stephd |
1.1 |
#endif |
97 |
|
|
C FOR NON-INTERACTIVE Si |
98 |
stephd |
1.3 |
surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj) |
99 |
stephd |
1.1 |
ENDDO |
100 |
|
|
ENDDO |
101 |
|
|
|
102 |
|
|
CALL CARBON_COEFFS( |
103 |
|
|
I theta,salt, |
104 |
|
|
I bi,bj,iMin,iMax,jMin,jMax) |
105 |
|
|
C==================================================================== |
106 |
|
|
|
107 |
dfer |
1.17 |
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 |
stephd |
1.1 |
c pCO2 solver... |
130 |
stephd |
1.3 |
C$TAF LOOP = parallel |
131 |
stephd |
1.10 |
DO j=jmin,jmax |
132 |
stephd |
1.3 |
C$TAF LOOP = parallel |
133 |
stephd |
1.10 |
DO i=imin,imax |
134 |
stephd |
1.1 |
|
135 |
dfer |
1.18 |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
136 |
stephd |
1.1 |
CALL CALC_PCO2_APPROX( |
137 |
|
|
I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj), |
138 |
|
|
I PTR_CO2(i,j,kLev), surfphos(i,j), |
139 |
|
|
I surfsi(i,j),surfalk(i,j), |
140 |
|
|
I ak1(i,j,bi,bj),ak2(i,j,bi,bj), |
141 |
|
|
I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj), |
142 |
|
|
I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj), |
143 |
|
|
I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj), |
144 |
|
|
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) ) |
146 |
|
|
ELSE |
147 |
dfer |
1.18 |
pCO2(i,j,bi,bj)=0. _d 0 |
148 |
|
|
ENDIF |
149 |
stephd |
1.1 |
ENDDO |
150 |
|
|
ENDDO |
151 |
|
|
|
152 |
stephd |
1.10 |
DO j=jmin,jmax |
153 |
|
|
DO i=imin,imax |
154 |
stephd |
1.1 |
|
155 |
dfer |
1.18 |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
156 |
stephd |
1.1 |
C calculate SCHMIDT NO. for CO2 |
157 |
|
|
SchmidtNoDIC(i,j) = |
158 |
|
|
& sca1 |
159 |
|
|
& + sca2 * theta(i,j,kLev,bi,bj) |
160 |
|
|
& + sca3 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj) |
161 |
|
|
& + sca4 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj) |
162 |
|
|
& *theta(i,j,kLev,bi,bj) |
163 |
|
|
|
164 |
|
|
C Determine surface flux (FDIC) |
165 |
|
|
C first correct pCO2at for surface atmos pressure |
166 |
|
|
pCO2sat(i,j) = |
167 |
|
|
& AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj) |
168 |
|
|
|
169 |
dfer |
1.17 |
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 |
stephd |
1.1 |
|
173 |
|
|
C Calculate flux in terms of DIC units using K0, solubility |
174 |
|
|
C Flux = Vp * ([CO2sat] - [CO2]) |
175 |
|
|
C CO2sat = K0*pCO2atmos*P/P0 |
176 |
|
|
C Converting pCO2 to [CO2] using ff, as in CALC_PCO2 |
177 |
stephd |
1.2 |
FluxCO2(i,j,bi,bj) = |
178 |
dfer |
1.17 |
& Kwexch(i,j)*( |
179 |
stephd |
1.1 |
& ak0(i,j,bi,bj)*pCO2sat(i,j) - |
180 |
|
|
& ff(i,j,bi,bj)*pCO2(i,j,bi,bj) |
181 |
|
|
& ) |
182 |
dfer |
1.18 |
ELSE |
183 |
|
|
FluxCO2(i,j,bi,bj) = 0. _d 0 |
184 |
|
|
ENDIF |
185 |
stephd |
1.1 |
C convert flux (mol kg-1 m s-1) to (mol m-2 s-1) |
186 |
stephd |
1.2 |
FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil |
187 |
stephd |
1.1 |
|
188 |
dfer |
1.16 |
#ifdef ALLOW_OLD_VIRTUALFLUX |
189 |
dfer |
1.18 |
IF (maskC(i,j,kLev,bi,bj).NE.0. _d 0) THEN |
190 |
stephd |
1.1 |
c calculate virtual flux |
191 |
|
|
c EminusPforV = dS/dt*(1/Sglob) |
192 |
|
|
C NOTE: Be very careful with signs here! |
193 |
|
|
C Positive EminusPforV => loss of water to atmos and increase |
194 |
|
|
C in salinity. Thus, also increase in other surface tracers |
195 |
|
|
C (i.e. positive virtual flux into surface layer) |
196 |
|
|
C ...so here, VirtualFLux = dC/dt! |
197 |
jmc |
1.7 |
VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s |
198 |
stephd |
1.1 |
c OR |
199 |
|
|
c let virtual flux be zero |
200 |
|
|
c VirtualFlux(i,j)=0.d0 |
201 |
|
|
c |
202 |
|
|
ELSE |
203 |
|
|
VirtualFlux(i,j)=0. _d 0 |
204 |
|
|
ENDIF |
205 |
dfer |
1.16 |
#endif /* ALLOW_OLD_VIRTUALFLUX */ |
206 |
stephd |
1.1 |
ENDDO |
207 |
|
|
ENDDO |
208 |
|
|
|
209 |
|
|
C update tendency |
210 |
stephd |
1.10 |
DO j=jmin,jmax |
211 |
|
|
DO i=imin,imax |
212 |
dfer |
1.17 |
GDC(i,j)= recip_drF(kLev)*recip_hFacC(i,j,kLev,bi,bj) |
213 |
|
|
& *(FluxCO2(i,j,bi,bj) |
214 |
dfer |
1.16 |
#ifdef ALLOW_OLD_VIRTUALFLUX |
215 |
dfer |
1.17 |
& + VirtualFlux(i,j) |
216 |
dfer |
1.16 |
#endif |
217 |
dfer |
1.17 |
& ) |
218 |
stephd |
1.1 |
ENDDO |
219 |
|
|
ENDDO |
220 |
|
|
|
221 |
|
|
#endif |
222 |
|
|
RETURN |
223 |
|
|
END |