-
Notifications
You must be signed in to change notification settings - Fork 25
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
Lon-lat variable sediment porosity #189
Changes from 18 commits
cb2ddf8
21aa70d
61e0cec
654b6d5
0198811
3f35c6b
55948dd
96311dc
2fedbd9
afc9628
6cb54ab
9623c12
f98bb5a
fe7788c
a3366dc
86ff2c8
cbab888
9e60515
978a95b
e44c152
dce4263
1a7e6ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,6 +237,9 @@ set OALKSCEN = "''" | |
set OALKFILE = "''" | ||
set WITH_DMSPH = .false. | ||
set PI_PH_FILE = "''" | ||
set L_SED_POR = .false. | ||
set SEDPORFILE = "''" | ||
|
||
|
||
# set DIAPHY defaults | ||
set GLB_FNAMETAG = "'hd','hm','hy'" | ||
|
@@ -706,6 +709,7 @@ if ($OCN_GRID == tnx2v1) then | |
set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx2v1_20130927.nc'" | ||
set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx2v1_20130506.nc'" | ||
set SWACLIMFILE = "''" | ||
set SEDPORFILE = "''" | ||
if ($BLOM_RIVER_NUTRIENTS == TRUE) then | ||
set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx2v1_20170915.nc'" | ||
else | ||
|
@@ -726,6 +730,7 @@ else if ($OCN_GRID == tnx1v4) then | |
set CCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/chlorophyll_concentration_tnx1v4_20170608.nc'" | ||
set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx1v4_20170604.nc'" | ||
set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx1v4_20171107.nc'" | ||
set SEDPORFILE = "''" | ||
if ($HAMOCC_VSLS == TRUE) then | ||
set SWACLIMFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/Annual_clim_swa_tnx1v4_20210415.nc'" | ||
else | ||
|
@@ -752,6 +757,7 @@ else if ($OCN_GRID == tnx0.25v4) then | |
set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.25v4_20170623.nc'" | ||
set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.25v4_20181004.nc'" | ||
set SWACLIMFILE = "''" | ||
set SEDPORFILE = "''" | ||
if ($BLOM_RIVER_NUTRIENTS == TRUE) then | ||
set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.25v4_20170821.nc'" | ||
else | ||
|
@@ -773,6 +779,7 @@ else if ($OCN_GRID == tnx0.125v4) then | |
set SCFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/sss_clim_core_tnx0.125v4_20200722.nc'" | ||
set FEDEPFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/dustdep_mhw2006_tnx0.125v4_20200722.nc'" | ||
set SWACLIMFILE = "''" | ||
set SEDPORFILE = "''" | ||
if ($BLOM_RIVER_NUTRIENTS == TRUE) then | ||
set RIVINFILE = "'$DIN_LOC_ROOT/ocn/blom/bndcon/river_nutrients_GNEWS2000_tnx0.125v4_20170821.nc'" | ||
else | ||
|
@@ -1445,6 +1452,8 @@ cat >>! $RUNDIR/ocn_in$inststr << EOF | |
! OXY, NO3, SIL, D13C, and D14C | ||
! WITH_DMSPH : Logical switch to activate DMS calculation as function of pH | ||
! PI_PH_FILE : File name (incl. full path) for surface PI pH input data. | ||
! L_SED_POR : Logical switch to enable lon-lat variable sediment porosity | ||
! SEDPORFILE : File name (incl. full path) for sediment porosity | ||
&BGCNML | ||
ATM_CO2 = $CCSM_CO2_PPMV | ||
FEDEPFILE = $FEDEPFILE | ||
|
@@ -1470,6 +1479,8 @@ cat >>! $RUNDIR/ocn_in$inststr << EOF | |
INID14C = $INID14C | ||
WITH_DMSPH = $WITH_DMSPH | ||
PI_PH_FILE = $PI_PH_FILE | ||
L_SED_POR = $L_SED_POR | ||
SEDPORFILE = $SEDPORFILE | ||
/ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GitHub won't let me add a comment in an untouched part of the code, but further below at line 1840 there is a file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Thanks for the explanation! I'll add that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
! IO-NAMELIST FOR DIAGNOSTIC iHAMOCC OUTPUT | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -17,7 +17,7 @@ | |||||||||||||||||||||||||
! along with BLOM. If not, see https://www.gnu.org/licenses/. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
subroutine bodensed(kpie,kpje,kpke,pddpo) | ||||||||||||||||||||||||||
subroutine bodensed(kpie,kpje,kpke,pddpo,omask,sed_por) | ||||||||||||||||||||||||||
!********************************************************************** | ||||||||||||||||||||||||||
! | ||||||||||||||||||||||||||
!**** *BODENSED* - . | ||||||||||||||||||||||||||
|
@@ -44,15 +44,18 @@ subroutine bodensed(kpie,kpje,kpke,pddpo) | |||||||||||||||||||||||||
!********************************************************************** | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
use mo_sedmnt, only: calcwei,calfa,clafa,claydens,calcdens,opaldens,opalwei,oplfa,orgdens,orgfa,seddzi,porwat,porwah, & | ||||||||||||||||||||||||||
& porsol,dzs,seddw,sedict,solfu,orgwei | ||||||||||||||||||||||||||
use mo_control_bgc, only: dtbgc,io_stdo_bgc | ||||||||||||||||||||||||||
& porsol,dzs,seddw,sedict,solfu,orgwei,zcoefsu,zcoeflo,disso_sil,silsat,disso_poc,sed_denit,disso_caco3 | ||||||||||||||||||||||||||
use mo_control_bgc, only: dtbgc,io_stdo_bgc,l_sed_por | ||||||||||||||||||||||||||
use mo_apply_sedpor,only: apply_sedpor | ||||||||||||||||||||||||||
use mo_param1_bgc, only: ks | ||||||||||||||||||||||||||
use mod_xc, only: mnproc | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
implicit none | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
integer, intent(in) :: kpie,kpje,kpke | ||||||||||||||||||||||||||
real, intent(in) :: pddpo(kpie,kpje,kpke) | ||||||||||||||||||||||||||
real, intent(in) :: omask(kpie,kpje) | ||||||||||||||||||||||||||
real, intent(in) :: sed_por(kpie,kpje,ks) | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
! Local variables | ||||||||||||||||||||||||||
integer :: i,j,k | ||||||||||||||||||||||||||
|
@@ -79,33 +82,60 @@ subroutine bodensed(kpie,kpje,kpke,pddpo) | |||||||||||||||||||||||||
write(io_stdo_bgc,*) ' ' | ||||||||||||||||||||||||||
endif | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
porwat(1) = 0.85 | ||||||||||||||||||||||||||
porwat(2) = 0.83 | ||||||||||||||||||||||||||
porwat(3) = 0.8 | ||||||||||||||||||||||||||
porwat(4) = 0.79 | ||||||||||||||||||||||||||
porwat(5) = 0.77 | ||||||||||||||||||||||||||
porwat(6) = 0.75 | ||||||||||||||||||||||||||
porwat(7) = 0.73 | ||||||||||||||||||||||||||
porwat(8) = 0.7 | ||||||||||||||||||||||||||
porwat(9) = 0.68 | ||||||||||||||||||||||||||
porwat(10) = 0.66 | ||||||||||||||||||||||||||
porwat(11) = 0.64 | ||||||||||||||||||||||||||
porwat(12) = 0.62 | ||||||||||||||||||||||||||
! this initialization can be done later via reading a porosity map | ||||||||||||||||||||||||||
if (l_sed_por)then | ||||||||||||||||||||||||||
! lon-lat variable sediment porosity from input file | ||||||||||||||||||||||||||
call apply_sedpor(kpie,kpje,ks,omask,sed_por) | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it a bit overkill to define an extra module for ~10 lines of code (essentially porwat=sedpor) that could be just placed directly here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :-) - agree - I was debating with myself - I'll change it. |
||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||
porwat(:,:,1) = 0.85 | ||||||||||||||||||||||||||
porwat(:,:,2) = 0.83 | ||||||||||||||||||||||||||
porwat(:,:,3) = 0.8 | ||||||||||||||||||||||||||
porwat(:,:,4) = 0.79 | ||||||||||||||||||||||||||
porwat(:,:,5) = 0.77 | ||||||||||||||||||||||||||
porwat(:,:,6) = 0.75 | ||||||||||||||||||||||||||
porwat(:,:,7) = 0.73 | ||||||||||||||||||||||||||
porwat(:,:,8) = 0.7 | ||||||||||||||||||||||||||
porwat(:,:,9) = 0.68 | ||||||||||||||||||||||||||
porwat(:,:,10) = 0.66 | ||||||||||||||||||||||||||
porwat(:,:,11) = 0.64 | ||||||||||||||||||||||||||
porwat(:,:,12) = 0.62 | ||||||||||||||||||||||||||
endif | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
if (mnproc == 1) then | ||||||||||||||||||||||||||
write(io_stdo_bgc,*) 'Pore water in sediment: ',porwat | ||||||||||||||||||||||||||
write(io_stdo_bgc,*) 'Pore water in sediment initialized' | ||||||||||||||||||||||||||
endif | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
seddzi(1) = 500. | ||||||||||||||||||||||||||
do k = 1, ks | ||||||||||||||||||||||||||
porsol(k) = 1. - porwat(k) | ||||||||||||||||||||||||||
if(k >= 2) porwah(k) = 0.5 * (porwat(k) + porwat(k-1)) | ||||||||||||||||||||||||||
if(k == 1) porwah(k) = 0.5 * (1. + porwat(1)) | ||||||||||||||||||||||||||
seddzi(k+1) = 1. / dzs(k+1) | ||||||||||||||||||||||||||
seddw(k) = 0.5 * (dzs(k) + dzs(k+1)) | ||||||||||||||||||||||||||
do j = 1, kpje | ||||||||||||||||||||||||||
do i = 1, kpie | ||||||||||||||||||||||||||
porsol(i,j,k) = 1. - porwat(i,j,k) | ||||||||||||||||||||||||||
if(k >= 2) porwah(i,j,k) = 0.5 * (porwat(i,j,k) + porwat(i,j,k-1)) | ||||||||||||||||||||||||||
if(k == 1) porwah(i,j,k) = 0.5 * (1. + porwat(i,j,1)) | ||||||||||||||||||||||||||
enddo | ||||||||||||||||||||||||||
enddo | ||||||||||||||||||||||||||
enddo | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
sedict = 1.e-9 * dtbgc ! Moecular diffusion coefficient | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
typo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||||||||||||||||||||||
! Dissolution rate constant of opal (disso) [1/(kmol Si(OH)4/m3)*1/sec] | ||||||||||||||||||||||||||
! THIS NEEDS TO BE CHANGED TO disso=3.e-8! THIS IS ONLY KEPT FOR THE MOMENT | ||||||||||||||||||||||||||
! FOR BACKWARDS COMPATIBILITY | ||||||||||||||||||||||||||
!disso=3.e-8 ! (2011-01-04) EMR | ||||||||||||||||||||||||||
!disso=1.e-6 ! test vom 03.03.04 half live sil ca. 20.000 yr | ||||||||||||||||||||||||||
disso_sil = 1.e-6*dtbgc | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe a bit pedantic, but I think it is best if the commented lines also reflect the code change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, I can do this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||||||||||||||||||||||
! Silicate saturation concentration is 1 mol/m3 | ||||||||||||||||||||||||||
silsat = 0.001 | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
! Degradation rate constant of POP (disso) [1/(kmol O2/m3)*1/sec] | ||||||||||||||||||||||||||
disso_poc = 0.01 / 86400. * dtbgc ! disso=3.e-5 was quite high | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Is this comment relevant, do we need to keep it around? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't tell - maybe @JorgSchwinger made some experiences that allow for better judgement? |
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
sedict = 1.e-9 * dtbgc | ||||||||||||||||||||||||||
! Denitrification rate constant of POP (disso) [1/sec] | ||||||||||||||||||||||||||
sed_denit = 0.01/86400. * dtbgc !ik denit = 1.e-6*dtbgc | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Same as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JorgSchwinger - any reason to keep the comment? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I don't think so, too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed. |
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
! Dissolution rate constant of CaCO3 (disso) [1/(kmol CO3--/m3)*1/sec] | ||||||||||||||||||||||||||
disso_caco3 = 1.e-7 * dtbgc | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
! ****************************************************************** | ||||||||||||||||||||||||||
! densities etc. for SEDIMENT SHIFTING | ||||||||||||||||||||||||||
|
@@ -131,9 +161,26 @@ subroutine bodensed(kpie,kpje,kpke,pddpo) | |||||||||||||||||||||||||
|
||||||||||||||||||||||||||
! determine total solid sediment volume | ||||||||||||||||||||||||||
solfu = 0. | ||||||||||||||||||||||||||
do i = 1, kpie | ||||||||||||||||||||||||||
do j = 1, kpje | ||||||||||||||||||||||||||
do k = 1, ks | ||||||||||||||||||||||||||
solfu = solfu + seddw(k) * porsol(k) | ||||||||||||||||||||||||||
solfu(i,j) = solfu(i,j) + seddw(k) * porsol(i,j,k) | ||||||||||||||||||||||||||
enddo | ||||||||||||||||||||||||||
enddo | ||||||||||||||||||||||||||
enddo | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
! Initialize porosity-dependent diffusion coefficients of sediment | ||||||||||||||||||||||||||
zcoefsu(:,:,0) = 0.0 | ||||||||||||||||||||||||||
do k = 1,ks | ||||||||||||||||||||||||||
do j = 1, kpje | ||||||||||||||||||||||||||
do i = 1, kpie | ||||||||||||||||||||||||||
! sediment diffusion coefficient * 1/dz * fraction of pore water at half depths | ||||||||||||||||||||||||||
zcoefsu(i,j,k ) = -sedict * seddzi(k) * porwah(i,j,k) | ||||||||||||||||||||||||||
zcoeflo(i,j,k-1) = -sedict * seddzi(k) * porwah(i,j,k) ! why the same ? | ||||||||||||||||||||||||||
enddo | ||||||||||||||||||||||||||
enddo | ||||||||||||||||||||||||||
enddo | ||||||||||||||||||||||||||
zcoeflo(:,:,ks) = 0.0 ! diffusion coefficient for bottom sediment layer | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
end subroutine bodensed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a more suggestive name would be preferable? For example L_SEDPOR_2D to indicate that this activates a 2d-spatially variable sediment porosity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Thanks for the suggestion! Maybe
l_3Dvarsedpor
(variable sediment porosity)?!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done