/[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.4 - (hide annotations) (download)
Thu Oct 9 04:19:19 2003 UTC (20 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52e_pre, checkpoint51o_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint51l_post, checkpoint51q_post, hrcube_1, branch-netcdf, checkpoint52d_pre, checkpoint51r_post, checkpoint52b_pre, checkpoint51o_post, checkpoint51p_post, checkpoint52a_pre, checkpoint51i_post, checkpoint52, checkpoint52d_post, checkpoint52a_post, checkpoint52b_post, checkpoint52f_post, checkpoint52c_post, checkpoint51l_pre, ecco_c52_e35, checkpoint52i_post, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, checkpoint51u_post, checkpoint52h_pre, checkpoint52f_pre, hrcube_2, hrcube_3, checkpoint51m_post, checkpoint51s_post
Branch point for: branch-nonh, tg2-branch, checkpoint51n_branch, netcdf-sm0
Changes since 1.3: +1 -1 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

1 edhill 1.4 #include "DIC_OPTIONS.h"
2 stephd 1.1 #include "PTRACERS_OPTIONS.h"
3     #include "GCHEM_OPTIONS.h"
4    
5     CStartOfInterFace
6     SUBROUTINE DIC_SURFFORCING( PTR_CO2 , GDC,
7     I bi,bj,imin,imax,jmin,jmax,
8     I myIter,myTime,myThid)
9    
10     C /==========================================================\
11     C | SUBROUTINE DIC_SURFFORCING |
12     C | o Calculate the carbon air-sea flux terms |
13     C | o following external_forcing_dic.F from Mick |
14     C |==========================================================|
15     IMPLICIT NONE
16    
17     C == GLobal variables ==
18     #include "SIZE.h"
19     #include "DYNVARS.h"
20     #include "EEPARAMS.h"
21     #include "PARAMS.h"
22     #include "GRID.h"
23     #include "FFIELDS.h"
24     #include "DIC_ABIOTIC.h"
25     #ifdef DIC_BIOTIC
26     #include "PTRACERS.h"
27     #endif
28    
29     C == Routine arguments ==
30     INTEGER myIter, myThid
31     _RL myTime
32     _RL PTR_CO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
33     _RL GDC(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
34     INTEGER iMin,iMax,jMin,jMax, bi, bj
35    
36     #ifdef ALLOW_PTRACERS
37     C == Local variables ==
38 stephd 1.2 INTEGER I,J, kLev, it
39 stephd 1.1 C Number of iterations for pCO2 solvers...
40     C Solubility relation coefficients
41     _RL SchmidtNoDIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
42     _RL pCO2sat(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
43     _RL Kwexch(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44     C local variables for carbon chem
45     _RL surfalk(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46     _RL surfphos(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47     _RL surfsi(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
48     _RL VirtualFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
49    
50     cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
51    
52     kLev=1
53    
54     C PRE-INDUSTRIAL STEADY STATE pCO2 = 278.0 ppmv
55     DO j=1-OLy,sNy+OLy
56     DO i=1-OLx,sNx+OLx
57     AtmospCO2(i,j,bi,bj)=278.0d-6
58     ENDDO
59     ENDDO
60    
61    
62     C =================================================================
63     C determine inorganic carbon chem coefficients
64     DO j=1-OLy,sNy+OLy
65     DO i=1-OLx,sNx+OLx
66    
67     #ifdef DIC_BIOTIC
68     cQQQQ check ptracer numbers
69     surfalk(i,j) = PTRACER(i,j,klev,bi,bj,2)
70     & * maskC(i,j,kLev,bi,bj)
71     surfphos(i,j) = PTRACER(i,j,klev,bi,bj,3)
72     & * maskC(i,j,kLev,bi,bj)
73     #else
74     surfalk(i,j) = 2.366595 * salt(i,j,kLev,bi,bj)/gsm_s
75     & * maskC(i,j,kLev,bi,bj)
76     surfphos(i,j) = 5.1225e-4 * maskC(i,j,kLev,bi,bj)
77     #endif
78     C FOR NON-INTERACTIVE Si
79 stephd 1.3 surfsi(i,j) = SILICA(i,j,bi,bj) * maskC(i,j,kLev,bi,bj)
80 stephd 1.1 ENDDO
81     ENDDO
82    
83     CALL CARBON_COEFFS(
84     I theta,salt,
85     I bi,bj,iMin,iMax,jMin,jMax)
86     C====================================================================
87    
88     c pCO2 solver...
89 stephd 1.3 C$TAF LOOP = parallel
90 stephd 1.1 DO j=1-OLy,sNy+OLy
91 stephd 1.3 C$TAF LOOP = parallel
92 stephd 1.1 DO i=1-OLx,sNx+OLx
93    
94     IF(maskC(i,j,kLev,bi,bj) .NE. 0.)THEN
95     CALL CALC_PCO2_APPROX(
96     I theta(i,j,kLev,bi,bj),salt(i,j,kLev,bi,bj),
97     I PTR_CO2(i,j,kLev), surfphos(i,j),
98     I surfsi(i,j),surfalk(i,j),
99     I ak1(i,j,bi,bj),ak2(i,j,bi,bj),
100     I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj),
101     I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj),
102     I aksi(i,j,bi,bj),akf(i,j,bi,bj),ff(i,j,bi,bj),
103     I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
104     U pH(i,j,bi,bj),pCO2(i,j,bi,bj) )
105     ELSE
106     pCO2(i,j,bi,bj)=0. _d 0
107     END IF
108     ENDDO
109     ENDDO
110    
111     DO j=1-OLy,sNy+OLy
112     DO i=1-OLx,sNx+OLx
113    
114     IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN
115     C calculate SCHMIDT NO. for CO2
116     SchmidtNoDIC(i,j) =
117     & sca1
118     & + sca2 * theta(i,j,kLev,bi,bj)
119     & + sca3 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
120     & + sca4 * theta(i,j,kLev,bi,bj)*theta(i,j,kLev,bi,bj)
121     & *theta(i,j,kLev,bi,bj)
122    
123     C Determine surface flux (FDIC)
124     C first correct pCO2at for surface atmos pressure
125     pCO2sat(i,j) =
126     & AtmosP(i,j,bi,bj)*AtmospCO2(i,j,bi,bj)
127     c find exchange coefficient
128     c account for schmidt number and and varible piston velocity
129     Kwexch(i,j) =
130     & pisvel(i,j,bi,bj)
131     & / sqrt(SchmidtNoDIC(i,j)/660.0)
132     c OR use a constant coeff
133     c Kwexch(i,j) = 5e-5
134     c ice influence
135     cQQ Kwexch(i,j) =(1.d0-Fice(i,j,bi,bj))*Kwexch(i,j)
136    
137    
138     C Calculate flux in terms of DIC units using K0, solubility
139     C Flux = Vp * ([CO2sat] - [CO2])
140     C CO2sat = K0*pCO2atmos*P/P0
141     C Converting pCO2 to [CO2] using ff, as in CALC_PCO2
142 stephd 1.2 FluxCO2(i,j,bi,bj) =
143 stephd 1.1 & maskC(i,j,kLev,bi,bj)*Kwexch(i,j)*(
144     & ak0(i,j,bi,bj)*pCO2sat(i,j) -
145     & ff(i,j,bi,bj)*pCO2(i,j,bi,bj)
146     & )
147     ELSE
148 stephd 1.2 FluxCO2(i,j,bi,bj) = 0.
149 stephd 1.1 ENDIF
150     C convert flux (mol kg-1 m s-1) to (mol m-2 s-1)
151 stephd 1.2 FluxCO2(i,j,bi,bj) = FluxCO2(i,j,bi,bj)/permil
152 stephd 1.1
153     IF (maskC(i,j,kLev,bi,bj).NE.0.) THEN
154     c calculate virtual flux
155     c EminusPforV = dS/dt*(1/Sglob)
156     C NOTE: Be very careful with signs here!
157     C Positive EminusPforV => loss of water to atmos and increase
158     C in salinity. Thus, also increase in other surface tracers
159     C (i.e. positive virtual flux into surface layer)
160     C ...so here, VirtualFLux = dC/dt!
161     VirtualFlux(i,j)=gsm_DIC*surfaceTendencyS(i,j,bi,bj)/gsm_s
162     c OR
163     c let virtual flux be zero
164     c VirtualFlux(i,j)=0.d0
165     c
166     ELSE
167     VirtualFlux(i,j)=0. _d 0
168     ENDIF
169     ENDDO
170     ENDDO
171    
172     C update tendency
173     DO j=1-OLy,sNy+OLy
174     DO i=1-OLx,sNx+OLx
175     GDC(i,j)= maskC(i,j,kLev,bi,bj)*(
176 stephd 1.2 & FluxCO2(i,j,bi,bj)*recip_drF(kLev)
177 stephd 1.1 & + VirtualFlux(i,j)
178     & )
179     ENDDO
180     ENDDO
181    
182     #endif
183     RETURN
184     END

  ViewVC Help
Powered by ViewVC 1.1.22