Skip to content

Commit

Permalink
Read parameters for alkalinization scenario from namelist file.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasTorsvik committed Jan 24, 2023
1 parent 97676b6 commit 69f30fe
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 21 deletions.
19 changes: 19 additions & 0 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,25 @@ cat >>! $RUNDIR/ocn_in$inststr << EOF
SEDPORFILE = $SEDPORFILE
/
! NAMELIST FOR ALKALINIZATION SCENARIO
!
! CONTENTS:
!
! ADDALK_TOT : Pmol alkalinity/yr added in the scenarios.
! CDRMIP_LATMAX : Max latitude where alkalinity is added according to the
! CDRMIP protocol
! CDRMIP_LATMIN : Min latitude where alkalinity is added according to the
! CDRMIP protocol
! RAMP_START : Start year for ramp up in 'ramp' scenario
! RAMP_END : End year for 'ramp' scenario
&BGCNML
ADDALK_TOT = 0.135
CDRMIP_LATMAX = 70.0
CDRMIP_LATMIN = -60.0
RAMP_START = 2025
RAMP_END = 2035
/
! IO-NAMELIST FOR DIAGNOSTIC iHAMOCC OUTPUT
!
! Namelist acronyms:
Expand Down
45 changes: 24 additions & 21 deletions hamocc/mo_read_oafx.F90
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,21 @@ module mo_read_oafx
! ALK/yr-1 from 2025 to 2035 over the ice-free surface ocean
! (assumed to be between 60S and 70N)
!
real, parameter :: addalk_0p14 = 0.14 ! Pmol alkalinity/yr added in the
real, parameter :: addalk_0p56 = 0.56 ! 'const_0p14' and 'const_0p56'
! scenarios
real, parameter :: cdrmip_latmax = 70.0 ! Min and max latitude where
real, parameter :: cdrmip_latmin = -60.0 ! alkalinity is added according
real, protected :: addalk_tot = 0.56 ! Pmol alkalinity/yr added in the
! scenarios. Read from namelist file
! to overwrite default value.
real, protected :: cdrmip_latmax = 70.0 ! Min and max latitude where
real, protected :: cdrmip_latmin = -60.0 ! alkalinity is added according
! to the CDRMIP protocol
real, parameter :: addalk_ramp = 0.135 ! Max Pmol alkalinity/yr added
integer, parameter :: ramp_start = 2025 ! in 2035 in the 'ramp' scenario,
integer, parameter :: ramp_end = 2035 ! starting at 0 Pmol/yr in 2025.
integer, protected :: ramp_start = 2025 ! In 'ramp' scenario, start at
integer, protected :: ramp_end = 2035 ! 0 Pmol/yr in ramp_start, and max
! addalk_const Pmol/yr in ramp_end.

logical, save :: lini = .false.

namelist /bgcoafx/ addalk_tot,cdrmip_latmax,cdrmip_latmin, &
& ramp_start,ramp_end

!******************************************************************************
contains

Expand Down Expand Up @@ -126,17 +129,18 @@ subroutine ini_read_oafx(kpie,kpje,pdlxp,pdlyp,pglat,omask)
!
!******************************************************************************
use mod_xc, only: xcsum,xchalt,mnproc,nbdy,ips
use mo_control_bgc, only: io_stdo_bgc,do_oalk
use mo_control_bgc, only: io_stdo_bgc,do_oalk,bgc_namelist,get_bgc_namelist

implicit none
implicit none

integer, intent(in) :: kpie,kpje
real, intent(in) :: pdlxp(kpie,kpje), pdlyp(kpie,kpje)
real, intent(in) :: pglat(1-nbdy:kpie+nbdy,1-nbdy:kpje+nbdy)
real, intent(in) :: pglat(1-nbdy:kpie+nbdy,1-nbdy:kpje+nbdy)
real, intent(in) :: omask(kpie,kpje)

integer :: i,j,errstat
real :: avflx,ztotarea,addalk_tot
integer :: iounit
real :: avflx,ztotarea
real :: ztmp1(1-nbdy:kpie+nbdy,1-nbdy:kpje+nbdy)

! Return if alkalinization is turned off
Expand Down Expand Up @@ -166,6 +170,13 @@ subroutine ini_read_oafx(kpie,kpje,pdlxp,pdlyp,pglat,omask)
write(io_stdo_bgc,*)' '
endif

! Read parameters for alkalinization fluxes from namelist file
if(.not. allocated(bgc_namelist)) call get_bgc_namelist
open (newunit=iounit, file=bgc_namelist, status='old' &
& ,action='read')
read (unit=iounit, nml=BGCOAFX)
close (unit=iounit)

! Allocate field to hold constant alkalinization fluxes
if(mnproc.eq.1) then
write(io_stdo_bgc,*)'Memory allocation for variable oalkflx ...'
Expand All @@ -189,15 +200,7 @@ subroutine ini_read_oafx(kpie,kpje,pdlxp,pdlyp,pglat,omask)
enddo

call xcsum(ztotarea,ztmp1,ips)

if( trim(oalkscen)=='const_0p14') then
addalk_tot = addalk_0p14
else if( trim(oalkscen)=='const_0p56') then
addalk_tot = addalk_0p56
else
addalk_tot = addalk_ramp
endif


! Calculate alkalinity flux (kmol m^2 yr-1) to be applied
avflx = addalk_tot/ztotarea*Pmol2kmol
if(mnproc.eq.1) then
Expand Down

0 comments on commit 69f30fe

Please sign in to comment.