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

Diff of /MITgcm_contrib/darwin2/pkg/darwin/dic_carbon_chem.F

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

revision 1.1 by jahn, Wed Apr 13 18:56:24 2011 UTC revision 1.2 by stephd, Wed Apr 20 19:19:27 2011 UTC
# Line 18  C !INTERFACE: ========================== Line 18  C !INTERFACE: ==========================
18       I                       k1plocal,k2plocal,k3plocal,       I                       k1plocal,k2plocal,k3plocal,
19       I                       kslocal,kblocal,kwlocal,       I                       kslocal,kblocal,kwlocal,
20       I                       ksilocal,kflocal,       I                       ksilocal,kflocal,
21         I                       k0local, fugflocal,
22       I                       fflocal,btlocal,stlocal,ftlocal,       I                       fflocal,btlocal,stlocal,ftlocal,
23       U                       pHlocal,pCO2surfloc,       U                       pHlocal,pCO2surfloc,
24       I                       myThid)       I                       myThid)
# Line 55  C       s   = salinity (PSU) Line 56  C       s   = salinity (PSU)
56          _RL  k1local, k2local          _RL  k1local, k2local
57          _RL  k1plocal, k2plocal, k3plocal          _RL  k1plocal, k2plocal, k3plocal
58          _RL  kslocal, kblocal, kwlocal, ksilocal, kflocal          _RL  kslocal, kblocal, kwlocal, ksilocal, kflocal
59            _RL  k0local, fugflocal
60          INTEGER myThid          INTEGER myThid
61  CEndOfInterface  CEndOfInterface
62    
# Line 114  C -------------------------------------- Line 116  C --------------------------------------
116          _RL  dpCO2          _RL  dpCO2
117          _RL  phguess          _RL  phguess
118          _RL  atmpres          _RL  atmpres
119            _RL  fco2
120          INTEGER inewton          INTEGER inewton
121          INTEGER ibrack          INTEGER ibrack
122          INTEGER hstep          INTEGER hstep
# Line 315  c -------------------------------------- Line 318  c --------------------------------------
318  c Add two output arguments for storing pCO2surf  c Add two output arguments for storing pCO2surf
319  c Should we be using K0 or ff for the solubility here?  c Should we be using K0 or ff for the solubility here?
320  c ---------------------------------------------------------------  c ---------------------------------------------------------------
321    #ifdef WATERVAP_BUG
322          pCO2surfloc = co2star / fflocal          pCO2surfloc = co2star / fflocal
323    #else
324    c Corrected by Val Bennington (Nov 2010)
325            fco2 = co2star / k0local
326            pCO2surfloc = fco2/fugflocal
327    #endif
328    
329  C ----------------------------------------------------------------  C ----------------------------------------------------------------
330  C Reconvert units back to original values for input arguments  C Reconvert units back to original values for input arguments
# Line 478  CC                             Taka Ito Line 487  CC                             Taka Ito
487  CC                             Stephanie Dutkiewicz CC  CC                             Stephanie Dutkiewicz CC
488  CC  20 April 2003                                   CC  CC  20 April 2003                                   CC
489  CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC  CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
490    C Apr 2011: fix vapour bug (following Bennington)
491  #include "DARWIN_OPTIONS.h"  #include "DARWIN_OPTIONS.h"
492  CStartOfInterFace  CStartOfInterFace
493         SUBROUTINE CALC_PCO2_APPROX(         SUBROUTINE CALC_PCO2_APPROX(
# Line 486  CStartOfInterFace Line 496  CStartOfInterFace
496       I                       k1plocal,k2plocal,k3plocal,       I                       k1plocal,k2plocal,k3plocal,
497       I                       kslocal,kblocal,kwlocal,       I                       kslocal,kblocal,kwlocal,
498       I                       ksilocal,kflocal,       I                       ksilocal,kflocal,
499         I                       k0local, fugflocal,
500       I                       fflocal,btlocal,stlocal,ftlocal,       I                       fflocal,btlocal,stlocal,ftlocal,
501       U                       pHlocal,pCO2surfloc,       U                       pHlocal,pCO2surfloc,
502       I                       myThid)       I                       myThid)
# Line 517  C       s   = salinity (PSU) Line 528  C       s   = salinity (PSU)
528          _RL  k1local, k2local          _RL  k1local, k2local
529          _RL  k1plocal, k2plocal, k3plocal          _RL  k1plocal, k2plocal, k3plocal
530          _RL  kslocal, kblocal, kwlocal, ksilocal, kflocal          _RL  kslocal, kblocal, kwlocal, ksilocal, kflocal
531            _RL  k0local, fugflocal
532          INTEGER myThid          INTEGER myThid
533  CEndOfInterface  CEndOfInterface
534    
# Line 531  C     == Local variables == Line 543  C     == Local variables ==
543          _RL  co2s          _RL  co2s
544          _RL  h3po4g, h2po4g, hpo4g, po4g            _RL  h3po4g, h2po4g, hpo4g, po4g  
545          _RL  siooh3g          _RL  siooh3g
546            _RL  fco2
547  c carbonate  c carbonate
548          _RL  co3local          _RL  co3local
549    
# Line 598  c    &         (hnew*hnew + k1local*hnew Line 611  c    &         (hnew*hnew + k1local*hnew
611    
612  c ---------------------------------------------------------------  c ---------------------------------------------------------------
613  c surface pCO2 (following Dickson and Goyet, DOE...)  c surface pCO2 (following Dickson and Goyet, DOE...)
614    #ifdef WATERVAP_BUG
615          pCO2surfloc = co2s/fflocal          pCO2surfloc = co2s/fflocal
616    #else
617    c bug fix by Bennington
618            fco2 = co2s/k0local
619            pco2surfloc = fco2/fugflocal
620    #endif
621    
622  C ----------------------------------------------------------------  C ----------------------------------------------------------------
623  c Reconvert from mol/kg -> mol/m^3  c Reconvert from mol/kg -> mol/m^3
# Line 642  c     - I have changed things slightly s Line 661  c     - I have changed things slightly s
661  c     - Thus, all input concentrations (diclocal, ta, pt, and st) should be  c     - Thus, all input concentrations (diclocal, ta, pt, and st) should be
662  c       given in mol/m^3; output arguments "co2star" and "dco2star"    c       given in mol/m^3; output arguments "co2star" and "dco2star"  
663  c       are likewise be in mol/m^3.  c       are likewise be in mol/m^3.
664    C
665    C Apr 2011: fix vapour bug (following Bennington)
666  C--------------------------------------------------------------------------  C--------------------------------------------------------------------------
667          IMPLICIT NONE          IMPLICIT NONE
668  C     == GLobal variables ==  C     == GLobal variables ==
# Line 685  C LOCAL VARIABLES Line 706  C LOCAL VARIABLES
706          _RL  invtk          _RL  invtk
707          _RL  is          _RL  is
708          _RL  is2          _RL  is2
709    c add Bennington
710            _RL  P1atm
711            _RL  Rgas
712            _RL  RT
713            _RL  delta
714            _RL  B1
715            _RL  B
716          INTEGER i          INTEGER i
717          INTEGER j          INTEGER j
718    
# Line 717  C terms used more than once Line 745  C terms used more than once
745             sqrts=sqrt(s)             sqrts=sqrt(s)
746             s15=s**1.5 _d 0             s15=s**1.5 _d 0
747             scl=s/1.80655 _d 0             scl=s/1.80655 _d 0
748    C -----------------------------------------------------------------------
749    C added by Val Bennington Nov 2010
750    C Fugacity Factor needed for non-ideality in ocean
751    C ff used for atmospheric correction for water vapor and pressure
752    C Weiss (1974) Marine Chemistry
753               P1atm = 1.01325 _d 0 ! bars
754               Rgas = 83.1451 _d 0 ! bar*cm3/(mol*K)
755               RT = Rgas*tk
756               delta = (57.7 _d 0 - 0.118 _d 0*tk)
757               B1 = -1636.75 _d 0 + 12.0408 _d 0*tk - 0.0327957 _d 0*tk*tk
758               B = B1 + 3.16528 _d 0*tk*tk*tk*(0.00001 _d 0)
759               fugf(i,j,bi,bj) = exp( (B+2. _d 0*delta) * P1atm / RT)
760  C------------------------------------------------------------------------  C------------------------------------------------------------------------
761  C f = k0(1-pH2O)*correction term for non-ideality  C f = k0(1-pH2O)*correction term for non-ideality
762  C Weiss & Price (1980, Mar. Chem., 8, 347-359; Eq 13 with table 6 values)  C Weiss & Price (1980, Mar. Chem., 8, 347-359; Eq 13 with table 6 values)
# Line 808  C Riley (1965) Line 848  C Riley (1965)
848             ft(i,j,bi,bj) = 0.000067 _d 0 * scl/18.9984 _d 0             ft(i,j,bi,bj) = 0.000067 _d 0 * scl/18.9984 _d 0
849  C------------------------------------------------------------------------  C------------------------------------------------------------------------
850           else           else
851    c add Bennington
852                fugf(i,j,bi,bj)=0. _d 0
853              ff(i,j,bi,bj)=0. _d 0              ff(i,j,bi,bj)=0. _d 0
854              ak0(i,j,bi,bj)= 0. _d 0              ak0(i,j,bi,bj)= 0. _d 0
855              ak1(i,j,bi,bj)= 0. _d 0              ak1(i,j,bi,bj)= 0. _d 0

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22