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

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

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


Revision 1.29 - (hide annotations) (download)
Fri Oct 7 21:36:39 2011 UTC (13 years, 9 months ago) by dfer
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint64, checkpoint65, checkpoint65h, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e
Changes since 1.28: +3 -2 lines
Remove subroutine CALC_PCO2_APPROX_CO3 from carbon_chem.F
and add carbonate computation/output to CALC_PCO2_APPROX

1 dfer 1.29 C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_surfforcing.F,v 1.28 2011/06/24 01:35:32 jmc 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 jmc 1.24 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 jmc 1.24 C Calculate the carbon air-sea flux terms
17     C following external_forcing_dic.F (OCMIP run) from Mick
18 stephd 1.5
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 jmc 1.23 INTEGER i,j, kLev
49 dfer 1.29 _RL co3dummy
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 stephd 1.27 _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 dfer 1.16 #ifdef ALLOW_OLD_VIRTUALFLUX
64 stephd 1.1 _RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
65 dfer 1.16 #endif
66 stephd 1.5 CEOP
67 stephd 1.1
68     cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
69    
70     kLev=1
71    
72 stephd 1.19 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 stephd 1.1
83    
84     C =================================================================
85     C determine inorganic carbon chem coefficients
86 stephd 1.10 DO j=jmin,jmax
87     DO i=imin,imax
88 stephd 1.1
89     #ifdef DIC_BIOTIC
90     cQQQQ check ptracer numbers
91 stephd 1.27 #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 stephd 1.12 surfalk(i,j) = PTR_ALK(i,j,klev)
100 stephd 1.1 & * maskC(i,j,kLev,bi,bj)
101 stephd 1.12 surfphos(i,j) = PTR_PO4(i,j,klev)
102 stephd 1.1 & * maskC(i,j,kLev,bi,bj)
103 stephd 1.27 #endif
104 stephd 1.1 #else
105 dfer 1.15 surfalk(i,j) = 2.366595 _d 0 * salt(i,j,kLev,bi,bj)/gsm_s
106 stephd 1.1 & * maskC(i,j,kLev,bi,bj)
107 dfer 1.15 surfphos(i,j) = 5.1225 _d -4 * maskC(i,j,kLev,bi,bj)
108 stephd 1.1 #endif
109     C FOR NON-INTERACTIVE Si
110 stephd 1.3 surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj)
111 stephd 1.27 #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 stephd 1.1 ENDDO
124     ENDDO
125    
126     CALL CARBON_COEFFS(
127 stephd 1.27 I surftemp,surfsalt,
128 jmc 1.22 I bi,bj,iMin,iMax,jMin,jMax,myThid)
129 stephd 1.1 C====================================================================
130    
131 dfer 1.17 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 stephd 1.1 c pCO2 solver...
154 stephd 1.3 C$TAF LOOP = parallel
155 stephd 1.10 DO j=jmin,jmax
156 stephd 1.3 C$TAF LOOP = parallel
157 stephd 1.10 DO i=imin,imax
158 stephd 1.1
159 dfer 1.18 IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN
160 stephd 1.1 CALL CALC_PCO2_APPROX(
161 stephd 1.27 I surftemp(i,j),surfsalt(i,j),
162     I surfdic(i,j), surfphos(i,j),
163 stephd 1.1 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 stephd 1.25 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 stephd 1.1 I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
171 dfer 1.29 U pH(i,j,bi,bj),pCO2(i,j,bi,bj),co3dummy,
172 jmc 1.24 I i,j,kLev,bi,bj,myIter,myThid )
173 stephd 1.1 ELSE
174 dfer 1.18 pCO2(i,j,bi,bj)=0. _d 0
175     ENDIF
176 stephd 1.1 ENDDO
177     ENDDO
178    
179 stephd 1.10 DO j=jmin,jmax
180     DO i=imin,imax
181 stephd 1.1
182 dfer 1.18 IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN
183 stephd 1.1 C calculate SCHMIDT NO. for CO2
184 jmc 1.24 SchmidtNoDIC(i,j) =
185     & sca1
186 stephd 1.1 & + sca2 * theta(i,j,kLev,bi,bj)
187 jmc 1.24 & + 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 stephd 1.1 & *theta(i,j,kLev,bi,bj)
190 jmc 1.28 c make sure Schmidt number is not negative (will happen if temp>39C)
191 stephd 1.26 SchmidtNoDIC(i,j)=max(1.0 _d -2, SchmidtNoDIC(i,j))
192 stephd 1.1
193     C Determine surface flux (FDIC)
194     C first correct pCO2at for surface atmos pressure
195 jmc 1.24 pCO2sat(i,j) =
196 stephd 1.1 & AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj)
197    
198 dfer 1.17 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 stephd 1.1
202 stephd 1.25 #ifdef WATERVAP_BUG
203 stephd 1.1 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 jmc 1.24 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 stephd 1.25 #else
213 jmc 1.28 C Corrected by Val Bennington Nov 2010 per G.A. McKinley s finding
214 stephd 1.25 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 dfer 1.18 ELSE
224     FluxCO2(i,j,bi,bj) = 0. _d 0
225     ENDIF
226 stephd 1.1 C convert flux (mol kg-1 m s-1) to (mol m-2 s-1)
227 stephd 1.2 FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil
228 stephd 1.1
229 dfer 1.16 #ifdef ALLOW_OLD_VIRTUALFLUX
230 dfer 1.18 IF (maskC(i,j,kLev,bi,bj).NE.0. _d 0) THEN
231 stephd 1.1 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 jmc 1.7 VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s
239 stephd 1.1 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 dfer 1.16 #endif /* ALLOW_OLD_VIRTUALFLUX */
247 stephd 1.1 ENDDO
248     ENDDO
249    
250 jmc 1.24 C update tendency
251 stephd 1.10 DO j=jmin,jmax
252     DO i=imin,imax
253 dfer 1.17 GDC(i,j)= recip_drF(kLev)*recip_hFacC(i,j,kLev,bi,bj)
254 jmc 1.24 & *(FluxCO2(i,j,bi,bj)
255 dfer 1.16 #ifdef ALLOW_OLD_VIRTUALFLUX
256 dfer 1.17 & + VirtualFlux(i,j)
257 dfer 1.16 #endif
258 dfer 1.17 & )
259 stephd 1.1 ENDDO
260     ENDDO
261    
262     #endif
263     RETURN
264     END

  ViewVC Help
Powered by ViewVC 1.1.22