From 6032936ab4f748e04964314cf194c77219d253f6 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Mon, 7 Oct 2024 11:54:56 +0200 Subject: [PATCH] more updates addressing comments in PR --- cime_config/config_component.xml | 32 ++++++------- cime_config/namelist_definition_blom.xml | 14 +----- cime_config/ocn_in.readme | 57 ++++++++++++------------ hamocc/mo_control_bgc.F90 | 1 - hamocc/mo_hamocc_init.F90 | 4 +- hamocc/mo_param_bgc.F90 | 3 +- hamocc/mo_read_ndep.F90 | 42 +++++++---------- 7 files changed, 65 insertions(+), 88 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 765eef22..e4214535 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -121,23 +121,24 @@ UNSET,1850,2000,hist,ssp119,ssp126,ssp245,ssp370,ssp434,ssp460,ssp534os,ssp585 1850 - hist - hist - 2000 - ssp119 - ssp126 - ssp245 - ssp370 - ssp370 - ssp370 - ssp434 - ssp460 - ssp534os - ssp585 + 1850 + 2000 + hist + hist + ssp119 + ssp126 + ssp245 + ssp370 + ssp434 + ssp460 + ssp534os + ssp585 + ssp370 run_component_blom env_run.xml - Scenario for nitrogen deposition data. Requires module ecosys + Scenario for nitrogen deposition data. Requires module ecosys. + Not used when coupling with nuopc-cmeps @@ -163,7 +164,8 @@ run_component_blom env_run.xml - Nitrogen deposition coupled from atmosphere. Requires module ecosys and extncycle + Nitrogen deposition coupled from atmosphere. Requires module ecosys and extncycle. + Not used when coupling with nuopc-cmeps diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 1ccde94a..3030ea67 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -3847,19 +3847,7 @@ .false. .true. - 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 - - - - logical - bgcnml - bgcnml - - .false. - .true. - - Switch to couple nitrogen deposition. Requires do_ndep. + if .true., use NUOPC to obtain NDEP (always imported to model). diff --git a/cime_config/ocn_in.readme b/cime_config/ocn_in.readme index c3ce0150..3fa6b797 100644 --- a/cime_config/ocn_in.readme +++ b/cime_config/ocn_in.readme @@ -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 ! @@ -188,7 +188,7 @@ ! 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 ! @@ -196,7 +196,7 @@ ! ! SEC_SIFILE : Name of file containing section specification for section ! transport computation (a) -! +! !=========================================================================== ! IO-NAMELIST FOR DIAGNOSTIC OUTPUT ! @@ -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) ! @@ -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 @@ -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 @@ -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 @@ -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 @@ -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] @@ -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] @@ -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] @@ -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 @@ -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] diff --git a/hamocc/mo_control_bgc.F90 b/hamocc/mo_control_bgc.F90 index 3235710e..c03962ac 100644 --- a/hamocc/mo_control_bgc.F90 +++ b/hamocc/mo_control_bgc.F90 @@ -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 diff --git a/hamocc/mo_hamocc_init.F90 b/hamocc/mo_hamocc_init.F90 index e1e42f8e..e3db5805 100644 --- a/hamocc/mo_hamocc_init.F90 +++ b/hamocc/mo_hamocc_init.F90 @@ -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 @@ -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 ! diff --git a/hamocc/mo_param_bgc.F90 b/hamocc/mo_param_bgc.F90 index 8deac006..6cf8a78f 100644 --- a/hamocc/mo_param_bgc.F90 +++ b/hamocc/mo_param_bgc.F90 @@ -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 @@ -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,*) '* ' diff --git a/hamocc/mo_read_ndep.F90 b/hamocc/mo_read_ndep.F90 index 2cd75bfd..e4155dee 100644 --- a/hamocc/mo_read_ndep.F90 +++ b/hamocc/mo_read_ndep.F90 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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