Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for surface pH output #221

Merged
merged 4 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ set SRF_ALKALI = '4, 2, 2'
set SRF_SILICA = '0, 2, 2'
set SRF_DIC = '4, 2, 2'
set SRF_PHYTO = '4, 2, 2'
set SRF_PH = '0, 2, 2'
set SRF_EXPORT = '0, 2, 2'
set SRF_EXPOSI = '0, 2, 2'
set SRF_EXPOCA = '0, 2, 2'
Expand All @@ -446,6 +447,7 @@ set SRF_ATMO2 = '0, 2, 2'
set SRF_ATMN2 = '0, 2, 2'
set SRF_NATDIC = '0, 2, 2'
set SRF_NATALKALI = '0, 2, 2'
set SRF_NATPH = '0, 2, 2'
set SRF_NATPCO2 = '0, 2, 2'
set SRF_NATCO2FX = '0, 2, 2'
set SRF_CO213FXD = '0, 2, 2'
Expand Down Expand Up @@ -1535,8 +1537,10 @@ cat >>! $RUNDIR/ocn_in$inststr << EOF
! IRON - Dissolved iron (dfe) [mol Fe m-3]
! SILICA - Silicate (si) [mol Si m-3]
! PHYTO - Phytoplankton (phyc) [mol C m-3]
! PH - pH (ph) [-log10([h+])]
! NATDIC - Natural dissolved carbon (natdissic) [mol C m-3]
! NATALKALI - Natural alkalinity (nattalk) [eq m-3]
! NATPH - Natural pH (natph) [-log10([h+])]
!
! Other 3d tracer or diagnostic variables (LYR or LVL)
! DP - Layer thickness (pddpo) [m]
Expand All @@ -1554,14 +1558,12 @@ cat >>! $RUNDIR/ocn_in$inststr << EOF
! PHOSY - Primary production (pp) [mol C m-3 s-1]
! CO3 - Carbonate ions (co3) [mol C m-3]
! N2O - Nitrous oxide concentration [mol N2O m-3]
! PH - pH (ph) [-log10([h+])]
! OMEGAA - Aragonite saturation state (omegaa) [1]
! OMEGAC - Calcite saturation state (omegac) [1]
! NATDIC - Natural dissolved carbon (natdissic) [mol C m-3]
! NATALKALI - Natural alkalinity (nattalk) [eq m-3]
! NATCO3 - Natural carbonate ion concentration (natco3) [mol C m-3]
! NATCALC - Natural CaCO3 shells (natcalc) [mol C m-3]
! NATPH - Natural pH (natph) [-log10([h+])]
! NATOMEGAA - Natural aragonite saturation state (natomegaa) [1]
! NATOMEGAC - Natural calcite saturation state (natomegac) [1]
! DIC13 - Dissolved C13 (dissic13) [mol C m-3]
Expand Down Expand Up @@ -1668,6 +1670,7 @@ cat >>! $RUNDIR/ocn_in$inststr << EOF
SRF_SILICA = $SRF_SILICA
SRF_DIC = $SRF_DIC
SRF_PHYTO = $SRF_PHYTO
SRF_PH = $SRF_PH
SRF_EXPORT = $SRF_EXPORT
SRF_EXPOSI = $SRF_EXPOSI
SRF_EXPOCA = $SRF_EXPOCA
Expand All @@ -1692,6 +1695,7 @@ cat >>! $RUNDIR/ocn_in$inststr << EOF
SRF_ATMN2 = $SRF_ATMN2
SRF_NATDIC = $SRF_NATDIC
SRF_NATALKALI = $SRF_NATALKALI
SRF_NATPH = $SRF_NATPH
SRF_NATPCO2 = $SRF_NATPCO2
SRF_NATCO2FX = $SRF_NATCO2FX
SRF_CO213FXD = $SRF_CO213FXD
Expand Down
11 changes: 6 additions & 5 deletions hamocc/accfields.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ SUBROUTINE ACCFIELDS(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
& jlvlprefo2,jlvlprefpo4,jlvlsf6,jlvlsilica,jlvlwnos,jlvlwphy,jn2flux,jn2o,jn2oflux,jn2ofx, &
& jprorca,jprcaca,jsilpro,jpodiic,jpodial,jpodiph,jpodiox,jpodin2,jpodino3,jpodisi,jndep, &
& jniflux,jnos,jo2flux,jo2sat,jomegaa,jomegac,jopal,joxflux,joxygen,jpco2,jpco2m,jkwco2khm,jco2khm, &
& jco2kh,jph,jphosph,jphosy,jphyto, &
& jpoc,jprefalk,jprefdic,jprefo2,jprefpo4,jsilica,jsrfalkali,jsrfano3,jsrfdic,jsrfiron,jsrfoxygen, &
& jsrfphosph,jsrfphyto,jsrfsilica,jwnos,jwphy,nbgc,nacc_bgc,bgcwrt,glb_inventory,bgct2d,acclvl, &
& acclyr,accsrf,bgczlv
& jco2kh,jph,jphosph,jphosy,jphyto,jpoc,jprefalk,jprefdic,jprefo2,jprefpo4,jsilica,jsrfalkali, &
& jsrfano3,jsrfdic,jsrfiron,jsrfoxygen,jsrfphosph,jsrfphyto,jsrfsilica,jsrfph,jwnos,jwphy, &
& nbgc,nacc_bgc,bgcwrt,glb_inventory,bgct2d,acclvl,acclyr,accsrf,bgczlv
use mo_control_bgc, only: io_stdo_bgc
use mo_param1_bgc, only: ialkali,ian2o,iano3,iatmco2,iatmdms,iatmn2,iatmn2o,iatmo2,icalc,idet,idms,idicsat,idoc,iiron,iopal,&
& ioxygen,iphosph,iphy,iprefalk,iprefdic,iprefpo4,iprefo2,isco212,isilica,izoo, &
Expand Down Expand Up @@ -100,7 +99,7 @@ SUBROUTINE ACCFIELDS(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
use mo_param1_bgc, only: iatmnco2,inatalkali,inatcalc,inatsco212
use mo_carbch, only: natco3,nathi,natomegaa,natomegac,natpco2d
use mo_bgcmean, only: jlvlnatph,jnatalkali,jnatcalc,jnatco2fx,jnatco3,jnatdic,jnatomegaa,jnatomegac,jnatpco2,jnatph, &
& jsrfnatalk,jsrfnatdic
& jsrfnatalk,jsrfnatdic,jsrfnatph
#endif
#ifndef sedbypass
use mo_param1_bgc, only: ipowaal,ipowaic,ipowaox,ipowaph,ipowasi,ipown2,ipowno3,isssc12,issso12,issssil,issster
Expand Down Expand Up @@ -242,6 +241,7 @@ SUBROUTINE ACCFIELDS(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
call accsrf(jsrfsilica,ocetra(1,1,1,isilica),omask,0)
call accsrf(jsrfdic,ocetra(1,1,1,isco212),omask,0)
call accsrf(jsrfphyto,ocetra(1,1,1,iphy),omask,0)
call accsrf(jsrfph,hi(1,1,1),omask,0)
call accsrf(jdms,ocetra(1,1,1,idms),omask,0)
call accsrf(jexport,expoor,omask,0)
call accsrf(jexpoca,expoca,omask,0)
Expand All @@ -256,6 +256,7 @@ SUBROUTINE ACCFIELDS(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
call accsrf(jsrfnatdic,ocetra(1,1,1,inatsco212),omask,0)
call accsrf(jsrfnatalk,ocetra(1,1,1,inatalkali),omask,0)
call accsrf(jnatpco2,natpco2d,omask,0)
call accsrf(jsrfnatph,nathi(1,1,1),omask,0)
#endif
#ifdef BROMO
call accsrf(jsrfbromo,ocetra(1,1,1,ibromo),omask,0)
Expand Down
14 changes: 11 additions & 3 deletions hamocc/mo_bgcmean.F90
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ MODULE mo_bgcmean
& SRF_SF6 =0 ,SRF_PHOSPH =0 ,SRF_OXYGEN =0 , &
& SRF_IRON =0 ,SRF_ANO3 =0 ,SRF_ALKALI =0 , &
& SRF_SILICA =0 ,SRF_DIC =0 ,SRF_PHYTO =0 , &
& SRF_PH =0 , &
& SRF_NATDIC =0 ,SRF_NATALKALI =0 ,SRF_NATPCO2 =0 , &
& SRF_NATCO2FX =0 , &
& SRF_NATCO2FX =0 ,SRF_NATPH =0 , &
& SRF_ATMBROMO =0 ,SRF_BROMO =0 ,SRF_BROMOFX =0 , &
& INT_BROMOPRO =0 ,INT_BROMOUV =0 , &
& INT_PHOSY =0 ,INT_NFIX =0 ,INT_DNIT =0 , &
Expand Down Expand Up @@ -165,8 +166,9 @@ MODULE mo_bgcmean
& SRF_SF6 ,SRF_PHOSPH ,SRF_OXYGEN , &
& SRF_IRON ,SRF_ANO3 ,SRF_ALKALI , &
& SRF_SILICA ,SRF_DIC ,SRF_PHYTO , &
& SRF_PH , &
& SRF_NATDIC ,SRF_NATALKALI ,SRF_NATPCO2 , &
& SRF_NATCO2FX , &
& SRF_NATCO2FX ,SRF_NATPH , &
& SRF_ATMBROMO ,SRF_BROMO ,SRF_BROMOFX , &
& INT_BROMOPRO ,INT_BROMOUV , &
& INT_PHOSY ,INT_NFIX ,INT_DNIT , &
Expand Down Expand Up @@ -292,6 +294,7 @@ MODULE mo_bgcmean
& jsrfsilica = 0 , &
& jsrfdic = 0 , &
& jsrfphyto = 0 , &
& jsrfph = 0 , &
& jintphosy = 0 , &
& jintnfix = 0 , &
& jintdnit = 0 , &
Expand Down Expand Up @@ -327,7 +330,8 @@ MODULE mo_bgcmean
& jsrfnatdic = 0 , &
& jsrfnatalk = 0 , &
& jnatpco2 = 0 , &
& jnatco2fx = 0
& jnatco2fx = 0 , &
& jsrfnatph = 0

INTEGER, DIMENSION(nbgcmax), SAVE :: &
& jbromofx = 0 , &
Expand Down Expand Up @@ -620,6 +624,8 @@ SUBROUTINE ALLOC_MEM_BGCMEAN(kpie,kpje,kpke)
jsrfdic(n)=i_bsc_m2d*min(1,SRF_DIC(n))
IF (SRF_PHYTO(n).GT.0) i_bsc_m2d=i_bsc_m2d+1
jsrfphyto(n)=i_bsc_m2d*min(1,SRF_PHYTO(n))
IF (SRF_PH(n).GT.0) i_bsc_m2d=i_bsc_m2d+1
jsrfph(n)=i_bsc_m2d*min(1,SRF_PH(n))
IF (INT_PHOSY(n).GT.0) i_bsc_m2d=i_bsc_m2d+1
jintphosy(n)=i_bsc_m2d*min(1,INT_PHOSY(n))
IF (INT_NFIX(n).GT.0) i_bsc_m2d=i_bsc_m2d+1
Expand Down Expand Up @@ -705,6 +711,8 @@ SUBROUTINE ALLOC_MEM_BGCMEAN(kpie,kpje,kpke)
jnatpco2(n)=i_bsc_m2d*min(1,SRF_NATPCO2(n))
IF (SRF_NATCO2FX(n).GT.0) i_bsc_m2d=i_bsc_m2d+1
jnatco2fx(n)=i_bsc_m2d*min(1,SRF_NATCO2FX(n))
IF (SRF_NATPH(n).GT.0) i_bsc_m2d=i_bsc_m2d+1
jsrfnatph(n)=i_bsc_m2d*min(1,SRF_NATPH(n))
#endif
#ifdef BROMO
IF (SRF_BROMO(n).GT.0) i_bsc_m2d=i_bsc_m2d+1
Expand Down
Loading