Skip to content

Commit

Permalink
more updates addressing comments in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mvertens committed Oct 7, 2024
1 parent 2b55a4e commit 6032936
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 88 deletions.
32 changes: 17 additions & 15 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,24 @@
<valid_values>UNSET,1850,2000,hist,ssp119,ssp126,ssp245,ssp370,ssp434,ssp460,ssp534os,ssp585</valid_values>
<default_value>1850</default_value>
<values>
<value compset="HIST_CAM60%NORESM.*_BLOM%ECO" >hist</value>
<value compset="20TR_DATM.*_BLOM%ECO" >hist</value>
<value compset="2000_CAM60%NORESM.*_BLOM%ECO" >2000</value>
<value compset="SSP119_CAM60%NORESM.*_BLOM%ECO" >ssp119</value>
<value compset="SSP126_CAM60%NORESM.*_BLOM%ECO" >ssp126</value>
<value compset="SSP245_CAM60%NORESM.*_BLOM%ECO" >ssp245</value>
<value compset="SSP370_CAM60%NORESM.*_BLOM%ECO" >ssp370</value>
<value compset="SSP370LOWNTCF_CAM60%NORESM.*_BLOM%ECO" >ssp370</value>
<value compset="SSP370REFGHGLOWNTCF_CAM60%NORESM.*_BLOM%ECO">ssp370</value>
<value compset="SSP434_CAM60%NORESM.*_BLOM%ECO" >ssp434</value>
<value compset="SSP460_CAM60%NORESM.*_BLOM%ECO" >ssp460</value>
<value compset="SSP534_CAM60%NORESM.*_BLOM%ECO" >ssp534os</value>
<value compset="SSP585_CAM60%NORESM.*_BLOM%ECO" >ssp585</value>
<value compset="1850_.*_BLOM%ECO" >1850</value>
<value compset="2000_.*_BLOM%ECO" >2000</value>
<value compset="HIST_.*_BLOM%ECO" >hist</value>
<value compset="20TR_.*_BLOM%ECO" >hist</value>
<value compset="SSP119_.*_BLOM%ECO" >ssp119</value>
<value compset="SSP126_.*_BLOM%ECO" >ssp126</value>
<value compset="SSP245_.*_BLOM%ECO" >ssp245</value>
<value compset="SSP370_.*_BLOM%ECO" >ssp370</value>
<value compset="SSP434_.*_BLOM%ECO" >ssp434</value>
<value compset="SSP460_.*_BLOM%ECO" >ssp460</value>
<value compset="SSP534_.*_BLOM%ECO" >ssp534os</value>
<value compset="SSP585_.*_BLOM%ECO" >ssp585</value>
<value compset="SSP370.*_BLOM%ECO" >ssp370</value>
</values>
<group>run_component_blom</group>
<file>env_run.xml</file>
<desc>Scenario for nitrogen deposition data. Requires module ecosys</desc>
<desc>Scenario for nitrogen deposition data. Requires module ecosys.
Not used when coupling with nuopc-cmeps</desc>
</entry>

<entry id="HAMOCC_EXTNCYCLE">
Expand All @@ -163,7 +164,8 @@
</values>
<group>run_component_blom</group>
<file>env_run.xml</file>
<desc>Nitrogen deposition coupled from atmosphere. Requires module ecosys and extncycle</desc>
<desc>Nitrogen deposition coupled from atmosphere. Requires module ecosys and extncycle.
Not used when coupling with nuopc-cmeps</desc>
</entry>

<entry id="HAMOCC_N2OC">
Expand Down
14 changes: 1 addition & 13 deletions cime_config/namelist_definition_blom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3847,19 +3847,7 @@
<value>.false.</value>
<value comp_interface="nuopc">.true.</value>
</values>
<desc>if .true., use NUOPC to obtain NDEP (always imported to model) and ignore the
settings of do_ndep_coupled and ndepfile, whereas the setting of do_ndep is still used</desc>
</entry>

<entry id="do_ndep_coupled" modify_via_xml="HAMOCC_ATMNDEPC">
<type>logical</type>
<category>bgcnml</category>
<group>bgcnml</group>
<values>
<value>.false.</value>
<value blom_n_deposition="yes" hamocc_atmndepc="yes" hamocc_extncycle="yes">.true.</value>
</values>
<desc>Switch to couple nitrogen deposition. Requires do_ndep.</desc>
<desc>if .true., use NUOPC to obtain NDEP (always imported to model).</desc>
</entry>

