/[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.16 - (hide annotations) (download)
Mon Aug 27 19:44:13 2007 UTC (17 years, 10 months ago) by dfer
Branch: MAIN
Changes since 1.15: +11 -4 lines
CPP option to do virtual flux of dic and alkalinity as coded in dic package

1 dfer 1.16 C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_surfforcing.F,v 1.15 2007/08/14 19:32:40 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     #include "GCHEM_OPTIONS.h"
7    
8 stephd 1.5 CBOP
9     C !ROUTINE: DIC_SURFFORCING
10    
11     C !INTERFACE: ==========================================================
12 stephd 1.12 SUBROUTINE DIC_SURFFORCING( PTR_CO2 , PTR_ALK, PTR_PO4, GDC,
13 stephd 1.1 I bi,bj,imin,imax,jmin,jmax,
14     I myIter,myTime,myThid)
15    
16 stephd 1.5 C !DESCRIPTION:
17     C Calculate the carbon air-sea flux terms
18     C following external_forcing_dic.F (OCMIP run) from Mick
19    
20     C !USES: ===============================================================
21 stephd 1.1 IMPLICIT NONE
22     #include "SIZE.h"
23     #include "DYNVARS.h"
24     #include "EEPARAMS.h"
25     #include "PARAMS.h"
26     #include "GRID.h"
27     #include "FFIELDS.h"
28     #include "DIC_ABIOTIC.h"
29    
30 stephd 1.5 C !INPUT PARAMETERS: ===================================================
31     C myThid :: thread number
32     C myIter :: current timestep
33     C myTime :: current time
34     c PTR_CO2 :: DIC tracer field
35 stephd 1.1 INTEGER myIter, myThid
36     _RL myTime
37     _RL PTR_CO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
38 stephd 1.12 _RL PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
39     _RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
40 stephd 1.5 INTEGER iMin,iMax,jMin,jMax, bi, bj
41    
42     C !OUTPUT PARAMETERS: ===================================================
43 stephd 1.8 c GDC :: tendency due to air-sea exchange
44 stephd 1.1 _RL GDC(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45    
46     #ifdef ALLOW_PTRACERS
47 stephd 1.5
48     C !LOCAL VARIABLES: ====================================================
49 stephd 1.2 INTEGER I,J, kLev, it
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     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.13 c if coupled to atmsopheric model, use the
69     c Co2 value passed from the coupler
70     #ifndef USE_ATMOSCO2
71 stephd 1.1 C PRE-INDUSTRIAL STEADY STATE pCO2 = 278.0 ppmv
72     DO j=1-OLy,sNy+OLy
73     DO i=1-OLx,sNx+OLx
74 dfer 1.15 AtmospCO2(i,j,bi,bj)=278.0 _d -6
75 stephd 1.1 ENDDO
76     ENDDO
77 stephd 1.13 #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     c pCO2 solver...
107 stephd 1.3 C$TAF LOOP = parallel
108 stephd 1.10 DO j=jmin,jmax
109 stephd 1.3 C$TAF LOOP = parallel
110 stephd 1.10 DO i=imin,imax
111 stephd 1.1
112     IF(maskC(i,j,kLev,bi,bj) .NE. 0.)THEN
113     CALL CALC_PCO2_APPROX(
114     I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj),
115     I PTR_CO2(i,j,kLev), surfphos(i,j),
116     I surfsi(i,j),surfalk(i,j),
117     I ak1(i,j,bi,bj),ak2(i,j,bi,bj),
118     I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj),
119     I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj),
120     I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj),
121     I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
122     U pH(i,j,bi,bj),pCO2(i,j,bi,bj) )
123     ELSE
124     pCO2(i,j,bi,bj)=0. _d 0
125     END IF
126     ENDDO
127     ENDDO
128    
129 stephd 1.10 DO j=jmin,jmax
130     DO i=imin,imax
131 stephd 1.1
132     IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN
133     C calculate SCHMIDT NO. for CO2
134     SchmidtNoDIC(i,j) =
135     & sca1
136     & + sca2 * theta(i,j,kLev,bi,bj)
137     & + sca3 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
138     & + sca4 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
139     & *theta(i,j,kLev,bi,bj)
140    
141 stephd 1.13 c
142     #ifdef USE_PLOAD
143 dfer 1.14 C Convert anomalous pressure pLoad (in Pa) from atmospheric model
144     C to total pressure (in Atm)
145     C Note: it is assumed the reference atmospheric pressure is 1Atm=1013mb
146     C rather than the actual ref. pressure from Atm. model so that on
147     C average AtmosP is about 1 Atm.
148 dfer 1.15 AtmosP(i,j,bi,bj)= 1. _d 0 + pLoad(i,j,bi,bj)/Pa2Atm
149 stephd 1.13 #endif
150    
151 stephd 1.1 C Determine surface flux (FDIC)
152     C first correct pCO2at for surface atmos pressure
153     pCO2sat(i,j) =
154     & AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj)
155     c find exchange coefficient
156     c account for schmidt number and and varible piston velocity
157 dfer 1.15 pisvel(i,j,bi,bj)=0.337 _d 0 *wind(i,j,bi,bj)**2/3.6 _d 5
158 stephd 1.1 Kwexch(i,j) =
159     & pisvel(i,j,bi,bj)
160 dfer 1.15 & / sqrt(SchmidtNoDIC(i,j)/660.0 _d 0)
161 stephd 1.1 c OR use a constant coeff
162     c Kwexch(i,j) = 5e-5
163     c ice influence
164 dfer 1.15 Kwexch(i,j) =(1. _d 0 - FIce(i,j,bi,bj))*Kwexch(i,j)
165 stephd 1.1
166    
167     C Calculate flux in terms of DIC units using K0, solubility
168     C Flux = Vp * ([CO2sat] - [CO2])
169     C CO2sat = K0*pCO2atmos*P/P0
170     C Converting pCO2 to [CO2] using ff, as in CALC_PCO2
171 stephd 1.2 FluxCO2(i,j,bi,bj) =
172 stephd 1.1 & maskC(i,j,kLev,bi,bj)*Kwexch(i,j)*(
173     & ak0(i,j,bi,bj)*pCO2sat(i,j) -
174     & ff(i,j,bi,bj)*pCO2(i,j,bi,bj)
175     & )
176     ELSE
177 dfer 1.15 FluxCO2(i,j,bi,bj) = 0. _d 0
178 stephd 1.1 ENDIF
179     C convert flux (mol kg-1 m s-1) to (mol m-2 s-1)
180 stephd 1.2 FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil
181 stephd 1.1
182 dfer 1.16 #ifdef ALLOW_OLD_VIRTUALFLUX
183 stephd 1.1 IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN
184     c calculate virtual flux
185     c EminusPforV = dS/dt*(1/Sglob)
186     C NOTE: Be very careful with signs here!
187     C Positive EminusPforV => loss of water to atmos and increase
188     C in salinity. Thus, also increase in other surface tracers
189     C (i.e. positive virtual flux into surface layer)
190     C ...so here, VirtualFLux = dC/dt!
191 jmc 1.7 VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s
192 stephd 1.1 c OR
193     c let virtual flux be zero
194     c VirtualFlux(i,j)=0.d0
195     c
196     ELSE
197     VirtualFlux(i,j)=0. _d 0
198     ENDIF
199 dfer 1.16 #endif /* ALLOW_OLD_VIRTUALFLUX */
200 stephd 1.1 ENDDO
201     ENDDO
202    
203     C update tendency
204 stephd 1.10 DO j=jmin,jmax
205     DO i=imin,imax
206 stephd 1.9 GDC(i,j)= maskC(i,j,kLev,bi,bj)*recip_drF(kLev)*
207 dfer 1.16 & recip_hFacC(i,j,kLev,bi,bj)
208     & *(FluxCO2(i,j,bi,bj)
209     #ifdef ALLOW_OLD_VIRTUALFLUX
210     & + VirtualFlux(i,j)
211     #endif
212     & )
213 stephd 1.1 ENDDO
214     ENDDO
215    
216     #endif
217     RETURN
218     END

  ViewVC Help
Powered by ViewVC 1.1.22