From 7abe0e0054c27fce8f1722e22dd659bcf206811e Mon Sep 17 00:00:00 2001 From: jmaerz <92309038+jmaerz@users.noreply.github.com> Date: Fri, 25 Oct 2024 11:43:39 +0200 Subject: [PATCH] Apply patch of latest commit in master for the dustflux output PR #420 (#423) Introduction of dustflux output and of a xml-switch HAMOCC_SINKING_SCHEME with options WLIN, AGG, M4AGO and CONST, default is WLIN, to select a sinking scheme in iHAMOCC. --- cime_config/buildnml | 29 +++- cime_config/config_component.xml | 15 +- cime_config/namelist_definition_blom.xml | 178 ++++++++++++++++------- cime_config/ocn_in.readme | 1 + hamocc/mo_accfields.F90 | 10 ++ hamocc/mo_bgcmean.F90 | 35 ++++- hamocc/mo_biomod.F90 | 28 +++- hamocc/mo_ncout_hamocc.F90 | 40 ++++- hamocc/mo_ocprod.F90 | 103 +++++++++---- 9 files changed, 338 insertions(+), 101 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 6ef0f906..89952579 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -83,7 +83,7 @@ def buildnml(case, caseroot, compname): hamocc_extncycle = case.get_value("HAMOCC_EXTNCYCLE") hamocc_n2oc = case.get_value("HAMOCC_N2OC") hamocc_atmndepc = case.get_value("HAMOCC_ATMNDEPC") - hamocc_m4ago = case.get_value("HAMOCC_M4AGO") + hamocc_sinking_scheme = case.get_value("HAMOCC_SINKING_SCHEME") hamocc_sedbypass = case.get_value("HAMOCC_SEDBYPASS") hamocc_sedspinup = case.get_value("HAMOCC_SEDSPINUP") hamocc_sedspinup_yr_start = case.get_value("HAMOCC_SEDSPINUP_YR_START") @@ -192,7 +192,6 @@ def buildnml(case, caseroot, compname): config["hamocc_extncycle"] = "yes" if hamocc_extncycle else "no" config["hamocc_n2oc"] = "yes" if hamocc_n2oc else "no" config["hamocc_atmndepc"] = "yes" if hamocc_atmndepc else "no" - config["hamocc_m4ago"] = "yes" if hamocc_m4ago else "no" config["hamocc_sedbypass"] = "yes" if hamocc_sedbypass else "no" config["hamocc_sedspinup"] = "yes" if hamocc_sedspinup else "no" config["hamocc_sedspinup_yr_start"] = hamocc_sedspinup_yr_start @@ -201,9 +200,29 @@ def buildnml(case, caseroot, compname): config["is_test"] = "yes" if is_test else "no" config["comp_interface"] = comp_interface - # TODO: the following needs to have new ways to turn this to "yes" - config["use_agg"] = "no" - config["use_wlin"] = "yes" + # Set the sinking scheme in iHAMOCC + # Note: the following part requires to have set options for no/yes + # in the namelist_definition_blom.xml for the 'use_XXX' switches + if hamocc_sinking_scheme == 'WLIN': # current default + config['use_wlin'] = 'yes' + config['use_agg'] = 'no' + config['use_m4ago'] = 'no' + elif hamocc_sinking_scheme == 'M4AGO': + config['use_wlin'] = 'no' + config['use_agg'] = 'no' + config['use_m4ago'] = 'yes' + elif hamocc_sinking_scheme == 'AGG': + config['use_wlin'] = 'no' + config['use_agg'] = 'yes' + config['use_m4ago'] = 'no' + elif hamocc_sinking_scheme == 'CONST': + # if all options are 'no' iHAMOCC falls back to constant sinking velocities + config['use_wlin'] = 'no' + config['use_agg'] = 'no' + config['use_m4ago'] = 'no' + else: # likely doesn't enter here due to previous cime checkings for available options + print('Unknown sinking scheme option in BLOM buildnml- exit now') + exit if is_test: testcase = case.get_value("TESTCASE") diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 3d462ee0..b13c8542 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -178,13 +178,14 @@ N2O and NH3 fluxes coupled from atmosphere. Requires module ecosys and extncycle - - logical - TRUE,FALSE - FALSE - run_component_blom - env_run.xml - Set preprocessor option to activate the M4AGO sinking scheme. Requires module ecosys + + char + WLIN,M4AGO,AGG,CONST + WLIN + run_component_blom + env_run.xml + Set namelist option to activate the M4AGO sinking scheme. Requires module ecosys + Namelist option to set sinking scheme. Requires module ecosys diff --git a/cime_config/namelist_definition_blom.xml b/cime_config/namelist_definition_blom.xml index 395f9d3b..03ec0732 100644 --- a/cime_config/namelist_definition_blom.xml +++ b/cime_config/namelist_definition_blom.xml @@ -3632,13 +3632,13 @@ Switch to couple N2O and NH3 fluxes - + logical bgcnml bgcnml .false. - .true. + .true. Switch for M4AGO settling scheme @@ -3813,7 +3813,7 @@ .false. - add desc + Switch to use variable sediment porosity @@ -3846,6 +3846,7 @@ config_bgc .true. + .false. Use POC sinking scheme with increasing sinking velocity with depth @@ -3955,6 +3956,7 @@ config_bgc .false. + .true. Use aggregation scheme for sinking of particles @@ -3966,7 +3968,7 @@ .false. - add desc + Activate interactive phytoplankton absorption @@ -5022,7 +5024,7 @@ 'hbgcd','hbgcm','hbgcy' - add desc + File name extension for BGC output frequencies @@ -5032,7 +5034,7 @@ 1,30,365 - add desc + Averaging period for BGC diagnostic output @@ -5044,7 +5046,7 @@ 1,30,365 0,0,0 - add desc + Frequency for writing the BGC output @@ -5054,7 +5056,7 @@ 0,0,0 - add desc + switch for compressed/uncompressed output @@ -5065,7 +5067,7 @@ 0,0,0 1,1,1 - add desc + netcdf format (valid arguments are 0 for classic, 1 for 64-bit offset and 2 for netcdf4/hdf5 format) @@ -5075,7 +5077,7 @@ 0,1,0 - add desc + Writing the BGC inventory files at BGC frequencies @@ -5171,7 +5173,7 @@ 4,2,2 0,0,0 - add desc + Surface silicate concentration [mol Si m-3] @@ -5699,7 +5701,7 @@ 4,2,2 0,0,0 - add desc + Surface bromoform concentration [mol CHBr3 m-3] @@ -5711,7 +5713,7 @@ 4,2,2 0,0,0 - add desc + Surface bromoform flux [mol CHBr3 -m2 s-1] @@ -5723,7 +5725,7 @@ 4,2,2 0,0,0 - add desc + Integrated bromoform production [mol CHBr3 m-2 s-1] @@ -5735,7 +5737,7 @@ 4,2,2 0,0,0 - add desc + Integrated bromoform loss to photolysis [mol CHBr m-2 s-1] @@ -5819,7 +5821,7 @@ 4,2,2 0,0,0 - add desc + Gravitational POC flux at 100m [mol C m-2 s-1] @@ -5831,7 +5833,7 @@ 4,2,2 0,0,0 - add desc + Gravitational POC flux at 500m [mol C m-2 s-1] @@ -5843,7 +5845,7 @@ 4,2,2 0,0,0 - add desc + Gravitational POC flux at 1000m [mol C m-2 s-1] @@ -5855,7 +5857,7 @@ 4,2,2 0,0,0 - add desc + Gravitational POC flux at 2000m [mol C m-2 s-1] @@ -5867,7 +5869,7 @@ 4,2,2 0,0,0 - add desc + Gravitational POC flux at 4000m [mol C m-2 s-1] @@ -5879,7 +5881,79 @@ 4,2,2 0,0,0 - add desc + Gravitational POC flux to the sediment [mol C m-2 s-1] + + + + integer(3) + diabgc + diabgc + + 0,2,2 + 4,2,2 + 0,0,0 + + Gravitational dust fluxes at 100m + + + + integer(3) + diabgc + diabgc + + 0,2,2 + 4,2,2 + 0,0,0 + + Gravitational dust fluxes at 500m + + + + integer(3) + diabgc + diabgc + + 0,2,2 + 4,2,2 + 0,0,0 + + Gravitational dust fluxes at 1000m + + + + integer(3) + diabgc + diabgc + + 0,2,2 + 4,2,2 + 0,0,0 + + Gravitational dust fluxes at 2000m + + + + integer(3) + diabgc + diabgc + + 0,2,2 + 4,2,2 + 0,0,0 + + Gravitational dust fluxes at 4000m + + + + integer(3) + diabgc + diabgc + + 0,2,2 + 4,2,2 + 0,0,0 + + Gravitational dust fluxes to sediment @@ -5891,7 +5965,7 @@ 4,2,2 0,0,0 - add desc + Gravitational opal flux at 100m [mol Si m-2 s-1] @@ -5903,7 +5977,7 @@ 4,2,2 0,0,0 - add desc + Gravitational opal flux at 500m [mol Si m-2 s-1] @@ -5915,7 +5989,7 @@ 4,2,2 0,0,0 - add desc + Gravitational opal flux at 1000m [mol Si m-2 s-1] @@ -5927,7 +6001,7 @@ 4,2,2 0,0,0 - add desc + Gravitational opal flux at 2000m [mol Si m-2 s-1] @@ -5939,7 +6013,7 @@ 4,2,2 0,0,0 - add desc + Gravitational opal flux at 4000m [mol Si m-2 s-1] @@ -5951,7 +6025,7 @@ 4,2,2 0,0,0 - add desc + Gravitational opal flux to the sediment [mol Si m-2 s-1] @@ -5963,7 +6037,7 @@ 4,2,2 0,0,0 - add desc + Gravitational CaCO3 flux at 100m [mol Ca m-2 s-1] @@ -5975,7 +6049,7 @@ 4,2,2 0,0,0 - add desc + Gravitational CaCO3 flux at 500m [mol Ca m-2 s-1] @@ -5987,7 +6061,7 @@ 4,2,2 0,0,0 - add desc + Gravitational CaCO3 flux at 1000m [mol Ca m-2 s-1] @@ -5999,7 +6073,7 @@ 4,2,2 0,0,0 - add desc + Gravitational CaCO3 flux at 2000m [mol Ca m-2 s-1] @@ -6011,7 +6085,7 @@ 4,2,2 0,0,0 - add desc + Gravitational CaCO3 flux at 4000m [mol Ca m-2 s-1] @@ -6023,7 +6097,7 @@ 4,2,2 0,0,0 - add desc + Gravitational CaCO3 flux to the sediment [mol Ca m-2 s-1] @@ -6035,7 +6109,7 @@ 4,2,2 0,0,0 - add desc + Phytoplankton [mol P m-3] @@ -6047,7 +6121,7 @@ 4,2,2 0,0,0 - add desc + Zooplankton [mol P m-3] @@ -6059,7 +6133,7 @@ 4,2,2 0,0,0 - add desc + Dissolved organic carbon [mol P m-3] @@ -6071,7 +6145,7 @@ 4,2,2 0,0,0 - add desc + Primary production [mol C m-3] @@ -6119,7 +6193,7 @@ 2,0,2 0,0,0 - add desc + Nitrate concentration [mol NO3 m-3] @@ -6479,7 +6553,7 @@ 2,0,2 0,0,0 - add desc + Alkalinity [eq m-3] @@ -6491,7 +6565,7 @@ 2,0,2 0,0,0 - add desc + Silicate [mol Si m-3] @@ -6503,7 +6577,7 @@ 2,0,2 0,0,0 - add desc + Dissolved inorganic carbon [mol C m-3] @@ -6515,7 +6589,7 @@ 2,0,2 0,0,0 - add desc + Detritus [mol P m-3] @@ -6575,7 +6649,7 @@ 2,0,2 0,0,0 - add desc + pH [-log10([H+])] @@ -6635,7 +6709,7 @@ 2,0,2 0,0,0 - add desc + Preformed phosphorus [mol P m-3] @@ -6647,7 +6721,7 @@ 4,2,2 0,0,0 - Pre-formed silica [mol m-3] + Pre-formed silica [mol Si m-3] @@ -6993,7 +7067,7 @@ 0,0,2 - add desc + Bromoform [mol CHBr3 m-3] @@ -7005,7 +7079,7 @@ 0,2,2 0,0,0 - add desc + Layer thickness [m] @@ -7557,7 +7631,7 @@ 4,2,2 0,0,0 - add desc + pH [-log10(H+)] @@ -7951,7 +8025,7 @@ 4,2,2 0,0,0 - add desc + Bromoform [mol CHBr3 m-3] @@ -7963,7 +8037,7 @@ 2,0,2 0,0,0 - add desc + Diffusive DIC flux to sediment (positive downward) [mol C m-2 s-1] @@ -7975,7 +8049,7 @@ 2,0,2 0,0,0 - add desc + Diffusive alkalinity flux to sediment (positive downward) [mol eq m-2 s-1] @@ -7987,7 +8061,7 @@ 2,0,2 0,0,0 - add desc + Diffusive phosphate flux to sediment (positive downward) [mol P m-2 s-1] diff --git a/cime_config/ocn_in.readme b/cime_config/ocn_in.readme index 891e8785..1f09825d 100644 --- a/cime_config/ocn_in.readme +++ b/cime_config/ocn_in.readme @@ -572,6 +572,7 @@ ! CARFLX**** - POC flux at **** metres depth [mol C m-2 s-1] ! BSIFLX**** - Biogenic silica flux at **** metres depth [mol Si m-2 s-1] ! CALFLX**** - Calcium carbonate flux at **** metres depth [mol C m-2 s-1] +! DUSTFLX**** - Dust flux at **** metres depth [g m-2 s-1] ! SEDIFFIC - sediment - water-column diffusive flux of DIC [mol C m-2 s-1] ! SEDIFFAL - sediment - water-column diffusive flux of alkalinity [mol m-2 s-1] ! SEDIFFPH - sediment - water-column diffusive flux of phosphate [mol PO3 m-2 s-1] diff --git a/hamocc/mo_accfields.F90 b/hamocc/mo_accfields.F90 index d214ea92..679ded85 100644 --- a/hamocc/mo_accfields.F90 +++ b/hamocc/mo_accfields.F90 @@ -50,6 +50,8 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask) bsiflx2000,bsiflx4000,calflx_bot,calflx0100,calflx0500, & calflx1000,calflx2000,calflx4000,carflx_bot,carflx0100, & carflx0500,carflx1000,carflx2000,carflx4000, & + dustflx_bot,dustflx0100, & + dustflx0500,dustflx1000,dustflx2000,dustflx4000, & expoca,expoor,exposi,intdms_bac,intdms_uv,intdmsprod, & intdnit,intnfix,intphosy,phosy3d, & int_chbr3_prod,int_chbr3_uv,asize3d,eps3d,wnumb,wmass, & @@ -63,6 +65,8 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask) jcalflx1000,jcalflx2000,jcalflx4000, & jcalflx_bot,jcarflx0100,jcarflx0500, & jcarflx1000,jcarflx2000,jcarflx4000,jcarflx_bot, & + jdustflx0100,jdustflx0500, & + jdustflx1000,jdustflx2000,jdustflx4000,jdustflx_bot, & jsediffic,jsediffal,jsediffph,jsediffox, & jburflxsso12,jburflxsssc12,jburflxssssil,jburflxssster, & jsediffn2,jsediffno3,jsediffsi,jco2flux, & @@ -335,21 +339,27 @@ subroutine accfields(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask) call accsrf(jcarflx0100,carflx0100,omask,0) call accsrf(jbsiflx0100,bsiflx0100,omask,0) call accsrf(jcalflx0100,calflx0100,omask,0) + call accsrf(jdustflx0100,dustflx0100,omask,0) call accsrf(jcarflx0500,carflx0500,omask,0) call accsrf(jbsiflx0500,bsiflx0500,omask,0) call accsrf(jcalflx0500,calflx0500,omask,0) + call accsrf(jdustflx0500,dustflx0500,omask,0) call accsrf(jcarflx1000,carflx1000,omask,0) call accsrf(jbsiflx1000,bsiflx1000,omask,0) call accsrf(jcalflx1000,calflx1000,omask,0) + call accsrf(jdustflx1000,dustflx1000,omask,0) call accsrf(jcarflx2000,carflx2000,omask,0) call accsrf(jbsiflx2000,bsiflx2000,omask,0) call accsrf(jcalflx2000,calflx2000,omask,0) + call accsrf(jdustflx2000,dustflx2000,omask,0) call accsrf(jcarflx4000,carflx4000,omask,0) call accsrf(jbsiflx4000,bsiflx4000,omask,0) call accsrf(jcalflx4000,calflx4000,omask,0) + call accsrf(jdustflx4000,dustflx4000,omask,0) call accsrf(jcarflx_bot,carflx_bot,omask,0) call accsrf(jbsiflx_bot,bsiflx_bot,omask,0) call accsrf(jcalflx_bot,calflx_bot,omask,0) + call accsrf(jdustflx_bot,dustflx_bot,omask,0) endif if (.not. use_sedbypass) then diff --git a/hamocc/mo_bgcmean.F90 b/hamocc/mo_bgcmean.F90 index d4b0b74e..5eb4f542 100644 --- a/hamocc/mo_bgcmean.F90 +++ b/hamocc/mo_bgcmean.F90 @@ -123,6 +123,8 @@ module mo_bgcmean & FLX_BSI2000 =0 ,FLX_BSI4000 =0 ,FLX_BSI_BOT =0 , & & FLX_CAL0100 =0 ,FLX_CAL0500 =0 ,FLX_CAL1000 =0 , & & FLX_CAL2000 =0 ,FLX_CAL4000 =0 ,FLX_CAL_BOT =0 , & + & FLX_DUST0100 =0 ,FLX_DUST0500 =0 ,FLX_DUST1000 =0 , & + & FLX_DUST2000 =0 ,FLX_DUST4000 =0 ,FLX_DUST_BOT =0 , & & FLX_SEDIFFIC =0 ,FLX_SEDIFFAL =0 ,FLX_SEDIFFPH =0 , & & FLX_SEDIFFOX =0 ,FLX_SEDIFFN2 =0 ,FLX_SEDIFFNO3 =0 , & & FLX_SEDIFFSI =0 ,FLX_SEDIFFNH4 =0 ,FLX_SEDIFFN2O =0 , & @@ -242,6 +244,8 @@ module mo_bgcmean & FLX_BSI2000 ,FLX_BSI4000 ,FLX_BSI_BOT , & & FLX_CAL0100 ,FLX_CAL0500 ,FLX_CAL1000 , & & FLX_CAL2000 ,FLX_CAL4000 ,FLX_CAL_BOT , & + & FLX_DUST0100 ,FLX_DUST0500 ,FLX_DUST1000 , & + & FLX_DUST2000 ,FLX_DUST4000 ,FLX_DUST_BOT , & & FLX_SEDIFFIC ,FLX_SEDIFFAL ,FLX_SEDIFFPH , & & FLX_SEDIFFOX ,FLX_SEDIFFN2 ,FLX_SEDIFFNO3 , & & FLX_SEDIFFSI ,FLX_SEDIFFNH4 ,FLX_SEDIFFN2O , & @@ -273,7 +277,7 @@ module mo_bgcmean & LYR_nitr_NH4_OM ,LYR_nitr_NO2_OM ,LYR_denit_NO3 , & & LYR_denit_NO2 ,LYR_denit_N2O ,LYR_DNRA_NO2 , & & LYR_anmx_N2_prod ,LYR_anmx_OM_prod ,LYR_phosy_NH4 , & - & LYR_phosy_NO3 ,LYR_remin_aerob ,LYR_remin_sulf , & + & LYR_phosy_NO3 ,LYR_remin_aerob ,LYR_remin_sulf , & & LYR_agg_ws ,LYR_dynvis ,LYR_agg_stick , & & LYR_agg_stickf ,LYR_agg_dmax ,LYR_agg_avdp , & & LYR_agg_avrhop ,LYR_agg_avdC ,LYR_agg_df , & @@ -303,11 +307,11 @@ module mo_bgcmean & LVL_nitr_NH4_OM ,LVL_nitr_NO2_OM ,LVL_denit_NO3 , & & LVL_denit_NO2 ,LVL_denit_N2O ,LVL_DNRA_NO2 , & & LVL_anmx_N2_prod ,LVL_anmx_OM_prod ,LVL_phosy_NH4 , & - & LVL_phosy_NO3 ,LVL_remin_aerob ,LVL_remin_sulf , & + & LVL_phosy_NO3 ,LVL_remin_aerob ,LVL_remin_sulf , & & LVL_agg_ws ,LVL_dynvis ,LVL_agg_stick , & & LVL_agg_stickf ,LVL_agg_dmax ,LVL_agg_avdp , & & LVL_agg_avrhop ,LVL_agg_avdC ,LVL_agg_df , & - & LVL_agg_b ,LVL_agg_Vrhof ,LVL_agg_Vpor , & + & LVL_agg_b ,LVL_agg_Vrhof ,LVL_agg_Vpor , & & SDM_POWAIC ,SDM_POWAAL ,SDM_POWAPH , & & SDM_POWAOX ,SDM_POWN2 ,SDM_POWNO3 , & & SDM_POWASI ,SDM_SSSO12 ,SDM_SSSSIL , & @@ -416,7 +420,13 @@ module mo_bgcmean & jcalflx1000= 0 , & & jcalflx2000= 0 , & & jcalflx4000= 0 , & - & jcalflx_bot= 0 + & jcalflx_bot= 0 , & + & jdustflx0100= 0 , & + & jdustflx0500= 0 , & + & jdustflx1000= 0 , & + & jdustflx2000= 0 , & + & jdustflx4000= 0 , & + & jdustflx_bot= 0 integer, dimension(nbgcmax) :: & & jsediffic = 0 , & @@ -865,6 +875,19 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke) jcalflx4000(n)=i_bsc_m2d*min(1,FLX_CAL4000(n)) if (FLX_CAL_BOT(n) > 0) i_bsc_m2d=i_bsc_m2d+1 jcalflx_bot(n)=i_bsc_m2d*min(1,FLX_CAL_BOT(n)) + if (FLX_DUST0100(n) > 0) i_bsc_m2d=i_bsc_m2d+1 + jdustflx0100(n)=i_bsc_m2d*min(1,FLX_DUST0100(n)) + if (FLX_DUST0500(n) > 0) i_bsc_m2d=i_bsc_m2d+1 + jdustflx0500(n)=i_bsc_m2d*min(1,FLX_DUST0500(n)) + if (FLX_DUST1000(n) > 0) i_bsc_m2d=i_bsc_m2d+1 + jdustflx1000(n)=i_bsc_m2d*min(1,FLX_DUST1000(n)) + if (FLX_DUST2000(n) > 0) i_bsc_m2d=i_bsc_m2d+1 + jdustflx2000(n)=i_bsc_m2d*min(1,FLX_DUST2000(n)) + if (FLX_DUST4000(n) > 0) i_bsc_m2d=i_bsc_m2d+1 + jdustflx4000(n)=i_bsc_m2d*min(1,FLX_DUST4000(n)) + if (FLX_DUST_BOT(n) > 0) i_bsc_m2d=i_bsc_m2d+1 + jdustflx_bot(n)=i_bsc_m2d*min(1,FLX_DUST_BOT(n)) + if (.not. use_sedbypass) then if (FLX_SEDIFFIC(n) > 0) i_bsc_m2d=i_bsc_m2d+1 jsediffic(n)=i_bsc_m2d*min(1,FLX_SEDIFFIC(n)) @@ -957,7 +980,9 @@ subroutine alloc_mem_bgcmean(kpie,kpje,kpke) jbsiflx0100+jbsiflx0500+jbsiflx1000+ & jbsiflx2000+jbsiflx4000+jbsiflx_bot+ & jcalflx0100+jcalflx0500+jcalflx1000+ & - jcalflx2000+jcalflx4000+jcalflx_bot > 0) + jcalflx2000+jcalflx4000+jcalflx_bot+ & + jdustflx0100+jdustflx0500+jdustflx1000+ & + jdustflx2000+jdustflx4000+jdustflx_bot > 0) i_atm_m2d=i_bsc_m2d do n=1,nbgc diff --git a/hamocc/mo_biomod.F90 b/hamocc/mo_biomod.F90 index 56bea1c0..cbe6fedd 100644 --- a/hamocc/mo_biomod.F90 +++ b/hamocc/mo_biomod.F90 @@ -69,6 +69,12 @@ module mo_biomod real, dimension (:,:), allocatable, public :: calflx2000 real, dimension (:,:), allocatable, public :: calflx4000 real, dimension (:,:), allocatable, public :: calflx_bot + real, dimension (:,:), allocatable, public :: dustflx0100 + real, dimension (:,:), allocatable, public :: dustflx0500 + real, dimension (:,:), allocatable, public :: dustflx1000 + real, dimension (:,:), allocatable, public :: dustflx2000 + real, dimension (:,:), allocatable, public :: dustflx4000 + real, dimension (:,:), allocatable, public :: dustflx_bot real, dimension (:,:,:), allocatable, public :: phosy3d ! Variables for interactive phytoplanktion absorption (use_FB_BGC_OCE=.true.) @@ -277,7 +283,7 @@ subroutine alloc_mem_biomod(kpie,kpje,kpke) allocate (calflx2000(kpie,kpje),stat=errstat) allocate (calflx4000(kpie,kpje),stat=errstat) allocate (calflx_bot(kpie,kpje),stat=errstat) - if(errstat.ne.0) stop 'not enough memory bsiflx*' + if(errstat.ne.0) stop 'not enough memory calflx*' calflx0100(:,:) = 0.0 calflx0500(:,:) = 0.0 calflx1000(:,:) = 0.0 @@ -285,6 +291,26 @@ subroutine alloc_mem_biomod(kpie,kpje,kpke) calflx4000(:,:) = 0.0 calflx_bot(:,:) = 0.0 + if (mnproc.eq.1) then + write(io_stdo_bgc,*)'Memory allocation for variable dustflx* ...' + write(io_stdo_bgc,*)'First dimension : ',kpie + write(io_stdo_bgc,*)'Second dimension : ',kpje + endif + + allocate (dustflx0100(kpie,kpje),stat=errstat) + allocate (dustflx0500(kpie,kpje),stat=errstat) + allocate (dustflx1000(kpie,kpje),stat=errstat) + allocate (dustflx2000(kpie,kpje),stat=errstat) + allocate (dustflx4000(kpie,kpje),stat=errstat) + allocate (dustflx_bot(kpie,kpje),stat=errstat) + if(errstat.ne.0) stop 'not enough memory dustflx*' + dustflx0100(:,:) = 0.0 + dustflx0500(:,:) = 0.0 + dustflx1000(:,:) = 0.0 + dustflx2000(:,:) = 0.0 + dustflx4000(:,:) = 0.0 + dustflx_bot(:,:) = 0.0 + if (mnproc.eq.1) then write(io_stdo_bgc,*)'Memory allocation for variable phosy3d ...' write(io_stdo_bgc,*)'First dimension : ',kpie diff --git a/hamocc/mo_ncout_hamocc.F90 b/hamocc/mo_ncout_hamocc.F90 index 4e794472..d867384f 100644 --- a/hamocc/mo_ncout_hamocc.F90 +++ b/hamocc/mo_ncout_hamocc.F90 @@ -46,6 +46,8 @@ subroutine ncwrt_bgc(iogrp) flx_car2000,flx_car4000,flx_car_bot, & flx_bsi0100,flx_bsi0500,flx_bsi1000, & flx_bsi2000,flx_bsi4000,flx_bsi_bot, & + flx_dust0100,flx_dust0500,flx_dust1000, & + flx_dust2000,flx_dust4000,flx_dust_bot, & flx_sediffic,flx_sediffal,flx_sediffph, & flx_sediffox,flx_sediffn2,flx_sediffno3,flx_sediffsi, & flx_bursso12,flx_bursssc12,flx_burssssil, & @@ -61,6 +63,8 @@ subroutine ncwrt_bgc(iogrp) jcalflx2000,jcalflx4000,jcalflx_bot, & jcarflx0100,jcarflx0500,jcarflx1000, & jcarflx2000,jcarflx4000,jcarflx_bot, & + jdustflx0100,jdustflx0500,jdustflx1000, & + jdustflx2000,jdustflx4000,jdustflx_bot, & jco2fxd,jco2fxu,jco3,jdic,jdicsat, & jdms,jdms_bac,jdms_uv,jdmsflux,jdmsprod, & jdoc,jdp,jeps,jexpoca,jexport,jexposi,jgrazer, & @@ -418,6 +422,11 @@ subroutine ncwrt_bgc(iogrp) call msksrf(jcalflx1000(iogrp),k1000) call msksrf(jcalflx2000(iogrp),k2000) call msksrf(jcalflx4000(iogrp),k4000) + call msksrf(jdustflx0100(iogrp),k0100) + call msksrf(jdustflx0500(iogrp),k0500) + call msksrf(jdustflx1000(iogrp),k1000) + call msksrf(jdustflx2000(iogrp),k2000) + call msksrf(jdustflx4000(iogrp),k4000) ! --- Mask sea floor in level data call msklvl(jlvlphyto(iogrp),depths) @@ -580,6 +589,12 @@ subroutine ncwrt_bgc(iogrp) call wrtsrf(jcalflx2000(iogrp), FLX_CAL2000(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'calflx2000') call wrtsrf(jcalflx4000(iogrp), FLX_CAL4000(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'calflx4000') call wrtsrf(jcalflx_bot(iogrp), FLX_CAL_BOT(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'calflx_bot') + call wrtsrf(jdustflx0100(iogrp), FLX_DUST0100(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'dustflx0100') + call wrtsrf(jdustflx0500(iogrp), FLX_DUST0500(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'dustflx0500') + call wrtsrf(jdustflx1000(iogrp), FLX_DUST1000(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'dustflx1000') + call wrtsrf(jdustflx2000(iogrp), FLX_DUST2000(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'dustflx2000') + call wrtsrf(jdustflx4000(iogrp), FLX_DUST4000(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'dustflx4000') + call wrtsrf(jdustflx_bot(iogrp), FLX_DUST_BOT(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'dustflx_bot') if (.not. use_sedbypass) then call wrtsrf(jsediffic(iogrp), FLX_SEDIFFIC(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'sedfdic') call wrtsrf(jsediffal(iogrp), FLX_SEDIFFAL(iogrp), rnacc*1e3/dtbgc,0.,cmpflg,'sedfalk') @@ -934,6 +949,12 @@ subroutine ncwrt_bgc(iogrp) call inisrf(jcalflx2000(iogrp),0.) call inisrf(jcalflx4000(iogrp),0.) call inisrf(jcalflx_bot(iogrp),0.) + call inisrf(jdustflx0100(iogrp),0.) + call inisrf(jdustflx0500(iogrp),0.) + call inisrf(jdustflx1000(iogrp),0.) + call inisrf(jdustflx2000(iogrp),0.) + call inisrf(jdustflx4000(iogrp),0.) + call inisrf(jdustflx_bot(iogrp),0.) if (.not. use_sedbypass) then call inisrf(jsediffic(iogrp),0.) call inisrf(jsediffal(iogrp),0.) @@ -1251,6 +1272,8 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg) flx_bsi0100,flx_bsi0500,flx_bsi1000,flx_bsi2000,flx_bsi4000, & flx_bsi_bot,flx_cal0100,flx_cal0500,flx_cal1000,flx_cal2000, & flx_cal4000,flx_cal_bot,flx_sediffic,flx_sediffal, & + flx_dust0100,flx_dust0500,flx_dust1000,flx_dust2000,flx_dust4000, & + flx_dust_bot, & flx_sediffph,flx_sediffox,flx_sediffn2,flx_sediffno3, & flx_sediffsi,flx_bursso12,flx_bursssc12,flx_burssssil,flx_burssster, & srf_n2ofx,srf_atmco2,lyr_dp,lyr_dic, & @@ -1475,6 +1498,19 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg) & 'CaCO3 flux at 4000m',' ','mol Ca m-2 s-1',0) call ncdefvar3d(FLX_CAL_BOT(iogrp),cmpflg,'p','calflx_bot', & & 'CaCO3 flux to sediment',' ','mol Ca m-2 s-1',0) + call ncdefvar3d(FLX_DUST0100(iogrp),cmpflg,'p','dustflx0100', & + & 'Dust flux at 100m',' ','g m-2 s-1',0) + call ncdefvar3d(FLX_DUST0500(iogrp),cmpflg,'p','dustflx0500', & + & 'Dust flux at 500m',' ','g m-2 s-1',0) + call ncdefvar3d(FLX_DUST1000(iogrp),cmpflg,'p','dustflx1000', & + & 'Dust flux at 1000m',' ','g m-2 s-1',0) + call ncdefvar3d(FLX_DUST2000(iogrp),cmpflg,'p','dustflx2000', & + & 'Dust flux at 2000m',' ','g m-2 s-1',0) + call ncdefvar3d(FLX_DUST4000(iogrp),cmpflg,'p','dustflx4000', & + & 'Dust flux at 4000m',' ','g m-2 s-1',0) + call ncdefvar3d(FLX_DUST_BOT(iogrp),cmpflg,'p','dustflx_bot', & + & 'Dust flux to sediment',' ','g m-2 s-1',0) + call ncdefvar3d(SRF_N2OFX(iogrp),cmpflg,'p','n2oflux', & & 'N2O flux',' ','mol N2O m-2 s-1',0) if (.not. use_sedbypass) then @@ -1486,7 +1522,7 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg) & ' ','mol m-2 s-1',0) call ncdefvar3d(FLX_SEDIFFPH(iogrp),cmpflg,'p','sedfpho', & & 'diffusive phosphate flux to sediment (positive downwards)', & - & ' ','mol m-2 s-1',0) + & ' ','mol P m-2 s-1',0) call ncdefvar3d(FLX_SEDIFFOX(iogrp),cmpflg,'p','sedfox', & & 'diffusive oxygen flux to sediment (positive downwards)', & & ' ','mol O2 m-2 s-1',0) @@ -1646,7 +1682,7 @@ subroutine hamoccvardef(iogrp,timeunits,calendar,cmpflg) call ncdefvar3d(LYR_PREFPO4(iogrp),cmpflg,'p', & & 'p_po4','Preformed phosphorus',' ','mol P m-3',1) call ncdefvar3d(LYR_PREFSILICA(iogrp),cmpflg,'p', & - & 'p_silica','Preformed silica',' ','mol N m-3',1) + & 'p_silica','Preformed silica',' ','mol Si m-3',1) call ncdefvar3d(LYR_PREFALK(iogrp),cmpflg,'p', & & 'p_talk','Preformed alkalinity',' ','eq m-3',1) call ncdefvar3d(LYR_PREFDIC(iogrp),cmpflg,'p', & diff --git a/hamocc/mo_ocprod.F90 b/hamocc/mo_ocprod.F90 index 37c5e49b..ab954217 100644 --- a/hamocc/mo_ocprod.F90 +++ b/hamocc/mo_ocprod.F90 @@ -81,6 +81,8 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp use mo_biomod, only: bsiflx0100,bsiflx0500,bsiflx1000,bsiflx2000,bsiflx4000,bsiflx_bot, & calflx0100,calflx0500,calflx1000,calflx2000,calflx4000,calflx_bot, & carflx0100,carflx0500,carflx1000,carflx2000,carflx4000,carflx_bot, & + dustflx0100,dustflx0500,dustflx1000,dustflx2000,dustflx4000, & + dustflx_bot, & expoor,exposi,expoca,intdnit,intdms_bac,intdmsprod,intdms_uv, & intphosy,int_chbr3_prod,int_chbr3_uv, & phosy3d,abs_oce,strahl,asize3d,wmass,wnumb,eps3d,phosy_NH4, & @@ -1158,6 +1160,16 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp wdust = wdust_const wdustd = wdust_const dagg = 0.0 + else if (use_M4AGO) then + wpoc = ws_agg(i,j,k) + wpocd = ws_agg(i,j,kdonor) + wcal = ws_agg(i,j,k) + wcald = ws_agg(i,j,kdonor) + wopal = ws_agg(i,j,k) + wopald = ws_agg(i,j,kdonor) + wdust = ws_agg(i,j,k) + wdustd = ws_agg(i,j,kdonor) + dagg = 0.0 else wpoc = wpoc_const wpocd = wpoc_const @@ -1169,17 +1181,6 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp wdustd = wdust_const dagg = 0.0 endif - if (use_M4AGO) then ! superseding every other method - wpoc = ws_agg(i,j,k) - wpocd = ws_agg(i,j,kdonor) - wcal = ws_agg(i,j,k) - wcald = ws_agg(i,j,kdonor) - wopal = ws_agg(i,j,k) - wopald = ws_agg(i,j,kdonor) - wdust = ws_agg(i,j,k) - wdustd = ws_agg(i,j,kdonor) - dagg = 0.0 - endif if( k == 1 ) then wpocd = 0.0 @@ -1189,11 +1190,9 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp if (use_AGG) then wnosd = 0.0 else if (use_WLIN) then - if (use_M4AGO) then - wpoc = ws_agg(i,j,k) - else - wpoc = wmin - endif + wpoc = wmin + else if (use_M4AGO) then + wpoc = ws_agg(i,j,k) endif endif @@ -1380,19 +1379,28 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp wpoc = wmass(i,j,k) wcal = wmass(i,j,k) wopal = wmass(i,j,k) + wdust = dustsink else if (use_WLIN) then wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax) - endif - if (use_M4AGO) then + wdust = wdust_const + else if (use_M4AGO) then wpoc = ws_agg(i,j,k) wcal = ws_agg(i,j,k) wopal = ws_agg(i,j,k) + wdust = ws_agg(i,j,k) + else + wpoc = wpoc_const + wcal = wcal_const + wopal = wopal_const + wdust = wdust_const endif if (use_AGG) then carflx0100(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc + dustflx0100(i,j)= ocetra(i,j,k,ifdust)*wdust + ocetra(i,j,k,iadust)*wpoc else carflx0100(i,j) = ocetra(i,j,k,idet)*rcar*wpoc + dustflx0100(i,j)= ocetra(i,j,k,ifdust)*wdust endif bsiflx0100(i,j) = ocetra(i,j,k,iopal)*wopal calflx0100(i,j) = ocetra(i,j,k,icalc)*wcal @@ -1405,19 +1413,28 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp wpoc = wmass(i,j,k) wcal = wmass(i,j,k) wopal = wmass(i,j,k) + wdust = dustsink else if (use_WLIN) then wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax) + wdust = wdust_const + else if (use_M4AGO) then + wpoc = ws_agg(i,j,k) + wcal = ws_agg(i,j,k) + wopal = ws_agg(i,j,k) + wdust = ws_agg(i,j,k) + else + wpoc = wpoc_const + wcal = wcal_const + wopal = wopal_const + wdust = wdust_const endif - if (use_M4AGO) then - wpoc = ws_agg(i,j,k) - wcal = ws_agg(i,j,k) - wopal = ws_agg(i,j,k) - endif if (use_AGG) then carflx0500(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc + dustflx0500(i,j)= ocetra(i,j,k,ifdust)*wdust + ocetra(i,j,k,iadust)*wpoc else carflx0500(i,j) = ocetra(i,j,k,idet)*rcar*wpoc + dustflx0500(i,j)= ocetra(i,j,k,ifdust)*wdust endif bsiflx0500(i,j) = ocetra(i,j,k,iopal)*wopal calflx0500(i,j) = ocetra(i,j,k,icalc)*wcal @@ -1430,19 +1447,28 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp wpoc = wmass(i,j,k) wcal = wmass(i,j,k) wopal = wmass(i,j,k) + wdust = dustsink else if (use_WLIN) then wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax) - endif - if (use_M4AGO) then + wdust = wdust_const + else if (use_M4AGO) then wpoc = ws_agg(i,j,k) wcal = ws_agg(i,j,k) wopal = ws_agg(i,j,k) + wdust = ws_agg(i,j,k) + else + wpoc = wpoc_const + wcal = wcal_const + wopal = wopal_const + wdust = wdust_const endif if (use_AGG) then carflx1000(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc + dustflx1000(i,j)= ocetra(i,j,k,ifdust)*wdust + ocetra(i,j,k,iadust)*wpoc else carflx1000(i,j) = ocetra(i,j,k,idet)*rcar*wpoc + dustflx1000(i,j)= ocetra(i,j,k,ifdust)*wdust endif bsiflx1000(i,j) = ocetra(i,j,k,iopal)*wopal calflx1000(i,j) = ocetra(i,j,k,icalc)*wcal @@ -1455,19 +1481,28 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp wpoc = wmass(i,j,k) wcal = wmass(i,j,k) wopal = wmass(i,j,k) + wdust = dustsink else if (use_WLIN) then wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax) - endif - if (use_M4AGO) then + wdust = wdust_const + else if (use_M4AGO) then wpoc = ws_agg(i,j,k) wcal = ws_agg(i,j,k) wopal = ws_agg(i,j,k) + wdust = ws_agg(i,j,k) + else + wpoc = wpoc_const + wcal = wcal_const + wopal = wopal_const + wdust = wdust_const endif if (use_AGG) then carflx2000(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc + dustflx2000(i,j)= ocetra(i,j,k,ifdust)*wdust + ocetra(i,j,k,iadust)*wpoc else carflx2000(i,j) = ocetra(i,j,k,idet)*rcar*wpoc + dustflx2000(i,j)= ocetra(i,j,k,ifdust)*wdust endif bsiflx2000(i,j) = ocetra(i,j,k,iopal)*wopal calflx2000(i,j) = ocetra(i,j,k,icalc)*wcal @@ -1480,19 +1515,28 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp wpoc = wmass(i,j,k) wcal = wmass(i,j,k) wopal = wmass(i,j,k) + wdust = dustsink else if (use_WLIN) then wpoc = min(wmin+wlin*ptiestu(i,j,k), wmax) - endif - if (use_M4AGO) then + wdust = wdust_const + else if (use_M4AGO) then wpoc = ws_agg(i,j,k) wcal = ws_agg(i,j,k) wopal = ws_agg(i,j,k) + wdust = ws_agg(i,j,k) + else + wpoc = wpoc_const + wcal = wcal_const + wopal = wopal_const + wdust = wdust_const endif if (use_AGG) then carflx4000(i,j) = (ocetra(i,j,k,idet)+ocetra(i,j,k,iphy))*rcar*wpoc + dustflx4000(i,j)= ocetra(i,j,k,ifdust)*wdust + ocetra(i,j,k,iadust)*wpoc else carflx4000(i,j) = ocetra(i,j,k,idet)*rcar*wpoc + dustflx4000(i,j)= ocetra(i,j,k,ifdust)*wdust endif bsiflx4000(i,j) = ocetra(i,j,k,iopal)*wopal calflx4000(i,j) = ocetra(i,j,k,icalc)*wcal @@ -1502,6 +1546,7 @@ subroutine ocprod(kpie,kpje,kpke,kbnd,pdlxp,pdlyp,pddpo,omask,ptho,pi_ph,psao,pp carflx_bot(i,j) = prorca(i,j)*rcar bsiflx_bot(i,j) = silpro(i,j) calflx_bot(i,j) = prcaca(i,j) + dustflx_bot(i,j)= produs(i,j) endif ! omask > 0.5 enddo