<entry id="do_n2onh3_coupled" modify_via_xml="HAMOCC_N2OC">
Expand Down
57 changes: 28 additions & 29 deletions cime_config/ocn_in.readme
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
! CWMI : Array of grid cell i-indices (i)
! CWMJ : Array of grid cell j-indices (i)
! CWMWTH : Array of modified grid cell widths (m) (f)
!
!
!===========================================================================
! NAMELIST FOR MERIDIONAL OVERTURNING AND FLUX DIAGNOSTICS
!
Expand All @@ -188,15 +188,15 @@
! for each region (i)
! MER_MINLAT : Minimum latitude to be considered for each region (f)
! MER_MAXLAT : Maximum latitude to be considered for each region (f)
!
!
!===========================================================================
! NAMELIST FOR SECTION TRANSPORT DIAGNOSTICS
!
! CONTENTS:
!
! SEC_SIFILE : Name of file containing section specification for section
! transport computation (a)
!
!
!===========================================================================
! IO-NAMELIST FOR DIAGNOSTIC OUTPUT
!
Expand Down Expand Up @@ -230,10 +230,10 @@
! MSC_ - miscellanous, non-gridded fields
!
! Global parameters:
! FNAMETAG - tag used in file name (c10)
! AVEPERIO - average period in days (i)
! FILEFREQ - how often to start a new file in days (i)
! COMPFLAG - switch for compressed/uncompressed output (i)
! FNAMETAG - tag used in file name (c10)
! AVEPERIO - average period in days (i)
! FILEFREQ - how often to start a new file in days (i)
! COMPFLAG - switch for compressed/uncompressed output (i)
! NCFORMAT - netcdf format (valid arguments are 0 for classic,
! 1 for 64-bit offset and 2 for netcdf4/hdf5 format)
!
Expand Down Expand Up @@ -380,13 +380,12 @@
!
! ATM_CO2 : Atmospheric CO2 concentration [ppmv]
! FEDEPFILE : File name (incl. full path) for iron (dust) deposition data
! SWACLIMFILE : File name (incl. full path) for swa climatology field (needed
! SWACLIMFILE : File name (incl. full path) for swa climatology field (needed
! if bromoform scheme is activated)
! DO_RIVINPT : Logical switch to activate riverine input
! RIVINFILE : File name (incl. full path) for riverine input data
! DO_NDEP : Logical switch to activate N-deposition
! DO_NDEP_COUPLED: Logical to apply N-deposition fluxes received from the atmosphere (true=atm, false=clim), requires DO_NDEP=TRUE
! NDEPFILE : File name (incl. full path) for atmopheric N-deposition data
! NDEPFILE : File name (incl. full path) for atmopheric N-deposition data (not used for coupling to cmeps)
! DO_N2ONH3_COUPLED: Logical switch for interactive coupling of N2O and NH3 fluxes (true=atm, false=fix atmospheric value)
! DO_SEDSPINUP: Logical switch to activate sediment spin-up
! SEDSPIN_YR_S: Start year for sediment spinup
Expand All @@ -398,21 +397,21 @@
! PI_PH_FILE : File name (incl. full path) for surface PI pH input data.
! use_M4AGO : Switch for M4AGO settling scheme
! LEUPHOTIC_CYA : Switch to perform bluefix (cyanobacteria) only in the euphotic zone
! L_3DVARSEDPOR : Logical switch to enable lon-lat-depth variable sediment porosity (as opposed to default: only depth)
! L_3DVARSEDPOR : Logical switch to enable lon-lat-depth variable sediment porosity (as opposed to default: only depth)
! SEDPORFILE : File name (incl. full path) for sediment porosity
!
!===========================================================================
! NAMELIST BGCPARAMS FOR iHAMOCC-BGC PARAMETERS (DEVELOPERS ONLY)
!
!
! CONTENTS: EMPTY BY DEFAULT
! FOR ADJUSTABLE PARAMETERS, SEE CODE
!
!
!===========================================================================
! NAMELIST BGCOAFX FOR ALKALINIZATION SCENARIO
!
! CONTENTS:
!
! OALKSCEN : Name of alkalinization scenario ('const', 'ramp', or 'file')
! OALKSCEN : Name of alkalinization scenario ('const', 'ramp', or 'file')
! OALKFILE : Full path of the input file for the alkalinization scenario 'file'
! ADDALK : Pmol alkalinity/yr added in 'const' or 'ramp' scenarios
! CDRMIP_LATMAX : Max latitude where alkalinity is added in 'const' or 'ramp' scenarios
Expand All @@ -434,10 +433,10 @@
! BUR_ - 2d fields of sediment burial
!
! Global parameters:
! FNAMETAG - tag used in file name (c10)
! AVEPERIO - average period in days (i)
! FILEFREQ - how often to start a new file in days (i)
! COMPFLAG - switch for compressed/uncompressed output (i)
! FNAMETAG - tag used in file name (c10)
! AVEPERIO - average period in days (i)
! FILEFREQ - how often to start a new file in days (i)
! COMPFLAG - switch for compressed/uncompressed output (i)
! NCFORMAT - netcdf format (valid arguments are 0 for classic,
! 1 for 64-bit offset and 2 for netcdf4/hdf5 format)
! INVENTORY- how often to write an inventory of tracers to ocean
Expand Down Expand Up @@ -487,7 +486,7 @@
! 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]
! NITR_NH4 - nitrification rate on NH4 [mol NH4 m-3 s-1] - extended N cycle only
! NITR_NH4 - nitrification rate on NH4 [mol NH4 m-3 s-1] - extended N cycle only
! NITR_NO2 - nitrification rate on NO2 [mol NO2 m-3 s-1] - extended N cycle only
! NITR_N2O_PROD - N2O production rate during nitrification on NH4 [mol N2O m-3 s-1] - ext. N cycle only
! NITR_NH4_OM - detritus production during nitrification on NH4 [mol P m-3 s-1] - ext. N cycle only
Expand All @@ -498,9 +497,9 @@
! DNRA_NO2 - DNRA on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
! ANMX_N2_PROD - anammox N2 production [mol N2 m-3 s-1] - ext. N cycle only
! ANMX_OM_PROD - anammox detritus production [mol P m-3 s-1] - ext. N cycle only
! PHOSY_NH4 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
! PHOSY_NO3 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
! REMIN_AEROB - aerob remineralization rate (sev. sources) [mol NH4 m-3 s-1] - ext. N cycle only
! PHOSY_NH4 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
! PHOSY_NO3 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
! REMIN_AEROB - aerob remineralization rate (sev. sources) [mol NH4 m-3 s-1] - ext. N cycle only
! REMIN_SULF - sulfate-based remin rate on det [mol P m-3 s-1] - ext. N cycle only
! AGG_WS - M4AGO aggregate mean settling velocity [m/d]
! DYNVIS - molecular dynamic viscosity of sea water [kg m-1 s-1]
Expand Down Expand Up @@ -549,8 +548,8 @@
! PCO2M - Surface PCO2 under moist air assumption [uatm]
! KWCO2 - Piston velocity (kwco2) [m s-1]
! KWCO2KHM - Piston velocity times solubility (kwco2*kh; moist air) [m s-1 mol kg-1 uatm-1]
! CO2KH - CO2 solubility under dry air assumption (khd) [mol kg-1 atm-1]
! CO2KHM - CO2 solubility under moist air assumption (kh) [mol kg-1 atm-1]
! CO2KH - CO2 solubility under dry air assumption (khd) [mol kg-1 atm-1]
! CO2KHM - CO2 solubility under moist air assumption (kh) [mol kg-1 atm-1]
! CO2FXD - Downward CO2 flux (co2fxd) [kg C m-2 s-1]
! CO2FXU - Upward CO2 flux (co2fxu) [kg C m-2 s-1]
! NIFLUX - Nitrogen flux (fgn2) [mol N2 m-2 s-1]
Expand Down Expand Up @@ -608,7 +607,7 @@
! BURSSSC12 - burial fluxes of calcium carbonate [mol Ca m-2 s-1]
! BURSSSSIL - burial fluxes of silicate [mol Si m-2 s-1]
! BURSSSTER - burial fluxes of clay [g m-2 s-1]
!
!
! Sediment fields (SDM)
! POWAIC - (powdic) [mol C m-3]
! POWAAL - (powalk) [eq m-3]
Expand All @@ -620,7 +619,7 @@
! POWNH4 - (pownh4) [mol NH4 m-3] - extended N cycle only
! POWN2O - (pown2o) [mol N2O m-3] - extended N cycle only
! POWNO2 - (powno2) [mol NO2 m-3] - extended N cycle only
! NITR_NH4 - nitrification rate on NH4 [mol NH4 m-3 s-1] - extended N cycle only
! NITR_NH4 - nitrification rate on NH4 [mol NH4 m-3 s-1] - extended N cycle only
! NITR_NO2 - nitrification rate on NO2 [mol NO2 m-3 s-1] - extended N cycle only
! NITR_N2O_PROD - N2O production rate during nitrification on NH4 [mol N2O m-3 s-1] - ext. N cycle only
! NITR_NH4_OM - detritus production during nitrification on NH4 [mol P m-3 s-1] - ext. N cycle only
Expand All @@ -631,9 +630,9 @@
! DNRA_NO2 - DNRA on NO2 [mol NO2 m-3 s-1] - ext. N cycle only
! ANMX_N2_PROD - anammox N2 production [mol N2 m-3 s-1] - ext. N cycle only
! ANMX_OM_PROD - anammox detritus production [mol P m-3 s-1] - ext. N cycle only
! PHOSY_NH4 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
! PHOSY_NO3 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
! REMIN_AEROB - aerob remineralization rate (sev. sources) [mol NH4 m-3 s-1] - ext. N cycle only
! PHOSY_NH4 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
! PHOSY_NO3 - PP consumption of NH4 [mol NH4 m-3 s-1] - ext. N cycle only
! REMIN_AEROB - aerob remineralization rate (sev. sources) [mol NH4 m-3 s-1] - ext. N cycle only
! REMIN_SULF - sulfate-based remin rate on det [mol P m-3 s-1] - ext. N cycle only
! SSSO12 - (ssso12) [mol m-3]
! SSSSIL - (ssssil) [mol Si m-3]
Expand Down
1 change: 0 additions & 1 deletion hamocc/mo_control_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ module mo_control_bgc
! Variables set via namelist bgcnml
logical :: l_3Dvarsedpor = .false. ! apply spatially variable sediment porosity
logical :: do_ndep = .true. ! apply n-deposition
logical :: do_ndep_coupled = .false. ! for coupled simulations, use field provided by atmosphere
logical :: do_n2onh3_coupled = .false. ! for coupled simulations, use field provided by atmosphere
logical :: do_rivinpt = .true. ! apply riverine input
logical :: do_sedspinup = .false. ! apply sediment spin-up
Expand Down
4 changes: 2 additions & 2 deletions hamocc/mo_hamocc_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
do_sedspinup,sedspin_yr_s,sedspin_yr_e,sedspin_ncyc, &
dtb,dtbgc,io_stdo_bgc,ldtbgc, &
ldtrunbgc,ndtdaybgc,with_dmsph,l_3Dvarsedpor,use_M4AGO, &
do_ndep_coupled,lkwrbioz_off,do_n2onh3_coupled, &
lkwrbioz_off,do_n2onh3_coupled, &
ocn_co2_type, use_sedbypass, use_BOXATM, use_BROMO,use_extNcycle, &
use_nuopc_ndep
use mo_param1_bgc, only: ks,init_por2octra_mapping
Expand Down Expand Up @@ -82,7 +82,7 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
& do_sedspinup,sedspin_yr_s,sedspin_yr_e,sedspin_ncyc, &
& inidic,inialk,inipo4,inioxy,inino3,inisil,inid13c,inid14c,swaclimfile, &
& with_dmsph,pi_ph_file,l_3Dvarsedpor,sedporfile,ocn_co2_type,use_M4AGO, &
& do_ndep_coupled,do_n2onh3_coupled,lkwrbioz_off
& do_n2onh3_coupled,lkwrbioz_off
!
! --- Set io units and some control parameters
!
Expand Down
3 changes: 1 addition & 2 deletions hamocc/mo_param_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module mo_param_bgc
do_ndep,do_oalk,do_rivinpt,do_sedspinup,l_3Dvarsedpor, &
use_BOXATM,use_CFC,use_PBGC_CK_TIMESTEP, &
use_sedbypass,with_dmsph,use_PBGC_OCNP_TIMESTEP,ocn_co2_type,use_M4AGO,&
do_ndep_coupled,do_n2onh3_coupled,use_extNcycle, &
do_n2onh3_coupled,use_extNcycle, &
lkwrbioz_off
use mod_xc, only: mnproc

