/[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.30 - (show annotations) (download)
Sun Jan 11 20:02:41 2015 UTC (9 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, HEAD
Changes since 1.29: +18 -19 lines
fix typo to allow to compile with DIC_BOUNDS defined (thanks to Samar Khatiwala)

1 C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_surfforcing.F,v 1.29 2011/10/07 21:36:39 dfer 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 C =================================================================
84 C determine inorganic carbon chem coefficients
85 DO j=jMin,jMax
86 DO i=iMin,iMax
87
88 #ifdef DIC_BIOTIC
89 cQQQQ check ptracer numbers
90 #ifdef DIC_BOUNDS
91 surfalk(i,j) = max(0.4 _d 0,
92 & min(10. _d 0,PTR_ALK(i,j,klev)))
93 & * maskC(i,j,kLev,bi,bj)
94 surfphos(i,j) = max(1.0 _d -11,
95 & min(1. _d -1,PTR_PO4(i,j,klev)))
96 & * maskC(i,j,kLev,bi,bj)
97 #else
98 surfalk(i,j) = PTR_ALK(i,j,klev)
99 & * maskC(i,j,kLev,bi,bj)
100 surfphos(i,j) = PTR_PO4(i,j,klev)
101 & * maskC(i,j,kLev,bi,bj)
102 #endif
103 #else
104 surfalk(i,j) = 2.366595 _d 0 * salt(i,j,kLev,bi,bj)/gsm_s
105 & * maskC(i,j,kLev,bi,bj)
106 surfphos(i,j) = 5.1225 _d -4 * maskC(i,j,kLev,bi,bj)
107 #endif
108 C FOR NON-INTERACTIVE Si
109 surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj)
110 #ifdef DIC_BOUNDS
111 surftemp(i,j) = max(-4. _d 0,
112 & min(50. _d 0, theta(i,j,kLev,bi,bj)))
113 surfsalt(i,j) = max(4. _d 0,
114 & min(50. _d 0, salt(i,j,kLev,bi,bj)))
115 surfdic(i,j) = max(0.4 _d 0,
116 & min(10. _d 0, PTR_CO2(i,j,kLev)))
117 #else
118 surftemp(i,j) = theta(i,j,kLev,bi,bj)
119 surfsalt(i,j) = salt(i,j,kLev,bi,bj)
120 surfdic(i,j) = PTR_CO2(i,j,kLev)
121 #endif
122 ENDDO
123 ENDDO
124
125 CALL CARBON_COEFFS(
126 I surftemp,surfsalt,
127 I bi,bj,iMin,iMax,jMin,jMax,myThid)
128 C====================================================================
129
130 DO j=jMin,jMax
131 DO i=iMin,iMax
132 C Compute AtmosP and Kwexch_Pre which are re-used for flux of O2
133
134 #ifdef USE_PLOAD
135 C Convert anomalous pressure pLoad (in Pa) from atmospheric model
136 C to total pressure (in Atm)
137 C Note: it is assumed the reference atmospheric pressure is 1Atm=1013mb
138 C rather than the actual ref. pressure from Atm. model so that on
139 C average AtmosP is about 1 Atm.
140 AtmosP(i,j,bi,bj)= 1. _d 0 + pLoad(i,j,bi,bj)/Pa2Atm
141 #endif
142
143 C Pre-compute part of exchange coefficient: pisvel*(1-fice)
144 C Schmidt number is accounted for later
145 pisvel(i,j)=0.337 _d 0 *wind(i,j,bi,bj)**2/3.6 _d 5
146 Kwexch_Pre(i,j,bi,bj) = pisvel(i,j)
147 & * (1. _d 0 - FIce(i,j,bi,bj))
148
149 ENDDO
150 ENDDO
151
152 c pCO2 solver...
153 C$TAF LOOP = parallel
154 DO j=jMin,jMax
155 C$TAF LOOP = parallel
156 DO i=iMin,iMax
157
158 IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN
159 CALL CALC_PCO2_APPROX(
160 I surftemp(i,j),surfsalt(i,j),
161 I surfdic(i,j), surfphos(i,j),
162 I surfsi(i,j),surfalk(i,j),
163 I ak1(i,j,bi,bj),ak2(i,j,bi,bj),
164 I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj),
165 I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj),
166 I aksi(i,j,bi,bj),akf(i,j,bi,bj),
167 I ak0(i,j,bi,bj), fugf(i,j,bi,bj),
168 I ff(i,j,bi,bj),
169 I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
170 U pH(i,j,bi,bj),pCO2(i,j,bi,bj),co3dummy,
171 I i,j,kLev,bi,bj,myIter,myThid )
172 ELSE
173 pCO2(i,j,bi,bj)=0. _d 0
174 ENDIF
175 ENDDO
176 ENDDO
177
178 DO j=jMin,jMax
179 DO i=iMin,iMax
180
181 IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN
182 C calculate SCHMIDT NO. for CO2
183 SchmidtNoDIC(i,j) =
184 & sca1
185 & + sca2 * theta(i,j,kLev,bi,bj)
186 & + sca3 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
187 & + sca4 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
188 & *theta(i,j,kLev,bi,bj)
189 c make sure Schmidt number is not negative (will happen if temp>39C)
190 SchmidtNoDIC(i,j)=max(1.0 _d -2, SchmidtNoDIC(i,j))
191
192 C Determine surface flux (FDIC)
193 C first correct pCO2at for surface atmos pressure
194 pCO2sat(i,j) =
195 & AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj)
196
197 C then account for Schmidt number
198 Kwexch(i,j) = Kwexch_Pre(i,j,bi,bj)
199 & / sqrt(SchmidtNoDIC(i,j)/660.0 _d 0)
200
201 #ifdef WATERVAP_BUG
202 C Calculate flux in terms of DIC units using K0, solubility
203 C Flux = Vp * ([CO2sat] - [CO2])
204 C CO2sat = K0*pCO2atmos*P/P0
205 C Converting pCO2 to [CO2] using ff, as in CALC_PCO2
206 FluxCO2(i,j,bi,bj) =
207 & Kwexch(i,j)*(
208 & ak0(i,j,bi,bj)*pCO2sat(i,j) -
209 & ff(i,j,bi,bj)*pCO2(i,j,bi,bj)
210 & )
211 #else
212 C Corrected by Val Bennington Nov 2010 per G.A. McKinley s finding
213 C of error in application of water vapor correction
214 c Flux = kw*rho*(ff*pCO2atm-k0*FugFac*pCO2ocean)
215 FluxCO2(i,j,bi,bj) =
216 & Kwexch(i,j)*(
217 & ff(i,j,bi,bj)*pCO2sat(i,j) -
218 & pCO2(i,j,bi,bj)*fugf(i,j,bi,bj)
219 & *ak0(i,j,bi,bj) )
220 &
221 #endif
222 ELSE
223 FluxCO2(i,j,bi,bj) = 0. _d 0
224 ENDIF
225 C convert flux (mol kg-1 m s-1) to (mol m-2 s-1)
226 FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil
227
228 #ifdef ALLOW_OLD_VIRTUALFLUX
229 IF (maskC(i,j,kLev,bi,bj).NE.0. _d 0) THEN
230 c calculate virtual flux
231 c EminusPforV = dS/dt*(1/Sglob)
232 C NOTE: Be very careful with signs here!
233 C Positive EminusPforV => loss of water to atmos and increase
234 C in salinity. Thus, also increase in other surface tracers
235 C (i.e. positive virtual flux into surface layer)
236 C ...so here, VirtualFLux = dC/dt!
237 VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s
238 c OR
239 c let virtual flux be zero
240 c VirtualFlux(i,j)=0.d0
241 c
242 ELSE
243 VirtualFlux(i,j)=0. _d 0
244 ENDIF
245 #endif /* ALLOW_OLD_VIRTUALFLUX */
246 ENDDO
247 ENDDO
248
249 C update tendency
250 DO j=jMin,jMax
251 DO i=iMin,iMax
252 GDC(i,j)= recip_drF(kLev)*recip_hFacC(i,j,kLev,bi,bj)
253 & *(FluxCO2(i,j,bi,bj)
254 #ifdef ALLOW_OLD_VIRTUALFLUX
255 & + VirtualFlux(i,j)
256 #endif
257 & )
258 ENDDO
259 ENDDO
260
261 #endif
262 RETURN
263 END

  ViewVC Help
Powered by ViewVC 1.1.22