/[MITgcm]/MITgcm/pkg/dic/dic_surfforcing.F
ViewVC logotype

Contents of /MITgcm/pkg/dic/dic_surfforcing.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.25 - (show annotations) (download)
Tue Apr 19 21:34:32 2011 UTC (14 years, 2 months ago) by stephd
Branch: MAIN
CVS Tags: checkpoint62w
Changes since 1.24: +16 -2 lines
o add fix to two bugs in handling water vapour pressure in carbonate chemistry
  and air-sea fluxes. Found by Val Bennington and Galen McKinley
  NOTE: tutorial_global_oce_biogeo has these bugs still on

1 C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_surfforcing.F,v 1.24 2010/04/12 20:07:57 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 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 _RL pisvel(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
55 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 #ifdef ALLOW_OLD_VIRTUALFLUX
60 _RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
61 #endif
62 CEOP
63
64 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
65
66 kLev=1
67
68 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
79
80 C =================================================================
81 C determine inorganic carbon chem coefficients
82 DO j=jmin,jmax
83 DO i=imin,imax
84
85 #ifdef DIC_BIOTIC
86 cQQQQ check ptracer numbers
87 surfalk(i,j) = PTR_ALK(i,j,klev)
88 & * maskC(i,j,kLev,bi,bj)
89 surfphos(i,j) = PTR_PO4(i,j,klev)
90 & * maskC(i,j,kLev,bi,bj)
91 #else
92 surfalk(i,j) = 2.366595 _d 0 * salt(i,j,kLev,bi,bj)/gsm_s
93 & * maskC(i,j,kLev,bi,bj)
94 surfphos(i,j) = 5.1225 _d -4 * maskC(i,j,kLev,bi,bj)
95 #endif
96 C FOR NON-INTERACTIVE Si
97 surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj)
98 ENDDO
99 ENDDO
100
101 CALL CARBON_COEFFS(
102 I theta,salt,
103 I bi,bj,iMin,iMax,jMin,jMax,myThid)
104 C====================================================================
105
106 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 c pCO2 solver...
129 C$TAF LOOP = parallel
130 DO j=jmin,jmax
131 C$TAF LOOP = parallel
132 DO i=imin,imax
133
134 IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN
135 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),
143 I ak0(i,j,bi,bj), fugf(i,j,bi,bj),
144 I ff(i,j,bi,bj),
145 I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
146 U pH(i,j,bi,bj),pCO2(i,j,bi,bj),
147 I i,j,kLev,bi,bj,myIter,myThid )
148 ELSE
149 pCO2(i,j,bi,bj)=0. _d 0
150 ENDIF
151 ENDDO
152 ENDDO
153
154 DO j=jmin,jmax
155 DO i=imin,imax
156
157 IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN
158 C calculate SCHMIDT NO. for CO2
159 SchmidtNoDIC(i,j) =
160 & sca1
161 & + sca2 * theta(i,j,kLev,bi,bj)
162 & + sca3 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
163 & + sca4 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
164 & *theta(i,j,kLev,bi,bj)
165
166 C Determine surface flux (FDIC)
167 C first correct pCO2at for surface atmos pressure
168 pCO2sat(i,j) =
169 & AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj)
170
171 C then account for Schmidt number
172 Kwexch(i,j) = Kwexch_Pre(i,j,bi,bj)
173 & / sqrt(SchmidtNoDIC(i,j)/660.0 _d 0)
174
175 #ifdef WATERVAP_BUG
176 C Calculate flux in terms of DIC units using K0, solubility
177 C Flux = Vp * ([CO2sat] - [CO2])
178 C CO2sat = K0*pCO2atmos*P/P0
179 C Converting pCO2 to [CO2] using ff, as in CALC_PCO2
180 FluxCO2(i,j,bi,bj) =
181 & Kwexch(i,j)*(
182 & ak0(i,j,bi,bj)*pCO2sat(i,j) -
183 & ff(i,j,bi,bj)*pCO2(i,j,bi,bj)
184 & )
185 #else
186 C Corrected by Val Bennington Nov 2010 per G.A. McKinley's finding
187 C of error in application of water vapor correction
188 c Flux = kw*rho*(ff*pCO2atm-k0*FugFac*pCO2ocean)
189 FluxCO2(i,j,bi,bj) =
190 & Kwexch(i,j)*(
191 & ff(i,j,bi,bj)*pCO2sat(i,j) -
192 & pCO2(i,j,bi,bj)*fugf(i,j,bi,bj)
193 & *ak0(i,j,bi,bj) )
194 &
195 #endif
196 ELSE
197 FluxCO2(i,j,bi,bj) = 0. _d 0
198 ENDIF
199 C convert flux (mol kg-1 m s-1) to (mol m-2 s-1)
200 FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil
201
202 #ifdef ALLOW_OLD_VIRTUALFLUX
203 IF (maskC(i,j,kLev,bi,bj).NE.0. _d 0) THEN
204 c calculate virtual flux
205 c EminusPforV = dS/dt*(1/Sglob)
206 C NOTE: Be very careful with signs here!
207 C Positive EminusPforV => loss of water to atmos and increase
208 C in salinity. Thus, also increase in other surface tracers
209 C (i.e. positive virtual flux into surface layer)
210 C ...so here, VirtualFLux = dC/dt!
211 VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s
212 c OR
213 c let virtual flux be zero
214 c VirtualFlux(i,j)=0.d0
215 c
216 ELSE
217 VirtualFlux(i,j)=0. _d 0
218 ENDIF
219 #endif /* ALLOW_OLD_VIRTUALFLUX */
220 ENDDO
221 ENDDO
222
223 C update tendency
224 DO j=jmin,jmax
225 DO i=imin,imax
226 GDC(i,j)= recip_drF(kLev)*recip_hFacC(i,j,kLev,bi,bj)
227 & *(FluxCO2(i,j,bi,bj)
228 #ifdef ALLOW_OLD_VIRTUALFLUX
229 & + VirtualFlux(i,j)
230 #endif
231 & )
232 ENDDO
233 ENDDO
234
235 #endif
236 RETURN
237 END

  ViewVC Help
Powered by ViewVC 1.1.22