Expand Down Expand Up @@ -837,7 +837,6 @@ subroutine write_parambgc()
call cinfo_add_entry('lkwrbioz_off', lkwrbioz_off)
call cinfo_add_entry('use_M4AGO', use_M4AGO)
if (use_extNcycle) then
call cinfo_add_entry('do_ndep_coupled', do_ndep_coupled)
call cinfo_add_entry('do_n2onh3_coupled', do_n2onh3_coupled)
endif
write(io_stdo_bgc,*) '* '
Expand Down
42 changes: 16 additions & 26 deletions hamocc/mo_read_ndep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ subroutine ini_read_ndep(kpie,kpje)
!***********************************************************************************************

use mod_xc, only: mnproc,xchalt
use mo_control_bgc, only: io_stdo_bgc,do_ndep,do_ndep_coupled,use_extNcycle
use mo_control_bgc, only: io_stdo_bgc,do_ndep,use_extNcycle
use mod_dia, only: iotype
use mod_nctools, only: ncfopn,ncgeti,ncfcls
use mo_netcdf_bgcrw, only: read_netcdf_var
Expand All @@ -96,13 +96,6 @@ subroutine ini_read_ndep(kpie,kpje)
endif
return
endif
if (do_ndep_coupled) then
if (mnproc == 1) then
write(io_stdo_bgc,*) ''
write(io_stdo_bgc,*) 'ini_read_ndep: N deposition in interactive mode.'
endif
return
end if

