Skip to content

Commit

Permalink
Merge pull request #133 from derpycode/_closedC
Browse files Browse the repository at this point in the history
_closedC -> master
  • Loading branch information
DomHu authored Jul 22, 2020
2 parents c6eeb2a + 073668a commit 362934a
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
43 changes: 40 additions & 3 deletions genie-biogem/src/fortran/biogem.f90
Original file line number Diff line number Diff line change
Expand Up @@ -487,23 +487,60 @@ subroutine biogem( &
loc_vocn(l) = ocn(l2io(l),i,j,loc_k1)
end DO
call sub_box_remin_redfield(loc_vocn,loc_conv_ls_lo(:,:))
! set sed tracer -> POP
ls = is2l(is_POP)
loc_tot_i = conv_ls_lo_i(0,ls)
do loc_i=1,loc_tot_i
lo = conv_ls_lo_i(loc_i,ls)
if (lo == io2l(io_PO4)) then
loc_remin = loc_conv_ls_lo(lo,ls)*bio_settle(l2is(ls),i,j,loc_k1)
dum_sfxsumrok1(io_PO4,i,j) = dum_sfxsumrok1(io_PO4,i,j) + &
& (loc_remin - locij_fsedocn(io_PO4,i,j))
dum_sfxsumrok1(l2io(lo),i,j) = dum_sfxsumrok1(l2io(lo),i,j) + &
& (loc_remin - locij_fsedocn(l2io(lo),i,j))
if (ctrl_bio_red_ALKwithPOC) then
! do nothing -- ALK with POC
else
dum_sfxsumrok1(io_ALK,i,j) = dum_sfxsumrok1(io_ALK,i,j) + &
& conv_sed_ocn(io_ALK,is_POP)*(loc_remin - locij_fsedocn(io_PO4,i,j))
& conv_sed_ocn(io_ALK,is_POP)*(loc_remin - locij_fsedocn(io_PO4,i,j))
end if
end if
end do
end if
if (ctrl_force_sed_closed_C) then
! special case of partial closure -- calculate theoretical DIC remin flux required for closure
! set weathering equal to imbalance in DIC return
DO l=1,n_l_ocn
loc_vocn(l) = ocn(l2io(l),i,j,loc_k1)
end DO
call sub_box_remin_redfield(loc_vocn,loc_conv_ls_lo(:,:))
! set sed tracer -> POC
ls = is2l(is_POC)
loc_tot_i = conv_ls_lo_i(0,ls)
do loc_i=1,loc_tot_i
lo = conv_ls_lo_i(loc_i,ls)
if (lo == io2l(io_DIC)) then
loc_remin = loc_conv_ls_lo(lo,ls)*bio_settle(l2is(ls),i,j,loc_k1)
dum_sfxsumrok1(l2io(lo),i,j) = dum_sfxsumrok1(l2io(lo),i,j) + &
& (loc_remin - locij_fsedocn(l2io(lo),i,j))
if (ctrl_bio_red_ALKwithPOC) then
dum_sfxsumrok1(io_ALK,i,j) = dum_sfxsumrok1(io_ALK,i,j) + &
& conv_sed_ocn(io_ALK,is_POC)*(loc_remin - locij_fsedocn(l2io(lo),i,j))
else
! do nothing -- ALK with POP
end if
end if
end do
! set sed tracer -> 13POC
ls = is2l(is_POC_13C)
loc_tot_i = conv_ls_lo_i(0,ls)
do loc_i=1,loc_tot_i
lo = conv_ls_lo_i(loc_i,ls)
if (lo == io2l(io_DIC_13C)) then
loc_remin = loc_conv_ls_lo(lo,ls)*bio_settle(l2is(ls),i,j,loc_k1)
dum_sfxsumrok1(l2io(lo),i,j) = dum_sfxsumrok1(l2io(lo),i,j) + &
& (loc_remin - locij_fsedocn(l2io(lo),i,j))
end if
end do
end if
end if ! [(ctrl_force_sed_closedsystem)]
! convert fluxes to remin
DO l=3,n_l_ocn
Expand Down
1 change: 1 addition & 0 deletions genie-biogem/src/fortran/biogem_data.f90
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ SUBROUTINE sub_load_goin_biogem(dum_dtyr)
print*,'--- BOUNDARY CONDITIONS ----------------------------'
print*,'Set dissolution flux = rain flux to close system? : ',ctrl_force_sed_closedsystem
print*,'Balance the P cycle (with weathering)? : ',ctrl_force_sed_closed_P
print*,'Balance the C cycle (with weathering)? : ',ctrl_force_sed_closed_C
print*,'set reflective boundary condition for POM? : ',ctrl_force_sed_reflective_POM
print*,'Allow temperature / salinity forcing of climate? : ',ctrl_force_GOLDSTEInTS
print*,'Allow ONLY temperature / salinity forcing? : ',ctrl_force_GOLDSTEInTSonly
Expand Down
3 changes: 2 additions & 1 deletion genie-biogem/src/fortran/biogem_lib.f90
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ MODULE biogem_lib
logical::ctrl_force_sed_closedsystem ! Set dissolution flux = rain flux to close system?
NAMELIST /ini_biogem_nml/ctrl_force_sed_closedsystem
logical::ctrl_force_sed_closed_P ! Balance the P cycle (with weathering)?
NAMELIST /ini_biogem_nml/ctrl_force_sed_closed_P
logical::ctrl_force_sed_closed_C ! Balance the C cycle (with weathering)?
NAMELIST /ini_biogem_nml/ctrl_force_sed_closed_P,ctrl_force_sed_closed_C
logical::ctrl_force_sed_reflective_POM ! Set reflective boundary condition for POM?
NAMELIST /ini_biogem_nml/ctrl_force_sed_reflective_POM
logical::ctrl_force_GOLDSTEInTS ! Allow temperature / salinity forcing of climate?
Expand Down
4 changes: 4 additions & 0 deletions genie-main/src/xml-config/xml/definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4020,6 +4020,10 @@
<value datatype="boolean">.false.</value>
<description>Balance the P cycle (with weathering)?</description>
</param>
<param name="ctrl_force_sed_closed_C">
<value datatype="boolean">.false.</value>
<description>Balance the C cycle (with weathering)?</description>
</param>
<param name="ctrl_force_sed_reflective_POM">
<value datatype="boolean">.false.</value>
<description>Set reflective boundary condition for POM? </description>
Expand Down

0 comments on commit 362934a

Please sign in to comment.