/[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.12 - (show annotations) (download)
Tue Nov 28 21:16:03 2006 UTC (17 years, 10 months ago) by stephd
Branch: MAIN
CVS Tags: checkpoint58u_post, checkpoint58w_post, checkpoint58x_post, checkpoint58t_post, checkpoint59a, checkpoint59, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post
Changes since 1.11: +6 -8 lines
o changes to make dic code more adjoint friendly:
      - standardize how tracers are passed from dic_biotic_forcing to
        other subroutines
      - add a tanh function to take the place of min(x,y) in bio_export.F
        and fe_chem.F.

1 C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_surfforcing.F,v 1.11 2006/09/12 19:58:02 stephd Exp $
2 C $Name: $
3
4 #include "DIC_OPTIONS.h"
5 #include "PTRACERS_OPTIONS.h"
6 #include "GCHEM_OPTIONS.h"
7
8 CBOP
9 C !ROUTINE: DIC_SURFFORCING
10
11 C !INTERFACE: ==========================================================
12 SUBROUTINE DIC_SURFFORCING( PTR_CO2 , PTR_ALK, PTR_PO4, GDC,
13 I bi,bj,imin,imax,jmin,jmax,
14 I myIter,myTime,myThid)
15
16 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 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 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 INTEGER myIter, myThid
36 _RL myTime
37 _RL PTR_CO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
38 _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 INTEGER iMin,iMax,jMin,jMax, bi, bj
41
42 C !OUTPUT PARAMETERS: ===================================================
43 c GDC :: tendency due to air-sea exchange
44 _RL GDC(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45
46 #ifdef ALLOW_PTRACERS
47
48 C !LOCAL VARIABLES: ====================================================
49 INTEGER I,J, kLev, it
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 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 _RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
60 CEOP
61
62 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
63
64 kLev=1
65
66 C PRE-INDUSTRIAL STEADY STATE pCO2 = 278.0 ppmv
67 DO j=1-OLy,sNy+OLy
68 DO i=1-OLx,sNx+OLx
69 AtmospCO2(i,j,bi,bj)=278.0d-6
70 ENDDO
71 ENDDO
72
73
74 C =================================================================
75 C determine inorganic carbon chem coefficients
76 DO j=jmin,jmax
77 DO i=imin,imax
78
79 #ifdef DIC_BIOTIC
80 cQQQQ check ptracer numbers
81 surfalk(i,j) = PTR_ALK(i,j,klev)
82 & * maskC(i,j,kLev,bi,bj)
83 surfphos(i,j) = PTR_PO4(i,j,klev)
84 & * maskC(i,j,kLev,bi,bj)
85 #else
86 surfalk(i,j) = 2.366595 * salt(i,j,kLev,bi,bj)/gsm_s
87 & * maskC(i,j,kLev,bi,bj)
88 surfphos(i,j) = 5.1225e-4 * maskC(i,j,kLev,bi,bj)
89 #endif
90 C FOR NON-INTERACTIVE Si
91 surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj)
92 ENDDO
93 ENDDO
94
95 CALL CARBON_COEFFS(
96 I theta,salt,
97 I bi,bj,iMin,iMax,jMin,jMax)
98 C====================================================================
99
100 c pCO2 solver...
101 C$TAF LOOP = parallel
102 DO j=jmin,jmax
103 C$TAF LOOP = parallel
104 DO i=imin,imax
105
106 IF(maskC(i,j,kLev,bi,bj) .NE. 0.)THEN
107 CALL CALC_PCO2_APPROX(
108 I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj),
109 I PTR_CO2(i,j,kLev), surfphos(i,j),
110 I surfsi(i,j),surfalk(i,j),
111 I ak1(i,j,bi,bj),ak2(i,j,bi,bj),
112 I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj),
113 I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj),
114 I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj),
115 I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
116 U pH(i,j,bi,bj),pCO2(i,j,bi,bj) )
117 ELSE
118 pCO2(i,j,bi,bj)=0. _d 0
119 END IF
120 ENDDO
121 ENDDO
122
123 DO j=jmin,jmax
124 DO i=imin,imax
125
126 IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN
127 C calculate SCHMIDT NO. for CO2
128 SchmidtNoDIC(i,j) =
129 & sca1
130 & + sca2 * theta(i,j,kLev,bi,bj)
131 & + sca3 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
132 & + sca4 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
133 & *theta(i,j,kLev,bi,bj)
134
135 C Determine surface flux (FDIC)
136 C first correct pCO2at for surface atmos pressure
137 pCO2sat(i,j) =
138 & AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj)
139 c find exchange coefficient
140 c account for schmidt number and and varible piston velocity
141 pisvel(i,j,bi,bj) =0.337*wind(i,j,bi,bj)**2/3.6d5
142 Kwexch(i,j) =
143 & pisvel(i,j,bi,bj)
144 & / sqrt(SchmidtNoDIC(i,j)/660.0)
145 c OR use a constant coeff
146 c Kwexch(i,j) = 5e-5
147 c ice influence
148 Kwexch(i,j) =(1.d0-Fice(i,j,bi,bj))*Kwexch(i,j)
149
150
151 C Calculate flux in terms of DIC units using K0, solubility
152 C Flux = Vp * ([CO2sat] - [CO2])
153 C CO2sat = K0*pCO2atmos*P/P0
154 C Converting pCO2 to [CO2] using ff, as in CALC_PCO2
155 FluxCO2(i,j,bi,bj) =
156 & maskC(i,j,kLev,bi,bj)*Kwexch(i,j)*(
157 & ak0(i,j,bi,bj)*pCO2sat(i,j) -
158 & ff(i,j,bi,bj)*pCO2(i,j,bi,bj)
159 & )
160 ELSE
161 FluxCO2(i,j,bi,bj) = 0.
162 ENDIF
163 C convert flux (mol kg-1 m s-1) to (mol m-2 s-1)
164 FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil
165
166 IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN
167 c calculate virtual flux
168 c EminusPforV = dS/dt*(1/Sglob)
169 C NOTE: Be very careful with signs here!
170 C Positive EminusPforV => loss of water to atmos and increase
171 C in salinity. Thus, also increase in other surface tracers
172 C (i.e. positive virtual flux into surface layer)
173 C ...so here, VirtualFLux = dC/dt!
174 VirtualFlux(i,j)=gsm_DIC*surfaceForcingS(i,j,bi,bj)/gsm_s
175 c OR
176 c let virtual flux be zero
177 c VirtualFlux(i,j)=0.d0
178 c
179 ELSE
180 VirtualFlux(i,j)=0. _d 0
181 ENDIF
182 ENDDO
183 ENDDO
184
185 C update tendency
186 DO j=jmin,jmax
187 DO i=imin,imax
188 GDC(i,j)= maskC(i,j,kLev,bi,bj)*recip_drF(kLev)*
189 & recip_hFacC(i,j,kLev,bi,bj)*(
190 & FluxCO2(i,j,bi,bj) + VirtualFlux(i,j)
191 & )
192 ENDDO
193 ENDDO
194
195 #endif
196 RETURN
197 END

  ViewVC Help
Powered by ViewVC 1.1.22