! Initialise the module
if (.not. lini) then
Expand Down Expand Up @@ -182,7 +175,7 @@ subroutine get_ndep(kpie,kpje,kbnd,kplyear,kplmon,omask,ndep,patmnhxdep,patmnoyd

use mod_xc, only: mnproc
use netcdf, only: nf90_open,nf90_close,nf90_nowrite
use mo_control_bgc, only: io_stdo_bgc, do_ndep, use_extNcycle, do_ndep_coupled, use_nuopc_ndep
use mo_control_bgc, only: io_stdo_bgc, do_ndep, use_extNcycle, use_nuopc_ndep
use mo_netcdf_bgcrw, only: read_netcdf_var
use mo_param1_bgc, only: nndep,idepnoy,idepnhx
use mo_chemcon, only: mw_nitrogen
Expand Down Expand Up @@ -210,17 +203,22 @@ subroutine get_ndep(kpie,kpje,kbnd,kplyear,kplmon,omask,ndep,patmnhxdep,patmnoyd
return
endif

! If use_nuopc_ndep, nitrogen deposition is ALWAYS obtained from the
! nuopc mediator
if (use_extNcycle .and. do_ndep_coupled) then
if (use_nuopc_ndep) then

! If use_nuopc_ndep, nitrogen deposition is ALWAYS obtained from the
! nuopc mediator
if (mnproc == 1 .and. first_call) then
write (io_stdo_bgc,*) 'iHAMOCC: getting NOy and NHx deposition from atm'
endif

! convert from kgN/m2/s to climatological input file units: kmolN/m2/yr
fatmndep = 365.*86400./mw_nitrogen
ndep(:,:,:) = 0.

! get N-deposition from atmosphere
fatmndep = 365.*86400./mw_nitrogen
ndep(:,:,:) = 0.
if (use_extNcycle) then
!$omp parallel do private(i)
do j=1,kpje
do i=1,kpie
! convert from kgN/m2/s to climatological input file units: kmolN/m2/yr
if (patmnoydep(i,j) > 0.) then
ndep(i,j,idepnoy) = patmnoydep(i,j)*fatmndep
endif
Expand All @@ -230,24 +228,16 @@ subroutine get_ndep(kpie,kpje,kbnd,kplyear,kplmon,omask,ndep,patmnhxdep,patmnoyd
enddo
enddo
!$omp end parallel do
if (mnproc == 1 .and. first_call) then
write (io_stdo_bgc,*) 'iHAMOCC: getting NOy and NHx deposition from atm'
endif

else if (use_nuopc_ndep) then

! get N-deposition from atmosphere
fatmndep = 365.*86400./mw_nitrogen
ndep(:,:,:) = 0.
else
!$omp parallel do private(i)
do j=1,kpje
do i=1,kpie
! convert from kgN/m2/s to climatological input file units: kmolN/m2/yr
! reduced and oxidized forms will all enter the NO3 pool
ndep(i,j,idepnoy) = (patmnoydep(i,j)+patmnhxdep(i,j))*fatmndep
enddo
enddo
!$omp end parallel do
end if

else

Expand Down

0 comments on commit 6032936

Please sign in to comment.