/[MITgcm]/MITgcm_contrib/darwin2/pkg/darwin/dic_surfforcing.F
ViewVC logotype

Contents of /MITgcm_contrib/darwin2/pkg/darwin/dic_surfforcing.F

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


Revision 1.1 - (show annotations) (download)
Wed Apr 13 18:56:24 2011 UTC (14 years, 6 months ago) by jahn
Branch: MAIN
CVS Tags: ctrb_darwin2_ckpt62v_20110413, ctrb_darwin2_baseline
darwin2 initial checkin

1 #include "CPP_OPTIONS.h"
2 #include "PTRACERS_OPTIONS.h"
3 #include "DARWIN_OPTIONS.h"
4
5 #ifdef ALLOW_PTRACERS
6 #ifdef ALLOW_DARWIN
7
8 #ifdef ALLOW_CARBON
9
10 CBOP
11 C !ROUTINE: DIC_SURFFORCING
12
13 C !INTERFACE: ==========================================================
14 SUBROUTINE DIC_SURFFORCING( PTR_DIC , PTR_ALK, PTR_PO4, PTR_SIL,
15 O GDC,
16 I bi,bj,imin,imax,jmin,jmax,
17 I myIter,myTime,myThid)
18
19 C !DESCRIPTION:
20 C Calculate the carbon air-sea flux terms
21 C following external_forcing_dic.F (OCMIP run) from Mick
22
23 C !USES: ===============================================================
24 IMPLICIT NONE
25 #include "SIZE.h"
26 #include "DYNVARS.h"
27 #include "EEPARAMS.h"
28 #include "PARAMS.h"
29 #include "GRID.h"
30 #include "FFIELDS.h"
31 #include "DARWIN_SIZE.h"
32 #include "DARWIN_IO.h"
33 #include "DARWIN_FLUX.h"
34
35 C !INPUT PARAMETERS: ===================================================
36 C myThid :: thread number
37 C myIter :: current timestep
38 C myTime :: current time
39 c PTR_DIC :: DIC tracer field
40 INTEGER myIter, myThid
41 _RL myTime
42 _RL PTR_DIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
43 _RL PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44 _RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45 _RL PTR_SIL(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46 INTEGER iMin,iMax,jMin,jMax, bi, bj
47
48 C !OUTPUT PARAMETERS: ===================================================
49 c GDC :: tendency due to air-sea exchange
50 _RL GDC(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
51
52
53 C !LOCAL VARIABLES: ====================================================
54 INTEGER I,J, kLev, it
55 C Number of iterations for pCO2 solvers...
56 C Solubility relation coefficients
57 _RL SchmidtNoDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
58 _RL pCO2sat(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
59 _RL Kwexch(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
60 _RL pisvel(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
61 C local variables for carbon chem
62 _RL surfdic(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
63 _RL surfalk(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
64 _RL surfphos(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
65 _RL surfsi(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
66 _RL surfsalt(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
67 #ifdef ALLOW_OLD_VIRTUALFLUX
68 _RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
69 #endif
70 CEOP
71
72 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
73
74 kLev=1
75
76 cc if coupled to atmsopheric model, use the
77 cc Co2 value passed from the coupler
78 c#ifndef USE_ATMOSCO2
79 cC PRE-INDUSTRIAL STEADY STATE pCO2 = 278.0 ppmv
80 c DO j=1-OLy,sNy+OLy
81 c DO i=1-OLx,sNx+OLx
82 c AtmospCO2(i,j,bi,bj)=278.0 _d -6
83 c ENDDO
84 c ENDDO
85 c#endif
86 C =================================================================
87 C determine inorganic carbon chem coefficients
88 DO j=jmin,jmax
89 DO i=imin,imax
90 surfdic(i,j) = max(10. _d 0 , PTR_DIC(i,j))*1e-3
91 & * maskC(i,j,kLev,bi,bj)
92 surfalk(i,j) = max(10. _d 0 , PTR_ALK(i,j))*1e-3
93 & * maskC(i,j,kLev,bi,bj)
94 surfphos(i,j) = max(1. _d -10, PTR_PO4(i,j))*1e-3
95 & * maskC(i,j,kLev,bi,bj)
96 surfsi(i,j) = max(1. _d -8, PTR_SIL(i,j))*1e-3
97 & * maskC(i,j,kLev,bi,bj)
98 surfsalt(i,j) = max(4. _d 0, salt(i,j,kLev,bi,bj))
99 ENDDO
100 ENDDO
101
102 CALL CARBON_COEFFS(
103 I theta,salt,
104 I bi,bj,iMin,iMax,jMin,jMax,myThid)
105 C====================================================================
106
107 DO j=jmin,jmax
108 DO i=imin,imax
109 C Compute AtmosP and Kwexch_Pre which are re-used for flux of O2
110
111 #ifdef USE_PLOAD
112 C Convert anomalous pressure pLoad (in Pa) from atmospheric model
113 C to total pressure (in Atm)
114 C Note: it is assumed the reference atmospheric pressure is 1Atm=1013mb
115 C rather than the actual ref. pressure from Atm. model so that on
116 C average AtmosP is about 1 Atm.
117 AtmosP(i,j,bi,bj)= 1. _d 0 + pLoad(i,j,bi,bj)/Pa2Atm
118 #endif
119
120 C Pre-compute part of exchange coefficient: pisvel*(1-fice)
121 C Schmidt number is accounted for later
122 pisvel(i,j)=0.337 _d 0 *wind(i,j,bi,bj)**2/3.6 _d 5
123 Kwexch_Pre(i,j,bi,bj) = pisvel(i,j)
124 & * (1. _d 0 - FIce(i,j,bi,bj))
125
126 ENDDO
127 ENDDO
128
129 c pCO2 solver...
130 C$TAF LOOP = parallel
131 DO j=jmin,jmax
132 C$TAF LOOP = parallel
133 DO i=imin,imax
134
135 IF ( maskC(i,j,kLev,bi,bj).NE.0. _d 0 ) THEN
136 CALL CALC_PCO2_APPROX(
137 I theta(i,j,kLev,bi,bj),surfsalt(i,j),
138 I surfdic(i,j), surfphos(i,j),
139 I surfsi(i,j),surfalk(i,j),
140 I ak1(i,j,bi,bj),ak2(i,j,bi,bj),
141 I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj),
142 I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj),
143 I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj),
144 I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
145 U pH(i,j,bi,bj),pCO2(i,j,bi,bj),
146 I myThid )
147 ELSE
148 pCO2(i,j,bi,bj)=0. _d 0
149 ENDIF
150 ENDDO
151 ENDDO
152
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
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 FluxCO2(i,j,bi,bj) = 0. _d 0
187 ENDIF
188 C convert flux (mol kg-1 m s-1) to (mol m-2 s-1)
189 FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil
190 c convert flux (mol m-2 s-1) to (mmol m-2 s-1)
191 FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)*1. _d 3
192
193
194 #ifdef ALLOW_OLD_VIRTUALFLUX
195 IF (maskC(i,j,kLev,bi,bj).NE.0. _d 0) THEN
196 c calculate virtual flux
197 c EminusPforV = dS/dt*(1/Sglob)
198 C NOTE: Be very careful with signs here!
199 C Positive EminusPforV => loss of water to atmos and increase
200 C in salinity. Thus, also increase in other surface tracers
201 C (i.e. positive virtual flux into surface layer)
202 C ...so here, VirtualFLux = dC/dt!
203 VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s
204 c OR
205 c let virtual flux be zero
206 c VirtualFlux(i,j)=0.d0
207 c
208 ELSE
209 VirtualFlux(i,j)=0. _d 0
210 ENDIF
211 #endif /* ALLOW_OLD_VIRTUALFLUX */
212 ENDDO
213 ENDDO
214
215 C update tendency
216 DO j=jmin,jmax
217 DO i=imin,imax
218 GDC(i,j)= recip_drF(kLev)*recip_hFacC(i,j,kLev,bi,bj)
219 & *(FluxCO2(i,j,bi,bj)
220 #ifdef ALLOW_OLD_VIRTUALFLUX
221 & + VirtualFlux(i,j)
222 #endif
223 & )
224 ENDDO
225 ENDDO
226
227 RETURN
228 END
229 #endif /*ALLOW_CARBON*/
230
231 #endif /*DARWIN*/
232 #endif /*ALLOW_PTRACERS*/
233 c ==================================================================

  ViewVC Help
Powered by ViewVC 1.1.22