1 |
dfer |
1.21 |
C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_surfforcing.F,v 1.20 2008/04/04 21:37:06 dfer 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 |
|
|
|
7 |
stephd |
1.5 |
CBOP |
8 |
|
|
C !ROUTINE: DIC_SURFFORCING |
9 |
|
|
|
10 |
|
|
C !INTERFACE: ========================================================== |
11 |
stephd |
1.12 |
SUBROUTINE DIC_SURFFORCING( PTR_CO2 , PTR_ALK, PTR_PO4, GDC, |
12 |
stephd |
1.1 |
I bi,bj,imin,imax,jmin,jmax, |
13 |
|
|
I myIter,myTime,myThid) |
14 |
|
|
|
15 |
stephd |
1.5 |
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 |
stephd |
1.1 |
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 |
dfer |
1.20 |
#include "DIC_VARS.h" |
28 |
stephd |
1.1 |
|
29 |
stephd |
1.5 |
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 |
stephd |
1.1 |
INTEGER myIter, myThid |
35 |
|
|
_RL myTime |
36 |
|
|
_RL PTR_CO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
37 |
stephd |
1.12 |
_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 |
stephd |
1.5 |
INTEGER iMin,iMax,jMin,jMax, bi, bj |
40 |
|
|
|
41 |
|
|
C !OUTPUT PARAMETERS: =================================================== |
42 |
stephd |
1.8 |
c GDC :: tendency due to air-sea exchange |
43 |
stephd |
1.1 |
_RL GDC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
44 |
|
|
|
45 |
|
|
#ifdef ALLOW_PTRACERS |
46 |
stephd |
1.5 |
|
47 |
|
|
C !LOCAL VARIABLES: ==================================================== |
48 |
stephd |
1.2 |
INTEGER I,J, kLev, it |
49 |
stephd |
1.1 |
C Number of iterations for pCO2 solvers... |
50 |
|
|
C Solubility relation coefficients |
51 |
|
|
_RL SchmidtNoDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
52 |
|
|
_RL pCO2sat(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
53 |
|
|
_RL Kwexch(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
54 |
dfer |
1.17 |
_RL pisvel(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
55 |
stephd |
1.1 |
C local variables for carbon chem |
56 |
|
|
_RL surfalk(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
57 |
|
|
_RL surfphos(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
58 |
|
|
_RL surfsi(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
59 |
dfer |
1.16 |
#ifdef ALLOW_OLD_VIRTUALFLUX |
60 |
stephd |
1.1 |
_RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
61 |
dfer |
1.16 |
#endif |
62 |
stephd |
1.5 |
CEOP |
63 |
stephd |
1.1 |
|
64 |
|
|
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
65 |
|
|
|
66 |
|
|
kLev=1 |
67 |
|
|
|
68 |
stephd |
1.19 |
cc if coupled to atmsopheric model, use the |
69 |
|
|
cc Co2 value passed from the coupler |
70 |
|
|
c#ifndef USE_ATMOSCO2 |
71 |
|
|
cC PRE-INDUSTRIAL STEADY STATE pCO2 = 278.0 ppmv |
72 |
|
|
c DO j=1-OLy,sNy+OLy |
73 |
|
|
c DO i=1-OLx,sNx+OLx |
74 |
|
|
c AtmospCO2(i,j,bi,bj)=278.0 _d -6 |
75 |
|
|
c ENDDO |
76 |
|
|
c ENDDO |
77 |
|
|
c#endif |
78 |
stephd |
1.1 |
|
79 |
|
|
|
80 |
|
|
C ================================================================= |
81 |
|
|
C determine inorganic carbon chem coefficients |
82 |
stephd |
1.10 |
DO j=jmin,jmax |
83 |
|
|
DO i=imin,imax |
84 |
stephd |
1.1 |
|
85 |
|
|
#ifdef DIC_BIOTIC |
86 |
|
|
cQQQQ check ptracer numbers |
87 |
stephd |
1.12 |
surfalk(i,j) = PTR_ALK(i,j,klev) |
88 |
stephd |
1.1 |
& * maskC(i,j,kLev,bi,bj) |
89 |
stephd |
1.12 |
surfphos(i,j) = PTR_PO4(i,j,klev) |
90 |
stephd |
1.1 |
& * maskC(i,j,kLev,bi,bj) |
91 |
|
|
#else |
92 |
dfer |
1.15 |
surfalk(i,j) = 2.366595 _d 0 * salt(i,j,kLev,bi,bj)/gsm_s |
93 |
stephd |
1.1 |
& * maskC(i,j,kLev,bi,bj) |
94 |
dfer |
1.15 |
surfphos(i,j) = 5.1225 _d -4 * maskC(i,j,kLev,bi,bj) |
95 |
stephd |
1.1 |
#endif |
96 |
|
|
C FOR NON-INTERACTIVE Si |
97 |
stephd |
1.3 |
surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj) |
98 |
stephd |
1.1 |
ENDDO |
99 |
|
|
ENDDO |
100 |
|
|
|
101 |
|
|
CALL CARBON_COEFFS( |
102 |
|
|
I theta,salt, |
103 |
|
|
I bi,bj,iMin,iMax,jMin,jMax) |
104 |
|
|
C==================================================================== |
105 |
|
|
|
106 |
dfer |
1.17 |
DO j=jmin,jmax |
107 |
|
|
DO i=imin,imax |
108 |
|
|
C Compute AtmosP and Kwexch_Pre which are re-used for flux of O2 |
109 |
|
|
|
110 |
|
|
#ifdef USE_PLOAD |
111 |
|
|
C Convert anomalous pressure pLoad (in Pa) from atmospheric model |
112 |
|
|
C to total pressure (in Atm) |
113 |
|
|
C Note: it is assumed the reference atmospheric pressure is 1Atm=1013mb |
114 |
|
|
C rather than the actual ref. pressure from Atm. model so that on |
115 |
|
|
C average AtmosP is about 1 Atm. |
116 |
|
|
AtmosP(i,j,bi,bj)= 1. _d 0 + pLoad(i,j,bi,bj)/Pa2Atm |
117 |
|
|
#endif |
118 |
|
|
|
119 |
|
|
C Pre-compute part of exchange coefficient: pisvel*(1-fice) |
120 |
|
|
C Schmidt number is accounted for later |
121 |
|
|
pisvel(i,j)=0.337 _d 0 *wind(i,j,bi,bj)**2/3.6 _d 5 |
122 |
|
|
Kwexch_Pre(i,j,bi,bj) = pisvel(i,j) |
123 |
|
|
& * (1. _d 0 - FIce(i,j,bi,bj)) |
124 |
|
|
|
125 |
|
|
ENDDO |
126 |
|
|
ENDDO |
127 |
|
|
|
128 |
stephd |
1.1 |
c pCO2 solver... |
129 |
stephd |
1.3 |
C$TAF LOOP = parallel |
130 |
stephd |
1.10 |
DO j=jmin,jmax |
131 |
stephd |
1.3 |
C$TAF LOOP = parallel |
132 |
stephd |
1.10 |
DO i=imin,imax |
133 |
stephd |
1.1 |
|
134 |
dfer |
1.18 |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
135 |
stephd |
1.1 |
CALL CALC_PCO2_APPROX( |
136 |
|
|
I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj), |
137 |
|
|
I PTR_CO2(i,j,kLev), surfphos(i,j), |
138 |
|
|
I surfsi(i,j),surfalk(i,j), |
139 |
|
|
I ak1(i,j,bi,bj),ak2(i,j,bi,bj), |
140 |
|
|
I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj), |
141 |
|
|
I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj), |
142 |
|
|
I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj), |
143 |
|
|
I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj), |
144 |
|
|
U pH(i,j,bi,bj),pCO2(i,j,bi,bj) ) |
145 |
|
|
ELSE |
146 |
dfer |
1.18 |
pCO2(i,j,bi,bj)=0. _d 0 |
147 |
|
|
ENDIF |
148 |
stephd |
1.1 |
ENDDO |
149 |
|
|
ENDDO |
150 |
|
|
|
151 |
stephd |
1.10 |
DO j=jmin,jmax |
152 |
|
|
DO i=imin,imax |
153 |
stephd |
1.1 |
|
154 |
dfer |
1.18 |
IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN |
155 |
stephd |
1.1 |
C calculate SCHMIDT NO. for CO2 |
156 |
|
|
SchmidtNoDIC(i,j) = |
157 |
|
|
& sca1 |
158 |
|
|
& + sca2 * theta(i,j,kLev,bi,bj) |
159 |
|
|
& + sca3 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj) |
160 |
|
|
& + sca4 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj) |
161 |
|
|
& *theta(i,j,kLev,bi,bj) |
162 |
|
|
|
163 |
|
|
C Determine surface flux (FDIC) |
164 |
|
|
C first correct pCO2at for surface atmos pressure |
165 |
|
|
pCO2sat(i,j) = |
166 |
|
|
& AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj) |
167 |
|
|
|
168 |
dfer |
1.17 |
C then account for Schmidt number |
169 |
|
|
Kwexch(i,j) = Kwexch_Pre(i,j,bi,bj) |
170 |
|
|
& / sqrt(SchmidtNoDIC(i,j)/660.0 _d 0) |
171 |
stephd |
1.1 |
|
172 |
|
|
C Calculate flux in terms of DIC units using K0, solubility |
173 |
|
|
C Flux = Vp * ([CO2sat] - [CO2]) |
174 |
|
|
C CO2sat = K0*pCO2atmos*P/P0 |
175 |
|
|
C Converting pCO2 to [CO2] using ff, as in CALC_PCO2 |
176 |
stephd |
1.2 |
FluxCO2(i,j,bi,bj) = |
177 |
dfer |
1.17 |
& Kwexch(i,j)*( |
178 |
stephd |
1.1 |
& ak0(i,j,bi,bj)*pCO2sat(i,j) - |
179 |
|
|
& ff(i,j,bi,bj)*pCO2(i,j,bi,bj) |
180 |
|
|
& ) |
181 |
dfer |
1.18 |
ELSE |
182 |
|
|
FluxCO2(i,j,bi,bj) = 0. _d 0 |
183 |
|
|
ENDIF |
184 |
stephd |
1.1 |
C convert flux (mol kg-1 m s-1) to (mol m-2 s-1) |
185 |
stephd |
1.2 |
FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil |
186 |
stephd |
1.1 |
|
187 |
dfer |
1.16 |
#ifdef ALLOW_OLD_VIRTUALFLUX |
188 |
dfer |
1.18 |
IF (maskC(i,j,kLev,bi,bj).NE.0. _d 0) THEN |
189 |
stephd |
1.1 |
c calculate virtual flux |
190 |
|
|
c EminusPforV = dS/dt*(1/Sglob) |
191 |
|
|
C NOTE: Be very careful with signs here! |
192 |
|
|
C Positive EminusPforV => loss of water to atmos and increase |
193 |
|
|
C in salinity. Thus, also increase in other surface tracers |
194 |
|
|
C (i.e. positive virtual flux into surface layer) |
195 |
|
|
C ...so here, VirtualFLux = dC/dt! |
196 |
jmc |
1.7 |
VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s |
197 |
stephd |
1.1 |
c OR |
198 |
|
|
c let virtual flux be zero |
199 |
|
|
c VirtualFlux(i,j)=0.d0 |
200 |
|
|
c |
201 |
|
|
ELSE |
202 |
|
|
VirtualFlux(i,j)=0. _d 0 |
203 |
|
|
ENDIF |
204 |
dfer |
1.16 |
#endif /* ALLOW_OLD_VIRTUALFLUX */ |
205 |
stephd |
1.1 |
ENDDO |
206 |
|
|
ENDDO |
207 |
|
|
|
208 |
|
|
C update tendency |
209 |
stephd |
1.10 |
DO j=jmin,jmax |
210 |
|
|
DO i=imin,imax |
211 |
dfer |
1.17 |
GDC(i,j)= recip_drF(kLev)*recip_hFacC(i,j,kLev,bi,bj) |
212 |
|
|
& *(FluxCO2(i,j,bi,bj) |
213 |
dfer |
1.16 |
#ifdef ALLOW_OLD_VIRTUALFLUX |
214 |
dfer |
1.17 |
& + VirtualFlux(i,j) |
215 |
dfer |
1.16 |
#endif |
216 |
dfer |
1.17 |
& ) |
217 |
stephd |
1.1 |
ENDDO |
218 |
|
|
ENDDO |
219 |
|
|
|
220 |
|
|
#endif |
221 |
|
|
RETURN |
222 |
|
|
END |