1 |
C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_surfforcing.F,v 1.28 2011/06/24 01:35:32 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "DIC_OPTIONS.h" |
5 |
#include "PTRACERS_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: DIC_SURFFORCING |
9 |
|
10 |
C !INTERFACE: ========================================================== |
11 |
SUBROUTINE DIC_SURFFORCING( PTR_CO2 , PTR_ALK, PTR_PO4, GDC, |
12 |
I bi,bj,imin,imax,jmin,jmax, |
13 |
I myIter,myTime,myThid) |
14 |
|
15 |
C !DESCRIPTION: |
16 |
C Calculate the carbon air-sea flux terms |
17 |
C following external_forcing_dic.F (OCMIP run) from Mick |
18 |
|
19 |
C !USES: =============================================================== |
20 |
IMPLICIT NONE |
21 |
#include "SIZE.h" |
22 |
#include "DYNVARS.h" |
23 |
#include "EEPARAMS.h" |
24 |
#include "PARAMS.h" |
25 |
#include "GRID.h" |
26 |
#include "FFIELDS.h" |
27 |
#include "DIC_VARS.h" |
28 |
|
29 |
C !INPUT PARAMETERS: =================================================== |
30 |
C myThid :: thread number |
31 |
C myIter :: current timestep |
32 |
C myTime :: current time |
33 |
c PTR_CO2 :: DIC tracer field |
34 |
INTEGER myIter, myThid |
35 |
_RL myTime |
36 |
_RL PTR_CO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
37 |
_RL PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
38 |
_RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
39 |
INTEGER iMin,iMax,jMin,jMax, bi, bj |
40 |
|
41 |
C !OUTPUT PARAMETERS: =================================================== |
42 |
c GDC :: tendency due to air-sea exchange |
43 |
_RL GDC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
44 |
|
45 |
#ifdef ALLOW_PTRACERS |
46 |
|
47 |
C !LOCAL VARIABLES: ==================================================== |
48 |
INTEGER i,j, kLev |
49 |
_RL co3dummy |
50 |
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 |
_RL pisvel(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
56 |
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 |
_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) |
65 |
#endif |
66 |
CEOP |
67 |
|
68 |
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
69 |
|
70 |
kLev=1 |
71 |
|
72 |
cc if coupled to atmsopheric model, use the |
73 |
cc Co2 value passed from the coupler |
74 |
c#ifndef USE_ATMOSCO2 |
75 |
cC PRE-INDUSTRIAL STEADY STATE pCO2 = 278.0 ppmv |
76 |
c DO j=1-OLy,sNy+OLy |
77 |
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 ================================================================= |
85 |
C determine inorganic carbon chem coefficients |
86 |
DO j=jmin,jmax |
87 |
DO i=imin,imax |
88 |
|
89 |
#ifdef DIC_BIOTIC |
90 |
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) |
100 |
& * maskC(i,j,kLev,bi,bj) |
101 |
surfphos(i,j) = PTR_PO4(i,j,klev) |
102 |
& * maskC(i,j,kLev,bi,bj) |
103 |
#endif |
104 |
#else |
105 |
surfalk(i,j) = 2.366595 _d 0 * salt(i,j,kLev,bi,bj)/gsm_s |
106 |
& * maskC(i,j,kLev,bi,bj) |
107 |
surfphos(i,j) = 5.1225 _d -4 * maskC(i,j,kLev,bi,bj) |
108 |
#endif |
109 |
C FOR NON-INTERACTIVE Si |
110 |
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 |
124 |
ENDDO |
125 |
|
126 |
CALL CARBON_COEFFS( |
127 |
I surftemp,surfsalt, |
128 |
I bi,bj,iMin,iMax,jMin,jMax,myThid) |
129 |
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... |
154 |
C$TAF LOOP = parallel |
155 |
DO j=jmin,jmax |
156 |
C$TAF LOOP = parallel |
157 |
DO i=imin,imax |
158 |
|
159 |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
160 |
CALL CALC_PCO2_APPROX( |
161 |
I surftemp(i,j),surfsalt(i,j), |
162 |
I surfdic(i,j), surfphos(i,j), |
163 |
I surfsi(i,j),surfalk(i,j), |
164 |
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), |
166 |
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), |
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), |
171 |
U pH(i,j,bi,bj),pCO2(i,j,bi,bj),co3dummy, |
172 |
I i,j,kLev,bi,bj,myIter,myThid ) |
173 |
ELSE |
174 |
pCO2(i,j,bi,bj)=0. _d 0 |
175 |
ENDIF |
176 |
ENDDO |
177 |
ENDDO |
178 |
|
179 |
DO j=jmin,jmax |
180 |
DO i=imin,imax |
181 |
|
182 |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
183 |
C calculate SCHMIDT NO. for CO2 |
184 |
SchmidtNoDIC(i,j) = |
185 |
& sca1 |
186 |
& + sca2 * theta(i,j,kLev,bi,bj) |
187 |
& + 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) |
189 |
& *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) |
194 |
C first correct pCO2at for surface atmos pressure |
195 |
pCO2sat(i,j) = |
196 |
& AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj) |
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 |
204 |
C Flux = Vp * ([CO2sat] - [CO2]) |
205 |
C CO2sat = K0*pCO2atmos*P/P0 |
206 |
C Converting pCO2 to [CO2] using ff, as in CALC_PCO2 |
207 |
FluxCO2(i,j,bi,bj) = |
208 |
& Kwexch(i,j)*( |
209 |
& ak0(i,j,bi,bj)*pCO2sat(i,j) - |
210 |
& ff(i,j,bi,bj)*pCO2(i,j,bi,bj) |
211 |
& ) |
212 |
#else |
213 |
C Corrected by Val Bennington Nov 2010 per G.A. McKinley s finding |
214 |
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) |
227 |
FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil |
228 |
|
229 |
#ifdef ALLOW_OLD_VIRTUALFLUX |
230 |
IF (maskC(i,j,kLev,bi,bj).NE.0. _d 0) THEN |
231 |
c calculate virtual flux |
232 |
c EminusPforV = dS/dt*(1/Sglob) |
233 |
C NOTE: Be very careful with signs here! |
234 |
C Positive EminusPforV => loss of water to atmos and increase |
235 |
C in salinity. Thus, also increase in other surface tracers |
236 |
C (i.e. positive virtual flux into surface layer) |
237 |
C ...so here, VirtualFLux = dC/dt! |
238 |
VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s |
239 |
c OR |
240 |
c let virtual flux be zero |
241 |
c VirtualFlux(i,j)=0.d0 |
242 |
c |
243 |
ELSE |
244 |
VirtualFlux(i,j)=0. _d 0 |
245 |
ENDIF |
246 |
#endif /* ALLOW_OLD_VIRTUALFLUX */ |
247 |
ENDDO |
248 |
ENDDO |
249 |
|
250 |
C update tendency |
251 |
DO j=jmin,jmax |
252 |
DO i=imin,imax |
253 |
GDC(i,j)= recip_drF(kLev)*recip_hFacC(i,j,kLev,bi,bj) |
254 |
& *(FluxCO2(i,j,bi,bj) |
255 |
#ifdef ALLOW_OLD_VIRTUALFLUX |
256 |
& + VirtualFlux(i,j) |
257 |
#endif |
258 |
& ) |
259 |
ENDDO |
260 |
ENDDO |
261 |
|
262 |
#endif |
263 |
RETURN |
264 |
END |