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

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

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


Revision 1.11 - (hide annotations) (download)
Fri Oct 7 21:36:39 2011 UTC (12 years, 7 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, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.10: +4 -3 lines
Remove subroutine CALC_PCO2_APPROX_CO3 from carbon_chem.F
and add carbonate computation/output to CALC_PCO2_APPROX

1 dfer 1.11 C $Header: /u/gcmpack/MITgcm/pkg/dic/calcite_saturation.F,v 1.10 2010/04/12 20:07:57 jmc Exp $
2 jmc 1.4 C $Name: $
3    
4 stephd 1.1 #include "DIC_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: CAR_FLUX
8    
9     C !INTERFACE: ==========================================================
10 stephd 1.3 SUBROUTINE CALCITE_SATURATION(PTR_DIC, PTR_ALK, PTR_PO4,
11 stephd 1.1 I bi,bj,imin,imax,jmin,jmax,
12     I myIter,myTime,myThid)
13    
14     C !DESCRIPTION:
15     C Calculate carbonate fluxes
16    
17     C !USES: ===============================================================
18     IMPLICIT NONE
19     #include "SIZE.h"
20     #include "DYNVARS.h"
21     #include "EEPARAMS.h"
22     #include "PARAMS.h"
23     #include "GRID.h"
24 dfer 1.7 #include "DIC_VARS.h"
25 stephd 1.1
26     C !INPUT PARAMETERS: ===================================================
27     C myThid :: thread number
28     C myIter :: current timestep
29     C myTime :: current time
30     C bioac :: biological productivity
31 stephd 1.3 _RL PTR_DIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
32     _RL PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
33     _RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
34    
35 stephd 1.1 INTEGER myIter
36     _RL myTime
37     INTEGER myThid
38     INTEGER imin, imax, jmin, jmax, bi, bj
39    
40     C !OUTPUT PARAMETERS: ===================================================
41    
42     #ifdef ALLOW_PTRACERS
43     #ifdef DIC_BIOTIC
44    
45     C !LOCAL VARIABLES: ====================================================
46     C i,j,k :: loop indices
47     c ko :: loop-within-loop index
48     c depth_u, depth_l :: depths of upper and lower interfaces
49     c flux_u, flux_l :: flux through upper and lower interfaces
50     c zbase :: depth of bottom of current productive layer
51     INTEGER I,J,k
52     _RL carbonate
53     _RL calcium
54     _RL silicaTEST
55     _RL po4local
56     _RL diclocal
57     _RL alklocal
58     _RL pCO2local
59     _RL pHlocal
60     INTEGER CO3ITER
61     INTEGER CO3ITERmax
62     CEOP
63    
64    
65     cmick...................................................
66     write(6,*)'myIter ',myIter,' CALLED CALCITEcd_SATURATION'
67     c write(6,*)'WARNING calcite_sat needs 3d silica & H0 set=7.9'
68     c write(6,*)' - & Fixed first guess of deep pH to 7.9'
69     cmick....................................................
70    
71     c determine carbonate ion concentration through full domain
72     c determine calcite saturation state
73 dfer 1.5 DO k=1,Nr
74 stephd 1.1
75     CALL CARBON_COEFFS_PRESSURE_DEP(
76     I theta,salt,
77     I bi,bj,iMin,iMax,jMin,jMax,
78 jmc 1.9 I k,myThid)
79 stephd 1.1
80    
81 stephd 1.2 DO j=jmin,jmax
82     DO i=imin,imax
83 stephd 1.1
84 dfer 1.5 if ( hFacC(i,j,k,bi,bj) .gt. 0. _d 0 ) then
85 stephd 1.1
86 dfer 1.5 calcium = 1.028 _d -2*salt(i,j,k,bi,bj)/35. _d 0
87 stephd 1.1
88     c 30 micromol = 0.03 mol m-3
89 dfer 1.5 silicaTEST = 0.03 _d 0
90 stephd 1.3 po4local = PTR_PO4(i,j,k)
91     diclocal = PTR_DIC(i,j,k)
92     alklocal = PTR_ALK(i,j,k)
93 dfer 1.5 pHlocal = 7.9 _d 0
94 stephd 1.1
95     CMICK - TEMPORARY!!!!!
96     CMICK silica = fixed
97     CMICK silica = fixed
98     C
99     CMICK -DEC 04
100     CMICK- NOW ITERATE pH SOLVER AT DEPTH ONLY
101     CMICK TO ENSURE ACCURATE ESTIMATE OF CO3 AT DEPTH
102     CMICK - NOTE Si STILL USING A UNIFORM DUMMY VALUE
103     CO3itermax = 10
104     CMICK - SO NOW WE ITERATE, UPDATING THE ESTIMATE OF pH and CO3--
105     CMICK - SINCE WE CALL THIS FOR DEEP OCEAN INFREQUENTLY (MONTHLY?)
106     CMIKC - CAN AFFORD TO MAKE SEVERAL ITERATIONS...
107     DO CO3iter = 1, CO3itermax
108 dfer 1.11 CALL CALC_PCO2_APPROX(
109 stephd 1.1 I theta(i,j,k,bi,bj),salt(i,j,k,bi,bj),
110     I diclocal, po4local,
111     I silicaTEST,alklocal,
112     I ak1(i,j,bi,bj),ak2(i,j,bi,bj),
113     I ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj),
114     I aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj),
115 dfer 1.11 I aksi(i,j,bi,bj),akf(i,j,bi,bj),
116     I ak0(i,j,bi,bj), fugf(i,j,bi,bj), ff(i,j,bi,bj),
117 stephd 1.1 I bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
118 jmc 1.9 U pHlocal,pCO2local,carbonate,
119 jmc 1.10 I i,j,k,bi,bj,myIter,myThid )
120 stephd 1.1 c........................................................
121     c if(i .eq. 76 .and. j .eq. 36 .and. k .eq. 15) then
122     c write(6,*)'Iteration, pH = ',CO3iter,pHlocal
123     c endif
124     c........................................................
125     END DO
126    
127    
128     omegaC(i,j,k,bi,bj) = calcium * carbonate /
129     & Ksp_TP_Calc(i,j,bi,bj)
130    
131     cmick...................................................
132     c if(omegaC(i,j,k,bi,bj) .eq. 0.) then
133     c if(i .eq. 76 .and. j .eq. 36 .and. k .eq. 15) then
134     c write(6,*)'i,j,k,KS,CO3,pHCa,T,S,hfacc,omega',
135     c & i,j,k,
136     c & Ksp_TP_Calc(i,j,bi,bj),
137     c & carbonate,calcium,pHlocal,
138     c & theta(i,j,k,bi,bj),salt(i,j,k,bi,bj),
139     c & hfacc(i,j,k,bi,bj),omegaC(i,j,k,bi,bj)
140     c write(6,*)'Ksp_TP_Calc',
141     c & Ksp_TP_Calc(i,j,bi,bj)
142     c write(6,*)'dic, alk, po4 ',
143     c & diclocal, alklocal,po4local
144     c write(6,*)'k1, k2, k1p, k2p, k3p ',
145     c & ak1(i,j,bi,bj),ak2(i,j,bi,bj),
146     c & ak1p(i,j,bi,bj),ak2p(i,j,bi,bj),ak3p(i,j,bi,bj)
147     c write(6,*)'ks, kb, kw, ksi ',
148     c & aks(i,j,bi,bj),akb(i,j,bi,bj),akw(i,j,bi,bj),
149     c & aksi(i,j,bi,bj)
150     c write(6,*)'akf, ff, bt, st, ft ',
151     c & akf(i,j,bi,bj),ff(i,j,bi,bj),
152     c & bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj)
153     c end if
154     cmick....................................................
155     else
156 dfer 1.5 omegaC(i,j,k,bi,bj) = 0. _d 0
157 stephd 1.1 endif
158    
159     ENDDO
160     ENDDO
161    
162     ENDDO
163     c
164     #endif
165     #endif
166     RETURN
167     END

  ViewVC Help
Powered by ViewVC 1.1.22