From d7cd4ef85a4921d0d8326e976ee8f21242661aba Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 12 Mar 2021 13:05:48 -0500 Subject: [PATCH 01/14] Changes to enable FATES-side running means --- src/biogeophys/CanopyFluxesMod.F90 | 3 +- src/main/clm_driver.F90 | 2 + src/main/clm_initializeMod.F90 | 2 +- src/utils/clmfates_interfaceMod.F90 | 57 +++++++++++++++++++++-------- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index f18bde2e0e..2a53cf5a00 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -612,6 +612,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, bsha => energyflux_inst%bsha_patch ! Output: [real(r8) (:) ] sunlit canopy transpiration wetness factor (0 to 1) end if + ! Determine step size dtime = get_step_size_real() @@ -627,7 +628,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, fn = num_exposedvegp filterp(1:fn) = filter_exposedvegp(1:fn) - + ! ----------------------------------------------------------------- ! Time step initialization of photosynthesis variables ! ----------------------------------------------------------------- diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 276dfbc467..555c097650 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -1088,6 +1088,8 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro soilbiogeochem_carbonflux_inst, & soilbiogeochem_carbonstate_inst) + call clm_fates%WrapUpdateFatesRmean(nc,temperature_inst) + if( is_beg_curr_day() ) then diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 648e252f5c..53357a6d36 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -208,7 +208,7 @@ subroutine initialize1(dtime, gindex_ocn) ! This also sets up various global constants in FATES ! ------------------------------------------------------------------------ - call CLMFatesGlobals() + call CLMFatesGlobals(dtime) ! ------------------------------------------------------------------------ ! Determine decomposition of subgrid scale landunits, columns, patches diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 836668511f..4ce85c50c6 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -114,8 +114,8 @@ module CLMFatesInterfaceMod use FatesInterfaceMod , only : zero_bcs use FatesInterfaceMod , only : SetFatesTime use FatesInterfaceMod , only : set_fates_ctrlparms - - + use FatesInterfaceMod , only : UpdateFatesRMeansTStep + use FatesHistoryInterfaceMod, only : fates_history_interface_type use FatesRestartInterfaceMod, only : fates_restart_interface_type @@ -218,7 +218,8 @@ module CLMFatesInterfaceMod procedure, private :: init_soil_depths procedure, public :: ComputeRootSoilFlux procedure, public :: wrap_hydraulics_drive - + procedure, public :: WrapUpdateFatesRmean + end type hlm_fates_interface_type ! hlm_bounds_to_fates_bounds is not currently called outside the interface. @@ -241,7 +242,7 @@ module CLMFatesInterfaceMod contains - subroutine CLMFatesGlobals() + subroutine CLMFatesGlobals(dtime) ! -------------------------------------------------------------------------------- ! This is one of the first calls to fates @@ -253,6 +254,8 @@ subroutine CLMFatesGlobals() ! over the NL variables to FATES global settings. ! -------------------------------------------------------------------------------- + real(r8), intent(in) :: dtime ! main model timestep + logical :: verbose_output integer :: pass_masterproc integer :: pass_vertsoilc @@ -319,6 +322,7 @@ subroutine CLMFatesGlobals() call set_fates_ctrlparms('sf_scalar_lightning_def',ival=scalar_lightning) call set_fates_ctrlparms('sf_successful_ignitions_def',ival=successful_ignitions) call set_fates_ctrlparms('sf_anthro_ignitions_def',ival=anthro_ignitions) + call set_fates_ctrlparms('stepsize', rval = dtime) !get_step_size_real()) if(is_restart()) then pass_is_restart = 1 @@ -812,8 +816,6 @@ subroutine dynamics_driv(this, nc, bounds_clump, & do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) - this%fates(nc)%bc_in(s)%t_veg24_pa(ifp) = & - temperature_inst%t_veg24_patch(p) this%fates(nc)%bc_in(s)%precip24_pa(ifp) = & wateratm2lndbulk_inst%prec24_patch(p) @@ -1074,6 +1076,7 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & patch%is_veg(p) = .true. patch%wt_ed(p) = this%fates(nc)%bc_out(s)%canopy_fraction_pa(ifp) + elai(p) = this%fates(nc)%bc_out(s)%elai_pa(ifp) tlai(p) = this%fates(nc)%bc_out(s)%tlai_pa(ifp) esai(p) = this%fates(nc)%bc_out(s)%esai_pa(ifp) @@ -1092,7 +1095,7 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & end do - + end do end associate @@ -1430,7 +1433,7 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & type(waterdiagnosticbulk_type) , intent(inout) :: waterdiagnosticbulk_inst type(canopystate_type) , intent(inout) :: canopystate_inst type(soilstate_type) , intent(inout) :: soilstate_inst - + ! locals integer :: nclumps integer :: nc @@ -1506,6 +1509,7 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & call HydrSiteColdStart(this%fates(nc)%sites,this%fates(nc)%bc_in) end if + ! Newly initialized patches need a starting temperature call init_patches(this%fates(nc)%nsites, this%fates(nc)%sites, & this%fates(nc)%bc_in) @@ -2322,7 +2326,9 @@ subroutine InitAccVars(this, bounds) end subroutine InitAccVars !----------------------------------------------------------------------- - subroutine UpdateAccVars(this, bounds) + + subroutine UpdateAccVars(this, bounds_proc) + ! ! !DESCRIPTION: ! Update any accumulation variables needed for FATES @@ -2331,23 +2337,44 @@ subroutine UpdateAccVars(this, bounds) ! ! !ARGUMENTS: class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds_proc ! - ! !LOCAL VARIABLES: - + character(len=*), parameter :: subname = 'UpdateAccVars' !----------------------------------------------------------------------- call t_startf('fates_updateaccvars') - call this%fates_fire_data_method%UpdateAccVars( bounds ) - + call this%fates_fire_data_method%UpdateAccVars( bounds_proc ) + call t_stopf('fates_updateaccvars') end subroutine UpdateAccVars - + ! ====================================================================================== + subroutine WrapUpdateFatesRmean(this, nc, temperature_inst) + + class(hlm_fates_interface_type), intent(inout) :: this + type(temperature_type), intent(in) :: temperature_inst + + ! !LOCAL VARIABLES: + integer :: nc,s,c,p,ifp ! indices and loop counters + + do s = 1, this%fates(nc)%nsites + c = this%f2hmap(nc)%fcolumn(s) + do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno + p = ifp+col%patchi(c) + this%fates(nc)%bc_in(s)%tveg_pa(ifp) = temperature_inst%t_veg_patch(p) + end do + end do + + call UpdateFatesRMeansTStep(this%fates(nc)%sites,this%fates(nc)%bc_in) + + end subroutine WrapUpdateFatesRmean + + ! ====================================================================================== + subroutine init_history_io(this,bounds_proc) use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp From 376943cd50cdb7b773ae41604bc29026dcd5117f Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 19 Mar 2021 15:10:34 -0400 Subject: [PATCH 02/14] fixed api with fates running means --- src/utils/clmfates_interfaceMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 4ce85c50c6..68ccc5b96e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -254,7 +254,7 @@ subroutine CLMFatesGlobals(dtime) ! over the NL variables to FATES global settings. ! -------------------------------------------------------------------------------- - real(r8), intent(in) :: dtime ! main model timestep + integer, intent(in) :: dtime ! main model timestep (s) logical :: verbose_output integer :: pass_masterproc @@ -322,7 +322,7 @@ subroutine CLMFatesGlobals(dtime) call set_fates_ctrlparms('sf_scalar_lightning_def',ival=scalar_lightning) call set_fates_ctrlparms('sf_successful_ignitions_def',ival=successful_ignitions) call set_fates_ctrlparms('sf_anthro_ignitions_def',ival=anthro_ignitions) - call set_fates_ctrlparms('stepsize', rval = dtime) !get_step_size_real()) + call set_fates_ctrlparms('stepsize', rval = real(dtime,r8)) !get_step_size_real()) if(is_restart()) then pass_is_restart = 1 From 218027bf16c91a34391ec18413b54d9af1e1afdf Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 27 May 2021 12:09:20 -0400 Subject: [PATCH 03/14] Updating external hash on FATES to use the testing branch for running means --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index bc4e1d22a0..8eb4816812 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NGEET/fates -tag = sci.1.46.0_api.16.0.0 +repo_url = https://github.com/rgknox/fates +hash = e5c8b2e6af0e3482880545d2d041b35b09faddfe required = True [PTCLM] From 45654662e482d03c2aade599e87a2f73a4cf302a Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 27 May 2021 12:33:19 -0400 Subject: [PATCH 04/14] Fixed argument type issue in fates initialization coupling --- src/utils/clmfates_interfaceMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index e441976903..a22c9891b0 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -251,7 +251,7 @@ subroutine CLMFatesGlobals(dtime) ! over the NL variables to FATES global settings. ! -------------------------------------------------------------------------------- - integer, intent(in) :: dtime ! main model timestep (s) + real(r8), intent(in) :: dtime ! main model timestep (s) logical :: verbose_output integer :: pass_masterproc @@ -320,7 +320,7 @@ subroutine CLMFatesGlobals(dtime) call set_fates_ctrlparms('sf_scalar_lightning_def',ival=scalar_lightning) call set_fates_ctrlparms('sf_successful_ignitions_def',ival=successful_ignitions) call set_fates_ctrlparms('sf_anthro_ignitions_def',ival=anthro_ignitions) - call set_fates_ctrlparms('stepsize', rval = real(dtime,r8)) !get_step_size_real()) + call set_fates_ctrlparms('stepsize', rval = dtime) if(is_restart()) then pass_is_restart = 1 From 966344758f4e409fe464f2c3558e8145095a549c Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 27 May 2021 12:53:14 -0400 Subject: [PATCH 05/14] Changed call order for initing fates globals --- src/main/clm_initializeMod.F90 | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index f5ba6f9952..76dd9e23a8 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -223,20 +223,7 @@ subroutine initialize2(ni,nj) ! Read surface dataset and set up subgrid weight arrays call surfrd_get_data(begg, endg, ldomain, fsurdat, actual_numcft) - ! Ask Fates to evaluate its own dimensioning needs. - ! This determines the total amount of space it requires in its largest - ! dimension. We are currently calling that the "cohort" dimension, but - ! it is really a utility dimension that captures the models largest - ! size need. - ! Sets: - ! fates_maxElementsPerPatch - ! fates_maxElementsPerSite (where a site is roughly equivalent to a column) - ! (Note: fates_maxELementsPerSite is the critical variable used by CLM - ! to allocate space) - ! This also sets up various global constants in FATES - ! ------------------------------------------------------------------------ - - call CLMFatesGlobals(dtime) + ! Determine decomposition of subgrid scale landunits, columns, patches call decompInit_clumps(ni, nj, glc_behavior) @@ -317,6 +304,22 @@ subroutine initialize2(ni,nj) call t_stopf('init_orbd') call InitDaylength(bounds_proc, declin=declin, declinm1=declinm1, obliquity=obliqr) + ! Ask Fates to evaluate its own dimensioning needs. + ! This determines the total amount of space it requires in its largest + ! dimension. We are currently calling that the "cohort" dimension, but + ! it is really a utility dimension that captures the models largest + ! size need. + ! Sets: + ! fates_maxElementsPerPatch + ! fates_maxElementsPerSite (where a site is roughly equivalent to a column) + ! (Note: fates_maxELementsPerSite is the critical variable used by CLM + ! to allocate space) + ! This also sets up various global constants in FATES + ! ------------------------------------------------------------------------ + + call CLMFatesGlobals(dtime) + + ! Initialize Balance checking (after time-manager) call BalanceCheckInit() From 1f1bb75e29996ed3a6997488feaaaac4e5ea96b6 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 8 Jul 2021 13:04:46 -0400 Subject: [PATCH 06/14] fates running means: removed duplicative boundary condition on the fates side. --- src/main/clm_driver.F90 | 2 ++ src/utils/clmfates_interfaceMod.F90 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 68bd36fb05..0ac5a10e3e 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -1088,6 +1088,8 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro soilbiogeochem_carbonflux_inst, & soilbiogeochem_carbonstate_inst) + ! This call updates some history diagnostics and must be called + ! after wrap_update_hifrq_hist call clm_fates%WrapUpdateFatesRmean(nc,temperature_inst) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index f80caf9d27..37009266df 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -2421,7 +2421,7 @@ subroutine WrapUpdateFatesRmean(this, nc, temperature_inst) c = this%f2hmap(nc)%fcolumn(s) do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) - this%fates(nc)%bc_in(s)%tveg_pa(ifp) = temperature_inst%t_veg_patch(p) + this%fates(nc)%bc_in(s)%t_veg_pa(ifp) = temperature_inst%t_veg_patch(p) end do end do From fd1459da2cf9d834678834e96d71dc7055d062be Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 8 Jul 2021 13:06:27 -0400 Subject: [PATCH 07/14] Update fates external to testing hash --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index e24b102da1..8291a2b4f1 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NGEET/fates -tag = sci.1.46.2_api.16.1.0 +repo_url = https://github.com/rgknox/fates +hash = da2d7e36e52c205a9883f2c3a65bb358d994bdd2 required = True [PTCLM] From 3c6eec6cd2f523873fea41f8e5774fa355739de6 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 13 Oct 2021 18:04:58 -0400 Subject: [PATCH 08/14] Merge resolution between fates running means feature branch and dev59 --- .config_files.xml | 10 +- .gitignore | 4 +- Externals.cfg | 46 +- Externals_CLM.cfg | 6 +- README | 48 +- README.CHECKLIST.new_case | 40 + bld/CLMBuildNamelist.pm | 385 ++- bld/namelist_files/checkmapfiles.ncl | 2 +- bld/namelist_files/createMapEntry.pl | 11 +- bld/namelist_files/namelist_defaults_ctsm.xml | 722 +++-- .../namelist_defaults_ctsm_tools.xml | 16 +- .../namelist_defaults_overall.xml | 2 - .../namelist_definition_ctsm.xml | 97 +- .../1850-2100_SSP1-1.9_transient.xml | 4 + .../1850-2100_SSP1-2.6_transient.xml | 4 + .../1850-2100_SSP2-4.5_transient.xml | 4 + .../1850-2100_SSP3-7.0_transient.xml | 4 + .../1850-2100_SSP4-3.4_transient.xml | 4 + .../1850-2100_SSP4-6.0_transient.xml | 4 + .../1850-2100_SSP5-3.4_transient.xml | 4 + .../1850-2100_SSP5-8.5_transient.xml | 4 + .../use_cases/1850_noanthro_control.xml | 4 +- .../use_cases/20thC_transient.xml | 4 + bld/unit_testers/build-namelist_test.pl | 241 +- cime_config/buildlib | 2 + cime_config/buildnml | 32 +- cime_config/config_component.xml | 37 +- cime_config/config_compsets.xml | 15 +- cime_config/testdefs/ExpectedTestFails.xml | 162 +- cime_config/testdefs/testlist_clm.xml | 274 +- .../testmods_dirs/clm/Fates/shell_commands | 1 - .../testmods_dirs/clm/Fates/user_nl_clm | 97 +- .../clm/FatesAllVars/shell_commands | 1 - .../clm/FatesColdDef/user_nl_clm | 10 - .../clm/FatesColdDefAllVars/shell_commands | 3 + .../user_nl_clm | 0 .../testmods_dirs/clm/FatesColdDefCH4/README | 2 + .../clm/FatesColdDefCH4/user_nl_clm | 1 + .../include_user_mods | 0 .../user_nl_clm | 0 .../include_user_mods | 0 .../clm/FatesColdDefLandUse/user_nl_clm | 2 + .../include_user_mods | 0 .../user_nl_clm | 0 .../include_user_mods | 0 .../user_nl_clm | 0 .../include_user_mods | 0 .../user_nl_clm | 0 .../include_user_mods | 0 .../clm/FatesColdDefPRT2/user_nl_clm | 1 + .../include_user_mods | 0 .../user_nl_clm | 1 + .../include_user_mods | 1 + .../user_nl_clm | 1 + .../include_user_mods | 1 + .../user_nl_clm | 2 + .../clm/FatesColdDefST3/include_user_mods | 1 + .../{FatesST3 => FatesColdDefST3}/user_nl_clm | 0 .../FatesColdDefSizeAgeMort/include_user_mods | 1 + .../user_nl_clm | 0 .../README | 1 - .../user_nl_clm | 0 .../clm/FatesHydro/shell_commands | 1 - .../clm/FatesPRT2/include_user_mods | 1 - .../testmods_dirs/clm/FatesPRT2/user_nl_clm | 5 - .../user_nl_clm | 1 - .../clm/NEON_NIWO/include_user_mods | 1 - .../testmods_dirs/clm/NoVSNoNI/user_nl_clm | 4 - .../{NoVSNoNI => anoxia}/include_user_mods | 0 .../clm/{rootlit => anoxia}/user_nl_clm | 1 - .../testmods_dirs/clm/ciso_cwd_hr/user_nl_clm | 2 +- .../testmods_dirs/clm/default/user_nl_clm | 1 - .../clm/extra_outputs/user_nl_clm | 4 + .../clm/fatesFire/include_user_mods | 1 - .../clm/fatesFire/shell_commands | 1 - .../testmods_dirs/clm/fatesFire/user_nl_clm | 2 - .../README | 0 .../include_user_mods | 0 .../user_nl_clm | 2 +- .../testmods_dirs/clm/luna/shell_commands | 3 + .../testmods_dirs/clm/nofire/user_nl_clm | 1 - .../testdefs/testmods_dirs/clm/o3/user_nl_clm | 2 - .../include_user_mods | 0 .../clm/o3lombardozzi2015/user_nl_clm | 2 + .../clm/rootlit/include_user_mods | 1 - .../shell_commands | 4 + .../smallville_dynlakes_monthly/user_nl_clm | 4 - .../usermods_dirs/NEON/defaults/user_nl_clm | 8 +- .../usermods_dirs/output_bgc/user_nl_clm | 6 +- doc/.ChangeLog_template | 5 +- doc/ChangeLog | 1521 +++++++++- doc/ChangeSum | 107 +- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 2 +- .../CLM50_Tech_Note_Photosynthesis.rst | 88 +- ...CLM50_Tech_Note_Soil_Snow_Temperatures.rst | 2 +- .../Adding-Resolution-Names.rst | 6 +- .../running-single-point-configurations.rst | 6 +- .../README_master_list_file | 9 - .../README_master_list_files | 10 + .../customizing-the-clm-namelist.rst | 11 +- .../setting-up-and-running-a-case/index.rst | 3 +- .../master_list_fates.rst | 955 ++++++ ..._list_file.rst => master_list_nofates.rst} | 2551 +++++++++-------- .../trouble-shooting/trouble-shooting.rst | 139 +- python/ctsm/lilac_make_runtime_inputs.py | 1 + python/ctsm/machine_defaults.py | 4 +- python/ctsm/path_utils.py | 3 + python/ctsm/run_sys_tests.py | 4 + src/CMakeLists.txt | 15 +- src/biogeochem/CMakeLists.txt | 9 + src/biogeochem/CNBalanceCheckMod.F90 | 13 +- src/biogeochem/CNDVEstablishmentMod.F90 | 4 +- src/biogeochem/CNDVType.F90 | 5 +- src/biogeochem/CNDriverMod.F90 | 9 +- src/biogeochem/CNFireLi2021Mod.F90 | 6 +- src/biogeochem/CNNDynamicsMod.F90 | 2 +- src/biogeochem/CNPhenologyMod.F90 | 642 +++-- src/biogeochem/CNPrecisionControlMod.F90 | 15 +- src/biogeochem/CNRootDynMod.F90 | 14 +- src/biogeochem/CNVegCarbonFluxType.F90 | 16 +- src/biogeochem/CNVegNitrogenFluxType.F90 | 8 +- src/biogeochem/CNVegNitrogenStateType.F90 | 1 - src/biogeochem/CNVegStructUpdateMod.F90 | 5 - src/biogeochem/DUSTMod.F90 | 6 +- src/biogeochem/DryDepVelocity.F90 | 5 +- src/biogeochem/EDBGCDynMod.F90 | 8 +- src/biogeochem/SatellitePhenologyMod.F90 | 50 +- src/biogeochem/ch4Mod.F90 | 48 +- src/biogeochem/test/CMakeLists.txt | 3 +- .../test/CNPhenology_test/CMakeLists.txt | 7 + .../test/CNPhenology_test/test_CNPhenology.pf | 298 ++ src/biogeophys/BalanceCheckMod.F90 | 26 +- src/biogeophys/CMakeLists.txt | 2 + src/biogeophys/CanopyFluxesMod.F90 | 57 +- src/biogeophys/CanopyHydrologyMod.F90 | 21 +- src/biogeophys/CanopyStateType.F90 | 155 +- src/biogeophys/FrictionVelocityMod.F90 | 4 +- src/biogeophys/HumanIndexMod.F90 | 32 +- src/biogeophys/HydrologyNoDrainageMod.F90 | 4 +- src/biogeophys/IrrigationMod.F90 | 16 +- src/biogeophys/LunaMod.F90 | 88 +- src/biogeophys/OzoneBaseMod.F90 | 47 +- src/biogeophys/OzoneFactoryMod.F90 | 16 +- src/biogeophys/OzoneMod.F90 | 320 ++- src/biogeophys/OzoneOffMod.F90 | 26 +- src/biogeophys/PhotosynthesisMod.F90 | 411 ++- src/biogeophys/SnowHydrologyMod.F90 | 90 +- src/biogeophys/SnowSnicarMod.F90 | 56 +- .../SoilHydrologyInitTimeConstMod.F90 | 34 +- src/biogeophys/SoilHydrologyMod.F90 | 14 +- src/biogeophys/SoilStateInitTimeConstMod.F90 | 97 +- src/biogeophys/SoilWaterMovementMod.F90 | 5 +- src/biogeophys/SurfaceAlbedoMod.F90 | 8 +- src/biogeophys/SurfaceRadiationMod.F90 | 5 +- src/biogeophys/SurfaceWaterMod.F90 | 37 +- src/biogeophys/TemperatureType.F90 | 50 +- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 22 +- src/biogeophys/UrbanAlbedoMod.F90 | 18 +- src/biogeophys/UrbanFluxesMod.F90 | 14 +- src/biogeophys/UrbanParamsType.F90 | 10 +- src/biogeophys/UrbanRadiationMod.F90 | 9 +- src/biogeophys/WaterBalanceType.F90 | 32 +- src/biogeophys/WaterDiagnosticBulkType.F90 | 40 +- src/biogeophys/WaterDiagnosticType.F90 | 26 +- src/biogeophys/WaterFluxType.F90 | 134 +- src/biogeophys/WaterStateType.F90 | 32 +- src/biogeophys/WaterTracerContainerType.F90 | 23 + src/biogeophys/WaterTracerUtils.F90 | 34 +- src/biogeophys/WaterType.F90 | 5 +- src/biogeophys/Wateratm2lndType.F90 | 21 +- src/biogeophys/Waterlnd2atmType.F90 | 26 +- src/biogeophys/test/CMakeLists.txt | 1 + .../test/Photosynthesis_test/CMakeLists.txt | 7 + .../test_Photosynthesis.pf | 107 + .../test_water_tracer_container.pf | 12 +- .../test_calc_tracer_from_bulk.pf | 3 + .../test_compare_bulk_to_tracer.pf | 4 +- src/cpl/lilac/lnd_comp_esmf.F90 | 4 +- src/cpl/mct/FireDataBaseType.F90 | 122 +- src/cpl/mct/SoilMoistureStreamMod.F90 | 52 +- src/cpl/mct/UrbanTimeVarType.F90 | 59 +- src/cpl/mct/ch4FInundatedStreamType.F90 | 51 +- src/cpl/mct/laiStreamMod.F90 | 4 +- src/cpl/mct/lnd_comp_mct.F90 | 61 +- src/cpl/mct/lnd_import_export.F90 | 5 +- src/cpl/mct/lnd_set_decomp_and_domain.F90 | 53 +- src/cpl/mct/ndepStreamMod.F90 | 27 +- src/cpl/nuopc/lnd_comp_nuopc.F90 | 100 +- src/cpl/share_esmf/SoilMoistureStreamMod.F90 | 8 +- src/cpl/share_esmf/UrbanTimeVarType.F90 | 7 +- .../share_esmf/lnd_set_decomp_and_domain.F90 | 6 +- src/dyn_subgrid/dynColumnStateUpdaterMod.F90 | 8 +- src/dyn_subgrid/dynHarvestMod.F90 | 6 +- src/dyn_subgrid/dynInitColumnsMod.F90 | 22 +- src/dyn_subgrid/dynPatchStateUpdaterMod.F90 | 4 +- src/dyn_subgrid/dynPriorWeightsMod.F90 | 4 +- src/dyn_subgrid/dynSubgridDriverMod.F90 | 8 +- src/dyn_subgrid/dyncropFileMod.F90 | 10 +- src/dyn_subgrid/dynlakeFileMod.F90 | 6 +- src/dyn_subgrid/dynpftFileMod.F90 | 10 +- src/main/GetGlobalValuesMod.F90 | 215 -- src/main/GridcellType.F90 | 3 - src/main/PatchType.F90 | 4 +- src/main/abortutils.F90 | 137 +- src/main/accumulMod.F90 | 15 +- src/main/atm2lndMod.F90 | 8 +- src/main/clm_driver.F90 | 80 +- src/main/clm_initializeMod.F90 | 45 +- src/main/clm_instMod.F90 | 12 +- src/main/clm_varcon.F90 | 3 - src/main/clm_varctl.F90 | 17 +- src/main/clm_varpar.F90 | 43 +- src/main/controlMod.F90 | 34 +- src/main/decompInitMod.F90 | 782 +++-- src/main/decompMod.F90 | 740 ++--- src/main/filterMod.F90 | 108 +- src/main/glc2lndMod.F90 | 18 +- src/main/glcBehaviorMod.F90 | 8 +- src/main/histFileMod.F90 | 455 ++- src/main/initGridCellsMod.F90 | 150 +- src/main/initSubgridMod.F90 | 25 +- src/main/initVerticalMod.F90 | 46 +- src/main/lnd2glcMod.F90 | 6 +- src/main/ncdio_pio.F90.in | 103 +- src/main/pftconMod.F90 | 2 +- src/main/readParamsMod.F90 | 13 +- src/main/restFileMod.F90 | 4 +- src/main/reweightMod.F90 | 4 +- src/main/subgridAveMod.F90 | 28 +- src/main/subgridRestMod.F90 | 54 +- src/main/subgridWeightsMod.F90 | 83 +- src/main/surfrdMod.F90 | 2 +- src/soilbiogeochem/CMakeLists.txt | 3 + .../SoilBiogeochemCarbonFluxType.F90 | 50 +- .../SoilBiogeochemCarbonStateType.F90 | 117 +- .../SoilBiogeochemDecompCascadeBGCMod.F90 | 166 +- .../SoilBiogeochemDecompCascadeCNMod.F90 | 855 ------ .../SoilBiogeochemDecompCascadeConType.F90 | 195 +- .../SoilBiogeochemLittVertTranspMod.F90 | 453 ++- .../SoilBiogeochemNLeachingMod.F90 | 118 +- .../SoilBiogeochemNitrifDenitrifMod.F90 | 10 +- .../SoilBiogeochemNitrogenFluxType.F90 | 6 +- .../SoilBiogeochemNitrogenStateType.F90 | 105 +- .../SoilBiogeochemStateType.F90 | 2 +- .../SoilBiogeochemVerticalProfileMod.F90 | 202 +- src/unit_test_shr/unittestSubgridMod.F90 | 28 +- .../csm_share/shr_mpi_mod_stub.F90 | 18 + .../main/GetGlobalValuesMod_stub.F90 | 24 +- .../main/ncdio_pio_fake.F90.in | 8 +- src/utils/AnnualFluxDribbler.F90 | 11 +- src/utils/clmfates_interfaceMod.F90 | 826 +++--- src/utils/domainMod.F90 | 12 +- src/utils/spmdGathScatMod.F90 | 540 ---- test/tools/README | 4 +- test/tools/README.testnames | 21 +- test/tools/TSMscript_tools.sh | 4 +- test/tools/input_tests_master | 39 +- test/tools/nl_files/mkmapdata_i1x1_brazil | 2 +- test/tools/nl_files/mkmapdata_if10 | 2 +- test/tools/nl_files/mkmapdata_ne30np4 | 2 +- test/tools/nl_files/modify_data_YELL | 1 + test/tools/nl_files/run_neon_YELL | 1 + test/tools/nl_files/subset_data_YELL | 1 + test/tools/test_driver.sh | 2 + test/tools/tests_pretag_cheyenne_nompi | 3 + tools/README | 54 +- tools/contrib/modify_singlept_site | 20 - tools/contrib/ssp_anomaly_forcing_smooth | 2 +- tools/mkmapdata/README | 7 +- tools/mkmapdata/mkmapdata.sh | 15 +- tools/mksurfdata_map/Makefile.data | 2 +- tools/mksurfdata_map/mksurfdata.pl | 4 +- tools/mksurfdata_map/mksurfdata_map.namelist | 2 - tools/mksurfdata_map/src/mkdomainMod.F90 | 31 + tools/mksurfdata_map/src/mksurfdat.F90 | 17 +- tools/mksurfdata_map/src/mkvarctl.F90 | 2 - tools/mksurfdata_map/src/test/CMakeLists.txt | 1 + .../src/test/mkdomain_test/CMakeLists.txt | 7 + .../src/test/mkdomain_test/test_mkdomain.pf | 93 + tools/ncl_scripts/README | 10 +- tools/site_and_regional/README | 46 + .../README.getregional | 4 +- .../getregional_datasets.ncl | 0 .../getregional_datasets.pl | 0 .../mknoocnmap.pl | 0 .../mkunitymap.ncl | 0 .../modify_singlept_site_neon.py | 556 ++++ tools/site_and_regional/run_neon.py | 613 ++++ .../sample_inlist | 0 .../sample_inlist_0.5popd | 0 .../sample_inlist_T62 | 0 .../sample_inlist_ndep | 0 .../sample_outlist | 0 .../sample_outlist_0.5popd | 0 .../sample_outlist_T62 | 0 .../sample_outlist_ndep | 0 .../subset_data.py | 8 +- 297 files changed, 12294 insertions(+), 8109 deletions(-) create mode 100644 README.CHECKLIST.new_case delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefAllVars/shell_commands rename cime_config/testdefs/testmods_dirs/clm/{FatesAllVars => FatesColdDefAllVars}/user_nl_clm (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/README rename cime_config/testdefs/testmods_dirs/clm/{FatesAllVars => FatesColdDefHydro}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesHydro => FatesColdDefHydro}/user_nl_clm (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesLogging => FatesColdDefLandUse}/include_user_mods (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefLandUse/user_nl_clm rename cime_config/testdefs/testmods_dirs/clm/{FatesNoFire => FatesColdDefLogging}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesLogging => FatesColdDefLogging}/user_nl_clm (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesPPhys => FatesColdDefNoFire}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesNoFire => FatesColdDefNoFire}/user_nl_clm (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesReducedComplexFixedBiogeo => FatesColdDefPPhys}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesPPhys => FatesColdDefPPhys}/user_nl_clm (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesST3 => FatesColdDefPRT2}/include_user_mods (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefPRT2/user_nl_clm rename cime_config/testdefs/testmods_dirs/clm/{FatesSizeAgeMort => FatesColdDefReducedComplexFixedBiogeo}/include_user_mods (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexFixedBiogeo/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexNoComp/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexNoComp/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexSatPhen/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexSatPhen/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefST3/include_user_mods rename cime_config/testdefs/testmods_dirs/clm/{FatesST3 => FatesColdDefST3}/user_nl_clm (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDefSizeAgeMort/include_user_mods rename cime_config/testdefs/testmods_dirs/clm/{FatesSizeAgeMort => FatesColdDefSizeAgeMort}/user_nl_clm (100%) rename cime_config/testdefs/testmods_dirs/clm/{Fates_nat_and_anthro_ignitions => FatesFireLightningPopDens}/README (97%) rename cime_config/testdefs/testmods_dirs/clm/{Fates_nat_and_anthro_ignitions => FatesFireLightningPopDens}/user_nl_clm (100%) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesHydro/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesPRT2/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesPRT2/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesReducedComplexFixedBiogeo/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/NEON_NIWO/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/user_nl_clm rename cime_config/testdefs/testmods_dirs/clm/{NoVSNoNI => anoxia}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{rootlit => anoxia}/user_nl_clm (65%) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/fatesFire/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/fatesFire/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/fatesFire/user_nl_clm rename cime_config/testdefs/testmods_dirs/clm/{irrig_o3_reduceOutput => irrig_o3falk_reduceOutput}/README (100%) rename cime_config/testdefs/testmods_dirs/clm/{irrig_o3_reduceOutput => irrig_o3falk_reduceOutput}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{irrig_o3_reduceOutput => irrig_o3falk_reduceOutput}/user_nl_clm (87%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/luna/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm rename cime_config/testdefs/testmods_dirs/clm/{o3 => o3lombardozzi2015}/include_user_mods (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/rootlit/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/shell_commands delete mode 100644 doc/source/users_guide/setting-up-and-running-a-case/README_master_list_file create mode 100644 doc/source/users_guide/setting-up-and-running-a-case/README_master_list_files create mode 100644 doc/source/users_guide/setting-up-and-running-a-case/master_list_fates.rst rename doc/source/users_guide/setting-up-and-running-a-case/{master_list_file.rst => master_list_nofates.rst} (65%) create mode 100644 src/biogeochem/test/CNPhenology_test/CMakeLists.txt create mode 100644 src/biogeochem/test/CNPhenology_test/test_CNPhenology.pf create mode 100644 src/biogeophys/test/Photosynthesis_test/CMakeLists.txt create mode 100644 src/biogeophys/test/Photosynthesis_test/test_Photosynthesis.pf delete mode 100644 src/main/GetGlobalValuesMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 delete mode 100644 src/utils/spmdGathScatMod.F90 create mode 100644 test/tools/nl_files/modify_data_YELL create mode 100644 test/tools/nl_files/run_neon_YELL create mode 100644 test/tools/nl_files/subset_data_YELL create mode 100644 tools/mksurfdata_map/src/test/mkdomain_test/CMakeLists.txt create mode 100644 tools/mksurfdata_map/src/test/mkdomain_test/test_mkdomain.pf create mode 100644 tools/site_and_regional/README rename tools/{ncl_scripts => site_and_regional}/README.getregional (85%) rename tools/{ncl_scripts => site_and_regional}/getregional_datasets.ncl (100%) rename tools/{ncl_scripts => site_and_regional}/getregional_datasets.pl (100%) rename tools/{mkmapdata => site_and_regional}/mknoocnmap.pl (100%) rename tools/{mkmapdata => site_and_regional}/mkunitymap.ncl (100%) create mode 100755 tools/site_and_regional/modify_singlept_site_neon.py create mode 100755 tools/site_and_regional/run_neon.py rename tools/{ncl_scripts => site_and_regional}/sample_inlist (100%) rename tools/{ncl_scripts => site_and_regional}/sample_inlist_0.5popd (100%) rename tools/{ncl_scripts => site_and_regional}/sample_inlist_T62 (100%) rename tools/{ncl_scripts => site_and_regional}/sample_inlist_ndep (100%) rename tools/{ncl_scripts => site_and_regional}/sample_outlist (100%) rename tools/{ncl_scripts => site_and_regional}/sample_outlist_0.5popd (100%) rename tools/{ncl_scripts => site_and_regional}/sample_outlist_T62 (100%) rename tools/{ncl_scripts => site_and_regional}/sample_outlist_ndep (100%) rename tools/{contrib => site_and_regional}/subset_data.py (99%) diff --git a/.config_files.xml b/.config_files.xml index a1775b52ce..c6dcbbcdb3 100644 --- a/.config_files.xml +++ b/.config_files.xml @@ -19,10 +19,12 @@ $SRCROOT $SRCROOT - $CIMEROOT/src/components/data_comps_mct/dlnd - $CIMEROOT/src/components/cdeps/dlnd - $CIMEROOT/src/components/stub_comps_$COMP_INTERFACE/slnd - $CIMEROOT/src/components/xcpl_comps_$COMP_INTERFACE/xlnd + $SRCROOT/components/cpl7/components/data_comps_mct/dlnd + $SRCROOT/components/cdeps/dlnd + $SRCROOT/components/cpl7/components/stub_comps_mct/slnd + $SRCROOT/components/cpl7/components/xcpl_comps_mct/xlnd + $CIMEROOT/src/components/stub_comps_nuopc/slnd + $CIMEROOT/src/components/xcpl_comps_nuopc/xlnd case_comps env_case.xml diff --git a/.gitignore b/.gitignore index 26aca9549c..9b97e8c3c0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,11 @@ # by manage_externals manage_externals.log /src/fates/ -/tools/PTCLM/ +/tools/site_and_regional/PTCLM/ /cime/ /components/ +/libraries/ +/share/ /doc/doc-builder/ # ignore svn directories diff --git a/Externals.cfg b/Externals.cfg index 881b4e6ee7..0c149001f1 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -8,7 +8,7 @@ required = True local_path = components/cism protocol = git repo_url = https://github.com/ESCOMP/CISM-wrapper -tag = cismwrap_2_1_83 +tag = cismwrap_2_1_87 externals = Externals_CISM.cfg required = True @@ -16,14 +16,14 @@ required = True local_path = components/rtm protocol = git repo_url = https://github.com/ESCOMP/RTM -tag = rtm1_0_76 +tag = rtm1_0_77 required = True [mosart] local_path = components/mosart protocol = git repo_url = https://github.com/ESCOMP/MOSART -tag = mosart1_0_42 +tag = mosart1_0_43 required = True [mizuRoute] @@ -37,22 +37,50 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = branch_tags/cime5.8.47_a01 +tag = cime6.0.4 required = True [cmeps] -local_path = cime/src/drivers/nuopc/ +tag = cmeps0.13.23 protocol = git repo_url = https://github.com/ESCOMP/CMEPS.git -tag = cmeps0.13.2 +local_path = components/cmeps required = True [cdeps] -local_path = components/cdeps +tag = cdeps0.12.19 protocol = git repo_url = https://github.com/ESCOMP/CDEPS.git -tag = cdeps0.12.11 -externals = Externals_CDEPS.cfg +local_path = components/cdeps +externals = Externals_CDEPS.cfg +required = True + +[cpl7] +tag = cpl7.0.3 +protocol = git +repo_url = https://github.com/ESCOMP/CESM_CPL7andDataComps +local_path = components/cpl7 +required = True + +[share] +tag = share1.0.2 +protocol = git +repo_url = https://github.com/ESCOMP/CESM_share +local_path = share +required = True + +[mct] +tag = MCT_2.11.0 +protocol = git +repo_url = https://github.com/MCSclimate/MCT +local_path = libraries/mct +required = True + +[parallelio] +tag = pio2_5_4 +protocol = git +repo_url = https://github.com/NCAR/ParallelIO +local_path = libraries/parallelio required = True [doc-builder] diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 8291a2b4f1..95c8e3a84a 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,14 +2,14 @@ local_path = src/fates protocol = git repo_url = https://github.com/rgknox/fates -hash = da2d7e36e52c205a9883f2c3a65bb358d994bdd2 +branch = fates_runmean_vars required = True [PTCLM] -local_path = tools/PTCLM +local_path = tools/site_and_regional/PTCLM protocol = git repo_url = https://github.com/ESCOMP/PTCLM -tag = PTCLM2_20200902 +tag = PTCLM2_20210810 required = True [externals_description] diff --git a/README b/README index e8db3de87f..49ea1aa1ed 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ $CTSMROOT/README 06/08/2018 -Community Land Surface Model (CLM) science version 5.0.0 series -- source code, tools, +Community Terrestrial Systems Model (CTSM) science version 5.1 series -- source code, tools, offline-build and test scripts. This gives you everything you need -to run CLM with CESM with datm8 to provide CRU NCEP or GSWP3 forcing data in +to run CTSM with CESM with datm8 to provide CRU NCEP or GSWP3 forcing data in place of a modeled atmosphere. For lists of current bugs (issues) and current development see the CTSM GitHub page: @@ -25,18 +25,18 @@ be $CTSMROOT/cime. General directory structure ($CTSMROOT): -doc --------------- Documentation of CLM. +doc --------------- Documentation of CTSM. bld --------------- Template, configure and build-namelist scripts for clm. -src --------------- CLM Source code. -test -------------- CLM Testing scripts for CLM offline tools. -tools ------------- CLM Offline tools to prepare input datasets and process output. -cime_config ------- Configuration files of cime for compsets and CLM settings +src --------------- CTSM Source code. +test -------------- CTSM Testing scripts for CTSM offline tools. +tools ------------- CTSM Offline tools to prepare input datasets and process output. +cime_config ------- Configuration files of cime for compsets and CTSM settings manage_externals -- Script to manage the external source directories python ------------ Some python modules mostly for use by run_sys_tests (but could be used elsewhere) Directory structure only for a CTSM checkout: -components -------- Other active sub-components needed for CLM to run (river routing and land-ice models) +components -------- Other active sub-components needed for CTSM to run (river routing and land-ice models) cime/scripts --------------- cesm/cime driver scripts @@ -64,8 +64,8 @@ CODE_OF_CONDUCT.md ------- Code of Conduct for how to work with each other on th Copyright ---------------- CESM Copyright file doc/UpdateChangeLog.pl --- Script to add documentation on a tag to the ChangeLog/ChangeSum files -doc/ChangeLog ------------ Documents different CLM versions -doc/ChangeSum ------------ Summary documentation of different CLM versions +doc/ChangeLog ------------ Documents different CTSM versions +doc/ChangeSum ------------ Summary documentation of different CTSM versions doc/design --------------- Software Engineering and code design document files @@ -84,7 +84,7 @@ Important files in main directories (under $CTSMROOT): ============================================================================================= Externals.cfg --------------- File for management of the main high level externals -Externals_CLM.cfg ----------- File for management of the CLM specific externals (i.e. FATES) +Externals_CLM.cfg ----------- File for management of the CTSM specific externals (i.e. FATES) run_sys_tests --------------- Python script to send the standard CTSM testing off (submits the create_test test suite for several different compilers on the @@ -100,21 +100,21 @@ doc/ChangeLog --------------- Detailed list of changes for each model version. doc/ChangeSum --------------- Summary one-line list of changes for each model version. doc/README ------------------ Documentation similar to this file -doc/UsersGuide -------------- CLM Users Guide +doc/UsersGuide -------------- CTSM Users Guide doc/IMPORTANT_NOTES --------- Some important notes on caveats for some configurations/namelist items bld/README ------------------ Description of how to use the configure and build-namelist scripts. -bld/configure --------------- Script to prepare CLM to be built. -bld/build-namelist ---------- Script to build CLM namelists. - -cime_config/buildnml ------------- Build the CLM namelist for CIME -cime_config/buildlib ------------- Build the CLM library -cime_config/config_compsets.xml -- Define CLM compsets -cime_config/config_component.xml - Define CLM XML settings -cime_config/config_tests.xml ----- Define CLM specific tests -cime_config/config_pes.xml ------- Define Processor layouts for various CLM grids and compsets -cime_config/testdefs ------------- Directory for specification of CLM testing +bld/configure --------------- Script to prepare CTSM to be built. +bld/build-namelist ---------- Script to build CTSM namelists. + +cime_config/buildnml ------------- Build the CTSM namelist for CIME +cime_config/buildlib ------------- Build the CTSM library +cime_config/config_compsets.xml -- Define CTSM compsets +cime_config/config_component.xml - Define CTSM XML settings +cime_config/config_tests.xml ----- Define CTSM specific tests +cime_config/config_pes.xml ------- Define Processor layouts for various CTSM grids and compsets +cime_config/testdefs ------------- Directory for specification of CTSM testing cime_config/testdefs/ExpectedTestFails.xml -- List of tests that are expected to fail cime_config/usermods_dirs -------- Directories of sets of user-modification subdirs (These are directories that add specific user modifications to @@ -122,7 +122,7 @@ cime_config/usermods_dirs -------- Directories of sets of user-modification subd Current sub directories are for various CMIP6 configurations) test/tools/test_driver.sh -- Script for general software testing of - CLM's offline tools. + CTSM's offline tools. tools/mksurfdata_map ---------- Directory to build program to create surface dataset at any resolution. @@ -135,6 +135,8 @@ tools/ncl_scripts ------------ Directory of NCL and perl scripts to do various tasks. Most notably to plot perturbation error growth testing and to extract regional information from global datasets for single-point/regional simulations. +tools/site_and_regional ------- Scripts to create input datasets for single site and regional + cases, primarily by modifying existing global datasets tools/contrib ----------------- Miscellansous useful scripts for pre and post processing as well as case management of CTSM. These scripts are contributed by users and may not be as well tested or diff --git a/README.CHECKLIST.new_case b/README.CHECKLIST.new_case new file mode 100644 index 0000000000..f3538c6fc9 --- /dev/null +++ b/README.CHECKLIST.new_case @@ -0,0 +1,40 @@ +$CTSMROOT/README.CHECKLIST.new_case 03/01/2021 + +This is a check list of things to do when setting up a new case in order to help ensure everything is correct. There +are lots of tiny details that need to be right and it's easy to get something wrong. So the first screening to make +sure it's right is for you to carefully check through your case and make sure it's right. + +The following assumes you have created a new case and are in it's case directory. + +General Checklist to always do: + + - Make sure CLM_ env settings are correct + (./xmlquery -p CLM) + - Make sure you are using the correct CLM_PHYSICS_VERSION + (./xmlquery -p CLM_PHYSICS_VERSION) + - Make sure you are running the appropriate overall CLM vegetation model. + The "-bgc" option of either Satellite Phenology (sp), or + Full BioGeoChemistry (bgc), or FATES (fates) + (./xmlquery -p CLM_BLDNML_OPTS) + - Also if you are running the bgc model, check to see if you should be running the prognostic crop model + (option -crop in CLM_BLDNML_OPTS) + - Make sure the LND_TUNING_MODE is correct + (./xmlquery LND_TUNING_MODE) + - For an "I compset" make sure you are running over the right forcing years + (usually ./xmlquery -p DATM_CLMNCEP_YR) + - First and align year for streams should be the start year of a historical simulation + (./xmlquery RUN_STARTDATE) + (grep stream_year_first CaseDocs/lnd_in; grep model_year_align CaseDocs/lnd_in) + - Last year for streams should be the last year you are going to run to (or beyond it) + (grep stream_year_last CaseDocs/lnd_in) + - Make sure you are starting from appropriate spunup initial conditions + (Check the run-type with: ./xmlquery RUN_TYPE) + (check finidat for a startup or hybrid simulation: grep finidat CaseDocs/lnd_in) + (check nrevsn for a branch simulation: grep nrevsn CaseDocs/lnd_in) + - Run for a month (or some short period) and go over the log files and especially the settings and files read in them. + (For an I case you especially want to look at the lnd.log and atm.log files) + +Some other suggestions on things that can be done: + +- Compare namelist files to an existing case if you are doing something almost the same as a previous simulation. +- Ask another collaborator to look over your case directory diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d4575c4462..6c06a46cea 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -71,7 +71,7 @@ REQUIRED OPTIONS (if read they allow user_nl_clm and CLM_BLDNML_OPTS to expand variables [for example to use \$DIN_LOC_ROOT]) (default current directory) - -lnd_frac "domainfile" Land fraction file (the input domain file) + -lnd_frac "domainfile" Land fraction file (the input domain file) (needed for MCT driver and LILAC) -res "resolution" Specify horizontal grid. Use nlatxnlon for spectral grids; dlatxdlon for fv grids (dlat and dlon are the grid cell size in degrees for latitude and longitude respectively) @@ -83,21 +83,19 @@ REQUIRED OPTIONS (default 2000) -structure "structure" The overall structure being used [ standard | fast ] OPTIONS - -driver "value" mct or nuopc - -bgc "value" Build CLM with BGC package [ sp | cn | bgc | fates ] + -driver "value" CESM driver type you will run with [ mct | nuopc ] + -bgc "value" Build CLM with BGC package [ sp | bgc | fates ] (default is sp). CLM Biogeochemistry mode sp = Satellite Phenology (SP) This toggles off the namelist variable: use_cn - cn = Carbon Nitrogen model (CN) - This toggles on the namelist variable: use_cn bgc = Carbon Nitrogen with methane, nitrification, vertical soil C, CENTURY decomposition This toggles on the namelist variables: - use_cn, use_lch4, use_nitrif_denitrif, use_vertsoilc, use_century_decomp + use_cn, use_lch4, use_nitrif_denitrif fates = FATES/Ecosystem Demography with below ground BGC This toggles on the namelist variables: - use_fates, use_vertsoilc, use_century_decomp + use_fates (Only for CLM4.5/CLM5.0) -[no-]chk_res Also check [do NOT check] to make sure the resolution and land-mask is valid. @@ -160,7 +158,7 @@ OPTIONS Default: -no-drydep (Note: buildnml copies the file for use by the driver) -dynamic_vegetation Toggle for dynamic vegetation model. (default is off) - (can ONLY be turned on when BGC type is 'cn' or 'bgc') + (can ONLY be turned on when BGC type is 'bgc') This turns on the namelist variable: use_cndv (Deprecated, this will be removed) -fire_emis Produce a fire_emis_nl namelist that will go into the @@ -171,11 +169,13 @@ OPTIONS -glc_use_antarctica Set defaults appropriate for runs that include Antarctica -help [or -h] Print usage to STDOUT. -light_res Resolution of lightning dataset to use for CN fire (360x720 or 94x192) + -lilac If CTSM is being run through LILAC (normally not used) + (LILAC is the Lightweight Infrastructure for Land-Atmosphere Coupling) -ignore_ic_date Ignore the date on the initial condition files when determining what input initial condition file to use. -ignore_ic_year Ignore just the year part of the date on the initial condition files when determining what input initial condition file to use. - -ignore_warnings Allow build-namelist to continue, rather than stopping on + -ignore_warnings Allow build-namelist to continue, rather than stopping on warnings -infile "filepath" Specify a file (or list of files) containing namelists to read values from. @@ -268,6 +268,7 @@ sub process_commandline { chk_res => undef, note => undef, drydep => 0, + lilac => 0, output_reals_filename => undef, fire_emis => 0, megan => "default", @@ -296,6 +297,7 @@ sub process_commandline { "clm_usr_name=s" => \$opts{'clm_usr_name'}, "envxml_dir=s" => \$opts{'envxml_dir'}, "drydep!" => \$opts{'drydep'}, + "lilac!" => \$opts{'lilac'}, "fire_emis!" => \$opts{'fire_emis'}, "ignore_warnings!" => \$opts{'ignore_warnings'}, "chk_res!" => \$opts{'chk_res'}, @@ -745,18 +747,17 @@ sub setup_cmdl_fates_mode { # want to set a catch to fail and warn users if they explicitly set incompatible user namelist # options -# my $var = "use_somevar"; -# $val = $nl_flags->{$var}; -# if ( defined($nl->get_value($var)) ) { -# if ( &value_is_true($nl->get_value($var)) ) { -# $log->fatal_error("$var was set to .true., which is incompatible when -bgc fates option is used."); -# } -# } - + my $var = "use_crop"; + $val = $nl_flags->{$var}; + if ( defined($nl->get_value($var)) ) { + if ( &value_is_true($nl->get_value($var)) ) { + $log->fatal_error("$var was set to .true., which is incompatible when -bgc fates option is used."); + } + } # The following variables may be set by the user and are compatible with use_fates # no need to set defaults, covered in a different routine - my @list = ( "use_vertsoilc", "use_century_decomp", "use_lch4" ); + my @list = ( "use_lch4" ); foreach my $var ( @list ) { if ( defined($nl->get_value($var)) ) { $nl_flags->{$var} = $nl->get_value($var); @@ -771,9 +772,10 @@ sub setup_cmdl_fates_mode { } } else { # dis-allow fates specific namelist items with non-fates runs - my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", - "use_fates_cohort_age_tracking", - "use_fates_inventory_init","use_fates_fixed_biogeog", "fates_inventory_ctrl_filename","use_fates_logging","fates_parteh_mode" ); + my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", + "use_fates_cohort_age_tracking", + "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","use_fates_logging","fates_parteh_mode" ); + # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { if ( defined($nl->get_value($var)) ) { $log->fatal_error("$var is being set, but can ONLY be set when -bgc fates option is used.\n"); @@ -833,10 +835,7 @@ sub setup_cmdl_bgc { $log->verbose_message("Using $nl_flags->{$var} for bgc."); # now set the actual name list variables based on the bgc alias - if ($nl_flags->{$var} eq "cn" ) { - $nl_flags->{'use_cn'} = ".true."; - $nl_flags->{'use_fates'} = ".false."; - } elsif ($nl_flags->{$var} eq "bgc" ) { + if ($nl_flags->{$var} eq "bgc" ) { $nl_flags->{'use_cn'} = ".true."; $nl_flags->{'use_fates'} = ".false."; } elsif ($nl_flags->{$var} eq "fates" ) { @@ -853,34 +852,6 @@ sub setup_cmdl_bgc { $log->fatal_error("The namelist variable use_fates is inconsistent with the -bgc option"); } - { - # If the variable has already been set use it, if not set to the value defined by the bgc_mode - my @list = ( "use_lch4", "use_nitrif_denitrif", "use_vertsoilc", "use_century_decomp" ); - my $ndiff = 0; - my %settings = ( 'bgc_mode'=>$nl_flags->{'bgc_mode'} ); - foreach my $var ( @list ) { - my $default_setting = $defaults->get_value($var, \%settings ); - if ( ! defined($nl->get_value($var)) ) { - $nl_flags->{$var} = $default_setting; - } else { - if ( $nl->get_value($var) ne $default_setting ) { - $ndiff += 1; - } - $nl_flags->{$var} = $nl->get_value($var); - } - $val = $nl_flags->{$var}; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } - # If all the variables are different report it as an error - if ( $ndiff == ($#list + 1) ) { - $log->fatal_error("You are contradicting the -bgc setting with the namelist variables: @list" ); - } - } # Now set use_cn and use_fates foreach $var ( "use_cn", "use_fates" ) { @@ -892,13 +863,58 @@ sub setup_cmdl_bgc { $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); } } - + # + # Determine Soil decomposition method + # + my $var = "soil_decomp_method"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + 'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} ); + my $soil_decomp_method = remove_leading_and_trailing_quotes( $nl->get_value( $var ) ); + + if ( &value_is_true($nl_flags->{'use_cn'}) || &value_is_true($nl_flags->{'use_fates'})) { + if ( $soil_decomp_method eq "None" ) { + $log->fatal_error("$var must NOT be None if use_cn or use_fates are on"); + } + } elsif ( $soil_decomp_method ne "None" ) { + $log->fatal_error("$var must be None if use_cn or use_fates are not"); + } + # + # Soil decomposition control variables, methane and Nitrification-Denitrification + # + my @list = ( "use_lch4", "use_nitrif_denitrif" ); + my %settings = ( 'bgc_mode'=>$nl_flags->{'bgc_mode'} ); + foreach my $var ( @list ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + 'phys'=>$nl_flags->{'phys'}, 'soil_decomp_method'=>$soil_decomp_method ); + $nl_flags->{$var} = $nl->get_value($var); + } + if ( $soil_decomp_method eq "None" ) { + foreach my $var ( @list ) { + if ( &value_is_true($nl_flags->{$var}) ) { + $log->fatal_error("When soil_decomp_method is None $var can NOT be TRUE"); + } + } + } else { + # nitrif_denitrif can only be .false. if fates is on + if ( (! &value_is_true($nl_flags->{'use_fates'})) && &value_is_true($nl_flags->{'use_cn'}) ) { + $var = "use_nitrif_denitrif"; + if ( ! &value_is_true($nl_flags->{$var}) ) { + $log->warning("$var normally use_nitrif_denitrif should only be FALSE if FATES is on, it has NOT been validated for being off for BGC mode" ); + } + } + } + # + # Set FUN for BGC + # my $var = "use_fun"; if ( ! defined($nl->get_value($var)) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_nitrif_denitrif'=>$nl_flags->{'use_nitrif_denitrif'} ); } + if ( (! &value_is_true($nl_flags->{'use_cn'}) ) && &value_is_true($nl->get_value('use_fun')) ) { + $log->fatal_error("When FUN is on, use_cn MUST also be on!"); + } if ( (! &value_is_true($nl_flags->{'use_nitrif_denitrif'}) ) && &value_is_true($nl->get_value('use_fun')) ) { $log->fatal_error("When FUN is on, use_nitrif_denitrif MUST also be on!"); } @@ -916,7 +932,7 @@ sub setup_cmdl_fire_light_res { if ( $val eq "default" ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, - 'fates_spitfire_mode'=>$nl->get_value('fates_spitfire_mode'), + 'fates_spitfire_mode'=>$nl->get_value('fates_spitfire_mode'), 'use_fates'=>$nl_flags->{'use_fates'}, fire_method=>$nl->get_value('fire_method') ); $val = remove_leading_and_trailing_quotes( $nl->get_value($var) ); $nl_flags->{$var} = $val; @@ -986,8 +1002,8 @@ sub setup_cmdl_crop { if ( ($nl_flags->{'crop'} eq 1 ) && ($nl_flags->{'bgc_mode'} eq "sp") ) { $log->fatal_error("** Cannot turn crop mode on mode bgc=sp\n" . "**\n" . - "** Set the bgc mode to 'cn' or 'bgc' by the following means from highest to lowest precedence:\n" . - "** * by the command-line options -bgc cn\n" . + "** Set the bgc mode to 'bgc' by the following means from highest to lowest precedence:\n" . + "** * by the command-line options -bgc bgc\n" . "** * by a default configuration file, specified by -defaults"); } @@ -1206,7 +1222,7 @@ sub setup_cmdl_run_type { } if (defined $opts->{$var}) { if ($opts->{$var} eq "default" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'}, 'sim_year'=>$st_year, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, 'bgc_spinup'=>$nl_flags->{'bgc_spinup'} ); @@ -1215,7 +1231,7 @@ sub setup_cmdl_run_type { $nl->set_variable_value($group, $var, quote_string( $opts->{$var} ) ); } } else { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'}, 'sim_year'=>$st_year ); } @@ -1235,8 +1251,8 @@ sub setup_cmdl_dynamic_vegetation { if ( ($nl_flags->{'dynamic_vegetation'} eq 1 ) && ($nl_flags->{'bgc_mode'} eq "sp") ) { $log->fatal_error("** Cannot turn dynamic_vegetation mode on with bgc=sp.\n" . "**\n" . - "** Set the bgc mode to 'cn' or 'bgc' by the following means from highest to lowest precedence:" . - "** * by the command-line options -bgc cn\n"); + "** Set the bgc mode to 'bgc' by the following means from highest to lowest precedence:" . + "** * by the command-line options -bgc bgc\n"); } $var = "use_cndv"; @@ -1255,7 +1271,7 @@ sub setup_cmdl_dynamic_vegetation { my @valid_values = $definition->get_valid_values( $var ); $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); } - $log->warning("The use_cndv=T option is deprecated. We do NOT recommend using it." . + $log->warning("The use_cndv=T option is deprecated. We do NOT recommend using it." . " It's known to have issues and it's not calibrated."); } } @@ -1288,9 +1304,10 @@ sub setup_cmdl_vichydro { $var = "use_vichydro"; $val = $nl->get_value($var); + my $set = undef; if ($nl_flags->{'vichydro'} eq 1) { my $group = $definition->get_group_name($var); - my $set = ".true."; + $set = ".true."; if ( defined($val) && $set ne $val ) { $log->fatal_error("$var contradicts the command-line -vichydro option" ); } @@ -1299,7 +1316,10 @@ sub setup_cmdl_vichydro { my @valid_values = $definition->get_valid_values( $var ); $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); } + } else { + $set = ".false."; } + $nl_flags->{$var} = $set; } @@ -1497,6 +1517,7 @@ sub process_namelist_inline_logic { setup_logic_glacier($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref); setup_logic_dynamic_plant_nitrogen_alloc($opts, $nl_flags, $definition, $defaults, $nl, $physv); setup_logic_luna($opts, $nl_flags, $definition, $defaults, $nl, $physv); + setup_logic_o3_veg_stress_method($opts, $nl_flags, $definition, $defaults, $nl,$physv); setup_logic_hydrstress($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_dynamic_roots($opts, $nl_flags, $definition, $defaults, $nl, $physv); setup_logic_params_file($opts, $nl_flags, $definition, $defaults, $nl); @@ -1787,21 +1808,41 @@ sub setup_logic_lnd_frac { my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref) = @_; + # + # fatmlndfrc is required for the MCT driver (or LILAC), but uneeded for NUOPC + # my $var = "lnd_frac"; - if ( defined($opts->{$var}) ) { - if ( defined($nl->get_value('fatmlndfrc')) ) { - $log->fatal_error("Can NOT set both -lnd_frac option (set via LND_DOMAIN_PATH/LND_DOMAIN_FILE " . - "env variables) AND fatmlndfrac on namelist"); - } - my $lnd_frac = SetupTools::expand_xml_var( $opts->{$var}, $envxml_ref); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fatmlndfrc','val'=>$lnd_frac ); - } + if ( ($opts->{'driver'} eq "mct") || $opts->{'lilac'} ) { + if ( defined($opts->{$var}) ) { + if ( defined($nl->get_value('fatmlndfrc')) ) { + $log->fatal_error("Can NOT set both -lnd_frac option (set via LND_DOMAIN_PATH/LND_DOMAIN_FILE " . + "env variables) AND fatmlndfrac on namelist"); + } + if ( $opts->{$var} =~ /UNSET/ ) { + $log->fatal_error("-lnd_frac was set as UNSET in the CTSM build-namelist set it with the env variables: LND_DOMAIN_PATH/LND_DOMAIN_FILE."); + } + my $lnd_frac = SetupTools::expand_xml_var( $opts->{$var}, $envxml_ref); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fatmlndfrc','val'=>$lnd_frac ); + } - # Get the fraction file - if (defined $nl->get_value('fatmlndfrc')) { - # do nothing - use value provided by config_grid.xml and clm.cpl7.template + # Get the fraction file + if (defined $nl->get_value('fatmlndfrc')) { + # do nothing - use value provided by config_grid.xml and clm.cpl7.template + } else { + $log->fatal_error("fatmlndfrc was NOT sent into CLM build-namelist."); + } + # + # For the NUOPC driver neither lnd_frac nor fatmlndfrc need to be set + # } else { - $log->fatal_error("fatmlndfrc was NOT sent into CLM build-namelist."); + if ( defined($opts->{$var}) ) { + if ( $opts->{$var} !~ /UNSET/ ) { + $log->fatal_error("$var should NOT be set for the NUOPC driver as it is unused" ); + } + } + if ( defined($nl->get_value('fatmlndfrc')) ) { + $log->fatal_error("fatmlndfrac should NOT be set in the namelist for the NUOPC driver as it is unused" ); + } } } @@ -1941,7 +1982,7 @@ sub setup_logic_params_file { # get param data my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'paramfile', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'paramfile', 'phys'=>$nl_flags->{'phys'}, 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); } @@ -1953,7 +1994,7 @@ sub setup_logic_create_crop_landunit { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; my $var = 'create_crop_landunit'; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'} ); if ( &value_is_true($nl_flags->{'use_fates'}) && &value_is_true($nl->get_value($var)) ) { $log->fatal_error( "$var is true and yet use_fates is being set, which contradicts that (use_fates requires $var to be .false." ); @@ -1990,7 +2031,7 @@ sub setup_logic_cnfire { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; my @fire_consts = ( "rh_low", "rh_hgh", "bt_min", "bt_max", "cli_scale", "boreal_peatfire_c", "non_boreal_peatfire_c", - "pot_hmn_ign_counts_alpha", "cropfire_a1", "occur_hi_gdp_tree", "lfuel", "ufuel", + "pot_hmn_ign_counts_alpha", "cropfire_a1", "occur_hi_gdp_tree", "lfuel", "ufuel", "cmb_cmplt_fact_litter", "cmb_cmplt_fact_cwd" ); if ( &value_is_true($nl->get_value('use_cn')) ) { foreach my $item ( @fire_consts ) { @@ -2001,7 +2042,7 @@ sub setup_logic_cnfire { } else { my $fire_method = remove_leading_and_trailing_quotes( $nl->get_value('fire_method') ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $item, - 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, + 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, 'fire_method'=>$fire_method ); } } @@ -2128,6 +2169,7 @@ sub setup_logic_demand { $settings{'hgrid'} = $nl_flags->{'res'}; $settings{'sim_year'} = $nl_flags->{'sim_year'}; $settings{'sim_year_range'} = $nl_flags->{'sim_year_range'}; + $settings{'use_vichydro'} = $nl_flags->{'use_vichydro'}; $settings{'mask'} = $nl_flags->{'mask'}; $settings{'crop'} = $nl_flags->{'crop'}; $settings{'ssp_rcp'} = $nl_flags->{'ssp_rcp'}; @@ -2139,8 +2181,6 @@ sub setup_logic_demand { $settings{'use_cndv'} = $nl_flags->{'use_cndv'}; $settings{'use_lch4'} = $nl_flags->{'use_lch4'}; $settings{'use_nitrif_denitrif'} = $nl_flags->{'use_nitrif_denitrif'}; - $settings{'use_vertsoilc'} = $nl_flags->{'use_vertsoilc'}; - $settings{'use_century_decomp'} = $nl_flags->{'use_century_decomp'}; $settings{'use_crop'} = $nl_flags->{'use_crop'}; my $demand = $nl->get_value('clm_demand'); @@ -2167,7 +2207,22 @@ sub setup_logic_demand { if ( $item eq "finidat" ) { $log->fatal_error( "Do NOT put findat in the clm_demand list, set the clm_start_type=startup so initial conditions are required"); } + # For landuse.timeseries try with crop and irrigate on first, if found use it, otherwise try with exact settings + # Logic for this is identical for fsurdat + if ( $item eq "flanduse_timeseries" ) { + $settings{'irrigate'} = ".true."; + $settings{'use_crop'} = ".true."; + $settings{'nofail'} = 1; + } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $item, %settings ); + if ( $item eq "flanduse_timeseries" ) { + $settings{'nofail'} = 0; + $settings{'irrigate'} = $nl_flags->{'irrigate'}; + $settings{'use_crop'} = $nl_flags->{'use_crop'}; + if ( ! defined($nl->get_value( $item )) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $item, %settings ); + } + } } } @@ -2196,10 +2251,27 @@ sub setup_logic_surface_dataset { if ($flanduse_timeseries ne "null" && &value_is_true($nl_flags->{'use_cndv'}) ) { $log->fatal_error( "dynamic PFT's (setting flanduse_timeseries) are incompatible with dynamic vegetation (use_cndv=.true)." ); } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fsurdat', - 'hgrid'=>$nl_flags->{'res'}, 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, - 'sim_year'=>$nl_flags->{'sim_year'}, 'irrigate'=>$nl_flags->{'irrigate'}, - 'use_crop'=>$nl_flags->{'use_crop'}, 'glc_nec'=>$nl_flags->{'glc_nec'}); + # + # Always get the crop version of the datasets now and let the code turn it into the form desired + # Provided this isn't with FATES on + # + my $var = "fsurdat"; + if ( ! &value_is_true($nl_flags->{'use_fates'}) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + 'hgrid'=>$nl_flags->{'res'}, 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, + 'sim_year'=>$nl_flags->{'sim_year'}, 'irrigate'=>".true.", 'use_vichydro'=>$nl_flags->{'use_vichydro'}, + 'use_crop'=>".true.", 'glc_nec'=>$nl_flags->{'glc_nec'}, 'nofail'=>1); + } + # If didn't find the crop version check for the exact match + if ( ! defined($nl->get_value($var) ) ) { + if ( ! &value_is_true($nl_flags->{'use_fates'}) ) { + $log->verbose_message( "Crop version of $var NOT found, searching for an exact match" ); + } + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + 'hgrid'=>$nl_flags->{'res'}, 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'use_vichydro'=>$nl_flags->{'use_vichydro'}, + 'sim_year'=>$nl_flags->{'sim_year'}, 'irrigate'=>$nl_flags->{'irrigate'}, + 'use_crop'=>$nl_flags->{'use_crop'}, 'glc_nec'=>$nl_flags->{'glc_nec'}); + } } #------------------------------------------------------------------------------- @@ -2252,20 +2324,20 @@ sub setup_logic_initial_conditions { # if (string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) { $settings{'sim_year'} = $nl_flags->{'sim_year'}; - $opts->{'ignore_ic_year'} = 1; + $opts->{'ignore_ic_year'} = 1; } else { $settings{'sim_year'} = $st_year; } - foreach my $item ( "mask", "maxpft", "irrigate", "glc_nec", "use_crop", "use_cn", "use_cndv", - "use_nitrif_denitrif", "use_vertsoilc", "use_century_decomp", "use_fates", - "lnd_tuning_mode", + foreach my $item ( "mask", "maxpft", "irrigate", "glc_nec", "use_crop", "use_cn", "use_cndv", + "use_fates", + "lnd_tuning_mode", ) { $settings{$item} = $nl_flags->{$item}; } if ($opts->{'ignore_ic_date'}) { if ( &value_is_true($nl_flags->{'use_crop'}) ) { - $log->warning("using ignore_ic_date is incompatable with crop! If you choose to ignore this error, " . - "the counters since planting for crops will be messed up. \nSo you should ignore at " . + $log->warning("using ignore_ic_date is incompatable with crop! If you choose to ignore this error, " . + "the counters since planting for crops will be messed up. \nSo you should ignore at " . "least the first season for crops. And since it will impact the 20 year means, ideally the " . "first 20 years should be ignored."); } @@ -2339,9 +2411,9 @@ SIMYR: foreach my $sim_yr ( @sim_years ) { } } else { my $stat = add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "init_interp_attributes", - 'sim_year'=>$settings{'sim_year'}, 'use_cndv'=>$nl_flags->{'use_cndv'}, + 'sim_year'=>$settings{'sim_year'}, 'use_cndv'=>$nl_flags->{'use_cndv'}, 'glc_nec'=>$nl_flags->{'glc_nec'}, 'use_fates'=>$nl_flags->{'use_fates'}, - 'hgrid'=>$nl_flags->{'res'}, + 'hgrid'=>$nl_flags->{'res'}, 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, 'nofail'=>1 ); if ( $stat ) { $log->fatal_error("$useinitvar is NOT synchronized with init_interp_attributes"); @@ -2688,12 +2760,7 @@ sub setup_logic_bgc_shared { if ( $nl_flags->{'bgc_mode'} ne "sp" ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'constrain_stress_deciduous_onset', 'phys'=>$physv->as_string() ); } - # FIXME(bja, 201606) the logic around fates / bgc_mode / - # use_century_decomp is confusing and messed up. This is a hack - # workaround. - if ( &value_is_true($nl_flags->{'use_century_decomp'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'decomp_depth_efolding', 'phys'=>$physv->as_string() ); - } + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'decomp_depth_efolding', 'phys'=>$physv->as_string() ); } #------------------------------------------------------------------------------- @@ -2701,10 +2768,10 @@ sub setup_logic_bgc_shared { sub setup_logic_cnphenology { my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - my @list = ( "onset_thresh_depends_on_veg", "min_crtical_dayl_depends_on_lat" ); + my @list = ( "onset_thresh_depends_on_veg", "min_critical_dayl_method" ); foreach my $var ( @list ) { if ( &value_is_true($nl_flags->{'use_cn'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$physv->as_string(), 'use_cn'=>$nl_flags->{'use_cn'} ); } else { if ( defined($nl->get_value($var)) ) { @@ -2889,7 +2956,7 @@ sub setup_logic_hydrology_switches { } # Test bad configurations my $lower = $nl->get_value( 'lower_boundary_condition' ); - my $use_vic = $nl->get_value( 'use_vichydro' ); + my $use_vic = $nl_flags->{'use_vichydro'}; my $use_bed = $nl->get_value( 'use_bedrock' ); my $soilmtd = $nl->get_value( 'soilwater_movement_method' ); if ( defined($soilmtd) && defined($lower) && $soilmtd == 0 && $lower != 4 ) { @@ -2924,10 +2991,10 @@ sub setup_logic_methane { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_method', 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} ); my $finundation_method = remove_leading_and_trailing_quotes($nl->get_value('finundation_method' )); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ch4finundated', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ch4finundated', 'finundation_method'=>$finundation_method); if ($opts->{'driver'} eq "nuopc" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ch4finundated', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ch4finundated', 'finundation_method'=>$finundation_method); } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_aereoxid_prog', @@ -2972,6 +3039,10 @@ sub setup_logic_methane { $log->fatal_error("$var set without methane model configuration on (use_lch4)"); } } + my $var = "use_nitrif_denitrif"; + if ( (! &value_is_true( $nl_flags->{'use_fates'} ) ) && &value_is_true($nl->get_value($var)) ) { + $log->warning("methane is off (use_lch4=FALSE), but $var is TRUE, both need to be on, unless FATES is also on" ); + } } } # end methane @@ -2987,6 +3058,9 @@ sub setup_logic_dynamic_plant_nitrogen_alloc { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_flexibleCN', 'phys'=>$physv->as_string(), 'use_cn'=>$nl_flags->{'use_cn'} ); $nl_flags->{'use_flexibleCN'} = $nl->get_value('use_flexibleCN'); + if ( &value_is_true($nl->get_value('use_fun') ) && not &value_is_true( $nl_flags->{'use_flexibleCN'}) ) { + $log->warning("FUN has NOT been extensively tested without use_flexibleCN on, so could result in failures or unexpected results" ); + } if ( &value_is_true($nl_flags->{'use_flexibleCN'}) ) { # TODO(bja, 2015-04) make this depend on > clm 5.0 and bgc mode at some point. @@ -3029,6 +3103,26 @@ sub setup_logic_dynamic_plant_nitrogen_alloc { #------------------------------------------------------------------------------- +sub setup_logic_o3_veg_stress_method { + # + # Ozone vegetation stress method + # + my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; + + my $var = 'o3_veg_stress_method'; + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var ); + + my $val = $nl->get_value($var); + + if (remove_leading_and_trailing_quotes($val) eq "stress_falk" && not (&value_is_true($nl_flags->{'use_luna'})) ) { + $log->fatal_error(" use_luna=.true. is required for $var='stress_falk'."); + } + +} + +#------------------------------------------------------------------------------- + sub setup_logic_luna { # # LUNA model to calculate photosynthetic capacities based on environmental conditions @@ -3126,7 +3220,7 @@ sub setup_logic_dynamic_roots { my $use_dynroot = $nl->get_value('use_dynroot'); if ( &value_is_true($use_dynroot) && ($nl_flags->{'bgc_mode'} eq "sp") ) { $log->fatal_error("Cannot turn dynroot mode on mode bgc=sp\n" . - "Set the bgc mode to 'cn' or 'bgc'."); + "Set the bgc mode to 'bgc'."); } if ( &value_is_true( $use_dynroot ) && &value_is_true( $nl_flags->{'use_hydrstress'} ) ) { $log->fatal_error("Cannot turn use_dynroot on when use_hydrstress is on" ); @@ -3177,7 +3271,7 @@ sub setup_logic_c_isotope { my $use_c13_timeseries = $nl->get_value('use_c13_timeseries'); if ( defined($use_c13_timeseries) && &value_is_true($use_c13_timeseries) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c13_filename', - 'use_c13'=>$use_c13, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c13_timeseries'=>$nl->get_value('use_c13_timeseries'), + 'use_c13'=>$use_c13, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c13_timeseries'=>$nl->get_value('use_c13_timeseries'), 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); } } else { @@ -3212,15 +3306,15 @@ sub setup_logic_nitrogen_deposition { # # Nitrogen deposition for bgc=CN # - if ( $nl_flags->{'bgc_mode'} =~/cn|bgc/ ) { + if ( $nl_flags->{'bgc_mode'} =~/bgc/ ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndepmapalgo', 'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, 'hgrid'=>$nl_flags->{'res'}, 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndep_taxmode', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, + 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndep_varlist', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, + 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_ndep', 'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, 'sim_year'=>$nl_flags->{'sim_year'}, @@ -3324,7 +3418,7 @@ sub setup_logic_photosyns { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'modifyphoto_and_lmr_forcrop', 'phys'=>$nl_flags->{'phys'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'stomatalcond_method', 'phys'=>$nl_flags->{'phys'}, + $nl, 'stomatalcond_method', 'phys'=>$nl_flags->{'phys'}, 'use_hydrstress'=>$nl_flags->{'use_hydrstress'} ); # When CN on, must NOT be scaled by vcmax25top if ( &value_is_true( $nl_flags->{'use_cn'} ) ) { @@ -3373,24 +3467,24 @@ sub setup_logic_popd_streams { } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_popdens', 'phys'=>$nl_flags->{'phys'}, 'cnfireson'=>$nl_flags->{'cnfireson'}, 'hgrid'=>"0.5x0.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); - # - # TODO (mvertens, 2021-06-22) the following is needed for MCT since a use case enforces this - so for now stream_meshfile_popdens will be added to the mct + # + # TODO (mvertens, 2021-06-22) the following is needed for MCT since a use case enforces this - so for now stream_meshfile_popdens will be added to the mct # stream namelist but simply not used if ($opts->{'driver'} eq "nuopc" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_popdens', 'hgrid'=>"0.5x0.5"); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_popdens', 'hgrid'=>"0.5x0.5"); my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; my $default_value = $nl->get_value('stream_meshfile_popdens'); my $none_filename = $inputdata_rootdir . '/none'; my $none_filename = "e_string($none_filename); if ($default_value eq $none_filename) { - my $var = 'stream_meshfile_popdens'; + my $var = 'stream_meshfile_popdens'; my $group = $definition->get_group_name($var); my $val = "none"; $val = "e_string( $val ); $nl->set_variable_value($group, $var, $val); } } else { - my $var = 'stream_meshfile_popdens'; + my $var = 'stream_meshfile_popdens'; my $group = $definition->get_group_name($var); my $val = "none"; $val = "e_string( $val ); @@ -3445,13 +3539,13 @@ sub setup_logic_lightning_streams { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; if ( $nl_flags->{'light_res'} ne "none" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lightngmapalgo', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lightngmapalgo', 'hgrid'=>$nl_flags->{'res'}, 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_lightng', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_lightng', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_lightng', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_lightng', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); # Set align year, if first and last years are different @@ -3460,10 +3554,10 @@ sub setup_logic_lightning_streams { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_lightng', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lightng', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lightng', 'hgrid'=>$nl_flags->{'light_res'} ); if ($opts->{'driver'} eq "nuopc" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_lightng', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_lightng', 'hgrid'=>$nl_flags->{'light_res'} ); } } else { @@ -3584,8 +3678,8 @@ sub setup_logic_soilm_streams { defined($nl->get_value('soilm_tintalgo')) || defined($nl->get_value('soilm_offset')) || defined($nl->get_value('stream_year_last_soilm')) ) { - $log->fatal_error("One of the soilm streams namelist items (stream_year_first_soilm, " . - " model_year_align_soilm, stream_fldfilename_soilm, stream_fldfilename_soilm)" . + $log->fatal_error("One of the soilm streams namelist items (stream_year_first_soilm, " . + " model_year_align_soilm, stream_fldfilename_soilm, stream_fldfilename_soilm)" . " soilm_tintalgo soilm_offset" . " is defined, but use_soil_moisture_streams option NOT set to true"); } @@ -3652,7 +3746,7 @@ sub setup_logic_soilwater_movement { my $soilmtd = $nl->get_value("soilwater_movement_method"); my $use_bed = $nl->get_value('use_bedrock' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lower_boundary_condition', 'vichydro'=>$nl_flags->{'vichydro'}, 'soilwater_movement_method'=>$soilmtd, 'use_bedrock'=>$use_bed ); @@ -3673,7 +3767,7 @@ sub setup_logic_cnvegcarbonstate { if ( &value_is_true($nl->get_value('use_cn')) ) { my $mmnuptake = $nl->get_value('mm_nuptake_opt'); if ( ! defined($mmnuptake) ) { $mmnuptake = ".false."; } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_vegC', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_vegC', 'use_cn' => $nl->get_value('use_cn'), 'mm_nuptake_opt' => $mmnuptake ); } } @@ -3686,8 +3780,8 @@ sub setup_logic_cngeneral { if ( &value_is_true($nl->get_value('use_cn')) ) { if ( &value_is_true($nl->get_value('use_crop')) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dribble_crophrv_xsmrpool_2atm', - 'co2_type' => remove_leading_and_trailing_quotes($nl->get_value('co2_type')), + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dribble_crophrv_xsmrpool_2atm', + 'co2_type' => remove_leading_and_trailing_quotes($nl->get_value('co2_type')), 'use_crop' => $nl->get_value('use_crop') ); } else { if ( defined($nl->get_value('dribble_crophrv_xsmrpool_2atm')) ) { @@ -3931,10 +4025,37 @@ sub setup_logic_fates { if (&value_is_true( $nl_flags->{'use_fates'}) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); - my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", - "use_fates_inventory_init","use_fates_fixed_biogeog", "use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking" ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_sp', 'use_fates'=>$nl_flags->{'use_fates'} ); + if ( &value_is_true($nl->get_value('use_fates_sp')) ) { + $nl_flags->{'use_fates_sp'} = ".true."; + } else { + $nl_flags->{'use_fates_sp'} = ".false."; + } + my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", + "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp", + "use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking" ); foreach my $var ( @list ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'} ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, + 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); + } + # + # For FATES SP mode make sure no-competetiion, and fixed-biogeography are also set + # And also check for other settings that can't be trigged on as well + # + my $var = "use_fates_sp"; + if ( defined($nl->get_value($var)) ) { + if ( &value_is_true($nl->get_value($var)) ) { + my @list = ( "use_fates_nocomp", "use_fates_fixed_biogeog" ); + foreach my $var ( @list ) { + if ( ! &value_is_true($nl->get_value($var)) ) { + $log->fatal_error("$var is required when FATES SP is on (use_fates_sp)" ); + } + } + # spit-fire can't be on with FATES SP mode is active + if ( $nl->get_value('fates_spitfire_mode') > 0 ) { + $log->fatal_error('fates_spitfire_mode can NOT be set to greater than 0 when use_fates_sp is true'); + } + } } my $var = "use_fates_inventory_init"; if ( defined($nl->get_value($var)) ) { @@ -3985,7 +4106,7 @@ sub write_output_files { @groups = qw(clm_inparm ndepdyn_nml popd_streams urbantv_streams light_streams soil_moisture_streams lai_streams atm2lnd_inparm lnd2atm_inparm clm_canopyhydrology_inparm cnphenology clm_soilhydrology_inparm dynamic_subgrid cnvegcarbonstate - finidat_consistency_checks dynpft_consistency_checks + finidat_consistency_checks dynpft_consistency_checks clm_initinterp_inparm century_soilbgcdecompcascade soilhydrology_inparm luna friction_velocity mineral_nitrogen_dynamics soilwater_movement_inparm rooting_profile_inparm @@ -3997,9 +4118,6 @@ sub write_output_files { #@groups = qw(clm_inparm clm_canopyhydrology_inparm clm_soilhydrology_inparm # finidat_consistency_checks dynpft_consistency_checks); # Eventually only list namelists that are actually used when CN on - #if ( $nl_flags->{'bgc_mode'} eq "cn" ) { - # push @groups, qw(ndepdyn_nml popd_streams light_streams); - #} if ( &value_is_true($nl_flags->{'use_lch4'}) ) { push @groups, "ch4par_in"; } @@ -4011,6 +4129,7 @@ sub write_output_files { push @groups, "nitrif_inparm"; push @groups, "lifire_inparm"; push @groups, "ch4finundated"; + push @groups, "soilbgc_decomp"; push @groups, "clm_canopy_inparm"; if (remove_leading_and_trailing_quotes($nl->get_value('snow_cover_fraction_method')) eq 'SwensonLawrence2012') { push @groups, "scf_swenson_lawrence_2012_inparm"; diff --git a/bld/namelist_files/checkmapfiles.ncl b/bld/namelist_files/checkmapfiles.ncl index f10a631f95..e37100747a 100644 --- a/bld/namelist_files/checkmapfiles.ncl +++ b/bld/namelist_files/checkmapfiles.ncl @@ -9,7 +9,7 @@ ; print( "Check that datm mapping files are consistent" ); - resolutions = (/ "128x256", "64x128", "48x96", "94x192", "0.23x0.31", "0.47x0.63", "0.9x1.25", "1.9x2.5", "2.5x3.33", "4x5", "10x15", "0.125nldas2", "5x5_amazon", "1x1_camdenNJ", "1x1_vancouverCAN", "1x1_mexicocityMEX", "1x1_asphaltjungleNJ", "1x1_brazil", "1x1_urbanc_alpha", "1x1_numaIA", "1x1_smallvilleIA", "ne4np4", "ne16np4", "ne30np4", "ne60np4", "ne120np4", "ne240np4" /); + resolutions = (/ "128x256", "64x128", "48x96", "94x192", "0.23x0.31", "0.47x0.63", "0.9x1.25", "1.9x2.5", "2.5x3.33", "4x5", "10x15", "0.125nldas2", "5x5_amazon", "1x1_vancouverCAN", "1x1_mexicocityMEX", "1x1_asphaltjungleNJ", "1x1_brazil", "1x1_urbanc_alpha", "1x1_numaIA", "1x1_smallvilleIA", "ne4np4", "ne16np4", "ne30np4", "ne60np4", "ne120np4", "ne240np4" /); space = " "; badres = 0 diff --git a/bld/namelist_files/createMapEntry.pl b/bld/namelist_files/createMapEntry.pl index b4ea766e38..5ba9a2030a 100755 --- a/bld/namelist_files/createMapEntry.pl +++ b/bld/namelist_files/createMapEntry.pl @@ -56,9 +56,14 @@ foreach my $foo ( @list ) { next if ($foo =~ m/^\./); #~# skip anything in the directory with a leading or stand alone 'dot' my @tokens = split(/_/, $foo); #~# split foo name by the underscore - #~# write out lines for namelist_defaults_ctsm.xml - print "$partialPath/$foo\n"; + #~# write out lines for namelist_defaults_ctsm.xml nomask" files + my $from_mask = $tokens[2]; + if ( $from_mask =~ /nomask/ ) { + if ( $tokens[5] eq "nomask" && $tokens[4] eq $grid ) { + print "$partialPath/$foo\n"; + } + } } #~# print a unique end string in the XML comments diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index f97121ec56..8a10a96ebf 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -101,11 +101,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. -Medlyn2011 -Ball-Berry1987 -Medlyn2011 -Ball-Berry1987 -Ball-Berry1987 +Medlyn2011 +Medlyn2011 +Ball-Berry1987 lnd/clm2/isotopes/atm_delta_C13_CMIP6_1850-2015_yearly_v2.0_c190528.nc @@ -349,10 +347,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 2 3 -60. +60. 1.e-8 -1.e-1 -1.e-2 +1.e-1 +1.e-2 42 1 1 @@ -483,9 +481,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/ctsm51_params.c210528.nc -lnd/clm2/paramdata/clm50_params.c210528.nc -lnd/clm2/paramdata/clm45_params.c210528.nc +lnd/clm2/paramdata/ctsm51_params.c210923.nc +lnd/clm2/paramdata/clm50_params.c210803.nc +lnd/clm2/paramdata/clm45_params.c210803.nc @@ -541,6 +539,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.17 0.17 + +unset + .false. .false. .true. @@ -560,10 +561,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 1.d00 -.true. -.true. -.false. -.false. +.true. +DependsOnLat +.false. +Constant 0.5 @@ -611,7 +612,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. - + .false. - @@ -674,171 +675,171 @@ attributes from the config_cache.xml file (with keys converted to upper-case). Or one specific file will be chosen over another. --> hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.true. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.true. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +>hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 p hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 hgrid=ne0np4CONUS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 +>hgrid=ne0np4CONUS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 @@ -848,21 +849,21 @@ p --> lnd/clm2/initdata_map/clmi.I1850Clm45BgcGs.0901-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.I1850Clm45BgcCruGs.1101-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.B1850Clm45BgcGs.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc @@ -870,7 +871,7 @@ p lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc @@ -878,7 +879,7 @@ p lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c200428.nc @@ -886,7 +887,7 @@ p lnd/clm2/initdata_map/clmi.I1850Clm50BgcCropCru-ciso.1526-01-01.0.9x1.25_gx1v7_simyr1850_c200728.nc @@ -894,14 +895,14 @@ p lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc lnd/clm2/initdata_map/clmi.I1850Clm50SpCru.1706-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc @@ -909,13 +910,13 @@ p lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c200428.nc @@ -928,7 +929,7 @@ p lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc @@ -936,7 +937,7 @@ p lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc @@ -944,13 +945,13 @@ p lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc @@ -959,7 +960,7 @@ p lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc @@ -967,21 +968,21 @@ p lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -989,7 +990,7 @@ p lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -997,7 +998,7 @@ p lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTICGRIS_ne30x8_mt12_simyr1979_c200806.nc @@ -1005,7 +1006,7 @@ p lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1013,7 +1014,7 @@ p lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc @@ -1021,7 +1022,7 @@ p lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1030,7 +1031,7 @@ p lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc @@ -1040,13 +1041,19 @@ p lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_48x96_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc + +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc - + +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr2000_c190304.nc + lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr2000_c190304.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_4x5_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc - + +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc + lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc @@ -1077,13 +1084,13 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_C96_hist_78pfts_CMIP6_simyr2000 lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_C48_hist_78pfts_CMIP6_simyr2000_c200317.nc lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_C24_hist_78pfts_CMIP6_simyr2000_c200317.nc - + lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c190214.nc - + lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr2000_c190304.nc lnd/clm2/surfdata_map/release-clm5.0.24/surfdata_0.125x0.125_hist_78pfts_CMIP6_simyr2005_c190624.nc - + lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_78pfts_CMIP6_simyr2000_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_4x5_hist_78pfts_CMIP6_simyr2000_c190214.nc @@ -1114,8 +1121,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.ARCTIC.ne30x4_hist_78pft lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts_CMIP6_simyr2000_c200426.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_camdenNJ_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_vancouverCAN_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc @@ -1197,11 +1202,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc +lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc +lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc +lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc @@ -1218,11 +1229,11 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc @@ -1272,7 +1283,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts lnd/clm2/surfdata_map/release-clm5.0.30/landuse.timeseries_C96_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c200317.nc -lnd/clm2/surfdata_map/release-clm5.0.30/landuse.timeseries_ne30np4_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c200426.nc lnd/clm2/surfdata_map/release-clm5.0.30/landuse.timeseries_ne30np4.pg2_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c200426.nc @@ -1503,15 +1514,12 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts cycle NDEP_month -limit cycle NDEP_month -limit cycle NDEP_month -limit bilinear @@ -1519,7 +1527,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts nn nn nn -nn nn nn @@ -1550,14 +1557,12 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts nn nn nn -nn nn nn nn nn nn nn -nn nn nn @@ -1589,7 +1594,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts nn nn nn -nn nn nn @@ -1686,7 +1690,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts nn nn nn -nn nn nn @@ -1696,7 +1699,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts nn nn nn -nn nn nn @@ -1731,17 +1733,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts 1850 2106 -lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc -lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc -lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc @@ -1752,7 +1754,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts nn nn nn -nn nn nn @@ -1789,203 +1790,164 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts - - -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.125x0.125_nomask_to_0.1x0.1_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.5x0.5_nomask_to_0.1x0.1_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.25x0.25_nomask_to_0.1x0.1_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_3x3min_nomask_to_0.1x0.1_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_10x10min_nomask_to_0.1x0.1_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_5x5min_nomask_to_0.1x0.1_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.9x1.25_nomask_to_0.1x0.1_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.1x0.1_nomask_aave_da_c130405.nc - - - + lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.125x0.125_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.5x0.5_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.25x0.25_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_10x10min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_5x5min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.9x1.25_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c130403.nc - + - + lnd/clm2/mappingdata/maps/1x1_brazil/map_0.125x0.125_nomask_to_1x1_brazil_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_nomask_to_1x1_brazil_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.25x0.25_nomask_to_1x1_brazil_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_nomask_to_1x1_brazil_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_10x10min_nomask_to_1x1_brazil_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_5x5min_nomask_to_1x1_brazil_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.9x1.25_nomask_to_1x1_brazil_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_brazil_nomask_aave_da_c130403.nc - - - -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.125x0.125_nomask_to_1x1_camdenNJ_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.5x0.5_nomask_to_1x1_camdenNJ_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.25x0.25_nomask_to_1x1_camdenNJ_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_nomask_to_1x1_camdenNJ_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_10x10min_nomask_to_1x1_camdenNJ_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_5x5min_nomask_to_1x1_camdenNJ_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.9x1.25_nomask_to_1x1_camdenNJ_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_camdenNJ_nomask_aave_da_c130403.nc - - - + + + lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.125x0.125_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.5x0.5_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.25x0.25_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_10x10min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_5x5min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.9x1.25_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_mexicocityMEX_nomask_aave_da_c130403.nc - + - + lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.125x0.125_nomask_to_1x1_numaIA_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.5x0.5_nomask_to_1x1_numaIA_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.25x0.25_nomask_to_1x1_numaIA_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_nomask_to_1x1_numaIA_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_10x10min_nomask_to_1x1_numaIA_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_5x5min_nomask_to_1x1_numaIA_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.9x1.25_nomask_to_1x1_numaIA_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_numaIA_nomask_aave_da_c130403.nc - + - + lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.125x0.125_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.25x0.25_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.5x0.5_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_10x10min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_5x5min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.9x1.25_nomask_to_1x1_smallvilleIA_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_smallvilleIA_nomask_aave_da_c130403.nc - + - + lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.125x0.125_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.25x0.25_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.5x0.5_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_10x10min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_5x5min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.9x1.25_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_urbanc_alpha_nomask_aave_da_c130403.nc - + - + lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.125x0.125_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.25x0.25_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.5x0.5_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_10x10min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_5x5min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.9x1.25_nomask_to_1x1_vancouverCAN_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_vancouverCAN_nomask_aave_da_c130403.nc - + - + lnd/clm2/mappingdata/maps/0.47x0.63/map_0.125x0.125_nomask_to_0.47x0.63_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.5x0.5_nomask_to_0.47x0.63_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.25x0.25_nomask_to_0.47x0.63_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_10x10min_nomask_to_0.47x0.63_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_nomask_to_0.47x0.63_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_5x5min_nomask_to_0.47x0.63_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.9x1.25_nomask_to_0.47x0.63_nomask_aave_da_c200206.nc - + lnd/clm2/mappingdata/maps/0.9x1.25/map_0.125x0.125_nomask_to_0.9x1.25_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.5x0.5_nomask_to_0.9x1.25_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.25x0.25_nomask_to_0.9x1.25_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/0.9x1.25/map_10x10min_nomask_to_0.9x1.25_nomask_aave_da_c200206.nc @@ -1993,16 +1955,16 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/0.9x1.25/map_5x5min_nomask_to_0.9x1.25_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_nomask_to_0.9x1.25_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.9x1.25_nomask_to_0.9x1.25_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.9x1.25_nomask_aave_da_c130405.nc lnd/clm2/mappingdata/maps/1.9x2.5/map_0.125x0.125_nomask_to_1.9x2.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.5x0.5_nomask_to_1.9x2.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.25x0.25_nomask_to_1.9x2.5_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/1.9x2.5/map_10x10min_nomask_to_1.9x2.5_nomask_aave_da_c200206.nc @@ -2010,17 +1972,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/1.9x2.5/map_5x5min_nomask_to_1.9x2.5_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_nomask_to_1.9x2.5_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.9x1.25_nomask_to_1.9x2.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1.9x2.5_nomask_aave_da_c130405.nc lnd/clm2/mappingdata/maps/10x15/map_0.125x0.125_nomask_to_10x15_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_nomask_to_10x15_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_nomask_to_10x15_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/10x15/map_10x10min_nomask_to_10x15_nomask_aave_da_c200206.nc @@ -2028,34 +1990,39 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/10x15/map_5x5min_nomask_to_10x15_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/10x15/map_3x3min_nomask_to_10x15_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/10x15/map_0.9x1.25_nomask_to_10x15_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/10x15/map_1km-merge-10min_HYDRO1K-merge-nomask_to_10x15_nomask_aave_da_c130411.nc + + + + lnd/clm2/mappingdata/maps/0.5x0.5/map_0.125x0.125_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.25x0.25_nomask_to_0.5x0.5_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_10x10min_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_nomask_to_0.5x0.5_nomask_aave_da_c200309.nc +>lnd/clm2/mappingdata/maps/360x720/map_0.125x0.125_nomask_to_360x720cru_nomask_aave_da_c210823.nc +lnd/clm2/mappingdata/maps/360x720/map_0.5x0.5_nomask_to_360x720_nomask_aave_da_c120830.nc +lnd/clm2/mappingdata/maps/360x720/map_0.25x0.25_nomask_to_360x720cru_nomask_aave_da_c210823.nc lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_nomask_to_0.5x0.5_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.9x1.25_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.5x0.5_nomask_aave_da_c130405.nc - +>lnd/clm2/mappingdata/maps/360x720/map_3x3min_nomask_to_360x720cru_nomask_aave_da_c210823.nc +lnd/clm2/mappingdata/maps/360x720/map_10x10min_nomask_to_360x720_nomask_aave_da_c120830.nc +lnd/clm2/mappingdata/maps/360x720/map_5x5min_nomask_to_360x720_nomask_aave_da_c120830.nc +lnd/clm2/mappingdata/maps/360x720/map_0.9x1.25_nomask_to_360x720cru_nomask_aave_da_c210823.nc +lnd/clm2/mappingdata/maps/360x720/map_1km-merge-10min_HYDRO1K-merge-nomask_to_360x720_nomask_aave_da_c130403.nc + + lnd/clm2/mappingdata/maps/512x1024/map_0.125x0.125_nomask_to_512x1024_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/512x1024/map_0.5x0.5_nomask_to_512x1024_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/512x1024/map_0.25x0.25_nomask_to_512x1024_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/512x1024/map_10x10min_nomask_to_512x1024_nomask_aave_da_c200206.nc @@ -2063,17 +2030,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/512x1024/map_5x5min_nomask_to_512x1024_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/512x1024/map_3x3min_nomask_to_512x1024_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/512x1024/map_0.9x1.25_nomask_to_512x1024_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/512x1024/map_1km-merge-10min_HYDRO1K-merge-nomask_to_512x1024_nomask_aave_da_c130403.nc lnd/clm2/mappingdata/maps/128x256/map_0.125x0.125_nomask_to_128x256_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/128x256/map_0.5x0.5_nomask_to_128x256_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/128x256/map_0.25x0.25_nomask_to_128x256_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/128x256/map_10x10min_nomask_to_128x256_nomask_aave_da_c200206.nc @@ -2081,17 +2048,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/128x256/map_5x5min_nomask_to_128x256_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/128x256/map_3x3min_nomask_to_128x256_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/128x256/map_0.9x1.25_nomask_to_128x256_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/128x256/map_1km-merge-10min_HYDRO1K-merge-nomask_to_128x256_nomask_aave_da_c130403.nc lnd/clm2/mappingdata/maps/64x128/map_0.125x0.125_nomask_to_64x128_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/64x128/map_0.5x0.5_nomask_to_64x128_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/64x128/map_0.25x0.25_nomask_to_64x128_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/64x128/map_10x10min_nomask_to_64x128_nomask_aave_da_c200206.nc @@ -2099,16 +2066,16 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/64x128/map_5x5min_nomask_to_64x128_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/64x128/map_3x3min_nomask_to_64x128_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/64x128/map_0.9x1.25_nomask_to_64x128_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/64x128/map_1km-merge-10min_HYDRO1K-merge-nomask_to_64x128_nomask_aave_da_c130403.nc lnd/clm2/mappingdata/maps/48x96/map_0.125x0.125_nomask_to_48x96_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/48x96/map_0.5x0.5_nomask_to_48x96_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/48x96/map_0.25x0.25_nomask_to_48x96_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/48x96/map_10x10min_nomask_to_48x96_nomask_aave_da_c200206.nc @@ -2116,16 +2083,16 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/48x96/map_5x5min_nomask_to_48x96_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/48x96/map_3x3min_nomask_to_48x96_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/48x96/map_0.9x1.25_nomask_to_48x96_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/48x96/map_1km-merge-10min_HYDRO1K-merge-nomask_to_48x96_nomask_aave_da_c130405.nc lnd/clm2/mappingdata/maps/4x5/map_0.125x0.125_nomask_to_4x5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/4x5/map_0.5x0.5_nomask_to_4x5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/4x5/map_0.25x0.25_nomask_to_4x5_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/4x5/map_10x10min_nomask_to_4x5_nomask_aave_da_c200206.nc @@ -2133,16 +2100,16 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/4x5/map_5x5min_nomask_to_4x5_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/4x5/map_3x3min_nomask_to_4x5_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/4x5/map_0.9x1.25_nomask_to_4x5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/4x5/map_1km-merge-10min_HYDRO1K-merge-nomask_to_4x5_nomask_aave_da_c130411.nc lnd/clm2/mappingdata/maps/0.23x0.31/map_0.125x0.125_nomask_to_0.23x0.31_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.5x0.5_nomask_to_0.23x0.31_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.25x0.25_nomask_to_0.23x0.31_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/0.23x0.31/map_10x10min_nomask_to_0.23x0.31_nomask_aave_da_c200206.nc @@ -2150,17 +2117,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_nomask_to_0.23x0.31_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_nomask_to_0.23x0.31_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.9x1.25_nomask_to_0.23x0.31_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.23x0.31_nomask_aave_da_c130405.nc lnd/clm2/mappingdata/maps/2.5x3.33/map_0.125x0.125_nomask_to_2.5x3.33_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.5x0.5_nomask_to_2.5x3.33_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.25x0.25_nomask_to_2.5x3.33_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/2.5x3.33/map_10x10min_nomask_to_2.5x3.33_nomask_aave_da_c200206.nc @@ -2168,38 +2135,36 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_nomask_to_2.5x3.33_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_nomask_to_2.5x3.33_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.9x1.25_nomask_to_2.5x3.33_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_1km-merge-10min_HYDRO1K-merge-nomask_to_2.5x3.33_nomask_aave_da_c130405.nc - + lnd/clm2/mappingdata/maps/0.5x0.5/map_0.125x0.125_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_10x10min_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.25x0.25_nomask_to_0.5x0.5_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_nomask_to_0.5x0.5_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_nomask_to_0.5x0.5_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.1x0.1_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.9x1.25_nomask_to_0.5x0.5_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.5x0.5_nomask_aave_da_c130405.nc lnd/clm2/mappingdata/maps/ne4np4/map_0.125x0.125_nomask_to_ne4np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne4np4/map_0.5x0.5_nomask_to_ne4np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne4np4/map_0.25x0.25_nomask_to_ne4np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne4np4/map_5x5min_nomask_to_ne4np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_nomask_to_ne4np4_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/ne4np4/map_0.9x1.25_nomask_to_ne4np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne4np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne4np4_nomask_aave_da_c130411.nc lnd/clm2/mappingdata/maps/ne16np4/map_0.125x0.125_nomask_to_ne16np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne16np4/map_0.5x0.5_nomask_to_ne16np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne16np4/map_0.25x0.25_nomask_to_ne16np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne16np4/map_10x10min_nomask_to_ne16np4_nomask_aave_da_c200206.nc @@ -2290,17 +2255,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_nomask_to_ne16np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_nomask_to_ne16np4_nomask_aave_da_c210506.nc -lnd/clm2/mappingdata/maps/ne16np4/map_0.9x1.25_nomask_to_ne16np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne16np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne16np4_nomask_aave_da_c130408.nc lnd/clm2/mappingdata/maps/ne30np4/map_0.125x0.125_nomask_to_ne30np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne30np4/map_0.5x0.5_nomask_to_ne30np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne30np4/map_0.25x0.25_nomask_to_ne30np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne30np4/map_10x10min_nomask_to_ne30np4_nomask_aave_da_c200206.nc @@ -2308,17 +2273,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/ne30np4/map_5x5min_nomask_to_ne30np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_nomask_to_ne30np4_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/ne30np4/map_0.9x1.25_nomask_to_ne30np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne30np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne30np4_nomask_aave_da_c130405.nc lnd/clm2/mappingdata/maps/ne60np4/map_0.125x0.125_nomask_to_ne60np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne60np4/map_0.5x0.5_nomask_to_ne60np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne60np4/map_0.25x0.25_nomask_to_ne60np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne60np4/map_10x10min_nomask_to_ne60np4_nomask_aave_da_c200206.nc @@ -2326,16 +2291,16 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_nomask_to_ne60np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_nomask_to_ne60np4_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/ne60np4/map_0.9x1.25_nomask_to_ne60np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne60np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne60np4_nomask_aave_da_c130405.nc lnd/clm2/mappingdata/maps/ne120np4/map_0.125x0.125_nomask_to_ne120np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne120np4/map_0.5x0.5_nomask_to_ne120np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne120np4/map_0.25x0.25_nomask_to_ne120np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne120np4/map_10x10min_nomask_to_ne120np4_nomask_aave_da_c200206.nc @@ -2343,16 +2308,16 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/ne120np4/map_5x5min_nomask_to_ne120np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_nomask_to_ne120np4_nomask_aave_da_c210506.nc -lnd/clm2/mappingdata/maps/ne120np4/map_0.9x1.25_nomask_to_ne120np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne120np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne120np4_nomask_aave_da_c130405.nc - + - + @@ -2378,18 +2343,18 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts lnd/clm2/mappingdata/maps/5x5_amazon/map_0.125x0.125_nomask_to_5x5_amazon_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.5x0.5_nomask_to_5x5_amazon_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.25x0.25_nomask_to_5x5_amazon_nomask_aave_da_c200309.nc - - +lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_5x5min_nomask_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_10x10min_nomask_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne0np4CONUS.ne30x8/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne0np4CONUS.ne30x8_nomask_aave_da_c200426.nc @@ -2399,145 +2364,145 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts >lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_nomask_to_5x5_amazon_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_nomask_to_5x5_amazon_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.9x1.25_nomask_to_5x5_amazon_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_1km-merge-10min_HYDRO1K-merge-nomask_to_5x5_amazon_nomask_aave_da_c130403.nc lnd/clm2/mappingdata/maps/ne240np4/map_0.125x0.125_nomask_to_ne240np4_nomask_aave_da_c200206.nc lnd/clm2/mappingdata/maps/ne240np4/map_10x10min_nomask_to_ne240np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne240np4/map_0.5x0.5_nomask_to_ne240np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne240np4/map_0.25x0.25_nomask_to_ne240np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_nomask_to_ne240np4_nomask_aave_da_c200309.nc lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_nomask_to_ne240np4_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/ne240np4/map_0.9x1.25_nomask_to_ne240np4_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/ne240np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne240np4_nomask_aave_da_c130405.nc - + lnd/clm2/mappingdata/maps/0.125x0.125/map_0.125x0.125_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125x0.125_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_0.25x0.25_nomask_to_0.125x0.125_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_nomask_to_0.125x0.125_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_nomask_to_0.125x0.125_nomask_aave_da_c200309.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_0.9x1.25_nomask_to_0.125x0.125_nomask_aave_da_c200206.nc -lnd/clm2/mappingdata/maps/1km/map_0.5x0.5_nomask_to_1km-merge-10min_HYDRO1K-merge-nomask_aave_da_c200206.nc - + -lnd/clm2/mappingdata/maps/94x192/map_0.5x0.5_nomask_to_94x192_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/94x192/map_94x192_nomask_to_0.5x0.5_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/94x192/map_1km-merge-10min_HYDRO1K-merge-nomask_to_94x192_nomask_aave_da_c190521.nc -lnd/clm2/mappingdata/maps/94x192/map_5x5min_nomask_to_94x192_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/94x192/map_10x10min_nomask_to_94x192_nomask_aave_da_c110823.nc - + -lnd/clm2/mappingdata/maps/ARCTIC/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ARCTIC/map_5x5min_nomask_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ARCTIC/map_10x10min_nomask_to_ne0np4.ARCTIC.ne30x4_nomask_aave_da_c200426.nc - + - + -lnd/clm2/mappingdata/maps/ARCTICGRIS/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ARCTICGRIS/map_5x5min_nomask_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ARCTICGRIS/map_10x10min_nomask_to_ne0np4.ARCTICGRIS.ne30x8_nomask_aave_da_c200426.nc - + - + -lnd/clm2/mappingdata/maps/ne30np4.pg2/map_5x5min_nomask_to_ne30np4.pg2_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne30np4.pg2/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne30np4.pg2_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne30np4.pg2/map_10x10min_nomask_to_ne30np4.pg2_nomask_aave_da_c200426.nc - + - + -lnd/clm2/mappingdata/maps/ne30pg3/map_5x5min_nomask_to_ne30np4.pg3_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne30pg3/map_10x10min_nomask_to_ne30np4.pg3_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne30pg3/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne30np4.pg3_nomask_aave_da_c200426.nc - + - + -lnd/clm2/mappingdata/maps/ne120np4.pg2/map_10x10min_nomask_to_ne120np4.pg2_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne120np4.pg2/map_5x5min_nomask_to_ne120np4.pg2_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne120np4.pg2/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne120np4.pg2_nomask_aave_da_c200426.nc - + - + -lnd/clm2/mappingdata/maps/ne120np4.pg3/map_10x10min_nomask_to_ne120np4.pg3_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne120np4.pg3/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne120np4.pg3_nomask_aave_da_c200426.nc -lnd/clm2/mappingdata/maps/ne120np4.pg3/map_5x5min_nomask_to_ne120np4.pg3_nomask_aave_da_c200426.nc - + @@ -2555,9 +2520,12 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts .true. .true. -0.9x1.25 +0.9x1.25 + +lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc -lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc -.false. -.false. -.false. -.false. - -.false. -.false. -.false. -.false. +CENTURYKoven2013 +CENTURYKoven2013 +None -.true. -.true. -.true. -.true. - -.true. -.true. -.false. -.false. +.false. +.true. +.false. +.true. 0 @@ -2597,9 +2554,14 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts .false. .false. .false. -.false. +.false. 1 +.true. +.false. +.true. +.false. + diff --git a/bld/namelist_files/namelist_defaults_ctsm_tools.xml b/bld/namelist_files/namelist_defaults_ctsm_tools.xml index 0f79ff53d6..1166e80c9c 100644 --- a/bld/namelist_files/namelist_defaults_ctsm_tools.xml +++ b/bld/namelist_files/namelist_defaults_ctsm_tools.xml @@ -67,9 +67,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/mappingdata/grids/SCRIPgrid_0.125x0.125_nomask_c140702.nc lnd/clm2/mappingdata/grids/SCRIPgrid_0.33x0.33_navy_c111207.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_0.1x0.1_nomask_c110712.nc - +lnd/clm2/mappingdata/grids/SCRIPgrid_360x720_nomask_c120830.nc + +lnd/clm2/mappingdata/grids/SCRIPgrid_0.5x0.5_nomask_c110308.nc lnd/clm2/mappingdata/grids/SCRIPgrid_0.25x0.25_nomask_c200309.nc @@ -93,9 +95,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/mappingdata/grids/SCRIPgrid_0.125nldas2_nomask_c190328.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_camdenNJ_nomask_c110308.nc lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_brazil_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_camdenNJ_nomask_c110308.nc lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_mexicocityMEX_nomask_c110308.nc lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_numaIA_nomask_c110308.nc lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_smallvilleIA_nomask_c110308.nc @@ -160,7 +160,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). nomask HYDRO1K-merge-nomask nomask -nomask 3x3min @@ -187,7 +186,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5x0.5 1km-merge-10min 0.9x1.25 -0.5x0.5 mksrf_flakwat @@ -210,7 +208,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). mksrf_fabm mksrf_ftopostats mksrf_fvic -mksrf_fch4 lnd/clm2/rawdata/mksrf_navyoro_20min.c010129.nc @@ -313,9 +310,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/rawdata/mksrf_vic_0.9x1.25_GRDC_simyr2000.c130307.nc -lnd/clm2/rawdata/mksrf_ch4inversion_0.5x0.5_cruncep_simyr2000.c191112.nc - diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml index f0c7f3c0ff..c4ccac6467 100644 --- a/bld/namelist_files/namelist_defaults_overall.xml +++ b/bld/namelist_files/namelist_defaults_overall.xml @@ -55,7 +55,6 @@ determine default values for namelists. 1.9x2.5 1x1_brazil 5x5_amazon -1x1_camdenNJ 1x1_vancouverCAN 1x1_mexicocityMEX 1x1_asphaltjungleNJ @@ -103,7 +102,6 @@ determine default values for namelists. nldas2 navy -navy navy navy navy diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index a310182849..67929c4bd4 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -86,7 +86,6 @@ Type of CO2 feedback. diagnostic = use the diagnostic value sent from the atmosphere - Supplemental Nitrogen mode and for what type of vegetation it's turned on for. @@ -324,6 +323,7 @@ If TRUE use the undercanopy stability term used with CLM4.5 (Sakaguchi&Zeng, If TRUE, include biomass heat storage in canopy energy balance. + @@ -659,6 +659,17 @@ Toggle to turn on fixed biogeography mode (Only relevant if FATES is on) + +Toggle to turn on no competition mode (only relevant if FATES is being used). + + + + +Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used). + + Toggle to turn on the logging module @@ -753,13 +764,14 @@ SNICAR (SNow, ICe, and Aerosol Radiative model) snow aging data file name If TRUE, write master field list to separate file for documentation purposes - + Per file averaging flag. 'A' (average over history period) 'I' (instantaneous) 'X' (maximum over history period) 'M' (minimum over history period) + 'LXXXXX' (local solar time at XXXXX seconds of day) - -If TRUE, write diagnostic of global radiative temperature written to CLM log file. - - Whether to use subgrid fluxes for snow @@ -1001,37 +1008,23 @@ Requires the CN model to work (either CN or CNDV). group="clm_inparm" valid_values="" value=".false."> Nitrification/denitrification splits the prognostic mineral N pool into two mineral N pools: NO3 and NH4, and includes the transformations between them. -Requires the CN model to work (either CN or CNDV). +Turned on for BGC +FATES currently allows it to be true or false, but will be hardwired to true later Multiplier for heterotrophic respiration for max denitrification rates -(ONLY used if use_nitrif_denitrif is enabled) Exponent power for heterotrophic respiration for max denitrification rates -(ONLY used if use_nitrif_denitrif is enabled) Maximum nitrification rate constant (1/s) -(ONLY used if use_nitrif_denitrif is enabled) - - - -Turn on vertical soil carbon. -Requires the CN or FATES model to work (either CN or CNDV). - - - -Use parameters for decomposition from the CENTURY Carbon model -Requires the CN or FATES model to work (either CN or CNDV). + + Parameter to set the type of ozone vegetation stress method + unset = (default) ozone stress vegetation method is off + stress_lombardozzi2015 = ozone stress vegetation functions from Danica Lombardozzi 2015 + stress_falk = ozone stress vegetation functions from Stefanie Falk (issue #1224) +Default: "unset" + + Phenology onset depends on the vegetation type (only used when CN is on) - -The minimum critical day length for onset depends on latitude + +Method for determining what the minimum critical day length for seasonal decidious leaf offset depends on +Constant ----------- constant value of crit_dayl from parameter file (value from White 2001) +DependsOnLat ------- Higher values at high latitudes down to value from parameter file for temperate and equatorial regions + (L. Birch et. al, GMD 2021) +DependsOnVeg ------- Arctic vegetation with higher value and temperate vegetation with crit_dayl from parameter file +DependsOnLatAndVeg - Arctic vegetation depends on latitude as above, but temperate vegetation fixed at crit_dayl value from parameter file (only used when CN is on) - -Toggle to turn on ozone stress - - Toggle to turn on calculation of SNow and Ice Aerosol Radiation model (SNICAR) radiative forcing @@ -1229,7 +1231,7 @@ Output of "git describe" to give the tag/commit the version being used correspon + valid_values="mksrf_fsoitex,mksrf_forganic,mksrf_flakwat,mksrf_fwetlnd,mksrf_fmax,mksrf_fmax,mksrf_fglacier,mksrf_fglacierregion,mksrf_fvocef,mksrf_furbtopo,firrig,mksrf_furban,mksrf_fvegtyp,mksrf_fhrvtyp,mksrf_fsoicol,mksrf_flai,mksrf_fgdp,mksrf_fpeat,mksrf_fsoildepth,mksrf_fabm,mksrf_ftopostats,mksrf_fvic" > Filename for mksurfdata_map to remap raw data into the output surface dataset @@ -1367,11 +1369,6 @@ Topography statistics dataset for mksurfdata VIC parameters dataset for mksurfdata - -Inversion-derived CH4 parameters dataset for mksurfdata - - If TRUE, output variables in double precision for mksurfdata @@ -1943,7 +1940,7 @@ Land mask description for mksurfdata input files + valid_values="0.25x0.25,0.5x0.5,10x10min,5x5min,360x720cru,0.9x1.25,19basin,1km-merge-10min"> Horizontal grid resolutions for mksurfdata input files @@ -1953,7 +1950,7 @@ Horizontal grid resolutions for mksurfdata input files + group="default_settings" valid_values="none,0.9x1.25" > Resolution of finundated inversion streams dataset (stream_fldfilename_ch4finundated) to use for methane model (only applies when CN and methane model are turned on) @@ -1988,9 +1985,9 @@ CLM run type. + valid_values="512x1024,360x720cru,128x256,64x128,48x96,94x192,0.23x0.31,0.47x0.63,0.9x1.25,1.9x2.5,2.5x3.33,4x5,10x15,0.125nldas2,5x5_amazon,1x1_vancouverCAN,1x1_mexicocityMEX,1x1_asphaltjungleNJ,1x1_brazil,1x1_urbanc_alpha,1x1_numaIA,1x1_smallvilleIA,0.25x0.25,0.5x0.5,3x3min,5x5min,10x10min,0.33x0.33,0.125x0.125,ne4np4,ne16np4,ne30np4.pg2,ne30np4.pg3,ne30np4,ne60np4,ne120np4,ne120np4.pg2,ne120np4.pg3,ne0np4CONUS.ne30x8,ne0np4.ARCTIC.ne30x4,ne0np4.ARCTICGRIS.ne30x8,ne240np4,1km-merge-10min,C24,C48,C96,C192,C384"> Horizontal resolutions -Note: 0.1x0.1, 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min, 1km-merge-10min and 0.33x0.33 are only used for CLM toolsI +Note: 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min, 1km-merge-10min and 0.33x0.33 are only used for CLM toolsI + + +Soil decomposition method + None -- No soil decomposition is done + CENTURYKoven2013 -- CENTURY model in CTSM from Koven et. al. 2013 + +An active soil decomposition method requires the BGC or FATES model to work +And both BGC and FATES models require an active soil decomposition model + + @@ -2662,11 +2670,6 @@ Snow compaction overburden exponential factor (1/K) Not used for snow_overburden_compaction_method=Vionnet2012 - -Minimum wind speed tht results in compaction (m/s) - - maximum warm (at freezing) fresh snow effective radius [microns] diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml index 93e5e24372..7ce017b3fc 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml @@ -12,6 +12,10 @@ 1850-2100 + + SSP1-1.9 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml index d10ef6d45f..a622d270ad 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml @@ -12,6 +12,10 @@ 1850-2100 + + SSP1-2.6 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml index 85859517f1..e67af8dc85 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml @@ -12,6 +12,10 @@ 1850-2100 + + SSP2-4.5 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml index 317ca3fbcd..2a0bdbc7cf 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml @@ -12,6 +12,10 @@ 1850-2100 + + SSP3-7.0 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml index 0e42bbd724..6425fed3a5 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml @@ -12,6 +12,10 @@ 1850-2100 + + SSP4-3.4 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml index b2b67a4d5b..3b32371efc 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml @@ -12,6 +12,10 @@ 1850-2100 + + SSP4-6.0 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml index e4ae71ca94..0f7cd35eb9 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml @@ -12,6 +12,10 @@ 1850-2100 + + SSP5-3.4 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml index fbb8af4d10..c3c0e33f20 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml @@ -12,6 +12,10 @@ 1850-2100 + + SSP5-8.5 diff --git a/bld/namelist_files/use_cases/1850_noanthro_control.xml b/bld/namelist_files/use_cases/1850_noanthro_control.xml index 59d06b83b5..636164a729 100644 --- a/bld/namelist_files/use_cases/1850_noanthro_control.xml +++ b/bld/namelist_files/use_cases/1850_noanthro_control.xml @@ -54,7 +54,7 @@ .false. -0.0 -0.0 +0.0 +0.0 diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml index faf0534f34..d6dd729b35 100644 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ b/bld/namelist_files/use_cases/20thC_transient.xml @@ -12,6 +12,10 @@ arb_ic + + flanduse_timeseries .true. diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 9282c5cfeb..cfcd0abe5d 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -23,9 +23,9 @@ sub usage { SYNOPSIS build-namelist_test.pl [options] - Test the the CLM build-namelist + Test the the CLM build-namelist OPTIONS - -help [or -h] Print usage to STDOUT. + -help [or -h] Print usage to STDOUT. -compare Compare namelists for this version to namelists created by another version. -generate Leave the namelists in place to do a later compare. @@ -59,7 +59,7 @@ sub make_env_run { EOF foreach my $item ( keys(%env_vars) ) { print $fh < + EOF } print $fh <$ntests ); @@ -176,7 +176,7 @@ sub cat_and_create_namelistinfile { my $captOut=""; #_# variable to capture Test::More output Test::More->builder->output(\$captOut); #_# ============================================================ -#_# +#_# #_# ============================================================ # Check for unparsed arguments @@ -222,7 +222,7 @@ sub cat_and_create_namelistinfile { &make_env_run(); eval{ system( "$bldnml > $tempfile 2>&1 " ); }; is( $@, '', "plain build-namelist" ); - $cfiles->checkfilesexist( "default", $mode ); + $cfiles->checkfilesexist( "default", $mode ); # Compare to baseline if ( defined($opts{'compare'}) ) { $cfiles->doNOTdodiffonfile( "$tempfile", "default", $mode ); @@ -236,7 +236,7 @@ sub cat_and_create_namelistinfile { $cfiles->copyfiles( "default", $mode ); &cleanup(); # Simple test -- run all the list options -foreach my $options ( "clm_demand", "ssp_rcp", "res", +foreach my $options ( "clm_demand", "ssp_rcp", "res", "sim_year", "use_case" ) { &make_env_run(); eval{ system( "$bldnml -${options} list > $tempfile 2>&1 " ); }; @@ -315,38 +315,48 @@ sub cat_and_create_namelistinfile { print "Test configuration, structure, irrigate, verbose, clm_demand, ssp_rcp, test, sim_year, use_case\n"; print "=================================================================================\n"; -# configuration, structure, irrigate, verbose, clm_demand, ssp_rcp, test, sim_year, use_case my $startfile = "clmrun.clm2.r.1964-05-27-00000.nc"; -foreach my $options ( "-configuration nwp", - "-structure fast", - "-namelist '&a irrigate=.true./'", "-verbose", "-ssp_rcp SSP1-2.6", "-test", "-sim_year 1850", - "-use_case 1850_control", - "-clm_start_type startup", "-namelist '&a irrigate=.false./' -crop -bgc bgc", - "-envxml_dir . -infile myuser_nl_clm", - "-ignore_ic_date -clm_start_type branch -namelist '&a nrevsn=\"thing.nc\"/' -bgc bgc -crop", - "-clm_start_type branch -namelist '&a nrevsn=\"thing.nc\",use_init_interp=T/'", - "-ignore_ic_date -clm_start_type startup -namelist '&a finidat=\"thing.nc\"/' -bgc bgc -crop", - ) { - my $file = $startfile; - &make_env_run(); - eval{ system( "$bldnml -res 0.9x1.25 -envxml_dir . $options > $tempfile 2>&1 " ); }; - is( $@, '', "options: $options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", $mode ); - my $finidat = `grep finidat lnd_in`; - if ( $options =~ /myuser_nl_clm/ ) { - my $fsurdat = `grep fsurdat lnd_in`; - like( $fsurdat, "/MYDINLOCROOT/lnd/clm2/PTCLMmydatafiles/1x1pt_US-UMB/surfdata_1x1pt_US-UMB_simyr2000_clm4_5_c131122.nc/", "$options" ); - } - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->dodiffonfile( "$real_par_file", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); +foreach my $driver ( "mct", "nuopc" ) { + print " For $driver driver\n\n"; + # configuration, structure, irrigate, verbose, clm_demand, ssp_rcp, test, sim_year, use_case + foreach my $options ( "-configuration nwp", + "-structure fast", + "-namelist '&a irrigate=.true./'", "-verbose", "-ssp_rcp SSP1-2.6", "-test", "-sim_year 1850", + "-namelist '&a use_lai_streams=.true.,use_soil_moisture_streams=.true./'", + "-use_case 1850_control", + "-res 1x1pt_US-UMB -clm_usr_name 1x1pt_US-UMB -namelist '&a fsurdat=\"/dev/null\"/'", + "-res 1x1_brazil", + "-clm_start_type startup", "-namelist '&a irrigate=.false./' -crop -bgc bgc", + "-envxml_dir . -infile myuser_nl_clm", + "-ignore_ic_date -clm_start_type branch -namelist '&a nrevsn=\"thing.nc\"/' -bgc bgc -crop", + "-clm_start_type branch -namelist '&a nrevsn=\"thing.nc\",use_init_interp=T/'", + "-ignore_ic_date -clm_start_type startup -namelist '&a finidat=\"thing.nc\"/' -bgc bgc -crop", + ) { + my $file = $startfile; + &make_env_run(); + my $base_options = "-res 0.9x1.25 -envxml_dir . -driver $driver"; + if ( $driver eq "nuopc" ) { + $base_options = "$base_options -lnd_frac UNSET"; + } + eval{ system( "$bldnml $base_options $options > $tempfile 2>&1 " ); }; + is( $@, '', "options: $base_options $options" ); + $cfiles->checkfilesexist( "$base_options $options", $mode ); + $cfiles->shownmldiff( "default", $mode ); + my $finidat = `grep finidat lnd_in`; + if ( $options =~ /myuser_nl_clm/ ) { + my $fsurdat = `grep fsurdat lnd_in`; + like( $fsurdat, "/MYDINLOCROOT/lnd/clm2/PTCLMmydatafiles/1x1pt_US-UMB/surfdata_1x1pt_US-UMB_simyr2000_clm4_5_c131122.nc/", "$options" ); + } + if ( defined($opts{'compare'}) ) { + $cfiles->doNOTdodiffonfile( "$tempfile", "$base_options $options", $mode ); + $cfiles->dodiffonfile( "$real_par_file", "$base_options $options", $mode ); + $cfiles->comparefiles( "$base_options $options", $mode, $opts{'compare'} ); + } + if ( defined($opts{'generate'}) ) { + $cfiles->copyfiles( "$base_options $options", $mode ); + } + &cleanup(); } - &cleanup(); } print "\n===============================================================================\n"; print "Test the NEON sites\n"; @@ -355,17 +365,17 @@ sub cat_and_create_namelistinfile { $mode = "-phys $phys"; &make_config_cache($phys); my $neondir = "../../cime_config/usermods_dirs/NEON"; -foreach my $site ( "ABBY", "BLAN", "CPER", "DEJU", "GRSM", "HEAL", "KONA", "LENO", "NIWO", - "ONAQ", "PUUM", "SERC", "SRER", "TALL", "TREE", "WOOD", "BARR", "BONA", - "DCFS", "DELA", "GUAN", "JERC", "KONZ", "MLBS", "NOGP", "ORNL", "RMNP", - "SJER", "STEI", "TEAK", "UKFS", "WREF", "BART", "CLBJ", "DSNY", "HARV", - "JORN", "LAJA", "MOAB", "OAES", "OSBS", "SCBI", "SOAP", "STER", "TOOL", - "UNDE", "YELL" +foreach my $site ( "ABBY", "BLAN", "CPER", "DEJU", "GRSM", "HEAL", "KONA", "LENO", "NIWO", + "ONAQ", "PUUM", "SERC", "SRER", "TALL", "TREE", "WOOD", "BARR", "BONA", + "DCFS", "DELA", "GUAN", "JERC", "KONZ", "MLBS", "NOGP", "ORNL", "RMNP", + "SJER", "STEI", "TEAK", "UKFS", "WREF", "BART", "CLBJ", "DSNY", "HARV", + "JORN", "LAJA", "MOAB", "OAES", "OSBS", "SCBI", "SOAP", "STER", "TOOL", + "UNDE", "YELL" ) { &make_env_run(); # # Concatonate default usermods and specific sitetogether expanding env variables while doing that - # + # if ( ! -d "$neondir/$site" ) { print "NEON directory is not there: $neondir/$site\n"; die "ERROR:: NEON site does not exist: $site\n"; @@ -380,7 +390,7 @@ sub cat_and_create_namelistinfile { &cat_and_create_namelistinfile( $neondefaultfile, $neonsitefile, $namelistfile ); # # Now run the site - # + # my $options = "-res CLM_USRDAT -clm_usr_name NEON -no-megan -bgc bgc -sim_year 2000 -infile $namelistfile"; eval{ system( "$bldnml -envxml_dir . $options > $tempfile 2>&1 " ); }; is( $@, '', "options: $options" ); @@ -405,7 +415,7 @@ sub cat_and_create_namelistinfile { foreach my $phys ( "clm4_5", "clm5_0" ) { $mode = "-phys $phys"; &make_config_cache($phys); - foreach my $options ( + foreach my $options ( "-res ne0np4.ARCTIC.ne30x4 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam6.0", "-res ne0np4.ARCTICGRIS.ne30x8 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam6.0", "-res 1.9x2.5 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam6.0", @@ -442,14 +452,17 @@ sub cat_and_create_namelistinfile { $phys = "clm5_0"; $mode = "-phys $phys"; &make_config_cache($phys); -foreach my $options ( +foreach my $options ( "-bgc bgc -use_case 1850-2100_SSP1-2.6_transient -namelist '&a start_ymd=20100101/'", "-bgc sp -use_case 1850-2100_SSP2-4.5_transient -namelist '&a start_ymd=18501223/'", "-bgc bgc -use_case 1850-2100_SSP3-7.0_transient -namelist '&a start_ymd=20701029/'", "-bgc fates -use_case 2000_control -no-megan", + "-bgc fates -use_case 20thC_transient -no-megan", + "-bgc fates -use_case 1850_control -no-megan -namelist '&a use_fates_sp=T/'", "-bgc sp -use_case 2000_control -res 0.9x1.25 -namelist '&a use_soil_moisture_streams = T/'", - "-bgc cn -use_case 1850-2100_SSP5-8.5_transient -namelist '&a start_ymd=19101023/'", + "-bgc bgc -use_case 1850-2100_SSP5-8.5_transient -namelist '&a start_ymd=19101023/'", "-bgc bgc -use_case 2000_control -namelist \"&a fire_method='nofire'/\" -crop", + "-res 0.9x1.25 -bgc sp -use_case 1850_noanthro_control -drydep -fire_emis", "-res 0.9x1.25 -bgc bgc -use_case 1850_noanthro_control -drydep -fire_emis -light_res 360x720", ) { my $file = $startfile; @@ -480,7 +493,7 @@ sub cat_and_create_namelistinfile { my $finidat = "thing.nc"; system( "touch $finidat" ); -my %failtest = ( +my %failtest = ( "coldstart but with IC file"=>{ options=>"-clm_start_type cold -envxml_dir .", namelst=>"finidat='$finidat'", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -516,6 +529,16 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, + "decomp_without_cn" =>{ options=>" -envxml_dir . -bgc sp", + namelst=>"soil_decomp_method='CENTURYKoven2013'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, + "bgc_with_no_decomp" =>{ options=>" -envxml_dir . -bgc bgc", + namelst=>"soil_decomp_method='None'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, "reseed without CN" =>{ options=>" -envxml_dir . -bgc sp", namelst=>"reseed_dead_plants=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -531,7 +554,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "dribble_crphrv w/o crop" =>{ options=>" -envxml_dir . -bgc cn -no-crop", + "dribble_crphrv w/o crop" =>{ options=>" -envxml_dir . -bgc bgc -no-crop", namelst=>"dribble_crophrv_xsmrpool_2atm=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", @@ -541,12 +564,12 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, - "use_cndv=T without bldnml op"=>{ options=>"-bgc cn -envxml_dir . -ignore_warnings", + "use_cndv=T without bldnml op"=>{ options=>"-bgc bgc -envxml_dir . -ignore_warnings", namelst=>"use_cndv=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, - "use_cndv=F with dyn_veg op"=>{ options=>"-bgc cn -dynamic_vegetation -envxml_dir . -ignore_warnings", + "use_cndv=F with dyn_veg op"=>{ options=>"-bgc bgc -dynamic_vegetation -envxml_dir . -ignore_warnings", namelst=>"use_cndv=.false.", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", @@ -582,7 +605,7 @@ sub cat_and_create_namelistinfile { phys=>"clm5_0", }, "toosmall glc w trans" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"toosmall_glacier=10, dyn_transient_pfts=T", + namelst=>"toosmall_glacier=10, dyn_transient_pfts=T", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, @@ -616,13 +639,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - # This one should fail now, because we don't have non irrigated non-crop datasets - "-irrigate=F without -crop" =>{ options=>"-bgc cn -no-crop -envxml_dir .", - namelst=>"irrigate=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm4_5", - }, - "grainproductWOcrop" =>{ options=>"-bgc cn -no-crop -envxml_dir .", + "grainproductWOcrop" =>{ options=>"-bgc bgc -no-crop -envxml_dir .", namelst=>"use_grainproduct=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", @@ -672,7 +689,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "lightres no fire" =>{ options=>"-bgc cn -envxml_dir . -light_res 360x720", + "lightres no fire" =>{ options=>"-bgc bgc -envxml_dir . -light_res 360x720", namelst=>"fire_method='nofire'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", @@ -697,21 +714,11 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "bgc=cn and bgc settings" =>{ options=>"-bgc cn -envxml_dir .", - namelst=>"use_lch4=.true.,use_nitrif_denitrif=.true.,use_vertsoilc=.true.,use_century_decomp=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm4_5", - }, - "finundated and not methane"=>{ options=>"-bgc cn -envxml_dir .", + "finundated and not methane"=>{ options=>"-bgc bgc -envxml_dir .", namelst=>"use_lch4=.false.,finundation_method='h2osfc'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "bgc=bgc and cn-only set" =>{ options=>"-bgc bgc -envxml_dir .", - namelst=>"use_lch4=.false.,use_nitrif_denitrif=.false.,use_vertsoilc=.false.,use_century_decomp=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm4_5", - }, "use_cn=true bgc=sp" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"use_cn=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -722,7 +729,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, - "use_cn=false bgc=cn" =>{ options=>"-bgc cn -envxml_dir .", + "use_cn=false bgc=bgc" =>{ options=>"-bgc bgc -envxml_dir .", namelst=>"use_cn=.false.", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", @@ -872,11 +879,31 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "both lnd_frac and on nml" =>{ options=>"-lnd_frac domain.nc -envxml_dir .", + "both lnd_frac and on nml" =>{ options=>"-driver mct -lnd_frac domain.nc -envxml_dir .", namelst=>"fatmlndfrc='frac.nc'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, + "lnd_frac set to UNSET" =>{ options=>"-driver mct -lnd_frac UNSET -envxml_dir .", + namelst=>"", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, + "lnd_frac set but nuopc" =>{ options=>"-driver nuopc -lnd_frac domain.nc -envxml_dir .", + namelst=>"", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, + "lnd_frac not set but lilac"=>{ options=>"-driver nuopc -lilac -envxml_dir . -lnd_frac UNSET", + namelst=>"fsurdat='surfdata.nc'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, + "fatmlndfrc set but nuopc" =>{ options=>"-driver nuopc -envxml_dir .", + namelst=>"fatmlndfrc='frac.nc'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, "branch but NO nrevsn" =>{ options=>"-clm_start_type branch -envxml_dir .", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -912,6 +939,11 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, + "useFATESWcrop" =>{ options=>"-bgc fates -envxml_dir . -no-megan -crop", + namelst=>"", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, "useFATESWcreatecrop" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"create_crop_landunit=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -938,7 +970,7 @@ sub cat_and_create_namelistinfile { phys=>"clm5_0", }, "usespitfireButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", - namelst=>"fates_spitfire_mode>0", + namelst=>"fates_spitfire_mode=1", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, @@ -962,6 +994,16 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, + "useFATESSPWONOCOMP" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_sp=T,use_fates_nocomp=F", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, + "useFATESTRANSWdynPFT" =>{ options=>"-bgc fates -envxml_dir . -use_case 20thC_transient -no-megan", + namelst=>"do_transient_pfts=T", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, "useHYDSTwithFATES" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_hydrstress=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -1047,6 +1089,11 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, + "SPModeWNitrifNMethane" =>{ options=>"-envxml_dir . -bgc sp", + namelst=>"use_lch4=.true., use_nitrif_denitrif=.true.", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, "knitrmaxWOnitrif" =>{ options=>"-envxml_dir . -bgc bgc", namelst=>"use_nitrif_denitrif=.false., k_nitr_max=1.0", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -1101,7 +1148,7 @@ sub cat_and_create_namelistinfile { # Warning testing, do things that give warnings, unless -ignore_warnings option is used -my %warntest = ( +my %warntest = ( # Warnings without the -ignore_warnings option given "coldwfinidat" =>{ options=>"-envxml_dir . -clm_start_type cold", namelst=>"finidat = 'testfile.nc'", @@ -1113,15 +1160,15 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "use_c13_wo_bgc" =>{ options=>"-envxml_dir . -bgc cn", - namelst=>"use_c13=.true.", + "bgc=bgc WO nitrif_denit" =>{ options=>"-bgc bgc -envxml_dir .", + namelst=>"use_nitrif_denitrif=.false.", GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_0", + phys=>"clm4_5", }, - "use_c14_wo_bgc" =>{ options=>"-envxml_dir . -bgc cn", - namelst=>"use_c14=.true.", + "methane off W nitrif_denit"=>{ options=>"-bgc bgc -envxml_dir .", + namelst=>"use_nitrif_denitrif=.true.,use_lch4=.false.", GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_0", + phys=>"clm5_1", }, "soilm_stream w transient" =>{ options=>"-res 0.9x1.25 -envxml_dir . -use_case 20thC_transient", namelst=>"use_soil_moisture_streams=T,soilm_tintalgo='linear'", @@ -1138,6 +1185,11 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, + "FUN_wo_flexCN" =>{ options=>"-envxml_dir . -bgc bgc", + namelst=>"use_fun=.true.,use_flexiblecn=.false.", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, ); foreach my $key ( keys(%warntest) ) { print( "$key\n" ); @@ -1183,7 +1235,6 @@ sub cat_and_create_namelistinfile { # Resolutions for mksurfdata mapping } elsif ( $res eq "0.5x0.5" || $res eq "0.25x0.25" || - $res eq "0.1x0.1" || $res eq "3x3min" || $res eq "5x5min" || $res eq "10x10min" || @@ -1442,7 +1493,7 @@ sub cat_and_create_namelistinfile { my $mode = "-phys $phys"; &make_config_cache($phys); my @clmoptions = ( "-bgc bgc -envxml_dir .", "-bgc bgc -envxml_dir . -clm_accelerated_spinup=on", "-bgc bgc -envxml_dir . -light_res 360x720", - "-bgc sp -envxml_dir . -vichydro", "-bgc bgc -dynamic_vegetation -ignore_warnings", + "-bgc sp -envxml_dir . -vichydro", "-bgc bgc -dynamic_vegetation -ignore_warnings", "-bgc bgc -clm_demand flanduse_timeseries -sim_year 1850-2000 -namelist '&a start_ymd=18500101/'", "-bgc bgc -envxml_dir . -namelist '&a use_c13=.true.,use_c14=.true.,use_c14_bombspike=.true./'" ); foreach my $clmopts ( @clmoptions ) { @@ -1464,7 +1515,7 @@ sub cat_and_create_namelistinfile { &cleanup(); } } - my @clmoptions = ( "-bgc bgc -envxml_dir .", + my @clmoptions = ( "-bgc bgc -envxml_dir .", "-bgc sp -envxml_dir .", ); foreach my $clmopts ( @clmoptions ) { my @clmres = ( "ne16np4" ); @@ -1485,9 +1536,9 @@ sub cat_and_create_namelistinfile { &cleanup(); } } - my $clmopts = "-bgc cn -crop"; + my $clmopts = "-bgc bgc -crop"; my $res = "1.9x2.5"; - $options = "-res $res -namelist '&a irrigate=.true./' -crop -bgc cn -envxml_dir ."; + $options = "-res $res -namelist '&a irrigate=.true./' -crop -envxml_dir ."; &make_env_run(); eval{ system( "$bldnml $options $clmopts > $tempfile 2>&1 " ); }; is( $@, '', "$options $clmopts" ); @@ -1506,11 +1557,11 @@ sub cat_and_create_namelistinfile { my @clmres = ( "1x1_brazil", "5x5_amazon", "4x5", "1.9x2.5" ); foreach my $res ( @clmres ) { $options = "-res $res -clm_start_type cold"; - my @edoptions = ( "-use_case 2000_control", - "-use_case 1850_control", - "", - "-namelist \"&a use_lch4=.true.,use_nitrif_denitrif=.true./\"", - "-clm_accelerated_spinup on" + my @edoptions = ( "-use_case 2000_control", + "-use_case 1850_control", + "", + "-namelist \"&a use_lch4=.true.,use_nitrif_denitrif=.true./\"", + "-clm_accelerated_spinup on" ); foreach my $edop (@edoptions ) { if ( $res eq "5x5_amazon" && ($edop =~ /1850_control/) ) { diff --git a/cime_config/buildlib b/cime_config/buildlib index 9b9b7da78f..1ed64ca236 100755 --- a/cime_config/buildlib +++ b/cime_config/buildlib @@ -167,4 +167,6 @@ def _main_func(): ############################################################################### if __name__ == "__main__": + logger.warning( "WARNING: buildlib is being called as a program rather than a subroutine as " + + "it is expected to be in the CESM context" ) _main_func() diff --git a/cime_config/buildnml b/cime_config/buildnml index e3f6a5b933..7ed70b5ffd 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -32,7 +32,7 @@ def buildnml(case, caseroot, compname): ############################################################################### """Build the CTSM namelist """ - # Build the component namelist + # Build the component namelist if compname != "ctsm" and compname != "clm": raise AttributeError @@ -73,10 +73,10 @@ def buildnml(case, caseroot, compname): os.makedirs(ctsmconf) # ----------------------------------------------------- - # Create config_cache.xml file + # Create config_cache.xml file # ----------------------------------------------------- - # Note that build-namelist utilizes the contents of the config_cache.xml file in + # Note that build-namelist utilizes the contents of the config_cache.xml file in # the namelist_defaults.xml file to obtain namelist variables clm_phys = case.get_value("CLM_PHYSICS_VERSION") @@ -159,15 +159,19 @@ def buildnml(case, caseroot, compname): ignore = "-ignore_ic_date" tuning = "-lnd_tuning_mode %s "%lnd_tuning_mode - + spinup = "-clm_accelerated_spinup %s "%clm_accelerated_spinup - + infile = os.path.join(ctsmconf, "namelist") - + inputdata_file = os.path.join(caseroot,"Buildconf","ctsm.input_data_list") - - lndfrac_file = os.path.join(lnd_domain_path,lnd_domain_file) - + + if driver == "nuopc": + lndfrac_setting = " " + else: + lndfrac_file = os.path.join(lnd_domain_path,lnd_domain_file) + lndfrac_setting = "-lnd_frac "+lndfrac_file + config_cache_file = os.path.join(caseroot,"Buildconf", compname+"conf","config_cache.xml") # ----------------------------------------------------- @@ -191,7 +195,7 @@ def buildnml(case, caseroot, compname): # If multi-instance case does not have restart file, use # single-case restart for each instance - rpointer = "rpointer.lnd" + rpointer = "rpointer.lnd" if (os.path.isfile(os.path.join(rundir,rpointer)) and (not os.path.isfile(os.path.join(rundir,rpointer + inst_string)))): shutil.copy(os.path.join(rundir, rpointer), @@ -232,12 +236,12 @@ def buildnml(case, caseroot, compname): command = ("%s -cimeroot %s -infile %s -csmdata %s -inputdata %s %s -namelist \"&clm_inparm start_ymd=%s %s/ \" " "%s %s -res %s %s -clm_start_type %s -envxml_dir %s " "-configuration %s -structure %s " - "-lnd_frac %s -glc_nec %s %s -co2_ppmv %s -co2_type %s -config %s -driver %s " + "%s -glc_nec %s %s -co2_ppmv %s -co2_type %s -config %s -driver %s " "%s %s %s %s" - %(cmd, _CIMEROOT, infile, din_loc_root, inputdata_file, ignore, start_ymd, clm_namelist_opts, + %(cmd, _CIMEROOT, infile, din_loc_root, inputdata_file, ignore, start_ymd, clm_namelist_opts, nomeg, usecase, lnd_grid, clmusr, start_type, caseroot, configuration, structure, - lndfrac_file, glc_nec, glc_use_antarctica_flag, ccsm_co2_ppmv, clm_co2_type, config_cache_file, driver, + lndfrac_setting, glc_nec, glc_use_antarctica_flag, ccsm_co2_ppmv, clm_co2_type, config_cache_file, driver, clm_bldnml_opts, spinup, tuning, gridmask)) rc, out, err = run_cmd(command, from_dir=ctsmconf) @@ -265,6 +269,8 @@ def _main_func(): caseroot = parse_input(sys.argv) with Case(caseroot) as case: compname = case.get_value("COMP_LND") + logger.warning( "WARNING: buildnml is being called a s program rather than a subroutine " + + "as it is expected to be in the CESM context" ) buildnml(case, caseroot, compname) if __name__ == "__main__": diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index f1a57c8da0..f6637cd964 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -14,14 +14,10 @@ - clm4.5: - clm5.0: + clm4.5: + clm5.0: clm5.1: Satellite phenology: - CN: Carbon Nitrogen model - CNDV: CN with Dynamic Vegetation (deprecated) - CN with prognostic crop: - CNDV with prognostic crop: (deprecated) Satellite phenology with VIC hydrology: Satellite phenology without anthropomorphic influences @@ -168,34 +164,21 @@ char - -bgc sp - -bgc cn - -bgc bgc - -bgc cn -crop - -bgc bgc -crop - -bgc cn -dynamic_vegetation + + -bgc sp + -bgc bgc + -bgc bgc -crop + -bgc fates -no-megan + + -bgc bgc -dynamic_vegetation - -bgc cn -dynamic_vegetation -crop -bgc bgc -dynamic_vegetation -crop -bgc sp -vichydro - -bgc fates -no-megan - -bgc sp - -bgc bgc + -bgc bgc -dynamic_vegetation - -bgc bgc -crop - -bgc cn - -bgc cn -crop - -bgc cn -dynamic_vegetation - -bgc cn -dynamic_vegetation -crop -bgc bgc -dynamic_vegetation -crop -bgc sp -vichydro - -bgc fates -no-megan - - -bgc sp - -bgc bgc - -bgc bgc -crop - -bgc fates -no-megan run_component_ctsm env_run.xml diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 421b4d5035..0cf6d01830 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -128,11 +128,6 @@ - - I2000Clm50Cn - 2000_DATM%GSWP3v1_CLM50%CN_SICE_SOCN_MOSART_SGLC_SWAV - - I1850Clm50Sp 1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV @@ -468,11 +463,6 @@ 2000_DATM%GSWP3v1_CLM45%FATES_SICE_SOCN_SROF_SGLC_SWAV - - I1850Clm45Cn - 1850_DATM%GSWP3v1_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV - - I1850Clm45Bgc 1850_DATM%GSWP3v1_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV @@ -518,6 +508,11 @@ 1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%GRIS-EVOLVE_SWAV + + I1850Clm50SpGa + 1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%AIS-EVOLVE_SWAV + + IHistClm50SpG HIST_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%GRIS-EVOLVE_SWAV diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index f0e7ac509b..1ae6bc7640 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -36,18 +36,11 @@ ESCOMP/CMEPS#175 - - - - FAIL - ESMCI/cime#3915 - - - - - - FAIL - ESMCI/cime#3915 + + + + PEND + ESCOMP/CMEPS#175 @@ -58,106 +51,8 @@ - - - FAIL - #1317 - - - - - - FAIL - #1356 - - - - - - FAIL - #1356 - - - - - - FAIL - #1356 - - - - - - FAIL - #1356 - - - - - - FAIL - #1356 - - - - - - FAIL - #1356 - - - - - - FAIL - #1356 - - - - - - FAIL - NGEET/fates#315 - - - - - - FAIL - NGEET/fates#315 - - - - - - FAIL - NGEET/fates#315 - - - - - - FAIL - NGEET/fates#315 - - - - - - FAIL - NGEET/fates#315 - - - - - - FAIL - NGEET/fates#510 - - - FAIL @@ -165,60 +60,25 @@ - - - FAIL - NGEET/fates#508 - - - - - - FAIL - NGEET/fates#315 - - - - - - FAIL - NGEET/fates#315 - - - - - - FAIL - NGEET/fates#315 - - - - - - FAIL - NGEET/fates#315 - - - - + FAIL #667 - - + + FAIL #667 - + FAIL - #667 + #1485 - + diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 9d37f60c48..6965086779 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -17,15 +17,6 @@ - - - - - - - - - @@ -380,20 +371,13 @@ - - - - - - - - - + + @@ -527,7 +511,7 @@ - + @@ -535,14 +519,6 @@ - - - - - - - - @@ -638,7 +614,7 @@ - + @@ -825,14 +801,6 @@ - - - - - - - - @@ -850,16 +818,6 @@ - - - - - - - - - - @@ -1018,7 +976,7 @@ - + @@ -1432,7 +1390,7 @@ - @@ -1501,15 +1459,6 @@ - - - - - - - - - @@ -1520,15 +1469,6 @@ - - - - - - - - - @@ -1680,9 +1620,8 @@ - + - @@ -1933,15 +1872,6 @@ - - - - - - - - - @@ -1976,15 +1906,6 @@ - - - - - - - - - @@ -1996,24 +1917,7 @@ - - - - - - - - - - - - - - - - - - + @@ -2025,22 +1929,24 @@ + - + + - + @@ -2048,17 +1954,18 @@ - + + - + @@ -2067,108 +1974,116 @@ - + - + + - + - - + - + + - + - + - - - - + + - - + - + - + - + - + + - + + + + - + + - + + - + + - + - + - + + - + + - + + @@ -2251,9 +2166,10 @@ - + + @@ -2269,10 +2185,9 @@ - + - @@ -2280,10 +2195,9 @@ - + - @@ -2291,7 +2205,7 @@ - + @@ -2302,10 +2216,21 @@ - + + + + + + + + + + + + @@ -2323,7 +2248,7 @@ - + @@ -2334,7 +2259,7 @@ - + @@ -2346,7 +2271,7 @@ - + @@ -2356,7 +2281,7 @@ - + @@ -2377,10 +2302,9 @@ - + - @@ -2388,7 +2312,7 @@ - + @@ -2398,10 +2322,9 @@ - + - @@ -2409,7 +2332,7 @@ - + @@ -2418,18 +2341,45 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -2438,18 +2388,18 @@ - + - + - + @@ -2459,7 +2409,7 @@ - + @@ -2469,7 +2419,7 @@ - + @@ -2520,7 +2470,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands index fe7182b67f..41a2342a51 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands @@ -1,3 +1,2 @@ ./xmlchange CLM_BLDNML_OPTS="-no-megan" --append ./xmlchange BFBFLAG="TRUE" -./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index 90a188bdb1..cbf6c1b7c4 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -3,11 +3,92 @@ hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .true. fates_spitfire_mode = 1 -hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN_ELEM','LITTER_OUT_ELEM', - 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','FIRE_FUEL_MEF', - 'FIRE_FUEL_BULKD','FIRE_FUEL_SAV','FIRE_NESTEROV_INDEX','PFTbiomass', - 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR','NPLANT_SCAG','NPLANT_SCPF', - 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN', - 'LITTER_FINES_AG_ELEM','LITTER_FINES_BG_ELEM','LITTER_CWD_AG_ELEM','LITTER_CWD_BG_ELEM', - 'SEED_BANK' +hist_fincl1 = 'ED_NPATCHES', +'ED_NCOHORTS', +'TRIMMING', +'AREA_PLANT', +'AREA_TREES', +'SITE_COLD_STATUS', +'SITE_DROUGHT_STATUS', +'SITE_GDD', +'SITE_NCHILLDAYS', +'SITE_NCOLDDAYS', +'SITE_DAYSINCE_COLDLEAFOFF', +'SITE_DAYSINCE_COLDLEAFON', +'SITE_DAYSINCE_DROUGHTLEAFOFF', +'SITE_DAYSINCE_DROUGHTLEAFON', +'SITE_MEANLIQVOL_DROUGHTPHEN', +'CANOPY_SPREAD', +'FIRE_NESTEROV_INDEX', +'FIRE_IGNITIONS', +'FIRE_FDI', +'FIRE_ROS', +'FIRE_ROS_AREA_PRODUCT', +'EFFECT_WSPEED', +'FIRE_TFC_ROS', +'FIRE_TFC_ROS_AREA_PRODUCT', +'FIRE_INTENSITY', +'FIRE_INTENSITY_AREA_PRODUCT', +'FIRE_AREA', +'FIRE_FUEL_MEF', +'FIRE_FUEL_BULKD', +'FIRE_FUEL_EFF_MOIST', +'FIRE_FUEL_SAV', +'SUM_FUEL', +'LITTER_IN', +'LITTER_OUT', +'SEED_BANK', +'SEEDS_IN', +'STOREC', +'TOTVEGC', +'SAPWC', +'LEAFC', +'FNRTC', +'REPROC', +'CEFFLUX', +'ED_bstore', +'ED_bdead', +'ED_balive', +'ED_bleaf', +'ED_bsapwood', +'ED_bfineroot', +'ED_biomass', +'AGB', +'BIOMASS_CANOPY', +'BIOMASS_UNDERSTORY', +'PRIMARYLAND_PATCHFUSION_ERROR', +'DISTURBANCE_RATE_P2P', +'DISTURBANCE_RATE_P2S', +'DISTURBANCE_RATE_S2S', +'DISTURBANCE_RATE_FIRE', +'DISTURBANCE_RATE_LOGGING', +'DISTURBANCE_RATE_TREEFALL', +'DISTURBANCE_RATE_POTENTIAL', +'HARVEST_CARBON_FLUX', +'C_STOMATA', +'C_LBLAYER', +'NPP', +'GPP', +'AR', +'GROWTH_RESP', +'MAINT_RESP', +'GPP_CANOPY', +'AR_CANOPY', +'GPP_UNDERSTORY', +'AR_UNDERSTORY', +'DEMOTION_CARBONFLUX', +'PROMOTION_CARBONFLUX', +'MORTALITY_CARBONFLUX_CANOPY', +'MORTALITY_CARBONFLUX_UNDERSTORY', +'NEP', +'FATES_HR', +'Fire_Closs', +'FIRE_FLUX', +'CBALANCE_ERROR_FATES', +'ERROR_FATES', +'NPP_LEAF', +'NPP_SEED', +'NPP_STEM', +'NPP_FROOT', +'NPP_CROOT', +'NPP_STOR' \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands deleted file mode 100644 index 2a9f09bd75..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm deleted file mode 100644 index c092059cea..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm +++ /dev/null @@ -1,10 +0,0 @@ -hist_mfilt = 365 -hist_nhtfrq = -24 -hist_empty_htapes = .true. -fates_spitfire_mode = 1 -hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', - 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','FIRE_FUEL_MEF', - 'FIRE_FUEL_BULKD','FIRE_FUEL_SAV','FIRE_NESTEROV_INDEX','PFTbiomass', - 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR','NPLANT_SCAG','NPLANT_SCPF', - 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefAllVars/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefAllVars/shell_commands new file mode 100644 index 0000000000..20db712f77 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefAllVars/shell_commands @@ -0,0 +1,3 @@ +./xmlchange CLM_BLDNML_OPTS="-no-megan" --append +./xmlchange BFBFLAG="TRUE" +./xmlchange CLM_FORCE_COLDSTART="on" \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefAllVars/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefAllVars/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/README b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/README new file mode 100644 index 0000000000..299d5cf468 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/README @@ -0,0 +1,2 @@ +This test mod outputs an optional text file containing a table of the +history fields master list. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/user_nl_clm index 10ce93bcd1..b01aafeef5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefCH4/user_nl_clm @@ -1 +1,2 @@ use_lch4 = .true. +hist_master_list_file = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefHydro/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefHydro/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefHydro/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefHydro/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefLandUse/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefLandUse/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefLandUse/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefLandUse/user_nl_clm new file mode 100644 index 0000000000..098d4fd33a --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefLandUse/user_nl_clm @@ -0,0 +1,2 @@ +flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_simyr1850-2015_200311.nc' +do_harvest = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefLogging/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefLogging/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefLogging/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefLogging/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefNoFire/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefNoFire/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefNoFire/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefNoFire/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesReducedComplexFixedBiogeo/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefPPhys/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesReducedComplexFixedBiogeo/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefPPhys/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefPPhys/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefPPhys/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefPRT2/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefPRT2/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefPRT2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefPRT2/user_nl_clm new file mode 100644 index 0000000000..bde61cee2e --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefPRT2/user_nl_clm @@ -0,0 +1 @@ +fates_parteh_mode = 2 \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSizeAgeMort/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexFixedBiogeo/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesSizeAgeMort/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexFixedBiogeo/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexFixedBiogeo/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexFixedBiogeo/user_nl_clm new file mode 100644 index 0000000000..ffcc5dd2f5 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexFixedBiogeo/user_nl_clm @@ -0,0 +1 @@ +use_fates_fixed_biogeog=.true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexNoComp/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexNoComp/include_user_mods new file mode 100644 index 0000000000..1f2c03aebe --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexNoComp/include_user_mods @@ -0,0 +1 @@ +../FatesColdDef diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexNoComp/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexNoComp/user_nl_clm new file mode 100644 index 0000000000..ca1d1f88b0 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexNoComp/user_nl_clm @@ -0,0 +1 @@ +use_fates_nocomp = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexSatPhen/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexSatPhen/include_user_mods new file mode 100644 index 0000000000..1f2c03aebe --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexSatPhen/include_user_mods @@ -0,0 +1 @@ +../FatesColdDef diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexSatPhen/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexSatPhen/user_nl_clm new file mode 100644 index 0000000000..5ae85742ed --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefReducedComplexSatPhen/user_nl_clm @@ -0,0 +1,2 @@ +use_fates_sp = .true. +fates_spitfire_mode = 0 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefST3/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefST3/include_user_mods new file mode 100644 index 0000000000..1f2c03aebe --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefST3/include_user_mods @@ -0,0 +1 @@ +../FatesColdDef diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefST3/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefST3/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDefSizeAgeMort/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefSizeAgeMort/include_user_mods new file mode 100644 index 0000000000..1f2c03aebe --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefSizeAgeMort/include_user_mods @@ -0,0 +1 @@ +../FatesColdDef diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSizeAgeMort/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDefSizeAgeMort/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesSizeAgeMort/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdDefSizeAgeMort/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates_nat_and_anthro_ignitions/README b/cime_config/testdefs/testmods_dirs/clm/FatesFireLightningPopDens/README similarity index 97% rename from cime_config/testdefs/testmods_dirs/clm/Fates_nat_and_anthro_ignitions/README rename to cime_config/testdefs/testmods_dirs/clm/FatesFireLightningPopDens/README index 3bd8c7dd62..8acea69aa4 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates_nat_and_anthro_ignitions/README +++ b/cime_config/testdefs/testmods_dirs/clm/FatesFireLightningPopDens/README @@ -16,7 +16,6 @@ dataset for California that has not been placed in the repository of CTSM datasets as of 2020/6/6. That dataset can be used with the following settings: -fire_method = 'spitfire' fates_spitfire_mode = 3 stream_fldfilename_lightng = '.../data_UCB/observed/CA_monthly_ignition_number_1980-2016/ignition_1980_to_2016_monthly_20190801.nc' stream_year_first_lightng = 1980 diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates_nat_and_anthro_ignitions/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesFireLightningPopDens/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/Fates_nat_and_anthro_ignitions/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesFireLightningPopDens/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesHydro/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesHydro/shell_commands deleted file mode 100644 index 2a9f09bd75..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesHydro/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesPRT2/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesPRT2/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesPRT2/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesPRT2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesPRT2/user_nl_clm deleted file mode 100644 index 400fa7cfd4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesPRT2/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ -hist_mfilt = 365 -hist_nhtfrq = -24 -hist_empty_htapes = .false. -fates_parteh_mode = 2 -fates_spitfire_mode = 1 \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesReducedComplexFixedBiogeo/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesReducedComplexFixedBiogeo/user_nl_clm deleted file mode 100644 index d3349780e0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesReducedComplexFixedBiogeo/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -use_fates_fixed_biogeog=.true. \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/NEON_NIWO/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/NEON_NIWO/include_user_mods deleted file mode 100644 index 56aab07c3e..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/NEON_NIWO/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../../../../usermods_dirs/NEON/NIWO diff --git a/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/user_nl_clm deleted file mode 100644 index f225dede82..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/user_nl_clm +++ /dev/null @@ -1,4 +0,0 @@ - anoxia = .true. - use_vertsoilc = .false. - use_nitrif_denitrif = .false. - hist_wrtch4diag = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/anoxia/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/anoxia/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/rootlit/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/anoxia/user_nl_clm similarity index 65% rename from cime_config/testdefs/testmods_dirs/clm/rootlit/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/anoxia/user_nl_clm index 53d20a3a97..0f30b7f5f3 100644 --- a/cime_config/testdefs/testmods_dirs/clm/rootlit/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/anoxia/user_nl_clm @@ -1,3 +1,2 @@ - use_vertsoilc = .false. anoxia = .true. hist_wrtch4diag = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm index 7f8887875c..b7672df8ca 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm @@ -1,2 +1,2 @@ -paramfile = '/glade/p/cesm/cseg/inputdata/lnd/clm2/paramdata/ctsm51_params.c210624.nc' +paramfile = '/glade/p/cesm/cseg/inputdata/lnd/clm2/paramdata/ctsm51_params.c210827.nc' hist_fincl1 = 'CWDC_HR','C13_CWDC_HR','C14_CWDC_HR','CWD_HR_L2','CWD_HR_L2_vr','CWD_HR_L3','CWD_HR_L3_vr' diff --git a/cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm index e113c389ce..12fd0b0d53 100644 --- a/cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm @@ -1,4 +1,3 @@ - wrtdia = .true. hist_dov2xy = .true.,.false. ! Even though only 2 history tapes are defined here, set ndens to 1 for up to 6 history ! tapes, for the sake of mods that extend these default mods and may add other history tapes diff --git a/cime_config/testdefs/testmods_dirs/clm/extra_outputs/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/extra_outputs/user_nl_clm index 6d1167fc39..6dc5225f1d 100644 --- a/cime_config/testdefs/testmods_dirs/clm/extra_outputs/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/extra_outputs/user_nl_clm @@ -1,2 +1,6 @@ calc_human_stress_indices = 'ALL' hist_master_list_file = .true. + +hist_fincl1 += 'GSSUN:L43200', 'GSSHA:L43200', 'FSDSND:L43200', 'FSRND:L43200', 'FSRSFND:L43200', + 'SSRE_FSRND:L43200', 'FSDSVD:L43200', 'FSDSVI:L43200', + 'FSRVD:L43200', 'FSRSFVD:L43200', 'SSRE_FSRVD:L43200' diff --git a/cime_config/testdefs/testmods_dirs/clm/fatesFire/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/fatesFire/include_user_mods deleted file mode 100644 index fb35ec8c90..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/fatesFire/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../fates diff --git a/cime_config/testdefs/testmods_dirs/clm/fatesFire/shell_commands b/cime_config/testdefs/testmods_dirs/clm/fatesFire/shell_commands deleted file mode 100644 index d81ed7dbc5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/fatesFire/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange CLM_BLDNML_OPTS="-no-megan" --append diff --git a/cime_config/testdefs/testmods_dirs/clm/fatesFire/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/fatesFire/user_nl_clm deleted file mode 100644 index 265f4c5406..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/fatesFire/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ -fates_spitfire_mode = 1 - diff --git a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/README b/cime_config/testdefs/testmods_dirs/clm/irrig_o3falk_reduceOutput/README similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/README rename to cime_config/testdefs/testmods_dirs/clm/irrig_o3falk_reduceOutput/README diff --git a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/irrig_o3falk_reduceOutput/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/irrig_o3falk_reduceOutput/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/irrig_o3falk_reduceOutput/user_nl_clm similarity index 87% rename from cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/irrig_o3falk_reduceOutput/user_nl_clm index 937cd64717..3ac6a15d3e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/irrig_o3falk_reduceOutput/user_nl_clm @@ -1,6 +1,6 @@ ! explicitly include stuff needed for o3 here rather than including the o3 directory, ! since the o3 directory includes default, and we don't want that for this ! reducedOutput testmod -use_ozone = .true. +o3_veg_stress_method = 'stress_falk' hist_fincl1 += 'O3UPTAKESUN', 'O3UPTAKESHA' hist_fincl2 += 'O3UPTAKESUN', 'O3UPTAKESHA' diff --git a/cime_config/testdefs/testmods_dirs/clm/luna/shell_commands b/cime_config/testdefs/testmods_dirs/clm/luna/shell_commands new file mode 100644 index 0000000000..f0547f3f26 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/luna/shell_commands @@ -0,0 +1,3 @@ +#!/bin/bash + +./xmlchange CLM_BLDNML_OPTS="-ignore_warnings" --append diff --git a/cime_config/testdefs/testmods_dirs/clm/nofire/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/nofire/user_nl_clm index e6e4f8f843..20becb95da 100644 --- a/cime_config/testdefs/testmods_dirs/clm/nofire/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/nofire/user_nl_clm @@ -1,4 +1,3 @@ - wrtdia = .true. hist_dov2xy = .true.,.false. ! Even though only 2 history tapes are defined here, set ndens to 1 for up to 6 history ! tapes, for the sake of mods that extend these default mods and may add other history tapes diff --git a/cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm deleted file mode 100644 index a80360aaa0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - use_ozone = .true. - hist_fincl2 += 'O3UPTAKESUN', 'O3UPTAKESHA' diff --git a/cime_config/testdefs/testmods_dirs/clm/o3/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/o3/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/user_nl_clm new file mode 100644 index 0000000000..3a7ef0558f --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/user_nl_clm @@ -0,0 +1,2 @@ + o3_veg_stress_method = 'stress_lombardozzi2015' + hist_fincl2 += 'O3UPTAKESUN', 'O3UPTAKESHA' diff --git a/cime_config/testdefs/testmods_dirs/clm/rootlit/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/rootlit/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/rootlit/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/shell_commands b/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/shell_commands new file mode 100644 index 0000000000..92d856873f --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/shell_commands @@ -0,0 +1,4 @@ +#!/bin/bash + +./xmlchange CLM_BLDNML_OPTS=-ignore_warnings --append + diff --git a/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm index b85d0ba6c1..923abcdaec 100644 --- a/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm @@ -6,7 +6,3 @@ do_transient_lakes = .true. ! PCT_CROP is also changed so that PCT_LAKE + PCT_CROP <= 100. (Here, PCT_CROP increases and decreases at the same time as PCT_LAKE in order to exercise the simultaneous increase or decrease of two landunits, but that isn't a critical part of this test.) ! Note that the use of this file means that this testmod can only be used with the 1x1_smallvilleIA grid. flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_dynLakes_c200928.nc' - -! BUG(wjs, 2020-09-25, ESCOMP/CTSM#43) Dynamic lakes don't work when methane is active, -! so for now disable methane for this test. -use_lch4 = .false. diff --git a/cime_config/usermods_dirs/NEON/defaults/user_nl_clm b/cime_config/usermods_dirs/NEON/defaults/user_nl_clm index 01db7d0380..742cd6f65e 100644 --- a/cime_config/usermods_dirs/NEON/defaults/user_nl_clm +++ b/cime_config/usermods_dirs/NEON/defaults/user_nl_clm @@ -19,7 +19,7 @@ !---------------------------------------------------------------------------------- flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets -fsurdat = "$DIN_LOC_ROOT/lnd/clm2/surfdata_map/NEON/surfdata_hist_16pfts_Irrig_CMIP6_simyr2000_${NEONSITE}_c210513.nc" +fsurdat = "$DIN_LOC_ROOT/lnd/clm2/surfdata_map/NEON/surfdata_hist_78pfts_CMIP6_simyr2000_${NEONSITE}_c210720.nc" model_year_align_urbantv = 2018 stream_year_first_urbantv = 2018 stream_year_last_urbantv = 2019 @@ -29,3 +29,9 @@ stream_year_last_ndep = 2019 model_year_align_popdens = 2018 stream_year_first_popdens = 2018 stream_year_last_popdens = 2019 +stream_fldfilename_lightng = '$DIN_LOC_ROOT/atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_NEONarea_c210625.nc' +! h1 output stream +hist_fincl2 = 'AR','ELAI','FCEV','FCTR','FGEV','FIRA','FSA','FSH','GPP','H2OSOI', + 'HR','SNOW_DEPTH','TBOT','TSOI','SOILC_vr','FV','NET_NMIN_vr' +hist_mfilt(2) = 48 +hist_nhtfrq(2) = 1 diff --git a/cime_config/usermods_dirs/output_bgc/user_nl_clm b/cime_config/usermods_dirs/output_bgc/user_nl_clm index 0c0bcd52ff..f7aaa09911 100644 --- a/cime_config/usermods_dirs/output_bgc/user_nl_clm +++ b/cime_config/usermods_dirs/output_bgc/user_nl_clm @@ -3,8 +3,8 @@ !---------------------------------------------------------------------------------- ! h0 stream (monthly average, gridcell-level) -hist_fexcl1 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'SOILC_vr','SOILN_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr', 'CWDN_vr', 'SMIN_NO3_vr', 'CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr' -hist_fincl1 += 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', 'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH' +hist_fexcl1 += 'ACT_SOMC_vr', 'ACT_SOMN_vr', 'SLO_SOMC_vr', 'SLO_SOMN_vr', 'PAS_SOMC_vr', 'PAS_SOMN_vr', 'SOILC_vr','SOILN_vr', 'CWDC_vr', 'MET_LITC_vr', 'CEL_LITC_vr', 'LIG_LITC_vr', 'MET_LITN_vr', 'CEL_LITN_vr', 'LIG_LITN_vr', 'CWDN_vr', 'SMIN_NO3_vr', 'CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr' +hist_fincl1 += 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','MET_LITC_TO_ACT_SOMC','MET_LITN_TO_ACT_SOMN','CEL_LITC_TO_ACT_SOMC', 'CEL_LITN_TO_ACT_SOMN','LIG_LITC_TO_SLO_SOMC','LIG_LITN_TO_SLO_SOMN','DWT_WOOD_PRODUCTC_GAIN_PATCH' ! h1 stream (monthly average, finest sub-grid) hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'AR', 'HR', 'HTOP' @@ -14,7 +14,7 @@ hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'AR', 'HR', 'HTO hist_fincl3 += 'GPP', 'NPP', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', 'WOOD_HARVESTC', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'SLASH_HARVESTC', 'COL_FIRE_CLOSS', 'FROOTC:I', 'HTOP' ! h3 stream (yearly average, gridcell-level) -hist_fincl4 += 'SOILC_vr', 'SOILN_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'TOTLITC:I', 'TOT_WOODPRODC:I', 'TOTSOMC:I','TOTVEGC:I' +hist_fincl4 += 'SOILC_vr', 'SOILN_vr', 'CWDC_vr', 'MET_LITC_vr', 'CEL_LITC_vr', 'LIG_LITC_vr', 'MET_LITN_vr', 'CEL_LITN_vr', 'LIG_LITN_vr','CWDN_vr', 'TOTLITC:I', 'TOT_WOODPRODC:I', 'TOTSOMC:I','TOTVEGC:I' ! h4 stream (yearly average, landunit-level) hist_fincl5 += 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I' diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index f72764d0f4..84026a6805 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -53,9 +53,8 @@ Changes made to namelist defaults (e.g., changed parameter values): Changes to the datasets (e.g., parameter, surface or initial files): Substantial timing or memory changes: -[For timing changes, you should at least check the PFS test in the test - suite, whether or not you expect timing changes: ensure that its run - time has not increased significantly relative to the baseline.] +[e.g., check PFS test in the test suite and look at timings, if you +expect possible significant timing changes] Notes of particular relevance for developers: diff --git a/doc/ChangeLog b/doc/ChangeLog index 661f91fb0e..eba4ffc113 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,1319 @@ =============================================================== +Tag name: ctsm5.1.dev059 +Originator(s): glemieux (Gregory Lemieux,LBL/NGEET,510-486-5049) +Date: Wed Oct 13 10:46:06 MDT 2021 +One-line Summary: Update fates tests and list for diversity and coverage + +Purpose and description of changes +---------------------------------- + +This tag changes the list of fates testmod represented in the aux_clm category test list +to provide an updated set of testmods to improve coverage and diversity of fates modes +to be checked during ctsm updates now that fates is updating directory to the ctsm main/master +branch. A number of updates were made to the fates category list as well, including +test name changes, variables including for fates testmods, and the addition of a fates landuse +testmod. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + Fixes #1273 -- Add testmod for FATES land use + Fixes #1265 -- Diversifying fates testmods included in aux_clm test suite + +CIME Issues fixed (include issue #): + +Known bugs introduced in this tag (include issue #): + FATES #790 -- NAG compiler runtime error in FatesHydroWTFMod + #1518 -- FATES P32x2 test appears to fail reliably when using I2000FatesCruRsGs compset + #1520 -- Short clm ERS test hits reasonable wall clock limit on izumi nag + +Notes of particular relevance for developers: +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Changes to tests or testing: + - The list of fates testmods that are included as part of the aux_clm testlist has been updated to + change older compset coverage for newer Clm50 compsets. It also changes the list of fates testmods + to improve coverage for stable fates run mode options. + - The list of tests for the fates test category on all machines has been updated to use river stub compsets + for most tests in an effort to reduce test runtime. + - The list of tests for the fates test category on izumi has been change to only include debug-only tests as + a short term work around for FATES #771 + - The output variables for most all fates testmods is updated to only include site-level variables in an + effort to decrease history write time for any given test + - Updates the expected failure test list to remove out-of-date entries failures + - Many of the fates testmods have been renamed to be have a more broadly consistent naming scheme that denotes + which testmod is a baseline for a given testmod + - FatesColdDefLandUse testmod has been added to gain coverage for the do_harvest mode + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- ok + izumi ------- ok + + fates tests: + cheyenne ---- ok + + any other testing (give details below): + + Note that since testnames and variable inclusion list was changed for all fates testmods, test results + are not automatically comparable by cprnc. Manually comparison was done to validate output for fates testmods. + See PR #1275 details for more thorough explanation of testing results. + +Answer changes +-------------- + +Changes answers relative to baseline: No (only for non-fates testsmods) + +Other details +------------- + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #1275 -- FATES testing update and cleanup + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev058 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Thu Oct 7 20:47:14 MDT 2021 +One-line Summary: Some miscellaneous small answer changes + +Purpose and description of changes +---------------------------------- + +Change ceta from 450 to 358 for CTSM5.1 See Leo VanKamenhout's work on this in +https://github.com/ESCOMP/CTSM/pull/250. Note, this is used in the PPE work. +See van Kampenhout et al. (2017). Turn Medlyn on for PHS off for clm51 and clm50. +Make max CO2 partial pressure consistent in Photosynthesis. +Change surface datasets to only use 78PFT versions +Fix GSSUN and GSSHA history variables so now not just writing missing values. +Changes FATES to run with use_nitrif_dentrif=T by default. Change dynlakes test +to methane/use_nitrif_=T. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[x] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ +Issues fixed (include CTSM Issue #): + Fixes #1504 -- Transient Sp cases fail when using mismatched crop surface/landuse-timeseries datasets #1504 + Fixes #1503 -- VIC cases can't use crop surface datasets because of missing vic data #1503 + Fixes #1462 -- GSSUN and GSSHA are not set on history files #1462 + Fixes #1394 -- Max partial pressure of CO2 be should be 1.e-6 rather than 10.e-6 which it is for ci_func_PHS #1394 + Fixes #1460 -- Initialize t_soisno to 272K instead of 274K to avoid deep soil carbon in permafrost regions #1460 + Fixes #1465 -- Change FATES to run with use_nitrif_dentrif TRUE #1465 + Worked on #1356 -- Remove the CN (non CENTURY) version of Carbon-Nitrogen soil biogeochemistry code and its testing #1356 + Fixes #1496 -- SP NoAnthro case fails... #1496 + +Notes of particular relevance for users +--------------------------------------- + +Changes made to namelist defaults (e.g., changed parameter values): + stomatalcond_method is now Medlyn2011 for clm5_0 and clm5_1 + use_nitrif_denitrif is now TRUE when using FATES + +Changes to the datasets (e.g., parameter, surface or initial files): + New parameter file for clm5_1 (changes ceta) + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Surface datasets are now labeled with use_vichydro=TRUE in the xml. This also means that some files + listed in the XML are listed twice for VIC both on and off (that's important for FATES since it still + requires non-crop datasets (see #1505) + + Also the logic for finding both fsurdat and flanduse_timeseries files needs to be the same in first + asking for a crop version and then an exact match if it isn't found (unless it's FATES and then you just + do the exact match). + +Changes to tests or testing: + Dynamic lakes test now has methane on, which works because we turn off methane conservation check after restart + See #43 for more information on this. + + +Testing summary: regular +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + cheyenne - OK (306 tests different than baseline) + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + cheyenne - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- OK + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes + + Summarize any changes to answers, i.e., + - what code configurations: Most + - what platforms/compilers: all + - nature of change: + similar climate most changes are near roundoff level + + All clm5_1 physics change answers because of change in ceta parameter. + When PHS off for clm5_1 and clm5_0 changes answers because of Medlyn photosynthesis over Ball-Berry. + Photosynthesis potentially changes all the time because a maximum parameter was off. + Answer should be close to roundoff for Sp and Bgc cases without Crop because we now use crop surface datasets. + FATES changes answers since user_nitrif_dentrif is now on by default + COLDSTART BGC cases will change answers because of a change in initial soil temperature + clm4_5 and clm5_0 vichydro results are identical + clm4_5 and clm5_0 single point urban tests are identical + Some tests are still identical mostly crop-cases non-cold-start + In some cases GSSUN and GSSHA will be different. + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #1497 -- Miscellaneous small answer changes + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev057 +Originator(s): Sam Rabin +Date: Mon Sep 20 10:07:26 MDT 2021 +One-line Summary: Consolidate duplicated crop phenology code + +Purpose and description of changes +---------------------------------- + +Consolidate duplicated code related to crop planting + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1479 (Suggested cleanup in CropPhenology(): + Removing duplicated sowing code) + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- ok + izumi ------- ok + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Other details +------------- +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1482 + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev056 +Originator(s): glemieux (Gregory Lemieux,LBL/NGEET,510-486-5049) +Date: Fri Sep 17 15:41:57 MDT 2021 +One-line Summary: FATES Satellite Phenology mode implemented + +Purpose and description of changes +---------------------------------- + +This PR enables FATES TLAI, TSAI, and HTOP to be driven by the host land model +satellite data sets. The parameter file has been updated to include an array +mapping the indices of the host land model pfts to fates pfts. FATES satellite +phenology mode automatically enables two additional reduced complexity modes: +fixed biogeography and no competition. The former had previously been +implimented although this update corrected an error associated with this mode. +The latter is a new mode introduced in this PR as well and a corresponding +regression test has been added along with a new sp mode regression test. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + Adds FATES-SP mode as part of #1047 (a FATES v1 requirement) + +Known bugs introduced in this tag (include issue #): + #1485 -- Forthcoming FATES satellite phenology ERS test fails COMPARE_base_rest + #1488 -- FATES SP mode filter comparison: all_soil_patches and soil + #1489 -- Add graceful build failure for additional modes that are incompatible with use_fates_sp + +Known bugs found since the previous tag (include issue #): + MOSART #45 -- frivinp_rtm is still required even if MOSART is turned off + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + The SPITFIRE model is set to fail gracefully if accidentally enabled in conjunction with sp mode. + There is a known error in the satellite phenology exact restart, so restarts should not be + attempted until issue #1485 has been resolved. + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + History variables TLAI, TSAI, and HTOP are updated to reflect the fates sp mode outputs by means + of overwriting the existing history outputs. The original canopystate variables are still + calculated, but not available to the user. + +Changes made to namelist defaults (e.g., changed parameter values): + Add namelist option: use_fates_sp, use_fates_nocomp + +Changes to the datasets (e.g., parameter, surface or initial files): + New fates paramter file which include hlm to fates pft indexing map + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + All single site fates suite tests need to be manually built and submitted given MOSART #45. PR #1275 will resolve + this by switching to a non-MOSART compset. + +Changes to tests or testing: + A temporary SMS test has been added for Satellite Phenology testmod given the known ERS failure (issue #1485). + +Testing summary: +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + cheyenne - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- OK + izumi ------- OK + + ok: NLCOMP failures due to new fates namelist options added + + fates tests: + cheyenne ---- OK + + ok: FixedBiogeo DIFF deemed acceptable due to error correction from previous baseline. + + fates baseline: fates-sci.1.46.2_api.16.1.0-ctsm5.1.dev055 + +Answer changes +-------------- + +Changes answers relative to baseline: No (except for FATES FixedBiogeo) + + Summarize any changes to answers, i.e., + - what code configurations: FATES FixedBiogeo mode only + - what platforms/compilers: all + - nature of change: larger than roundoff due to corrected hlm-fates pft mapping + +Other details +------------- + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): + fates: sci.1.46.2_api.16.1.0 -> sci.1.47.0_api.17.0.0 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #1182 -- FATES SP api + FATES #703 -- Fates SP mode + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev055 +Originator(s): slevis (Samuel Levis,SLevis Consulting,303-665-1310) +Date: Fri Sep 10 11:25:08 MDT 2021 +One-line Summary: Updates to master_list_file.rst + +Purpose and description of changes +---------------------------------- + + Added code that writes a disclaimer and a few of the case's flags near + the top of master_list_file.rst. + Added code to generate a FATES version of master_list_file.rst. + Named new file master_list_file_fates.rst and renamed existing file + master_list_file_nofates.rst. + Updated .rst files in the documentation accordingly. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No. +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ + None. + +Notes of particular relevance for users +--------------------------------------- +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + The changes described above mainly affect the documentation. + If a user sets hist_master_list_file = .true. + to see the list of history fields available in their case, then they + will see the changes to master_list_file.rst described above. + +Notes of particular relevance for developers: +--------------------------------------------- + None. + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- OK + izumi ------- OK + + Note 1. On izumi I got four NLCOMP failures that seem unexpected: + ERI_D_Ld9_P48x1_Vnuopc.f10_f10_mg37.I2000Clm50Sp.izumi_nag.clm-SNICARFRC + ERS_D_Mmpi-serial_Ld5_Vnuopc.1x1_brazil.I2000Clm50FatesRs.izumi_nag.clm-FatesColdDef + SMS_D_Ld1_P48x1_Vnuopc.f10_f10_mg37.I2000Clm50BgcCru.izumi_nag.clm-af_bias_v7 + SMS_D_Vnuopc_Mmpi-serial.CLM_USRDAT.I1PtClm51Bgc.izumi_nag.clm-default--clm-NEON-NIWO + with errors like this: + Comparison failed between '/scratch/cluster/slevis/tests_0908-183947iz/ERI_D_Ld9_P48x1_Vnuopc.f10_f10_mg37.I2000Clm50Sp.izumi_nag.clm-SNICARFRC.GC.0908-183947iz_nag/CaseDocs/lnd_in' with '/fs/cgd/csm/ccsm_baselines/ctsm5.1.dev054/ERI_D_Ld9_P48x1_Vnuopc.f10_f10_mg37.I2000Clm50Sp.izumi_nag.clm-SNICARFRC/CaseDocs/lnd_in' + missing variable: 'fatmlndfrc' + + Note 2. On cheyenne I got an expected NLCOMP failure due to the Fates test + that I modified to output the master_list_fates.rst file. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + +Answer changes +-------------- + +Changes answers relative to baseline: No. + + The contents of master_list_nofates.rst have changed relative to the + earlier copy named master_list_file.rst, due to changes in the list of + available history fields introduced in previous tags. + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/1481 + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev054 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Thu Sep 2 01:18:31 MDT 2021 +One-line Summary: New parameters on paramsfile, many bit-for-bit changes, new history fields for IWUELN,VPD_2M, allow Medlyn Photosynthesis for non-PHS cases, fixes to HumanStressIndex + +Purpose and description of changes +---------------------------------- + +Brings more hardcoded parameters to the paramsfile. Some bit-for-bit cleanup. A fix for HumanStressIndex. Adding IWUELN +and VPD_2M diagnostic to history output. Add in ability to run Medlyn photosynthesis for non-PHS cases (not turned on yet though). +Most of the addition of parameters is from Keith Oleson. + +Daniel Kennedy added two new diagnostic fields available for history outuput. +IWUELN: the intrinsic water use efficiency at local noon (umolCO2/molH2O) +VPD_2M: vapor pressure deficit at 2m reference height (pascals) + +The Medlyn stomatal conductance functionality was deployed for CLM5. It had not been implemented for use_hydrstress=.false +(i.e. SMS). Previously if we opted for: use_hydrstress=.false and stomatalcond_method = 'Medlyn2011', +the model would actually use the Ball-Berry stomatal conductance model. Daniel Kennedy adds the changes to allow this for +non-PHS. + +Human Stress index changes are from Jonathan Buzan and Keith Oleson. + +Some clean-up work on arctic vegetation changes. Also removal of the option to run non-CENTRY based soil +decomposition model. CN options are removed along with use_century_decomp and use_vertsoilc. use_nitrif_dentrif and +use_lch4 are still retained, but recommended to be always on, and will be removed later. + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ +Issues fixed (include CTSM Issue #): + + Fixes #1472 - hist_master_list_file dies if master_list_file.rst already exists + Fixes #1469 - Remove unused 0.1x0.1 grid + Fixes #1468 - Remove vestiges of ch4 0.9x1.25 grid in mksurfdata_map/mkmapdata + Fixes #1427 - Division of critical day length by 2 is incorrect + Fixes #1403 - Invalid test running single-point forcing data before or after it's valid data series + Fixes #1401 - 1-Degree methane finundated stream data is labeled as if it's 2-degree + Fixes #1399 - Some cleanup for arctic luna changes + Fixes #1296 - Make a checklist of issues to check for when running a simulation. + Fixes #1245 - intrinsic water use efficiency diagnosti + Fixes #1250 - Error in HumanIndexMod (QSat_2 subroutine) + Fixes #1284 - change where stem_biomass is set + Fixes #1382 - write out friction velocity to history files by default + Fixes #1379 - Invalid xml for namelist_definition file: missing end tag + Fixes #1185 - Remove wrtdia + Fixes #1168 - Remove duplication between phys versions in CLM_BLDNML_OPTS settings (and fix some others) in config_component.xml + Fixes #886 -- Warning if FUN is on, but FlexibleCN is not + Fixes #808 -- Remove camdenNJ test from prebeta test list, replace it with working tests + +Partial work on #1356 (but use_lch4, use_nitrif_dentrif remain) + +Known bugs found since the previous tag (include issue #): + #1462 -- GSSUN and GSSHA are not set on history files + #1460 -- Initialize t_soisno to 272K instead of 274K to avoid deep soil carbon in permafrost regions + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + Vertical soil carbon is now hardcoded to on. This means that if you had run a simulation + with it turned off -- you won't be able to use it's restart files in this versions and after. + Likewise with CENTURY-BGC. + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + Removed namelist options: wrtdia, use_vertsoilc, use_century_decomp, min_wind_snowcompact + Added namelist options: min_critical_dayl_method, soil_decomp_method + New options for min_critical_dayl_method, DependsOnVeg and DependsOnLatAndVeg + + Remove 1x1_camdenNJ and 1x1_asphaltjungleNJ grid options + Remove some uneeded grids and files, correct 360x720cru grid for mksurfdata_map + Remove vestiges of ch4 files in mksurfdata_map + Remove the "cn" option to "-bgc" in CLM_BLDNML_OPTS and remove Cn compsets and tests + + New history variables: VPD2M, IWUELN (FV made default active) + +Changes to the datasets (e.g., parameter, surface or initial files): + New parameter files + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + After we turn on methane and nitrfication-dentrification for all configurations we + can remove the use_lch4 and use_nitrif_denitrif options + +Changes to tests or testing: + Removed CN and 1x1_camdenNJ tests as well as NoVSNoNI + Shortened 1x1_cancouverCAN test as it ran beyond the end of data + Changed name of "rootlit" test to "anoxia" as that was the only thing it does, it now + also runs with vertical soil Carbon profile + + +Testing summary: regular, tools +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + cheyenne - OK + + tools-tests (test/tools) (if tools have been changed): + + cheyenne - OK + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + cheyenne - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- OK + izumi ------- OK + + any other testing (give details below): + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit (except diagnostic fields when HumanStress is turned on) + + Summarize any changes to answers, i.e., + - what code configurations: When human-stress turned on + - what platforms/compilers: All + - nature of change: Small (only to diagnostic fields) + Also now can't run with use_vertsoilc off + anoxia tests are different from rootlit tests as use_vertsoilc is now hardcoded on + +Other details +------------- +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #1164 -- Some more hardcoded parameters to the params file + #1250 -- Error in HumanIndexMod (QSat_2 subroutine) + #1267 -- Adding IWUELN and VPD_2M diagnostic + #1321 -- Medlyn-SMS + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev053 +Originator(s): sacks (Bill Sacks) +Date: Fri Aug 13 10:17:42 MDT 2021 +One-line Summary: Add Antarctica compset and change min_snow_to_keep + +Purpose and description of changes +---------------------------------- + +(1) Add a compset for running CISM with Antarctica + +(2) Change min_snow_to_keep (see + https://github.com/ESCOMP/CTSM/issues/1425 for details) + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1425 (Need to increase min_snow_to_keep) + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- ok + izumi ------- ok + + any other testing (give details below): + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, but very limited circumstances + + Summarize any changes to answers, i.e., + - what code configurations: rarely, when have large snow capping flux + - what platforms/compilers: all (potentially) + - nature of change (roundoff; larger than roundoff/same climate; new climate): + slightly larger than roundoff when it occurs + + Changes only appear if removing the entire bottom layer of the snow + pack in one time step due to snow capping. The only test in the test + suite that changes answers is: + + ERS_D.f10_f10_mg37.I1850Clm50BgcCrop.cheyenne_intel.clm-reseedresetsnow + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev052 +Originator(s): negins/jedwards/erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Aug 11 21:58:47 MDT 2021 +One-line Summary: Wrapper script for running NEON sites, and some NEON updates + +Purpose and description of changes +---------------------------------- + +This is a wrapper script for running CTSM simulation for one or more neon sites using +CIME case objects. + +This script accomplishes the following: + +Downloads and parses neon listing file for the available neon data : +https://neon-ncar.s3.data.neonscience.org/listing.csv + +Create a base generic case and clone other cases from this generic base case. + +Enable the user to run in AD, Post-AD, and transient mode. + +Currently, there is no case dependency or case status check in the code. Which means +that the user cannot run Post-AD +AD + transient all at the same time. If we add case +dependency, then the code that checks the status of a case (e.g. spinup) every 2 +seconds and once it is finished successfully submit the next phase (e.g. transient.) + +Externals are also updated to fix some NEON issues. + +New tools subdirectory site_and_regional and current scripts for handling single-point +moved underneath. Also README files and tools testing changed for this move. Also tools +test added for the new wrapper script talked about above. Fix an issue in subset_data.py +where it couldn't be run from outside of a git directory because it checks for the git hash. + +Changes so that CTSM will write restarts as signaled at end of simulation by the CMEPS mediator. + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ +Issues fixed (include CTSM Issue #): + Fixes #1354 Batch run single point sites + Fixes #1454 run_sys_test improve error for rerun option + Fixes #1456 Missing files for test tools + Fixes #1407 mkmapdata.sh failing for regional grid + Fixes #1446 modifiy_neon script changes dimension for zbedrock + Fixes #1429 Modified neon datasets have errors + +Known bugs introduced in this tag (include issue #): + #1459 -- Change run_neon to run from any directory and add some additional options for testing + +Known bugs found since the previous tag (include issue #): + #1443 -- NEON site data requirements + #1442 -- Rename NEON files for CLM + #1433 -- Bring in eval data from NEON + +Notes of particular relevance for developers: +--------------------------------------------- +Changes to tests or testing: tools testing modified add a tools test for the run_neon script + +Testing summary: regular and tools +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + cheyenne - PASS + + tools-tests (test/tools) (if tools have been changed): + + cheyenne - OK + + PTCLM testing (tools/shared/PTCLM/test): (if cime or cime_config are changed) + (PTCLM is being deprecated, so we only expect this to be done on occasion) + + cheyenne - OK + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + cheyenne - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- OK + izumi ------- OK + + any other testing (give details below): + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Other details +------------- +[Remove any lines that don't apply. Remove entire section if nothing applies.] + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cism, cime, cmeps, cdeps + cism to cismwrap_2_1_87 + cime to cime6.0.4 + cmeps to cmeps0.13.23 + cdeps to cdeps0.12.19 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #1444 -- Wrapper script for batch running NEON sites, and NEON fixes + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev051 +Originator(s): Stefanie Falk, Sunniva Indrehus, Bill Sacks +Date: Fri Aug 6 10:30:32 MDT 2021 +One-line Summary: New LUNA-specific ozone stress option + +Purpose and description of changes +---------------------------------- + +Add a new ozone stress option that modifies jmax; this stress option is +specific to LUNA. See https://github.com/ESCOMP/CTSM/issues/1224 for a +detailed description. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1224 (Add new feature: Ozone impact on Jmax in + LUNA (OzoneLUNA)) + +Known bugs introduced in this tag (include issue #): +- https://github.com/ESCOMP/CTSM/issues/1381 (Distinction between sunlit + vs. shaded leaves in Luna (e.g., for ozone stress)) + +Notes of particular relevance for users +--------------------------------------- + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- use_ozone logical replaced by o3_veg_stress_method string + +Notes of particular relevance for developers: +--------------------------------------------- + +Changes to tests or testing: +- Ozone tests reworked so that one covers this new option + +Testing summary: +---------------- + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- ok + izumi ------- ok + + any other testing (give details below): + - Ran ERP_D_Ld5_P72x2.f10_f10_mg37.I2000Clm50BgcCrop.cheyenne_intel.clm-o3falk (passes) + - Ran the two old ozone tests that have been replaced; these passed + and were bit-for-bit (other than fieldlist diffs due to new ozone + diagnostic fields added in this tag) + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, just roundoff-level for pgi + + Summarize any changes to answers, i.e., + - what code configurations: anything with LUNA + - what platforms/compilers: pgi + - nature of change (roundoff; larger than roundoff/same climate; new climate): + roundoff + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + I verified that the answer changes just arise due to an extra + multiplication by 1 in LUNA, which must change order of operations + for pgi. (I compared with this one-off from master and was + bit-for-bit: + https://github.com/billsacks/ctsm/commit/011c79fc361a98c04a42824b74ca81209262da7c) + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1232 +https://github.com/ESCOMP/CTSM/pull/1370 + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev050 +Originator(s): sacks (Bill Sacks) +Date: Mon Aug 2 17:17:10 MDT 2021 +One-line Summary: Improve and document method for getting diagnostics on a problem point + +Purpose and description of changes +---------------------------------- + +Following from the changes in ctsm5.1.dev047 to change the lower bounds +to 1 on all processors: The one downside of that change was that it made +it a bit harder to write diagnostics on a given point. This PR cleans up +the method for writing these diagnostics and adds relevant +documentation. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#164 (BalanceCheck: Calls get_proc_bounds from + threaded region) +- Resolves ESCOMP/CTSM#1424 (Change all the endrun calls to write out + the point context information) + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- ok + izumi ------- ok + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Other details +------------- +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cdeps: cdeps0.12.14 -> cdeps0.12.17 + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/issues/1424 + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev049 +Originator(s): jedwards4b/erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Mon Jul 26 01:31:04 MDT 2021 +One-line Summary: Update externals, NEON updates, fix stop_option=date, move neon niwo test to match user_mods, local time option + +Purpose and description of changes +---------------------------------- + +Move the NEON_NIWO test to NEON/NIWO to match the names in usermods. Output particular fields for the NEON +cases, and use a reduced size dataset for lightning for NEON sites. Update NEON surface datasets with +new scripts included here. Fix stop option for NUOPC. NEON NIWO test in testlist explicity uses the user-mod +as well as the defaults testmod. + +This script is for modifying the surface dataset at neon sites using data available from the neon server. + +Also add the ability to output history fields for a particular time of day (in seconds) with the LXXXXX +history averaging option from Ronny Meier. + +Externals are updated extensively to the version with cpl7 cime directories split out for CESM. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #1412 + Fixes #1412 -- Reduce data requirements for NEON single point sites + Fixes #1353 -- Need script to modify NEON surface datasets + +CIME Issues fixed (include issue #): #3915 + Fixes cime/#3915 -- CESM nuopc build fails on izumi_nag + +Known bugs introduced in this tag (include issue #): + #1437 -- modify_singlept_site_neon.py seems to have trouble finding latest file and creates hidden file for output + #1436 -- Need subset_data.py script to be able to run from any directory + +Known bugs found since the previous tag (include issue #): + #1429 -- Modified NEON surface datasets have errors + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + NEON cases now download data to $RUNDIR + +Changes to the datasets (e.g., parameter, surface or initial files): NEON sufdata + +Notes of particular relevance for developers: +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide +[Remove any lines that don't apply. Remove entire section if nothing applies.] + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Note when you have a test with two testmod directories it won't be able to reduce any deuplication + that happens in directories used between the two. + +Changes to tests or testing: + Test mods in testlists can now include multiple test mod directories and this is used for the NEON test + + +Testing summary: regular +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + cheyenne - PASS (47 tests differ from before because of NEON surface dataset update) + + tools-tests (test/tools) (if tools have been changed): + + cheyenne - OK + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + cheyenne - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- OK + izumi ------- OK + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +------------- + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cism, mosart, rtm, cime, cmeps, cdeps (cime split) + cism to cismwrap_2_1_85 + mosart to mosart1_0_43 + rtm to rtm1_0_77 + cime to cime6.0.3 + cmeps to cmeps0.13.15 + cdeps to cdeps0.12.14 + + New cime-split externals: + + cpl7.0.3 + share1.0.2 + MCT_2.11.0 + pio2_5_4 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #1411 -- fix stop_option=date, move neon niwo test to match user_mods + #1375 -- Script for modifying neon surface dataset + #1374 -- Local solar time option for average flag + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev048 +Originator(s): slevis (Samuel Levis,SLevis Consulting,303-665-1310) +Date: Sat Jul 10 11:39:55 MDT 2021 +One-line Summary: Make certain history fields descriptive inst. of labeling by number + +Purpose and description of changes +---------------------------------- + + I used existing infrastructure to add descriptive strings to certain history + fields that I had labeled by number in #1340. While doing this, I applied the + change to a bunch of other history fields that needed it. + + Some variable names for pools was also changed to use terms consistent with the new + names as well. + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ +Issues fixed (include CTSM Issue #): #1392 + #1392 -- Some soil decomposition history fields have the pool number rather than a description in their name + + +Notes of particular relevance for users +--------------------------------------- +Caveats for users (e.g., need to interpolate initial conditions): + The names of certain history fields have changed to be more descriptive + in place of using numbers to differentiate them. + + history field name change as follows... + LITR1 becomes MET_LIT (metabolic) + LITR2 becomes CEL_LIT (cellulosic) + LITR3 becomes LIG_LIT (lignin) + SOIL1 becomes ACT_SOM (active) + SOIL2 becomes SLO_SOM (slow) + SOIL3 becomes PAS_SOM (passive) + +Testing summary: +---------------- + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + cheyenne - PASS + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + cheyenne - PASS + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- OK + izumi ------- OK + + +Answer changes +-------------- +Changes answers relative to baseline: NO bit-for-bit + + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/1413 + +=============================================================== +=============================================================== +Tag name: ctsm5.1.dev047 +Originator(s): mvertens (Mariana Vertenstein) +Date: Thu Jul 8 12:03:31 MDT 2021 +One-line Summary: Start bounds at 1; remove references to MCT + +Purpose and description of changes +---------------------------------- + +Users: take note of (1), and in particular the caveat for users noted +below (in the "Notes of particular relevance for users"). + +(1) All global index arrays on a given processor now have a starting index of 1 + - bounds_proc for each subgrid level has a starting index of 1 for each level + - bounds_clump for each subgrid level has a starting index of 1 for just + the first clump on the processor - but all the other clumps on the + processor do not start at 1 - but rather are offset with the number of + gridcells, columns, ...etc on the preceeding clumps + +(2) There are no longer any references to any mct data structures other than in the mct cap + - All references to gsmap have been removed from decompMod.F90 and + replaced with new global index arrays for the various subgrid levels + - decompInitMod has been refactored to calculated these global index + arrays using pure MPI rather than mct + - ncdio_pio_F90.in has been refactored to use the new global index + arrays rather than the gsmap data structures + - the data struture ldecomp is no longer needed + - the module spmdGathScatMod.F90 is no longer needed and has been removed + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ +Issues fixed (include CTSM Issue #): +- Addresses the first part of ESCOMP/CTSM#293 (Rework threading to be + done at a higher level, simplifying array argument passing) + +Notes of particular relevance for users +--------------------------------------- +Caveats for users (e.g., need to interpolate initial conditions): +- Until now, if the model produced an error message with a gridcell or + subgrid index (e.g., "Error at p = 1234"), you could rerun the model + with write statements in conditionals like "if (p == 1234) then". With + the changes in this tag, this simple conditional is no longer + possible. Instead, you will need to also reference the processor + number that produces the error. + + If the error message is produced in the lnd log file, then you can + have a conditional like: + if (masterproc .and. p == 1234) then + + If the error message is produced in the cesm log file, then you can + have a conditional like: + if (iam == X .and. p == 1234) then + + where X is the processor number that produced the message. On some + machines (including cheyenne), this processor number is printed at the + start of each line in the cesm log file. In addition, some aborts will + now print "proc_id = X", and that value can be used. + + Soon we will update + https://escomp.github.io/ctsm-docs/versions/master/html/users_guide/trouble-shooting/trouble-shooting.html + to document the new recommended procedure. + +Testing summary: +---------------- + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- ok + izumi ------- ok + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Other details +------------- +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1420 + +=============================================================== +=============================================================== Tag name: ctsm5.1.dev046 Originator(s): rgknox (Ryan Knox,,,) Date: Fri Jul 2 14:36:44 MDT 2021 @@ -7,7 +1322,7 @@ One-line Summary: Updating external fates has to tag sci.1.46.2_api.16.1.0. FATE Purpose and description of changes ---------------------------------- - This change brings the fates external up to sci.1.46.2_api.16.1.0. FATES side changes expand + This change brings the fates external up to sci.1.46.2_api.16.1.0. FATES side changes expand the FATES parameter file to include new fields. New and UNUSED parameters include: @@ -68,7 +1383,7 @@ Issues fixed (include CTSM Issue #): Notes of particular relevance for users --------------------------------------- - The FATES parameter file now contains new fields. Users must update their personal parameter + The FATES parameter file now contains new fields. Users must update their personal parameter files to contain these new fields. See src/fates/parameter_files/fates_params_default.cdl Notes of particular relevance for developers: @@ -96,7 +1411,7 @@ Testing summary: regular cheyenne ---- OK izumi ------- OK - + fates tests: cheyenne ---- OK @@ -179,7 +1494,7 @@ Notes of particular relevance for users Notes of particular relevance for developers: --------------------------------------------- - + Testing summary: ---------------- @@ -197,7 +1512,7 @@ Testing summary: cheyenne ---- OK izumi ------- OK - + Answer changes -------------- @@ -370,7 +1685,7 @@ Testing summary: cheyenne ---- OK (read above in "bugs introduced" about CN failures) izumi ------- OK (read below in "other testing" about pgi failures) - + any other testing (give details below): Two unexpected tests fail on izumi, so I performed additional testing. The tests that fail: @@ -465,7 +1780,7 @@ Testing summary: regular cheyenne ---- OK izumi ------- OK - + If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -498,10 +1813,10 @@ One-line Summary: Updates to coupling interface to enable FATES-CH4, and to be c Purpose and description of changes ---------------------------------- -These changes are only relegated to the API with FATES. Boundary conditions were prepared within -FATES to enable proper use of the methane model. Further, some minor changes were made to the FATES -interface code (clmfates_interfaceMod.F90) allowing compatibility with FATES tag sci.1.46.0_api.16.0.0 -(https://github.com/NGEET/fates/releases/tag/sci.1.46.0_api.16.0.0). Most of these changes have to do +These changes are only relegated to the API with FATES. Boundary conditions were prepared within +FATES to enable proper use of the methane model. Further, some minor changes were made to the FATES +interface code (clmfates_interfaceMod.F90) allowing compatibility with FATES tag sci.1.46.0_api.16.0.0 +(https://github.com/NGEET/fates/releases/tag/sci.1.46.0_api.16.0.0). Most of these changes have to do with how the FATES history interface is instantiated. Significant changes to scientifically-supported configurations @@ -855,7 +2170,7 @@ This also brings in Negin's first version of the subset_data.py script to create datasets for single-point and regional cases. And a version of it was run to create the NEON surface datasets. -To setup a NEON site do the following +To setup a NEON site do the following cd cime/scripts ./create_newcase --case myNEONtest --res CLM_USRDAT --compset IHist1PtClm51Bgc \ @@ -889,14 +2204,14 @@ Bugs fixed or introduced Issues fixed (include CTSM Issue #): #1368 -- Longitude isn't correct for NEON singlept fsurdat files. - #1353 -- Modify NEON surface data + #1353 -- Modify NEON surface data Known bugs introduced in this tag (include issue #): #1364 -- Change NEON surface datasets to 79PFT files to facilitate the crop sites #1368 -- Additional modifications to subset_data.py #1363 -- 2018 and 2018-PD compsets for NEON single point ty #1354 -- Batch run single point sites, including NEON - #1355 -- Python scripts for NEON analyses + #1355 -- Python scripts for NEON analyses cime/#3970 -- cdeps library fails to build on izumi: nag, intel, and gnu compilers Known bugs found since the previous tag (include issue #): @@ -947,7 +2262,7 @@ Testing summary: regular cheyenne ---- OK izumi ------- OK - + any other testing (give details below): If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -974,7 +2289,7 @@ List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): c Pull Requests that document the changes (include PR ids): (https://github.com/ESCOMP/ctsm/pull) - #1278 -- Neon compsets + #1278 -- Neon compsets #1360 -- Singlept and regional subsetting script (initial version) =============================================================== @@ -1064,7 +2379,7 @@ Testing summary: regular cheyenne ---- OK izumi ------- OK - + any other testing (give details below): Ran mkmapdata.sh for 1-deg maps @@ -1165,7 +2480,7 @@ Testing summary: cheyenne ---- OK izumi ------- OK - + any other testing (give details below): Unit tests PASS @@ -1204,11 +2519,11 @@ One-line Summary: FATES tag update and snow occlusion of LAI fix Purpose and description of changes ---------------------------------- -This tag updates the way in which fates is called during restarts to appropriately -handle the fates-side snow occlusion code. Additionally, this update points to the +This tag updates the way in which fates is called during restarts to appropriately +handle the fates-side snow occlusion code. Additionally, this update points to the most recent fates tag, which includes a number of fates science updates (including -the snow occlusion fix) and fates-side bug fixes (see below for list of issues -addressed). +the snow occlusion fix) and fates-side bug fixes (see below for list of issues +addressed). Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -1259,13 +2574,13 @@ Testing summary: regular cheyenne ---- ok izumi ------- ok - + ok: All non-fates testmods PASS b4b. Fates testmods have DIFF as expected due to update of fates science tag. fates tests: cheyenne ---- ok - ok: NLCOMP failures due to clm50_param file update relative to ctsm tag used on the last fates baseline. + ok: NLCOMP failures due to clm50_param file update relative to ctsm tag used on the last fates baseline. fates baseline: fates-sci.1.44.1_api.14.2.0-ctsm5.1.dev033-C30ca1849-F6065b9a2 @@ -1283,7 +2598,7 @@ Changes answers relative to baseline: Yes, only for fates than roundoff? - fates-side review of expected differences for all PRs that changed answers (2 science updates and 2 bug fixes) - + Other details ------------- @@ -1296,8 +2611,8 @@ Pull Requests that document the changes (include PR ids): (https://github.com/ESCOMP/ctsm/pull) - https://github.com/ESCOMP/CTSM/pull/1324 - - https://github.com/NGEET/fates/pull/734 - + - https://github.com/NGEET/fates/pull/734 + =============================================================== =============================================================== Tag name: ctsm5.1.dev035 @@ -1413,13 +2728,13 @@ One-line Summary: Bring in Arctic changes to LUNA from Leah Birch Purpose and description of changes ---------------------------------- -This is @lmbirch89 branch from #947 with the exception that Kattge is used in place of -Leuning in LUNA. Also the startup initial values in the luna bug fix branch #961 is +This is @lmbirch89 branch from #947 with the exception that Kattge is used in place of +Leuning in LUNA. Also the startup initial values in the luna bug fix branch #961 is used in place of the updated values by @lmbirch89. The LUNA bug fixes have already come in, so these are some changes to improve arctic plants. -We have addressed the issues in phenology and photosynthesis in the high latitudes. -Development was focused on PFT specific differences and we used observations to inform +We have addressed the issues in phenology and photosynthesis in the high latitudes. +Development was focused on PFT specific differences and we used observations to inform model development. GPP is improved now such that the tundra is realistically less productive than the boreal forest. @@ -1493,7 +2808,7 @@ Testing summary: regular cheyenne ---- OK izumi ------- OK - + Answer changes -------------- @@ -1510,7 +2825,7 @@ Changes answers relative to baseline: Yes for clm5_1 physics URL for LMWG diagnostics output used to validate new climate: http://webext.cgd.ucar.edu/I1850/clm50_ctsm10d089_2deg_GSWP3V1_lmbirch_wkattge_jmaxb1-0.17_slatopA_1850AD/ - + Other details ------------- @@ -1644,7 +2959,7 @@ Changes answers relative to baseline: YES Summarize any changes to answers, i.e., - what code configurations: Cases where CTSM receives CO2 from atmosphere - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): potentially new climate Answer changes due to fixing these issues: @@ -1721,7 +3036,7 @@ Testing summary: cheyenne ---- OK izumi ------- OK - + If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -1773,14 +3088,14 @@ Purpose and description of changes Implemented new nuopc/cmeps single column functionality. -In config/cesm/config_files.xml - single point domains are only used -for mct/cpl7. For cmeps single point meshes are now generated on the +In config/cesm/config_files.xml - single point domains are only used +for mct/cpl7. For cmeps single point meshes are now generated on the fly and component domains files are no longer needed. -env_run.xml variables PTS_LAT, PTS_LON and PTS_DOMAINFILE are used +env_run.xml variables PTS_LAT, PTS_LON and PTS_DOMAINFILE are used to determine if there is a single point or single column run. -If PTS_LAT and PTS_LON are not -999 and PTS_DOMAINFILE is UNSET, +If PTS_LAT and PTS_LON are not -999 and PTS_DOMAINFILE is UNSET, then you have a single point run and the exact values of PTS_LAT -and PTS_LON are used. If PTS_LAT and PTS_LON are not -999 and +and PTS_LON are used. If PTS_LAT and PTS_LON are not -999 and PTS_DOMAINFILE is not UNSET, then then the cmeps driver will recognize the nearest neighbor values of PTS_LAT and PTS_LON in PTS_DOMAINFILE as the single column lat and lon to use. @@ -1813,7 +3128,7 @@ Issues fixed (include CTSM Issue #): Known bugs introduced in this tag (include issue #): Known bugs found since the previous tag (include issue #): - #1317 -- MPI timeout for some izumi_nag tests reading in datm forcing files in NUOPC cap + #1317 -- MPI timeout for some izumi_nag tests reading in datm forcing files in NUOPC cap #1314 -- Send unset value for scol_lat/lon from driver Notes of particular relevance for users @@ -1852,7 +3167,7 @@ Testing summary: regular cheyenne ---- OK izumi ------- OK - + any other testing (give details below): Ran full izumi test list for nuopc driver (failed tests appear above) If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -1863,7 +3178,7 @@ Answer changes Changes answers relative to baseline: No (List of fields change though) - + Other details ------------- @@ -1876,7 +3191,7 @@ List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): c Pull Requests that document the changes (include PR ids): (https://github.com/ESCOMP/ctsm/pull) #1309 -- New single column functionality for NUOPC/CMEPS - #1310 -- run_sys_tests: add --retry option on izumi + #1310 -- run_sys_tests: add --retry option on izumi =============================================================== =============================================================== @@ -1936,16 +3251,16 @@ limited changes for LILAC Summarize any changes to answers, i.e., - what code configurations: NUOPC, and limited changes for LILAC - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): roundoff For nuopc: changes in area (relatively large differences in the f10 test in the test suite, but Mariana saw only very small changes in an f09 case), landfrac; these influence l2r fields, which in turn influence TWS and methane fields. - + For lilac: just changes in area - + If bitwise differences were observed, how did you show they were no worse than roundoff? Examination of cprnc diffs. @@ -2029,13 +3344,13 @@ Changes answers relative to baseline: YES Summarize any changes to answers, i.e., - what code configurations: all - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): Not investigated carefully, but expected to be larger than roundoff/same climate - + If bitwise differences were observed, how did you show they were no worse than roundoff? N/A - + Other details ------------- @@ -2138,7 +3453,7 @@ Changes answers relative to baseline: YES, but just for nuopc Summarize any changes to answers, i.e., - what code configurations: Just with nuopc driver - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): Not investigated The only test that changes answers is @@ -2359,19 +3674,19 @@ CTSM testing: build-namelist tests: - cheyenne - + cheyenne - tools-tests (test/tools): - cheyenne - + cheyenne - PTCLM testing (tools/shared/PTCLM/test): - cheyenne - + cheyenne - python testing (see instructions in python/README.md; document testing done): - (any machine) - + (any machine) - regular tests (aux_clm): @@ -2442,7 +3757,7 @@ Bugs fixed or introduced ------------------------ Issues fixed (include CTSM Issue #): Fixes #1256 -- num_iter incorrect - Fixes #1268 -- Leaf biomass not updated for + Fixes #1268 -- Leaf biomass not updated for Fixes #1262 -- pconv should be 1 for crops Fixes #1261 -- Restarts fail in AD-spinup mode Fixes #1255 -- mkmapdata crashes because of modules @@ -2495,7 +3810,7 @@ Testing summary: regular tools cheyenne ---- PASS izumi ------- PASS - + any other testing (give details below): If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -2570,15 +3885,15 @@ Known bugs found since the previous tag (include issue #): Notes of particular relevance for users --------------------------------------- -Changes made to namelist defaults (e.g., changed parameter values): +Changes made to namelist defaults (e.g., changed parameter values): - fates_spitfire_mode updated with multiple modes that use external datasets - use_fates_cohort_age_tracking added to enable size and age dependent mortality - fates_parteh_mode option 2 added for fates CNP mode -Changes to the datasets (e.g., parameter, surface or initial files): +Changes to the datasets (e.g., parameter, surface or initial files): fates_paramfile updated to fates_params_api.14.0.0_12pft_c200921.nc -Substantial timing or memory changes: +Substantial timing or memory changes: Only the fates testmod FatesAllVars failed the MEMCOMP test due to the increase in the number of variables included @@ -2586,13 +3901,13 @@ Notes of particular relevance for developers: --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): +Caveats for developers (e.g., code that is duplicated that requires double maintenance): There are a couple of issues we plan to address later (#1265, and #1272) Note also that NAG compiler production tests started failing because of a compiler error Since, we only care about NAG for DEBUG testing we removed those tests. Hopefully, a compiler update will allow that to work in the future. -Changes to tests or testing: +Changes to tests or testing: - Added FatesPRT2 testmod test which activates fates CNP mode - Added FatesReducedComplexFixedBiogeo testmod which activates fates fixed biogeography mode - Added FatesSizeAgeMort testmod which activates tracking of size and age dependent mortality in fates @@ -2613,17 +3928,17 @@ Testing summary: regular cheyenne ---- PASS (fates testmods DIFFs are expected) izumi ------- OK - ok: All non-fates testmods PASS. Fates testmods have DIFF as expected due to update of fates tag. + ok: All non-fates testmods PASS. Fates testmods have DIFF as expected due to update of fates tag. BFAILs expected due to changing non-debug nag test to debug. See #1264 comments for discussion. fates tests: - cheyenne ---- OK + cheyenne ---- OK ok: expected failures on COMPARE_base_rest for FatesHydro and Fates_nat_and_anthro_ignitions. All else B4B. fates baseline: fates-sci.1.43.2_api.14.2.0-ctsm5.1.dev020-C5f348cac-F5534a940 - + any other testing (give details below): If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -2639,7 +3954,7 @@ Changes answers relative to baseline: Yes, only for fates - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff - Comparison made using fates suite between fates_main_api (at ctsm5.1.dev020) + Comparison made using fates suite between fates_main_api (at ctsm5.1.dev020) and ctsm5.1.dev022. All tests PASS, except for two expected failures and expected NLCOMP failure due to ctsm5.1.dev021 update to paramfile. @@ -2672,12 +3987,12 @@ physics and when FATES is turned on. Those cases are identical to before, answer when it's turned on. Papers describing BHS simulations: -R. Meier, Davin, E., Swenson, S., Lawrence, D., and Schwaab, Jo. (2019). Biomass heat +R. Meier, Davin, E., Swenson, S., Lawrence, D., and Schwaab, Jo. (2019). Biomass heat storage dampens diurnal temperature variations in forests. Environmental Research Letters. 14. 084026. 10.1088/1748-9326/ab2b4e. -S.C. Swenson, Burns, S. P., and Lawrence, D. M. ( 2019). The impact of biomass heat storage -on the canopy energy balance and atmospheric stability in the community land model, Journal +S.C. Swenson, Burns, S. P., and Lawrence, D. M. ( 2019). The impact of biomass heat storage +on the canopy energy balance and atmospheric stability in the community land model, Journal of Advances in Modeling Earth Systems, 11, 83– 98. https://doi.org/10.1029/2018MS001476 @@ -2686,11 +4001,11 @@ Bugs fixed or introduced ------------------------ Issues fixed (include CTSM Issue #): - #342 --- set medlynslope to C4 appropriate value for millet and sorghum + #342 --- set medlynslope to C4 appropriate value for millet and sorghum (had already been done for miscanthus and switchgrass) #1246 -- Make spinup_factor_deadwood a variable rather than hardcoded constant -Known bugs introduced in this tag (include github issue ID): +Known bugs introduced in this tag (include github issue ID): #1247 -- FATES doesn't work with BHS Significant changes to scientifically-supported configurations @@ -3001,7 +4316,7 @@ Changes answers relative to baseline: YES, but just in select coupled configurat - what code configurations: Coupled configurations where CTSM receives NDEP from CAM - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): potentially new climate If bitwise differences were observed, how did you show they were no worse @@ -3012,7 +4327,7 @@ Changes answers relative to baseline: YES, but just in select coupled configurat - casename: N/A URL for LMWG diagnostics output used to validate new climate: N/A - + Detailed list of changes ------------------------ @@ -3090,19 +4405,19 @@ CTSM testing: build-namelist tests: - cheyenne - + cheyenne - tools-tests (test/tools): - cheyenne - + cheyenne - PTCLM testing (tools/shared/PTCLM/test): - cheyenne - + cheyenne - python testing (see instructions in python/README.md; document testing done): - (any machine) - + (any machine) - regular tests (aux_clm): @@ -3148,7 +4463,7 @@ Purpose of changes Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): #34 #941 +Issues fixed (include CTSM Issue #): #34 #941 Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -3215,19 +4530,19 @@ CTSM testing: build-namelist tests: - cheyenne - + cheyenne - tools-tests (test/tools): - cheyenne - + cheyenne - PTCLM testing (tools/shared/PTCLM/test): - cheyenne - + cheyenne - python testing (see instructions in python/README.md; document testing done): - (any machine) - + (any machine) - regular tests (aux_clm): @@ -3584,7 +4899,7 @@ Changes answers relative to baseline: YES Summarize any changes to answers, i.e., - what code configurations: all (or at least most) - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): new climate, at least to some extent Changes arise from (1) & (2) (large changes) and from (3) (small @@ -3685,7 +5000,7 @@ Substantial timing or memory changes: relative to the baseline. I have more carefully investigated this change in the context of pio2, which will soon become the default: with pio2, this change is important to get good performance. - + Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- @@ -3998,7 +5313,7 @@ Changes answers relative to baseline: YES Summarize any changes to answers, i.e., - what code configurations: ALL - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): Larger than roundoff; potentially new climate regionally, over Greenland The changes arise from changes in the meaning of @@ -4019,7 +5334,7 @@ Changes answers relative to baseline: YES - casename: N/A URL for LMWG diagnostics output used to validate new climate: N/A - + Detailed list of changes ------------------------ @@ -4200,8 +5515,8 @@ Notes of particular relevance for users Caveats for users (e.g., need to interpolate initial conditions): None -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - - maxpatch_pft is removed from namelist +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + - maxpatch_pft is removed from namelist Changes made to namelist defaults (e.g., changed parameter values): None @@ -4239,7 +5554,7 @@ CTSM testing: regular tests (aux_clm): - cheyenne ---- ok + cheyenne ---- ok izumi ------- ok If the tag used for baseline comparisons was NOT the previous tag, note that here: N/A @@ -4281,7 +5596,7 @@ Fix the finidat files being selected for 2000_control conditions for clm5_1 Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): +Issues fixed (include CTSM Issue #): Fixes #1158 -- Turn dribble_crophrv_xsmrpool_2atm on when crop is on for all physics versions Another issue in #1166 -- correct finidat file for 2000Clm51 @@ -4363,7 +5678,7 @@ List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): N Pull Requests that document the changes (include PR ids): #1177 (https://github.com/ESCOMP/ctsm/pull) - #1177 -- Two answer changes turn dribble_crophrv_xsmrpool_2atm and correct clm5_1 finidat + #1177 -- Two answer changes turn dribble_crophrv_xsmrpool_2atm and correct clm5_1 finidat file for 2000 conditions =============================================================== @@ -4530,7 +5845,7 @@ Changes answers relative to baseline: YES, for all CN/BGC configurations Summarize any changes to answers, i.e., - what code configurations: All CN/BGC configurations - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff; expected to be same climate, but not investigated yet @@ -4682,7 +5997,7 @@ Changes answers relative to baseline: YES Summarize any changes to answers, i.e., - what code configurations: Clm51Bgc - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff; whether it is climate changing was not investigated Detailed list of changes @@ -4807,7 +6122,7 @@ Changes answers relative to baseline: YES - just for CLM51 Summarize any changes to answers, i.e., - what code configurations: CLM51 - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): possibly new climate Detailed list of changes @@ -4927,7 +6242,7 @@ Changes answers relative to baseline: YES, but in very limited circumstances - what code configurations: Only when the model run uses a different time step than the initial conditions file - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff; magnitude not investigated; in some cases, the differences might be significant if the model actually continues without aborting @@ -5075,7 +6390,7 @@ Changes answers relative to baseline: YES Summarize any changes to answers, i.e., - what code configurations: Transient cases - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - nature of change (roundoff; larger than roundoff/same climate; new climate): Mostly roundoff-level. See below for details. - Differences in HEAT_CONTENT1, ICE_CONTENT1, LIQUID_CONTENT1, as @@ -5109,7 +6424,7 @@ Changes answers relative to baseline: YES - casename: N/A URL for LMWG diagnostics output used to validate new climate: N/A - + Detailed list of changes ------------------------ @@ -5186,19 +6501,19 @@ CTSM testing: build-namelist tests: - cheyenne - + cheyenne - tools-tests (test/tools): - cheyenne - + cheyenne - PTCLM testing (tools/shared/PTCLM/test): - cheyenne - + cheyenne - python testing (see instructions in python/README.md; document testing done): - (any machine) - + (any machine) - regular tests (aux_clm): @@ -5272,7 +6587,7 @@ Some more work done to change clm to ctsm, and allow for ctsm as a component. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): +Issues fixed (include CTSM Issue #): Fix #1142 -- Add ctsm_sci test list Fix #1145 -- File was corrupted on glade Fix #1144 -- Move btran2 to just inside of fire model @@ -5300,7 +6615,7 @@ Caveats for users (e.g., need to interpolate initial conditions): None Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Adds clm5_1 option to CLM_PHYSICS_VERSION clm5_1_GSWP3v1 is the only LND_TUNING_MDOE option for clm5_1 New compsets added for CLM51 I2000Clm51BgcCropGs, I2000Clm51BgcGs, I1850Clm51BgcGs, IHistClm51BgcGs, IHistClm51BgcCropGs - + Changes made to namelist defaults (e.g., changed parameter values): clm5_1 physics options added in Add the ability to set the component name in filenames (default is still clm2, but can be clm4, olr clm5) diff --git a/doc/ChangeSum b/doc/ChangeSum index f37a03661d..62eb8037e8 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,18 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.1.dev059 glemieux 10/13/2021 Update fates tests and list for diversity and coverage + ctsm5.1.dev058 erik 10/07/2021 Some miscellaneous small answer changes + ctsm5.1.dev057 samrabin 09/20/2021 Consolidate duplicated crop phenology code + ctsm5.1.dev056 glemieux 09/17/2021 FATES Satellite Phenology mode implemented + ctsm5.1.dev055 slevis 09/10/2021 Updates to master_list_file.rst + ctsm5.1.dev054 erik 09/02/2021 New parameters on paramsfile, many bit-for-bit changes, new history fields for IWUELN,VPD_2M, allow Medlyn Photosynthesis for non-PHS cases, fixes to HumanStressIndex + ctsm5.1.dev053 sacks 08/13/2021 Add Antarctica compset and change min_snow_to_keep + ctsm5.1.dev052 negins 08/11/2021 Wrapper script for running NEON sites, and some NEON updates + ctsm5.1.dev051 multiple 08/06/2021 New LUNA-specific ozone stress option + ctsm5.1.dev050 sacks 08/02/2021 Improve and document method for getting diagnostics on a problem point + ctsm5.1.dev049 jedwards 07/26/2021 Update externals, NEON updates, fix stop_option=date, move neon niwo test to match user_mods, local time option + ctsm5.1.dev048 slevis 07/10/2021 Make certain history fields descriptive inst. of labeling by number + ctsm5.1.dev047 mvertens 07/08/2021 Start bounds at 1; remove references to MCT ctsm5.1.dev046 rgknox 07/02/2021 Updating external fates has to tag sci.1.46.2_api.16.1.0 ctsm5.1.dev045 slevis 06/29/2021 Include CWD in heterotrophic respiration ctsm5.1.dev044 mvertens 06/24/2021 New stream functionality when using NUOPC or LILAC @@ -86,7 +99,7 @@ release-clm5.0.20 erik 03/12/2019 Update all fsurdat files and bring in files release-clm5.0.19 erik 03/08/2019 SKIPPED ON MASTER -- Update cime version release-clm5.0.18 erik 02/13/2019 Add NoAnthro compset, reduce fields on fsurdat in mksurfdata_map, initial add of tools/contrib directory release-clm5.0.17 sacks 01/23/2019 History fields for vertically-resolved sums of soil C and N, and minor fixes -release-clm5.0.16 erik 01/15/2019 PtVg and ssp_rcp future scenario options and Antarctica wetlands fix to mksurfdata, and option to dribble crop harvest XSMRPOOL flux to atmosphere +release-clm5.0.16 erik 01/15/2019 PtVg and ssp_rcp future scenario options and Antarctica wetlands fix to mksurfdata, and option to dribble crop harvest XSMRPOOL flux to atmosphere release-clm5.0.15 sacks 12/06/2018 SKIPPED ON MASTER -- Option for rain-to-snow release-clm5.0.14 erik 11/29/2018 Update cime and fix surface dataset for f05 1850 non-crop case release-clm5.0.13 erik 11/14/2018 Update externals with new CO2/presearo/rtm/mosart, add science_support, change testing @@ -140,7 +153,7 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, ctsm1.0.dev046 sacks 06/15/2019 Separate the two uses of h2osno ctsm1.0.dev045 sacks 06/06/2019 Recalculate h2osno for the sake of SnowCapping ctsm1.0.dev044 sacks 06/06/2019 Make wetland snow resetting behavior more explicit - ctsm1.0.dev043 erik 06/05/2019 Fix FUN bug (frac_ideal_C_use was backwards in regard to delta_CN), + ctsm1.0.dev043 erik 06/05/2019 Fix FUN bug (frac_ideal_C_use was backwards in regard to delta_CN), and replace Ball-Berry mbbopt with the CLM4.5 version ctsm1.0.dev042 slevis 05/21/2019 Rename, correct, and simplify parameters dewmx and sno_stor_max ctsm1.0.dev041 sacks 05/17/2019 Add water tracers to CanopyHydrologyMod @@ -190,7 +203,7 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm5.0.dev010 erik 05/15/2018 Update cime version to version in cesm2.0.beta10, changes answers for 1850 compsets because of orbit clm5.0.dev009 sacks 05/10/2018 New init_interp method clm5.0.dev008 erik 04/27/2018 With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 - clm5.0.dev007 erik 04/24/2018 Bring in a few answer changing things: FATES, cism updates, IC file fix, + clm5.0.dev007 erik 04/24/2018 Bring in a few answer changing things: FATES, cism updates, IC file fix, testing 1850 compset use 1850 orbit clm5.0.dev006 sacks 04/12/2018 Don't allocate memory for zero-weight natveg patches and urban clm5.0.dev005 sacks 04/10/2018 Two fixes for init_interp @@ -225,14 +238,14 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_5_16_r253 erik 08/04/2017 Check on reasonable import/export from CLM, check ndep units from input file clm4_5_16_r252 erik 07/24/2017 Update parameter file for some crop albedo issues, and fix a bug in urban albedo for nightime clm4_5_16_r251 erik 07/14/2017 Update mksurfdata_map for soil depth/color, add new mapping files - clm4_5_16_r250 erik 07/13/2017 Update finundation dataset, new fsurdat files with updated soil color and soil depth, + clm4_5_16_r250 erik 07/13/2017 Update finundation dataset, new fsurdat files with updated soil color and soil depth, update mosart areas, fix cheyenne_gnu clm4_5_16_r249 sacks 07/06/2017 All new compsets, reworked test lists, and related fixes clm4_5_16_r248 sacks 06/28/2017 Melt most ice runoff clm4_5_16_r247 sacks 06/26/2017 New GLACIER_REGION field with CISM domain split in two clm4_5_16_r246 sacks 06/14/2017 Update to latest cime clm4_5_16_r245 sacks 06/14/2017 Only adjust glc_mec topographic heights if glc_do_dynglacier is true - clm4_5_16_r244 erik 06/09/2017 Update cime and cism externals, changes answers for IG compsets, test g17 grids, fix a few + clm4_5_16_r244 erik 06/09/2017 Update cime and cism externals, changes answers for IG compsets, test g17 grids, fix a few issues, update mksurfdata_map clm4_5_16_r243 andre 05/23/2017 History output cleanup from Dave Lawrence clm4_5_16_r242 erik 05/21/2017 Use finundated streams for CLM50, and use ndep if it comes from cpl @@ -241,7 +254,7 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_5_16_r239 sacks 05/13/2017 Avoid division by zero in snow WindDriftCompaction clm4_5_16_r238 andre 05/13/2017 ED is now an external library 'fates' clm4_5_16_r237 erik 05/09/2017 Latest parameter file and some changes for CLM50, CLM45-transient changes answers also - clm4_5_15_r236 erik 05/01/2017 New surface datasets, and landuse.timeseries files, as well as interpolating initial conditions for + clm4_5_15_r236 erik 05/01/2017 New surface datasets, and landuse.timeseries files, as well as interpolating initial conditions for almost all cases clm4_5_15_r235 sacks 04/27/2017 Zero dynbal fluxes if namelist variable is set clm4_5_15_r234 andre 04/14/2017 Update rtm and mosart externals @@ -263,7 +276,7 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_5_14_r218 sacks 01/13/2017 For newly initiating columns: do not copy snow state clm4_5_14_r217 sacks 01/13/2017 Bug fix for snow radiation absorption clm4_5_14_r216 erik 01/12/2017 Fix previous broken tag - clm4_5_14_r215 erik 01/12/2017 Update mksurfdata_map to work with new updated datasets from Peter, and use hand-edited + clm4_5_14_r215 erik 01/12/2017 Update mksurfdata_map to work with new updated datasets from Peter, and use hand-edited surfdata/landuse.timeseries datasets for f09/f19 clm4_5_14_r214 sacks 01/03/2017 Update column states based on dwt terms between dyn_cnbal_patch and dyn_cnbal_col, and minor fixes clm4_5_14_r213 sacks 12/30/2016 Convert buildnml to python @@ -279,7 +292,7 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_5_12_r203 sacks 11/10/2016 Bug fixes for snow-on-lake clm4_5_12_r202 sacks 11/09/2016 Update to cime version used in cesm2_0_beta03 clm4_5_12_r201 sacks 11/09/2016 Rework initialization of transient weights - important with use_init_interp - clm4_5_12_r200 erik 11/08/2016 Latest parameter updates from simulations, ignore surface soil layer for plant hydraulic stress + clm4_5_12_r200 erik 11/08/2016 Latest parameter updates from simulations, ignore surface soil layer for plant hydraulic stress for greater variability in surface soil moisture clm4_5_12_r199 sacks 10/29/2016 Use CISM2 by default clm4_5_12_r198 sacks 10/20/2016 Rework mapping of irrigation from CLM to ROF @@ -293,13 +306,13 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_5_12_r190 sacks 08/20/2016 Fix snow capping bug clm4_5_11_r189 erik 08/18/2016 Bring in time varying streams for urban data (currently triggers AC use) clm4_5_11_r188 erik 08/05/2016 A set of small answer changing issues for both clm45 and clm50 - clm4_5_10_r187 erik 07/26/2016 CLM45/50 changes: seperate carbon and water root profile, turn off undercanopystability, + clm4_5_10_r187 erik 07/26/2016 CLM45/50 changes: seperate carbon and water root profile, turn off undercanopystability, really turn PHS on, LUNA predict sunlit fraction N fractionation clm4_5_9_r186 sacks 07/13/2016 Initialize biogeochem balance checks AFTER column area updates clm4_5_9_r185 sacks 07/07/2016 Revert glacial melt behavior to the old treatment for mountain glaciers - clm4_5_9_r184 erik 07/06/2016 CLM50 changes: Atkin form of lmr changed, new parameters and files, turn PHS on by default, + clm4_5_9_r184 erik 07/06/2016 CLM50 changes: Atkin form of lmr changed, new parameters and files, turn PHS on by default, new cold snow density, reseed at exit AD spinup, fix fire bug, fix npool and cpool errors - clm4_5_9_r183 erik 07/02/2016 Decomposition is not water limited after reaching a field capacity parameter (maxpsi_hr) + clm4_5_9_r183 erik 07/02/2016 Decomposition is not water limited after reaching a field capacity parameter (maxpsi_hr) rather than only at soil saturation clm4_5_8_r182 erik 06/24/2016 Bring in option for plant hydraulic stress for clm50 clm4_5_8_r181 erik 06/17/2016 Update cime version which fixes several issues and changes answers @@ -328,14 +341,14 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_5_6_r158 andre 12/04/2015 misc clm 5.0 bugfixes clm4_5_6_r157 sacks 11/27/2015 Reduce memory use for init_interp clm4_5_6_r156 sacks 11/24/2015 Fix QSNWCPICE and glacial inception - clm4_5_6_r155 erik 11/23/2015 Bring FUN (Fixation and Uptake of Nitrogen) code option to trunk - from Mingjie, as well as latitude varying spinup from Charlie, + clm4_5_6_r155 erik 11/23/2015 Bring FUN (Fixation and Uptake of Nitrogen) code option to trunk + from Mingjie, as well as latitude varying spinup from Charlie, and a fix for crop with dynamic roots from Beth clm4_5_6_r154 andre 11/18/2015 one year grain product pool clm4_5_6_r153 sacks 11/17/2015 Fix snow cover fraction bug clm4_5_5_r152 sacks 11/17/2015 Fix glc_mec energy conservation bug clm4_5_4_r151 erik 11/13/2015 Fix broken r150 tag, with bgc_spinup issue in it - clm4_5_4_r150 erik 11/13/2015 Some needed answer changing fixes for: fire, disallow + clm4_5_4_r150 erik 11/13/2015 Some needed answer changing fixes for: fire, disallow negative photosynthis, and reduce LAI of DBT in evergreen state clm4_5_3_r149 sacks 11/08/2015 Change cold start initialization of snow pack clm4_5_3_r148 sacks 11/07/2015 For CLM5, increase max snow depth to 20 m @@ -394,8 +407,8 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_5_1_r095 andre 11/10/2014 N comp refactoring by Jinyun Tang (LBL) and transpiration sink isolation by Gautam Bisht (LBL) clm4_5_1_r094 sacks 11/07/2014 misc. glacier-related updates clm4_5_1_r093 sacks 11/07/2014 change cold-start snow initialization, update cism external - clm4_5_1_r092 muszala 11/04/2014 bug fixes from santos that address valgrind problems. update rtm external - clm4_5_1_r091 muszala 10/27/2014 update externals. fix bug so CLM runs with Intel 14x. + clm4_5_1_r092 muszala 11/04/2014 bug fixes from santos that address valgrind problems. update rtm external + clm4_5_1_r091 muszala 10/27/2014 update externals. fix bug so CLM runs with Intel 14x. clm4_5_1_r090 sacks 10/16/2014 modularize irrigation; do some unit test rework clm4_5_1_r089 erik 10/13/2014 Bring new urban building temperature to trunk as a clm5.0 feature as well as human-stress index calculations clm4_5_1_r088 muszala 10/01/2014 pull out ED deps. in TemperatureTypeMod, can now compile with pgi 14.7 @@ -461,7 +474,7 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_5_28 sacks 09/20/2013 fix FracH2oSfc bug clm4_5_27 sacks 09/20/2013 fix crop nyrs bug clm4_5_26 muszala 09/19/2013 water balance and SMS_Ly1.f19_g16.ICLM45BGCCROP fix - clm4_5_25 erik 09/13/2013 Bring in Tony's changes to kick sno all the way up to the coupler layer, makes all + clm4_5_25 erik 09/13/2013 Bring in Tony's changes to kick sno all the way up to the coupler layer, makes all CESM components more similar to each other clm4_5_24 sacks 09/03/2013 update externals to cesm1_3_beta02 or later clm4_5_23 muszala 08/22/2013 refactor to allow CH4 params. to be read from netcdf file and clean up clm4_5_20 @@ -489,7 +502,7 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_5_01 muszala 05/06/2013 update externals clm4_5_00 erik 05/02/2013 Official end to CLM4.5 development for CLM offline clm4_0_81 bandre 04/29/2013 Charlie Koven's variable consolidation, cryoturbation and BSW CPP changes - clm4_0_80 erik 04/26/2013 Bring Fang Li. Fire model into CLM4.5 science, update ALL CLM4.5 surface datasets, + clm4_0_80 erik 04/26/2013 Bring Fang Li. Fire model into CLM4.5 science, update ALL CLM4.5 surface datasets, provide a working initial condition file for CLM45BGC@f19_g16-1850 clm4_0_79 muszala 04/24/2013 pftdyn, pft-phys*.nc and datm8 update clm4_0_78 muszala 04/23/2013 MEGAN fixes @@ -502,7 +515,7 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_0_71 muszala 04/10/2013 compsets refactoring by mvertens clm4_0_70 muszala 04/01/2013 bring in vic hydrology clm4_0_69 muszala 03/26/2013 remove hydro reorder, volr and esmf mods - clm4_0_68 erik 03/16/2013 Fix some issues in mksurfdata_map for generation of ne120np surface data file. + clm4_0_68 erik 03/16/2013 Fix some issues in mksurfdata_map for generation of ne120np surface data file. Put error back in CLM if weights don't sum to 100. Add in Keith's photosynthesis change for CLM45. clm4_0_67 muszala 03/12/2013 Jinyun photosynthesis and hydrology reorder clm4_0_66 sacks 03/07/2013 turn off subgrid topography snow parameterization for glc_mec landunits @@ -567,21 +580,21 @@ release-clm5.0.12 erik 11/03/2018 New IC files for clm45/clm50 coupled cases, clm4_0_07 erik 06/03/2010 Some cleanup/fix bugs, add RTM var, add albice to namelist, allow last-millenium in mksurfdata, allow setting of datm_presaero in clm test-suite clm4_0_06 erik 05/26/2010 Update gglc to cism clm4_0_05 erik 05/25/2010 Move Nitrogen deposition stream branch to trunk - clm4_0_04 erik 05/20/2010 New namelist items: ice_runoff, scaled_harvest, carbon_only, + clm4_0_04 erik 05/20/2010 New namelist items: ice_runoff, scaled_harvest, carbon_only, new RTM hist vars, new finidat files, update esmf interface, turn off aerosol read quicker clm4_0_03 erik 05/17/2010 Changes from Francis for VOC and drydep clm4_0_02 erik 05/13/2010 Make sure dtime is initialized, so that answers are consistently the same as clm4_0_00 clm4_0_01 erik 05/11/2010 Move glacier multiple elevation class branch to the trunk so that we can work with the active glacier model - clm4_0_00 erik 05/04/2010 Update to datm8, redirect aquifer overflow - to drainage, add gx3v7 masks, script to extract regional - datasets, add harvesting for CN, modify shrubs, include urban - model, ice stream for snowcapping, new build-namelist system, - scale solar by solar zenith angle in datm, deep soil with - bedrock at bottom, organic matter in soils, SNICAR for snow + clm4_0_00 erik 05/04/2010 Update to datm8, redirect aquifer overflow + to drainage, add gx3v7 masks, script to extract regional + datasets, add harvesting for CN, modify shrubs, include urban + model, ice stream for snowcapping, new build-namelist system, + scale solar by solar zenith angle in datm, deep soil with + bedrock at bottom, organic matter in soils, SNICAR for snow radiation, sparce dense aero, snow cover changes - clm3_8_00 erik 05/04/2010 Get future scenarios working, finalize - documentation, bring in MEGAN VOC and CNDV, simplify, - mksurfdata optimization, fix bugs: snow enthalpy, BMOZ, pergro, + clm3_8_00 erik 05/04/2010 Get future scenarios working, finalize + documentation, bring in MEGAN VOC and CNDV, simplify, + mksurfdata optimization, fix bugs: snow enthalpy, BMOZ, pergro, use pft weights from fsurdat NOT finidat clm3_7_15 erik 04/27/2010 Finish User's Guide, surfdata files for urban-1pt, fix mksurfdata ifort bugs, work with testing clm3_7_14 erik 04/08/2010 Fix rcp=2.6/4.5 1-degree fndepdyn filenames @@ -618,8 +631,8 @@ used clm3_6_49 erik 08/25/2009 Fix ncl interpolation scripts, update externals, turn on CLM_CCSM_BLD for bluefire,jaguar, ESMF3 compliance clm3_6_48 erik 08/12/2009 New aerosol/nitrogen deposition datasets, mksurfdata work, scm work, clm_usr_name option to build-namelist clm3_6_47 erik 08/03/2009 Fix hybrid bug for dynpft case, update externals - clm3_6_46 erik 07/22/2009 Get more tests to work/document them, add use cases for 1850_control, 2000_control, and - 20thC_transient, straighten out single-point grids, Listen to LND_CDF64 env variable from + clm3_6_46 erik 07/22/2009 Get more tests to work/document them, add use cases for 1850_control, 2000_control, and + 20thC_transient, straighten out single-point grids, Listen to LND_CDF64 env variable from template, remove CLM_ARB_IC. clm3_6_45 erik 07/10/2009 Remove inconsistent finidat file in clm3_6_44 clm3_6_44 erik 07/09/2009 Fix C13 bug, update scripts, drv, datm. Add domain files for idmap atm-ocn grids for datm. Remove SEQ_MCT, add new ESMF env vars to template. Work with ndeplintInterp @@ -648,51 +661,51 @@ used clm3_6_17 oleson 02/26/2009 Urban model changes and mksurfdata changes to incorporate urban data clm3_6_16 erik 02/12/2009 Multiple elevation classes on surface dataset, urban fixes, mpi-serial and testing fixes clm3_6_15 erik 01/19/2009 Bring clm36sci branch to the trunk - clm3_6_14 erik 10/10/2008 Fix some global urban issues, fix pftdyn, really get compile-only option + clm3_6_14 erik 10/10/2008 Fix some global urban issues, fix pftdyn, really get compile-only option working in testing - clm3_6_13 erik 10/01/2008 Update to new version of cpl7 scripts and build, update externals for versions + clm3_6_13 erik 10/01/2008 Update to new version of cpl7 scripts and build, update externals for versions needed for clm36sci branch, add new CASA tests - clm3_6_12 erik 09/21/2008 Fix restarts for urban, add capability to do global urban experiments, + clm3_6_12 erik 09/21/2008 Fix restarts for urban, add capability to do global urban experiments, add in new forcing height changes clm3_6_11 dlawren 08/26/2008 Ice stream for snow capped regions clm3_6_10 tcraig 08/15/2008 extend rtm tracer, ascale for tri-grids, AIX O3 to O2 clm3_6_09 erik 08/11/2008 Fix clm.cpl7.template to run hybrid and branch cases clm3_6_08 erik 08/06/2008 Fix bugs, and build changes for inputdata repo clm3_6_07 erik 07/08/2008 Implement new build namelist system from Vertenstein/Eaton, bluefire, and BGP updates - clm3_6_06 erik 05/30/2008 Small fix needed for ccsm4_alpha30 + clm3_6_06 erik 05/30/2008 Small fix needed for ccsm4_alpha30 (use gx1v5 for some resolutions when OCN_GRID==ATM_GRID) - clm3_6_05 erik 05/27/2008 Fix to compile with PGI-6, update scripts, fix cpl7.template for new scripts LND_GRID, + clm3_6_05 erik 05/27/2008 Fix to compile with PGI-6, update scripts, fix cpl7.template for new scripts LND_GRID, fix 2.65x3.33 frac dataset. - clm3_6_04 erik 05/20/2008 Remove all MCT permutes, fix cpl7 script issues, remove offline mode, + clm3_6_04 erik 05/20/2008 Remove all MCT permutes, fix cpl7 script issues, remove offline mode, add ability to run over a range of years clm3_6_03 erik 05/08/2008 Fix so listen to next_swcday to calculate albedo rather than using irad clm3_6_02 erik 03/25/2008 Minor fix in configure remove perl5lib version under models/lnd/clm/bld clm3_6_01 erik 03/20/2008 40 m forcing height changes for clm - clm3_6_00 erik 03/20/2008 Fully implement sequential-ccsm mode, upgrade configure, build-namelist and testing, - upgrade interpolation tool, add mkdatadomain, write to iulog rather than 6 explicitly, - SCAM update, Update datasets, add archiving, and build-streams, add in point version + clm3_6_00 erik 03/20/2008 Fully implement sequential-ccsm mode, upgrade configure, build-namelist and testing, + upgrade interpolation tool, add mkdatadomain, write to iulog rather than 6 explicitly, + SCAM update, Update datasets, add archiving, and build-streams, add in point version of Urban model, change directory structure to mimic CCSM - clm3_5_20 erik 03/17/2008 Bug fixes before spinning off clm3_6_00, put in changes from ccsm4a01_clm3_5_18 + clm3_5_20 erik 03/17/2008 Bug fixes before spinning off clm3_6_00, put in changes from ccsm4a01_clm3_5_18 to ccsm4a04_clm3_5_18 - clm3_5_19 erik 03/06/2008 Change directory structure to mimic CCSM, fix so no NaNS on BGC interpinic output, + clm3_5_19 erik 03/06/2008 Change directory structure to mimic CCSM, fix so no NaNS on BGC interpinic output, new half degree CN clmi dataset clm3_5_18 erik 02/21/2008 Update to latest seq-ccsm4.alpha tag clm3_5_17 erik 02/06/2008 Merge Tony Craig's FMI branch fmi12_clm3_5_16 to the clm trunk clm3_5_16 erik 01/28/2008 Get point version of Urban code onto trunk (urban code can not restart) - clm3_5_15 erik 12/10/2007 Fix interpinic for half degree grid, add in large-file support, + clm3_5_15 erik 12/10/2007 Fix interpinic for half degree grid, add in large-file support, allow configure to work with ccsm directory structure clm3_5_14 erik 11/27/2007 Use build-streams, and archiving, multiple bug-fixes clm3_5_13 erik 11/16/2007 Update xml file with file needed for ccsm3_5_beta18 clm3_5_12 erik 11/08/2007 Tag with new files needed for ccsm3_5_beta17 - clm3_5_11 erik 09/28/2007 Update datasets in the DefaultCLM file for 0.23x0.31, 0.47x0.63, 0.9x1.25 and + clm3_5_11 erik 09/28/2007 Update datasets in the DefaultCLM file for 0.23x0.31, 0.47x0.63, 0.9x1.25 and add fndepdyn file for 1.9x2.5 clm3_5_10 jet 09/18/2007 SCAM update - clm3_5_09 erik 08/31/2007 Change configure to NOT have csm_share code for ccsm_con option, and add in 1x1.25 file, + clm3_5_09 erik 08/31/2007 Change configure to NOT have csm_share code for ccsm_con option, and add in 1x1.25 file, and update datm7 and csm_share clm3_5_08 tcraig 08/20/2007 convert 6 to iulog in logfile, updates for I/O clm3_5_07 erik 08/17/2007 Add mkdatadomain tool, add cprnc and perl5lib as externals - clm3_5_06 erik 08/10/2007 Update: interpolation, testing, script namelist build, and scripts. Fix bugs, - and fix possible + clm3_5_06 erik 08/10/2007 Update: interpolation, testing, script namelist build, and scripts. Fix bugs, + and fix possible clm3_5_05 tcraig 07/11/2007 seq clm mods and first hist refactor mods clm3_5_04 mvertens 06/05/2007 lnd_comp_mct.F90 change to work with sequential diagnostics clm3_5_03 tcraig 05/23/2007 reduce memory, partial I/O refactor, downscaling implementation diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index c4e0824ea7..323c8ea24b 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -1197,7 +1197,7 @@ The saturated thickness is \Delta z_{sat} = z_{bedrock} - z_{\nabla}, where the water table :math:`z_{\nabla}` is determined by finding the -irst soil layer above the bedrock depth (section :numref:`Depth to Bedrock`) +first soil layer above the bedrock depth (section :numref:`Depth to Bedrock`) in which the volumetric water content drops below a specified threshold. The default threshold is set to 0.9. diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index 3f0c4849ae..e4f4f63836 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -47,17 +47,17 @@ Stomatal resistance ----------------------- CLM5 calculates stomatal conductance using the Medlyn stomatal conductance model (:ref:`Medlyn et al. 2011`). -Previous versions of CLM calculated leaf stomatal resistance is using the Ball-Berry conductance +Previous versions of CLM calculated leaf stomatal resistance using the Ball-Berry conductance model as described by :ref:`Collatz et al. (1991)` and implemented in global climate models (:ref:`Sellers et al. 1996`). The Medlyn model calculates stomatal conductance (i.e., the inverse of resistance) based on net leaf -photosynthesis, the vapor pressure deficit, and the CO\ :sub:`2` concentration at the leaf surface. +photosynthesis, the leaf-to-air vapor pressure difference, and the CO\ :sub:`2` concentration at the leaf surface. Leaf stomatal resistance is: .. math:: :label: 9.1 - \frac{1}{r_{s} } =g_{s} = g_{o} + 1.6(1 + \frac{g_{1} }{\sqrt{D}}) \frac{A_{n} }{{c_{s} \mathord{\left/ {\vphantom {c_{s} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } } + \frac{1}{r_{s} } =g_{s} = g_{o} + 1.6(1 + \frac{g_{1} }{\sqrt{D_{s}}}) \frac{A_{n} }{{c_{s} \mathord{\left/ {\vphantom {c_{s} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } } where :math:`r_{s}` is leaf stomatal resistance (s m\ :sup:`2` :math:`\mu`\ mol\ :sup:`-1`), :math:`g_{o}` is the minimum stomatal conductance @@ -65,7 +65,9 @@ where :math:`r_{s}` is leaf stomatal resistance (s m\ :sup:`2` photosynthesis (:math:`\mu`\ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`), :math:`c_{s}` is the CO\ :sub:`2` partial pressure at the leaf surface (Pa), :math:`P_{atm}` is the atmospheric -pressure (Pa), and :math:`D` is the vapor pressure deficit at the leaf surface (kPa). +pressure (Pa), and :math:`D_{s}=(e_{i}-e{_s})/1000` is the leaf-to-air vapor pressure difference at the leaf surface (kPa) +where :math:`e_{i}` is the saturation vapor pressure (Pa) evaluated at the leaf temperature +:math:`T_{v}` , and :math:`e_{s}` is the vapor pressure at the leaf surface (Pa). :math:`g_{1}` is a plant functional type dependent parameter (:numref:`Table Plant functional type (PFT) stomatal conductance parameters`) and are the same as those used in the CABLE model (:ref:`de Kauwe et al. 2015 `). @@ -153,7 +155,7 @@ describe the implementation, modified here. In its simplest form, leaf net photosynthesis after accounting for respiration (:math:`R_{d}` ) is .. math:: - :label: 9.3 + :label: 9.2 A_{n} =\min \left(A_{c} ,A_{j} ,A_{p} \right)-R_{d} . @@ -162,7 +164,7 @@ The RuBP carboxylase (Rubisco) limited rate of carboxylation s\ :sup:`-1`) is .. math:: - :label: 9.4 + :label: 9.3 A_{c} =\left\{\begin{array}{l} {\frac{V_{c\max } \left(c_{i} -\Gamma _{\*} \right)}{c_{i} +K_{c} \left(1+{o_{i} \mathord{\left/ {\vphantom {o_{i} K_{o} }} \right. \kern-\nulldelimiterspace} K_{o} } \right)} \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {V_{c\max } \qquad \qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. @@ -171,7 +173,7 @@ RuBP (i.e., the light-limited rate) :math:`A_{j}` (:math:`\mu` \ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 9.5 + :label: 9.4 A_{j} =\left\{\begin{array}{l} {\frac{J_{x}\left(c_{i} -\Gamma _{\*} \right)}{4c_{i} +8\Gamma _{\*} } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {\alpha (4.6\phi )\qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. @@ -181,7 +183,7 @@ C\ :sub:`4` plants :math:`A_{p}` (:math:`\mu` \ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 9.6 + :label: 9.5 A_{p} =\left\{\begin{array}{l} {3T_{p\qquad } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {k_{p} \frac{c_{i} }{P_{atm} } \qquad \qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}. @@ -212,7 +214,7 @@ photosynthetically active radiation absorbed by the leaf. A common expression is the smaller of the two roots of the equation .. math:: - :label: 9.7 + :label: 9.6 \Theta _{PSII} J_{x}^{2} -\left(I_{PSII} +J_{\max } \right)J_{x}+I_{PSII} J_{\max } =0 @@ -227,7 +229,7 @@ with 4.6 :math:`\mu`\ mol J\ :sup:`-1`, the light utilized in electron transport is .. math:: - :label: 9.8 + :label: 9.7 I_{PSII} =0.5\Phi _{PSII} (4.6\phi ) @@ -244,7 +246,7 @@ The model uses co-limitation as described by :ref:`Collatz et al. (1991, 1992) smaller root of the equations .. math:: - :label: 9.9 + :label: 9.8 \begin{array}{rcl} {\Theta _{cj} A_{i}^{2} -\left(A_{c} +A_{j} \right)A_{i} +A_{c} A_{j} } & {=} & {0} \\ {\Theta _{ip} A^{2} -\left(A_{i} +A_{p} \right)A+A_{i} A_{p} } & {=} & {0} \end{array} . @@ -282,19 +284,19 @@ The parameters :math:`V_{c\max 25}`, :math:`T_{v}` (K), as: .. math:: - :label: 9.10 + :label: 9.9 \begin{array}{rcl} {V_{c\max } } & {=} & {V_{c\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {J_{\max } } & {=} & {J_{\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {T_{p} } & {=} & {T_{p25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {R_{d} } & {=} & {R_{d25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {K_{c} } & {=} & {K_{c25} \; f\left(T_{v} \right)} \\ {K_{o} } & {=} & {K_{o25} \; f\left(T_{v} \right)} \\ {\Gamma } & {=} & {\Gamma _{25} \; f\left(T_{v} \right)} \end{array} .. math:: - :label: 9.11 + :label: 9.10 f\left(T_{v} \right)=\; \exp \left[\frac{\Delta H_{a} }{298.15\times 0.001R_{gas} } \left(1-\frac{298.15}{T_{v} } \right)\right] and .. math:: - :label: 9.12 + :label: 9.11 f_{H} \left(T_{v} \right)=\frac{1+\exp \left(\frac{298.15\Delta S-\Delta H_{d} }{298.15\times 0.001R_{gas} } \right)}{1+\exp \left(\frac{\Delta ST_{v} -\Delta H_{d} }{0.001R_{gas} T_{v} } \right)} . @@ -310,7 +312,7 @@ Because :math:`T_{p}` as implemented here varies with :math:`V_{c\max}` . For C\ :sub:`4` plants, .. math:: - :label: 9.13 + :label: 9.12 \begin{array}{l} {V_{c\max } =V_{c\max 25} \left[\frac{Q_{10} ^{(T_{v} -298.15)/10} }{f_{H} \left(T_{v} \right)f_{L} \left(T_{v} \right)} \right]} \\ {f_{H} \left(T_{v} \right)=1+\exp \left[s_{1} \left(T_{v} -s_{2} \right)\right]} \\ {f_{L} \left(T_{v} \right)=1+\exp \left[s_{3} \left(s_{4} -T_{v} \right)\right]} \end{array} @@ -321,7 +323,7 @@ with :math:`Q_{10} =2`, Additionally, .. math:: - :label: 9.14 + :label: 9.13 R_{d} =R_{d25} \left\{\frac{Q_{10} ^{(T_{v} -298.15)/10} }{1+\exp \left[s_{5} \left(T_{v} -s_{6} \right)\right]} \right\} @@ -329,7 +331,7 @@ with :math:`Q_{10} =2`, :math:`s_{5} =1.3` K\ :sup:`-1` and :math:`s_{6} =328.15`\ K, and .. math:: - :label: 9.15 + :label: 9.14 k_{p} =k_{p25} \, Q_{10} ^{(T_{v} -298.15)/10} @@ -364,7 +366,7 @@ achieved by allowing :math:`\Delta S`\ to vary with growth temperature according to .. math:: - :label: 9.16 + :label: 9.15 \begin{array}{l} {\Delta S=668.39-1.07(T_{10} -T_{f} )\qquad \qquad {\rm for\; }V_{c\max } } \\ {\Delta S=659.70-0.75(T_{10} -T_{f} )\qquad \qquad {\rm for\; }J_{\max } } \end{array} @@ -374,7 +376,7 @@ Additionally, the ratio :math:`J_{\max 25} /V_{c\max 25}` at 25 :sup:`o`\ C decreases with growth temperature as .. math:: - :label: 9.17 + :label: 9.16 J_{\max 25} /V_{c\max 25} =2.59-0.035(T_{10} -T_{f} ). @@ -394,7 +396,7 @@ When LUNA is on, the :math:`V_{c\max 25}` for sun leaves is scaled to the shaded .. math:: - :label: 9.18 + :label: 9.17 \begin{array}{rcl} {V_{c\max 25 sha}} & {=} & {V_{c\max 25 sha} \frac{i_{v,sha}}{i_{v,sun}}} \\ @@ -404,7 +406,7 @@ When LUNA is on, the :math:`V_{c\max 25}` for sun leaves is scaled to the shaded Where :math:`i_{v,sun}` and :math:`i_{v,sha}` are the leaf-to-canopy scaling coefficients of the twostream radiation model, calculated as .. math:: - :label: 9.19 + :label: 9.18 i_{v,sun} = \frac{(1 - e^{-(k_{n,ext}+k_{b,ext})*lai_e)} / (k_{n,ext}+k_{b,ext})}{f_{sun}*lai_e}\\ i_{v,sha} = \frac{(1 - e^{-(k_{n,ext}+k_{b,ext})*lai_e)} / (k_{n,ext}+k_{b,ext})}{(1 - f_{sun})*lai_e} @@ -427,14 +429,14 @@ are calculated assuming there is negligible capacity to store CO\ :sub:`2` and water vapor at the leaf surface so that .. math:: - :label: 9.31 + :label: 9.19 A_{n} =\frac{c_{a} -c_{i} }{\left(1.4r_{b} +1.6r_{s} \right)P_{atm} } =\frac{c_{a} -c_{s} }{1.4r_{b} P_{atm} } =\frac{c_{s} -c_{i} }{1.6r_{s} P_{atm} } and the transpiration fluxes are related as .. math:: - :label: 9.32 + :label: 9.20 \frac{e_{a} -e_{i} }{r_{b} +r_{s} } =\frac{e_{a} -e_{s} }{r_{b} } =\frac{e_{s} -e_{i} }{r_{s} } @@ -444,21 +446,20 @@ terms 1.4 and 1.6 are the ratios of diffusivity of CO\ :sub:`2` to H\ :sub:`2`\ O for the leaf boundary layer resistance and stomatal resistance, :math:`c_{a} ={\rm CO}_{{\rm 2}} \left({\rm mol\; mol}^{{\rm -1}} \right)`, :math:`P_{atm}` -is the atmospheric CO\ :sub:`2` partial pressure (Pa) calculated -from CO\ :sub:`2` concentration (ppmv), :math:`e_{i}` is the +is the atmospheric pressure (Pa), :math:`e_{i}` is the saturation vapor pressure (Pa) evaluated at the leaf temperature :math:`T_{v}` , and :math:`e_{a}` is the vapor pressure of air (Pa). The vapor pressure of air in the plant canopy :math:`e_{a}` (Pa) is determined from .. math:: - :label: 9.33 + :label: 9.21 e_{a} =\frac{P_{atm} q_{s} }{0.622} where :math:`q_{s}` is the specific humidity of canopy air (kg kg\ :sup:`-1`, section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). -Equations and are solved for +Equations :eq:`9.19` and :eq:`9.20` are solved for :math:`c_{s}` and :math:`e_{s}` .. math:: @@ -471,40 +472,51 @@ Equations and are solved for e_{s} =\frac{e_{a} r_{s} +e_{i} r_{b} }{r_{b} +r_{s} } -Substitution of equation :eq:`9.35` into equation :eq:`9.1` gives an expression for stomatal -resistance (:math:`r_{s}` ) as a function of photosynthesis -(:math:`A_{n}` ), given here in terms of conductance with -:math:`g_{s} =1/r_{s}` and :math:`g_{b} =1/r_{b}` +In terms of conductance with +:math:`g_{s} =1/r_{s}` and :math:`g_{b} =1/r_{b}` .. math:: :label: 9.36 - g_{s}^{2} + bg_{s} + c = 0 + e_{s} =\frac{e_{a} g_{b} +e_{i} g_{s} }{g_{b} +g_{s} } . -where + +Substitution of equation :eq:`9.36` into equation :eq:`9.1` gives an expression for the stomatal +resistance +(:math:`r_{s}`) as a function of photosynthesis +(:math:`A_{n}` ) .. math:: :label: 9.37 - b = 2(g_{o} * 10^{-6} + d) + \frac{(g_{1}d)^{2}}{g_{b}*10^{-6}D} + ag_{s}^{2} + bg_{s} + c = 0 - c = (g_{o}*10^{-6})^{2} + [2g_{o}*10^{-6} + d \frac{1-g_{1}^{2}} {D}]d +where + +.. math:: + :label: 9.38 + + \begin{array}{l} a = 1 \\ + + b = -[2(g_{o} * 10^{-6} + d) + \frac{(g_{1}d)^{2}}{g_{b}*10^{-6}D_{l}}] \\ + + c = (g_{o}*10^{-6})^{2} + [2g_{o}*10^{-6} + d (1-\frac{g_{1}^{2}} {D_{l}})]d \end{array} and .. math:: - :label: 9.38 + :label: 9.39 d = \frac {1.6 A_{n}} {c_{s} / P_{atm} * 10^{6}} - D = \frac {e_{i} - e_{a}} {1000} + D_{l} = \frac {max(e_{i} - e_{a},50)} {1000} Stomatal conductance, as solved by equation :eq:`9.36` (mol m :sup:`-2` s :sup:`-1`), is the larger of the two roots that satisfy the quadratic equation. Values for :math:`c_{i}` are given by .. math:: - :label: 9.39 + :label: 9.40 c_{i} =c_{a} -\left(1.4r_{b} +1.6r_{s} \right)P_{atm} A{}_{n} diff --git a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst index 56b6adff3f..6e756ab7c4 100644 --- a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst +++ b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst @@ -43,7 +43,7 @@ one-dimensional form This equation is solved numerically to calculate the soil, snow, and surface water temperatures for a fifteen-layer soil column with up to -five overlying layers of snow and a single surface water layer with the +twelve overlying layers of snow and a single surface water layer with the boundary conditions of :math:`h` as the heat flux into the top soil, snow, and surface water layers from the overlying atmosphere (section :numref:`Numerical Solution Temperature`) and zero heat flux at the bottom diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst index 1bc7810021..337b6dfc5a 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst @@ -22,11 +22,11 @@ The only hard requirement is that names be unique for different grid files. Here group="default_settings" valid_values= "512x1024,360x720cru,128x256,64x128,48x96,32x64,8x16,94x192,0.23x0.31,0.9x1.25,1.9x2.5,2.5x3.33, - 4x5,10x15,5x5_amazon,1x1_tropicAtl,1x1_camdenNJ,1x1_vacouverCAN,1x1_mexicocityMEX,1x1_asphaltjungleNJ, - 1x1_brazil,1x1_urbanc_alpha,1x1_numaIA,1x1_smallvilleIA,0.1x0.1,0.5x0.5,3x3min,5x5min,10x10min,0.33x0.3, + 4x5,10x15,5x5_amazon,1x1_tropicAtl,1x1_vacouverCAN,1x1_mexicocityMEX,1x1_asphaltjungleNJ, + 1x1_brazil,1x1_urbanc_alpha,1x1_numaIA,1x1_smallvilleIA,0.5x0.5,3x3min,5x5min,10x10min,0.33x0.3, ne4np4,ne16np4,ne30np4,ne60np4,ne120np4,ne240np4,wus12,us20,1km-merge-10min"> Horizontal resolutions - Note: 0.1x0.1, 0.5x0.5, 5x5min, 10x10min, 3x3min, 1km-merge-10min, and 0.33x0.33 are only used for CLM tools + Note: 0.5x0.5, 5x5min, 10x10min, 3x3min, 1km-merge-10min, and 0.33x0.33 are only used for CLM tools As you can see you just add your new resolution names to the end of the valid_values list. diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index fd71d44de5..4705148f8c 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -21,11 +21,11 @@ Which results in the following: :: CLM build-namelist - valid values for res (Horizontal resolutions - Note: 0.1x0.1, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools): + Note: 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools): Values: default 512x1024 360x720cru 128x256 64x128 48x96 32x64 8x16 94x192 \ - 0.23x0.31 0.47x0.63 0.9x1.25 1.9x2.5 2.5x3.33 4x5 10x15 5x5_amazon 1x1_tropicAtl 1x1_camdenNJ \ + 0.23x0.31 0.47x0.63 0.9x1.25 1.9x2.5 2.5x3.33 4x5 10x15 5x5_amazon 1x1_tropicAtl \ 1x1_vancouverCAN 1x1_mexicocityMEX 1x1_asphaltjungleNJ 1x1_brazil 1x1_urbanc_alpha 1x1_numaIA \ - 1x1_smallvilleIA 0.1x0.1 0.5x0.5 3x3min 5x5min 10x10min 0.33x0.33 ne4np4 ne16np4 ne30np4 ne60np4 \ + 1x1_smallvilleIA 0.5x0.5 3x3min 5x5min 10x10min 0.33x0.33 ne4np4 ne16np4 ne30np4 ne60np4 \ ne120np4 ne240np4 wus12 us20 Default = 1.9x2.5 (NOTE: resolution and mask and other settings may influence what the default is) diff --git a/doc/source/users_guide/setting-up-and-running-a-case/README_master_list_file b/doc/source/users_guide/setting-up-and-running-a-case/README_master_list_file deleted file mode 100644 index ac9fa73864..0000000000 --- a/doc/source/users_guide/setting-up-and-running-a-case/README_master_list_file +++ /dev/null @@ -1,9 +0,0 @@ -2020/11/16 slevis - -The file master_list_file.rst contains a table of the history fields, -active and inactive, available in the CTSM case that gets generated by -this test: -ERP_P36x2_D_Ld3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_gnu.clm-extra_outputs - -To reproduce master_list_file.rst, run the above test and the file -will appear in the run directory. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/README_master_list_files b/doc/source/users_guide/setting-up-and-running-a-case/README_master_list_files new file mode 100644 index 0000000000..61f8ef44d4 --- /dev/null +++ b/doc/source/users_guide/setting-up-and-running-a-case/README_master_list_files @@ -0,0 +1,10 @@ +2021/9/8 slevis + +The files master_list_nofates.rst and master_list_fates.rst each contain a +table of the history fields, active and inactive, available in the CTSM cases +that get generated by these tests: +ERP_P36x2_D_Ld3.f10_f10_mg37.I1850Clm50BgcCrop.cheyenne_gnu.clm-extra_outputs +ERS_Ld9.f10_f10_mg37.I2000Clm50FatesCru.cheyenne_intel.clm-FatesColdDefCH4 + +To reproduce these .rst files, run the above tests and the files +will appear in the corresponding run directories. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst index 70795acda7..47274d8480 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst @@ -41,9 +41,14 @@ Included in the table are the following pieces of information: - units -Table 1-3. CLM History Fields ------------------------------ -For Table, please see :doc:`master_list_file`. +Table 1-3. CLM History Fields from a BgcCrop case +------------------------------------------------- +For Table from a BgcCrop case, please see :doc:`master_list_nofates`. + + +Table 1-4. CLM History Fields from a Fates case +----------------------------------------------- +For Table from a Fates case, please see :doc:`master_list_fates`. --------------------------------------------- diff --git a/doc/source/users_guide/setting-up-and-running-a-case/index.rst b/doc/source/users_guide/setting-up-and-running-a-case/index.rst index 4703223c73..f882df277b 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/index.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/index.rst @@ -18,5 +18,6 @@ Setting Up and Running a Case customizing-the-clm-configuration.rst customizing-the-clm-namelist.rst customizing-the-datm-namelist.rst - master_list_file + master_list_nofates + master_list_fates diff --git a/doc/source/users_guide/setting-up-and-running-a-case/master_list_fates.rst b/doc/source/users_guide/setting-up-and-running-a-case/master_list_fates.rst new file mode 100644 index 0000000000..57edbfd3ca --- /dev/null +++ b/doc/source/users_guide/setting-up-and-running-a-case/master_list_fates.rst @@ -0,0 +1,955 @@ +============================= +CTSM History Fields (fates) +============================= + +CAUTION: Not all variables are relevant / present for all CTSM cases. +Key flags used in this CTSM case: +use_cn = F +use_crop = F +use_fates = T + +==== =================================== ============================================================================================== ================================================================= ======= +CTSM History Fields +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + # Variable Name Long Description Units Active? +==== =================================== ============================================================================================== ================================================================= ======= + 1 A5TMIN 5-day running mean of min 2-m temperature K F + 2 ACTUAL_IMMOB actual N immobilization gN/m^2/s T + 3 ACT_SOMC ACT_SOM C gC/m^2 T + 4 ACT_SOMC_1m ACT_SOM C to 1 meter gC/m^2 F + 5 ACT_SOMC_TNDNCY_VERT_TRA active soil organic C tendency due to vertical transport gC/m^3/s F + 6 ACT_SOMC_TO_PAS_SOMC decomp. of active soil organic C to passive soil organic C gC/m^2/s F + 7 ACT_SOMC_TO_PAS_SOMC_vr decomp. of active soil organic C to passive soil organic C gC/m^3/s F + 8 ACT_SOMC_TO_SLO_SOMC decomp. of active soil organic C to slow soil organic ma C gC/m^2/s F + 9 ACT_SOMC_TO_SLO_SOMC_vr decomp. of active soil organic C to slow soil organic ma C gC/m^3/s F + 10 ACT_SOMC_vr ACT_SOM C (vertically resolved) gC/m^3 T + 11 ACT_SOMN ACT_SOM N gN/m^2 T + 12 ACT_SOMN_1m ACT_SOM N to 1 meter gN/m^2 F + 13 ACT_SOMN_TNDNCY_VERT_TRA active soil organic N tendency due to vertical transport gN/m^3/s F + 14 ACT_SOMN_TO_PAS_SOMN decomp. of active soil organic N to passive soil organic N gN/m^2 F + 15 ACT_SOMN_TO_PAS_SOMN_vr decomp. of active soil organic N to passive soil organic N gN/m^3 F + 16 ACT_SOMN_TO_SLO_SOMN decomp. of active soil organic N to slow soil organic ma N gN/m^2 F + 17 ACT_SOMN_TO_SLO_SOMN_vr decomp. of active soil organic N to slow soil organic ma N gN/m^3 F + 18 ACT_SOMN_vr ACT_SOM N (vertically resolved) gN/m^3 T + 19 ACT_SOM_HR_S2 Het. Resp. from active soil organic gC/m^2/s F + 20 ACT_SOM_HR_S2_vr Het. Resp. from active soil organic gC/m^3/s F + 21 ACT_SOM_HR_S3 Het. Resp. from active soil organic gC/m^2/s F + 22 ACT_SOM_HR_S3_vr Het. Resp. from active soil organic gC/m^3/s F + 23 AGB Aboveground biomass gC m-2 T + 24 AGB_SCLS Aboveground biomass by size class kgC/m2 T + 25 AGB_SCPF Aboveground biomass by pft/size kgC/m2 F + 26 AGLB Aboveground leaf biomass kg/m^2 F + 27 AGSB Aboveground stem biomass kg/m^2 F + 28 ALBD surface albedo (direct) proportion F + 29 ALBGRD ground albedo (direct) proportion F + 30 ALBGRI ground albedo (indirect) proportion F + 31 ALBI surface albedo (indirect) proportion F + 32 ALT current active layer thickness m F + 33 ALTMAX maximum annual active layer thickness m F + 34 ALTMAX_LASTYEAR maximum prior year active layer thickness m F + 35 AR autotrophic respiration gC/m^2/s T + 36 AREA_BURNT_BY_PATCH_AGE spitfire area burnt by patch age (divide by patch_area_by_age to get burnt fraction by age) m2/m2/day T + 37 AREA_PLANT area occupied by all plants m2/m2 T + 38 AREA_TREES area occupied by woody plants m2/m2 T + 39 AR_AGSAPM_SCPF above-ground sapwood maintenance autotrophic respiration per m2 per year by pft/size kgC/m2/yr F + 40 AR_CANOPY autotrophic respiration of canopy plants gC/m^2/s T + 41 AR_CANOPY_SCPF autotrophic respiration of canopy plants by pft/size kgC/m2/yr F + 42 AR_CROOTM_SCPF below-ground sapwood maintenance autotrophic respiration per m2 per year by pft/size kgC/m2/yr F + 43 AR_DARKM_SCPF dark portion of maintenance autotrophic respiration per m2 per year by pft/size kgC/m2/yr F + 44 AR_FROOTM_SCPF fine root maintenance autotrophic respiration per m2 per year by pft/size kgC/m2/yr F + 45 AR_GROW_SCPF growth autotrophic respiration per m2 per year by pft/size kgC/m2/yr F + 46 AR_MAINT_SCPF maintenance autotrophic respiration per m2 per year by pft/size kgC/m2/yr F + 47 AR_SCPF total autotrophic respiration per m2 per year by pft/size kgC/m2/yr F + 48 AR_UNDERSTORY autotrophic respiration of understory plants gC/m^2/s T + 49 AR_UNDERSTORY_SCPF autotrophic respiration of understory plants by pft/size kgC/m2/yr F + 50 ATM_TOPO atmospheric surface height m T + 51 AnnET Annual ET mm/s F + 52 BA_SCLS basal area by size class m2/ha T + 53 BA_SCPF basal area by pft/size m2/ha F + 54 BCDEP total BC deposition (dry+wet) from atmosphere kg/m^2/s T + 55 BDEAD_MD_CANOPY_SCLS BDEAD_MD for canopy plants by size class kg C / ha / yr F + 56 BDEAD_MD_UNDERSTORY_SCLS BDEAD_MD for understory plants by size class kg C / ha / yr F + 57 BIOMASS_AGEPFT biomass per PFT in each age bin kg C / m2 F + 58 BIOMASS_BY_AGE Total Biomass within a given patch age bin kgC/m2 F + 59 BIOMASS_CANOPY Biomass of canopy plants gC m-2 T + 60 BIOMASS_SCLS Total biomass by size class kgC/m2 F + 61 BIOMASS_UNDERSTORY Biomass of understory plants gC m-2 T + 62 BLEAF_CANOPY_SCPF biomass carbon in leaf of canopy plants by pft/size kgC/ha F + 63 BLEAF_UNDERSTORY_SCPF biomass carbon in leaf of understory plants by pft/size kgC/ha F + 64 BSTORE_MD_CANOPY_SCLS BSTORE_MD for canopy plants by size class kg C / ha / yr F + 65 BSTORE_MD_UNDERSTORY_SCLS BSTORE_MD for understory plants by size class kg C / ha / yr F + 66 BSTOR_CANOPY_SCPF biomass carbon in storage pools of canopy plants by pft/size kgC/ha F + 67 BSTOR_UNDERSTORY_SCPF biomass carbon in storage pools of understory plants by pft/size kgC/ha F + 68 BSW_MD_CANOPY_SCLS BSW_MD for canopy plants by size class kg C / ha / yr F + 69 BSW_MD_UNDERSTORY_SCLS BSW_MD for understory plants by size class kg C / ha / yr F + 70 BTRAN transpiration beta factor unitless T + 71 BTRANMN daily minimum of transpiration beta factor unitless T + 72 BURNT_LITTER_FRAC_AREA_PRODUCT product of fraction of fuel burnt and burned area (divide by FIRE_AREA to get burned-area-weig fraction T + 73 C13disc_SCPF C13 discrimination by pft/size per mil F + 74 CAMBIALFIREMORT_SCPF cambial fire mortality by pft/size N/ha/yr F + 75 CANOPY_AREA_BY_AGE canopy area by age bin m2/m2 T + 76 CANOPY_HEIGHT_DIST canopy height distribution m2/m2 T + 77 CANOPY_SPREAD Scaling factor between tree basal area and canopy area 0-1 T + 78 CARBON_BALANCE_CANOPY_SCLS CARBON_BALANCE for canopy plants by size class kg C / ha / yr F + 79 CARBON_BALANCE_UNDERSTORY_SCLS CARBON_BALANCE for understory plants by size class kg C / ha / yr F + 80 CBALANCE_ERROR_FATES total carbon error, FATES mgC/day T + 81 CEFFLUX carbon efflux, root to soil kgC/ha/day T + 82 CEFFLUX_SCPF carbon efflux, root to soil, by size-class x pft kg/ha/day F + 83 CEL_LITC CEL_LIT C gC/m^2 T + 84 CEL_LITC_1m CEL_LIT C to 1 meter gC/m^2 F + 85 CEL_LITC_TNDNCY_VERT_TRA cellulosic litter C tendency due to vertical transport gC/m^3/s F + 86 CEL_LITC_TO_ACT_SOMC decomp. of cellulosic litter C to active soil organic C gC/m^2/s F + 87 CEL_LITC_TO_ACT_SOMC_vr decomp. of cellulosic litter C to active soil organic C gC/m^3/s F + 88 CEL_LITC_vr CEL_LIT C (vertically resolved) gC/m^3 T + 89 CEL_LITN CEL_LIT N gN/m^2 T + 90 CEL_LITN_1m CEL_LIT N to 1 meter gN/m^2 F + 91 CEL_LITN_TNDNCY_VERT_TRA cellulosic litter N tendency due to vertical transport gN/m^3/s F + 92 CEL_LITN_TO_ACT_SOMN decomp. of cellulosic litter N to active soil organic N gN/m^2 F + 93 CEL_LITN_TO_ACT_SOMN_vr decomp. of cellulosic litter N to active soil organic N gN/m^3 F + 94 CEL_LITN_vr CEL_LIT N (vertically resolved) gN/m^3 T + 95 CEL_LIT_HR Het. Resp. from cellulosic litter gC/m^2/s F + 96 CEL_LIT_HR_vr Het. Resp. from cellulosic litter gC/m^3/s F + 97 CH4PROD Gridcell total production of CH4 gC/m2/s T + 98 CH4_EBUL_TOTAL_SAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F + 99 CH4_EBUL_TOTAL_UNSAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F + 100 CH4_SURF_AERE_SAT aerenchyma surface CH4 flux for inundated area; (+ to atm) mol/m2/s T + 101 CH4_SURF_AERE_UNSAT aerenchyma surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T + 102 CH4_SURF_DIFF_SAT diffusive surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T + 103 CH4_SURF_DIFF_UNSAT diffusive surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T + 104 CH4_SURF_EBUL_SAT ebullition surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T + 105 CH4_SURF_EBUL_UNSAT ebullition surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T + 106 COL_CTRUNC column-level sink for C truncation gC/m^2 F + 107 COL_NTRUNC column-level sink for N truncation gN/m^2 F + 108 CONC_CH4_SAT CH4 soil Concentration for inundated / lake area mol/m3 F + 109 CONC_CH4_UNSAT CH4 soil Concentration for non-inundated area mol/m3 F + 110 CONC_O2_SAT O2 soil Concentration for inundated / lake area mol/m3 T + 111 CONC_O2_UNSAT O2 soil Concentration for non-inundated area mol/m3 T + 112 COSZEN cosine of solar zenith angle none F + 113 CROWNAREA_CAN total crown area in each canopy layer m2/m2 T + 114 CROWNAREA_CNLF total crown area that is occupied by leaves in each canopy and leaf layer m2/m2 F + 115 CROWNFIREMORT_SCPF crown fire mortality by pft/size N/ha/yr F + 116 CROWN_AREA_CANOPY_SCLS total crown area of canopy plants by size class m2/ha F + 117 CROWN_AREA_UNDERSTORY_SCLS total crown area of understory plants by size class m2/ha F + 118 CWDC_HR cwd C heterotrophic respiration gC/m^2/s F + 119 CWD_AG_CWDSC size-resolved AG CWD stocks gC/m^2 F + 120 CWD_AG_IN_CWDSC size-resolved AG CWD input gC/m^2/y F + 121 CWD_AG_OUT_CWDSC size-resolved AG CWD output gC/m^2/y F + 122 CWD_BG_CWDSC size-resolved BG CWD stocks gC/m^2 F + 123 CWD_BG_IN_CWDSC size-resolved BG CWD input gC/m^2/y F + 124 CWD_BG_OUT_CWDSC size-resolved BG CWD output gC/m^2/y F + 125 C_LBLAYER mean leaf boundary layer conductance umol m-2 s-1 T + 126 C_LBLAYER_BY_AGE mean leaf boundary layer conductance - by patch age umol m-2 s-1 F + 127 C_STOMATA mean stomatal conductance umol m-2 s-1 T + 128 C_STOMATA_BY_AGE mean stomatal conductance - by patch age umol m-2 s-1 F + 129 DDBH_CANOPY_SCAG growth rate of canopy plantsnumber of plants per hectare in canopy in each size x age class cm/yr/ha F + 130 DDBH_CANOPY_SCLS diameter growth increment by pft/size cm/yr/ha T + 131 DDBH_CANOPY_SCPF diameter growth increment by pft/size cm/yr/ha F + 132 DDBH_SCPF diameter growth increment by pft/size cm/yr/ha F + 133 DDBH_UNDERSTORY_SCAG growth rate of understory plants in each size x age class cm/yr/ha F + 134 DDBH_UNDERSTORY_SCLS diameter growth increment by pft/size cm/yr/ha T + 135 DDBH_UNDERSTORY_SCPF diameter growth increment by pft/size cm/yr/ha F + 136 DEMOTION_CARBONFLUX demotion-associated biomass carbon flux from canopy to understory gC/m2/s T + 137 DEMOTION_RATE_SCLS demotion rate from canopy to understory by size class indiv/ha/yr F + 138 DENIT total rate of denitrification gN/m^2/s T + 139 DGNETDT derivative of net ground heat flux wrt soil temp W/m^2/K F + 140 DISPLA displacement height m F + 141 DISTURBANCE_RATE_FIRE Disturbance rate from fire m2 m-2 d-1 T + 142 DISTURBANCE_RATE_LOGGING Disturbance rate from logging m2 m-2 d-1 T + 143 DISTURBANCE_RATE_P2P Disturbance rate from primary to primary lands m2 m-2 d-1 T + 144 DISTURBANCE_RATE_P2S Disturbance rate from primary to secondary lands m2 m-2 d-1 T + 145 DISTURBANCE_RATE_POTENTIAL Potential (i.e., including unresolved) disturbance rate m2 m-2 d-1 T + 146 DISTURBANCE_RATE_S2S Disturbance rate from secondary to secondary lands m2 m-2 d-1 T + 147 DISTURBANCE_RATE_TREEFALL Disturbance rate from treefall m2 m-2 d-1 T + 148 DPVLTRB1 turbulent deposition velocity 1 m/s F + 149 DPVLTRB2 turbulent deposition velocity 2 m/s F + 150 DPVLTRB3 turbulent deposition velocity 3 m/s F + 151 DPVLTRB4 turbulent deposition velocity 4 m/s F + 152 DSL dry surface layer thickness mm T + 153 DSTDEP total dust deposition (dry+wet) from atmosphere kg/m^2/s T + 154 DSTFLXT total surface dust emission kg/m2/s T + 155 DYN_COL_ADJUSTMENTS_CH4 Adjustments in ch4 due to dynamic column areas; only makes sense at the column level: should n gC/m^2 F + 156 DYN_COL_SOIL_ADJUSTMENTS_C Adjustments in soil carbon due to dynamic column areas; only makes sense at the column level: gC/m^2 F + 157 DYN_COL_SOIL_ADJUSTMENTS_N Adjustments in soil nitrogen due to dynamic column areas; only makes sense at the column level gN/m^2 F + 158 ED_NCOHORTS Total number of ED cohorts per site none T + 159 ED_NPATCHES Total number of ED patches per site none T + 160 ED_balive Live biomass gC m-2 T + 161 ED_bdead Dead (structural) biomass (live trees, not CWD) gC m-2 T + 162 ED_bfineroot Fine root biomass gC m-2 T + 163 ED_biomass Total biomass gC m-2 T + 164 ED_bleaf Leaf biomass gC m-2 T + 165 ED_bsapwood Sapwood biomass gC m-2 T + 166 ED_bstore Storage biomass gC m-2 T + 167 EFFECT_WSPEED effective windspeed for fire spread none T + 168 EFLXBUILD building heat flux from change in interior building air temperature W/m^2 T + 169 EFLX_DYNBAL dynamic land cover change conversion energy flux W/m^2 T + 170 EFLX_GNET net heat flux into ground W/m^2 F + 171 EFLX_GRND_LAKE net heat flux into lake/snow surface, excluding light transmission W/m^2 T + 172 EFLX_LH_TOT total latent heat flux [+ to atm] W/m^2 T + 173 EFLX_LH_TOT_ICE total latent heat flux [+ to atm] (ice landunits only) W/m^2 F + 174 EFLX_LH_TOT_R Rural total evaporation W/m^2 T + 175 EFLX_LH_TOT_U Urban total evaporation W/m^2 F + 176 EFLX_SOIL_GRND soil heat flux [+ into soil] W/m^2 F + 177 ELAI exposed one-sided leaf area index m^2/m^2 T + 178 ERRH2O total water conservation error mm T + 179 ERRH2OSNO imbalance in snow depth (liquid water) mm T + 180 ERROR_FATES total error, FATES mass-balance mg/day T + 181 ERRSEB surface energy conservation error W/m^2 T + 182 ERRSOI soil/lake energy conservation error W/m^2 T + 183 ERRSOL solar radiation conservation error W/m^2 T + 184 ESAI exposed one-sided stem area index m^2/m^2 T + 185 FABD_SHA_CNLF shade fraction of direct light absorbed by each canopy and leaf layer fraction F + 186 FABD_SHA_CNLFPFT shade fraction of direct light absorbed by each canopy, leaf, and PFT fraction F + 187 FABD_SHA_TOPLF_BYCANLAYER shade fraction of direct light absorbed by the top leaf layer of each canopy layer fraction F + 188 FABD_SUN_CNLF sun fraction of direct light absorbed by each canopy and leaf layer fraction F + 189 FABD_SUN_CNLFPFT sun fraction of direct light absorbed by each canopy, leaf, and PFT fraction F + 190 FABD_SUN_TOPLF_BYCANLAYER sun fraction of direct light absorbed by the top leaf layer of each canopy layer fraction F + 191 FABI_SHA_CNLF shade fraction of indirect light absorbed by each canopy and leaf layer fraction F + 192 FABI_SHA_CNLFPFT shade fraction of indirect light absorbed by each canopy, leaf, and PFT fraction F + 193 FABI_SHA_TOPLF_BYCANLAYER shade fraction of indirect light absorbed by the top leaf layer of each canopy layer fraction F + 194 FABI_SUN_CNLF sun fraction of indirect light absorbed by each canopy and leaf layer fraction F + 195 FABI_SUN_CNLFPFT sun fraction of indirect light absorbed by each canopy, leaf, and PFT fraction F + 196 FABI_SUN_TOPLF_BYCANLAYER sun fraction of indirect light absorbed by the top leaf layer of each canopy layer fraction F + 197 FATES_HR heterotrophic respiration gC/m^2/s T + 198 FATES_c_to_litr_cel_c litter celluluse carbon flux from FATES to BGC gC/m^3/s T + 199 FATES_c_to_litr_lab_c litter labile carbon flux from FATES to BGC gC/m^3/s T + 200 FATES_c_to_litr_lig_c litter lignin carbon flux from FATES to BGC gC/m^3/s T + 201 FCEV canopy evaporation W/m^2 T + 202 FCH4 Gridcell surface CH4 flux to atmosphere (+ to atm) kgC/m2/s T + 203 FCH4TOCO2 Gridcell oxidation of CH4 to CO2 gC/m2/s T + 204 FCH4_DFSAT CH4 additional flux due to changing fsat, natural vegetated and crop landunits only kgC/m2/s T + 205 FCO2 CO2 flux to atmosphere (+ to atm) kgCO2/m2/s F + 206 FCOV fractional impermeable area unitless T + 207 FCTR canopy transpiration W/m^2 T + 208 FGEV ground evaporation W/m^2 T + 209 FGR heat flux into soil/snow including snow melt and lake / snow light transmission W/m^2 T + 210 FGR12 heat flux between soil layers 1 and 2 W/m^2 T + 211 FGR_ICE heat flux into soil/snow including snow melt and lake / snow light transmission (ice landunits W/m^2 F + 212 FGR_R Rural heat flux into soil/snow including snow melt and snow light transmission W/m^2 F + 213 FGR_SOIL_R Rural downward heat flux at interface below each soil layer watt/m^2 F + 214 FGR_U Urban heat flux into soil/snow including snow melt W/m^2 F + 215 FH2OSFC fraction of ground covered by surface water unitless T + 216 FH2OSFC_NOSNOW fraction of ground covered by surface water (if no snow present) unitless F + 217 FINUNDATED fractional inundated area of vegetated columns unitless T + 218 FINUNDATED_LAG time-lagged inundated fraction of vegetated columns unitless F + 219 FIRA net infrared (longwave) radiation W/m^2 T + 220 FIRA_ICE net infrared (longwave) radiation (ice landunits only) W/m^2 F + 221 FIRA_R Rural net infrared (longwave) radiation W/m^2 T + 222 FIRA_U Urban net infrared (longwave) radiation W/m^2 F + 223 FIRE emitted infrared (longwave) radiation W/m^2 T + 224 FIRE_AREA spitfire fire area burn fraction fraction/day T + 225 FIRE_FDI probability that an ignition will lead to a fire none T + 226 FIRE_FLUX ED-spitfire loss to atmosphere of elements g/m^2/s T + 227 FIRE_FUEL_BULKD spitfire fuel bulk density kg biomass/m3 T + 228 FIRE_FUEL_EFF_MOIST spitfire fuel moisture m T + 229 FIRE_FUEL_MEF spitfire fuel moisture m T + 230 FIRE_FUEL_SAV spitfire fuel surface/volume per m T + 231 FIRE_ICE emitted infrared (longwave) radiation (ice landunits only) W/m^2 F + 232 FIRE_IGNITIONS number of successful ignitions number/km2/day T + 233 FIRE_INTENSITY spitfire fire intensity: kJ/m/s kJ/m/s T + 234 FIRE_INTENSITY_AREA_PRODUCT spitfire product of fire intensity and burned area (divide by FIRE_AREA to get area-weighted m kJ/m/s T + 235 FIRE_INTENSITY_BY_PATCH_AGE product of fire intensity and burned area, resolved by patch age (so divide by AREA_BURNT_BY_P kJ/m/2 T + 236 FIRE_NESTEROV_INDEX nesterov_fire_danger index none T + 237 FIRE_R Rural emitted infrared (longwave) radiation W/m^2 T + 238 FIRE_ROS fire rate of spread m/min m/min T + 239 FIRE_ROS_AREA_PRODUCT product of fire rate of spread (m/min) and burned area (fraction)--divide by FIRE_AREA to get m/min T + 240 FIRE_TFC_ROS total fuel consumed kgC/m2 T + 241 FIRE_TFC_ROS_AREA_PRODUCT product of total fuel consumed and burned area--divide by FIRE_AREA to get burned-area-weighte kgC/m2 T + 242 FIRE_U Urban emitted infrared (longwave) radiation W/m^2 F + 243 FLDS atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 T + 244 FLDS_ICE atmospheric longwave radiation (downscaled to columns in glacier regions) (ice landunits only) W/m^2 F + 245 FNRTC Total carbon in live plant fine-roots kgC ha-1 T + 246 FNRTC_SCPF fine-root carbon mass by size-class x pft kgC/ha F + 247 FRAGMENTATION_SCALER_SL factor by which litter/cwd fragmentation proceeds relative to max rate by soil layer unitless (0-1) T + 248 FROOT_MR fine root maintenance respiration) kg C / m2 / yr T + 249 FROOT_MR_CANOPY_SCLS FROOT_MR for canopy plants by size class kg C / ha / yr F + 250 FROOT_MR_UNDERSTORY_SCLS FROOT_MR for understory plants by size class kg C / ha / yr F + 251 FROST_TABLE frost table depth (natural vegetated and crop landunits only) m F + 252 FSA absorbed solar radiation W/m^2 T + 253 FSAT fractional area with water table at surface unitless T + 254 FSA_ICE absorbed solar radiation (ice landunits only) W/m^2 F + 255 FSA_R Rural absorbed solar radiation W/m^2 F + 256 FSA_U Urban absorbed solar radiation W/m^2 F + 257 FSD24 direct radiation (last 24hrs) K F + 258 FSD240 direct radiation (last 240hrs) K F + 259 FSDS atmospheric incident solar radiation W/m^2 T + 260 FSDSND direct nir incident solar radiation W/m^2 T + 261 FSDSNDLN direct nir incident solar radiation at local noon W/m^2 T + 262 FSDSNI diffuse nir incident solar radiation W/m^2 T + 263 FSDSVD direct vis incident solar radiation W/m^2 T + 264 FSDSVDLN direct vis incident solar radiation at local noon W/m^2 T + 265 FSDSVI diffuse vis incident solar radiation W/m^2 T + 266 FSDSVILN diffuse vis incident solar radiation at local noon W/m^2 T + 267 FSH sensible heat not including correction for land use change and rain/snow conversion W/m^2 T + 268 FSH_G sensible heat from ground W/m^2 T + 269 FSH_ICE sensible heat not including correction for land use change and rain/snow conversion (ice landu W/m^2 F + 270 FSH_PRECIP_CONVERSION Sensible heat flux from conversion of rain/snow atm forcing W/m^2 T + 271 FSH_R Rural sensible heat W/m^2 T + 272 FSH_RUNOFF_ICE_TO_LIQ sensible heat flux generated from conversion of ice runoff to liquid W/m^2 T + 273 FSH_TO_COUPLER sensible heat sent to coupler (includes corrections for land use change, rain/snow conversion W/m^2 T + 274 FSH_U Urban sensible heat W/m^2 F + 275 FSH_V sensible heat from veg W/m^2 T + 276 FSI24 indirect radiation (last 24hrs) K F + 277 FSI240 indirect radiation (last 240hrs) K F + 278 FSM snow melt heat flux W/m^2 T + 279 FSM_ICE snow melt heat flux (ice landunits only) W/m^2 F + 280 FSM_R Rural snow melt heat flux W/m^2 F + 281 FSM_U Urban snow melt heat flux W/m^2 F + 282 FSNO fraction of ground covered by snow unitless T + 283 FSNO_EFF effective fraction of ground covered by snow unitless T + 284 FSNO_ICE fraction of ground covered by snow (ice landunits only) unitless F + 285 FSR reflected solar radiation W/m^2 T + 286 FSRND direct nir reflected solar radiation W/m^2 T + 287 FSRNDLN direct nir reflected solar radiation at local noon W/m^2 T + 288 FSRNI diffuse nir reflected solar radiation W/m^2 T + 289 FSRVD direct vis reflected solar radiation W/m^2 T + 290 FSRVDLN direct vis reflected solar radiation at local noon W/m^2 T + 291 FSRVI diffuse vis reflected solar radiation W/m^2 T + 292 FSR_ICE reflected solar radiation (ice landunits only) W/m^2 F + 293 FSUN sunlit fraction of canopy proportion F + 294 FSUN24 fraction sunlit (last 24hrs) K F + 295 FSUN240 fraction sunlit (last 240hrs) K F + 296 FUEL_AMOUNT_AGEFUEL spitfire fuel quantity in each age x fuel class kg C / m2 T + 297 FUEL_AMOUNT_BY_NFSC spitfire size-resolved fuel quantity kg C / m2 T + 298 FUEL_MOISTURE_NFSC spitfire size-resolved fuel moisture - T + 299 Fire_Closs ED/SPitfire Carbon loss to atmosphere gC/m^2/s T + 300 GPP gross primary production gC/m^2/s T + 301 GPP_BY_AGE gross primary productivity by age bin gC/m^2/s F + 302 GPP_CANOPY gross primary production of canopy plants gC/m^2/s T + 303 GPP_CANOPY_SCPF gross primary production of canopy plants by pft/size kgC/m2/yr F + 304 GPP_SCPF gross primary production by pft/size kgC/m2/yr F + 305 GPP_UNDERSTORY gross primary production of understory plants gC/m^2/s T + 306 GPP_UNDERSTORY_SCPF gross primary production of understory plants by pft/size kgC/m2/yr F + 307 GROSS_NMIN gross rate of N mineralization gN/m^2/s T + 308 GROWTHFLUX_FUSION_SCPF flux of individuals into a given size class bin via fusion n/yr/ha F + 309 GROWTHFLUX_SCPF flux of individuals into a given size class bin via growth and recruitment n/yr/ha F + 310 GROWTH_RESP growth respiration gC/m^2/s T + 311 GSSHA shaded leaf stomatal conductance umol H20/m2/s T + 312 GSSHALN shaded leaf stomatal conductance at local noon umol H20/m2/s T + 313 GSSUN sunlit leaf stomatal conductance umol H20/m2/s T + 314 GSSUNLN sunlit leaf stomatal conductance at local noon umol H20/m2/s T + 315 H2OCAN intercepted water mm T + 316 H2OSFC surface water depth mm T + 317 H2OSNO snow depth (liquid water) mm T + 318 H2OSNO_ICE snow depth (liquid water, ice landunits only) mm F + 319 H2OSNO_TOP mass of snow in top snow layer kg/m2 T + 320 H2OSOI volumetric soil water (natural vegetated and crop landunits only) mm3/mm3 T + 321 HARVEST_CARBON_FLUX Harvest carbon flux kg C m-2 d-1 T + 322 HBOT canopy bottom m F + 323 HEAT_CONTENT1 initial gridcell total heat content J/m^2 T + 324 HEAT_CONTENT1_VEG initial gridcell total heat content - natural vegetated and crop landunits only J/m^2 F + 325 HEAT_CONTENT2 post land cover change total heat content J/m^2 F + 326 HEAT_FROM_AC sensible heat flux put into canyon due to heat removed from air conditioning W/m^2 T + 327 HIA 2 m NWS Heat Index C T + 328 HIA_R Rural 2 m NWS Heat Index C T + 329 HIA_U Urban 2 m NWS Heat Index C T + 330 HK hydraulic conductivity (natural vegetated and crop landunits only) mm/s F + 331 HR total heterotrophic respiration gC/m^2/s T + 332 HR_vr total vertically resolved heterotrophic respiration gC/m^3/s T + 333 HTOP canopy top m T + 334 HUMIDEX 2 m Humidex C T + 335 HUMIDEX_R Rural 2 m Humidex C T + 336 HUMIDEX_U Urban 2 m Humidex C T + 337 ICE_CONTENT1 initial gridcell total ice content mm T + 338 ICE_CONTENT2 post land cover change total ice content mm F + 339 ICE_MODEL_FRACTION Ice sheet model fractional coverage unitless F + 340 INT_SNOW accumulated swe (natural vegetated and crop landunits only) mm F + 341 INT_SNOW_ICE accumulated swe (ice landunits only) mm F + 342 IWUELN local noon intrinsic water use efficiency umolCO2/molH2O T + 343 KROOT root conductance each soil layer 1/s F + 344 KSOIL soil conductance in each soil layer 1/s F + 345 K_ACT_SOM active soil organic potential loss coefficient 1/s F + 346 K_CEL_LIT cellulosic litter potential loss coefficient 1/s F + 347 K_LIG_LIT lignin litter potential loss coefficient 1/s F + 348 K_MET_LIT metabolic litter potential loss coefficient 1/s F + 349 K_PAS_SOM passive soil organic potential loss coefficient 1/s F + 350 K_SLO_SOM slow soil organic ma potential loss coefficient 1/s F + 351 LAI240 240hr average of leaf area index m^2/m^2 F + 352 LAISHA shaded projected leaf area index m^2/m^2 T + 353 LAISHA_TOP_CAN LAI in the shade by the top leaf layer of each canopy layer m2/m2 F + 354 LAISHA_Z_CNLF LAI in the shade by each canopy and leaf layer m2/m2 F + 355 LAISHA_Z_CNLFPFT LAI in the shade by each canopy, leaf, and PFT m2/m2 F + 356 LAISUN sunlit projected leaf area index m^2/m^2 T + 357 LAISUN_TOP_CAN LAI in the sun by the top leaf layer of each canopy layer m2/m2 F + 358 LAISUN_Z_CNLF LAI in the sun by each canopy and leaf layer m2/m2 F + 359 LAISUN_Z_CNLFPFT LAI in the sun by each canopy, leaf, and PFT m2/m2 F + 360 LAI_BY_AGE leaf area index by age bin m2/m2 T + 361 LAI_CANOPY_SCLS Leaf are index (LAI) by size class m2/m2 T + 362 LAI_UNDERSTORY_SCLS number of understory plants by size class indiv/ha T + 363 LAKEICEFRAC lake layer ice mass fraction unitless F + 364 LAKEICEFRAC_SURF surface lake layer ice mass fraction unitless T + 365 LAKEICETHICK thickness of lake ice (including physical expansion on freezing) m T + 366 LEAFC Total carbon in live plant leaves kgC ha-1 T + 367 LEAFC_SCPF leaf carbon mass by size-class x pft kgC/ha F + 368 LEAF_HEIGHT_DIST leaf height distribution m2/m2 T + 369 LEAF_MD_CANOPY_SCLS LEAF_MD for canopy plants by size class kg C / ha / yr F + 370 LEAF_MD_UNDERSTORY_SCLS LEAF_MD for understory plants by size class kg C / ha / yr F + 371 LEAF_MR RDARK (leaf maintenance respiration) kg C / m2 / yr T + 372 LIG_LITC LIG_LIT C gC/m^2 T + 373 LIG_LITC_1m LIG_LIT C to 1 meter gC/m^2 F + 374 LIG_LITC_TNDNCY_VERT_TRA lignin litter C tendency due to vertical transport gC/m^3/s F + 375 LIG_LITC_TO_SLO_SOMC decomp. of lignin litter C to slow soil organic ma C gC/m^2/s F + 376 LIG_LITC_TO_SLO_SOMC_vr decomp. of lignin litter C to slow soil organic ma C gC/m^3/s F + 377 LIG_LITC_vr LIG_LIT C (vertically resolved) gC/m^3 T + 378 LIG_LITN LIG_LIT N gN/m^2 T + 379 LIG_LITN_1m LIG_LIT N to 1 meter gN/m^2 F + 380 LIG_LITN_TNDNCY_VERT_TRA lignin litter N tendency due to vertical transport gN/m^3/s F + 381 LIG_LITN_TO_SLO_SOMN decomp. of lignin litter N to slow soil organic ma N gN/m^2 F + 382 LIG_LITN_TO_SLO_SOMN_vr decomp. of lignin litter N to slow soil organic ma N gN/m^3 F + 383 LIG_LITN_vr LIG_LIT N (vertically resolved) gN/m^3 T + 384 LIG_LIT_HR Het. Resp. from lignin litter gC/m^2/s F + 385 LIG_LIT_HR_vr Het. Resp. from lignin litter gC/m^3/s F + 386 LIQCAN intercepted liquid water mm T + 387 LIQUID_CONTENT1 initial gridcell total liq content mm T + 388 LIQUID_CONTENT2 post landuse change gridcell total liq content mm F + 389 LIQUID_WATER_TEMP1 initial gridcell weighted average liquid water temperature K F + 390 LITTERC_HR litter C heterotrophic respiration gC/m^2/s T + 391 LITTER_CWD total mass of litter in CWD kg ha-1 T + 392 LITTER_CWD_AG_ELEM mass of above ground litter in CWD (trunks/branches/twigs) kg ha-1 T + 393 LITTER_CWD_BG_ELEM mass of below ground litter in CWD (coarse roots) kg ha-1 T + 394 LITTER_FINES_AG_ELEM mass of above ground litter in fines (leaves,nonviable seed) kg ha-1 T + 395 LITTER_FINES_BG_ELEM mass of below ground litter in fines (fineroots) kg ha-1 T + 396 LITTER_IN FATES litter flux in gC m-2 s-1 T + 397 LITTER_IN_ELEM FATES litter flux in kg ha-1 d-1 T + 398 LITTER_OUT FATES litter flux out gC m-2 s-1 T + 399 LITTER_OUT_ELEM FATES litter flux out (fragmentation only) kg ha-1 d-1 T + 400 LIVECROOT_MR live coarse root maintenance respiration) kg C / m2 / yr T + 401 LIVECROOT_MR_CANOPY_SCLS LIVECROOT_MR for canopy plants by size class kg C / ha / yr F + 402 LIVECROOT_MR_UNDERSTORY_SCLS LIVECROOT_MR for understory plants by size class kg C / ha / yr F + 403 LIVESTEM_MR live stem maintenance respiration) kg C / m2 / yr T + 404 LIVESTEM_MR_CANOPY_SCLS LIVESTEM_MR for canopy plants by size class kg C / ha / yr F + 405 LIVESTEM_MR_UNDERSTORY_SCLS LIVESTEM_MR for understory plants by size class kg C / ha / yr F + 406 LNC leaf N concentration gN leaf/m^2 T + 407 LWdown atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 F + 408 LWup upwelling longwave radiation W/m^2 F + 409 M10_CACLS age senescence mortality by cohort age N/ha/yr T + 410 M10_CAPF age senescence mortality by pft/cohort age N/ha/yr F + 411 M10_SCLS age senescence mortality by size N/ha/yr T + 412 M10_SCPF age senescence mortality by pft/size N/ha/yr F + 413 M1_SCLS background mortality by size N/ha/yr T + 414 M1_SCPF background mortality by pft/size N/ha/yr F + 415 M2_SCLS hydraulic mortality by size N/ha/yr T + 416 M2_SCPF hydraulic mortality by pft/size N/ha/yr F + 417 M3_SCLS carbon starvation mortality by size N/ha/yr T + 418 M3_SCPF carbon starvation mortality by pft/size N/ha/yr F + 419 M4_SCLS impact mortality by size N/ha/yr T + 420 M4_SCPF impact mortality by pft/size N/ha/yr F + 421 M5_SCLS fire mortality by size N/ha/yr T + 422 M5_SCPF fire mortality by pft/size N/ha/yr F + 423 M6_SCLS termination mortality by size N/ha/yr T + 424 M6_SCPF termination mortality by pft/size N/ha/yr F + 425 M7_SCLS logging mortality by size N/ha/event T + 426 M7_SCPF logging mortality by pft/size N/ha/event F + 427 M8_SCLS freezing mortality by size N/ha/event T + 428 M8_SCPF freezing mortality by pft/size N/ha/yr F + 429 M9_SCLS senescence mortality by size N/ha/yr T + 430 M9_SCPF senescence mortality by pft/size N/ha/yr F + 431 MAINT_RESP maintenance respiration gC/m^2/s T + 432 MET_LITC MET_LIT C gC/m^2 T + 433 MET_LITC_1m MET_LIT C to 1 meter gC/m^2 F + 434 MET_LITC_TNDNCY_VERT_TRA metabolic litter C tendency due to vertical transport gC/m^3/s F + 435 MET_LITC_TO_ACT_SOMC decomp. of metabolic litter C to active soil organic C gC/m^2/s F + 436 MET_LITC_TO_ACT_SOMC_vr decomp. of metabolic litter C to active soil organic C gC/m^3/s F + 437 MET_LITC_vr MET_LIT C (vertically resolved) gC/m^3 T + 438 MET_LITN MET_LIT N gN/m^2 T + 439 MET_LITN_1m MET_LIT N to 1 meter gN/m^2 F + 440 MET_LITN_TNDNCY_VERT_TRA metabolic litter N tendency due to vertical transport gN/m^3/s F + 441 MET_LITN_TO_ACT_SOMN decomp. of metabolic litter N to active soil organic N gN/m^2 F + 442 MET_LITN_TO_ACT_SOMN_vr decomp. of metabolic litter N to active soil organic N gN/m^3 F + 443 MET_LITN_vr MET_LIT N (vertically resolved) gN/m^3 T + 444 MET_LIT_HR Het. Resp. from metabolic litter gC/m^2/s F + 445 MET_LIT_HR_vr Het. Resp. from metabolic litter gC/m^3/s F + 446 MORTALITY Rate of total mortality by PFT indiv/ha/yr T + 447 MORTALITY_CANOPY_SCAG mortality rate of canopy plants in each size x age class plants/ha/yr F + 448 MORTALITY_CANOPY_SCLS total mortality of canopy trees by size class indiv/ha/yr T + 449 MORTALITY_CANOPY_SCPF total mortality of canopy plants by pft/size N/ha/yr F + 450 MORTALITY_CARBONFLUX_CANOPY flux of biomass carbon from live to dead pools from mortality of canopy plants gC/m2/s T + 451 MORTALITY_CARBONFLUX_UNDERSTORY flux of biomass carbon from live to dead pools from mortality of understory plants gC/m2/s T + 452 MORTALITY_UNDERSTORY_SCAG mortality rate of understory plantsin each size x age class plants/ha/yr F + 453 MORTALITY_UNDERSTORY_SCLS total mortality of understory trees by size class indiv/ha/yr T + 454 MORTALITY_UNDERSTORY_SCPF total mortality of understory plants by pft/size N/ha/yr F + 455 M_ACT_SOMC_TO_LEACHING active soil organic C leaching loss gC/m^2/s F + 456 M_ACT_SOMN_TO_LEACHING active soil organic N leaching loss gN/m^2/s F + 457 M_CEL_LITC_TO_LEACHING cellulosic litter C leaching loss gC/m^2/s F + 458 M_CEL_LITN_TO_LEACHING cellulosic litter N leaching loss gN/m^2/s F + 459 M_LIG_LITC_TO_LEACHING lignin litter C leaching loss gC/m^2/s F + 460 M_LIG_LITN_TO_LEACHING lignin litter N leaching loss gN/m^2/s F + 461 M_MET_LITC_TO_LEACHING metabolic litter C leaching loss gC/m^2/s F + 462 M_MET_LITN_TO_LEACHING metabolic litter N leaching loss gN/m^2/s F + 463 M_PAS_SOMC_TO_LEACHING passive soil organic C leaching loss gC/m^2/s F + 464 M_PAS_SOMN_TO_LEACHING passive soil organic N leaching loss gN/m^2/s F + 465 M_SLO_SOMC_TO_LEACHING slow soil organic ma C leaching loss gC/m^2/s F + 466 M_SLO_SOMN_TO_LEACHING slow soil organic ma N leaching loss gN/m^2/s F + 467 NCL_BY_AGE number of canopy levels by age bin -- F + 468 NDEP_TO_SMINN atmospheric N deposition to soil mineral N gN/m^2/s T + 469 NEM Gridcell net adjustment to net carbon exchange passed to atm. for methane production gC/m2/s T + 470 NEP net ecosystem production gC/m^2/s T + 471 NET_C_UPTAKE_CNLF net carbon uptake by each canopy and leaf layer per unit ground area (i.e. divide by CROWNAREA gC/m2/s F + 472 NET_NMIN net rate of N mineralization gN/m^2/s T + 473 NFIX_TO_SMINN symbiotic/asymbiotic N fixation to soil mineral N gN/m^2/s T + 474 NPATCH_BY_AGE number of patches by age bin -- F + 475 NPLANT_CACLS number of plants by coage class indiv/ha T + 476 NPLANT_CANOPY_SCAG number of plants per hectare in canopy in each size x age class plants/ha F + 477 NPLANT_CANOPY_SCLS number of canopy plants by size class indiv/ha T + 478 NPLANT_CANOPY_SCPF stem number of canopy plants density by pft/size N/ha F + 479 NPLANT_CAPF stem number density by pft/coage N/ha F + 480 NPLANT_SCAG number of plants per hectare in each size x age class plants/ha T + 481 NPLANT_SCAGPFT number of plants per hectare in each size x age x pft class plants/ha F + 482 NPLANT_SCLS number of plants by size class indiv/ha T + 483 NPLANT_SCPF stem number density by pft/size N/ha F + 484 NPLANT_UNDERSTORY_SCAG number of plants per hectare in understory in each size x age class plants/ha F + 485 NPLANT_UNDERSTORY_SCLS number of understory plants by size class indiv/ha T + 486 NPLANT_UNDERSTORY_SCPF stem number of understory plants density by pft/size N/ha F + 487 NPP net primary production gC/m^2/s T + 488 NPP_AGDW_SCPF NPP flux into above-ground deadwood by pft/size kgC/m2/yr F + 489 NPP_AGEPFT NPP per PFT in each age bin kgC/m2/yr F + 490 NPP_AGSW_SCPF NPP flux into above-ground sapwood by pft/size kgC/m2/yr F + 491 NPP_BDEAD_CANOPY_SCLS NPP_BDEAD for canopy plants by size class kg C / ha / yr F + 492 NPP_BDEAD_UNDERSTORY_SCLS NPP_BDEAD for understory plants by size class kg C / ha / yr F + 493 NPP_BGDW_SCPF NPP flux into below-ground deadwood by pft/size kgC/m2/yr F + 494 NPP_BGSW_SCPF NPP flux into below-ground sapwood by pft/size kgC/m2/yr F + 495 NPP_BSEED_CANOPY_SCLS NPP_BSEED for canopy plants by size class kg C / ha / yr F + 496 NPP_BSEED_UNDERSTORY_SCLS NPP_BSEED for understory plants by size class kg C / ha / yr F + 497 NPP_BSW_CANOPY_SCLS NPP_BSW for canopy plants by size class kg C / ha / yr F + 498 NPP_BSW_UNDERSTORY_SCLS NPP_BSW for understory plants by size class kg C / ha / yr F + 499 NPP_BY_AGE net primary productivity by age bin gC/m^2/s F + 500 NPP_CROOT NPP flux into coarse roots kgC/m2/yr T + 501 NPP_FNRT_SCPF NPP flux into fine roots by pft/size kgC/m2/yr F + 502 NPP_FROOT NPP flux into fine roots kgC/m2/yr T + 503 NPP_FROOT_CANOPY_SCLS NPP_FROOT for canopy plants by size class kg C / ha / yr F + 504 NPP_FROOT_UNDERSTORY_SCLS NPP_FROOT for understory plants by size class kg C / ha / yr F + 505 NPP_LEAF NPP flux into leaves kgC/m2/yr T + 506 NPP_LEAF_CANOPY_SCLS NPP_LEAF for canopy plants by size class kg C / ha / yr F + 507 NPP_LEAF_SCPF NPP flux into leaves by pft/size kgC/m2/yr F + 508 NPP_LEAF_UNDERSTORY_SCLS NPP_LEAF for understory plants by size class kg C / ha / yr F + 509 NPP_SCPF total net primary production by pft/size kgC/m2/yr F + 510 NPP_SEED NPP flux into seeds kgC/m2/yr T + 511 NPP_SEED_SCPF NPP flux into seeds by pft/size kgC/m2/yr F + 512 NPP_STEM NPP flux into stem kgC/m2/yr T + 513 NPP_STOR NPP flux into storage tissues kgC/m2/yr T + 514 NPP_STORE_CANOPY_SCLS NPP_STORE for canopy plants by size class kg C / ha / yr F + 515 NPP_STORE_UNDERSTORY_SCLS NPP_STORE for understory plants by size class kg C / ha / yr F + 516 NPP_STOR_SCPF NPP flux into storage by pft/size kgC/m2/yr F + 517 NSUBSTEPS number of adaptive timesteps in CLM timestep unitless F + 518 O2_DECOMP_DEPTH_UNSAT O2 consumption from HR and AR for non-inundated area mol/m3/s F + 519 OBU Monin-Obukhov length m F + 520 OCDEP total OC deposition (dry+wet) from atmosphere kg/m^2/s T + 521 O_SCALAR fraction by which decomposition is reduced due to anoxia unitless T + 522 PARPROF_DIF_CNLF Radiative profile of diffuse PAR through each canopy and leaf layer (averaged across PFTs) W/m2 F + 523 PARPROF_DIF_CNLFPFT Radiative profile of diffuse PAR through each canopy, leaf, and PFT W/m2 F + 524 PARPROF_DIR_CNLF Radiative profile of direct PAR through each canopy and leaf layer (averaged across PFTs) W/m2 F + 525 PARPROF_DIR_CNLFPFT Radiative profile of direct PAR through each canopy, leaf, and PFT W/m2 F + 526 PARSHA_Z_CAN PAR absorbed in the shade by top leaf layer in each canopy layer W/m2 F + 527 PARSHA_Z_CNLF PAR absorbed in the shade by each canopy and leaf layer W/m2 F + 528 PARSHA_Z_CNLFPFT PAR absorbed in the shade by each canopy, leaf, and PFT W/m2 F + 529 PARSUN_Z_CAN PAR absorbed in the sun by top leaf layer in each canopy layer W/m2 F + 530 PARSUN_Z_CNLF PAR absorbed in the sun by each canopy and leaf layer W/m2 F + 531 PARSUN_Z_CNLFPFT PAR absorbed in the sun by each canopy, leaf, and PFT W/m2 F + 532 PARVEGLN absorbed par by vegetation at local noon W/m^2 T + 533 PAS_SOMC PAS_SOM C gC/m^2 T + 534 PAS_SOMC_1m PAS_SOM C to 1 meter gC/m^2 F + 535 PAS_SOMC_TNDNCY_VERT_TRA passive soil organic C tendency due to vertical transport gC/m^3/s F + 536 PAS_SOMC_TO_ACT_SOMC decomp. of passive soil organic C to active soil organic C gC/m^2/s F + 537 PAS_SOMC_TO_ACT_SOMC_vr decomp. of passive soil organic C to active soil organic C gC/m^3/s F + 538 PAS_SOMC_vr PAS_SOM C (vertically resolved) gC/m^3 T + 539 PAS_SOMN PAS_SOM N gN/m^2 T + 540 PAS_SOMN_1m PAS_SOM N to 1 meter gN/m^2 F + 541 PAS_SOMN_TNDNCY_VERT_TRA passive soil organic N tendency due to vertical transport gN/m^3/s F + 542 PAS_SOMN_TO_ACT_SOMN decomp. of passive soil organic N to active soil organic N gN/m^2 F + 543 PAS_SOMN_TO_ACT_SOMN_vr decomp. of passive soil organic N to active soil organic N gN/m^3 F + 544 PAS_SOMN_vr PAS_SOM N (vertically resolved) gN/m^3 T + 545 PAS_SOM_HR Het. Resp. from passive soil organic gC/m^2/s F + 546 PAS_SOM_HR_vr Het. Resp. from passive soil organic gC/m^3/s F + 547 PATCH_AREA_BY_AGE patch area by age bin m2/m2 T + 548 PBOT atmospheric pressure at surface (downscaled to columns in glacier regions) Pa T + 549 PCH4 atmospheric partial pressure of CH4 Pa T + 550 PCO2 atmospheric partial pressure of CO2 Pa T + 551 PFTbiomass total PFT level biomass gC/m2 T + 552 PFTcanopycrownarea total PFT-level canopy-layer crown area m2/m2 F + 553 PFTcrownarea total PFT level crown area m2/m2 F + 554 PFTgpp total PFT-level GPP kg C m-2 y-1 T + 555 PFTleafbiomass total PFT level leaf biomass gC/m2 T + 556 PFTnindivs total PFT level number of individuals indiv / m2 T + 557 PFTnpp total PFT-level NPP kg C m-2 y-1 T + 558 PFTstorebiomass total PFT level stored biomass gC/m2 T + 559 POTENTIAL_IMMOB potential N immobilization gN/m^2/s T + 560 PRIMARYLAND_PATCHFUSION_ERROR Error in total primary lands associated with patch fusion m2 m-2 d-1 T + 561 PROMOTION_CARBONFLUX promotion-associated biomass carbon flux from understory to canopy gC/m2/s T + 562 PROMOTION_RATE_SCLS promotion rate from understory to canopy by size class indiv/ha/yr F + 563 PSurf atmospheric pressure at surface (downscaled to columns in glacier regions) Pa F + 564 Q2M 2m specific humidity kg/kg T + 565 QAF canopy air humidity kg/kg F + 566 QBOT atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg T + 567 QDIRECT_THROUGHFALL direct throughfall of liquid (rain + above-canopy irrigation) mm/s F + 568 QDIRECT_THROUGHFALL_SNOW direct throughfall of snow mm/s F + 569 QDRAI sub-surface drainage mm/s T + 570 QDRAI_PERCH perched wt drainage mm/s T + 571 QDRAI_XS saturation excess drainage mm/s T + 572 QDRIP rate of excess canopy liquid falling off canopy mm/s F + 573 QDRIP_SNOW rate of excess canopy snow falling off canopy mm/s F + 574 QFLOOD runoff from river flooding mm/s T + 575 QFLX_EVAP_TOT qflx_evap_soi + qflx_evap_can + qflx_tran_veg kg m-2 s-1 T + 576 QFLX_EVAP_VEG vegetation evaporation mm H2O/s F + 577 QFLX_ICE_DYNBAL ice dynamic land cover change conversion runoff flux mm/s T + 578 QFLX_LIQDEW_TO_TOP_LAYER rate of liquid water deposited on top soil or snow layer (dew) mm H2O/s T + 579 QFLX_LIQEVAP_FROM_TOP_LAYER rate of liquid water evaporated from top soil or snow layer mm H2O/s T + 580 QFLX_LIQ_DYNBAL liq dynamic land cover change conversion runoff flux mm/s T + 581 QFLX_LIQ_GRND liquid (rain+irrigation) on ground after interception mm H2O/s F + 582 QFLX_SNOW_DRAIN drainage from snow pack mm/s T + 583 QFLX_SNOW_DRAIN_ICE drainage from snow pack melt (ice landunits only) mm/s T + 584 QFLX_SNOW_GRND snow on ground after interception mm H2O/s F + 585 QFLX_SOLIDDEW_TO_TOP_LAYER rate of solid water deposited on top soil or snow layer (frost) mm H2O/s T + 586 QFLX_SOLIDEVAP_FROM_TOP_LAYER rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s T + 587 QFLX_SOLIDEVAP_FROM_TOP_LAYER_ICE rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s F + 588 QH2OSFC surface water runoff mm/s T + 589 QH2OSFC_TO_ICE surface water converted to ice mm/s F + 590 QHR hydraulic redistribution mm/s T + 591 QICE ice growth/melt mm/s T + 592 QICE_FORC qice forcing sent to GLC mm/s F + 593 QICE_FRZ ice growth mm/s T + 594 QICE_MELT ice melt mm/s T + 595 QINFL infiltration mm/s T + 596 QINTR interception mm/s T + 597 QIRRIG_DEMAND irrigation demand mm/s F + 598 QIRRIG_DRIP water added via drip irrigation mm/s F + 599 QIRRIG_FROM_GW_CONFINED water added through confined groundwater irrigation mm/s T + 600 QIRRIG_FROM_GW_UNCONFINED water added through unconfined groundwater irrigation mm/s T + 601 QIRRIG_FROM_SURFACE water added through surface water irrigation mm/s T + 602 QIRRIG_SPRINKLER water added via sprinkler irrigation mm/s F + 603 QOVER total surface runoff (includes QH2OSFC) mm/s T + 604 QOVER_LAG time-lagged surface runoff for soil columns mm/s F + 605 QPHSNEG net negative hydraulic redistribution flux mm/s F + 606 QRGWL surface runoff at glaciers (liquid only), wetlands, lakes; also includes melted ice runoff fro mm/s T + 607 QROOTSINK water flux from soil to root in each soil-layer mm/s F + 608 QRUNOFF total liquid runoff not including correction for land use change mm/s T + 609 QRUNOFF_ICE total liquid runoff not incl corret for LULCC (ice landunits only) mm/s T + 610 QRUNOFF_ICE_TO_COUPLER total ice runoff sent to coupler (includes corrections for land use change) mm/s T + 611 QRUNOFF_ICE_TO_LIQ liquid runoff from converted ice runoff mm/s F + 612 QRUNOFF_R Rural total runoff mm/s F + 613 QRUNOFF_TO_COUPLER total liquid runoff sent to coupler (includes corrections for land use change) mm/s T + 614 QRUNOFF_U Urban total runoff mm/s F + 615 QSNOCPLIQ excess liquid h2o due to snow capping not including correction for land use change mm H2O/s T + 616 QSNOEVAP evaporation from snow (only when snl<0, otherwise it is equal to qflx_ev_soil) mm/s T + 617 QSNOFRZ column-integrated snow freezing rate kg/m2/s T + 618 QSNOFRZ_ICE column-integrated snow freezing rate (ice landunits only) mm/s T + 619 QSNOMELT snow melt rate mm/s T + 620 QSNOMELT_ICE snow melt (ice landunits only) mm/s T + 621 QSNOUNLOAD canopy snow unloading mm/s T + 622 QSNO_TEMPUNLOAD canopy snow temp unloading mm/s T + 623 QSNO_WINDUNLOAD canopy snow wind unloading mm/s T + 624 QSNWCPICE excess solid h2o due to snow capping not including correction for land use change mm H2O/s T + 625 QSOIL Ground evaporation (soil/snow evaporation + soil/snow sublimation - dew) mm/s T + 626 QSOIL_ICE Ground evaporation (ice landunits only) mm/s T + 627 QTOPSOIL water input to surface mm/s F + 628 QVEGE canopy evaporation mm/s T + 629 QVEGT canopy transpiration mm/s T + 630 Qair atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg F + 631 Qh sensible heat W/m^2 F + 632 Qle total evaporation W/m^2 F + 633 Qstor storage heat flux (includes snowmelt) W/m^2 F + 634 Qtau momentum flux kg/m/s^2 F + 635 RAH1 aerodynamical resistance s/m F + 636 RAH2 aerodynamical resistance s/m F + 637 RAIN atmospheric rain, after rain/snow repartitioning based on temperature mm/s T + 638 RAIN_FROM_ATM atmospheric rain received from atmosphere (pre-repartitioning) mm/s T + 639 RAIN_ICE atmospheric rain, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F + 640 RAM_LAKE aerodynamic resistance for momentum (lakes only) s/m F + 641 RAW1 aerodynamical resistance s/m F + 642 RAW2 aerodynamical resistance s/m F + 643 RB leaf boundary resistance s/m F + 644 RDARK_CANOPY_SCLS RDARK for canopy plants by size class kg C / ha / yr F + 645 RDARK_UNDERSTORY_SCLS RDARK for understory plants by size class kg C / ha / yr F + 646 RECRUITMENT Rate of recruitment by PFT indiv/ha/yr T + 647 REPROC Total carbon in live plant reproductive tissues kgC ha-1 T + 648 REPROC_SCPF reproductive carbon mass (on plant) by size-class x pft kgC/ha F + 649 RESP_G_CANOPY_SCLS RESP_G for canopy plants by size class kg C / ha / yr F + 650 RESP_G_UNDERSTORY_SCLS RESP_G for understory plants by size class kg C / ha / yr F + 651 RESP_M_CANOPY_SCLS RESP_M for canopy plants by size class kg C / ha / yr F + 652 RESP_M_UNDERSTORY_SCLS RESP_M for understory plants by size class kg C / ha / yr F + 653 RH atmospheric relative humidity % F + 654 RH2M 2m relative humidity % T + 655 RH2M_R Rural 2m specific humidity % F + 656 RH2M_U Urban 2m relative humidity % F + 657 RHAF fractional humidity of canopy air fraction F + 658 RH_LEAF fractional humidity at leaf surface fraction F + 659 ROOT_MD_CANOPY_SCLS ROOT_MD for canopy plants by size class kg C / ha / yr F + 660 ROOT_MD_UNDERSTORY_SCLS ROOT_MD for understory plants by size class kg C / ha / yr F + 661 RSCANOPY canopy resistance s m-1 T + 662 RSSHA shaded leaf stomatal resistance s/m T + 663 RSSUN sunlit leaf stomatal resistance s/m T + 664 Rainf atmospheric rain, after rain/snow repartitioning based on temperature mm/s F + 665 Rnet net radiation W/m^2 F + 666 SABG solar rad absorbed by ground W/m^2 T + 667 SABG_PEN Rural solar rad penetrating top soil or snow layer watt/m^2 T + 668 SABV solar rad absorbed by veg W/m^2 T + 669 SAI_CANOPY_SCLS stem area index(SAI) by size class m2/m2 F + 670 SAI_UNDERSTORY_SCLS number of understory plants by size class indiv/ha F + 671 SAPWC Total carbon in live plant sapwood kgC ha-1 T + 672 SAPWC_SCPF sapwood carbon mass by size-class x pft kgC/ha F + 673 SCORCH_HEIGHT SPITFIRE Flame Scorch Height (calculated per PFT in each patch age bin) m T + 674 SECONDARY_AREA_AGE_ANTHRO_DIST Secondary forest patch area age distribution since anthropgenic disturbance m2/m2 F + 675 SECONDARY_AREA_PATCH_AGE_DIST Secondary forest patch area age distribution since any kind of disturbance m2/m2 F + 676 SECONDARY_FOREST_BIOMASS Biomass on secondary lands (per total site area, mult by SECONDARY_FOREST_FRACTION to get per kgC/m2 F + 677 SECONDARY_FOREST_FRACTION Secondary forest fraction m2/m2 F + 678 SEEDS_IN Seed Production Rate gC m-2 s-1 T + 679 SEEDS_IN_EXTERN_ELEM External Seed Influx Rate kg ha-1 d-1 T + 680 SEEDS_IN_LOCAL_ELEM Within Site Seed Production Rate kg ha-1 d-1 T + 681 SEED_BANK Total Seed Mass of all PFTs gC m-2 T + 682 SEED_BANK_ELEM Total Seed Mass of all PFTs kg ha-1 T + 683 SEED_DECAY_ELEM Seed mass decay (germinated and un-germinated) kg ha-1 d-1 T + 684 SEED_GERM_ELEM Seed mass converted into new cohorts kg ha-1 d-1 T + 685 SEED_PROD_CANOPY_SCLS SEED_PROD for canopy plants by size class kg C / ha / yr F + 686 SEED_PROD_UNDERSTORY_SCLS SEED_PROD for understory plants by size class kg C / ha / yr F + 687 SITE_COLD_STATUS Site level cold status, 0=not cold-dec, 1=too cold for leaves, 2=not-too cold 0,1,2 T + 688 SITE_DAYSINCE_COLDLEAFOFF site level days elapsed since cold leaf drop days T + 689 SITE_DAYSINCE_COLDLEAFON site level days elapsed since cold leaf flush days T + 690 SITE_DAYSINCE_DROUGHTLEAFOFF site level days elapsed since drought leaf drop days T + 691 SITE_DAYSINCE_DROUGHTLEAFON site level days elapsed since drought leaf flush days T + 692 SITE_DROUGHT_STATUS Site level drought status, <2 too dry for leaves, >=2 not-too dry 0,1,2,3 T + 693 SITE_GDD site level growing degree days degC T + 694 SITE_MEANLIQVOL_DROUGHTPHEN site level mean liquid water volume for drought phen m3/m3 T + 695 SITE_NCHILLDAYS site level number of chill days days T + 696 SITE_NCOLDDAYS site level number of cold days days T + 697 SLO_SOMC SLO_SOM C gC/m^2 T + 698 SLO_SOMC_1m SLO_SOM C to 1 meter gC/m^2 F + 699 SLO_SOMC_TNDNCY_VERT_TRA slow soil organic ma C tendency due to vertical transport gC/m^3/s F + 700 SLO_SOMC_TO_ACT_SOMC decomp. of slow soil organic ma C to active soil organic C gC/m^2/s F + 701 SLO_SOMC_TO_ACT_SOMC_vr decomp. of slow soil organic ma C to active soil organic C gC/m^3/s F + 702 SLO_SOMC_TO_PAS_SOMC decomp. of slow soil organic ma C to passive soil organic C gC/m^2/s F + 703 SLO_SOMC_TO_PAS_SOMC_vr decomp. of slow soil organic ma C to passive soil organic C gC/m^3/s F + 704 SLO_SOMC_vr SLO_SOM C (vertically resolved) gC/m^3 T + 705 SLO_SOMN SLO_SOM N gN/m^2 T + 706 SLO_SOMN_1m SLO_SOM N to 1 meter gN/m^2 F + 707 SLO_SOMN_TNDNCY_VERT_TRA slow soil organic ma N tendency due to vertical transport gN/m^3/s F + 708 SLO_SOMN_TO_ACT_SOMN decomp. of slow soil organic ma N to active soil organic N gN/m^2 F + 709 SLO_SOMN_TO_ACT_SOMN_vr decomp. of slow soil organic ma N to active soil organic N gN/m^3 F + 710 SLO_SOMN_TO_PAS_SOMN decomp. of slow soil organic ma N to passive soil organic N gN/m^2 F + 711 SLO_SOMN_TO_PAS_SOMN_vr decomp. of slow soil organic ma N to passive soil organic N gN/m^3 F + 712 SLO_SOMN_vr SLO_SOM N (vertically resolved) gN/m^3 T + 713 SLO_SOM_HR_S1 Het. Resp. from slow soil organic ma gC/m^2/s F + 714 SLO_SOM_HR_S1_vr Het. Resp. from slow soil organic ma gC/m^3/s F + 715 SLO_SOM_HR_S3 Het. Resp. from slow soil organic ma gC/m^2/s F + 716 SLO_SOM_HR_S3_vr Het. Resp. from slow soil organic ma gC/m^3/s F + 717 SMINN soil mineral N gN/m^2 T + 718 SMINN_LEACHED soil mineral N pool loss to leaching gN/m^2/s T + 719 SMINN_LEACHED_vr soil mineral N pool loss to leaching gN/m^3/s F + 720 SMINN_TO_DENIT_EXCESS denitrification from excess mineral N pool gN/m^2/s F + 721 SMINN_TO_DENIT_EXCESS_vr denitrification from excess mineral N pool gN/m^3/s F + 722 SMINN_TO_DENIT_L1S1 denitrification for decomp. of metabolic litterto ACT_SOM gN/m^2 F + 723 SMINN_TO_DENIT_L1S1_vr denitrification for decomp. of metabolic litterto ACT_SOM gN/m^3 F + 724 SMINN_TO_DENIT_L2S1 denitrification for decomp. of cellulosic litterto ACT_SOM gN/m^2 F + 725 SMINN_TO_DENIT_L2S1_vr denitrification for decomp. of cellulosic litterto ACT_SOM gN/m^3 F + 726 SMINN_TO_DENIT_L3S2 denitrification for decomp. of lignin litterto SLO_SOM gN/m^2 F + 727 SMINN_TO_DENIT_L3S2_vr denitrification for decomp. of lignin litterto SLO_SOM gN/m^3 F + 728 SMINN_TO_DENIT_S1S2 denitrification for decomp. of active soil organicto SLO_SOM gN/m^2 F + 729 SMINN_TO_DENIT_S1S2_vr denitrification for decomp. of active soil organicto SLO_SOM gN/m^3 F + 730 SMINN_TO_DENIT_S1S3 denitrification for decomp. of active soil organicto PAS_SOM gN/m^2 F + 731 SMINN_TO_DENIT_S1S3_vr denitrification for decomp. of active soil organicto PAS_SOM gN/m^3 F + 732 SMINN_TO_DENIT_S2S1 denitrification for decomp. of slow soil organic mato ACT_SOM gN/m^2 F + 733 SMINN_TO_DENIT_S2S1_vr denitrification for decomp. of slow soil organic mato ACT_SOM gN/m^3 F + 734 SMINN_TO_DENIT_S2S3 denitrification for decomp. of slow soil organic mato PAS_SOM gN/m^2 F + 735 SMINN_TO_DENIT_S2S3_vr denitrification for decomp. of slow soil organic mato PAS_SOM gN/m^3 F + 736 SMINN_TO_DENIT_S3S1 denitrification for decomp. of passive soil organicto ACT_SOM gN/m^2 F + 737 SMINN_TO_DENIT_S3S1_vr denitrification for decomp. of passive soil organicto ACT_SOM gN/m^3 F + 738 SMINN_TO_PLANT plant uptake of soil mineral N gN/m^2/s T + 739 SMINN_TO_S1N_L1 mineral N flux for decomp. of MET_LITto ACT_SOM gN/m^2 F + 740 SMINN_TO_S1N_L1_vr mineral N flux for decomp. of MET_LITto ACT_SOM gN/m^3 F + 741 SMINN_TO_S1N_L2 mineral N flux for decomp. of CEL_LITto ACT_SOM gN/m^2 F + 742 SMINN_TO_S1N_L2_vr mineral N flux for decomp. of CEL_LITto ACT_SOM gN/m^3 F + 743 SMINN_TO_S1N_S2 mineral N flux for decomp. of SLO_SOMto ACT_SOM gN/m^2 F + 744 SMINN_TO_S1N_S2_vr mineral N flux for decomp. of SLO_SOMto ACT_SOM gN/m^3 F + 745 SMINN_TO_S1N_S3 mineral N flux for decomp. of PAS_SOMto ACT_SOM gN/m^2 F + 746 SMINN_TO_S1N_S3_vr mineral N flux for decomp. of PAS_SOMto ACT_SOM gN/m^3 F + 747 SMINN_TO_S2N_L3 mineral N flux for decomp. of LIG_LITto SLO_SOM gN/m^2 F + 748 SMINN_TO_S2N_L3_vr mineral N flux for decomp. of LIG_LITto SLO_SOM gN/m^3 F + 749 SMINN_TO_S2N_S1 mineral N flux for decomp. of ACT_SOMto SLO_SOM gN/m^2 F + 750 SMINN_TO_S2N_S1_vr mineral N flux for decomp. of ACT_SOMto SLO_SOM gN/m^3 F + 751 SMINN_TO_S3N_S1 mineral N flux for decomp. of ACT_SOMto PAS_SOM gN/m^2 F + 752 SMINN_TO_S3N_S1_vr mineral N flux for decomp. of ACT_SOMto PAS_SOM gN/m^3 F + 753 SMINN_TO_S3N_S2 mineral N flux for decomp. of SLO_SOMto PAS_SOM gN/m^2 F + 754 SMINN_TO_S3N_S2_vr mineral N flux for decomp. of SLO_SOMto PAS_SOM gN/m^3 F + 755 SMINN_vr soil mineral N gN/m^3 T + 756 SMP soil matric potential (natural vegetated and crop landunits only) mm T + 757 SNOBCMCL mass of BC in snow column kg/m2 T + 758 SNOBCMSL mass of BC in top snow layer kg/m2 T + 759 SNOCAN intercepted snow mm T + 760 SNODSTMCL mass of dust in snow column kg/m2 T + 761 SNODSTMSL mass of dust in top snow layer kg/m2 T + 762 SNOFSDSND direct nir incident solar radiation on snow W/m^2 F + 763 SNOFSDSNI diffuse nir incident solar radiation on snow W/m^2 F + 764 SNOFSDSVD direct vis incident solar radiation on snow W/m^2 F + 765 SNOFSDSVI diffuse vis incident solar radiation on snow W/m^2 F + 766 SNOFSRND direct nir reflected solar radiation from snow W/m^2 T + 767 SNOFSRNI diffuse nir reflected solar radiation from snow W/m^2 T + 768 SNOFSRVD direct vis reflected solar radiation from snow W/m^2 T + 769 SNOFSRVI diffuse vis reflected solar radiation from snow W/m^2 T + 770 SNOINTABS Fraction of incoming solar absorbed by lower snow layers - T + 771 SNOLIQFL top snow layer liquid water fraction (land) fraction F + 772 SNOOCMCL mass of OC in snow column kg/m2 T + 773 SNOOCMSL mass of OC in top snow layer kg/m2 T + 774 SNORDSL top snow layer effective grain radius m^-6 F + 775 SNOTTOPL snow temperature (top layer) K F + 776 SNOTTOPL_ICE snow temperature (top layer, ice landunits only) K F + 777 SNOTXMASS snow temperature times layer mass, layer sum; to get mass-weighted temperature, divide by (SNO K kg/m2 T + 778 SNOTXMASS_ICE snow temperature times layer mass, layer sum (ice landunits only); to get mass-weighted temper K kg/m2 F + 779 SNOW atmospheric snow, after rain/snow repartitioning based on temperature mm/s T + 780 SNOWDP gridcell mean snow height m T + 781 SNOWICE snow ice kg/m2 T + 782 SNOWICE_ICE snow ice (ice landunits only) kg/m2 F + 783 SNOWLIQ snow liquid water kg/m2 T + 784 SNOWLIQ_ICE snow liquid water (ice landunits only) kg/m2 F + 785 SNOW_5D 5day snow avg m F + 786 SNOW_DEPTH snow height of snow covered area m T + 787 SNOW_DEPTH_ICE snow height of snow covered area (ice landunits only) m F + 788 SNOW_FROM_ATM atmospheric snow received from atmosphere (pre-repartitioning) mm/s T + 789 SNOW_ICE atmospheric snow, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F + 790 SNOW_PERSISTENCE Length of time of continuous snow cover (nat. veg. landunits only) seconds T + 791 SNOW_SINKS snow sinks (liquid water) mm/s T + 792 SNOW_SOURCES snow sources (liquid water) mm/s T + 793 SNO_ABS Absorbed solar radiation in each snow layer W/m^2 F + 794 SNO_ABS_ICE Absorbed solar radiation in each snow layer (ice landunits only) W/m^2 F + 795 SNO_BW Partial density of water in the snow pack (ice + liquid) kg/m3 F + 796 SNO_BW_ICE Partial density of water in the snow pack (ice + liquid, ice landunits only) kg/m3 F + 797 SNO_EXISTENCE Fraction of averaging period for which each snow layer existed unitless F + 798 SNO_FRZ snow freezing rate in each snow layer kg/m2/s F + 799 SNO_FRZ_ICE snow freezing rate in each snow layer (ice landunits only) mm/s F + 800 SNO_GS Mean snow grain size Microns F + 801 SNO_GS_ICE Mean snow grain size (ice landunits only) Microns F + 802 SNO_ICE Snow ice content kg/m2 F + 803 SNO_LIQH2O Snow liquid water content kg/m2 F + 804 SNO_MELT snow melt rate in each snow layer mm/s F + 805 SNO_MELT_ICE snow melt rate in each snow layer (ice landunits only) mm/s F + 806 SNO_T Snow temperatures K F + 807 SNO_TK Thermal conductivity W/m-K F + 808 SNO_TK_ICE Thermal conductivity (ice landunits only) W/m-K F + 809 SNO_T_ICE Snow temperatures (ice landunits only) K F + 810 SNO_Z Snow layer thicknesses m F + 811 SNO_Z_ICE Snow layer thicknesses (ice landunits only) m F + 812 SNOdTdzL top snow layer temperature gradient (land) K/m F + 813 SOIL10 10-day running mean of 12cm layer soil K F + 814 SOILC_HR soil C heterotrophic respiration gC/m^2/s T + 815 SOILC_vr SOIL C (vertically resolved) gC/m^3 T + 816 SOILICE soil ice (natural vegetated and crop landunits only) kg/m2 T + 817 SOILLIQ soil liquid water (natural vegetated and crop landunits only) kg/m2 T + 818 SOILN_vr SOIL N (vertically resolved) gN/m^3 T + 819 SOILPSI soil water potential in each soil layer MPa F + 820 SOILRESIS soil resistance to evaporation s/m T + 821 SOILWATER_10CM soil liquid water + ice in top 10cm of soil (veg landunits only) kg/m2 T + 822 SOMC_FIRE C loss due to peat burning gC/m^2/s T + 823 SOM_C_LEACHED total flux of C from SOM pools due to leaching gC/m^2/s T + 824 SOM_N_LEACHED total flux of N from SOM pools due to leaching gN/m^2/s F + 825 STOREC Total carbon in live plant storage kgC ha-1 T + 826 STOREC_SCPF storage carbon mass by size-class x pft kgC/ha F + 827 SUM_FUEL total ground fuel related to ros (omits 1000hr fuels) gC m-2 T + 828 SUM_FUEL_BY_PATCH_AGE spitfire ground fuel related to ros (omits 1000hr fuels) within each patch age bin (divide by gC / m2 of site area T + 829 SUPPLEMENT_TO_SMINN supplemental N supply gN/m^2/s T + 830 SWBGT 2 m Simplified Wetbulb Globe Temp C T + 831 SWBGT_R Rural 2 m Simplified Wetbulb Globe Temp C T + 832 SWBGT_U Urban 2 m Simplified Wetbulb Globe Temp C T + 833 SWdown atmospheric incident solar radiation W/m^2 F + 834 SWup upwelling shortwave radiation W/m^2 F + 835 SoilAlpha factor limiting ground evap unitless F + 836 SoilAlpha_U urban factor limiting ground evap unitless F + 837 T10 10-day running mean of 2-m temperature K F + 838 TAF canopy air temperature K F + 839 TAUX zonal surface stress kg/m/s^2 T + 840 TAUY meridional surface stress kg/m/s^2 T + 841 TBOT atmospheric air temperature (downscaled to columns in glacier regions) K T + 842 TBUILD internal urban building air temperature K T + 843 TBUILD_MAX prescribed maximum interior building temperature K F + 844 TFLOOR floor temperature K F + 845 TG ground temperature K T + 846 TG_ICE ground temperature (ice landunits only) K F + 847 TG_R Rural ground temperature K F + 848 TG_U Urban ground temperature K F + 849 TH2OSFC surface water temperature K T + 850 THBOT atmospheric air potential temperature (downscaled to columns in glacier regions) K T + 851 TKE1 top lake level eddy thermal conductivity W/(mK) T + 852 TLAI total projected leaf area index m^2/m^2 T + 853 TLAKE lake temperature K T + 854 TOPO_COL column-level topographic height m F + 855 TOPO_COL_ICE column-level topographic height (ice landunits only) m F + 856 TOPO_FORC topograephic height sent to GLC m F + 857 TOTCOLCH4 total belowground CH4 (0 for non-lake special landunits in the absence of dynamic landunits) gC/m2 T + 858 TOTLITC total litter carbon gC/m^2 T + 859 TOTLITC_1m total litter carbon to 1 meter depth gC/m^2 T + 860 TOTLITN total litter N gN/m^2 T + 861 TOTLITN_1m total litter N to 1 meter gN/m^2 T + 862 TOTSOILICE vertically summed soil cie (veg landunits only) kg/m2 T + 863 TOTSOILLIQ vertically summed soil liquid water (veg landunits only) kg/m2 T + 864 TOTSOMC total soil organic matter carbon gC/m^2 T + 865 TOTSOMC_1m total soil organic matter carbon to 1 meter depth gC/m^2 T + 866 TOTSOMN total soil organic matter N gN/m^2 T + 867 TOTSOMN_1m total soil organic matter N to 1 meter gN/m^2 T + 868 TOTVEGC Total carbon in live plants kgC ha-1 T + 869 TOTVEGC_SCPF total vegetation carbon mass in live plants by size-class x pft kgC/ha F + 870 TRAFFICFLUX sensible heat flux from urban traffic W/m^2 F + 871 TREFMNAV daily minimum of average 2-m temperature K T + 872 TREFMNAV_R Rural daily minimum of average 2-m temperature K F + 873 TREFMNAV_U Urban daily minimum of average 2-m temperature K F + 874 TREFMXAV daily maximum of average 2-m temperature K T + 875 TREFMXAV_R Rural daily maximum of average 2-m temperature K F + 876 TREFMXAV_U Urban daily maximum of average 2-m temperature K F + 877 TRIMMING Degree to which canopy expansion is limited by leaf economics none T + 878 TRIMMING_CANOPY_SCLS trimming term of canopy plants by size class indiv/ha F + 879 TRIMMING_UNDERSTORY_SCLS trimming term of understory plants by size class indiv/ha F + 880 TROOF_INNER roof inside surface temperature K F + 881 TSA 2m air temperature K T + 882 TSAI total projected stem area index m^2/m^2 T + 883 TSA_ICE 2m air temperature (ice landunits only) K F + 884 TSA_R Rural 2m air temperature K F + 885 TSA_U Urban 2m air temperature K F + 886 TSHDW_INNER shadewall inside surface temperature K F + 887 TSKIN skin temperature K T + 888 TSL temperature of near-surface soil layer (natural vegetated and crop landunits only) K T + 889 TSOI soil temperature (natural vegetated and crop landunits only) K T + 890 TSOI_10CM soil temperature in top 10cm of soil K T + 891 TSOI_ICE soil temperature (ice landunits only) K T + 892 TSRF_FORC surface temperature sent to GLC K F + 893 TSUNW_INNER sunwall inside surface temperature K F + 894 TV vegetation temperature K T + 895 TV24 vegetation temperature (last 24hrs) K F + 896 TV240 vegetation temperature (last 240hrs) K F + 897 TWS total water storage mm T + 898 T_SCALAR temperature inhibition of decomposition unitless T + 899 Tair atmospheric air temperature (downscaled to columns in glacier regions) K F + 900 Tair_from_atm atmospheric air temperature received from atmosphere (pre-downscaling) K F + 901 U10 10-m wind m/s T + 902 U10_DUST 10-m wind for dust model m/s T + 903 U10_ICE 10-m wind (ice landunits only) m/s F + 904 UAF canopy air speed m/s F + 905 UM wind speed plus stability effect m/s F + 906 URBAN_AC urban air conditioning flux W/m^2 T + 907 URBAN_HEAT urban heating flux W/m^2 T + 908 USTAR aerodynamical resistance s/m F + 909 UST_LAKE friction velocity (lakes only) m/s F + 910 VA atmospheric wind speed plus convective velocity m/s F + 911 VOLR river channel total water storage m3 T + 912 VOLRMCH river channel main channel water storage m3 T + 913 VPD vpd Pa F + 914 VPD2M 2m vapor pressure deficit Pa T + 915 VPD_CAN canopy vapor pressure deficit kPa T + 916 WASTEHEAT sensible heat flux from heating/cooling sources of urban waste heat W/m^2 T + 917 WBT 2 m Stull Wet Bulb C T + 918 WBT_R Rural 2 m Stull Wet Bulb C T + 919 WBT_U Urban 2 m Stull Wet Bulb C T + 920 WIND atmospheric wind velocity magnitude m/s T + 921 WOOD_PRODUCT Total wood product from logging gC/m2 F + 922 WTGQ surface tracer conductance m/s T + 923 W_SCALAR Moisture (dryness) inhibition of decomposition unitless T + 924 Wind atmospheric wind velocity magnitude m/s F + 925 YESTERDAYCANLEV_CANOPY_SCLS Yesterdays canopy level for canopy plants by size class indiv/ha F + 926 YESTERDAYCANLEV_UNDERSTORY_SCLS Yesterdays canopy level for understory plants by size class indiv/ha F + 927 Z0HG roughness length over ground, sensible heat m F + 928 Z0M momentum roughness length m F + 929 Z0MG roughness length over ground, momentum m F + 930 Z0M_TO_COUPLER roughness length, momentum: gridcell average sent to coupler m F + 931 Z0QG roughness length over ground, latent heat m F + 932 ZBOT atmospheric reference height m T + 933 ZETA dimensionless stability parameter unitless F + 934 ZII convective boundary height m F + 935 ZSTAR_BY_AGE product of zstar and patch area by age bin (divide by PATCH_AREA_BY_AGE to get mean zstar) m F + 936 ZWT water table depth (natural vegetated and crop landunits only) m T + 937 ZWT_CH4_UNSAT depth of water table for methane production used in non-inundated area m T + 938 ZWT_PERCH perched water table depth (natural vegetated and crop landunits only) m T + 939 num_iter number of iterations unitless F +==== =================================== ============================================================================================== ================================================================= ======= diff --git a/doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst b/doc/source/users_guide/setting-up-and-running-a-case/master_list_nofates.rst similarity index 65% rename from doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst rename to doc/source/users_guide/setting-up-and-running-a-case/master_list_nofates.rst index 610975876b..776acc9833 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/master_list_nofates.rst @@ -1,6 +1,12 @@ -=================== -CTSM History Fields -=================== +============================= +CTSM History Fields (nofates) +============================= + +CAUTION: Not all variables are relevant / present for all CTSM cases. +Key flags used in this CTSM case: +use_cn = T +use_crop = T +use_fates = F ==== =================================== ============================================================================================== ================================================================= ======= CTSM History Fields @@ -13,1262 +19,1285 @@ CTSM History Fields 4 ACTUAL_IMMOB_NH4 immobilization of NH4 gN/m^3/s F 5 ACTUAL_IMMOB_NO3 immobilization of NO3 gN/m^3/s F 6 ACTUAL_IMMOB_vr actual N immobilization gN/m^3/s F - 7 AGNPP aboveground NPP gC/m^2/s T - 8 ALBD surface albedo (direct) proportion T - 9 ALBDSF diagnostic snow-free surface albedo (direct) proportion T - 10 ALBGRD ground albedo (direct) proportion F - 11 ALBGRI ground albedo (indirect) proportion F - 12 ALBI surface albedo (indirect) proportion T - 13 ALBISF diagnostic snow-free surface albedo (indirect) proportion T - 14 ALPHA alpha coefficient for VOC calc non F - 15 ALT current active layer thickness m T - 16 ALTMAX maximum annual active layer thickness m T - 17 ALTMAX_LASTYEAR maximum prior year active layer thickness m F - 18 ANNAVG_T2M annual average 2m air temperature K F - 19 ANNMAX_RETRANSN annual max of retranslocated N pool gN/m^2 F - 20 ANNSUM_COUNTER seconds since last annual accumulator turnover s F - 21 ANNSUM_NPP annual sum of NPP gC/m^2/yr F - 22 ANNSUM_POTENTIAL_GPP annual sum of potential GPP gN/m^2/yr F - 23 APPAR_TEMP 2 m apparent temperature C T - 24 APPAR_TEMP_R Rural 2 m apparent temperature C T - 25 APPAR_TEMP_U Urban 2 m apparent temperature C T - 26 AR autotrophic respiration (MR + GR) gC/m^2/s T - 27 ATM_TOPO atmospheric surface height m T - 28 AVAILC C flux available for allocation gC/m^2/s F - 29 AVAIL_RETRANSN N flux available from retranslocation pool gN/m^2/s F - 30 AnnET Annual ET mm/s F - 31 BAF_CROP fractional area burned for crop s-1 T - 32 BAF_PEATF fractional area burned in peatland s-1 T - 33 BCDEP total BC deposition (dry+wet) from atmosphere kg/m^2/s T - 34 BETA coefficient of convective velocity none F - 35 BGLFR background litterfall rate 1/s F - 36 BGNPP belowground NPP gC/m^2/s T - 37 BGTR background transfer growth rate 1/s F - 38 BTRANMN daily minimum of transpiration beta factor unitless T - 39 CANNAVG_T2M annual average of 2m air temperature K F - 40 CANNSUM_NPP annual sum of column-level NPP gC/m^2/s F - 41 CGRND deriv. of soil energy flux wrt to soil temp W/m^2/K F - 42 CGRNDL deriv. of soil latent heat flux wrt soil temp W/m^2/K F - 43 CGRNDS deriv. of soil sensible heat flux wrt soil temp W/m^2/K F - 44 CH4PROD Gridcell total production of CH4 gC/m2/s T - 45 CH4_EBUL_TOTAL_SAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F - 46 CH4_EBUL_TOTAL_UNSAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F - 47 CH4_SURF_AERE_SAT aerenchyma surface CH4 flux for inundated area; (+ to atm) mol/m2/s T - 48 CH4_SURF_AERE_UNSAT aerenchyma surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T - 49 CH4_SURF_DIFF_SAT diffusive surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T - 50 CH4_SURF_DIFF_UNSAT diffusive surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T - 51 CH4_SURF_EBUL_SAT ebullition surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T - 52 CH4_SURF_EBUL_UNSAT ebullition surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T - 53 COL_CTRUNC column-level sink for C truncation gC/m^2 F - 54 COL_FIRE_CLOSS total column-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T - 55 COL_FIRE_NLOSS total column-level fire N loss gN/m^2/s T - 56 COL_NTRUNC column-level sink for N truncation gN/m^2 F - 57 CONC_CH4_SAT CH4 soil Concentration for inundated / lake area mol/m3 F - 58 CONC_CH4_UNSAT CH4 soil Concentration for non-inundated area mol/m3 F - 59 CONC_O2_SAT O2 soil Concentration for inundated / lake area mol/m3 T - 60 CONC_O2_UNSAT O2 soil Concentration for non-inundated area mol/m3 T - 61 COST_NACTIVE Cost of active uptake gN/gC T - 62 COST_NFIX Cost of fixation gN/gC T - 63 COST_NRETRANS Cost of retranslocation gN/gC T - 64 COSZEN cosine of solar zenith angle none F - 65 CPHASE crop phenology phase 0-not planted, 1-planted, 2-leaf emerge, 3-grain fill, 4-harvest T - 66 CPOOL temporary photosynthate C pool gC/m^2 T - 67 CPOOL_DEADCROOT_GR dead coarse root growth respiration gC/m^2/s F - 68 CPOOL_DEADCROOT_STORAGE_GR dead coarse root growth respiration to storage gC/m^2/s F - 69 CPOOL_DEADSTEM_GR dead stem growth respiration gC/m^2/s F - 70 CPOOL_DEADSTEM_STORAGE_GR dead stem growth respiration to storage gC/m^2/s F - 71 CPOOL_FROOT_GR fine root growth respiration gC/m^2/s F - 72 CPOOL_FROOT_STORAGE_GR fine root growth respiration to storage gC/m^2/s F - 73 CPOOL_LEAF_GR leaf growth respiration gC/m^2/s F - 74 CPOOL_LEAF_STORAGE_GR leaf growth respiration to storage gC/m^2/s F - 75 CPOOL_LIVECROOT_GR live coarse root growth respiration gC/m^2/s F - 76 CPOOL_LIVECROOT_STORAGE_GR live coarse root growth respiration to storage gC/m^2/s F - 77 CPOOL_LIVESTEM_GR live stem growth respiration gC/m^2/s F - 78 CPOOL_LIVESTEM_STORAGE_GR live stem growth respiration to storage gC/m^2/s F - 79 CPOOL_TO_DEADCROOTC allocation to dead coarse root C gC/m^2/s F - 80 CPOOL_TO_DEADCROOTC_STORAGE allocation to dead coarse root C storage gC/m^2/s F - 81 CPOOL_TO_DEADSTEMC allocation to dead stem C gC/m^2/s F - 82 CPOOL_TO_DEADSTEMC_STORAGE allocation to dead stem C storage gC/m^2/s F - 83 CPOOL_TO_FROOTC allocation to fine root C gC/m^2/s F - 84 CPOOL_TO_FROOTC_STORAGE allocation to fine root C storage gC/m^2/s F - 85 CPOOL_TO_GRESP_STORAGE allocation to growth respiration storage gC/m^2/s F - 86 CPOOL_TO_LEAFC allocation to leaf C gC/m^2/s F - 87 CPOOL_TO_LEAFC_STORAGE allocation to leaf C storage gC/m^2/s F - 88 CPOOL_TO_LIVECROOTC allocation to live coarse root C gC/m^2/s F - 89 CPOOL_TO_LIVECROOTC_STORAGE allocation to live coarse root C storage gC/m^2/s F - 90 CPOOL_TO_LIVESTEMC allocation to live stem C gC/m^2/s F - 91 CPOOL_TO_LIVESTEMC_STORAGE allocation to live stem C storage gC/m^2/s F - 92 CROOT_PROF profile for litter C and N inputs from coarse roots 1/m F - 93 CROPPROD1C 1-yr crop product (grain+biofuel) C gC/m^2 T - 94 CROPPROD1C_LOSS loss from 1-yr crop product pool gC/m^2/s T - 95 CROPPROD1N 1-yr crop product (grain+biofuel) N gN/m^2 T - 96 CROPPROD1N_LOSS loss from 1-yr crop product pool gN/m^2/s T - 97 CROPSEEDC_DEFICIT C used for crop seed that needs to be repaid gC/m^2 T - 98 CROPSEEDN_DEFICIT N used for crop seed that needs to be repaid gN/m^2 F - 99 CROP_SEEDC_TO_LEAF crop seed source to leaf gC/m^2/s F - 100 CROP_SEEDN_TO_LEAF crop seed source to leaf gN/m^2/s F - 101 CURRENT_GR growth resp for new growth displayed in this timestep gC/m^2/s F - 102 CWDC CWD C gC/m^2 T - 103 CWDC_1m CWD C to 1 meter gC/m^2 F - 104 CWDC_LOSS coarse woody debris C loss gC/m^2/s T - 105 CWDC_TO_LITR2C decomp. of coarse woody debris C to litter 2 C gC/m^2/s F - 106 CWDC_TO_LITR2C_vr decomp. of coarse woody debris C to litter 2 C gC/m^3/s F - 107 CWDC_TO_LITR3C decomp. of coarse woody debris C to litter 3 C gC/m^2/s F - 108 CWDC_TO_LITR3C_vr decomp. of coarse woody debris C to litter 3 C gC/m^3/s F - 109 CWDC_vr CWD C (vertically resolved) gC/m^3 T - 110 CWDN CWD N gN/m^2 T - 111 CWDN_1m CWD N to 1 meter gN/m^2 F - 112 CWDN_TO_LITR2N decomp. of coarse woody debris N to litter 2 N gN/m^2 F - 113 CWDN_TO_LITR2N_vr decomp. of coarse woody debris N to litter 2 N gN/m^3 F - 114 CWDN_TO_LITR3N decomp. of coarse woody debris N to litter 3 N gN/m^2 F - 115 CWDN_TO_LITR3N_vr decomp. of coarse woody debris N to litter 3 N gN/m^3 F - 116 CWDN_vr CWD N (vertically resolved) gN/m^3 T - 117 C_ALLOMETRY C allocation index none F - 118 DAYL daylength s F - 119 DAYS_ACTIVE number of days since last dormancy days F - 120 DEADCROOTC dead coarse root C gC/m^2 T - 121 DEADCROOTC_STORAGE dead coarse root C storage gC/m^2 F - 122 DEADCROOTC_STORAGE_TO_XFER dead coarse root C shift storage to transfer gC/m^2/s F - 123 DEADCROOTC_XFER dead coarse root C transfer gC/m^2 F - 124 DEADCROOTC_XFER_TO_DEADCROOTC dead coarse root C growth from storage gC/m^2/s F - 125 DEADCROOTN dead coarse root N gN/m^2 T - 126 DEADCROOTN_STORAGE dead coarse root N storage gN/m^2 F - 127 DEADCROOTN_STORAGE_TO_XFER dead coarse root N shift storage to transfer gN/m^2/s F - 128 DEADCROOTN_XFER dead coarse root N transfer gN/m^2 F - 129 DEADCROOTN_XFER_TO_DEADCROOTN dead coarse root N growth from storage gN/m^2/s F - 130 DEADSTEMC dead stem C gC/m^2 T - 131 DEADSTEMC_STORAGE dead stem C storage gC/m^2 F - 132 DEADSTEMC_STORAGE_TO_XFER dead stem C shift storage to transfer gC/m^2/s F - 133 DEADSTEMC_XFER dead stem C transfer gC/m^2 F - 134 DEADSTEMC_XFER_TO_DEADSTEMC dead stem C growth from storage gC/m^2/s F - 135 DEADSTEMN dead stem N gN/m^2 T - 136 DEADSTEMN_STORAGE dead stem N storage gN/m^2 F - 137 DEADSTEMN_STORAGE_TO_XFER dead stem N shift storage to transfer gN/m^2/s F - 138 DEADSTEMN_XFER dead stem N transfer gN/m^2 F - 139 DEADSTEMN_XFER_TO_DEADSTEMN dead stem N growth from storage gN/m^2/s F - 140 DENIT total rate of denitrification gN/m^2/s T - 141 DGNETDT derivative of net ground heat flux wrt soil temp W/m^2/K F - 142 DISCOI 2 m Discomfort Index C T - 143 DISCOIS 2 m Stull Discomfort Index C T - 144 DISCOIS_R Rural 2 m Stull Discomfort Index C T - 145 DISCOIS_U Urban 2 m Stull Discomfort Index C T - 146 DISCOI_R Rural 2 m Discomfort Index C T - 147 DISCOI_U Urban 2 m Discomfort Index C T - 148 DISPLA displacement height m F - 149 DISPVEGC displayed veg carbon, excluding storage and cpool gC/m^2 T - 150 DISPVEGN displayed vegetation nitrogen gN/m^2 T - 151 DLRAD downward longwave radiation below the canopy W/m^2 F - 152 DORMANT_FLAG dormancy flag none F - 153 DOWNREG fractional reduction in GPP due to N limitation proportion F - 154 DPVLTRB1 turbulent deposition velocity 1 m/s F - 155 DPVLTRB2 turbulent deposition velocity 2 m/s F - 156 DPVLTRB3 turbulent deposition velocity 3 m/s F - 157 DPVLTRB4 turbulent deposition velocity 4 m/s F - 158 DSL dry surface layer thickness mm T - 159 DSTDEP total dust deposition (dry+wet) from atmosphere kg/m^2/s T - 160 DSTFLXT total surface dust emission kg/m2/s T - 161 DT_VEG change in t_veg, last iteration K F - 162 DWT_CONV_CFLUX conversion C flux (immediate loss to atm) (0 at all times except first timestep of year) gC/m^2/s T - 163 DWT_CONV_CFLUX_DRIBBLED conversion C flux (immediate loss to atm), dribbled throughout the year gC/m^2/s T - 164 DWT_CONV_CFLUX_PATCH patch-level conversion C flux (immediate loss to atm) (0 at all times except first timestep of gC/m^2/s F - 165 DWT_CONV_NFLUX conversion N flux (immediate loss to atm) (0 at all times except first timestep of year) gN/m^2/s T - 166 DWT_CONV_NFLUX_PATCH patch-level conversion N flux (immediate loss to atm) (0 at all times except first timestep of gN/m^2/s F - 167 DWT_CROPPROD1C_GAIN landcover change-driven addition to 1-year crop product pool gC/m^2/s T - 168 DWT_CROPPROD1N_GAIN landcover change-driven addition to 1-year crop product pool gN/m^2/s T - 169 DWT_DEADCROOTC_TO_CWDC dead coarse root to CWD due to landcover change gC/m^2/s F - 170 DWT_DEADCROOTN_TO_CWDN dead coarse root to CWD due to landcover change gN/m^2/s F - 171 DWT_FROOTC_TO_LITR_CEL_C fine root to litter due to landcover change gC/m^2/s F - 172 DWT_FROOTC_TO_LITR_LIG_C fine root to litter due to landcover change gC/m^2/s F - 173 DWT_FROOTC_TO_LITR_MET_C fine root to litter due to landcover change gC/m^2/s F - 174 DWT_FROOTN_TO_LITR_CEL_N fine root to litter due to landcover change gN/m^2/s F - 175 DWT_FROOTN_TO_LITR_LIG_N fine root to litter due to landcover change gN/m^2/s F - 176 DWT_FROOTN_TO_LITR_MET_N fine root to litter due to landcover change gN/m^2/s F - 177 DWT_LIVECROOTC_TO_CWDC live coarse root to CWD due to landcover change gC/m^2/s F - 178 DWT_LIVECROOTN_TO_CWDN live coarse root to CWD due to landcover change gN/m^2/s F - 179 DWT_PROD100C_GAIN landcover change-driven addition to 100-yr wood product pool gC/m^2/s F - 180 DWT_PROD100N_GAIN landcover change-driven addition to 100-yr wood product pool gN/m^2/s F - 181 DWT_PROD10C_GAIN landcover change-driven addition to 10-yr wood product pool gC/m^2/s F - 182 DWT_PROD10N_GAIN landcover change-driven addition to 10-yr wood product pool gN/m^2/s F - 183 DWT_SEEDC_TO_DEADSTEM seed source to patch-level deadstem gC/m^2/s F - 184 DWT_SEEDC_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gC/m^2/s F - 185 DWT_SEEDC_TO_LEAF seed source to patch-level leaf gC/m^2/s F - 186 DWT_SEEDC_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gC/m^2/s F - 187 DWT_SEEDN_TO_DEADSTEM seed source to patch-level deadstem gN/m^2/s T - 188 DWT_SEEDN_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gN/m^2/s F - 189 DWT_SEEDN_TO_LEAF seed source to patch-level leaf gN/m^2/s T - 190 DWT_SEEDN_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gN/m^2/s F - 191 DWT_SLASH_CFLUX slash C flux (to litter diagnostic only) (0 at all times except first timestep of year) gC/m^2/s T - 192 DWT_SLASH_CFLUX_PATCH patch-level slash C flux (to litter diagnostic only) (0 at all times except first timestep of gC/m^2/s F - 193 DWT_WOODPRODC_GAIN landcover change-driven addition to wood product pools gC/m^2/s T - 194 DWT_WOODPRODN_GAIN landcover change-driven addition to wood product pools gN/m^2/s T - 195 DWT_WOOD_PRODUCTC_GAIN_PATCH patch-level landcover change-driven addition to wood product pools(0 at all times except first gC/m^2/s F - 196 DYN_COL_ADJUSTMENTS_CH4 Adjustments in ch4 due to dynamic column areas; only makes sense at the column level: should n gC/m^2 F - 197 DYN_COL_SOIL_ADJUSTMENTS_C Adjustments in soil carbon due to dynamic column areas; only makes sense at the column level: gC/m^2 F - 198 DYN_COL_SOIL_ADJUSTMENTS_N Adjustments in soil nitrogen due to dynamic column areas; only makes sense at the column level gN/m^2 F - 199 DYN_COL_SOIL_ADJUSTMENTS_NH4 Adjustments in soil NH4 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F - 200 DYN_COL_SOIL_ADJUSTMENTS_NO3 Adjustments in soil NO3 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F - 201 EFF_POROSITY effective porosity = porosity - vol_ice proportion F - 202 EFLXBUILD building heat flux from change in interior building air temperature W/m^2 T - 203 EFLX_DYNBAL dynamic land cover change conversion energy flux W/m^2 T - 204 EFLX_GNET net heat flux into ground W/m^2 F - 205 EFLX_GRND_LAKE net heat flux into lake/snow surface, excluding light transmission W/m^2 T - 206 EFLX_LH_TOT total latent heat flux [+ to atm] W/m^2 T - 207 EFLX_LH_TOT_ICE total latent heat flux [+ to atm] (ice landunits only) W/m^2 F - 208 EFLX_LH_TOT_R Rural total evaporation W/m^2 T - 209 EFLX_LH_TOT_U Urban total evaporation W/m^2 F - 210 EFLX_SOIL_GRND soil heat flux [+ into soil] W/m^2 F - 211 ELAI exposed one-sided leaf area index m^2/m^2 T - 212 EMG ground emissivity proportion F - 213 EMV vegetation emissivity proportion F - 214 EOPT Eopt coefficient for VOC calc non F - 215 EPT 2 m Equiv Pot Temp K T - 216 EPT_R Rural 2 m Equiv Pot Temp K T - 217 EPT_U Urban 2 m Equiv Pot Temp K T - 218 ER total ecosystem respiration, autotrophic + heterotrophic gC/m^2/s T - 219 ERRH2O total water conservation error mm T - 220 ERRH2OSNO imbalance in snow depth (liquid water) mm T - 221 ERRSEB surface energy conservation error W/m^2 T - 222 ERRSOI soil/lake energy conservation error W/m^2 T - 223 ERRSOL solar radiation conservation error W/m^2 T - 224 ESAI exposed one-sided stem area index m^2/m^2 T - 225 EXCESSC_MR excess C maintenance respiration gC/m^2/s F - 226 EXCESS_CFLUX C flux not allocated due to downregulation gC/m^2/s F - 227 FAREA_BURNED timestep fractional area burned s-1 T - 228 FCANSNO fraction of canopy that is wet proportion F - 229 FCEV canopy evaporation W/m^2 T - 230 FCH4 Gridcell surface CH4 flux to atmosphere (+ to atm) kgC/m2/s T - 231 FCH4TOCO2 Gridcell oxidation of CH4 to CO2 gC/m2/s T - 232 FCH4_DFSAT CH4 additional flux due to changing fsat, natural vegetated and crop landunits only kgC/m2/s T - 233 FCO2 CO2 flux to atmosphere (+ to atm) kgCO2/m2/s F - 234 FCOV fractional impermeable area unitless T - 235 FCTR canopy transpiration W/m^2 T - 236 FDRY fraction of foliage that is green and dry proportion F - 237 FERTNITRO Nitrogen fertilizer for each crop gN/m2/yr F - 238 FERT_COUNTER time left to fertilize seconds F - 239 FERT_TO_SMINN fertilizer to soil mineral N gN/m^2/s F - 240 FFIX_TO_SMINN free living N fixation to soil mineral N gN/m^2/s T - 241 FGEV ground evaporation W/m^2 T - 242 FGR heat flux into soil/snow including snow melt and lake / snow light transmission W/m^2 T - 243 FGR12 heat flux between soil layers 1 and 2 W/m^2 T - 244 FGR_ICE heat flux into soil/snow including snow melt and lake / snow light transmission (ice landunits W/m^2 F - 245 FGR_R Rural heat flux into soil/snow including snow melt and snow light transmission W/m^2 F - 246 FGR_SOIL_R Rural downward heat flux at interface below each soil layer watt/m^2 F - 247 FGR_U Urban heat flux into soil/snow including snow melt W/m^2 F - 248 FH2OSFC fraction of ground covered by surface water unitless T - 249 FH2OSFC_NOSNOW fraction of ground covered by surface water (if no snow present) unitless F - 250 FINUNDATED fractional inundated area of vegetated columns unitless T - 251 FINUNDATED_LAG time-lagged inundated fraction of vegetated columns unitless F - 252 FIRA net infrared (longwave) radiation W/m^2 T - 253 FIRA_ICE net infrared (longwave) radiation (ice landunits only) W/m^2 F - 254 FIRA_R Rural net infrared (longwave) radiation W/m^2 T - 255 FIRA_U Urban net infrared (longwave) radiation W/m^2 F - 256 FIRE emitted infrared (longwave) radiation W/m^2 T - 257 FIRE_ICE emitted infrared (longwave) radiation (ice landunits only) W/m^2 F - 258 FIRE_R Rural emitted infrared (longwave) radiation W/m^2 T - 259 FIRE_U Urban emitted infrared (longwave) radiation W/m^2 F - 260 FLDS atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 T - 261 FLDS_ICE atmospheric longwave radiation (downscaled to columns in glacier regions) (ice landunits only) W/m^2 F - 262 FMAX_DENIT_CARBONSUBSTRATE FMAX_DENIT_CARBONSUBSTRATE gN/m^3/s F - 263 FMAX_DENIT_NITRATE FMAX_DENIT_NITRATE gN/m^3/s F - 264 FPI fraction of potential immobilization proportion T - 265 FPI_vr fraction of potential immobilization proportion F - 266 FPSN photosynthesis umol m-2 s-1 T - 267 FPSN24 24 hour accumulative patch photosynthesis starting from mid-night umol CO2/m^2 ground/day F - 268 FPSN_WC Rubisco-limited photosynthesis umol m-2 s-1 F - 269 FPSN_WJ RuBP-limited photosynthesis umol m-2 s-1 F - 270 FPSN_WP Product-limited photosynthesis umol m-2 s-1 F - 271 FRAC_ICEOLD fraction of ice relative to the tot water proportion F - 272 FREE_RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T - 273 FROOTC fine root C gC/m^2 T - 274 FROOTC_ALLOC fine root C allocation gC/m^2/s T - 275 FROOTC_LOSS fine root C loss gC/m^2/s T - 276 FROOTC_STORAGE fine root C storage gC/m^2 F - 277 FROOTC_STORAGE_TO_XFER fine root C shift storage to transfer gC/m^2/s F - 278 FROOTC_TO_LITTER fine root C litterfall gC/m^2/s F - 279 FROOTC_XFER fine root C transfer gC/m^2 F - 280 FROOTC_XFER_TO_FROOTC fine root C growth from storage gC/m^2/s F - 281 FROOTN fine root N gN/m^2 T - 282 FROOTN_STORAGE fine root N storage gN/m^2 F - 283 FROOTN_STORAGE_TO_XFER fine root N shift storage to transfer gN/m^2/s F - 284 FROOTN_TO_LITTER fine root N litterfall gN/m^2/s F - 285 FROOTN_XFER fine root N transfer gN/m^2 F - 286 FROOTN_XFER_TO_FROOTN fine root N growth from storage gN/m^2/s F - 287 FROOT_MR fine root maintenance respiration gC/m^2/s F - 288 FROOT_PROF profile for litter C and N inputs from fine roots 1/m F - 289 FROST_TABLE frost table depth (natural vegetated and crop landunits only) m F - 290 FSA absorbed solar radiation W/m^2 T - 291 FSAT fractional area with water table at surface unitless T - 292 FSA_ICE absorbed solar radiation (ice landunits only) W/m^2 F - 293 FSA_R Rural absorbed solar radiation W/m^2 F - 294 FSA_U Urban absorbed solar radiation W/m^2 F - 295 FSD24 direct radiation (last 24hrs) K F - 296 FSD240 direct radiation (last 240hrs) K F - 297 FSDS atmospheric incident solar radiation W/m^2 T - 298 FSDSND direct nir incident solar radiation W/m^2 T - 299 FSDSNDLN direct nir incident solar radiation at local noon W/m^2 T - 300 FSDSNI diffuse nir incident solar radiation W/m^2 T - 301 FSDSVD direct vis incident solar radiation W/m^2 T - 302 FSDSVDLN direct vis incident solar radiation at local noon W/m^2 T - 303 FSDSVI diffuse vis incident solar radiation W/m^2 T - 304 FSDSVILN diffuse vis incident solar radiation at local noon W/m^2 T - 305 FSH sensible heat not including correction for land use change and rain/snow conversion W/m^2 T - 306 FSH_G sensible heat from ground W/m^2 T - 307 FSH_ICE sensible heat not including correction for land use change and rain/snow conversion (ice landu W/m^2 F - 308 FSH_PRECIP_CONVERSION Sensible heat flux from conversion of rain/snow atm forcing W/m^2 T - 309 FSH_R Rural sensible heat W/m^2 T - 310 FSH_RUNOFF_ICE_TO_LIQ sensible heat flux generated from conversion of ice runoff to liquid W/m^2 T - 311 FSH_TO_COUPLER sensible heat sent to coupler (includes corrections for land use change, rain/snow conversion W/m^2 T - 312 FSH_U Urban sensible heat W/m^2 F - 313 FSH_V sensible heat from veg W/m^2 T - 314 FSI24 indirect radiation (last 24hrs) K F - 315 FSI240 indirect radiation (last 240hrs) K F - 316 FSM snow melt heat flux W/m^2 T - 317 FSM_ICE snow melt heat flux (ice landunits only) W/m^2 F - 318 FSM_R Rural snow melt heat flux W/m^2 F - 319 FSM_U Urban snow melt heat flux W/m^2 F - 320 FSNO fraction of ground covered by snow unitless T - 321 FSNO_EFF effective fraction of ground covered by snow unitless T - 322 FSNO_ICE fraction of ground covered by snow (ice landunits only) unitless F - 323 FSR reflected solar radiation W/m^2 T - 324 FSRND direct nir reflected solar radiation W/m^2 T - 325 FSRNDLN direct nir reflected solar radiation at local noon W/m^2 T - 326 FSRNI diffuse nir reflected solar radiation W/m^2 T - 327 FSRSF reflected solar radiation W/m^2 T - 328 FSRSFND direct nir reflected solar radiation W/m^2 T - 329 FSRSFNDLN direct nir reflected solar radiation at local noon W/m^2 T - 330 FSRSFNI diffuse nir reflected solar radiation W/m^2 T - 331 FSRSFVD direct vis reflected solar radiation W/m^2 T - 332 FSRSFVDLN direct vis reflected solar radiation at local noon W/m^2 T - 333 FSRSFVI diffuse vis reflected solar radiation W/m^2 T - 334 FSRVD direct vis reflected solar radiation W/m^2 T - 335 FSRVDLN direct vis reflected solar radiation at local noon W/m^2 T - 336 FSRVI diffuse vis reflected solar radiation W/m^2 T - 337 FSR_ICE reflected solar radiation (ice landunits only) W/m^2 F - 338 FSUN sunlit fraction of canopy proportion F - 339 FSUN24 fraction sunlit (last 24hrs) K F - 340 FSUN240 fraction sunlit (last 240hrs) K F - 341 FUELC fuel load gC/m^2 T - 342 FV friction velocity for dust model m/s F - 343 FWET fraction of canopy that is wet proportion F - 344 F_DENIT denitrification flux gN/m^2/s T - 345 F_DENIT_BASE F_DENIT_BASE gN/m^3/s F - 346 F_DENIT_vr denitrification flux gN/m^3/s F - 347 F_N2O_DENIT denitrification N2O flux gN/m^2/s T - 348 F_N2O_NIT nitrification N2O flux gN/m^2/s T - 349 F_NIT nitrification flux gN/m^2/s T - 350 F_NIT_vr nitrification flux gN/m^3/s F - 351 FireComp_BC fire emissions flux of BC kg/m2/sec F - 352 FireComp_OC fire emissions flux of OC kg/m2/sec F - 353 FireComp_SO2 fire emissions flux of SO2 kg/m2/sec F - 354 FireEmis_TOT Total fire emissions flux gC/m2/sec F - 355 FireEmis_ZTOP Top of vertical fire emissions distribution m F - 356 FireMech_SO2 fire emissions flux of SO2 kg/m2/sec F - 357 FireMech_bc_a1 fire emissions flux of bc_a1 kg/m2/sec F - 358 FireMech_pom_a1 fire emissions flux of pom_a1 kg/m2/sec F - 359 GAMMA total gamma for VOC calc non F - 360 GAMMAA gamma A for VOC calc non F - 361 GAMMAC gamma C for VOC calc non F - 362 GAMMAL gamma L for VOC calc non F - 363 GAMMAP gamma P for VOC calc non F - 364 GAMMAS gamma S for VOC calc non F - 365 GAMMAT gamma T for VOC calc non F - 366 GDD0 Growing degree days base 0C from planting ddays F - 367 GDD020 Twenty year average of growing degree days base 0C from planting ddays F - 368 GDD10 Growing degree days base 10C from planting ddays F - 369 GDD1020 Twenty year average of growing degree days base 10C from planting ddays F - 370 GDD8 Growing degree days base 8C from planting ddays F - 371 GDD820 Twenty year average of growing degree days base 8C from planting ddays F - 372 GDDHARV Growing degree days (gdd) needed to harvest ddays F - 373 GDDPLANT Accumulated growing degree days past planting date for crop ddays F - 374 GDDTSOI Growing degree-days from planting (top two soil layers) ddays F - 375 GPP gross primary production gC/m^2/s T - 376 GR total growth respiration gC/m^2/s T - 377 GRAINC grain C (does not equal yield) gC/m^2 T - 378 GRAINC_TO_FOOD grain C to food gC/m^2/s T - 379 GRAINC_TO_SEED grain C to seed gC/m^2/s T - 380 GRAINN grain N gN/m^2 T - 381 GRESP_STORAGE growth respiration storage gC/m^2 F - 382 GRESP_STORAGE_TO_XFER growth respiration shift storage to transfer gC/m^2/s F - 383 GRESP_XFER growth respiration transfer gC/m^2 F - 384 GROSS_NMIN gross rate of N mineralization gN/m^2/s T - 385 GROSS_NMIN_vr gross rate of N mineralization gN/m^3/s F - 386 GSSHA shaded leaf stomatal conductance umol H20/m2/s T - 387 GSSHALN shaded leaf stomatal conductance at local noon umol H20/m2/s T - 388 GSSUN sunlit leaf stomatal conductance umol H20/m2/s T - 389 GSSUNLN sunlit leaf stomatal conductance at local noon umol H20/m2/s T - 390 H2OCAN intercepted water mm T - 391 H2OSFC surface water depth mm T - 392 H2OSNO snow depth (liquid water) mm T - 393 H2OSNO_ICE snow depth (liquid water, ice landunits only) mm F - 394 H2OSNO_TOP mass of snow in top snow layer kg/m2 T - 395 H2OSOI volumetric soil water (natural vegetated and crop landunits only) mm3/mm3 T - 396 HBOT canopy bottom m F - 397 HEAT_CONTENT1 initial gridcell total heat content J/m^2 T - 398 HEAT_CONTENT1_VEG initial gridcell total heat content - natural vegetated and crop landunits only J/m^2 F - 399 HEAT_CONTENT2 post land cover change total heat content J/m^2 F - 400 HEAT_FROM_AC sensible heat flux put into canyon due to heat removed from air conditioning W/m^2 T - 401 HIA 2 m NWS Heat Index C T - 402 HIA_R Rural 2 m NWS Heat Index C T - 403 HIA_U Urban 2 m NWS Heat Index C T - 404 HK hydraulic conductivity (natural vegetated and crop landunits only) mm/s F - 405 HR total heterotrophic respiration gC/m^2/s T - 406 HR_vr total vertically resolved heterotrophic respiration gC/m^3/s T - 407 HTOP canopy top m T - 408 HUMIDEX 2 m Humidex C T - 409 HUMIDEX_R Rural 2 m Humidex C T - 410 HUMIDEX_U Urban 2 m Humidex C T - 411 ICE_CONTENT1 initial gridcell total ice content mm T - 412 ICE_CONTENT2 post land cover change total ice content mm F - 413 ICE_MODEL_FRACTION Ice sheet model fractional coverage unitless F - 414 INIT_GPP GPP flux before downregulation gC/m^2/s F - 415 INT_SNOW accumulated swe (natural vegetated and crop landunits only) mm F - 416 INT_SNOW_ICE accumulated swe (ice landunits only) mm F - 417 JMX25T canopy profile of jmax umol/m2/s T - 418 Jmx25Z maximum rate of electron transport at 25 Celcius for canopy layers umol electrons/m2/s T - 419 KROOT root conductance each soil layer 1/s F - 420 KSOIL soil conductance in each soil layer 1/s F - 421 K_CWD coarse woody debris potential loss coefficient 1/s F - 422 K_LITR1 litter 1 potential loss coefficient 1/s F - 423 K_LITR2 litter 2 potential loss coefficient 1/s F - 424 K_LITR3 litter 3 potential loss coefficient 1/s F - 425 K_NITR K_NITR 1/s F - 426 K_NITR_H2O K_NITR_H2O unitless F - 427 K_NITR_PH K_NITR_PH unitless F - 428 K_NITR_T K_NITR_T unitless F - 429 K_SOIL1 soil 1 potential loss coefficient 1/s F - 430 K_SOIL2 soil 2 potential loss coefficient 1/s F - 431 K_SOIL3 soil 3 potential loss coefficient 1/s F - 432 LAI240 240hr average of leaf area index m^2/m^2 F - 433 LAISHA shaded projected leaf area index m^2/m^2 T - 434 LAISUN sunlit projected leaf area index m^2/m^2 T - 435 LAKEICEFRAC lake layer ice mass fraction unitless F - 436 LAKEICEFRAC_SURF surface lake layer ice mass fraction unitless T - 437 LAKEICETHICK thickness of lake ice (including physical expansion on freezing) m T - 438 LAND_USE_FLUX total C emitted from land cover conversion (smoothed over the year) and wood and grain product gC/m^2/s T - 439 LATBASET latitude vary base temperature for gddplant degree C F - 440 LEAFC leaf C gC/m^2 T - 441 LEAFCN Leaf CN ratio used for flexible CN gC/gN T - 442 LEAFCN_OFFSET Leaf C:N used by FUN unitless F - 443 LEAFCN_STORAGE Storage Leaf CN ratio used for flexible CN gC/gN F - 444 LEAFC_ALLOC leaf C allocation gC/m^2/s T - 445 LEAFC_CHANGE C change in leaf gC/m^2/s T - 446 LEAFC_LOSS leaf C loss gC/m^2/s T - 447 LEAFC_STORAGE leaf C storage gC/m^2 F - 448 LEAFC_STORAGE_TO_XFER leaf C shift storage to transfer gC/m^2/s F - 449 LEAFC_STORAGE_XFER_ACC Accumulated leaf C transfer gC/m^2 F - 450 LEAFC_TO_BIOFUELC leaf C to biofuel C gC/m^2/s T - 451 LEAFC_TO_LITTER leaf C litterfall gC/m^2/s F - 452 LEAFC_TO_LITTER_FUN leaf C litterfall used by FUN gC/m^2/s T - 453 LEAFC_XFER leaf C transfer gC/m^2 F - 454 LEAFC_XFER_TO_LEAFC leaf C growth from storage gC/m^2/s F - 455 LEAFN leaf N gN/m^2 T - 456 LEAFN_STORAGE leaf N storage gN/m^2 F - 457 LEAFN_STORAGE_TO_XFER leaf N shift storage to transfer gN/m^2/s F - 458 LEAFN_STORAGE_XFER_ACC Accmulated leaf N transfer gN/m^2 F - 459 LEAFN_TO_LITTER leaf N litterfall gN/m^2/s T - 460 LEAFN_TO_RETRANSN leaf N to retranslocated N pool gN/m^2/s F - 461 LEAFN_XFER leaf N transfer gN/m^2 F - 462 LEAFN_XFER_TO_LEAFN leaf N growth from storage gN/m^2/s F - 463 LEAF_MR leaf maintenance respiration gC/m^2/s T - 464 LEAF_PROF profile for litter C and N inputs from leaves 1/m F - 465 LFC2 conversion area fraction of BET and BDT that burned per sec T - 466 LGSF long growing season factor proportion F - 467 LIQCAN intercepted liquid water mm T - 468 LIQUID_CONTENT1 initial gridcell total liq content mm T - 469 LIQUID_CONTENT2 post landuse change gridcell total liq content mm F - 470 LIQUID_WATER_TEMP1 initial gridcell weighted average liquid water temperature K F - 471 LITFALL litterfall (leaves and fine roots) gC/m^2/s T - 472 LITFIRE litter fire losses gC/m^2/s F - 473 LITR1C LITR1 C gC/m^2 T - 474 LITR1C_1m LITR1 C to 1 meter gC/m^2 F - 475 LITR1C_TNDNCY_VERT_TRANS litter 1 C tendency due to vertical transport gC/m^3/s F - 476 LITR1C_TO_SOIL1C decomp. of litter 1 C to soil 1 C gC/m^2/s F - 477 LITR1C_TO_SOIL1C_vr decomp. of litter 1 C to soil 1 C gC/m^3/s F - 478 LITR1C_vr LITR1 C (vertically resolved) gC/m^3 T - 479 LITR1N LITR1 N gN/m^2 T - 480 LITR1N_1m LITR1 N to 1 meter gN/m^2 F - 481 LITR1N_TNDNCY_VERT_TRANS litter 1 N tendency due to vertical transport gN/m^3/s F - 482 LITR1N_TO_SOIL1N decomp. of litter 1 N to soil 1 N gN/m^2 F - 483 LITR1N_TO_SOIL1N_vr decomp. of litter 1 N to soil 1 N gN/m^3 F - 484 LITR1N_vr LITR1 N (vertically resolved) gN/m^3 T - 485 LITR1_HR Het. Resp. from litter 1 gC/m^2/s F - 486 LITR1_HR_vr Het. Resp. from litter 1 gC/m^3/s F - 487 LITR2C LITR2 C gC/m^2 T - 488 LITR2C_1m LITR2 C to 1 meter gC/m^2 F - 489 LITR2C_TNDNCY_VERT_TRANS litter 2 C tendency due to vertical transport gC/m^3/s F - 490 LITR2C_TO_SOIL1C decomp. of litter 2 C to soil 1 C gC/m^2/s F - 491 LITR2C_TO_SOIL1C_vr decomp. of litter 2 C to soil 1 C gC/m^3/s F - 492 LITR2C_vr LITR2 C (vertically resolved) gC/m^3 T - 493 LITR2N LITR2 N gN/m^2 T - 494 LITR2N_1m LITR2 N to 1 meter gN/m^2 F - 495 LITR2N_TNDNCY_VERT_TRANS litter 2 N tendency due to vertical transport gN/m^3/s F - 496 LITR2N_TO_SOIL1N decomp. of litter 2 N to soil 1 N gN/m^2 F - 497 LITR2N_TO_SOIL1N_vr decomp. of litter 2 N to soil 1 N gN/m^3 F - 498 LITR2N_vr LITR2 N (vertically resolved) gN/m^3 T - 499 LITR2_HR Het. Resp. from litter 2 gC/m^2/s F - 500 LITR2_HR_vr Het. Resp. from litter 2 gC/m^3/s F - 501 LITR3C LITR3 C gC/m^2 T - 502 LITR3C_1m LITR3 C to 1 meter gC/m^2 F - 503 LITR3C_TNDNCY_VERT_TRANS litter 3 C tendency due to vertical transport gC/m^3/s F - 504 LITR3C_TO_SOIL2C decomp. of litter 3 C to soil 2 C gC/m^2/s F - 505 LITR3C_TO_SOIL2C_vr decomp. of litter 3 C to soil 2 C gC/m^3/s F - 506 LITR3C_vr LITR3 C (vertically resolved) gC/m^3 T - 507 LITR3N LITR3 N gN/m^2 T - 508 LITR3N_1m LITR3 N to 1 meter gN/m^2 F - 509 LITR3N_TNDNCY_VERT_TRANS litter 3 N tendency due to vertical transport gN/m^3/s F - 510 LITR3N_TO_SOIL2N decomp. of litter 3 N to soil 2 N gN/m^2 F - 511 LITR3N_TO_SOIL2N_vr decomp. of litter 3 N to soil 2 N gN/m^3 F - 512 LITR3N_vr LITR3 N (vertically resolved) gN/m^3 T - 513 LITR3_HR Het. Resp. from litter 3 gC/m^2/s F - 514 LITR3_HR_vr Het. Resp. from litter 3 gC/m^3/s F - 515 LITTERC_HR litter C heterotrophic respiration gC/m^2/s T - 516 LITTERC_LOSS litter C loss gC/m^2/s T - 517 LIVECROOTC live coarse root C gC/m^2 T - 518 LIVECROOTC_STORAGE live coarse root C storage gC/m^2 F - 519 LIVECROOTC_STORAGE_TO_XFER live coarse root C shift storage to transfer gC/m^2/s F - 520 LIVECROOTC_TO_DEADCROOTC live coarse root C turnover gC/m^2/s F - 521 LIVECROOTC_XFER live coarse root C transfer gC/m^2 F - 522 LIVECROOTC_XFER_TO_LIVECROOTC live coarse root C growth from storage gC/m^2/s F - 523 LIVECROOTN live coarse root N gN/m^2 T - 524 LIVECROOTN_STORAGE live coarse root N storage gN/m^2 F - 525 LIVECROOTN_STORAGE_TO_XFER live coarse root N shift storage to transfer gN/m^2/s F - 526 LIVECROOTN_TO_DEADCROOTN live coarse root N turnover gN/m^2/s F - 527 LIVECROOTN_TO_RETRANSN live coarse root N to retranslocated N pool gN/m^2/s F - 528 LIVECROOTN_XFER live coarse root N transfer gN/m^2 F - 529 LIVECROOTN_XFER_TO_LIVECROOTN live coarse root N growth from storage gN/m^2/s F - 530 LIVECROOT_MR live coarse root maintenance respiration gC/m^2/s F - 531 LIVESTEMC live stem C gC/m^2 T - 532 LIVESTEMC_STORAGE live stem C storage gC/m^2 F - 533 LIVESTEMC_STORAGE_TO_XFER live stem C shift storage to transfer gC/m^2/s F - 534 LIVESTEMC_TO_BIOFUELC livestem C to biofuel C gC/m^2/s T - 535 LIVESTEMC_TO_DEADSTEMC live stem C turnover gC/m^2/s F - 536 LIVESTEMC_XFER live stem C transfer gC/m^2 F - 537 LIVESTEMC_XFER_TO_LIVESTEMC live stem C growth from storage gC/m^2/s F - 538 LIVESTEMN live stem N gN/m^2 T - 539 LIVESTEMN_STORAGE live stem N storage gN/m^2 F - 540 LIVESTEMN_STORAGE_TO_XFER live stem N shift storage to transfer gN/m^2/s F - 541 LIVESTEMN_TO_DEADSTEMN live stem N turnover gN/m^2/s F - 542 LIVESTEMN_TO_RETRANSN live stem N to retranslocated N pool gN/m^2/s F - 543 LIVESTEMN_XFER live stem N transfer gN/m^2 F - 544 LIVESTEMN_XFER_TO_LIVESTEMN live stem N growth from storage gN/m^2/s F - 545 LIVESTEM_MR live stem maintenance respiration gC/m^2/s F - 546 LNC leaf N concentration gN leaf/m^2 T - 547 LWdown atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 F - 548 LWup upwelling longwave radiation W/m^2 F - 549 MEG_acetaldehyde MEGAN flux kg/m2/sec T - 550 MEG_acetic_acid MEGAN flux kg/m2/sec T - 551 MEG_acetone MEGAN flux kg/m2/sec T - 552 MEG_carene_3 MEGAN flux kg/m2/sec T - 553 MEG_ethanol MEGAN flux kg/m2/sec T - 554 MEG_formaldehyde MEGAN flux kg/m2/sec T - 555 MEG_isoprene MEGAN flux kg/m2/sec T - 556 MEG_methanol MEGAN flux kg/m2/sec T - 557 MEG_pinene_a MEGAN flux kg/m2/sec T - 558 MEG_thujene_a MEGAN flux kg/m2/sec T - 559 MR maintenance respiration gC/m^2/s T - 560 M_CWDC_TO_FIRE coarse woody debris C fire loss gC/m^2/s F - 561 M_CWDC_TO_FIRE_vr coarse woody debris C fire loss gC/m^3/s F - 562 M_CWDN_TO_FIRE coarse woody debris N fire loss gN/m^2 F - 563 M_CWDN_TO_FIRE_vr coarse woody debris N fire loss gN/m^3 F - 564 M_DEADCROOTC_STORAGE_TO_LITTER dead coarse root C storage mortality gC/m^2/s F - 565 M_DEADCROOTC_STORAGE_TO_LITTER_FIRE dead coarse root C storage fire mortality to litter gC/m^2/s F - 566 M_DEADCROOTC_TO_LITTER dead coarse root C mortality gC/m^2/s F - 567 M_DEADCROOTC_XFER_TO_LITTER dead coarse root C transfer mortality gC/m^2/s F - 568 M_DEADCROOTN_STORAGE_TO_FIRE dead coarse root N storage fire loss gN/m^2/s F - 569 M_DEADCROOTN_STORAGE_TO_LITTER dead coarse root N storage mortality gN/m^2/s F - 570 M_DEADCROOTN_TO_FIRE dead coarse root N fire loss gN/m^2/s F - 571 M_DEADCROOTN_TO_LITTER dead coarse root N mortality gN/m^2/s F - 572 M_DEADCROOTN_TO_LITTER_FIRE dead coarse root N fire mortality to litter gN/m^2/s F - 573 M_DEADCROOTN_XFER_TO_FIRE dead coarse root N transfer fire loss gN/m^2/s F - 574 M_DEADCROOTN_XFER_TO_LITTER dead coarse root N transfer mortality gN/m^2/s F - 575 M_DEADROOTC_STORAGE_TO_FIRE dead root C storage fire loss gC/m^2/s F - 576 M_DEADROOTC_STORAGE_TO_LITTER_FIRE dead root C storage fire mortality to litter gC/m^2/s F - 577 M_DEADROOTC_TO_FIRE dead root C fire loss gC/m^2/s F - 578 M_DEADROOTC_TO_LITTER_FIRE dead root C fire mortality to litter gC/m^2/s F - 579 M_DEADROOTC_XFER_TO_FIRE dead root C transfer fire loss gC/m^2/s F - 580 M_DEADROOTC_XFER_TO_LITTER_FIRE dead root C transfer fire mortality to litter gC/m^2/s F - 581 M_DEADSTEMC_STORAGE_TO_FIRE dead stem C storage fire loss gC/m^2/s F - 582 M_DEADSTEMC_STORAGE_TO_LITTER dead stem C storage mortality gC/m^2/s F - 583 M_DEADSTEMC_STORAGE_TO_LITTER_FIRE dead stem C storage fire mortality to litter gC/m^2/s F - 584 M_DEADSTEMC_TO_FIRE dead stem C fire loss gC/m^2/s F - 585 M_DEADSTEMC_TO_LITTER dead stem C mortality gC/m^2/s F - 586 M_DEADSTEMC_TO_LITTER_FIRE dead stem C fire mortality to litter gC/m^2/s F - 587 M_DEADSTEMC_XFER_TO_FIRE dead stem C transfer fire loss gC/m^2/s F - 588 M_DEADSTEMC_XFER_TO_LITTER dead stem C transfer mortality gC/m^2/s F - 589 M_DEADSTEMC_XFER_TO_LITTER_FIRE dead stem C transfer fire mortality to litter gC/m^2/s F - 590 M_DEADSTEMN_STORAGE_TO_FIRE dead stem N storage fire loss gN/m^2/s F - 591 M_DEADSTEMN_STORAGE_TO_LITTER dead stem N storage mortality gN/m^2/s F - 592 M_DEADSTEMN_TO_FIRE dead stem N fire loss gN/m^2/s F - 593 M_DEADSTEMN_TO_LITTER dead stem N mortality gN/m^2/s F - 594 M_DEADSTEMN_TO_LITTER_FIRE dead stem N fire mortality to litter gN/m^2/s F - 595 M_DEADSTEMN_XFER_TO_FIRE dead stem N transfer fire loss gN/m^2/s F - 596 M_DEADSTEMN_XFER_TO_LITTER dead stem N transfer mortality gN/m^2/s F - 597 M_FROOTC_STORAGE_TO_FIRE fine root C storage fire loss gC/m^2/s F - 598 M_FROOTC_STORAGE_TO_LITTER fine root C storage mortality gC/m^2/s F - 599 M_FROOTC_STORAGE_TO_LITTER_FIRE fine root C storage fire mortality to litter gC/m^2/s F - 600 M_FROOTC_TO_FIRE fine root C fire loss gC/m^2/s F - 601 M_FROOTC_TO_LITTER fine root C mortality gC/m^2/s F - 602 M_FROOTC_TO_LITTER_FIRE fine root C fire mortality to litter gC/m^2/s F - 603 M_FROOTC_XFER_TO_FIRE fine root C transfer fire loss gC/m^2/s F - 604 M_FROOTC_XFER_TO_LITTER fine root C transfer mortality gC/m^2/s F - 605 M_FROOTC_XFER_TO_LITTER_FIRE fine root C transfer fire mortality to litter gC/m^2/s F - 606 M_FROOTN_STORAGE_TO_FIRE fine root N storage fire loss gN/m^2/s F - 607 M_FROOTN_STORAGE_TO_LITTER fine root N storage mortality gN/m^2/s F - 608 M_FROOTN_TO_FIRE fine root N fire loss gN/m^2/s F - 609 M_FROOTN_TO_LITTER fine root N mortality gN/m^2/s F - 610 M_FROOTN_XFER_TO_FIRE fine root N transfer fire loss gN/m^2/s F - 611 M_FROOTN_XFER_TO_LITTER fine root N transfer mortality gN/m^2/s F - 612 M_GRESP_STORAGE_TO_FIRE growth respiration storage fire loss gC/m^2/s F - 613 M_GRESP_STORAGE_TO_LITTER growth respiration storage mortality gC/m^2/s F - 614 M_GRESP_STORAGE_TO_LITTER_FIRE growth respiration storage fire mortality to litter gC/m^2/s F - 615 M_GRESP_XFER_TO_FIRE growth respiration transfer fire loss gC/m^2/s F - 616 M_GRESP_XFER_TO_LITTER growth respiration transfer mortality gC/m^2/s F - 617 M_GRESP_XFER_TO_LITTER_FIRE growth respiration transfer fire mortality to litter gC/m^2/s F - 618 M_LEAFC_STORAGE_TO_FIRE leaf C storage fire loss gC/m^2/s F - 619 M_LEAFC_STORAGE_TO_LITTER leaf C storage mortality gC/m^2/s F - 620 M_LEAFC_STORAGE_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F - 621 M_LEAFC_TO_FIRE leaf C fire loss gC/m^2/s F - 622 M_LEAFC_TO_LITTER leaf C mortality gC/m^2/s F - 623 M_LEAFC_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F - 624 M_LEAFC_XFER_TO_FIRE leaf C transfer fire loss gC/m^2/s F - 625 M_LEAFC_XFER_TO_LITTER leaf C transfer mortality gC/m^2/s F - 626 M_LEAFC_XFER_TO_LITTER_FIRE leaf C transfer fire mortality to litter gC/m^2/s F - 627 M_LEAFN_STORAGE_TO_FIRE leaf N storage fire loss gN/m^2/s F - 628 M_LEAFN_STORAGE_TO_LITTER leaf N storage mortality gN/m^2/s F - 629 M_LEAFN_TO_FIRE leaf N fire loss gN/m^2/s F - 630 M_LEAFN_TO_LITTER leaf N mortality gN/m^2/s F - 631 M_LEAFN_XFER_TO_FIRE leaf N transfer fire loss gN/m^2/s F - 632 M_LEAFN_XFER_TO_LITTER leaf N transfer mortality gN/m^2/s F - 633 M_LITR1C_TO_FIRE litter 1 C fire loss gC/m^2/s F - 634 M_LITR1C_TO_FIRE_vr litter 1 C fire loss gC/m^3/s F - 635 M_LITR1C_TO_LEACHING litter 1 C leaching loss gC/m^2/s F - 636 M_LITR1N_TO_FIRE litter 1 N fire loss gN/m^2 F - 637 M_LITR1N_TO_FIRE_vr litter 1 N fire loss gN/m^3 F - 638 M_LITR1N_TO_LEACHING litter 1 N leaching loss gN/m^2/s F - 639 M_LITR2C_TO_FIRE litter 2 C fire loss gC/m^2/s F - 640 M_LITR2C_TO_FIRE_vr litter 2 C fire loss gC/m^3/s F - 641 M_LITR2C_TO_LEACHING litter 2 C leaching loss gC/m^2/s F - 642 M_LITR2N_TO_FIRE litter 2 N fire loss gN/m^2 F - 643 M_LITR2N_TO_FIRE_vr litter 2 N fire loss gN/m^3 F - 644 M_LITR2N_TO_LEACHING litter 2 N leaching loss gN/m^2/s F - 645 M_LITR3C_TO_FIRE litter 3 C fire loss gC/m^2/s F - 646 M_LITR3C_TO_FIRE_vr litter 3 C fire loss gC/m^3/s F - 647 M_LITR3C_TO_LEACHING litter 3 C leaching loss gC/m^2/s F - 648 M_LITR3N_TO_FIRE litter 3 N fire loss gN/m^2 F - 649 M_LITR3N_TO_FIRE_vr litter 3 N fire loss gN/m^3 F - 650 M_LITR3N_TO_LEACHING litter 3 N leaching loss gN/m^2/s F - 651 M_LIVECROOTC_STORAGE_TO_LITTER live coarse root C storage mortality gC/m^2/s F - 652 M_LIVECROOTC_STORAGE_TO_LITTER_FIRE live coarse root C fire mortality to litter gC/m^2/s F - 653 M_LIVECROOTC_TO_LITTER live coarse root C mortality gC/m^2/s F - 654 M_LIVECROOTC_XFER_TO_LITTER live coarse root C transfer mortality gC/m^2/s F - 655 M_LIVECROOTN_STORAGE_TO_FIRE live coarse root N storage fire loss gN/m^2/s F - 656 M_LIVECROOTN_STORAGE_TO_LITTER live coarse root N storage mortality gN/m^2/s F - 657 M_LIVECROOTN_TO_FIRE live coarse root N fire loss gN/m^2/s F - 658 M_LIVECROOTN_TO_LITTER live coarse root N mortality gN/m^2/s F - 659 M_LIVECROOTN_XFER_TO_FIRE live coarse root N transfer fire loss gN/m^2/s F - 660 M_LIVECROOTN_XFER_TO_LITTER live coarse root N transfer mortality gN/m^2/s F - 661 M_LIVEROOTC_STORAGE_TO_FIRE live root C storage fire loss gC/m^2/s F - 662 M_LIVEROOTC_STORAGE_TO_LITTER_FIRE live root C storage fire mortality to litter gC/m^2/s F - 663 M_LIVEROOTC_TO_DEADROOTC_FIRE live root C fire mortality to dead root C gC/m^2/s F - 664 M_LIVEROOTC_TO_FIRE live root C fire loss gC/m^2/s F - 665 M_LIVEROOTC_TO_LITTER_FIRE live root C fire mortality to litter gC/m^2/s F - 666 M_LIVEROOTC_XFER_TO_FIRE live root C transfer fire loss gC/m^2/s F - 667 M_LIVEROOTC_XFER_TO_LITTER_FIRE live root C transfer fire mortality to litter gC/m^2/s F - 668 M_LIVESTEMC_STORAGE_TO_FIRE live stem C storage fire loss gC/m^2/s F - 669 M_LIVESTEMC_STORAGE_TO_LITTER live stem C storage mortality gC/m^2/s F - 670 M_LIVESTEMC_STORAGE_TO_LITTER_FIRE live stem C storage fire mortality to litter gC/m^2/s F - 671 M_LIVESTEMC_TO_DEADSTEMC_FIRE live stem C fire mortality to dead stem C gC/m^2/s F - 672 M_LIVESTEMC_TO_FIRE live stem C fire loss gC/m^2/s F - 673 M_LIVESTEMC_TO_LITTER live stem C mortality gC/m^2/s F - 674 M_LIVESTEMC_TO_LITTER_FIRE live stem C fire mortality to litter gC/m^2/s F - 675 M_LIVESTEMC_XFER_TO_FIRE live stem C transfer fire loss gC/m^2/s F - 676 M_LIVESTEMC_XFER_TO_LITTER live stem C transfer mortality gC/m^2/s F - 677 M_LIVESTEMC_XFER_TO_LITTER_FIRE live stem C transfer fire mortality to litter gC/m^2/s F - 678 M_LIVESTEMN_STORAGE_TO_FIRE live stem N storage fire loss gN/m^2/s F - 679 M_LIVESTEMN_STORAGE_TO_LITTER live stem N storage mortality gN/m^2/s F - 680 M_LIVESTEMN_TO_FIRE live stem N fire loss gN/m^2/s F - 681 M_LIVESTEMN_TO_LITTER live stem N mortality gN/m^2/s F - 682 M_LIVESTEMN_XFER_TO_FIRE live stem N transfer fire loss gN/m^2/s F - 683 M_LIVESTEMN_XFER_TO_LITTER live stem N transfer mortality gN/m^2/s F - 684 M_RETRANSN_TO_FIRE retranslocated N pool fire loss gN/m^2/s F - 685 M_RETRANSN_TO_LITTER retranslocated N pool mortality gN/m^2/s F - 686 M_SOIL1C_TO_LEACHING soil 1 C leaching loss gC/m^2/s F - 687 M_SOIL1N_TO_LEACHING soil 1 N leaching loss gN/m^2/s F - 688 M_SOIL2C_TO_LEACHING soil 2 C leaching loss gC/m^2/s F - 689 M_SOIL2N_TO_LEACHING soil 2 N leaching loss gN/m^2/s F - 690 M_SOIL3C_TO_LEACHING soil 3 C leaching loss gC/m^2/s F - 691 M_SOIL3N_TO_LEACHING soil 3 N leaching loss gN/m^2/s F - 692 NACTIVE Mycorrhizal N uptake flux gN/m^2/s T - 693 NACTIVE_NH4 Mycorrhizal N uptake flux gN/m^2/s T - 694 NACTIVE_NO3 Mycorrhizal N uptake flux gN/m^2/s T - 695 NAM AM-associated N uptake flux gN/m^2/s T - 696 NAM_NH4 AM-associated N uptake flux gN/m^2/s T - 697 NAM_NO3 AM-associated N uptake flux gN/m^2/s T - 698 NBP net biome production, includes fire, landuse, harvest and hrv_xsmrpool flux (latter smoothed o gC/m^2/s T - 699 NDEPLOY total N deployed in new growth gN/m^2/s T - 700 NDEP_PROF profile for atmospheric N deposition 1/m F - 701 NDEP_TO_SMINN atmospheric N deposition to soil mineral N gN/m^2/s T - 702 NECM ECM-associated N uptake flux gN/m^2/s T - 703 NECM_NH4 ECM-associated N uptake flux gN/m^2/s T - 704 NECM_NO3 ECM-associated N uptake flux gN/m^2/s T - 705 NEE net ecosystem exchange of carbon, includes fire and hrv_xsmrpool (latter smoothed over the yea gC/m^2/s T - 706 NEM Gridcell net adjustment to net carbon exchange passed to atm. for methane production gC/m2/s T - 707 NEP net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink gC/m^2/s T - 708 NET_NMIN net rate of N mineralization gN/m^2/s T - 709 NET_NMIN_vr net rate of N mineralization gN/m^3/s F - 710 NFERTILIZATION fertilizer added gN/m^2/s T - 711 NFIRE fire counts valid only in Reg.C counts/km2/sec T - 712 NFIX Symbiotic BNF uptake flux gN/m^2/s T - 713 NFIXATION_PROF profile for biological N fixation 1/m F - 714 NFIX_TO_SMINN symbiotic/asymbiotic N fixation to soil mineral N gN/m^2/s F - 715 NNONMYC Non-mycorrhizal N uptake flux gN/m^2/s T - 716 NNONMYC_NH4 Non-mycorrhizal N uptake flux gN/m^2/s T - 717 NNONMYC_NO3 Non-mycorrhizal N uptake flux gN/m^2/s T - 718 NPASSIVE Passive N uptake flux gN/m^2/s T - 719 NPOOL temporary plant N pool gN/m^2 T - 720 NPOOL_TO_DEADCROOTN allocation to dead coarse root N gN/m^2/s F - 721 NPOOL_TO_DEADCROOTN_STORAGE allocation to dead coarse root N storage gN/m^2/s F - 722 NPOOL_TO_DEADSTEMN allocation to dead stem N gN/m^2/s F - 723 NPOOL_TO_DEADSTEMN_STORAGE allocation to dead stem N storage gN/m^2/s F - 724 NPOOL_TO_FROOTN allocation to fine root N gN/m^2/s F - 725 NPOOL_TO_FROOTN_STORAGE allocation to fine root N storage gN/m^2/s F - 726 NPOOL_TO_LEAFN allocation to leaf N gN/m^2/s F - 727 NPOOL_TO_LEAFN_STORAGE allocation to leaf N storage gN/m^2/s F - 728 NPOOL_TO_LIVECROOTN allocation to live coarse root N gN/m^2/s F - 729 NPOOL_TO_LIVECROOTN_STORAGE allocation to live coarse root N storage gN/m^2/s F - 730 NPOOL_TO_LIVESTEMN allocation to live stem N gN/m^2/s F - 731 NPOOL_TO_LIVESTEMN_STORAGE allocation to live stem N storage gN/m^2/s F - 732 NPP net primary production gC/m^2/s T - 733 NPP_BURNEDOFF C that cannot be used for N uptake gC/m^2/s F - 734 NPP_GROWTH Total C used for growth in FUN gC/m^2/s T - 735 NPP_NACTIVE Mycorrhizal N uptake used C gC/m^2/s T - 736 NPP_NACTIVE_NH4 Mycorrhizal N uptake use C gC/m^2/s T - 737 NPP_NACTIVE_NO3 Mycorrhizal N uptake used C gC/m^2/s T - 738 NPP_NAM AM-associated N uptake used C gC/m^2/s T - 739 NPP_NAM_NH4 AM-associated N uptake use C gC/m^2/s T - 740 NPP_NAM_NO3 AM-associated N uptake use C gC/m^2/s T - 741 NPP_NECM ECM-associated N uptake used C gC/m^2/s T - 742 NPP_NECM_NH4 ECM-associated N uptake use C gC/m^2/s T - 743 NPP_NECM_NO3 ECM-associated N uptake used C gC/m^2/s T - 744 NPP_NFIX Symbiotic BNF uptake used C gC/m^2/s T - 745 NPP_NNONMYC Non-mycorrhizal N uptake used C gC/m^2/s T - 746 NPP_NNONMYC_NH4 Non-mycorrhizal N uptake use C gC/m^2/s T - 747 NPP_NNONMYC_NO3 Non-mycorrhizal N uptake use C gC/m^2/s T - 748 NPP_NRETRANS Retranslocated N uptake flux gC/m^2/s T - 749 NPP_NUPTAKE Total C used by N uptake in FUN gC/m^2/s T - 750 NRETRANS Retranslocated N uptake flux gN/m^2/s T - 751 NRETRANS_REG Retranslocated N uptake flux gN/m^2/s T - 752 NRETRANS_SEASON Retranslocated N uptake flux gN/m^2/s T - 753 NRETRANS_STRESS Retranslocated N uptake flux gN/m^2/s T - 754 NSUBSTEPS number of adaptive timesteps in CLM timestep unitless F - 755 NUPTAKE Total N uptake of FUN gN/m^2/s T - 756 NUPTAKE_NPP_FRACTION frac of NPP used in N uptake - T - 757 N_ALLOMETRY N allocation index none F - 758 O2_DECOMP_DEPTH_UNSAT O2 consumption from HR and AR for non-inundated area mol/m3/s F - 759 OCDEP total OC deposition (dry+wet) from atmosphere kg/m^2/s T - 760 OFFSET_COUNTER offset days counter days F - 761 OFFSET_FDD offset freezing degree days counter C degree-days F - 762 OFFSET_FLAG offset flag none F - 763 OFFSET_SWI offset soil water index none F - 764 ONSET_COUNTER onset days counter days F - 765 ONSET_FDD onset freezing degree days counter C degree-days F - 766 ONSET_FLAG onset flag none F - 767 ONSET_GDD onset growing degree days C degree-days F - 768 ONSET_GDDFLAG onset flag for growing degree day sum none F - 769 ONSET_SWI onset soil water index none F - 770 O_SCALAR fraction by which decomposition is reduced due to anoxia unitless T - 771 PAR240DZ 10-day running mean of daytime patch absorbed PAR for leaves for top canopy layer W/m^2 F - 772 PAR240XZ 10-day running mean of maximum patch absorbed PAR for leaves for top canopy layer W/m^2 F - 773 PAR240_shade shade PAR (240 hrs) umol/m2/s F - 774 PAR240_sun sunlit PAR (240 hrs) umol/m2/s F - 775 PAR24_shade shade PAR (24 hrs) umol/m2/s F - 776 PAR24_sun sunlit PAR (24 hrs) umol/m2/s F - 777 PARVEGLN absorbed par by vegetation at local noon W/m^2 T - 778 PAR_shade shade PAR umol/m2/s F - 779 PAR_sun sunlit PAR umol/m2/s F - 780 PBOT atmospheric pressure at surface (downscaled to columns in glacier regions) Pa T - 781 PBOT_240 10 day running mean of air pressure Pa F - 782 PCH4 atmospheric partial pressure of CH4 Pa T - 783 PCO2 atmospheric partial pressure of CO2 Pa T - 784 PCO2_240 10 day running mean of CO2 pressure Pa F - 785 PFT_CTRUNC patch-level sink for C truncation gC/m^2 F - 786 PFT_FIRE_CLOSS total patch-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T - 787 PFT_FIRE_NLOSS total patch-level fire N loss gN/m^2/s T - 788 PFT_NTRUNC patch-level sink for N truncation gN/m^2 F - 789 PLANTCN Plant C:N used by FUN unitless F - 790 PLANT_CALLOC total allocated C flux gC/m^2/s F - 791 PLANT_NALLOC total allocated N flux gN/m^2/s F - 792 PLANT_NDEMAND N flux required to support initial GPP gN/m^2/s T - 793 PNLCZ Proportion of nitrogen allocated for light capture unitless F - 794 PO2_240 10 day running mean of O2 pressure Pa F - 795 POTENTIAL_IMMOB potential N immobilization gN/m^2/s T - 796 POTENTIAL_IMMOB_vr potential N immobilization gN/m^3/s F - 797 POT_F_DENIT potential denitrification flux gN/m^2/s T - 798 POT_F_DENIT_vr potential denitrification flux gN/m^3/s F - 799 POT_F_NIT potential nitrification flux gN/m^2/s T - 800 POT_F_NIT_vr potential nitrification flux gN/m^3/s F - 801 PREC10 10-day running mean of PREC MM H2O/S F - 802 PREC60 60-day running mean of PREC MM H2O/S F - 803 PREV_DAYL daylength from previous timestep s F - 804 PREV_FROOTC_TO_LITTER previous timestep froot C litterfall flux gC/m^2/s F - 805 PREV_LEAFC_TO_LITTER previous timestep leaf C litterfall flux gC/m^2/s F - 806 PROD100C 100-yr wood product C gC/m^2 F - 807 PROD100C_LOSS loss from 100-yr wood product pool gC/m^2/s F - 808 PROD100N 100-yr wood product N gN/m^2 F - 809 PROD100N_LOSS loss from 100-yr wood product pool gN/m^2/s F - 810 PROD10C 10-yr wood product C gC/m^2 F - 811 PROD10C_LOSS loss from 10-yr wood product pool gC/m^2/s F - 812 PROD10N 10-yr wood product N gN/m^2 F - 813 PROD10N_LOSS loss from 10-yr wood product pool gN/m^2/s F - 814 PSNSHA shaded leaf photosynthesis umolCO2/m^2/s T - 815 PSNSHADE_TO_CPOOL C fixation from shaded canopy gC/m^2/s T - 816 PSNSUN sunlit leaf photosynthesis umolCO2/m^2/s T - 817 PSNSUN_TO_CPOOL C fixation from sunlit canopy gC/m^2/s T - 818 PSurf atmospheric pressure at surface (downscaled to columns in glacier regions) Pa F - 819 Q2M 2m specific humidity kg/kg T - 820 QBOT atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg T - 821 QCHARGE aquifer recharge rate (natural vegetated and crop landunits only) mm/s T - 822 QDIRECT_THROUGHFALL direct throughfall of liquid (rain + above-canopy irrigation) mm/s F - 823 QDIRECT_THROUGHFALL_SNOW direct throughfall of snow mm/s F - 824 QDRAI sub-surface drainage mm/s T - 825 QDRAI_PERCH perched wt drainage mm/s T - 826 QDRAI_XS saturation excess drainage mm/s T - 827 QDRIP rate of excess canopy liquid falling off canopy mm/s F - 828 QDRIP_SNOW rate of excess canopy snow falling off canopy mm/s F - 829 QFLOOD runoff from river flooding mm/s T - 830 QFLX_EVAP_TOT qflx_evap_soi + qflx_evap_can + qflx_tran_veg kg m-2 s-1 T - 831 QFLX_EVAP_VEG vegetation evaporation mm H2O/s F - 832 QFLX_ICE_DYNBAL ice dynamic land cover change conversion runoff flux mm/s T - 833 QFLX_LIQDEW_TO_TOP_LAYER rate of liquid water deposited on top soil or snow layer (dew) mm H2O/s T - 834 QFLX_LIQEVAP_FROM_TOP_LAYER rate of liquid water evaporated from top soil or snow layer mm H2O/s T - 835 QFLX_LIQ_DYNBAL liq dynamic land cover change conversion runoff flux mm/s T - 836 QFLX_LIQ_GRND liquid (rain+irrigation) on ground after interception mm H2O/s F - 837 QFLX_SNOW_DRAIN drainage from snow pack mm/s T - 838 QFLX_SNOW_DRAIN_ICE drainage from snow pack melt (ice landunits only) mm/s T - 839 QFLX_SNOW_GRND snow on ground after interception mm H2O/s F - 840 QFLX_SOLIDDEW_TO_TOP_LAYER rate of solid water deposited on top soil or snow layer (frost) mm H2O/s T - 841 QFLX_SOLIDEVAP_FROM_TOP_LAYER rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s T - 842 QFLX_SOLIDEVAP_FROM_TOP_LAYER_ICE rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s F - 843 QH2OSFC surface water runoff mm/s T - 844 QH2OSFC_TO_ICE surface water converted to ice mm/s F - 845 QHR hydraulic redistribution mm/s T - 846 QICE ice growth/melt mm/s T - 847 QICE_FORC qice forcing sent to GLC mm/s F - 848 QICE_FRZ ice growth mm/s T - 849 QICE_MELT ice melt mm/s T - 850 QINFL infiltration mm/s T - 851 QINTR interception mm/s T - 852 QIRRIG_DEMAND irrigation demand mm/s F - 853 QIRRIG_DRIP water added via drip irrigation mm/s F - 854 QIRRIG_FROM_GW_CONFINED water added through confined groundwater irrigation mm/s T - 855 QIRRIG_FROM_GW_UNCONFINED water added through unconfined groundwater irrigation mm/s T - 856 QIRRIG_FROM_SURFACE water added through surface water irrigation mm/s T - 857 QIRRIG_SPRINKLER water added via sprinkler irrigation mm/s F - 858 QOVER total surface runoff (includes QH2OSFC) mm/s T - 859 QOVER_LAG time-lagged surface runoff for soil columns mm/s F - 860 QPHSNEG net negative hydraulic redistribution flux mm/s F - 861 QRGWL surface runoff at glaciers (liquid only), wetlands, lakes; also includes melted ice runoff fro mm/s T - 862 QROOTSINK water flux from soil to root in each soil-layer mm/s F - 863 QRUNOFF total liquid runoff not including correction for land use change mm/s T - 864 QRUNOFF_ICE total liquid runoff not incl corret for LULCC (ice landunits only) mm/s T - 865 QRUNOFF_ICE_TO_COUPLER total ice runoff sent to coupler (includes corrections for land use change) mm/s T - 866 QRUNOFF_ICE_TO_LIQ liquid runoff from converted ice runoff mm/s F - 867 QRUNOFF_R Rural total runoff mm/s F - 868 QRUNOFF_TO_COUPLER total liquid runoff sent to coupler (includes corrections for land use change) mm/s T - 869 QRUNOFF_U Urban total runoff mm/s F - 870 QSNOCPLIQ excess liquid h2o due to snow capping not including correction for land use change mm H2O/s T - 871 QSNOEVAP evaporation from snow (only when snl<0, otherwise it is equal to qflx_ev_soil) mm/s T - 872 QSNOFRZ column-integrated snow freezing rate kg/m2/s T - 873 QSNOFRZ_ICE column-integrated snow freezing rate (ice landunits only) mm/s T - 874 QSNOMELT snow melt rate mm/s T - 875 QSNOMELT_ICE snow melt (ice landunits only) mm/s T - 876 QSNOUNLOAD canopy snow unloading mm/s T - 877 QSNO_TEMPUNLOAD canopy snow temp unloading mm/s T - 878 QSNO_WINDUNLOAD canopy snow wind unloading mm/s T - 879 QSNWCPICE excess solid h2o due to snow capping not including correction for land use change mm H2O/s T - 880 QSOIL Ground evaporation (soil/snow evaporation + soil/snow sublimation - dew) mm/s T - 881 QSOIL_ICE Ground evaporation (ice landunits only) mm/s T - 882 QTOPSOIL water input to surface mm/s F - 883 QVEGE canopy evaporation mm/s T - 884 QVEGT canopy transpiration mm/s T - 885 Qair atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg F - 886 Qh sensible heat W/m^2 F - 887 Qle total evaporation W/m^2 F - 888 Qstor storage heat flux (includes snowmelt) W/m^2 F - 889 Qtau momentum flux kg/m/s^2 F - 890 RAIN atmospheric rain, after rain/snow repartitioning based on temperature mm/s T - 891 RAIN_FROM_ATM atmospheric rain received from atmosphere (pre-repartitioning) mm/s T - 892 RAIN_ICE atmospheric rain, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F - 893 RAM1 aerodynamical resistance s/m F - 894 RAM_LAKE aerodynamic resistance for momentum (lakes only) s/m F - 895 RB10 10 day running mean boundary layer resistance s/m F - 896 RETRANSN plant pool of retranslocated N gN/m^2 T - 897 RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T - 898 RH atmospheric relative humidity % F - 899 RH2M 2m relative humidity % T - 900 RH2M_R Rural 2m specific humidity % F - 901 RH2M_U Urban 2m relative humidity % F - 902 RH30 30-day running mean of relative humidity % F - 903 RHAF fractional humidity of canopy air fraction F - 904 RHAF10 10 day running mean of fractional humidity of canopy air fraction F - 905 RH_LEAF fractional humidity at leaf surface fraction F - 906 ROOTR effective fraction of roots in each soil layer (SMS method) proportion F - 907 RR root respiration (fine root MR + total root GR) gC/m^2/s T - 908 RRESIS root resistance in each soil layer proportion F - 909 RSSHA shaded leaf stomatal resistance s/m T - 910 RSSUN sunlit leaf stomatal resistance s/m T - 911 Rainf atmospheric rain, after rain/snow repartitioning based on temperature mm/s F - 912 Rnet net radiation W/m^2 F - 913 SABG solar rad absorbed by ground W/m^2 T - 914 SABG_PEN Rural solar rad penetrating top soil or snow layer watt/m^2 T - 915 SABV solar rad absorbed by veg W/m^2 T - 916 SEEDC pool for seeding new PFTs via dynamic landcover gC/m^2 T - 917 SEEDN pool for seeding new PFTs via dynamic landcover gN/m^2 T - 918 SLASH_HARVESTC slash harvest carbon (to litter) gC/m^2/s T - 919 SMINN soil mineral N gN/m^2 T - 920 SMINN_TO_NPOOL deployment of soil mineral N uptake gN/m^2/s T - 921 SMINN_TO_PLANT plant uptake of soil mineral N gN/m^2/s T - 922 SMINN_TO_PLANT_FUN Total soil N uptake of FUN gN/m^2/s T - 923 SMINN_TO_PLANT_vr plant uptake of soil mineral N gN/m^3/s F - 924 SMINN_TO_SOIL1N_L1 mineral N flux for decomp. of LITR1to SOIL1 gN/m^2 F - 925 SMINN_TO_SOIL1N_L1_vr mineral N flux for decomp. of LITR1to SOIL1 gN/m^3 F - 926 SMINN_TO_SOIL1N_L2 mineral N flux for decomp. of LITR2to SOIL1 gN/m^2 F - 927 SMINN_TO_SOIL1N_L2_vr mineral N flux for decomp. of LITR2to SOIL1 gN/m^3 F - 928 SMINN_TO_SOIL1N_S2 mineral N flux for decomp. of SOIL2to SOIL1 gN/m^2 F - 929 SMINN_TO_SOIL1N_S2_vr mineral N flux for decomp. of SOIL2to SOIL1 gN/m^3 F - 930 SMINN_TO_SOIL1N_S3 mineral N flux for decomp. of SOIL3to SOIL1 gN/m^2 F - 931 SMINN_TO_SOIL1N_S3_vr mineral N flux for decomp. of SOIL3to SOIL1 gN/m^3 F - 932 SMINN_TO_SOIL2N_L3 mineral N flux for decomp. of LITR3to SOIL2 gN/m^2 F - 933 SMINN_TO_SOIL2N_L3_vr mineral N flux for decomp. of LITR3to SOIL2 gN/m^3 F - 934 SMINN_TO_SOIL2N_S1 mineral N flux for decomp. of SOIL1to SOIL2 gN/m^2 F - 935 SMINN_TO_SOIL2N_S1_vr mineral N flux for decomp. of SOIL1to SOIL2 gN/m^3 F - 936 SMINN_TO_SOIL3N_S1 mineral N flux for decomp. of SOIL1to SOIL3 gN/m^2 F - 937 SMINN_TO_SOIL3N_S1_vr mineral N flux for decomp. of SOIL1to SOIL3 gN/m^3 F - 938 SMINN_TO_SOIL3N_S2 mineral N flux for decomp. of SOIL2to SOIL3 gN/m^2 F - 939 SMINN_TO_SOIL3N_S2_vr mineral N flux for decomp. of SOIL2to SOIL3 gN/m^3 F - 940 SMINN_vr soil mineral N gN/m^3 T - 941 SMIN_NH4 soil mineral NH4 gN/m^2 T - 942 SMIN_NH4_TO_PLANT plant uptake of NH4 gN/m^3/s F - 943 SMIN_NH4_vr soil mineral NH4 (vert. res.) gN/m^3 T - 944 SMIN_NO3 soil mineral NO3 gN/m^2 T - 945 SMIN_NO3_LEACHED soil NO3 pool loss to leaching gN/m^2/s T - 946 SMIN_NO3_LEACHED_vr soil NO3 pool loss to leaching gN/m^3/s F - 947 SMIN_NO3_MASSDENS SMIN_NO3_MASSDENS ugN/cm^3 soil F - 948 SMIN_NO3_RUNOFF soil NO3 pool loss to runoff gN/m^2/s T - 949 SMIN_NO3_RUNOFF_vr soil NO3 pool loss to runoff gN/m^3/s F - 950 SMIN_NO3_TO_PLANT plant uptake of NO3 gN/m^3/s F - 951 SMIN_NO3_vr soil mineral NO3 (vert. res.) gN/m^3 T - 952 SMP soil matric potential (natural vegetated and crop landunits only) mm T - 953 SNOBCMCL mass of BC in snow column kg/m2 T - 954 SNOBCMSL mass of BC in top snow layer kg/m2 T - 955 SNOCAN intercepted snow mm T - 956 SNODSTMCL mass of dust in snow column kg/m2 T - 957 SNODSTMSL mass of dust in top snow layer kg/m2 T - 958 SNOFSDSND direct nir incident solar radiation on snow W/m^2 F - 959 SNOFSDSNI diffuse nir incident solar radiation on snow W/m^2 F - 960 SNOFSDSVD direct vis incident solar radiation on snow W/m^2 F - 961 SNOFSDSVI diffuse vis incident solar radiation on snow W/m^2 F - 962 SNOFSRND direct nir reflected solar radiation from snow W/m^2 T - 963 SNOFSRNI diffuse nir reflected solar radiation from snow W/m^2 T - 964 SNOFSRVD direct vis reflected solar radiation from snow W/m^2 T - 965 SNOFSRVI diffuse vis reflected solar radiation from snow W/m^2 T - 966 SNOINTABS Fraction of incoming solar absorbed by lower snow layers - T - 967 SNOLIQFL top snow layer liquid water fraction (land) fraction F - 968 SNOOCMCL mass of OC in snow column kg/m2 T - 969 SNOOCMSL mass of OC in top snow layer kg/m2 T - 970 SNORDSL top snow layer effective grain radius m^-6 F - 971 SNOTTOPL snow temperature (top layer) K F - 972 SNOTTOPL_ICE snow temperature (top layer, ice landunits only) K F - 973 SNOTXMASS snow temperature times layer mass, layer sum; to get mass-weighted temperature, divide by (SNO K kg/m2 T - 974 SNOTXMASS_ICE snow temperature times layer mass, layer sum (ice landunits only); to get mass-weighted temper K kg/m2 F - 975 SNOW atmospheric snow, after rain/snow repartitioning based on temperature mm/s T - 976 SNOWDP gridcell mean snow height m T - 977 SNOWICE snow ice kg/m2 T - 978 SNOWICE_ICE snow ice (ice landunits only) kg/m2 F - 979 SNOWLIQ snow liquid water kg/m2 T - 980 SNOWLIQ_ICE snow liquid water (ice landunits only) kg/m2 F - 981 SNOW_DEPTH snow height of snow covered area m T - 982 SNOW_DEPTH_ICE snow height of snow covered area (ice landunits only) m F - 983 SNOW_FROM_ATM atmospheric snow received from atmosphere (pre-repartitioning) mm/s T - 984 SNOW_ICE atmospheric snow, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F - 985 SNOW_PERSISTENCE Length of time of continuous snow cover (nat. veg. landunits only) seconds T - 986 SNOW_SINKS snow sinks (liquid water) mm/s T - 987 SNOW_SOURCES snow sources (liquid water) mm/s T - 988 SNO_ABS Absorbed solar radiation in each snow layer W/m^2 F - 989 SNO_ABS_ICE Absorbed solar radiation in each snow layer (ice landunits only) W/m^2 F - 990 SNO_BW Partial density of water in the snow pack (ice + liquid) kg/m3 F - 991 SNO_BW_ICE Partial density of water in the snow pack (ice + liquid, ice landunits only) kg/m3 F - 992 SNO_EXISTENCE Fraction of averaging period for which each snow layer existed unitless F - 993 SNO_FRZ snow freezing rate in each snow layer kg/m2/s F - 994 SNO_FRZ_ICE snow freezing rate in each snow layer (ice landunits only) mm/s F - 995 SNO_GS Mean snow grain size Microns F - 996 SNO_GS_ICE Mean snow grain size (ice landunits only) Microns F - 997 SNO_ICE Snow ice content kg/m2 F - 998 SNO_LIQH2O Snow liquid water content kg/m2 F - 999 SNO_MELT snow melt rate in each snow layer mm/s F -1000 SNO_MELT_ICE snow melt rate in each snow layer (ice landunits only) mm/s F -1001 SNO_T Snow temperatures K F -1002 SNO_TK Thermal conductivity W/m-K F -1003 SNO_TK_ICE Thermal conductivity (ice landunits only) W/m-K F -1004 SNO_T_ICE Snow temperatures (ice landunits only) K F -1005 SNO_Z Snow layer thicknesses m F -1006 SNO_Z_ICE Snow layer thicknesses (ice landunits only) m F -1007 SNOdTdzL top snow layer temperature gradient (land) K/m F -1008 SOIL1C SOIL1 C gC/m^2 T -1009 SOIL1C_1m SOIL1 C to 1 meter gC/m^2 F -1010 SOIL1C_TNDNCY_VERT_TRANS soil 1 C tendency due to vertical transport gC/m^3/s F -1011 SOIL1C_TO_SOIL2C decomp. of soil 1 C to soil 2 C gC/m^2/s F -1012 SOIL1C_TO_SOIL2C_vr decomp. of soil 1 C to soil 2 C gC/m^3/s F -1013 SOIL1C_TO_SOIL3C decomp. of soil 1 C to soil 3 C gC/m^2/s F -1014 SOIL1C_TO_SOIL3C_vr decomp. of soil 1 C to soil 3 C gC/m^3/s F -1015 SOIL1C_vr SOIL1 C (vertically resolved) gC/m^3 T -1016 SOIL1N SOIL1 N gN/m^2 T -1017 SOIL1N_1m SOIL1 N to 1 meter gN/m^2 F -1018 SOIL1N_TNDNCY_VERT_TRANS soil 1 N tendency due to vertical transport gN/m^3/s F -1019 SOIL1N_TO_SOIL2N decomp. of soil 1 N to soil 2 N gN/m^2 F -1020 SOIL1N_TO_SOIL2N_vr decomp. of soil 1 N to soil 2 N gN/m^3 F -1021 SOIL1N_TO_SOIL3N decomp. of soil 1 N to soil 3 N gN/m^2 F -1022 SOIL1N_TO_SOIL3N_vr decomp. of soil 1 N to soil 3 N gN/m^3 F -1023 SOIL1N_vr SOIL1 N (vertically resolved) gN/m^3 T -1024 SOIL1_HR_S2 Het. Resp. from soil 1 gC/m^2/s F -1025 SOIL1_HR_S2_vr Het. Resp. from soil 1 gC/m^3/s F -1026 SOIL1_HR_S3 Het. Resp. from soil 1 gC/m^2/s F -1027 SOIL1_HR_S3_vr Het. Resp. from soil 1 gC/m^3/s F -1028 SOIL2C SOIL2 C gC/m^2 T -1029 SOIL2C_1m SOIL2 C to 1 meter gC/m^2 F -1030 SOIL2C_TNDNCY_VERT_TRANS soil 2 C tendency due to vertical transport gC/m^3/s F -1031 SOIL2C_TO_SOIL1C decomp. of soil 2 C to soil 1 C gC/m^2/s F -1032 SOIL2C_TO_SOIL1C_vr decomp. of soil 2 C to soil 1 C gC/m^3/s F -1033 SOIL2C_TO_SOIL3C decomp. of soil 2 C to soil 3 C gC/m^2/s F -1034 SOIL2C_TO_SOIL3C_vr decomp. of soil 2 C to soil 3 C gC/m^3/s F -1035 SOIL2C_vr SOIL2 C (vertically resolved) gC/m^3 T -1036 SOIL2N SOIL2 N gN/m^2 T -1037 SOIL2N_1m SOIL2 N to 1 meter gN/m^2 F -1038 SOIL2N_TNDNCY_VERT_TRANS soil 2 N tendency due to vertical transport gN/m^3/s F -1039 SOIL2N_TO_SOIL1N decomp. of soil 2 N to soil 1 N gN/m^2 F -1040 SOIL2N_TO_SOIL1N_vr decomp. of soil 2 N to soil 1 N gN/m^3 F -1041 SOIL2N_TO_SOIL3N decomp. of soil 2 N to soil 3 N gN/m^2 F -1042 SOIL2N_TO_SOIL3N_vr decomp. of soil 2 N to soil 3 N gN/m^3 F -1043 SOIL2N_vr SOIL2 N (vertically resolved) gN/m^3 T -1044 SOIL2_HR_S1 Het. Resp. from soil 2 gC/m^2/s F -1045 SOIL2_HR_S1_vr Het. Resp. from soil 2 gC/m^3/s F -1046 SOIL2_HR_S3 Het. Resp. from soil 2 gC/m^2/s F -1047 SOIL2_HR_S3_vr Het. Resp. from soil 2 gC/m^3/s F -1048 SOIL3C SOIL3 C gC/m^2 T -1049 SOIL3C_1m SOIL3 C to 1 meter gC/m^2 F -1050 SOIL3C_TNDNCY_VERT_TRANS soil 3 C tendency due to vertical transport gC/m^3/s F -1051 SOIL3C_TO_SOIL1C decomp. of soil 3 C to soil 1 C gC/m^2/s F -1052 SOIL3C_TO_SOIL1C_vr decomp. of soil 3 C to soil 1 C gC/m^3/s F -1053 SOIL3C_vr SOIL3 C (vertically resolved) gC/m^3 T -1054 SOIL3N SOIL3 N gN/m^2 T -1055 SOIL3N_1m SOIL3 N to 1 meter gN/m^2 F -1056 SOIL3N_TNDNCY_VERT_TRANS soil 3 N tendency due to vertical transport gN/m^3/s F -1057 SOIL3N_TO_SOIL1N decomp. of soil 3 N to soil 1 N gN/m^2 F -1058 SOIL3N_TO_SOIL1N_vr decomp. of soil 3 N to soil 1 N gN/m^3 F -1059 SOIL3N_vr SOIL3 N (vertically resolved) gN/m^3 T -1060 SOIL3_HR Het. Resp. from soil 3 gC/m^2/s F -1061 SOIL3_HR_vr Het. Resp. from soil 3 gC/m^3/s F -1062 SOILC_CHANGE C change in soil gC/m^2/s T -1063 SOILC_HR soil C heterotrophic respiration gC/m^2/s T -1064 SOILC_vr SOIL C (vertically resolved) gC/m^3 T -1065 SOILICE soil ice (natural vegetated and crop landunits only) kg/m2 T -1066 SOILLIQ soil liquid water (natural vegetated and crop landunits only) kg/m2 T -1067 SOILN_vr SOIL N (vertically resolved) gN/m^3 T -1068 SOILPSI soil water potential in each soil layer MPa F -1069 SOILRESIS soil resistance to evaporation s/m T -1070 SOILWATER_10CM soil liquid water + ice in top 10cm of soil (veg landunits only) kg/m2 T -1071 SOMC_FIRE C loss due to peat burning gC/m^2/s T -1072 SOMFIRE soil organic matter fire losses gC/m^2/s F -1073 SOM_ADV_COEF advection term for vertical SOM translocation m/s F -1074 SOM_C_LEACHED total flux of C from SOM pools due to leaching gC/m^2/s T -1075 SOM_DIFFUS_COEF diffusion coefficient for vertical SOM translocation m^2/s F -1076 SOM_N_LEACHED total flux of N from SOM pools due to leaching gN/m^2/s F -1077 SR total soil respiration (HR + root resp) gC/m^2/s T -1078 SSRE_FSR surface snow effect on reflected solar radiation W/m^2 T -1079 SSRE_FSRND surface snow effect on direct nir reflected solar radiation W/m^2 T -1080 SSRE_FSRNDLN surface snow effect on direct nir reflected solar radiation at local noon W/m^2 T -1081 SSRE_FSRNI surface snow effect on diffuse nir reflected solar radiation W/m^2 T -1082 SSRE_FSRVD surface snow radiatve effect on direct vis reflected solar radiation W/m^2 T -1083 SSRE_FSRVDLN surface snow radiatve effect on direct vis reflected solar radiation at local noon W/m^2 T -1084 SSRE_FSRVI surface snow radiatve effect on diffuse vis reflected solar radiation W/m^2 T -1085 STEM_PROF profile for litter C and N inputs from stems 1/m F -1086 STORAGE_CDEMAND C use from the C storage pool gC/m^2 F -1087 STORAGE_GR growth resp for growth sent to storage for later display gC/m^2/s F -1088 STORAGE_NDEMAND N demand during the offset period gN/m^2 F -1089 STORVEGC stored vegetation carbon, excluding cpool gC/m^2 T -1090 STORVEGN stored vegetation nitrogen gN/m^2 T -1091 SUPPLEMENT_TO_SMINN supplemental N supply gN/m^2/s T -1092 SUPPLEMENT_TO_SMINN_vr supplemental N supply gN/m^3/s F -1093 SWBGT 2 m Simplified Wetbulb Globe Temp C T -1094 SWBGT_R Rural 2 m Simplified Wetbulb Globe Temp C T -1095 SWBGT_U Urban 2 m Simplified Wetbulb Globe Temp C T -1096 SWMP65 2 m Swamp Cooler Temp 65% Eff C T -1097 SWMP65_R Rural 2 m Swamp Cooler Temp 65% Eff C T -1098 SWMP65_U Urban 2 m Swamp Cooler Temp 65% Eff C T -1099 SWMP80 2 m Swamp Cooler Temp 80% Eff C T -1100 SWMP80_R Rural 2 m Swamp Cooler Temp 80% Eff C T -1101 SWMP80_U Urban 2 m Swamp Cooler Temp 80% Eff C T -1102 SWdown atmospheric incident solar radiation W/m^2 F -1103 SWup upwelling shortwave radiation W/m^2 F -1104 SoilAlpha factor limiting ground evap unitless F -1105 SoilAlpha_U urban factor limiting ground evap unitless F -1106 T10 10-day running mean of 2-m temperature K F -1107 TAUX zonal surface stress kg/m/s^2 T -1108 TAUY meridional surface stress kg/m/s^2 T -1109 TBOT atmospheric air temperature (downscaled to columns in glacier regions) K T -1110 TBUILD internal urban building air temperature K T -1111 TBUILD_MAX prescribed maximum interior building temperature K F -1112 TEMPAVG_T2M temporary average 2m air temperature K F -1113 TEMPMAX_RETRANSN temporary annual max of retranslocated N pool gN/m^2 F -1114 TEMPSUM_POTENTIAL_GPP temporary annual sum of potential GPP gC/m^2/yr F -1115 TEQ 2 m Equiv Temp K T -1116 TEQ_R Rural 2 m Equiv Temp K T -1117 TEQ_U Urban 2 m Equiv Temp K T -1118 TFLOOR floor temperature K F -1119 TG ground temperature K T -1120 TG_ICE ground temperature (ice landunits only) K F -1121 TG_R Rural ground temperature K F -1122 TG_U Urban ground temperature K F -1123 TH2OSFC surface water temperature K T -1124 THBOT atmospheric air potential temperature (downscaled to columns in glacier regions) K T -1125 THIC 2 m Temp Hum Index Comfort C T -1126 THIC_R Rural 2 m Temp Hum Index Comfort C T -1127 THIC_U Urban 2 m Temp Hum Index Comfort C T -1128 THIP 2 m Temp Hum Index Physiology C T -1129 THIP_R Rural 2 m Temp Hum Index Physiology C T -1130 THIP_U Urban 2 m Temp Hum Index Physiology C T -1131 TKE1 top lake level eddy thermal conductivity W/(mK) T -1132 TLAI total projected leaf area index m^2/m^2 T -1133 TLAKE lake temperature K T -1134 TOPO_COL column-level topographic height m F -1135 TOPO_COL_ICE column-level topographic height (ice landunits only) m F -1136 TOPO_FORC topograephic height sent to GLC m F -1137 TOPT topt coefficient for VOC calc non F -1138 TOTCOLC total column carbon, incl veg and cpool but excl product pools gC/m^2 T -1139 TOTCOLCH4 total belowground CH4 (0 for non-lake special landunits in the absence of dynamic landunits) gC/m2 T -1140 TOTCOLN total column-level N, excluding product pools gN/m^2 T -1141 TOTECOSYSC total ecosystem carbon, incl veg but excl cpool and product pools gC/m^2 T -1142 TOTECOSYSN total ecosystem N, excluding product pools gN/m^2 T -1143 TOTFIRE total ecosystem fire losses gC/m^2/s F -1144 TOTLITC total litter carbon gC/m^2 T -1145 TOTLITC_1m total litter carbon to 1 meter depth gC/m^2 T -1146 TOTLITN total litter N gN/m^2 T -1147 TOTLITN_1m total litter N to 1 meter gN/m^2 T -1148 TOTPFTC total patch-level carbon, including cpool gC/m^2 T -1149 TOTPFTN total patch-level nitrogen gN/m^2 T -1150 TOTSOILICE vertically summed soil cie (veg landunits only) kg/m2 T -1151 TOTSOILLIQ vertically summed soil liquid water (veg landunits only) kg/m2 T -1152 TOTSOMC total soil organic matter carbon gC/m^2 T -1153 TOTSOMC_1m total soil organic matter carbon to 1 meter depth gC/m^2 T -1154 TOTSOMN total soil organic matter N gN/m^2 T -1155 TOTSOMN_1m total soil organic matter N to 1 meter gN/m^2 T -1156 TOTVEGC total vegetation carbon, excluding cpool gC/m^2 T -1157 TOTVEGN total vegetation nitrogen gN/m^2 T -1158 TOT_WOODPRODC total wood product C gC/m^2 T -1159 TOT_WOODPRODC_LOSS total loss from wood product pools gC/m^2/s T -1160 TOT_WOODPRODN total wood product N gN/m^2 T -1161 TOT_WOODPRODN_LOSS total loss from wood product pools gN/m^2/s T -1162 TPU25T canopy profile of tpu umol/m2/s T -1163 TRAFFICFLUX sensible heat flux from urban traffic W/m^2 F -1164 TRANSFER_DEADCROOT_GR dead coarse root growth respiration from storage gC/m^2/s F -1165 TRANSFER_DEADSTEM_GR dead stem growth respiration from storage gC/m^2/s F -1166 TRANSFER_FROOT_GR fine root growth respiration from storage gC/m^2/s F -1167 TRANSFER_GR growth resp for transfer growth displayed in this timestep gC/m^2/s F -1168 TRANSFER_LEAF_GR leaf growth respiration from storage gC/m^2/s F -1169 TRANSFER_LIVECROOT_GR live coarse root growth respiration from storage gC/m^2/s F -1170 TRANSFER_LIVESTEM_GR live stem growth respiration from storage gC/m^2/s F -1171 TREFMNAV daily minimum of average 2-m temperature K T -1172 TREFMNAV_R Rural daily minimum of average 2-m temperature K F -1173 TREFMNAV_U Urban daily minimum of average 2-m temperature K F -1174 TREFMXAV daily maximum of average 2-m temperature K T -1175 TREFMXAV_R Rural daily maximum of average 2-m temperature K F -1176 TREFMXAV_U Urban daily maximum of average 2-m temperature K F -1177 TROOF_INNER roof inside surface temperature K F -1178 TSA 2m air temperature K T -1179 TSAI total projected stem area index m^2/m^2 T -1180 TSA_ICE 2m air temperature (ice landunits only) K F -1181 TSA_R Rural 2m air temperature K F -1182 TSA_U Urban 2m air temperature K F -1183 TSHDW_INNER shadewall inside surface temperature K F -1184 TSKIN skin temperature K T -1185 TSL temperature of near-surface soil layer (natural vegetated and crop landunits only) K T -1186 TSOI soil temperature (natural vegetated and crop landunits only) K T -1187 TSOI_10CM soil temperature in top 10cm of soil K T -1188 TSOI_ICE soil temperature (ice landunits only) K T -1189 TSRF_FORC surface temperature sent to GLC K F -1190 TSUNW_INNER sunwall inside surface temperature K F -1191 TV vegetation temperature K T -1192 TV24 vegetation temperature (last 24hrs) K F -1193 TV240 vegetation temperature (last 240hrs) K F -1194 TVEGD10 10 day running mean of patch daytime vegetation temperature Kelvin F -1195 TVEGN10 10 day running mean of patch night-time vegetation temperature Kelvin F -1196 TWS total water storage mm T -1197 T_SCALAR temperature inhibition of decomposition unitless T -1198 Tair atmospheric air temperature (downscaled to columns in glacier regions) K F -1199 Tair_from_atm atmospheric air temperature received from atmosphere (pre-downscaling) K F -1200 U10 10-m wind m/s T -1201 U10_DUST 10-m wind for dust model m/s T -1202 U10_ICE 10-m wind (ice landunits only) m/s F -1203 ULRAD upward longwave radiation above the canopy W/m^2 F -1204 URBAN_AC urban air conditioning flux W/m^2 T -1205 URBAN_HEAT urban heating flux W/m^2 T -1206 UST_LAKE friction velocity (lakes only) m/s F -1207 VA atmospheric wind speed plus convective velocity m/s F -1208 VCMX25T canopy profile of vcmax25 umol/m2/s T -1209 VEGWP vegetation water matric potential for sun/sha canopy,xyl,root segments mm T -1210 VEGWPLN vegetation water matric potential for sun/sha canopy,xyl,root at local noon mm T -1211 VEGWPPD predawn vegetation water matric potential for sun/sha canopy,xyl,root mm T -1212 VOCFLXT total VOC flux into atmosphere moles/m2/sec F -1213 VOLR river channel total water storage m3 T -1214 VOLRMCH river channel main channel water storage m3 T -1215 VPD_CAN canopy vapor pressure deficit kPa T -1216 Vcmx25Z canopy profile of vcmax25 predicted by LUNA model umol/m2/s T -1217 WA water in the unconfined aquifer (natural vegetated and crop landunits only) mm T -1218 WASTEHEAT sensible heat flux from heating/cooling sources of urban waste heat W/m^2 T -1219 WBA 2 m Wet Bulb C T -1220 WBA_R Rural 2 m Wet Bulb C T -1221 WBA_U Urban 2 m Wet Bulb C T -1222 WBT 2 m Stull Wet Bulb C T -1223 WBT_R Rural 2 m Stull Wet Bulb C T -1224 WBT_U Urban 2 m Stull Wet Bulb C T -1225 WF soil water as frac. of whc for top 0.05 m proportion F -1226 WFPS WFPS percent F -1227 WIND atmospheric wind velocity magnitude m/s T -1228 WOODC wood C gC/m^2 T -1229 WOODC_ALLOC wood C eallocation gC/m^2/s T -1230 WOODC_LOSS wood C loss gC/m^2/s T -1231 WOOD_HARVESTC wood harvest carbon (to product pools) gC/m^2/s T -1232 WOOD_HARVESTN wood harvest N (to product pools) gN/m^2/s T -1233 WTGQ surface tracer conductance m/s T -1234 W_SCALAR Moisture (dryness) inhibition of decomposition unitless T -1235 Wind atmospheric wind velocity magnitude m/s F -1236 XSMRPOOL temporary photosynthate C pool gC/m^2 T -1237 XSMRPOOL_LOSS temporary photosynthate C pool loss gC/m^2 F -1238 XSMRPOOL_RECOVER C flux assigned to recovery of negative xsmrpool gC/m^2/s T -1239 Z0HG roughness length over ground, sensible heat m F -1240 Z0HV roughness length over vegetation, sensible heat m F -1241 Z0M momentum roughness length m F -1242 Z0MG roughness length over ground, momentum m F -1243 Z0MV roughness length over vegetation, momentum m F -1244 Z0M_TO_COUPLER roughness length, momentum: gridcell average sent to coupler m F -1245 Z0QG roughness length over ground, latent heat m F -1246 Z0QV roughness length over vegetation, latent heat m F -1247 ZBOT atmospheric reference height m T -1248 ZII convective boundary height m F -1249 ZWT water table depth (natural vegetated and crop landunits only) m T -1250 ZWT_CH4_UNSAT depth of water table for methane production used in non-inundated area m T -1251 ZWT_PERCH perched water table depth (natural vegetated and crop landunits only) m T -1252 anaerobic_frac anaerobic_frac m3/m3 F -1253 bsw clap and hornberger B unitless F -1254 currentPatch currentPatch coefficient for VOC calc non F -1255 diffus diffusivity m^2/s F -1256 fr_WFPS fr_WFPS fraction F -1257 n2_n2o_ratio_denit n2_n2o_ratio_denit gN/gN F -1258 r_psi r_psi m F -1259 ratio_k1 ratio_k1 none F -1260 ratio_no3_co2 ratio_no3_co2 ratio F -1261 soil_bulkdensity soil_bulkdensity kg/m3 F -1262 soil_co2_prod soil_co2_prod ug C / g soil / day F -1263 watfc water field capacity m^3/m^3 F -1264 watsat water saturated m^3/m^3 F + 7 ACT_SOMC ACT_SOM C gC/m^2 T + 8 ACT_SOMC_1m ACT_SOM C to 1 meter gC/m^2 F + 9 ACT_SOMC_TNDNCY_VERT_TRA active soil organic C tendency due to vertical transport gC/m^3/s F + 10 ACT_SOMC_TO_PAS_SOMC decomp. of active soil organic C to passive soil organic C gC/m^2/s F + 11 ACT_SOMC_TO_PAS_SOMC_vr decomp. of active soil organic C to passive soil organic C gC/m^3/s F + 12 ACT_SOMC_TO_SLO_SOMC decomp. of active soil organic C to slow soil organic ma C gC/m^2/s F + 13 ACT_SOMC_TO_SLO_SOMC_vr decomp. of active soil organic C to slow soil organic ma C gC/m^3/s F + 14 ACT_SOMC_vr ACT_SOM C (vertically resolved) gC/m^3 T + 15 ACT_SOMN ACT_SOM N gN/m^2 T + 16 ACT_SOMN_1m ACT_SOM N to 1 meter gN/m^2 F + 17 ACT_SOMN_TNDNCY_VERT_TRA active soil organic N tendency due to vertical transport gN/m^3/s F + 18 ACT_SOMN_TO_PAS_SOMN decomp. of active soil organic N to passive soil organic N gN/m^2 F + 19 ACT_SOMN_TO_PAS_SOMN_vr decomp. of active soil organic N to passive soil organic N gN/m^3 F + 20 ACT_SOMN_TO_SLO_SOMN decomp. of active soil organic N to slow soil organic ma N gN/m^2 F + 21 ACT_SOMN_TO_SLO_SOMN_vr decomp. of active soil organic N to slow soil organic ma N gN/m^3 F + 22 ACT_SOMN_vr ACT_SOM N (vertically resolved) gN/m^3 T + 23 ACT_SOM_HR_S2 Het. Resp. from active soil organic gC/m^2/s F + 24 ACT_SOM_HR_S2_vr Het. Resp. from active soil organic gC/m^3/s F + 25 ACT_SOM_HR_S3 Het. Resp. from active soil organic gC/m^2/s F + 26 ACT_SOM_HR_S3_vr Het. Resp. from active soil organic gC/m^3/s F + 27 AGLB Aboveground leaf biomass kg/m^2 F + 28 AGNPP aboveground NPP gC/m^2/s T + 29 AGSB Aboveground stem biomass kg/m^2 F + 30 ALBD surface albedo (direct) proportion T + 31 ALBDSF diagnostic snow-free surface albedo (direct) proportion T + 32 ALBGRD ground albedo (direct) proportion F + 33 ALBGRI ground albedo (indirect) proportion F + 34 ALBI surface albedo (indirect) proportion T + 35 ALBISF diagnostic snow-free surface albedo (indirect) proportion T + 36 ALPHA alpha coefficient for VOC calc non F + 37 ALT current active layer thickness m T + 38 ALTMAX maximum annual active layer thickness m T + 39 ALTMAX_LASTYEAR maximum prior year active layer thickness m F + 40 ANNAVG_T2M annual average 2m air temperature K F + 41 ANNMAX_RETRANSN annual max of retranslocated N pool gN/m^2 F + 42 ANNSUM_COUNTER seconds since last annual accumulator turnover s F + 43 ANNSUM_NPP annual sum of NPP gC/m^2/yr F + 44 ANNSUM_POTENTIAL_GPP annual sum of potential GPP gN/m^2/yr F + 45 APPAR_TEMP 2 m apparent temperature C T + 46 APPAR_TEMP_R Rural 2 m apparent temperature C T + 47 APPAR_TEMP_U Urban 2 m apparent temperature C T + 48 AR autotrophic respiration (MR + GR) gC/m^2/s T + 49 ATM_TOPO atmospheric surface height m T + 50 AVAILC C flux available for allocation gC/m^2/s F + 51 AVAIL_RETRANSN N flux available from retranslocation pool gN/m^2/s F + 52 AnnET Annual ET mm/s F + 53 BAF_CROP fractional area burned for crop s-1 T + 54 BAF_PEATF fractional area burned in peatland s-1 T + 55 BCDEP total BC deposition (dry+wet) from atmosphere kg/m^2/s T + 56 BETA coefficient of convective velocity none F + 57 BGLFR background litterfall rate 1/s F + 58 BGNPP belowground NPP gC/m^2/s T + 59 BGTR background transfer growth rate 1/s F + 60 BTRANMN daily minimum of transpiration beta factor unitless T + 61 CANNAVG_T2M annual average of 2m air temperature K F + 62 CANNSUM_NPP annual sum of column-level NPP gC/m^2/s F + 63 CEL_LITC CEL_LIT C gC/m^2 T + 64 CEL_LITC_1m CEL_LIT C to 1 meter gC/m^2 F + 65 CEL_LITC_TNDNCY_VERT_TRA cellulosic litter C tendency due to vertical transport gC/m^3/s F + 66 CEL_LITC_TO_ACT_SOMC decomp. of cellulosic litter C to active soil organic C gC/m^2/s F + 67 CEL_LITC_TO_ACT_SOMC_vr decomp. of cellulosic litter C to active soil organic C gC/m^3/s F + 68 CEL_LITC_vr CEL_LIT C (vertically resolved) gC/m^3 T + 69 CEL_LITN CEL_LIT N gN/m^2 T + 70 CEL_LITN_1m CEL_LIT N to 1 meter gN/m^2 F + 71 CEL_LITN_TNDNCY_VERT_TRA cellulosic litter N tendency due to vertical transport gN/m^3/s F + 72 CEL_LITN_TO_ACT_SOMN decomp. of cellulosic litter N to active soil organic N gN/m^2 F + 73 CEL_LITN_TO_ACT_SOMN_vr decomp. of cellulosic litter N to active soil organic N gN/m^3 F + 74 CEL_LITN_vr CEL_LIT N (vertically resolved) gN/m^3 T + 75 CEL_LIT_HR Het. Resp. from cellulosic litter gC/m^2/s F + 76 CEL_LIT_HR_vr Het. Resp. from cellulosic litter gC/m^3/s F + 77 CGRND deriv. of soil energy flux wrt to soil temp W/m^2/K F + 78 CGRNDL deriv. of soil latent heat flux wrt soil temp W/m^2/K F + 79 CGRNDS deriv. of soil sensible heat flux wrt soil temp W/m^2/K F + 80 CH4PROD Gridcell total production of CH4 gC/m2/s T + 81 CH4_EBUL_TOTAL_SAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F + 82 CH4_EBUL_TOTAL_UNSAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F + 83 CH4_SURF_AERE_SAT aerenchyma surface CH4 flux for inundated area; (+ to atm) mol/m2/s T + 84 CH4_SURF_AERE_UNSAT aerenchyma surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T + 85 CH4_SURF_DIFF_SAT diffusive surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T + 86 CH4_SURF_DIFF_UNSAT diffusive surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T + 87 CH4_SURF_EBUL_SAT ebullition surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T + 88 CH4_SURF_EBUL_UNSAT ebullition surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T + 89 COL_CTRUNC column-level sink for C truncation gC/m^2 F + 90 COL_FIRE_CLOSS total column-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T + 91 COL_FIRE_NLOSS total column-level fire N loss gN/m^2/s T + 92 COL_NTRUNC column-level sink for N truncation gN/m^2 F + 93 CONC_CH4_SAT CH4 soil Concentration for inundated / lake area mol/m3 F + 94 CONC_CH4_UNSAT CH4 soil Concentration for non-inundated area mol/m3 F + 95 CONC_O2_SAT O2 soil Concentration for inundated / lake area mol/m3 T + 96 CONC_O2_UNSAT O2 soil Concentration for non-inundated area mol/m3 T + 97 COST_NACTIVE Cost of active uptake gN/gC T + 98 COST_NFIX Cost of fixation gN/gC T + 99 COST_NRETRANS Cost of retranslocation gN/gC T + 100 COSZEN cosine of solar zenith angle none F + 101 CPHASE crop phenology phase 0-not planted, 1-planted, 2-leaf emerge, 3-grain fill, 4-harvest T + 102 CPOOL temporary photosynthate C pool gC/m^2 T + 103 CPOOL_DEADCROOT_GR dead coarse root growth respiration gC/m^2/s F + 104 CPOOL_DEADCROOT_STORAGE_GR dead coarse root growth respiration to storage gC/m^2/s F + 105 CPOOL_DEADSTEM_GR dead stem growth respiration gC/m^2/s F + 106 CPOOL_DEADSTEM_STORAGE_GR dead stem growth respiration to storage gC/m^2/s F + 107 CPOOL_FROOT_GR fine root growth respiration gC/m^2/s F + 108 CPOOL_FROOT_STORAGE_GR fine root growth respiration to storage gC/m^2/s F + 109 CPOOL_LEAF_GR leaf growth respiration gC/m^2/s F + 110 CPOOL_LEAF_STORAGE_GR leaf growth respiration to storage gC/m^2/s F + 111 CPOOL_LIVECROOT_GR live coarse root growth respiration gC/m^2/s F + 112 CPOOL_LIVECROOT_STORAGE_GR live coarse root growth respiration to storage gC/m^2/s F + 113 CPOOL_LIVESTEM_GR live stem growth respiration gC/m^2/s F + 114 CPOOL_LIVESTEM_STORAGE_GR live stem growth respiration to storage gC/m^2/s F + 115 CPOOL_TO_DEADCROOTC allocation to dead coarse root C gC/m^2/s F + 116 CPOOL_TO_DEADCROOTC_STORAGE allocation to dead coarse root C storage gC/m^2/s F + 117 CPOOL_TO_DEADSTEMC allocation to dead stem C gC/m^2/s F + 118 CPOOL_TO_DEADSTEMC_STORAGE allocation to dead stem C storage gC/m^2/s F + 119 CPOOL_TO_FROOTC allocation to fine root C gC/m^2/s F + 120 CPOOL_TO_FROOTC_STORAGE allocation to fine root C storage gC/m^2/s F + 121 CPOOL_TO_GRESP_STORAGE allocation to growth respiration storage gC/m^2/s F + 122 CPOOL_TO_LEAFC allocation to leaf C gC/m^2/s F + 123 CPOOL_TO_LEAFC_STORAGE allocation to leaf C storage gC/m^2/s F + 124 CPOOL_TO_LIVECROOTC allocation to live coarse root C gC/m^2/s F + 125 CPOOL_TO_LIVECROOTC_STORAGE allocation to live coarse root C storage gC/m^2/s F + 126 CPOOL_TO_LIVESTEMC allocation to live stem C gC/m^2/s F + 127 CPOOL_TO_LIVESTEMC_STORAGE allocation to live stem C storage gC/m^2/s F + 128 CROOT_PROF profile for litter C and N inputs from coarse roots 1/m F + 129 CROPPROD1C 1-yr crop product (grain+biofuel) C gC/m^2 T + 130 CROPPROD1C_LOSS loss from 1-yr crop product pool gC/m^2/s T + 131 CROPPROD1N 1-yr crop product (grain+biofuel) N gN/m^2 T + 132 CROPPROD1N_LOSS loss from 1-yr crop product pool gN/m^2/s T + 133 CROPSEEDC_DEFICIT C used for crop seed that needs to be repaid gC/m^2 T + 134 CROPSEEDN_DEFICIT N used for crop seed that needs to be repaid gN/m^2 F + 135 CROP_SEEDC_TO_LEAF crop seed source to leaf gC/m^2/s F + 136 CROP_SEEDN_TO_LEAF crop seed source to leaf gN/m^2/s F + 137 CURRENT_GR growth resp for new growth displayed in this timestep gC/m^2/s F + 138 CWDC CWD C gC/m^2 T + 139 CWDC_1m CWD C to 1 meter gC/m^2 F + 140 CWDC_HR cwd C heterotrophic respiration gC/m^2/s F + 141 CWDC_LOSS coarse woody debris C loss gC/m^2/s T + 142 CWDC_TO_CEL_LITC decomp. of coarse woody debris C to cellulosic litter C gC/m^2/s F + 143 CWDC_TO_CEL_LITC_vr decomp. of coarse woody debris C to cellulosic litter C gC/m^3/s F + 144 CWDC_TO_LIG_LITC decomp. of coarse woody debris C to lignin litter C gC/m^2/s F + 145 CWDC_TO_LIG_LITC_vr decomp. of coarse woody debris C to lignin litter C gC/m^3/s F + 146 CWDC_vr CWD C (vertically resolved) gC/m^3 T + 147 CWDN CWD N gN/m^2 T + 148 CWDN_1m CWD N to 1 meter gN/m^2 F + 149 CWDN_TO_CEL_LITN decomp. of coarse woody debris N to cellulosic litter N gN/m^2 F + 150 CWDN_TO_CEL_LITN_vr decomp. of coarse woody debris N to cellulosic litter N gN/m^3 F + 151 CWDN_TO_LIG_LITN decomp. of coarse woody debris N to lignin litter N gN/m^2 F + 152 CWDN_TO_LIG_LITN_vr decomp. of coarse woody debris N to lignin litter N gN/m^3 F + 153 CWDN_vr CWD N (vertically resolved) gN/m^3 T + 154 CWD_HR_L2 Het. Resp. from coarse woody debris gC/m^2/s F + 155 CWD_HR_L2_vr Het. Resp. from coarse woody debris gC/m^3/s F + 156 CWD_HR_L3 Het. Resp. from coarse woody debris gC/m^2/s F + 157 CWD_HR_L3_vr Het. Resp. from coarse woody debris gC/m^3/s F + 158 C_ALLOMETRY C allocation index none F + 159 DAYL daylength s F + 160 DAYS_ACTIVE number of days since last dormancy days F + 161 DEADCROOTC dead coarse root C gC/m^2 T + 162 DEADCROOTC_STORAGE dead coarse root C storage gC/m^2 F + 163 DEADCROOTC_STORAGE_TO_XFER dead coarse root C shift storage to transfer gC/m^2/s F + 164 DEADCROOTC_XFER dead coarse root C transfer gC/m^2 F + 165 DEADCROOTC_XFER_TO_DEADCROOTC dead coarse root C growth from storage gC/m^2/s F + 166 DEADCROOTN dead coarse root N gN/m^2 T + 167 DEADCROOTN_STORAGE dead coarse root N storage gN/m^2 F + 168 DEADCROOTN_STORAGE_TO_XFER dead coarse root N shift storage to transfer gN/m^2/s F + 169 DEADCROOTN_XFER dead coarse root N transfer gN/m^2 F + 170 DEADCROOTN_XFER_TO_DEADCROOTN dead coarse root N growth from storage gN/m^2/s F + 171 DEADSTEMC dead stem C gC/m^2 T + 172 DEADSTEMC_STORAGE dead stem C storage gC/m^2 F + 173 DEADSTEMC_STORAGE_TO_XFER dead stem C shift storage to transfer gC/m^2/s F + 174 DEADSTEMC_XFER dead stem C transfer gC/m^2 F + 175 DEADSTEMC_XFER_TO_DEADSTEMC dead stem C growth from storage gC/m^2/s F + 176 DEADSTEMN dead stem N gN/m^2 T + 177 DEADSTEMN_STORAGE dead stem N storage gN/m^2 F + 178 DEADSTEMN_STORAGE_TO_XFER dead stem N shift storage to transfer gN/m^2/s F + 179 DEADSTEMN_XFER dead stem N transfer gN/m^2 F + 180 DEADSTEMN_XFER_TO_DEADSTEMN dead stem N growth from storage gN/m^2/s F + 181 DENIT total rate of denitrification gN/m^2/s T + 182 DGNETDT derivative of net ground heat flux wrt soil temp W/m^2/K F + 183 DISCOI 2 m Discomfort Index C T + 184 DISCOIS 2 m Stull Discomfort Index C T + 185 DISCOIS_R Rural 2 m Stull Discomfort Index C T + 186 DISCOIS_U Urban 2 m Stull Discomfort Index C T + 187 DISCOI_R Rural 2 m Discomfort Index C T + 188 DISCOI_U Urban 2 m Discomfort Index C T + 189 DISPLA displacement height m F + 190 DISPVEGC displayed veg carbon, excluding storage and cpool gC/m^2 T + 191 DISPVEGN displayed vegetation nitrogen gN/m^2 T + 192 DLRAD downward longwave radiation below the canopy W/m^2 F + 193 DORMANT_FLAG dormancy flag none F + 194 DOWNREG fractional reduction in GPP due to N limitation proportion F + 195 DPVLTRB1 turbulent deposition velocity 1 m/s F + 196 DPVLTRB2 turbulent deposition velocity 2 m/s F + 197 DPVLTRB3 turbulent deposition velocity 3 m/s F + 198 DPVLTRB4 turbulent deposition velocity 4 m/s F + 199 DSL dry surface layer thickness mm T + 200 DSTDEP total dust deposition (dry+wet) from atmosphere kg/m^2/s T + 201 DSTFLXT total surface dust emission kg/m2/s T + 202 DT_VEG change in t_veg, last iteration K F + 203 DWT_CONV_CFLUX conversion C flux (immediate loss to atm) (0 at all times except first timestep of year) gC/m^2/s T + 204 DWT_CONV_CFLUX_DRIBBLED conversion C flux (immediate loss to atm), dribbled throughout the year gC/m^2/s T + 205 DWT_CONV_CFLUX_PATCH patch-level conversion C flux (immediate loss to atm) (0 at all times except first timestep of gC/m^2/s F + 206 DWT_CONV_NFLUX conversion N flux (immediate loss to atm) (0 at all times except first timestep of year) gN/m^2/s T + 207 DWT_CONV_NFLUX_PATCH patch-level conversion N flux (immediate loss to atm) (0 at all times except first timestep of gN/m^2/s F + 208 DWT_CROPPROD1C_GAIN landcover change-driven addition to 1-year crop product pool gC/m^2/s T + 209 DWT_CROPPROD1N_GAIN landcover change-driven addition to 1-year crop product pool gN/m^2/s T + 210 DWT_DEADCROOTC_TO_CWDC dead coarse root to CWD due to landcover change gC/m^2/s F + 211 DWT_DEADCROOTN_TO_CWDN dead coarse root to CWD due to landcover change gN/m^2/s F + 212 DWT_FROOTC_TO_CEL_LIT_C fine root to cellulosic litter due to landcover change gC/m^2/s F + 213 DWT_FROOTC_TO_LIG_LIT_C fine root to lignin litter due to landcover change gC/m^2/s F + 214 DWT_FROOTC_TO_MET_LIT_C fine root to metabolic litter due to landcover change gC/m^2/s F + 215 DWT_FROOTN_TO_CEL_LIT_N fine root N to cellulosic litter due to landcover change gN/m^2/s F + 216 DWT_FROOTN_TO_LIG_LIT_N fine root N to lignin litter due to landcover change gN/m^2/s F + 217 DWT_FROOTN_TO_MET_LIT_N fine root N to metabolic litter due to landcover change gN/m^2/s F + 218 DWT_LIVECROOTC_TO_CWDC live coarse root to CWD due to landcover change gC/m^2/s F + 219 DWT_LIVECROOTN_TO_CWDN live coarse root to CWD due to landcover change gN/m^2/s F + 220 DWT_PROD100C_GAIN landcover change-driven addition to 100-yr wood product pool gC/m^2/s F + 221 DWT_PROD100N_GAIN landcover change-driven addition to 100-yr wood product pool gN/m^2/s F + 222 DWT_PROD10C_GAIN landcover change-driven addition to 10-yr wood product pool gC/m^2/s F + 223 DWT_PROD10N_GAIN landcover change-driven addition to 10-yr wood product pool gN/m^2/s F + 224 DWT_SEEDC_TO_DEADSTEM seed source to patch-level deadstem gC/m^2/s F + 225 DWT_SEEDC_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gC/m^2/s F + 226 DWT_SEEDC_TO_LEAF seed source to patch-level leaf gC/m^2/s F + 227 DWT_SEEDC_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gC/m^2/s F + 228 DWT_SEEDN_TO_DEADSTEM seed source to patch-level deadstem gN/m^2/s T + 229 DWT_SEEDN_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gN/m^2/s F + 230 DWT_SEEDN_TO_LEAF seed source to patch-level leaf gN/m^2/s T + 231 DWT_SEEDN_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gN/m^2/s F + 232 DWT_SLASH_CFLUX slash C flux (to litter diagnostic only) (0 at all times except first timestep of year) gC/m^2/s T + 233 DWT_SLASH_CFLUX_PATCH patch-level slash C flux (to litter diagnostic only) (0 at all times except first timestep of gC/m^2/s F + 234 DWT_WOODPRODC_GAIN landcover change-driven addition to wood product pools gC/m^2/s T + 235 DWT_WOODPRODN_GAIN landcover change-driven addition to wood product pools gN/m^2/s T + 236 DWT_WOOD_PRODUCTC_GAIN_PATCH patch-level landcover change-driven addition to wood product pools(0 at all times except first gC/m^2/s F + 237 DYN_COL_ADJUSTMENTS_CH4 Adjustments in ch4 due to dynamic column areas; only makes sense at the column level: should n gC/m^2 F + 238 DYN_COL_SOIL_ADJUSTMENTS_C Adjustments in soil carbon due to dynamic column areas; only makes sense at the column level: gC/m^2 F + 239 DYN_COL_SOIL_ADJUSTMENTS_N Adjustments in soil nitrogen due to dynamic column areas; only makes sense at the column level gN/m^2 F + 240 DYN_COL_SOIL_ADJUSTMENTS_NH4 Adjustments in soil NH4 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F + 241 DYN_COL_SOIL_ADJUSTMENTS_NO3 Adjustments in soil NO3 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F + 242 EFF_POROSITY effective porosity = porosity - vol_ice proportion F + 243 EFLXBUILD building heat flux from change in interior building air temperature W/m^2 T + 244 EFLX_DYNBAL dynamic land cover change conversion energy flux W/m^2 T + 245 EFLX_GNET net heat flux into ground W/m^2 F + 246 EFLX_GRND_LAKE net heat flux into lake/snow surface, excluding light transmission W/m^2 T + 247 EFLX_LH_TOT total latent heat flux [+ to atm] W/m^2 T + 248 EFLX_LH_TOT_ICE total latent heat flux [+ to atm] (ice landunits only) W/m^2 F + 249 EFLX_LH_TOT_R Rural total evaporation W/m^2 T + 250 EFLX_LH_TOT_U Urban total evaporation W/m^2 F + 251 EFLX_SOIL_GRND soil heat flux [+ into soil] W/m^2 F + 252 ELAI exposed one-sided leaf area index m^2/m^2 T + 253 EMG ground emissivity proportion F + 254 EMV vegetation emissivity proportion F + 255 EOPT Eopt coefficient for VOC calc non F + 256 EPT 2 m Equiv Pot Temp K T + 257 EPT_R Rural 2 m Equiv Pot Temp K T + 258 EPT_U Urban 2 m Equiv Pot Temp K T + 259 ER total ecosystem respiration, autotrophic + heterotrophic gC/m^2/s T + 260 ERRH2O total water conservation error mm T + 261 ERRH2OSNO imbalance in snow depth (liquid water) mm T + 262 ERRSEB surface energy conservation error W/m^2 T + 263 ERRSOI soil/lake energy conservation error W/m^2 T + 264 ERRSOL solar radiation conservation error W/m^2 T + 265 ESAI exposed one-sided stem area index m^2/m^2 T + 266 EXCESSC_MR excess C maintenance respiration gC/m^2/s F + 267 EXCESS_CFLUX C flux not allocated due to downregulation gC/m^2/s F + 268 FAREA_BURNED timestep fractional area burned s-1 T + 269 FCANSNO fraction of canopy that is wet proportion F + 270 FCEV canopy evaporation W/m^2 T + 271 FCH4 Gridcell surface CH4 flux to atmosphere (+ to atm) kgC/m2/s T + 272 FCH4TOCO2 Gridcell oxidation of CH4 to CO2 gC/m2/s T + 273 FCH4_DFSAT CH4 additional flux due to changing fsat, natural vegetated and crop landunits only kgC/m2/s T + 274 FCO2 CO2 flux to atmosphere (+ to atm) kgCO2/m2/s F + 275 FCOV fractional impermeable area unitless T + 276 FCTR canopy transpiration W/m^2 T + 277 FDRY fraction of foliage that is green and dry proportion F + 278 FERTNITRO Nitrogen fertilizer for each crop gN/m2/yr F + 279 FERT_COUNTER time left to fertilize seconds F + 280 FERT_TO_SMINN fertilizer to soil mineral N gN/m^2/s F + 281 FFIX_TO_SMINN free living N fixation to soil mineral N gN/m^2/s T + 282 FGEV ground evaporation W/m^2 T + 283 FGR heat flux into soil/snow including snow melt and lake / snow light transmission W/m^2 T + 284 FGR12 heat flux between soil layers 1 and 2 W/m^2 T + 285 FGR_ICE heat flux into soil/snow including snow melt and lake / snow light transmission (ice landunits W/m^2 F + 286 FGR_R Rural heat flux into soil/snow including snow melt and snow light transmission W/m^2 F + 287 FGR_SOIL_R Rural downward heat flux at interface below each soil layer watt/m^2 F + 288 FGR_U Urban heat flux into soil/snow including snow melt W/m^2 F + 289 FH2OSFC fraction of ground covered by surface water unitless T + 290 FH2OSFC_NOSNOW fraction of ground covered by surface water (if no snow present) unitless F + 291 FINUNDATED fractional inundated area of vegetated columns unitless T + 292 FINUNDATED_LAG time-lagged inundated fraction of vegetated columns unitless F + 293 FIRA net infrared (longwave) radiation W/m^2 T + 294 FIRA_ICE net infrared (longwave) radiation (ice landunits only) W/m^2 F + 295 FIRA_R Rural net infrared (longwave) radiation W/m^2 T + 296 FIRA_U Urban net infrared (longwave) radiation W/m^2 F + 297 FIRE emitted infrared (longwave) radiation W/m^2 T + 298 FIRE_ICE emitted infrared (longwave) radiation (ice landunits only) W/m^2 F + 299 FIRE_R Rural emitted infrared (longwave) radiation W/m^2 T + 300 FIRE_U Urban emitted infrared (longwave) radiation W/m^2 F + 301 FLDS atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 T + 302 FLDS_ICE atmospheric longwave radiation (downscaled to columns in glacier regions) (ice landunits only) W/m^2 F + 303 FMAX_DENIT_CARBONSUBSTRATE FMAX_DENIT_CARBONSUBSTRATE gN/m^3/s F + 304 FMAX_DENIT_NITRATE FMAX_DENIT_NITRATE gN/m^3/s F + 305 FPI fraction of potential immobilization proportion T + 306 FPI_vr fraction of potential immobilization proportion F + 307 FPSN photosynthesis umol m-2 s-1 T + 308 FPSN24 24 hour accumulative patch photosynthesis starting from mid-night umol CO2/m^2 ground/day F + 309 FPSN_WC Rubisco-limited photosynthesis umol m-2 s-1 F + 310 FPSN_WJ RuBP-limited photosynthesis umol m-2 s-1 F + 311 FPSN_WP Product-limited photosynthesis umol m-2 s-1 F + 312 FRAC_ICEOLD fraction of ice relative to the tot water proportion F + 313 FREE_RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T + 314 FROOTC fine root C gC/m^2 T + 315 FROOTC_ALLOC fine root C allocation gC/m^2/s T + 316 FROOTC_LOSS fine root C loss gC/m^2/s T + 317 FROOTC_STORAGE fine root C storage gC/m^2 F + 318 FROOTC_STORAGE_TO_XFER fine root C shift storage to transfer gC/m^2/s F + 319 FROOTC_TO_LITTER fine root C litterfall gC/m^2/s F + 320 FROOTC_XFER fine root C transfer gC/m^2 F + 321 FROOTC_XFER_TO_FROOTC fine root C growth from storage gC/m^2/s F + 322 FROOTN fine root N gN/m^2 T + 323 FROOTN_STORAGE fine root N storage gN/m^2 F + 324 FROOTN_STORAGE_TO_XFER fine root N shift storage to transfer gN/m^2/s F + 325 FROOTN_TO_LITTER fine root N litterfall gN/m^2/s F + 326 FROOTN_XFER fine root N transfer gN/m^2 F + 327 FROOTN_XFER_TO_FROOTN fine root N growth from storage gN/m^2/s F + 328 FROOT_MR fine root maintenance respiration gC/m^2/s F + 329 FROOT_PROF profile for litter C and N inputs from fine roots 1/m F + 330 FROST_TABLE frost table depth (natural vegetated and crop landunits only) m F + 331 FSA absorbed solar radiation W/m^2 T + 332 FSAT fractional area with water table at surface unitless T + 333 FSA_ICE absorbed solar radiation (ice landunits only) W/m^2 F + 334 FSA_R Rural absorbed solar radiation W/m^2 F + 335 FSA_U Urban absorbed solar radiation W/m^2 F + 336 FSD24 direct radiation (last 24hrs) K F + 337 FSD240 direct radiation (last 240hrs) K F + 338 FSDS atmospheric incident solar radiation W/m^2 T + 339 FSDSND direct nir incident solar radiation W/m^2 T + 340 FSDSNDLN direct nir incident solar radiation at local noon W/m^2 T + 341 FSDSNI diffuse nir incident solar radiation W/m^2 T + 342 FSDSVD direct vis incident solar radiation W/m^2 T + 343 FSDSVDLN direct vis incident solar radiation at local noon W/m^2 T + 344 FSDSVI diffuse vis incident solar radiation W/m^2 T + 345 FSDSVILN diffuse vis incident solar radiation at local noon W/m^2 T + 346 FSH sensible heat not including correction for land use change and rain/snow conversion W/m^2 T + 347 FSH_G sensible heat from ground W/m^2 T + 348 FSH_ICE sensible heat not including correction for land use change and rain/snow conversion (ice landu W/m^2 F + 349 FSH_PRECIP_CONVERSION Sensible heat flux from conversion of rain/snow atm forcing W/m^2 T + 350 FSH_R Rural sensible heat W/m^2 T + 351 FSH_RUNOFF_ICE_TO_LIQ sensible heat flux generated from conversion of ice runoff to liquid W/m^2 T + 352 FSH_TO_COUPLER sensible heat sent to coupler (includes corrections for land use change, rain/snow conversion W/m^2 T + 353 FSH_U Urban sensible heat W/m^2 F + 354 FSH_V sensible heat from veg W/m^2 T + 355 FSI24 indirect radiation (last 24hrs) K F + 356 FSI240 indirect radiation (last 240hrs) K F + 357 FSM snow melt heat flux W/m^2 T + 358 FSM_ICE snow melt heat flux (ice landunits only) W/m^2 F + 359 FSM_R Rural snow melt heat flux W/m^2 F + 360 FSM_U Urban snow melt heat flux W/m^2 F + 361 FSNO fraction of ground covered by snow unitless T + 362 FSNO_EFF effective fraction of ground covered by snow unitless T + 363 FSNO_ICE fraction of ground covered by snow (ice landunits only) unitless F + 364 FSR reflected solar radiation W/m^2 T + 365 FSRND direct nir reflected solar radiation W/m^2 T + 366 FSRNDLN direct nir reflected solar radiation at local noon W/m^2 T + 367 FSRNI diffuse nir reflected solar radiation W/m^2 T + 368 FSRSF reflected solar radiation W/m^2 T + 369 FSRSFND direct nir reflected solar radiation W/m^2 T + 370 FSRSFNDLN direct nir reflected solar radiation at local noon W/m^2 T + 371 FSRSFNI diffuse nir reflected solar radiation W/m^2 T + 372 FSRSFVD direct vis reflected solar radiation W/m^2 T + 373 FSRSFVDLN direct vis reflected solar radiation at local noon W/m^2 T + 374 FSRSFVI diffuse vis reflected solar radiation W/m^2 T + 375 FSRVD direct vis reflected solar radiation W/m^2 T + 376 FSRVDLN direct vis reflected solar radiation at local noon W/m^2 T + 377 FSRVI diffuse vis reflected solar radiation W/m^2 T + 378 FSR_ICE reflected solar radiation (ice landunits only) W/m^2 F + 379 FSUN sunlit fraction of canopy proportion F + 380 FSUN24 fraction sunlit (last 24hrs) K F + 381 FSUN240 fraction sunlit (last 240hrs) K F + 382 FUELC fuel load gC/m^2 T + 383 FV friction velocity m/s T + 384 FWET fraction of canopy that is wet proportion F + 385 F_DENIT denitrification flux gN/m^2/s T + 386 F_DENIT_BASE F_DENIT_BASE gN/m^3/s F + 387 F_DENIT_vr denitrification flux gN/m^3/s F + 388 F_N2O_DENIT denitrification N2O flux gN/m^2/s T + 389 F_N2O_NIT nitrification N2O flux gN/m^2/s T + 390 F_NIT nitrification flux gN/m^2/s T + 391 F_NIT_vr nitrification flux gN/m^3/s F + 392 FireComp_BC fire emissions flux of BC kg/m2/sec F + 393 FireComp_OC fire emissions flux of OC kg/m2/sec F + 394 FireComp_SO2 fire emissions flux of SO2 kg/m2/sec F + 395 FireEmis_TOT Total fire emissions flux gC/m2/sec F + 396 FireEmis_ZTOP Top of vertical fire emissions distribution m F + 397 FireMech_SO2 fire emissions flux of SO2 kg/m2/sec F + 398 FireMech_bc_a1 fire emissions flux of bc_a1 kg/m2/sec F + 399 FireMech_pom_a1 fire emissions flux of pom_a1 kg/m2/sec F + 400 GAMMA total gamma for VOC calc non F + 401 GAMMAA gamma A for VOC calc non F + 402 GAMMAC gamma C for VOC calc non F + 403 GAMMAL gamma L for VOC calc non F + 404 GAMMAP gamma P for VOC calc non F + 405 GAMMAS gamma S for VOC calc non F + 406 GAMMAT gamma T for VOC calc non F + 407 GDD0 Growing degree days base 0C from planting ddays F + 408 GDD020 Twenty year average of growing degree days base 0C from planting ddays F + 409 GDD10 Growing degree days base 10C from planting ddays F + 410 GDD1020 Twenty year average of growing degree days base 10C from planting ddays F + 411 GDD8 Growing degree days base 8C from planting ddays F + 412 GDD820 Twenty year average of growing degree days base 8C from planting ddays F + 413 GDDHARV Growing degree days (gdd) needed to harvest ddays F + 414 GDDPLANT Accumulated growing degree days past planting date for crop ddays F + 415 GDDTSOI Growing degree-days from planting (top two soil layers) ddays F + 416 GPP gross primary production gC/m^2/s T + 417 GR total growth respiration gC/m^2/s T + 418 GRAINC grain C (does not equal yield) gC/m^2 T + 419 GRAINC_TO_FOOD grain C to food gC/m^2/s T + 420 GRAINC_TO_SEED grain C to seed gC/m^2/s T + 421 GRAINN grain N gN/m^2 T + 422 GRESP_STORAGE growth respiration storage gC/m^2 F + 423 GRESP_STORAGE_TO_XFER growth respiration shift storage to transfer gC/m^2/s F + 424 GRESP_XFER growth respiration transfer gC/m^2 F + 425 GROSS_NMIN gross rate of N mineralization gN/m^2/s T + 426 GROSS_NMIN_vr gross rate of N mineralization gN/m^3/s F + 427 GSSHA shaded leaf stomatal conductance umol H20/m2/s T + 428 GSSHALN shaded leaf stomatal conductance at local noon umol H20/m2/s T + 429 GSSUN sunlit leaf stomatal conductance umol H20/m2/s T + 430 GSSUNLN sunlit leaf stomatal conductance at local noon umol H20/m2/s T + 431 H2OCAN intercepted water mm T + 432 H2OSFC surface water depth mm T + 433 H2OSNO snow depth (liquid water) mm T + 434 H2OSNO_ICE snow depth (liquid water, ice landunits only) mm F + 435 H2OSNO_TOP mass of snow in top snow layer kg/m2 T + 436 H2OSOI volumetric soil water (natural vegetated and crop landunits only) mm3/mm3 T + 437 HBOT canopy bottom m F + 438 HEAT_CONTENT1 initial gridcell total heat content J/m^2 T + 439 HEAT_CONTENT1_VEG initial gridcell total heat content - natural vegetated and crop landunits only J/m^2 F + 440 HEAT_CONTENT2 post land cover change total heat content J/m^2 F + 441 HEAT_FROM_AC sensible heat flux put into canyon due to heat removed from air conditioning W/m^2 T + 442 HIA 2 m NWS Heat Index C T + 443 HIA_R Rural 2 m NWS Heat Index C T + 444 HIA_U Urban 2 m NWS Heat Index C T + 445 HK hydraulic conductivity (natural vegetated and crop landunits only) mm/s F + 446 HR total heterotrophic respiration gC/m^2/s T + 447 HR_vr total vertically resolved heterotrophic respiration gC/m^3/s T + 448 HTOP canopy top m T + 449 HUMIDEX 2 m Humidex C T + 450 HUMIDEX_R Rural 2 m Humidex C T + 451 HUMIDEX_U Urban 2 m Humidex C T + 452 ICE_CONTENT1 initial gridcell total ice content mm T + 453 ICE_CONTENT2 post land cover change total ice content mm F + 454 ICE_MODEL_FRACTION Ice sheet model fractional coverage unitless F + 455 INIT_GPP GPP flux before downregulation gC/m^2/s F + 456 INT_SNOW accumulated swe (natural vegetated and crop landunits only) mm F + 457 INT_SNOW_ICE accumulated swe (ice landunits only) mm F + 458 IWUELN local noon intrinsic water use efficiency umolCO2/molH2O T + 459 JMX25T canopy profile of jmax umol/m2/s T + 460 Jmx25Z maximum rate of electron transport at 25 Celcius for canopy layers umol electrons/m2/s T + 461 KROOT root conductance each soil layer 1/s F + 462 KSOIL soil conductance in each soil layer 1/s F + 463 K_ACT_SOM active soil organic potential loss coefficient 1/s F + 464 K_CEL_LIT cellulosic litter potential loss coefficient 1/s F + 465 K_CWD coarse woody debris potential loss coefficient 1/s F + 466 K_LIG_LIT lignin litter potential loss coefficient 1/s F + 467 K_MET_LIT metabolic litter potential loss coefficient 1/s F + 468 K_NITR K_NITR 1/s F + 469 K_NITR_H2O K_NITR_H2O unitless F + 470 K_NITR_PH K_NITR_PH unitless F + 471 K_NITR_T K_NITR_T unitless F + 472 K_PAS_SOM passive soil organic potential loss coefficient 1/s F + 473 K_SLO_SOM slow soil organic ma potential loss coefficient 1/s F + 474 LAI240 240hr average of leaf area index m^2/m^2 F + 475 LAISHA shaded projected leaf area index m^2/m^2 T + 476 LAISUN sunlit projected leaf area index m^2/m^2 T + 477 LAKEICEFRAC lake layer ice mass fraction unitless F + 478 LAKEICEFRAC_SURF surface lake layer ice mass fraction unitless T + 479 LAKEICETHICK thickness of lake ice (including physical expansion on freezing) m T + 480 LAND_USE_FLUX total C emitted from land cover conversion (smoothed over the year) and wood and grain product gC/m^2/s T + 481 LATBASET latitude vary base temperature for gddplant degree C F + 482 LEAFC leaf C gC/m^2 T + 483 LEAFCN Leaf CN ratio used for flexible CN gC/gN T + 484 LEAFCN_OFFSET Leaf C:N used by FUN unitless F + 485 LEAFCN_STORAGE Storage Leaf CN ratio used for flexible CN gC/gN F + 486 LEAFC_ALLOC leaf C allocation gC/m^2/s T + 487 LEAFC_CHANGE C change in leaf gC/m^2/s T + 488 LEAFC_LOSS leaf C loss gC/m^2/s T + 489 LEAFC_STORAGE leaf C storage gC/m^2 F + 490 LEAFC_STORAGE_TO_XFER leaf C shift storage to transfer gC/m^2/s F + 491 LEAFC_STORAGE_XFER_ACC Accumulated leaf C transfer gC/m^2 F + 492 LEAFC_TO_BIOFUELC leaf C to biofuel C gC/m^2/s T + 493 LEAFC_TO_LITTER leaf C litterfall gC/m^2/s F + 494 LEAFC_TO_LITTER_FUN leaf C litterfall used by FUN gC/m^2/s T + 495 LEAFC_XFER leaf C transfer gC/m^2 F + 496 LEAFC_XFER_TO_LEAFC leaf C growth from storage gC/m^2/s F + 497 LEAFN leaf N gN/m^2 T + 498 LEAFN_STORAGE leaf N storage gN/m^2 F + 499 LEAFN_STORAGE_TO_XFER leaf N shift storage to transfer gN/m^2/s F + 500 LEAFN_STORAGE_XFER_ACC Accmulated leaf N transfer gN/m^2 F + 501 LEAFN_TO_LITTER leaf N litterfall gN/m^2/s T + 502 LEAFN_TO_RETRANSN leaf N to retranslocated N pool gN/m^2/s F + 503 LEAFN_XFER leaf N transfer gN/m^2 F + 504 LEAFN_XFER_TO_LEAFN leaf N growth from storage gN/m^2/s F + 505 LEAF_MR leaf maintenance respiration gC/m^2/s T + 506 LEAF_PROF profile for litter C and N inputs from leaves 1/m F + 507 LFC2 conversion area fraction of BET and BDT that burned per sec T + 508 LGSF long growing season factor proportion F + 509 LIG_LITC LIG_LIT C gC/m^2 T + 510 LIG_LITC_1m LIG_LIT C to 1 meter gC/m^2 F + 511 LIG_LITC_TNDNCY_VERT_TRA lignin litter C tendency due to vertical transport gC/m^3/s F + 512 LIG_LITC_TO_SLO_SOMC decomp. of lignin litter C to slow soil organic ma C gC/m^2/s F + 513 LIG_LITC_TO_SLO_SOMC_vr decomp. of lignin litter C to slow soil organic ma C gC/m^3/s F + 514 LIG_LITC_vr LIG_LIT C (vertically resolved) gC/m^3 T + 515 LIG_LITN LIG_LIT N gN/m^2 T + 516 LIG_LITN_1m LIG_LIT N to 1 meter gN/m^2 F + 517 LIG_LITN_TNDNCY_VERT_TRA lignin litter N tendency due to vertical transport gN/m^3/s F + 518 LIG_LITN_TO_SLO_SOMN decomp. of lignin litter N to slow soil organic ma N gN/m^2 F + 519 LIG_LITN_TO_SLO_SOMN_vr decomp. of lignin litter N to slow soil organic ma N gN/m^3 F + 520 LIG_LITN_vr LIG_LIT N (vertically resolved) gN/m^3 T + 521 LIG_LIT_HR Het. Resp. from lignin litter gC/m^2/s F + 522 LIG_LIT_HR_vr Het. Resp. from lignin litter gC/m^3/s F + 523 LIQCAN intercepted liquid water mm T + 524 LIQUID_CONTENT1 initial gridcell total liq content mm T + 525 LIQUID_CONTENT2 post landuse change gridcell total liq content mm F + 526 LIQUID_WATER_TEMP1 initial gridcell weighted average liquid water temperature K F + 527 LITFALL litterfall (leaves and fine roots) gC/m^2/s T + 528 LITFIRE litter fire losses gC/m^2/s F + 529 LITTERC_HR litter C heterotrophic respiration gC/m^2/s T + 530 LITTERC_LOSS litter C loss gC/m^2/s T + 531 LIVECROOTC live coarse root C gC/m^2 T + 532 LIVECROOTC_STORAGE live coarse root C storage gC/m^2 F + 533 LIVECROOTC_STORAGE_TO_XFER live coarse root C shift storage to transfer gC/m^2/s F + 534 LIVECROOTC_TO_DEADCROOTC live coarse root C turnover gC/m^2/s F + 535 LIVECROOTC_XFER live coarse root C transfer gC/m^2 F + 536 LIVECROOTC_XFER_TO_LIVECROOTC live coarse root C growth from storage gC/m^2/s F + 537 LIVECROOTN live coarse root N gN/m^2 T + 538 LIVECROOTN_STORAGE live coarse root N storage gN/m^2 F + 539 LIVECROOTN_STORAGE_TO_XFER live coarse root N shift storage to transfer gN/m^2/s F + 540 LIVECROOTN_TO_DEADCROOTN live coarse root N turnover gN/m^2/s F + 541 LIVECROOTN_TO_RETRANSN live coarse root N to retranslocated N pool gN/m^2/s F + 542 LIVECROOTN_XFER live coarse root N transfer gN/m^2 F + 543 LIVECROOTN_XFER_TO_LIVECROOTN live coarse root N growth from storage gN/m^2/s F + 544 LIVECROOT_MR live coarse root maintenance respiration gC/m^2/s F + 545 LIVESTEMC live stem C gC/m^2 T + 546 LIVESTEMC_STORAGE live stem C storage gC/m^2 F + 547 LIVESTEMC_STORAGE_TO_XFER live stem C shift storage to transfer gC/m^2/s F + 548 LIVESTEMC_TO_BIOFUELC livestem C to biofuel C gC/m^2/s T + 549 LIVESTEMC_TO_DEADSTEMC live stem C turnover gC/m^2/s F + 550 LIVESTEMC_XFER live stem C transfer gC/m^2 F + 551 LIVESTEMC_XFER_TO_LIVESTEMC live stem C growth from storage gC/m^2/s F + 552 LIVESTEMN live stem N gN/m^2 T + 553 LIVESTEMN_STORAGE live stem N storage gN/m^2 F + 554 LIVESTEMN_STORAGE_TO_XFER live stem N shift storage to transfer gN/m^2/s F + 555 LIVESTEMN_TO_DEADSTEMN live stem N turnover gN/m^2/s F + 556 LIVESTEMN_TO_RETRANSN live stem N to retranslocated N pool gN/m^2/s F + 557 LIVESTEMN_XFER live stem N transfer gN/m^2 F + 558 LIVESTEMN_XFER_TO_LIVESTEMN live stem N growth from storage gN/m^2/s F + 559 LIVESTEM_MR live stem maintenance respiration gC/m^2/s F + 560 LNC leaf N concentration gN leaf/m^2 T + 561 LWdown atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 F + 562 LWup upwelling longwave radiation W/m^2 F + 563 MEG_acetaldehyde MEGAN flux kg/m2/sec T + 564 MEG_acetic_acid MEGAN flux kg/m2/sec T + 565 MEG_acetone MEGAN flux kg/m2/sec T + 566 MEG_carene_3 MEGAN flux kg/m2/sec T + 567 MEG_ethanol MEGAN flux kg/m2/sec T + 568 MEG_formaldehyde MEGAN flux kg/m2/sec T + 569 MEG_isoprene MEGAN flux kg/m2/sec T + 570 MEG_methanol MEGAN flux kg/m2/sec T + 571 MEG_pinene_a MEGAN flux kg/m2/sec T + 572 MEG_thujene_a MEGAN flux kg/m2/sec T + 573 MET_LITC MET_LIT C gC/m^2 T + 574 MET_LITC_1m MET_LIT C to 1 meter gC/m^2 F + 575 MET_LITC_TNDNCY_VERT_TRA metabolic litter C tendency due to vertical transport gC/m^3/s F + 576 MET_LITC_TO_ACT_SOMC decomp. of metabolic litter C to active soil organic C gC/m^2/s F + 577 MET_LITC_TO_ACT_SOMC_vr decomp. of metabolic litter C to active soil organic C gC/m^3/s F + 578 MET_LITC_vr MET_LIT C (vertically resolved) gC/m^3 T + 579 MET_LITN MET_LIT N gN/m^2 T + 580 MET_LITN_1m MET_LIT N to 1 meter gN/m^2 F + 581 MET_LITN_TNDNCY_VERT_TRA metabolic litter N tendency due to vertical transport gN/m^3/s F + 582 MET_LITN_TO_ACT_SOMN decomp. of metabolic litter N to active soil organic N gN/m^2 F + 583 MET_LITN_TO_ACT_SOMN_vr decomp. of metabolic litter N to active soil organic N gN/m^3 F + 584 MET_LITN_vr MET_LIT N (vertically resolved) gN/m^3 T + 585 MET_LIT_HR Het. Resp. from metabolic litter gC/m^2/s F + 586 MET_LIT_HR_vr Het. Resp. from metabolic litter gC/m^3/s F + 587 MR maintenance respiration gC/m^2/s T + 588 M_ACT_SOMC_TO_LEACHING active soil organic C leaching loss gC/m^2/s F + 589 M_ACT_SOMN_TO_LEACHING active soil organic N leaching loss gN/m^2/s F + 590 M_CEL_LITC_TO_FIRE cellulosic litter C fire loss gC/m^2/s F + 591 M_CEL_LITC_TO_FIRE_vr cellulosic litter C fire loss gC/m^3/s F + 592 M_CEL_LITC_TO_LEACHING cellulosic litter C leaching loss gC/m^2/s F + 593 M_CEL_LITN_TO_FIRE cellulosic litter N fire loss gN/m^2 F + 594 M_CEL_LITN_TO_FIRE_vr cellulosic litter N fire loss gN/m^3 F + 595 M_CEL_LITN_TO_LEACHING cellulosic litter N leaching loss gN/m^2/s F + 596 M_CWDC_TO_FIRE coarse woody debris C fire loss gC/m^2/s F + 597 M_CWDC_TO_FIRE_vr coarse woody debris C fire loss gC/m^3/s F + 598 M_CWDN_TO_FIRE coarse woody debris N fire loss gN/m^2 F + 599 M_CWDN_TO_FIRE_vr coarse woody debris N fire loss gN/m^3 F + 600 M_DEADCROOTC_STORAGE_TO_LITTER dead coarse root C storage mortality gC/m^2/s F + 601 M_DEADCROOTC_STORAGE_TO_LITTER_FIRE dead coarse root C storage fire mortality to litter gC/m^2/s F + 602 M_DEADCROOTC_TO_LITTER dead coarse root C mortality gC/m^2/s F + 603 M_DEADCROOTC_XFER_TO_LITTER dead coarse root C transfer mortality gC/m^2/s F + 604 M_DEADCROOTN_STORAGE_TO_FIRE dead coarse root N storage fire loss gN/m^2/s F + 605 M_DEADCROOTN_STORAGE_TO_LITTER dead coarse root N storage mortality gN/m^2/s F + 606 M_DEADCROOTN_TO_FIRE dead coarse root N fire loss gN/m^2/s F + 607 M_DEADCROOTN_TO_LITTER dead coarse root N mortality gN/m^2/s F + 608 M_DEADCROOTN_TO_LITTER_FIRE dead coarse root N fire mortality to litter gN/m^2/s F + 609 M_DEADCROOTN_XFER_TO_FIRE dead coarse root N transfer fire loss gN/m^2/s F + 610 M_DEADCROOTN_XFER_TO_LITTER dead coarse root N transfer mortality gN/m^2/s F + 611 M_DEADROOTC_STORAGE_TO_FIRE dead root C storage fire loss gC/m^2/s F + 612 M_DEADROOTC_STORAGE_TO_LITTER_FIRE dead root C storage fire mortality to litter gC/m^2/s F + 613 M_DEADROOTC_TO_FIRE dead root C fire loss gC/m^2/s F + 614 M_DEADROOTC_TO_LITTER_FIRE dead root C fire mortality to litter gC/m^2/s F + 615 M_DEADROOTC_XFER_TO_FIRE dead root C transfer fire loss gC/m^2/s F + 616 M_DEADROOTC_XFER_TO_LITTER_FIRE dead root C transfer fire mortality to litter gC/m^2/s F + 617 M_DEADSTEMC_STORAGE_TO_FIRE dead stem C storage fire loss gC/m^2/s F + 618 M_DEADSTEMC_STORAGE_TO_LITTER dead stem C storage mortality gC/m^2/s F + 619 M_DEADSTEMC_STORAGE_TO_LITTER_FIRE dead stem C storage fire mortality to litter gC/m^2/s F + 620 M_DEADSTEMC_TO_FIRE dead stem C fire loss gC/m^2/s F + 621 M_DEADSTEMC_TO_LITTER dead stem C mortality gC/m^2/s F + 622 M_DEADSTEMC_TO_LITTER_FIRE dead stem C fire mortality to litter gC/m^2/s F + 623 M_DEADSTEMC_XFER_TO_FIRE dead stem C transfer fire loss gC/m^2/s F + 624 M_DEADSTEMC_XFER_TO_LITTER dead stem C transfer mortality gC/m^2/s F + 625 M_DEADSTEMC_XFER_TO_LITTER_FIRE dead stem C transfer fire mortality to litter gC/m^2/s F + 626 M_DEADSTEMN_STORAGE_TO_FIRE dead stem N storage fire loss gN/m^2/s F + 627 M_DEADSTEMN_STORAGE_TO_LITTER dead stem N storage mortality gN/m^2/s F + 628 M_DEADSTEMN_TO_FIRE dead stem N fire loss gN/m^2/s F + 629 M_DEADSTEMN_TO_LITTER dead stem N mortality gN/m^2/s F + 630 M_DEADSTEMN_TO_LITTER_FIRE dead stem N fire mortality to litter gN/m^2/s F + 631 M_DEADSTEMN_XFER_TO_FIRE dead stem N transfer fire loss gN/m^2/s F + 632 M_DEADSTEMN_XFER_TO_LITTER dead stem N transfer mortality gN/m^2/s F + 633 M_FROOTC_STORAGE_TO_FIRE fine root C storage fire loss gC/m^2/s F + 634 M_FROOTC_STORAGE_TO_LITTER fine root C storage mortality gC/m^2/s F + 635 M_FROOTC_STORAGE_TO_LITTER_FIRE fine root C storage fire mortality to litter gC/m^2/s F + 636 M_FROOTC_TO_FIRE fine root C fire loss gC/m^2/s F + 637 M_FROOTC_TO_LITTER fine root C mortality gC/m^2/s F + 638 M_FROOTC_TO_LITTER_FIRE fine root C fire mortality to litter gC/m^2/s F + 639 M_FROOTC_XFER_TO_FIRE fine root C transfer fire loss gC/m^2/s F + 640 M_FROOTC_XFER_TO_LITTER fine root C transfer mortality gC/m^2/s F + 641 M_FROOTC_XFER_TO_LITTER_FIRE fine root C transfer fire mortality to litter gC/m^2/s F + 642 M_FROOTN_STORAGE_TO_FIRE fine root N storage fire loss gN/m^2/s F + 643 M_FROOTN_STORAGE_TO_LITTER fine root N storage mortality gN/m^2/s F + 644 M_FROOTN_TO_FIRE fine root N fire loss gN/m^2/s F + 645 M_FROOTN_TO_LITTER fine root N mortality gN/m^2/s F + 646 M_FROOTN_XFER_TO_FIRE fine root N transfer fire loss gN/m^2/s F + 647 M_FROOTN_XFER_TO_LITTER fine root N transfer mortality gN/m^2/s F + 648 M_GRESP_STORAGE_TO_FIRE growth respiration storage fire loss gC/m^2/s F + 649 M_GRESP_STORAGE_TO_LITTER growth respiration storage mortality gC/m^2/s F + 650 M_GRESP_STORAGE_TO_LITTER_FIRE growth respiration storage fire mortality to litter gC/m^2/s F + 651 M_GRESP_XFER_TO_FIRE growth respiration transfer fire loss gC/m^2/s F + 652 M_GRESP_XFER_TO_LITTER growth respiration transfer mortality gC/m^2/s F + 653 M_GRESP_XFER_TO_LITTER_FIRE growth respiration transfer fire mortality to litter gC/m^2/s F + 654 M_LEAFC_STORAGE_TO_FIRE leaf C storage fire loss gC/m^2/s F + 655 M_LEAFC_STORAGE_TO_LITTER leaf C storage mortality gC/m^2/s F + 656 M_LEAFC_STORAGE_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F + 657 M_LEAFC_TO_FIRE leaf C fire loss gC/m^2/s F + 658 M_LEAFC_TO_LITTER leaf C mortality gC/m^2/s F + 659 M_LEAFC_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F + 660 M_LEAFC_XFER_TO_FIRE leaf C transfer fire loss gC/m^2/s F + 661 M_LEAFC_XFER_TO_LITTER leaf C transfer mortality gC/m^2/s F + 662 M_LEAFC_XFER_TO_LITTER_FIRE leaf C transfer fire mortality to litter gC/m^2/s F + 663 M_LEAFN_STORAGE_TO_FIRE leaf N storage fire loss gN/m^2/s F + 664 M_LEAFN_STORAGE_TO_LITTER leaf N storage mortality gN/m^2/s F + 665 M_LEAFN_TO_FIRE leaf N fire loss gN/m^2/s F + 666 M_LEAFN_TO_LITTER leaf N mortality gN/m^2/s F + 667 M_LEAFN_XFER_TO_FIRE leaf N transfer fire loss gN/m^2/s F + 668 M_LEAFN_XFER_TO_LITTER leaf N transfer mortality gN/m^2/s F + 669 M_LIG_LITC_TO_FIRE lignin litter C fire loss gC/m^2/s F + 670 M_LIG_LITC_TO_FIRE_vr lignin litter C fire loss gC/m^3/s F + 671 M_LIG_LITC_TO_LEACHING lignin litter C leaching loss gC/m^2/s F + 672 M_LIG_LITN_TO_FIRE lignin litter N fire loss gN/m^2 F + 673 M_LIG_LITN_TO_FIRE_vr lignin litter N fire loss gN/m^3 F + 674 M_LIG_LITN_TO_LEACHING lignin litter N leaching loss gN/m^2/s F + 675 M_LIVECROOTC_STORAGE_TO_LITTER live coarse root C storage mortality gC/m^2/s F + 676 M_LIVECROOTC_STORAGE_TO_LITTER_FIRE live coarse root C fire mortality to litter gC/m^2/s F + 677 M_LIVECROOTC_TO_LITTER live coarse root C mortality gC/m^2/s F + 678 M_LIVECROOTC_XFER_TO_LITTER live coarse root C transfer mortality gC/m^2/s F + 679 M_LIVECROOTN_STORAGE_TO_FIRE live coarse root N storage fire loss gN/m^2/s F + 680 M_LIVECROOTN_STORAGE_TO_LITTER live coarse root N storage mortality gN/m^2/s F + 681 M_LIVECROOTN_TO_FIRE live coarse root N fire loss gN/m^2/s F + 682 M_LIVECROOTN_TO_LITTER live coarse root N mortality gN/m^2/s F + 683 M_LIVECROOTN_XFER_TO_FIRE live coarse root N transfer fire loss gN/m^2/s F + 684 M_LIVECROOTN_XFER_TO_LITTER live coarse root N transfer mortality gN/m^2/s F + 685 M_LIVEROOTC_STORAGE_TO_FIRE live root C storage fire loss gC/m^2/s F + 686 M_LIVEROOTC_STORAGE_TO_LITTER_FIRE live root C storage fire mortality to litter gC/m^2/s F + 687 M_LIVEROOTC_TO_DEADROOTC_FIRE live root C fire mortality to dead root C gC/m^2/s F + 688 M_LIVEROOTC_TO_FIRE live root C fire loss gC/m^2/s F + 689 M_LIVEROOTC_TO_LITTER_FIRE live root C fire mortality to litter gC/m^2/s F + 690 M_LIVEROOTC_XFER_TO_FIRE live root C transfer fire loss gC/m^2/s F + 691 M_LIVEROOTC_XFER_TO_LITTER_FIRE live root C transfer fire mortality to litter gC/m^2/s F + 692 M_LIVESTEMC_STORAGE_TO_FIRE live stem C storage fire loss gC/m^2/s F + 693 M_LIVESTEMC_STORAGE_TO_LITTER live stem C storage mortality gC/m^2/s F + 694 M_LIVESTEMC_STORAGE_TO_LITTER_FIRE live stem C storage fire mortality to litter gC/m^2/s F + 695 M_LIVESTEMC_TO_DEADSTEMC_FIRE live stem C fire mortality to dead stem C gC/m^2/s F + 696 M_LIVESTEMC_TO_FIRE live stem C fire loss gC/m^2/s F + 697 M_LIVESTEMC_TO_LITTER live stem C mortality gC/m^2/s F + 698 M_LIVESTEMC_TO_LITTER_FIRE live stem C fire mortality to litter gC/m^2/s F + 699 M_LIVESTEMC_XFER_TO_FIRE live stem C transfer fire loss gC/m^2/s F + 700 M_LIVESTEMC_XFER_TO_LITTER live stem C transfer mortality gC/m^2/s F + 701 M_LIVESTEMC_XFER_TO_LITTER_FIRE live stem C transfer fire mortality to litter gC/m^2/s F + 702 M_LIVESTEMN_STORAGE_TO_FIRE live stem N storage fire loss gN/m^2/s F + 703 M_LIVESTEMN_STORAGE_TO_LITTER live stem N storage mortality gN/m^2/s F + 704 M_LIVESTEMN_TO_FIRE live stem N fire loss gN/m^2/s F + 705 M_LIVESTEMN_TO_LITTER live stem N mortality gN/m^2/s F + 706 M_LIVESTEMN_XFER_TO_FIRE live stem N transfer fire loss gN/m^2/s F + 707 M_LIVESTEMN_XFER_TO_LITTER live stem N transfer mortality gN/m^2/s F + 708 M_MET_LITC_TO_FIRE metabolic litter C fire loss gC/m^2/s F + 709 M_MET_LITC_TO_FIRE_vr metabolic litter C fire loss gC/m^3/s F + 710 M_MET_LITC_TO_LEACHING metabolic litter C leaching loss gC/m^2/s F + 711 M_MET_LITN_TO_FIRE metabolic litter N fire loss gN/m^2 F + 712 M_MET_LITN_TO_FIRE_vr metabolic litter N fire loss gN/m^3 F + 713 M_MET_LITN_TO_LEACHING metabolic litter N leaching loss gN/m^2/s F + 714 M_PAS_SOMC_TO_LEACHING passive soil organic C leaching loss gC/m^2/s F + 715 M_PAS_SOMN_TO_LEACHING passive soil organic N leaching loss gN/m^2/s F + 716 M_RETRANSN_TO_FIRE retranslocated N pool fire loss gN/m^2/s F + 717 M_RETRANSN_TO_LITTER retranslocated N pool mortality gN/m^2/s F + 718 M_SLO_SOMC_TO_LEACHING slow soil organic ma C leaching loss gC/m^2/s F + 719 M_SLO_SOMN_TO_LEACHING slow soil organic ma N leaching loss gN/m^2/s F + 720 NACTIVE Mycorrhizal N uptake flux gN/m^2/s T + 721 NACTIVE_NH4 Mycorrhizal N uptake flux gN/m^2/s T + 722 NACTIVE_NO3 Mycorrhizal N uptake flux gN/m^2/s T + 723 NAM AM-associated N uptake flux gN/m^2/s T + 724 NAM_NH4 AM-associated N uptake flux gN/m^2/s T + 725 NAM_NO3 AM-associated N uptake flux gN/m^2/s T + 726 NBP net biome production, includes fire, landuse, harvest and hrv_xsmrpool flux (latter smoothed o gC/m^2/s T + 727 NDEPLOY total N deployed in new growth gN/m^2/s T + 728 NDEP_PROF profile for atmospheric N deposition 1/m F + 729 NDEP_TO_SMINN atmospheric N deposition to soil mineral N gN/m^2/s T + 730 NECM ECM-associated N uptake flux gN/m^2/s T + 731 NECM_NH4 ECM-associated N uptake flux gN/m^2/s T + 732 NECM_NO3 ECM-associated N uptake flux gN/m^2/s T + 733 NEE net ecosystem exchange of carbon, includes fire and hrv_xsmrpool (latter smoothed over the yea gC/m^2/s T + 734 NEM Gridcell net adjustment to net carbon exchange passed to atm. for methane production gC/m2/s T + 735 NEP net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink gC/m^2/s T + 736 NET_NMIN net rate of N mineralization gN/m^2/s T + 737 NET_NMIN_vr net rate of N mineralization gN/m^3/s F + 738 NFERTILIZATION fertilizer added gN/m^2/s T + 739 NFIRE fire counts valid only in Reg.C counts/km2/sec T + 740 NFIX Symbiotic BNF uptake flux gN/m^2/s T + 741 NFIXATION_PROF profile for biological N fixation 1/m F + 742 NFIX_TO_SMINN symbiotic/asymbiotic N fixation to soil mineral N gN/m^2/s F + 743 NNONMYC Non-mycorrhizal N uptake flux gN/m^2/s T + 744 NNONMYC_NH4 Non-mycorrhizal N uptake flux gN/m^2/s T + 745 NNONMYC_NO3 Non-mycorrhizal N uptake flux gN/m^2/s T + 746 NPASSIVE Passive N uptake flux gN/m^2/s T + 747 NPOOL temporary plant N pool gN/m^2 T + 748 NPOOL_TO_DEADCROOTN allocation to dead coarse root N gN/m^2/s F + 749 NPOOL_TO_DEADCROOTN_STORAGE allocation to dead coarse root N storage gN/m^2/s F + 750 NPOOL_TO_DEADSTEMN allocation to dead stem N gN/m^2/s F + 751 NPOOL_TO_DEADSTEMN_STORAGE allocation to dead stem N storage gN/m^2/s F + 752 NPOOL_TO_FROOTN allocation to fine root N gN/m^2/s F + 753 NPOOL_TO_FROOTN_STORAGE allocation to fine root N storage gN/m^2/s F + 754 NPOOL_TO_LEAFN allocation to leaf N gN/m^2/s F + 755 NPOOL_TO_LEAFN_STORAGE allocation to leaf N storage gN/m^2/s F + 756 NPOOL_TO_LIVECROOTN allocation to live coarse root N gN/m^2/s F + 757 NPOOL_TO_LIVECROOTN_STORAGE allocation to live coarse root N storage gN/m^2/s F + 758 NPOOL_TO_LIVESTEMN allocation to live stem N gN/m^2/s F + 759 NPOOL_TO_LIVESTEMN_STORAGE allocation to live stem N storage gN/m^2/s F + 760 NPP net primary production gC/m^2/s T + 761 NPP_BURNEDOFF C that cannot be used for N uptake gC/m^2/s F + 762 NPP_GROWTH Total C used for growth in FUN gC/m^2/s T + 763 NPP_NACTIVE Mycorrhizal N uptake used C gC/m^2/s T + 764 NPP_NACTIVE_NH4 Mycorrhizal N uptake use C gC/m^2/s T + 765 NPP_NACTIVE_NO3 Mycorrhizal N uptake used C gC/m^2/s T + 766 NPP_NAM AM-associated N uptake used C gC/m^2/s T + 767 NPP_NAM_NH4 AM-associated N uptake use C gC/m^2/s T + 768 NPP_NAM_NO3 AM-associated N uptake use C gC/m^2/s T + 769 NPP_NECM ECM-associated N uptake used C gC/m^2/s T + 770 NPP_NECM_NH4 ECM-associated N uptake use C gC/m^2/s T + 771 NPP_NECM_NO3 ECM-associated N uptake used C gC/m^2/s T + 772 NPP_NFIX Symbiotic BNF uptake used C gC/m^2/s T + 773 NPP_NNONMYC Non-mycorrhizal N uptake used C gC/m^2/s T + 774 NPP_NNONMYC_NH4 Non-mycorrhizal N uptake use C gC/m^2/s T + 775 NPP_NNONMYC_NO3 Non-mycorrhizal N uptake use C gC/m^2/s T + 776 NPP_NRETRANS Retranslocated N uptake flux gC/m^2/s T + 777 NPP_NUPTAKE Total C used by N uptake in FUN gC/m^2/s T + 778 NRETRANS Retranslocated N uptake flux gN/m^2/s T + 779 NRETRANS_REG Retranslocated N uptake flux gN/m^2/s T + 780 NRETRANS_SEASON Retranslocated N uptake flux gN/m^2/s T + 781 NRETRANS_STRESS Retranslocated N uptake flux gN/m^2/s T + 782 NSUBSTEPS number of adaptive timesteps in CLM timestep unitless F + 783 NUPTAKE Total N uptake of FUN gN/m^2/s T + 784 NUPTAKE_NPP_FRACTION frac of NPP used in N uptake - T + 785 N_ALLOMETRY N allocation index none F + 786 O2_DECOMP_DEPTH_UNSAT O2 consumption from HR and AR for non-inundated area mol/m3/s F + 787 OBU Monin-Obukhov length m F + 788 OCDEP total OC deposition (dry+wet) from atmosphere kg/m^2/s T + 789 OFFSET_COUNTER offset days counter days F + 790 OFFSET_FDD offset freezing degree days counter C degree-days F + 791 OFFSET_FLAG offset flag none F + 792 OFFSET_SWI offset soil water index none F + 793 ONSET_COUNTER onset days counter days F + 794 ONSET_FDD onset freezing degree days counter C degree-days F + 795 ONSET_FLAG onset flag none F + 796 ONSET_GDD onset growing degree days C degree-days F + 797 ONSET_GDDFLAG onset flag for growing degree day sum none F + 798 ONSET_SWI onset soil water index none F + 799 O_SCALAR fraction by which decomposition is reduced due to anoxia unitless T + 800 PAR240DZ 10-day running mean of daytime patch absorbed PAR for leaves for top canopy layer W/m^2 F + 801 PAR240XZ 10-day running mean of maximum patch absorbed PAR for leaves for top canopy layer W/m^2 F + 802 PAR240_shade shade PAR (240 hrs) umol/m2/s F + 803 PAR240_sun sunlit PAR (240 hrs) umol/m2/s F + 804 PAR24_shade shade PAR (24 hrs) umol/m2/s F + 805 PAR24_sun sunlit PAR (24 hrs) umol/m2/s F + 806 PARVEGLN absorbed par by vegetation at local noon W/m^2 T + 807 PAR_shade shade PAR umol/m2/s F + 808 PAR_sun sunlit PAR umol/m2/s F + 809 PAS_SOMC PAS_SOM C gC/m^2 T + 810 PAS_SOMC_1m PAS_SOM C to 1 meter gC/m^2 F + 811 PAS_SOMC_TNDNCY_VERT_TRA passive soil organic C tendency due to vertical transport gC/m^3/s F + 812 PAS_SOMC_TO_ACT_SOMC decomp. of passive soil organic C to active soil organic C gC/m^2/s F + 813 PAS_SOMC_TO_ACT_SOMC_vr decomp. of passive soil organic C to active soil organic C gC/m^3/s F + 814 PAS_SOMC_vr PAS_SOM C (vertically resolved) gC/m^3 T + 815 PAS_SOMN PAS_SOM N gN/m^2 T + 816 PAS_SOMN_1m PAS_SOM N to 1 meter gN/m^2 F + 817 PAS_SOMN_TNDNCY_VERT_TRA passive soil organic N tendency due to vertical transport gN/m^3/s F + 818 PAS_SOMN_TO_ACT_SOMN decomp. of passive soil organic N to active soil organic N gN/m^2 F + 819 PAS_SOMN_TO_ACT_SOMN_vr decomp. of passive soil organic N to active soil organic N gN/m^3 F + 820 PAS_SOMN_vr PAS_SOM N (vertically resolved) gN/m^3 T + 821 PAS_SOM_HR Het. Resp. from passive soil organic gC/m^2/s F + 822 PAS_SOM_HR_vr Het. Resp. from passive soil organic gC/m^3/s F + 823 PBOT atmospheric pressure at surface (downscaled to columns in glacier regions) Pa T + 824 PBOT_240 10 day running mean of air pressure Pa F + 825 PCH4 atmospheric partial pressure of CH4 Pa T + 826 PCO2 atmospheric partial pressure of CO2 Pa T + 827 PCO2_240 10 day running mean of CO2 pressure Pa F + 828 PFT_CTRUNC patch-level sink for C truncation gC/m^2 F + 829 PFT_FIRE_CLOSS total patch-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T + 830 PFT_FIRE_NLOSS total patch-level fire N loss gN/m^2/s T + 831 PFT_NTRUNC patch-level sink for N truncation gN/m^2 F + 832 PLANTCN Plant C:N used by FUN unitless F + 833 PLANT_CALLOC total allocated C flux gC/m^2/s F + 834 PLANT_NALLOC total allocated N flux gN/m^2/s F + 835 PLANT_NDEMAND N flux required to support initial GPP gN/m^2/s T + 836 PNLCZ Proportion of nitrogen allocated for light capture unitless F + 837 PO2_240 10 day running mean of O2 pressure Pa F + 838 POTENTIAL_IMMOB potential N immobilization gN/m^2/s T + 839 POTENTIAL_IMMOB_vr potential N immobilization gN/m^3/s F + 840 POT_F_DENIT potential denitrification flux gN/m^2/s T + 841 POT_F_DENIT_vr potential denitrification flux gN/m^3/s F + 842 POT_F_NIT potential nitrification flux gN/m^2/s T + 843 POT_F_NIT_vr potential nitrification flux gN/m^3/s F + 844 PREC10 10-day running mean of PREC MM H2O/S F + 845 PREC60 60-day running mean of PREC MM H2O/S F + 846 PREV_DAYL daylength from previous timestep s F + 847 PREV_FROOTC_TO_LITTER previous timestep froot C litterfall flux gC/m^2/s F + 848 PREV_LEAFC_TO_LITTER previous timestep leaf C litterfall flux gC/m^2/s F + 849 PROD100C 100-yr wood product C gC/m^2 F + 850 PROD100C_LOSS loss from 100-yr wood product pool gC/m^2/s F + 851 PROD100N 100-yr wood product N gN/m^2 F + 852 PROD100N_LOSS loss from 100-yr wood product pool gN/m^2/s F + 853 PROD10C 10-yr wood product C gC/m^2 F + 854 PROD10C_LOSS loss from 10-yr wood product pool gC/m^2/s F + 855 PROD10N 10-yr wood product N gN/m^2 F + 856 PROD10N_LOSS loss from 10-yr wood product pool gN/m^2/s F + 857 PSNSHA shaded leaf photosynthesis umolCO2/m^2/s T + 858 PSNSHADE_TO_CPOOL C fixation from shaded canopy gC/m^2/s T + 859 PSNSUN sunlit leaf photosynthesis umolCO2/m^2/s T + 860 PSNSUN_TO_CPOOL C fixation from sunlit canopy gC/m^2/s T + 861 PSurf atmospheric pressure at surface (downscaled to columns in glacier regions) Pa F + 862 Q2M 2m specific humidity kg/kg T + 863 QAF canopy air humidity kg/kg F + 864 QBOT atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg T + 865 QDIRECT_THROUGHFALL direct throughfall of liquid (rain + above-canopy irrigation) mm/s F + 866 QDIRECT_THROUGHFALL_SNOW direct throughfall of snow mm/s F + 867 QDRAI sub-surface drainage mm/s T + 868 QDRAI_PERCH perched wt drainage mm/s T + 869 QDRAI_XS saturation excess drainage mm/s T + 870 QDRIP rate of excess canopy liquid falling off canopy mm/s F + 871 QDRIP_SNOW rate of excess canopy snow falling off canopy mm/s F + 872 QFLOOD runoff from river flooding mm/s T + 873 QFLX_EVAP_TOT qflx_evap_soi + qflx_evap_can + qflx_tran_veg kg m-2 s-1 T + 874 QFLX_EVAP_VEG vegetation evaporation mm H2O/s F + 875 QFLX_ICE_DYNBAL ice dynamic land cover change conversion runoff flux mm/s T + 876 QFLX_LIQDEW_TO_TOP_LAYER rate of liquid water deposited on top soil or snow layer (dew) mm H2O/s T + 877 QFLX_LIQEVAP_FROM_TOP_LAYER rate of liquid water evaporated from top soil or snow layer mm H2O/s T + 878 QFLX_LIQ_DYNBAL liq dynamic land cover change conversion runoff flux mm/s T + 879 QFLX_LIQ_GRND liquid (rain+irrigation) on ground after interception mm H2O/s F + 880 QFLX_SNOW_DRAIN drainage from snow pack mm/s T + 881 QFLX_SNOW_DRAIN_ICE drainage from snow pack melt (ice landunits only) mm/s T + 882 QFLX_SNOW_GRND snow on ground after interception mm H2O/s F + 883 QFLX_SOLIDDEW_TO_TOP_LAYER rate of solid water deposited on top soil or snow layer (frost) mm H2O/s T + 884 QFLX_SOLIDEVAP_FROM_TOP_LAYER rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s T + 885 QFLX_SOLIDEVAP_FROM_TOP_LAYER_ICE rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s F + 886 QH2OSFC surface water runoff mm/s T + 887 QH2OSFC_TO_ICE surface water converted to ice mm/s F + 888 QHR hydraulic redistribution mm/s T + 889 QICE ice growth/melt mm/s T + 890 QICE_FORC qice forcing sent to GLC mm/s F + 891 QICE_FRZ ice growth mm/s T + 892 QICE_MELT ice melt mm/s T + 893 QINFL infiltration mm/s T + 894 QINTR interception mm/s T + 895 QIRRIG_DEMAND irrigation demand mm/s F + 896 QIRRIG_DRIP water added via drip irrigation mm/s F + 897 QIRRIG_FROM_GW_CONFINED water added through confined groundwater irrigation mm/s T + 898 QIRRIG_FROM_GW_UNCONFINED water added through unconfined groundwater irrigation mm/s T + 899 QIRRIG_FROM_SURFACE water added through surface water irrigation mm/s T + 900 QIRRIG_SPRINKLER water added via sprinkler irrigation mm/s F + 901 QOVER total surface runoff (includes QH2OSFC) mm/s T + 902 QOVER_LAG time-lagged surface runoff for soil columns mm/s F + 903 QPHSNEG net negative hydraulic redistribution flux mm/s F + 904 QRGWL surface runoff at glaciers (liquid only), wetlands, lakes; also includes melted ice runoff fro mm/s T + 905 QROOTSINK water flux from soil to root in each soil-layer mm/s F + 906 QRUNOFF total liquid runoff not including correction for land use change mm/s T + 907 QRUNOFF_ICE total liquid runoff not incl corret for LULCC (ice landunits only) mm/s T + 908 QRUNOFF_ICE_TO_COUPLER total ice runoff sent to coupler (includes corrections for land use change) mm/s T + 909 QRUNOFF_ICE_TO_LIQ liquid runoff from converted ice runoff mm/s F + 910 QRUNOFF_R Rural total runoff mm/s F + 911 QRUNOFF_TO_COUPLER total liquid runoff sent to coupler (includes corrections for land use change) mm/s T + 912 QRUNOFF_U Urban total runoff mm/s F + 913 QSNOCPLIQ excess liquid h2o due to snow capping not including correction for land use change mm H2O/s T + 914 QSNOEVAP evaporation from snow (only when snl<0, otherwise it is equal to qflx_ev_soil) mm/s T + 915 QSNOFRZ column-integrated snow freezing rate kg/m2/s T + 916 QSNOFRZ_ICE column-integrated snow freezing rate (ice landunits only) mm/s T + 917 QSNOMELT snow melt rate mm/s T + 918 QSNOMELT_ICE snow melt (ice landunits only) mm/s T + 919 QSNOUNLOAD canopy snow unloading mm/s T + 920 QSNO_TEMPUNLOAD canopy snow temp unloading mm/s T + 921 QSNO_WINDUNLOAD canopy snow wind unloading mm/s T + 922 QSNWCPICE excess solid h2o due to snow capping not including correction for land use change mm H2O/s T + 923 QSOIL Ground evaporation (soil/snow evaporation + soil/snow sublimation - dew) mm/s T + 924 QSOIL_ICE Ground evaporation (ice landunits only) mm/s T + 925 QTOPSOIL water input to surface mm/s F + 926 QVEGE canopy evaporation mm/s T + 927 QVEGT canopy transpiration mm/s T + 928 Qair atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg F + 929 Qh sensible heat W/m^2 F + 930 Qle total evaporation W/m^2 F + 931 Qstor storage heat flux (includes snowmelt) W/m^2 F + 932 Qtau momentum flux kg/m/s^2 F + 933 RAH1 aerodynamical resistance s/m F + 934 RAH2 aerodynamical resistance s/m F + 935 RAIN atmospheric rain, after rain/snow repartitioning based on temperature mm/s T + 936 RAIN_FROM_ATM atmospheric rain received from atmosphere (pre-repartitioning) mm/s T + 937 RAIN_ICE atmospheric rain, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F + 938 RAM1 aerodynamical resistance s/m F + 939 RAM_LAKE aerodynamic resistance for momentum (lakes only) s/m F + 940 RAW1 aerodynamical resistance s/m F + 941 RAW2 aerodynamical resistance s/m F + 942 RB leaf boundary resistance s/m F + 943 RB10 10 day running mean boundary layer resistance s/m F + 944 RETRANSN plant pool of retranslocated N gN/m^2 T + 945 RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T + 946 RH atmospheric relative humidity % F + 947 RH2M 2m relative humidity % T + 948 RH2M_R Rural 2m specific humidity % F + 949 RH2M_U Urban 2m relative humidity % F + 950 RH30 30-day running mean of relative humidity % F + 951 RHAF fractional humidity of canopy air fraction F + 952 RHAF10 10 day running mean of fractional humidity of canopy air fraction F + 953 RH_LEAF fractional humidity at leaf surface fraction F + 954 ROOTR effective fraction of roots in each soil layer (SMS method) proportion F + 955 RR root respiration (fine root MR + total root GR) gC/m^2/s T + 956 RRESIS root resistance in each soil layer proportion F + 957 RSSHA shaded leaf stomatal resistance s/m T + 958 RSSUN sunlit leaf stomatal resistance s/m T + 959 Rainf atmospheric rain, after rain/snow repartitioning based on temperature mm/s F + 960 Rnet net radiation W/m^2 F + 961 SABG solar rad absorbed by ground W/m^2 T + 962 SABG_PEN Rural solar rad penetrating top soil or snow layer watt/m^2 T + 963 SABV solar rad absorbed by veg W/m^2 T + 964 SEEDC pool for seeding new PFTs via dynamic landcover gC/m^2 T + 965 SEEDN pool for seeding new PFTs via dynamic landcover gN/m^2 T + 966 SLASH_HARVESTC slash harvest carbon (to litter) gC/m^2/s T + 967 SLO_SOMC SLO_SOM C gC/m^2 T + 968 SLO_SOMC_1m SLO_SOM C to 1 meter gC/m^2 F + 969 SLO_SOMC_TNDNCY_VERT_TRA slow soil organic ma C tendency due to vertical transport gC/m^3/s F + 970 SLO_SOMC_TO_ACT_SOMC decomp. of slow soil organic ma C to active soil organic C gC/m^2/s F + 971 SLO_SOMC_TO_ACT_SOMC_vr decomp. of slow soil organic ma C to active soil organic C gC/m^3/s F + 972 SLO_SOMC_TO_PAS_SOMC decomp. of slow soil organic ma C to passive soil organic C gC/m^2/s F + 973 SLO_SOMC_TO_PAS_SOMC_vr decomp. of slow soil organic ma C to passive soil organic C gC/m^3/s F + 974 SLO_SOMC_vr SLO_SOM C (vertically resolved) gC/m^3 T + 975 SLO_SOMN SLO_SOM N gN/m^2 T + 976 SLO_SOMN_1m SLO_SOM N to 1 meter gN/m^2 F + 977 SLO_SOMN_TNDNCY_VERT_TRA slow soil organic ma N tendency due to vertical transport gN/m^3/s F + 978 SLO_SOMN_TO_ACT_SOMN decomp. of slow soil organic ma N to active soil organic N gN/m^2 F + 979 SLO_SOMN_TO_ACT_SOMN_vr decomp. of slow soil organic ma N to active soil organic N gN/m^3 F + 980 SLO_SOMN_TO_PAS_SOMN decomp. of slow soil organic ma N to passive soil organic N gN/m^2 F + 981 SLO_SOMN_TO_PAS_SOMN_vr decomp. of slow soil organic ma N to passive soil organic N gN/m^3 F + 982 SLO_SOMN_vr SLO_SOM N (vertically resolved) gN/m^3 T + 983 SLO_SOM_HR_S1 Het. Resp. from slow soil organic ma gC/m^2/s F + 984 SLO_SOM_HR_S1_vr Het. Resp. from slow soil organic ma gC/m^3/s F + 985 SLO_SOM_HR_S3 Het. Resp. from slow soil organic ma gC/m^2/s F + 986 SLO_SOM_HR_S3_vr Het. Resp. from slow soil organic ma gC/m^3/s F + 987 SMINN soil mineral N gN/m^2 T + 988 SMINN_TO_NPOOL deployment of soil mineral N uptake gN/m^2/s T + 989 SMINN_TO_PLANT plant uptake of soil mineral N gN/m^2/s T + 990 SMINN_TO_PLANT_FUN Total soil N uptake of FUN gN/m^2/s T + 991 SMINN_TO_PLANT_vr plant uptake of soil mineral N gN/m^3/s F + 992 SMINN_TO_S1N_L1 mineral N flux for decomp. of MET_LITto ACT_SOM gN/m^2 F + 993 SMINN_TO_S1N_L1_vr mineral N flux for decomp. of MET_LITto ACT_SOM gN/m^3 F + 994 SMINN_TO_S1N_L2 mineral N flux for decomp. of CEL_LITto ACT_SOM gN/m^2 F + 995 SMINN_TO_S1N_L2_vr mineral N flux for decomp. of CEL_LITto ACT_SOM gN/m^3 F + 996 SMINN_TO_S1N_S2 mineral N flux for decomp. of SLO_SOMto ACT_SOM gN/m^2 F + 997 SMINN_TO_S1N_S2_vr mineral N flux for decomp. of SLO_SOMto ACT_SOM gN/m^3 F + 998 SMINN_TO_S1N_S3 mineral N flux for decomp. of PAS_SOMto ACT_SOM gN/m^2 F + 999 SMINN_TO_S1N_S3_vr mineral N flux for decomp. of PAS_SOMto ACT_SOM gN/m^3 F +1000 SMINN_TO_S2N_L3 mineral N flux for decomp. of LIG_LITto SLO_SOM gN/m^2 F +1001 SMINN_TO_S2N_L3_vr mineral N flux for decomp. of LIG_LITto SLO_SOM gN/m^3 F +1002 SMINN_TO_S2N_S1 mineral N flux for decomp. of ACT_SOMto SLO_SOM gN/m^2 F +1003 SMINN_TO_S2N_S1_vr mineral N flux for decomp. of ACT_SOMto SLO_SOM gN/m^3 F +1004 SMINN_TO_S3N_S1 mineral N flux for decomp. of ACT_SOMto PAS_SOM gN/m^2 F +1005 SMINN_TO_S3N_S1_vr mineral N flux for decomp. of ACT_SOMto PAS_SOM gN/m^3 F +1006 SMINN_TO_S3N_S2 mineral N flux for decomp. of SLO_SOMto PAS_SOM gN/m^2 F +1007 SMINN_TO_S3N_S2_vr mineral N flux for decomp. of SLO_SOMto PAS_SOM gN/m^3 F +1008 SMINN_vr soil mineral N gN/m^3 T +1009 SMIN_NH4 soil mineral NH4 gN/m^2 T +1010 SMIN_NH4_TO_PLANT plant uptake of NH4 gN/m^3/s F +1011 SMIN_NH4_vr soil mineral NH4 (vert. res.) gN/m^3 T +1012 SMIN_NO3 soil mineral NO3 gN/m^2 T +1013 SMIN_NO3_LEACHED soil NO3 pool loss to leaching gN/m^2/s T +1014 SMIN_NO3_LEACHED_vr soil NO3 pool loss to leaching gN/m^3/s F +1015 SMIN_NO3_MASSDENS SMIN_NO3_MASSDENS ugN/cm^3 soil F +1016 SMIN_NO3_RUNOFF soil NO3 pool loss to runoff gN/m^2/s T +1017 SMIN_NO3_RUNOFF_vr soil NO3 pool loss to runoff gN/m^3/s F +1018 SMIN_NO3_TO_PLANT plant uptake of NO3 gN/m^3/s F +1019 SMIN_NO3_vr soil mineral NO3 (vert. res.) gN/m^3 T +1020 SMP soil matric potential (natural vegetated and crop landunits only) mm T +1021 SNOBCMCL mass of BC in snow column kg/m2 T +1022 SNOBCMSL mass of BC in top snow layer kg/m2 T +1023 SNOCAN intercepted snow mm T +1024 SNODSTMCL mass of dust in snow column kg/m2 T +1025 SNODSTMSL mass of dust in top snow layer kg/m2 T +1026 SNOFSDSND direct nir incident solar radiation on snow W/m^2 F +1027 SNOFSDSNI diffuse nir incident solar radiation on snow W/m^2 F +1028 SNOFSDSVD direct vis incident solar radiation on snow W/m^2 F +1029 SNOFSDSVI diffuse vis incident solar radiation on snow W/m^2 F +1030 SNOFSRND direct nir reflected solar radiation from snow W/m^2 T +1031 SNOFSRNI diffuse nir reflected solar radiation from snow W/m^2 T +1032 SNOFSRVD direct vis reflected solar radiation from snow W/m^2 T +1033 SNOFSRVI diffuse vis reflected solar radiation from snow W/m^2 T +1034 SNOINTABS Fraction of incoming solar absorbed by lower snow layers - T +1035 SNOLIQFL top snow layer liquid water fraction (land) fraction F +1036 SNOOCMCL mass of OC in snow column kg/m2 T +1037 SNOOCMSL mass of OC in top snow layer kg/m2 T +1038 SNORDSL top snow layer effective grain radius m^-6 F +1039 SNOTTOPL snow temperature (top layer) K F +1040 SNOTTOPL_ICE snow temperature (top layer, ice landunits only) K F +1041 SNOTXMASS snow temperature times layer mass, layer sum; to get mass-weighted temperature, divide by (SNO K kg/m2 T +1042 SNOTXMASS_ICE snow temperature times layer mass, layer sum (ice landunits only); to get mass-weighted temper K kg/m2 F +1043 SNOW atmospheric snow, after rain/snow repartitioning based on temperature mm/s T +1044 SNOWDP gridcell mean snow height m T +1045 SNOWICE snow ice kg/m2 T +1046 SNOWICE_ICE snow ice (ice landunits only) kg/m2 F +1047 SNOWLIQ snow liquid water kg/m2 T +1048 SNOWLIQ_ICE snow liquid water (ice landunits only) kg/m2 F +1049 SNOW_5D 5day snow avg m F +1050 SNOW_DEPTH snow height of snow covered area m T +1051 SNOW_DEPTH_ICE snow height of snow covered area (ice landunits only) m F +1052 SNOW_FROM_ATM atmospheric snow received from atmosphere (pre-repartitioning) mm/s T +1053 SNOW_ICE atmospheric snow, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F +1054 SNOW_PERSISTENCE Length of time of continuous snow cover (nat. veg. landunits only) seconds T +1055 SNOW_SINKS snow sinks (liquid water) mm/s T +1056 SNOW_SOURCES snow sources (liquid water) mm/s T +1057 SNO_ABS Absorbed solar radiation in each snow layer W/m^2 F +1058 SNO_ABS_ICE Absorbed solar radiation in each snow layer (ice landunits only) W/m^2 F +1059 SNO_BW Partial density of water in the snow pack (ice + liquid) kg/m3 F +1060 SNO_BW_ICE Partial density of water in the snow pack (ice + liquid, ice landunits only) kg/m3 F +1061 SNO_EXISTENCE Fraction of averaging period for which each snow layer existed unitless F +1062 SNO_FRZ snow freezing rate in each snow layer kg/m2/s F +1063 SNO_FRZ_ICE snow freezing rate in each snow layer (ice landunits only) mm/s F +1064 SNO_GS Mean snow grain size Microns F +1065 SNO_GS_ICE Mean snow grain size (ice landunits only) Microns F +1066 SNO_ICE Snow ice content kg/m2 F +1067 SNO_LIQH2O Snow liquid water content kg/m2 F +1068 SNO_MELT snow melt rate in each snow layer mm/s F +1069 SNO_MELT_ICE snow melt rate in each snow layer (ice landunits only) mm/s F +1070 SNO_T Snow temperatures K F +1071 SNO_TK Thermal conductivity W/m-K F +1072 SNO_TK_ICE Thermal conductivity (ice landunits only) W/m-K F +1073 SNO_T_ICE Snow temperatures (ice landunits only) K F +1074 SNO_Z Snow layer thicknesses m F +1075 SNO_Z_ICE Snow layer thicknesses (ice landunits only) m F +1076 SNOdTdzL top snow layer temperature gradient (land) K/m F +1077 SOIL10 10-day running mean of 12cm layer soil K F +1078 SOILC_CHANGE C change in soil gC/m^2/s T +1079 SOILC_HR soil C heterotrophic respiration gC/m^2/s T +1080 SOILC_vr SOIL C (vertically resolved) gC/m^3 T +1081 SOILICE soil ice (natural vegetated and crop landunits only) kg/m2 T +1082 SOILLIQ soil liquid water (natural vegetated and crop landunits only) kg/m2 T +1083 SOILN_vr SOIL N (vertically resolved) gN/m^3 T +1084 SOILPSI soil water potential in each soil layer MPa F +1085 SOILRESIS soil resistance to evaporation s/m T +1086 SOILWATER_10CM soil liquid water + ice in top 10cm of soil (veg landunits only) kg/m2 T +1087 SOMC_FIRE C loss due to peat burning gC/m^2/s T +1088 SOMFIRE soil organic matter fire losses gC/m^2/s F +1089 SOM_ADV_COEF advection term for vertical SOM translocation m/s F +1090 SOM_C_LEACHED total flux of C from SOM pools due to leaching gC/m^2/s T +1091 SOM_DIFFUS_COEF diffusion coefficient for vertical SOM translocation m^2/s F +1092 SOM_N_LEACHED total flux of N from SOM pools due to leaching gN/m^2/s F +1093 SR total soil respiration (HR + root resp) gC/m^2/s T +1094 SSRE_FSR surface snow effect on reflected solar radiation W/m^2 T +1095 SSRE_FSRND surface snow effect on direct nir reflected solar radiation W/m^2 T +1096 SSRE_FSRNDLN surface snow effect on direct nir reflected solar radiation at local noon W/m^2 T +1097 SSRE_FSRNI surface snow effect on diffuse nir reflected solar radiation W/m^2 T +1098 SSRE_FSRVD surface snow radiatve effect on direct vis reflected solar radiation W/m^2 T +1099 SSRE_FSRVDLN surface snow radiatve effect on direct vis reflected solar radiation at local noon W/m^2 T +1100 SSRE_FSRVI surface snow radiatve effect on diffuse vis reflected solar radiation W/m^2 T +1101 STEM_PROF profile for litter C and N inputs from stems 1/m F +1102 STORAGE_CDEMAND C use from the C storage pool gC/m^2 F +1103 STORAGE_GR growth resp for growth sent to storage for later display gC/m^2/s F +1104 STORAGE_NDEMAND N demand during the offset period gN/m^2 F +1105 STORVEGC stored vegetation carbon, excluding cpool gC/m^2 T +1106 STORVEGN stored vegetation nitrogen gN/m^2 T +1107 SUPPLEMENT_TO_SMINN supplemental N supply gN/m^2/s T +1108 SUPPLEMENT_TO_SMINN_vr supplemental N supply gN/m^3/s F +1109 SWBGT 2 m Simplified Wetbulb Globe Temp C T +1110 SWBGT_R Rural 2 m Simplified Wetbulb Globe Temp C T +1111 SWBGT_U Urban 2 m Simplified Wetbulb Globe Temp C T +1112 SWMP65 2 m Swamp Cooler Temp 65% Eff C T +1113 SWMP65_R Rural 2 m Swamp Cooler Temp 65% Eff C T +1114 SWMP65_U Urban 2 m Swamp Cooler Temp 65% Eff C T +1115 SWMP80 2 m Swamp Cooler Temp 80% Eff C T +1116 SWMP80_R Rural 2 m Swamp Cooler Temp 80% Eff C T +1117 SWMP80_U Urban 2 m Swamp Cooler Temp 80% Eff C T +1118 SWdown atmospheric incident solar radiation W/m^2 F +1119 SWup upwelling shortwave radiation W/m^2 F +1120 SoilAlpha factor limiting ground evap unitless F +1121 SoilAlpha_U urban factor limiting ground evap unitless F +1122 T10 10-day running mean of 2-m temperature K F +1123 TAF canopy air temperature K F +1124 TAUX zonal surface stress kg/m/s^2 T +1125 TAUY meridional surface stress kg/m/s^2 T +1126 TBOT atmospheric air temperature (downscaled to columns in glacier regions) K T +1127 TBUILD internal urban building air temperature K T +1128 TBUILD_MAX prescribed maximum interior building temperature K F +1129 TEMPAVG_T2M temporary average 2m air temperature K F +1130 TEMPMAX_RETRANSN temporary annual max of retranslocated N pool gN/m^2 F +1131 TEMPSUM_POTENTIAL_GPP temporary annual sum of potential GPP gC/m^2/yr F +1132 TEQ 2 m Equiv Temp K T +1133 TEQ_R Rural 2 m Equiv Temp K T +1134 TEQ_U Urban 2 m Equiv Temp K T +1135 TFLOOR floor temperature K F +1136 TG ground temperature K T +1137 TG_ICE ground temperature (ice landunits only) K F +1138 TG_R Rural ground temperature K F +1139 TG_U Urban ground temperature K F +1140 TH2OSFC surface water temperature K T +1141 THBOT atmospheric air potential temperature (downscaled to columns in glacier regions) K T +1142 THIC 2 m Temp Hum Index Comfort C T +1143 THIC_R Rural 2 m Temp Hum Index Comfort C T +1144 THIC_U Urban 2 m Temp Hum Index Comfort C T +1145 THIP 2 m Temp Hum Index Physiology C T +1146 THIP_R Rural 2 m Temp Hum Index Physiology C T +1147 THIP_U Urban 2 m Temp Hum Index Physiology C T +1148 TKE1 top lake level eddy thermal conductivity W/(mK) T +1149 TLAI total projected leaf area index m^2/m^2 T +1150 TLAKE lake temperature K T +1151 TOPO_COL column-level topographic height m F +1152 TOPO_COL_ICE column-level topographic height (ice landunits only) m F +1153 TOPO_FORC topograephic height sent to GLC m F +1154 TOPT topt coefficient for VOC calc non F +1155 TOTCOLC total column carbon, incl veg and cpool but excl product pools gC/m^2 T +1156 TOTCOLCH4 total belowground CH4 (0 for non-lake special landunits in the absence of dynamic landunits) gC/m2 T +1157 TOTCOLN total column-level N, excluding product pools gN/m^2 T +1158 TOTECOSYSC total ecosystem carbon, incl veg but excl cpool and product pools gC/m^2 T +1159 TOTECOSYSN total ecosystem N, excluding product pools gN/m^2 T +1160 TOTFIRE total ecosystem fire losses gC/m^2/s F +1161 TOTLITC total litter carbon gC/m^2 T +1162 TOTLITC_1m total litter carbon to 1 meter depth gC/m^2 T +1163 TOTLITN total litter N gN/m^2 T +1164 TOTLITN_1m total litter N to 1 meter gN/m^2 T +1165 TOTPFTC total patch-level carbon, including cpool gC/m^2 T +1166 TOTPFTN total patch-level nitrogen gN/m^2 T +1167 TOTSOILICE vertically summed soil cie (veg landunits only) kg/m2 T +1168 TOTSOILLIQ vertically summed soil liquid water (veg landunits only) kg/m2 T +1169 TOTSOMC total soil organic matter carbon gC/m^2 T +1170 TOTSOMC_1m total soil organic matter carbon to 1 meter depth gC/m^2 T +1171 TOTSOMN total soil organic matter N gN/m^2 T +1172 TOTSOMN_1m total soil organic matter N to 1 meter gN/m^2 T +1173 TOTVEGC total vegetation carbon, excluding cpool gC/m^2 T +1174 TOTVEGN total vegetation nitrogen gN/m^2 T +1175 TOT_WOODPRODC total wood product C gC/m^2 T +1176 TOT_WOODPRODC_LOSS total loss from wood product pools gC/m^2/s T +1177 TOT_WOODPRODN total wood product N gN/m^2 T +1178 TOT_WOODPRODN_LOSS total loss from wood product pools gN/m^2/s T +1179 TPU25T canopy profile of tpu umol/m2/s T +1180 TRAFFICFLUX sensible heat flux from urban traffic W/m^2 F +1181 TRANSFER_DEADCROOT_GR dead coarse root growth respiration from storage gC/m^2/s F +1182 TRANSFER_DEADSTEM_GR dead stem growth respiration from storage gC/m^2/s F +1183 TRANSFER_FROOT_GR fine root growth respiration from storage gC/m^2/s F +1184 TRANSFER_GR growth resp for transfer growth displayed in this timestep gC/m^2/s F +1185 TRANSFER_LEAF_GR leaf growth respiration from storage gC/m^2/s F +1186 TRANSFER_LIVECROOT_GR live coarse root growth respiration from storage gC/m^2/s F +1187 TRANSFER_LIVESTEM_GR live stem growth respiration from storage gC/m^2/s F +1188 TREFMNAV daily minimum of average 2-m temperature K T +1189 TREFMNAV_R Rural daily minimum of average 2-m temperature K F +1190 TREFMNAV_U Urban daily minimum of average 2-m temperature K F +1191 TREFMXAV daily maximum of average 2-m temperature K T +1192 TREFMXAV_R Rural daily maximum of average 2-m temperature K F +1193 TREFMXAV_U Urban daily maximum of average 2-m temperature K F +1194 TROOF_INNER roof inside surface temperature K F +1195 TSA 2m air temperature K T +1196 TSAI total projected stem area index m^2/m^2 T +1197 TSA_ICE 2m air temperature (ice landunits only) K F +1198 TSA_R Rural 2m air temperature K F +1199 TSA_U Urban 2m air temperature K F +1200 TSHDW_INNER shadewall inside surface temperature K F +1201 TSKIN skin temperature K T +1202 TSL temperature of near-surface soil layer (natural vegetated and crop landunits only) K T +1203 TSOI soil temperature (natural vegetated and crop landunits only) K T +1204 TSOI_10CM soil temperature in top 10cm of soil K T +1205 TSOI_ICE soil temperature (ice landunits only) K T +1206 TSRF_FORC surface temperature sent to GLC K F +1207 TSUNW_INNER sunwall inside surface temperature K F +1208 TV vegetation temperature K T +1209 TV24 vegetation temperature (last 24hrs) K F +1210 TV240 vegetation temperature (last 240hrs) K F +1211 TVEGD10 10 day running mean of patch daytime vegetation temperature Kelvin F +1212 TVEGN10 10 day running mean of patch night-time vegetation temperature Kelvin F +1213 TWS total water storage mm T +1214 T_SCALAR temperature inhibition of decomposition unitless T +1215 Tair atmospheric air temperature (downscaled to columns in glacier regions) K F +1216 Tair_from_atm atmospheric air temperature received from atmosphere (pre-downscaling) K F +1217 U10 10-m wind m/s T +1218 U10_DUST 10-m wind for dust model m/s T +1219 U10_ICE 10-m wind (ice landunits only) m/s F +1220 UAF canopy air speed m/s F +1221 ULRAD upward longwave radiation above the canopy W/m^2 F +1222 UM wind speed plus stability effect m/s F +1223 URBAN_AC urban air conditioning flux W/m^2 T +1224 URBAN_HEAT urban heating flux W/m^2 T +1225 USTAR aerodynamical resistance s/m F +1226 UST_LAKE friction velocity (lakes only) m/s F +1227 VA atmospheric wind speed plus convective velocity m/s F +1228 VCMX25T canopy profile of vcmax25 umol/m2/s T +1229 VEGWP vegetation water matric potential for sun/sha canopy,xyl,root segments mm T +1230 VEGWPLN vegetation water matric potential for sun/sha canopy,xyl,root at local noon mm T +1231 VEGWPPD predawn vegetation water matric potential for sun/sha canopy,xyl,root mm T +1232 VOCFLXT total VOC flux into atmosphere moles/m2/sec F +1233 VOLR river channel total water storage m3 T +1234 VOLRMCH river channel main channel water storage m3 T +1235 VPD vpd Pa F +1236 VPD2M 2m vapor pressure deficit Pa T +1237 VPD_CAN canopy vapor pressure deficit kPa T +1238 Vcmx25Z canopy profile of vcmax25 predicted by LUNA model umol/m2/s T +1239 WASTEHEAT sensible heat flux from heating/cooling sources of urban waste heat W/m^2 T +1240 WBA 2 m Wet Bulb C T +1241 WBA_R Rural 2 m Wet Bulb C T +1242 WBA_U Urban 2 m Wet Bulb C T +1243 WBT 2 m Stull Wet Bulb C T +1244 WBT_R Rural 2 m Stull Wet Bulb C T +1245 WBT_U Urban 2 m Stull Wet Bulb C T +1246 WF soil water as frac. of whc for top 0.05 m proportion F +1247 WFPS WFPS percent F +1248 WIND atmospheric wind velocity magnitude m/s T +1249 WOODC wood C gC/m^2 T +1250 WOODC_ALLOC wood C eallocation gC/m^2/s T +1251 WOODC_LOSS wood C loss gC/m^2/s T +1252 WOOD_HARVESTC wood harvest carbon (to product pools) gC/m^2/s T +1253 WOOD_HARVESTN wood harvest N (to product pools) gN/m^2/s T +1254 WTGQ surface tracer conductance m/s T +1255 W_SCALAR Moisture (dryness) inhibition of decomposition unitless T +1256 Wind atmospheric wind velocity magnitude m/s F +1257 XSMRPOOL temporary photosynthate C pool gC/m^2 T +1258 XSMRPOOL_LOSS temporary photosynthate C pool loss gC/m^2 F +1259 XSMRPOOL_RECOVER C flux assigned to recovery of negative xsmrpool gC/m^2/s T +1260 Z0HG roughness length over ground, sensible heat m F +1261 Z0HV roughness length over vegetation, sensible heat m F +1262 Z0M momentum roughness length m F +1263 Z0MG roughness length over ground, momentum m F +1264 Z0MV roughness length over vegetation, momentum m F +1265 Z0M_TO_COUPLER roughness length, momentum: gridcell average sent to coupler m F +1266 Z0QG roughness length over ground, latent heat m F +1267 Z0QV roughness length over vegetation, latent heat m F +1268 ZBOT atmospheric reference height m T +1269 ZETA dimensionless stability parameter unitless F +1270 ZII convective boundary height m F +1271 ZWT water table depth (natural vegetated and crop landunits only) m T +1272 ZWT_CH4_UNSAT depth of water table for methane production used in non-inundated area m T +1273 ZWT_PERCH perched water table depth (natural vegetated and crop landunits only) m T +1274 anaerobic_frac anaerobic_frac m3/m3 F +1275 bsw clap and hornberger B unitless F +1276 currentPatch currentPatch coefficient for VOC calc non F +1277 diffus diffusivity m^2/s F +1278 fr_WFPS fr_WFPS fraction F +1279 n2_n2o_ratio_denit n2_n2o_ratio_denit gN/gN F +1280 num_iter number of iterations unitless F +1281 r_psi r_psi m F +1282 ratio_k1 ratio_k1 none F +1283 ratio_no3_co2 ratio_no3_co2 ratio F +1284 soil_bulkdensity soil_bulkdensity kg/m3 F +1285 soil_co2_prod soil_co2_prod ug C / g soil / day F +1286 watfc water field capacity m^3/m^3 F +1287 watsat water saturated m^3/m^3 F ==== =================================== ============================================================================================== ================================================================= ======= diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index cdc8f8dc62..2228caa740 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -2,9 +2,9 @@ .. include:: ../substitutions.rst -********************* -Trouble Shooting -********************* +*************** +Troubleshooting +*************** In this chapter we give some guidance on what to do when you encounter some of the most common problems. @@ -25,55 +25,90 @@ The model has been run for thousands and thousands of simulation years in many d It is important to examine all of the component log files in the run directory for errors. An error in the land model may not appear in the lnd log file, it may show up in the cesm log. In a land-only simulation, errors associated with the data atmosphere model may show up in the atm log or the cesm log, or both. The two logs together may contain useful information about the error. Frequently, the error output in the log files will include a **traceback** of code where the error occurred. Identifying the specific line of code where the error occurred is the first step in diagnosing the error and developing a solution. If a traceback doesn't appear in the log files, then try running in debug mode as noted in the CIME troubleshooting guide. An example of a traceback in the cesm log is given below :: -> 398: ERROR: Carbon or Nitrogen patch negative = -60.0630620423182 -> 398: -1.49270707132601 -> 398: ERROR: limits = -60.0000000000000 -6.00000000000000 -> 398: ENDRUN: -> 398: ERROR: -> 398: ERROR: carbon or nitrogen state critically negative ERROR in CNPrecisionControl -> 398: Mod.F90 at line 209 -> 398:Image PC Routine Line Source -> 398:cesm.exe 000000000383B3EA Unknown Unknown Unknown -> 398:cesm.exe 0000000002F1E5D0 shr_abort_mod_mp_ 114 shr_abort_mod.F90 -> 398:cesm.exe 0000000001AF22BF abortutils_mp_end 50 abortutils.F90 -> 398:cesm.exe 0000000001D02677 cnprecisioncontro 693 CNPrecisionControlMod.F90 -> 398:cesm.exe 0000000001CFCC58 cnprecisioncontro 207 CNPrecisionControlMod.F90 -> 398:cesm.exe 00000000021FB4F5 cndrivermod_mp_cn 575 CNDriverMod.F90 -> 398:cesm.exe 0000000001D0F5C7 cnvegetationfacad 866 CNVegetationFacade.F90 -> 398:cesm.exe 0000000001AFEC96 clm_driver_mp_clm 925 clm_driver.F90 -> 398:cesm.exe 0000000001AE744B lnd_comp_mct_mp_l 458 lnd_comp_mct.F90 -> 398:cesm.exe 0000000000429414 component_mod_mp_ 737 component_mod.F90 -> 398:cesm.exe 000000000040AE4B cime_comp_mod_mp_ 2622 cime_comp_mod.F90 -> 398:cesm.exe 000000000042904C MAIN__ 133 cime_driver.F90 -> 398:cesm.exe 0000000000408D22 Unknown Unknown Unknown -> 398:libc.so.6 00002B8B95D306E5 __libc_start_main Unknown Unknown -> 398:cesm.exe 0000000000408C29 Unknown Unknown Unknown - -Here, the output is identifying the sequence of fortran statements involved in the error, starting with line 133 in cime_driver.F90 and ending with line 114 in shr_abort_mod.F90. In this case the run is triggering an error check in the model related to negative carbon/nitrogen at line 693 of CNPrecisionControlMod.F90. In addition, there is additional information related to the error indicating the carbon or nitrogen state is critically negative at line 209 in CNPrecisionControlMod.F90, which is + 398: ERROR: Carbon or Nitrogen patch negative = -60.0630620423182 + 398: -1.49270707132601 + 398: ERROR: limits = -60.0000000000000 -6.00000000000000 + 398: iam = 362: local patch index = 482 + 398: iam = 362: global patch index = 163723 + 398: iam = 362: global column index = 104283 + 398: iam = 362: global landunit index = 32348 + 398: iam = 362: global gridcell index = 13723 + 398: iam = 362: gridcell longitude = 120.0000000 + 398: iam = 362: gridcell latitude = -70.0000000 + 398: iam = 362: pft type = 10 + 398: iam = 362: column type = 1 + 398: iam = 362: landunit type = 1 + 398: ENDRUN: + 398: ERROR: + 398: ERROR: carbon or nitrogen state critically negative ERROR in CNPrecisionControl + 398: Mod.F90 at line 209 + 398:Image PC Routine Line Source + 398:cesm.exe 000000000383B3EA Unknown Unknown Unknown + 398:cesm.exe 0000000002F1E5D0 shr_abort_mod_mp_ 114 shr_abort_mod.F90 + 398:cesm.exe 0000000001AF22BF abortutils_mp_end 50 abortutils.F90 + 398:cesm.exe 0000000001D02677 cnprecisioncontro 693 CNPrecisionControlMod.F90 + 398:cesm.exe 0000000001CFCC58 cnprecisioncontro 207 CNPrecisionControlMod.F90 + 398:cesm.exe 00000000021FB4F5 cndrivermod_mp_cn 575 CNDriverMod.F90 + 398:cesm.exe 0000000001D0F5C7 cnvegetationfacad 866 CNVegetationFacade.F90 + 398:cesm.exe 0000000001AFEC96 clm_driver_mp_clm 925 clm_driver.F90 + 398:cesm.exe 0000000001AE744B lnd_comp_mct_mp_l 458 lnd_comp_mct.F90 + 398:cesm.exe 0000000000429414 component_mod_mp_ 737 component_mod.F90 + 398:cesm.exe 000000000040AE4B cime_comp_mod_mp_ 2622 cime_comp_mod.F90 + 398:cesm.exe 000000000042904C MAIN__ 133 cime_driver.F90 + 398:cesm.exe 0000000000408D22 Unknown Unknown Unknown + 398:libc.so.6 00002B8B95D306E5 __libc_start_main Unknown Unknown + 398:cesm.exe 0000000000408C29 Unknown Unknown Unknown + +Here, the output is identifying the sequence of Fortran statements involved in the error, starting with line 133 in cime_driver.F90 and ending with line 114 in shr_abort_mod.F90. In this case the run is triggering an error check in the model related to negative carbon/nitrogen at line 693 of CNPrecisionControlMod.F90. In addition, there is additional information related to the error indicating the carbon or nitrogen state is critically negative at line 209 in CNPrecisionControlMod.F90, which is :: -> call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%leafc_patch(bounds%begp:bounds%endp), & -> ns%leafn_patch(bounds%begp:bounds%endp), & -> pc(bounds%begp:), pn(bounds%begp:), __LINE__, & -> num_truncatep, filter_truncatep) + call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%leafc_patch(bounds%begp:bounds%endp), & + ns%leafn_patch(bounds%begp:bounds%endp), & + pc(bounds%begp:), pn(bounds%begp:), __LINE__, & + num_truncatep, filter_truncatep) So here we know that it is either leaf nitrogen (leafn) or leaf carbon (leafc) that has triggered the error. Furthermore, from the information above and looking at the code, we see that it is leaf carbon that is triggering the error, as the value is -60.0630620423182 and the limit is -60. -At this point it is useful as a next step to identify the particular pft index and perhaps the pft type that is triggering the error. This can be done by inserting the following code before the **endrun** that is called in CNPrecisionControlMod.F90 at line 693. -:: +At this point it is useful as a next step to identify the particular patch index and perhaps the pft type that is triggering the error. In this case, the endrun call is already written to provide this information: the patch index and pft type causing the error, along with some other information, are printed in the lines beginning with ``iam``. The ``iam`` value gives the CTSM processor number (this can be obtained in the code via the ``iam`` variable defined in ``spmdMod``). The local patch index is the value of ``p`` in the current patch loop; "local" implies that it refers to this processor's indexing. However, this same value of ``p`` may appear on other processors, since the local indexing on each processor starts with 1. So, to get the unique patch causing the problem, you either need to use the processor's ``iam`` index (there is only one patch with local index 482 on processor 362), or use the global indices printed below the local index. The "global" term here refers to the global index space across all processors (there is only one patch with a global index of 163723 across all processors). See below for how to use the ``get_global_index`` function to translate from local to global indices. -> if (abs(carbon_patch(p)) < ccrit) then -> write(iulog,*)'p: ',p -> write(iulog,*)'itype(p): ',patch%itype(p) -> end if +If you are writing your own ``endrun`` call, you can get this additional information by specifying the ``subgrid_index`` and ``subgrid_level`` arguments; for example:: -The pft index and the pft type will appear in either the cesm or lnd log file. In this case, the pft index is 163723 and the pft type is 10. From there, one can use this pft index to write out variables that are used in updating leafc, for example, leafc is updated a number of times in CNCStateUpdate1Mod.F90. -:: + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) + +(The ``subgrid_level_patch`` constant, and similar constants for the other subgrid levels, are defined in ``decompMod``, so can be accessed via ``use decompMod, only : subgrid_level_patch``.) + +You can get this same information without aborting the run via a call to ``write_point_context``, which is also defined in the ``abortutils`` module; e.g.:: + + if (abs(carbon_patch(p)) < ccrit) then + call write_point_context(subgrid_index=p, subgrid_level=subgrid_level_patch) + end if + +Or, if all you want is the global index of ``p`` for the sake of writing extra diagnostic prints like the example below, then you can use the ``get_global_index`` function defined in ``decompMod``, like:: + + if (abs(carbon_patch(p)) < ccrit) then + write(iulog,*) 'carbon patch significantly negative at local, global p = ', & + p, get_global_index(subgrid_index=p, subgrid_level=subgrid_level_patch) + end if + +In all of these cases, the output will appear in either the cesm or lnd log file. In the above example, we see that the local patch index is 482 on processor 362 and the global patch index is 163723. From there, one can use this patch index to write out variables that are used in updating leafc, for example, leafc is updated a number of times in CNCStateUpdate1Mod.F90. + +There are two equivalent methods to write a conditional statement to provide more output for the problem patch within a loop over all patches. The first method is to translate the local index to a global index:: + + use decompMod, only : get_global_index, subgrid_level_patch + ... + if (get_global_index(p, subgrid_level_patch) == 163723) then + write(iulog,*)'CNCStateUpdate1Mod leafc: ',cs_veg%leafc_patch(p) + write(iulog,*)'CNCStateUpdate1Mod +leafc_xfer_to_leafc: ',cf_veg%leafc_xfer_to_leafc_patch(p)*dt + end if + +The second method is to use the local index along with the processor number:: -> if (p .eq. 163723) then -> write(iulog,*)'CNCStateUpdate1Mod leafc: ',cs_veg%leafc_patch(p) -> write(iulog,*)'CNCStateUpdate1Mod +leafc_xfer_to_leafc: ',cf_veg%leafc_xfer_to_leafc_patch(p)*dt -> end if + use spmdMod, only : iam + ... + if (p == 482 .and. iam == 362) then + write(iulog,*)'CNCStateUpdate1Mod leafc: ',cs_veg%leafc_patch(p) + write(iulog,*)'CNCStateUpdate1Mod +leafc_xfer_to_leafc: ',cf_veg%leafc_xfer_to_leafc_patch(p)*dt + end if By placing these write statements in the code, one can get a sense of how leafc is evolving toward a negative state and why. This is a very complex example of troubleshooting. To make a long story short, as described `here `_, the error turned out to be caused by a few lines in the phenology code that weren't handling a 20 minute time step properly, thus an actual bug in the code. This was also a good example of where a much less computationally expensive land-only simulation was able to be used for debugging instead of the orginal expensive fully-coupled simulation. @@ -96,18 +131,18 @@ To use it The example function in **point_of_interest.F90** is **poi_c**. It finds columns with a given landunit type (in this case, the natural vegetated landunit). That function can be used in a column-level loop to find columns with that landunit within the grid cell of interest. Its typical use in CTSM code is :: - > do fc = 1, num_nolakec - > c = filter_nolakec(fc) - > ! Various code here, maybe setting foo and bar variables - > if (poi_c(c)) then - > write(iulog,*) 'DEBUG: foo, bar = ', foo(c), bar(c) - > end if - > end do + do fc = 1, num_nolakec + c = filter_nolakec(fc) + ! Various code here, maybe setting foo and bar variables + if (poi_c(c)) then + write(iulog,*) 'DEBUG: foo, bar = ', foo(c), bar(c) + end if + end do You will also need a **use** statement in the module from which you are calling poi_c :: -> use point_of_interest, only : poi_c + use point_of_interest, only : poi_c Here are some other suggestions on how to track down a problem encountered while running. These involve setting up and running simpler cases. In general if the problem still occurs for a simpler case, it will be easier to track down. However, we note that most errors are specific to the case being run. diff --git a/python/ctsm/lilac_make_runtime_inputs.py b/python/ctsm/lilac_make_runtime_inputs.py index ff292cb660..1e6f16fb4e 100644 --- a/python/ctsm/lilac_make_runtime_inputs.py +++ b/python/ctsm/lilac_make_runtime_inputs.py @@ -251,6 +251,7 @@ def buildnml(cime_path, rundir): '-clm_start_type', 'default', '-configuration', configuration, '-structure', structure, + '-lilac', '-lnd_frac', lnd_domain_file, '-glc_nec', str(10), '-co2_ppmv', co2_ppmv, diff --git a/python/ctsm/machine_defaults.py b/python/ctsm/machine_defaults.py index 637845d7eb..7a401c8647 100644 --- a/python/ctsm/machine_defaults.py +++ b/python/ctsm/machine_defaults.py @@ -73,8 +73,8 @@ baseline_dir=os.path.join(os.path.sep, 'fs', 'cgd', 'csm', 'ccsm_baselines'), account_required=False, # jobs on izumi experience a high frequency of failures, often at the very end of - # the job; so we'll automatically retry a failed job once before giving up on it - create_test_retry=1, + # the job; so we'll automatically retry a failed job twice before giving up on it + create_test_retry=2, job_launcher_defaults={ JOB_LAUNCHER_QSUB: QsubDefaults( queue='medium', diff --git a/python/ctsm/path_utils.py b/python/ctsm/path_utils.py index aaf79c2e66..7972fcd297 100644 --- a/python/ctsm/path_utils.py +++ b/python/ctsm/path_utils.py @@ -83,6 +83,9 @@ def add_cime_lib_to_path(standalone_only=False): cime_lib_path = os.path.join(cime_path, 'scripts', 'lib') prepend_to_python_path(cime_lib_path) + cime_lib_path = os.path.join(cime_path, + 'scripts', 'Tools') + prepend_to_python_path(cime_lib_path) return cime_path # ======================================================================== diff --git a/python/ctsm/run_sys_tests.py b/python/ctsm/run_sys_tests.py index f72d1863cf..f45aa81927 100644 --- a/python/ctsm/run_sys_tests.py +++ b/python/ctsm/run_sys_tests.py @@ -140,6 +140,10 @@ def run_sys_tests(machine, cime_path, testroot = _get_testroot(testroot_base, testid_base) if not (skip_testroot_creation or rerun_existing_failures): _make_testroot(testroot, testid_base, dry_run) + else: + if not os.path.exists(testroot): + raise RuntimeError("testroot directory does NOT exist as expected when a rerun" + + " option is used: directory expected = "+testroot ) print("Testroot: {}\n".format(testroot)) retry_final = get_possibly_overridden_mach_value(machine, varname='create_test_retry', diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 490aa3542a..395c2e4868 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,10 +16,10 @@ add_definitions(-DHIDE_MPI) # done first, so that in case of name collisions, the CLM versions take # precedence (when there are two files with the same name, the one added later # wins). -add_subdirectory(${CIMEROOT}/src/share/util csm_share) -add_subdirectory(${CIMEROOT}/src/share/unit_test_stubs/util csm_share_stubs) -add_subdirectory(${CIMEROOT}/src/share/esmf_wrf_timemgr esmf_wrf_timemgr) -add_subdirectory(${CIMEROOT}/src/drivers/mct/shr drv_share) +add_subdirectory(${CLM_ROOT}/share/src csm_share) +add_subdirectory(${CLM_ROOT}/share/unit_test_stubs/util csm_share_stubs) +add_subdirectory(${CLM_ROOT}/share/src/esmf_wrf_timemgr esmf_wrf_timemgr) +add_subdirectory(${CLM_ROOT}/components/cpl7/driver/shr drv_share) # Extract just the files we need from drv_share set (drv_sources_needed_base @@ -83,12 +83,11 @@ add_dependencies(esmf_wrf_timemgr csm_share) add_dependencies(clm csm_share esmf_wrf_timemgr) # We need to look for header files here, in order to pick up shr_assert.h -include_directories(${CIMEROOT}/src/share/include) +include_directories(${CLM_ROOT}/share/include) # And we need to look for header files here, for some include files needed by # the esmf_wrf_timemgr code -include_directories(${CIMEROOT}/src/share/esmf_wrf_timemgr) - +include_directories(${CLM_ROOT}/share/src/esmf_wrf_timemgr) # Tell cmake to look for libraries & mod files here, because this is where we built libraries include_directories(${CMAKE_CURRENT_BINARY_DIR}) link_directories(${CMAKE_CURRENT_BINARY_DIR}) @@ -106,4 +105,4 @@ add_subdirectory(${CLM_ROOT}/src/soilbiogeochem/test clm_soilbiogeochem_test) add_subdirectory(${CLM_ROOT}/src/dyn_subgrid/test clm_dyn_subgrid_test) add_subdirectory(${CLM_ROOT}/src/main/test clm_main_test) add_subdirectory(${CLM_ROOT}/src/init_interp/test clm_init_interp_test) -add_subdirectory(${CLM_ROOT}/src/self_tests/test clm_self_tests_test) \ No newline at end of file +add_subdirectory(${CLM_ROOT}/src/self_tests/test clm_self_tests_test) diff --git a/src/biogeochem/CMakeLists.txt b/src/biogeochem/CMakeLists.txt index 0a7ef162f4..b2de170099 100644 --- a/src/biogeochem/CMakeLists.txt +++ b/src/biogeochem/CMakeLists.txt @@ -3,7 +3,16 @@ list(APPEND clm_sources CNSharedParamsMod.F90 + CNPhenologyMod.F90 CNSpeciesMod.F90 + CNDVType.F90 + CropType.F90 + CNVegStateType.F90 + CNVegCarbonStateType.F90 + CNVegCarbonFluxType.F90 + CNVegNitrogenStateType.F90 + CNVegNitrogenFluxType.F90 + CNCIsoAtmTimeSeriesReadMod.F90 CNVegComputeSeedMod.F90 SpeciesBaseType.F90 SpeciesIsotopeType.F90 diff --git a/src/biogeochem/CNBalanceCheckMod.F90 b/src/biogeochem/CNBalanceCheckMod.F90 index 27fd2325ab..67e83713c3 100644 --- a/src/biogeochem/CNBalanceCheckMod.F90 +++ b/src/biogeochem/CNBalanceCheckMod.F90 @@ -8,7 +8,7 @@ module CNBalanceCheckMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_gridcell, subgrid_level_column use abortutils , only : endrun use clm_varctl , only : iulog, use_nitrif_denitrif use clm_time_manager , only : get_step_size_real @@ -306,7 +306,7 @@ subroutine CBalanceCheck(this, bounds, num_soilc, filter_soilc, & write(iulog,*)'wood_harvestc = ',wood_harvestc(c)*dt write(iulog,*)'grainc_to_cropprodc = ',grainc_to_cropprodc(c)*dt write(iulog,*)'-1*som_c_leached = ',som_c_leached(c)*dt - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end if ! Repeat error check at the gridcell level @@ -378,7 +378,7 @@ subroutine CBalanceCheck(this, bounds, num_soilc, filter_soilc, & write(iulog,*)'dwt_seedc_to_deadstem_grc =', dwt_seedc_to_deadstem_grc(g) * dt write(iulog,*)'--- Outputs ---' write(iulog,*)'-1*som_c_leached_grc = ', som_c_leached_grc(g) * dt - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end associate @@ -541,10 +541,7 @@ subroutine NBalanceCheck(this, bounds, num_soilc, filter_soilc, & write(iulog,*)'net flux = ',(col_ninputs(c)-col_noutputs(c))*dt write(iulog,*)'inputs,ffix,nfix,ndep = ',ffix_to_sminn(c)*dt,nfix_to_sminn(c)*dt,ndep_to_sminn(c)*dt write(iulog,*)'outputs,ffix,nfix,ndep = ',smin_no3_leached(c)*dt, smin_no3_runoff(c)*dt,f_n2o_nit(c)*dt - - - - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end if ! Repeat error check at the gridcell level @@ -618,7 +615,7 @@ subroutine NBalanceCheck(this, bounds, num_soilc, filter_soilc, & write(iulog,*) 'grc_noutputs_partial =', grc_noutputs_partial(g) * dt write(iulog,*) 'dwt_conv_nflux_grc =', dwt_conv_nflux_grc(g) * dt write(iulog,*) 'product_loss_grc =', product_loss_grc(g) * dt - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end associate diff --git a/src/biogeochem/CNDVEstablishmentMod.F90 b/src/biogeochem/CNDVEstablishmentMod.F90 index ffd213e3a3..461b01b869 100644 --- a/src/biogeochem/CNDVEstablishmentMod.F90 +++ b/src/biogeochem/CNDVEstablishmentMod.F90 @@ -7,7 +7,7 @@ module CNDVEstablishmentMod ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_gridcell use pftconMod , only : pftcon use atm2lndType , only : atm2lnd_type use CNDVType , only : dgvs_type, dgv_ecophyscon @@ -443,7 +443,7 @@ subroutine Establishment(bounds, & if (fn > 0) then g = filterg(1) write(iulog,*) 'Error in Establishment: fpc_total =',fpc_total(g), ' at gridcell ',g - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end associate diff --git a/src/biogeochem/CNDVType.F90 b/src/biogeochem/CNDVType.F90 index 065e972a15..19a0f64f7d 100644 --- a/src/biogeochem/CNDVType.F90 +++ b/src/biogeochem/CNDVType.F90 @@ -217,9 +217,8 @@ subroutine Restart(this, bounds, ncid, flag) use clm_varcon , only : spval use spmdMod , only : masterproc use decompMod , only : get_proc_global - use restUtilMod - use ncdio_pio - use pio + use restUtilMod, only : restartvar + use ncdio_pio , only : ncd_double, ncd_inqvdlen, ncd_int, file_desc_t ! ! !ARGUMENTS: class(dgvs_type) :: this diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index 84f9164b16..2f51846606 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -10,7 +10,8 @@ module CNDriverMod use dynSubgridControlMod , only : get_do_harvest use decompMod , only : bounds_type use perf_mod , only : t_startf, t_stopf - use clm_varctl , only : use_century_decomp, use_nitrif_denitrif, use_nguardrail + use clm_varctl , only : use_nitrif_denitrif, use_nguardrail + use SoilBiogeochemDecompCascadeConType, only : century_decomp, decomp_method use clm_varctl , only : use_crop use CNSharedParamsMod , only : use_fun use CNVegStateType , only : cnveg_state_type @@ -129,7 +130,6 @@ subroutine CNDriverNoLeaching(bounds, use CNSharedParamsMod , only: use_fun use dynHarvestMod , only: CNHarvest use SoilBiogeochemDecompCascadeBGCMod , only: decomp_rate_constants_bgc - use SoilBiogeochemDecompCascadeCNMod , only: decomp_rate_constants_cn use SoilBiogeochemCompetitionMod , only: SoilBiogeochemCompetition use SoilBiogeochemDecompMod , only: SoilBiogeochemDecomp use SoilBiogeochemLittVertTranspMod , only: SoilBiogeochemLittVertTransp @@ -311,12 +311,9 @@ subroutine CNDriverNoLeaching(bounds, !-------------------------------------------- call t_startf('SoilBiogeochem') - if (use_century_decomp) then + if (decomp_method == century_decomp) then call decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, & soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) - else - call decomp_rate_constants_cn(bounds, num_soilc, filter_soilc, & - soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) end if ! calculate potential decomp rates and total immobilization demand (previously inlined in CNDecompAlloc) diff --git a/src/biogeochem/CNFireLi2021Mod.F90 b/src/biogeochem/CNFireLi2021Mod.F90 index 973bbf46ed..aa61e291e9 100644 --- a/src/biogeochem/CNFireLi2021Mod.F90 +++ b/src/biogeochem/CNFireLi2021Mod.F90 @@ -596,7 +596,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) - arh30=1._r8-max(0.7_r8, min(1._r8,rh30_col(c)/90._r8)) + arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/90._r8)) if (forc_rh(g) < rh_hgh.and. wtlf(c) > 0._r8 .and. tsoi17(c)> SHR_CONST_TKFRZ)then fire_m = ((afuel*arh30+(1._r8-afuel)*arh)**1.5_r8) & *((1._r8-btran_col(c)/wtlf(c))**0.5_r8) @@ -606,8 +606,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8 fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf)) ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8* & - cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))*0.22_r8) & - *(1._r8-fs)*(1._r8-cropf_col(c)) + cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))* & + cnfire_params%ignition_efficiency)*(1._r8-fs)*(1._r8-cropf_col(c)) nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) !fire counts/km2/sec Lb_lf = 1._r8+10._r8*(1._r8-EXP(-0.06_r8*forc_wind(g))) spread_m = fire_m**0.5_r8 diff --git a/src/biogeochem/CNNDynamicsMod.F90 b/src/biogeochem/CNNDynamicsMod.F90 index 216f8c23ff..ac359e9cbc 100644 --- a/src/biogeochem/CNNDynamicsMod.F90 +++ b/src/biogeochem/CNNDynamicsMod.F90 @@ -9,7 +9,7 @@ module CNNDynamicsMod use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type use clm_varcon , only : dzsoi_decomp, zisoi - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, nfix_timeconst + use clm_varctl , only : use_nitrif_denitrif, nfix_timeconst use subgridAveMod , only : p2c use atm2lndType , only : atm2lnd_type use CNVegStateType , only : cnveg_state_type diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index b01294e45b..bd9a79b959 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -46,21 +46,48 @@ module CNPhenologyMod public :: CNPhenologyreadNML ! Read namelist public :: CNPhenologyInit ! Initialization public :: CNPhenology ! Update + + ! !PUBLIC for unit testing + public :: CNPhenologySetNML ! Set the namelist setttings explicitly for unit tests + public :: CNPhenologySetParams ! Set the parameters explicitly for unit tests + public :: SeasonalDecidOnset ! Logical function to determine is seasonal decidious onset should be triggered + public :: SeasonalCriticalDaylength ! Critical day length needed for Seasonal decidious offset + + ! !PRIVITE MEMBER FIUNCTIONS: + private :: CNPhenologyClimate ! Get climatological everages to figure out triggers for Phenology + private :: CNEvergreenPhenology ! Phenology for evergreen plants + private :: CNSeasonDecidPhenology ! Phenology for seasonal decidious platnts + private :: CNStressDecidPhenology ! Phenology for stress deciidous plants + private :: CropPhenology ! Phenology for crops + private :: CropPhenologyInit ! Initialize phenology for crops + private :: vernalization ! Vernalization (overwinterring) of crops + private :: CNOnsetGrowth ! Leaf Onset growth + private :: CNOffsetLitterfall ! Leaf Offset litter fall + private :: CNBackgroundLitterfall ! Background litter fall + private :: CNLivewoodTurnover ! Liver wood turnover to deadwood + private :: CNCropHarvestToProductPools ! Move crop harvest to product pools + private :: CNLitterToColumn ! Move litter ofrom patch to column level ! ! !PRIVATE DATA MEMBERS: type, private :: params_type - real(r8) :: crit_dayl ! critical day length for senescence - real(r8) :: ndays_on ! number of days to complete leaf onset - real(r8) :: ndays_off ! number of days to complete leaf offset - real(r8) :: fstor2tran ! fraction of storage to move to transfer for each onset - real(r8) :: crit_onset_fdd ! critical number of freezing days to set gdd counter - real(r8) :: crit_onset_swi ! critical number of days > soilpsi_on for onset - real(r8) :: soilpsi_on ! critical soil water potential for leaf onset - real(r8) :: crit_offset_fdd ! critical number of freezing days to initiate offset - real(r8) :: crit_offset_swi ! critical number of water stress days to initiate offset - real(r8) :: soilpsi_off ! critical soil water potential for leaf offset - real(r8) :: lwtop ! live wood turnover proportion (annual fraction) - real(r8) :: phenology_soil_depth ! soil depth used for measuring states for phenology triggers + real(r8) :: crit_dayl ! critical day length for senescence (sec) + ! (11 hrs [39,600 sec] from White 2001) + real(r8) :: crit_dayl_at_high_lat ! critical day length for senescence at high latitudes (sec) + ! (in Eitel 2019 this was 54000 [15 hrs]) + real(r8) :: crit_dayl_lat_slope ! Slope of time for critical day length with latitude (sec/deg) + ! (Birch et. all 2021 it was 720 see line below) + ! 15hr-11hr/(65N-45N)=linear slope = 720 min/latitude (Birch et. al 2021) + real(r8) :: ndays_on ! number of days to complete leaf onset + real(r8) :: ndays_off ! number of days to complete leaf offset + real(r8) :: fstor2tran ! fraction of storage to move to transfer for each onset + real(r8) :: crit_onset_fdd ! critical number of freezing days to set gdd counter + real(r8) :: crit_onset_swi ! critical number of days > soilpsi_on for onset + real(r8) :: soilpsi_on ! critical soil water potential for leaf onset + real(r8) :: crit_offset_fdd ! critical number of freezing days to initiate offset + real(r8) :: crit_offset_swi ! critical number of water stress days to initiate offset + real(r8) :: soilpsi_off ! critical soil water potential for leaf offset + real(r8) :: lwtop ! live wood turnover proportion (annual fraction) + real(r8) :: phenology_soil_depth ! soil depth used for measuring states for phenology triggers end type params_type type(params_type) :: params_inst @@ -96,8 +123,16 @@ module CNPhenologyMod integer :: jdayyrstart(inSH) ! julian day of start of year real(r8), private :: initial_seed_at_planting = 3._r8 ! Initial seed at planting - logical, private :: min_crtical_dayl_depends_on_lat = .false. ! If critical day-length for onset depends on latitude + + ! Constants for seasonal decidious leaf onset and offset logical, private :: onset_thresh_depends_on_veg = .false. ! If onset threshold depends on vegetation type + integer, public, parameter :: critical_daylight_constant = 1 + integer, public, parameter :: critical_daylight_depends_on_lat = critical_daylight_constant + 1 + integer, public, parameter :: critical_daylight_depends_on_veg = critical_daylight_depends_on_lat + 1 + integer, public, parameter :: critical_daylight_depends_on_latnveg = critical_daylight_depends_on_veg + 1 + integer, private :: critical_daylight_method = critical_daylight_constant + ! For determining leaf offset latitude that's considered high latitude (see Eitel 2019) + real(r8), parameter :: critical_offset_high_lat = 65._r8 ! Start of what's considered high latitude (degrees) character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -125,11 +160,12 @@ subroutine CNPhenologyReadNML( NLFilename ) integer :: ierr ! error code integer :: unitn ! unit for namelist file + character(len=25) :: min_critical_dayl_method ! Method to determine critical day length for onset character(len=*), parameter :: subname = 'CNPhenologyReadNML' character(len=*), parameter :: nmlname = 'cnphenology' !----------------------------------------------------------------------- namelist /cnphenology/ initial_seed_at_planting, onset_thresh_depends_on_veg, & - min_crtical_dayl_depends_on_lat + min_critical_dayl_method ! Initialize options to default values, in case they are not specified in ! the namelist @@ -150,9 +186,21 @@ subroutine CNPhenologyReadNML( NLFilename ) call relavu( unitn ) end if - call shr_mpi_bcast (initial_seed_at_planting, mpicom) - call shr_mpi_bcast (onset_thresh_depends_on_veg, mpicom) - call shr_mpi_bcast (min_crtical_dayl_depends_on_lat, mpicom) + call shr_mpi_bcast (initial_seed_at_planting, mpicom) + call shr_mpi_bcast (onset_thresh_depends_on_veg, mpicom) + call shr_mpi_bcast (min_critical_dayl_method, mpicom) + + if ( min_critical_dayl_method == "DependsOnLat" )then + critical_daylight_method = critical_daylight_depends_on_lat + else if ( min_critical_dayl_method == "DependsOnVeg" )then + critical_daylight_method = critical_daylight_depends_on_veg + else if ( min_critical_dayl_method == "DependsOnLatAndVeg" )then + critical_daylight_method = critical_daylight_depends_on_latnveg + else if ( min_critical_dayl_method == "Constant" )then + critical_daylight_method = critical_daylight_constant + else + call endrun(msg="ERROR min_critical_dayl_method is NOT set to a valid value"//errmsg(sourcefile, __LINE__)) + end if if (masterproc) then write(iulog,*) ' ' @@ -166,6 +214,45 @@ subroutine CNPhenologyReadNML( NLFilename ) end subroutine CNPhenologyReadNML + !----------------------------------------------------------------------- + subroutine CNPhenologySetNML( input_onset_thresh_depends_on_veg, input_critical_daylight_method ) + ! + ! !DESCRIPTION: + ! Set the namelist items for unit-testing + ! + logical, intent(in) :: input_onset_thresh_depends_on_veg + integer, intent(in) :: input_critical_daylight_method + + onset_thresh_depends_on_veg = input_onset_thresh_depends_on_veg + critical_daylight_method = input_critical_daylight_method + if ( (critical_daylight_method < critical_daylight_constant) .or. & + (critical_daylight_method > critical_daylight_depends_on_latnveg) )then + call endrun(msg="ERROR critical_daylight_method "//errmsg(sourcefile, __LINE__)) + end if + end subroutine CNPhenologySetNML + + !----------------------------------------------------------------------- + subroutine CNPhenologySetParams( ) + ! + ! !DESCRIPTION: + ! Set the parameters for unit-testing + ! + params_inst%crit_dayl = 39200._r8 ! Seconds + params_inst%crit_dayl_at_high_lat = 54000._r8 ! Seconds + params_inst%crit_dayl_lat_slope = 720._r8 ! Seconds / degree + params_inst%ndays_on = 15._r8 ! Days + params_inst%ndays_off = 30._r8 ! Days + params_inst%fstor2tran = 0.5 ! Fraction + params_inst%crit_onset_fdd = 15._r8 ! Days + params_inst%crit_onset_swi = 15._r8 ! Days + params_inst%soilpsi_on = -0.6_r8 ! MPa + params_inst%crit_offset_fdd = 15._r8 ! Days + params_inst%crit_offset_swi = 15._r8 ! Days + params_inst%soilpsi_off = -0.8 ! MPa + params_inst%lwtop = 0.7_r8 ! Fraction + params_inst%phenology_soil_depth = 0.08_r8 ! m + end subroutine CNPhenologySetParams + !----------------------------------------------------------------------- subroutine readParams ( ncid ) ! @@ -184,6 +271,8 @@ subroutine readParams ( ncid ) !----------------------------------------------------------------------- call readNcdioScalar(ncid, 'crit_dayl', subname, params_inst%crit_dayl) + call readNcdioScalar(ncid, 'crit_dayl_at_high_lat', subname, params_inst%crit_dayl_at_high_lat) + call readNcdioScalar(ncid, 'crit_dayl_lat_slope', subname, params_inst%crit_dayl_lat_slope) call readNcdioScalar(ncid, 'ndays_on', subname, params_inst%ndays_on) call readNcdioScalar(ncid, 'ndays_off', subname, params_inst%ndays_off) call readNcdioScalar(ncid, 'fstor2tran', subname, params_inst%fstor2tran) @@ -195,6 +284,7 @@ subroutine readParams ( ncid ) call readNcdioScalar(ncid, 'soilpsi_off', subname, params_inst%soilpsi_off) call readNcdioScalar(ncid, 'lwtop_ann', subname, params_inst%lwtop) call readNcdioScalar(ncid, 'phenology_soil_depth', subname, params_inst%phenology_soil_depth) + end subroutine readParams @@ -372,6 +462,31 @@ subroutine CNPhenologyInit(bounds) if ( use_crop ) call CropPhenologyInit(bounds) + ! Error checking for parameters + if ( (critical_daylight_method == critical_daylight_depends_on_lat) .or. & + (critical_daylight_method == critical_daylight_depends_on_veg) .or. & + (critical_daylight_method == critical_daylight_depends_on_latnveg) )then + if ( params_inst%crit_dayl_at_high_lat < params_inst%crit_dayl )then + call endrun(msg="ERROR crit_dayl_at_high_lat should be higher than crit_dayl on paramsfile"//errmsg(sourcefile, __LINE__)) + end if + if ( params_inst%crit_dayl_at_high_lat >= secspday )then + call endrun(msg="ERROR crit_dayl_at_high_lat can NOT be higher than seconds in a day"//errmsg(sourcefile, __LINE__)) + end if + if ( params_inst%crit_dayl >= secspday )then + call endrun(msg="ERROR crit_dayl can NOT be higher than seconds in a day"//errmsg(sourcefile, __LINE__)) + end if + end if + if ( (critical_daylight_method == critical_daylight_depends_on_lat) .or. & + (critical_daylight_method == critical_daylight_depends_on_latnveg) )then + if ( params_inst%crit_dayl_lat_slope <= 0.0_r8 )then + call endrun(msg="ERROR crit_dayl_lat_slope can not be negative or zero"//errmsg(sourcefile, __LINE__)) + end if + if ( params_inst%crit_dayl_lat_slope >= (secspday - params_inst%crit_dayl_at_high_lat)/ & + (90._r8 - critical_offset_high_lat) )then + call endrun(msg="ERROR crit_dayl_lat_slope cannot allow crit_dayl longer than a day"//errmsg(sourcefile, __LINE__)) + end if + end if + end subroutine CNPhenologyInit !----------------------------------------------------------------------- @@ -664,8 +779,8 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & real(r8):: ws_flag !winter-summer solstice flag (0 or 1) real(r8):: crit_onset_gdd !critical onset growing degree-day sum real(r8):: crit_daylat !latitudinal light gradient in arctic-boreal - real(r8):: onset_thresh !flag onset threshold - real(r8):: soilt + logical :: do_onset ! Flag if onset should happen + real(r8):: soilt ! soil temperature for layer to use for seasonal phenology trigger !----------------------------------------------------------------------- associate( & @@ -678,7 +793,7 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & season_decid_temperate => pftcon%season_decid_temperate , & ! Input: binary flag for seasonal-deciduous temperate leaf habit (0 or 1) t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - soila10 => temperature_inst%soila10_patch , & ! Input: [real(r8) (:) ] + soila10 => temperature_inst%soila10_col , & ! Input: [real(r8) (:) ] t_a5min => temperature_inst%t_a5min_patch , & ! input: [real(r8) (:) ] snow_5day => waterdiagnosticbulk_inst%snow_5day_col , & ! input: [real(r8) (:) ] @@ -853,56 +968,17 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & ! test for switching from dormant period to growth period if (dormant_flag(p) == 1.0_r8) then - onset_thresh = 0.0_r8 - ! Test to turn on growing degree-day sum, if off. - ! switch on the growing degree day sum on the winter solstice - - if (onset_gddflag(p) == 0._r8 .and. ws_flag == 1._r8) then - onset_gddflag(p) = 1._r8 - onset_gdd(p) = 0._r8 - end if - - ! Test to turn off growing degree-day sum, if on. - ! This test resets the growing degree day sum if it gets past - ! the summer solstice without reaching the threshold value. - ! In that case, it will take until the next winter solstice - ! before the growing degree-day summation starts again. - - if (onset_gddflag(p) == 1._r8 .and. ws_flag == 0._r8) then - onset_gddflag(p) = 0._r8 - onset_gdd(p) = 0._r8 - end if - - ! if the gdd flag is set, and if the soil is above freezing - ! then accumulate growing degree days for onset trigger - soilt = t_soisno(c, phenology_soil_layer) - if (onset_gddflag(p) == 1.0_r8 .and. soilt > SHR_CONST_TKFRZ) then - onset_gdd(p) = onset_gdd(p) + (soilt-SHR_CONST_TKFRZ)*fracday - end if - if ( onset_thresh_depends_on_veg ) then - ! separate into non-arctic seasonally deciduous pfts (temperate broadleaf deciduous - ! tree) and arctic/boreal seasonally deciduous pfts (boreal needleleaf deciduous tree, - ! boreal broadleaf deciduous tree, boreal broadleaf deciduous shrub, C3 arctic grass) - if (onset_gdd(p) > crit_onset_gdd .and. season_decid_temperate(ivt(p)) == 1) then - onset_thresh=1.0_r8 - else if (season_decid_temperate(ivt(p)) == 0 .and. onset_gddflag(p) == 1.0_r8 .and. & - soila10(p) > SHR_CONST_TKFRZ .and. & - t_a5min(p) > SHR_CONST_TKFRZ .and. ws_flag==1.0_r8 .and. & - dayl(g)>(crit_dayl/2.0_r8) .and. snow_5day(c)<0.1_r8) then - onset_thresh=1.0_r8 - end if - else - ! set onset_flag if critical growing degree-day sum is exceeded - if (onset_gdd(p) > crit_onset_gdd) onset_thresh = 1.0_r8 - end if + + do_onset = SeasonalDecidOnset( onset_gdd(p), onset_gddflag(p), soilt, soila10(c), t_a5min(p), dayl(g), & + snow_5day(c), ws_flag, crit_onset_gdd, season_decid_temperate(ivt(p)) ) ! If onset is being triggered - if (onset_thresh == 1.0_r8) then + if (do_onset) then onset_flag(p) = 1.0_r8 dormant_flag(p) = 0.0_r8 onset_gddflag(p) = 0.0_r8 onset_gdd(p) = 0.0_r8 - onset_thresh = 0.0_r8 + do_onset = .false. onset_counter(p) = ndays_on * secspday ! move all the storage pools into transfer pools, @@ -944,16 +1020,7 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & if (days_active(p) > 355._r8) pftmayexist(p) = .false. end if - if ( min_crtical_dayl_depends_on_lat )then - ! use 15 hr (54000 min) at ~65N from eitel 2019, to ~11hours in temperate regions - ! 15hr-11hr/(65N-45N)=linear slope = 720 min/latitude - crit_daylat=54000-720*(65-abs(grc%latdeg(g))) - if (crit_daylat < crit_dayl) then - crit_daylat = crit_dayl !maintain previous offset from White 2001 as minimum - end if - else - crit_daylat = crit_dayl - end if + crit_daylat = SeasonalCriticalDaylength( g, p ) ! only begin to test for offset daylength once past the summer sol if (ws_flag == 0._r8 .and. dayl(g) < crit_daylat) then @@ -972,6 +1039,153 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & end subroutine CNSeasonDecidPhenology + !----------------------------------------------------------------------- + function SeasonalCriticalDaylength( g, p ) result( crit_daylat ) + ! + ! !DESCRIPTION: + ! Function to determine the critical day length needed for seasonal + ! decidious leaf offset. When depends on latitude it's higher for + ! high latitudes and lower for temperate regions. + ! + ! !ARGUMENTS: + integer, intent(IN) :: g ! Gridcell index + integer, intent(IN) :: p ! Patch index + real(r8) :: crit_daylat ! Return value + ! + ! !LOCAL VARIABLES: + !----------------------------------------------------------------------- + + select case( critical_daylight_method ) + ! Critical day length depends on both vegetation type and latitude + case(critical_daylight_depends_on_latnveg) + ! Critical day length for offset is fixed for temperate type vegetation + if ( pftcon%season_decid_temperate(patch%itype(p)) == 1 )then + crit_daylat = crit_dayl + ! For Arctic vegetation -- critical daylength is longer at high latitudes and shorter + ! at midlatitudes + else + crit_daylat=params_inst%crit_dayl_at_high_lat-params_inst%crit_dayl_lat_slope* & + (critical_offset_high_lat-abs(grc%latdeg(g))) + if (crit_daylat < crit_dayl) then + crit_daylat = crit_dayl !maintain previous offset from White 2001 as minimum + end if + end if + ! Critical day length depends just on vegetation type + case(critical_daylight_depends_on_veg) + if ( pftcon%season_decid_temperate(patch%itype(p)) == 1 )then + crit_daylat = crit_dayl + else + crit_daylat=params_inst%crit_dayl_at_high_lat + end if + ! Critical day length depends on latitude + case(critical_daylight_depends_on_lat) + ! Critical daylength is higher at high latitudes and shorter + ! for temperatre regions + crit_daylat=params_inst%crit_dayl_at_high_lat-params_inst%crit_dayl_lat_slope* & + (critical_offset_high_lat-abs(grc%latdeg(g))) + if (crit_daylat < crit_dayl) then + crit_daylat = crit_dayl !maintain previous offset from White 2001 as minimum + end if + ! Critical day length is constant + case(critical_daylight_constant) + crit_daylat = crit_dayl + case default + call endrun(msg="ERROR SeasonalCriticalDaylength critical_daylight_method not implemented "//errmsg(sourcefile, __LINE__)) + end select + + end function SeasonalCriticalDaylength + + !----------------------------------------------------------------------- + function SeasonalDecidOnset( onset_gdd, onset_gddflag, soilt, soila10, t_a5min, dayl, & + snow_5day, ws_flag, crit_onset_gdd, season_decid_temperate ) & + result( do_onset ) + + ! + ! !DESCRIPTION: + ! Function to determine if seasonal deciduous leaf onset should happen. + ! + ! !USES: + use shr_const_mod , only: SHR_CONST_TKFRZ + ! !ARGUMENTS: + real(r8), intent(INOUT) :: onset_gdd ! onset growing degree days + real(r8), intent(INOUT) :: onset_gddflag ! Onset freeze flag + real(r8), intent(IN) :: soilt ! Soil temperature at specific level for this evaluation + real(r8), intent(IN) :: soila10 ! 10-day running mean of the 12cm soil layer temperature (K) + real(r8), intent(IN) :: t_a5min ! 5-day running mean of min 2-m temperature + real(r8), intent(IN) :: dayl ! Day length + real(r8), intent(IN) :: snow_5day ! 5-day average of snow + real(r8), intent(IN) :: ws_flag ! winter-summer solstice flag (0 or 1) + real(r8), intent(IN) :: crit_onset_gdd ! critical onset growing degree-day sum + real(r8), intent(IN) :: season_decid_temperate ! If this is a temperate seasonal decidious type + logical :: do_onset ! Flag if onset should happen (return value) + ! + ! !LOCAL VARIABLES: + real(r8), parameter :: snow5d_thresh_for_onset = 0.1_r8 ! 5-day snow depth threshold for leaf onset + real(r8), parameter :: min_critical_daylength_onset = 39300._r8/2._r8 ! Minimum daylength for onset to happen + ! NOTE above: The 39300/2(19650) value is what we've + ! tested with, we are concerned that changing + ! it might change answers. This trigger was just + ! added to make sure that onset doesn't happen in Jan/Feb. + ! See more notes on this parameter below. + !----------------------------------------------------------------------- + + do_onset = .false. + ! Test to turn on growing degree-day sum, if off. + ! switch on the growing degree day sum on the winter solstice + + if (onset_gddflag == 0._r8 .and. ws_flag == 1._r8) then + onset_gddflag = 1._r8 + onset_gdd = 0._r8 + end if + + ! Test to turn off growing degree-day sum, if on. + ! This test resets the growing degree day sum if it gets past + ! the summer solstice without reaching the threshold value. + ! In that case, it will take until the next winter solstice + ! before the growing degree-day summation starts again. + + if (onset_gddflag == 1._r8 .and. ws_flag == 0._r8) then + onset_gddflag = 0._r8 + onset_gdd = 0._r8 + end if + + ! if the gdd flag is set, and if the soil is above freezing + ! then accumulate growing degree days for onset trigger + + if (onset_gddflag == 1.0_r8 .and. soilt > SHR_CONST_TKFRZ) then + onset_gdd = onset_gdd + (soilt-SHR_CONST_TKFRZ)*fracday + end if + if ( onset_thresh_depends_on_veg) then + ! separate into non-arctic seasonally deciduous pfts + ! (temperate broadleaf deciduous + ! tree) and arctic/boreal seasonally deciduous pfts (boreal + ! needleleaf deciduous tree, + ! boreal broadleaf deciduous tree, boreal broadleaf deciduous + ! shrub, C3 arctic grass) + if (onset_gdd > crit_onset_gdd .and. season_decid_temperate == 1) then + do_onset = .true. + ! Note: The check "dayl>min_critical_daylength_onset" in the if + ! statement was added because for some coastal + ! points the other triggers could allow onset in January/February + ! which isn't sustainable and is a degenerate case. To prevent this + ! condition was added, but now the other conditions aren't triggered + ! until much later so it's value just needs to be high enough to prevent + ! the degenerate case of happening too early, and low enough that it + ! doesn't restrict onset. As such the value of this parameter shouldn't + ! matter for reasonable values between the two degenerate cases. + else if (season_decid_temperate == 0 .and. onset_gddflag == 1.0_r8 .and. & + soila10 > SHR_CONST_TKFRZ .and. & + t_a5min > SHR_CONST_TKFRZ .and. ws_flag==1.0_r8 .and. & + dayl>min_critical_daylength_onset .and. snow_5day crit_onset_gdd) do_onset = .true. + end if + + end function SeasonalDecidOnset + !----------------------------------------------------------------------- subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & soilstate_inst, temperature_inst, atm2lnd_inst, wateratm2lndbulk_inst, cnveg_state_inst, & @@ -1473,6 +1687,8 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & real(r8) dayspyr ! days per year real(r8) crmcorn ! comparitive relative maturity for corn real(r8) ndays_on ! number of days to fertilize + logical do_plant_normal ! are the normal planting rules defined and satisfied? + logical do_plant_lastchance ! if not the above, what about relaxed rules for the last day of the planting window? !------------------------------------------------------------------------ associate( & @@ -1625,82 +1841,32 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & ! cropplant through the end of the year for a harvested crop. ! Also harvdate(p) should be harvdate(p,ivt(p)) and should be ! updated on Jan 1st instead of at harvest (slevis) - if (a5tmin(p) /= spval .and. & - a5tmin(p) <= minplanttemp(ivt(p)) .and. & - jday >= minplantjday(ivt(p),h) .and. & - (gdd020(p) /= spval .and. & - gdd020(p) >= gddmin(ivt(p)))) then - - cumvd(p) = 0._r8 - hdidx(p) = 0._r8 - vf(p) = 0._r8 - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - gddmaturity(p) = hybgdd(ivt(p)) - leafc_xfer(p) = initial_seed_at_planting - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - crop_seedc_to_leaf(p) = leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = leafn_xfer(p)/dt - - ! because leafc_xfer is set above rather than incremneted through the normal process, must also set its isotope - ! pools here. use totvegc_patch as the closest analogue if nonzero, and use initial value otherwise - if (use_c13) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c13_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c13ratio - endif - endif - if (use_c14) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c14_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c14ratio - endif - endif - ! latest possible date to plant winter cereal and after all other - ! crops were harvested for that year + ! Are all the normal requirements for planting met? + do_plant_normal = a5tmin(p) /= spval .and. & + a5tmin(p) <= minplanttemp(ivt(p)) .and. & + jday >= minplantjday(ivt(p),h) .and. & + (gdd020(p) /= spval .and. & + gdd020(p) >= gddmin(ivt(p))) + ! If not, but it's the last day of the planting window, what about relaxed rules? + do_plant_lastchance = (.not. do_plant_normal) .and. & + jday >= maxplantjday(ivt(p),h) .and. & + gdd020(p) /= spval .and. & + gdd020(p) >= gddmin(ivt(p)) - else if (jday >= maxplantjday(ivt(p),h) .and. & - gdd020(p) /= spval .and. & - gdd020(p) >= gddmin(ivt(p))) then + if (do_plant_normal .or. do_plant_lastchance) then cumvd(p) = 0._r8 hdidx(p) = 0._r8 vf(p) = 0._r8 - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested + + call PlantCrop(p, leafcn(ivt(p)), jday, crop_inst, cnveg_state_inst, & + cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, & + cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & + c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst) + gddmaturity(p) = hybgdd(ivt(p)) - leafc_xfer(p) = initial_seed_at_planting - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - crop_seedc_to_leaf(p) = leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = leafn_xfer(p)/dt - ! because leafc_xfer is set above rather than incremneted through the normal process, must also set its isotope - ! pools here. use totvegc_patch as the closest analogue if nonzero, and use initial value otherwise - if (use_c13) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c13_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c13ratio - endif - endif - if (use_c14) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c14_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c14ratio - endif - endif else gddmaturity(p) = 0._r8 end if @@ -1708,21 +1874,27 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & else ! not winter cereal... slevis: added distinction between NH and SH ! slevis: The idea is that jday will equal idop sooner or later in the year ! while the gdd part is either true or false for the year. - if (t10(p) /= spval.and. a10tmin(p) /= spval .and. & - t10(p) > planttemp(ivt(p)) .and. & - a10tmin(p) > minplanttemp(ivt(p)) .and. & - jday >= minplantjday(ivt(p),h) .and. & - jday <= maxplantjday(ivt(p),h) .and. & - t10(p) /= spval .and. a10tmin(p) /= spval .and. & - gdd820(p) /= spval .and. & - gdd820(p) >= gddmin(ivt(p))) then - - ! impose limit on growing season length needed - ! for crop maturity - for cold weather constraints - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested + + ! Are all the normal requirements for planting met? + do_plant_normal = t10(p) /= spval .and. a10tmin(p) /= spval .and. & + t10(p) > planttemp(ivt(p)) .and. & + a10tmin(p) > minplanttemp(ivt(p)) .and. & + jday >= minplantjday(ivt(p),h) .and. & + jday <= maxplantjday(ivt(p),h) .and. & + gdd820(p) /= spval .and. & + gdd820(p) >= gddmin(ivt(p)) + ! If not, but it's the last day of the planting window, what about relaxed rules? + do_plant_lastchance = (.not. do_plant_normal) .and. & + jday == maxplantjday(ivt(p),h) .and. & + gdd820(p) > 0._r8 .and. & + gdd820(p) /= spval + + if (do_plant_normal .or. do_plant_lastchance) then + + call PlantCrop(p, leafcn(ivt(p)), jday, crop_inst, cnveg_state_inst, & + cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, & + cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & + c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst) ! go a specified amount of time before/after ! climatological date @@ -1737,58 +1909,9 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & ivt(p) == nmiscanthus .or. ivt(p) == nirrig_miscanthus .or. & ivt(p) == nswitchgrass .or. ivt(p) == nirrig_switchgrass) then gddmaturity(p) = max(950._r8, min(gdd820(p)*0.85_r8, hybgdd(ivt(p)))) - gddmaturity(p) = max(950._r8, min(gddmaturity(p)+150._r8, 1850._r8)) - end if - if (ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & - ivt(p) == ncotton .or. ivt(p) == nirrig_cotton .or. & - ivt(p) == nrice .or. ivt(p) == nirrig_rice) then - gddmaturity(p) = min(gdd020(p), hybgdd(ivt(p))) - end if - - leafc_xfer(p) = initial_seed_at_planting - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - crop_seedc_to_leaf(p) = leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = leafn_xfer(p)/dt - - ! because leafc_xfer is set above rather than incremneted through the normal process, must also set its isotope - ! pools here. use totvegc_patch as the closest analogue if nonzero, and use initial value otherwise - if (use_c13) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c13_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c13ratio - endif - endif - if (use_c14) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c14_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c14ratio - endif - endif - - - ! If hit the max planting julian day -- go ahead and plant - else if (jday == maxplantjday(ivt(p),h) .and. gdd820(p) > 0._r8 .and. & - gdd820(p) /= spval ) then - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - - if (ivt(p) == ntmp_soybean .or. ivt(p) == nirrig_tmp_soybean .or. & - ivt(p) == ntrp_soybean .or. ivt(p) == nirrig_trp_soybean) then - gddmaturity(p) = min(gdd1020(p), hybgdd(ivt(p))) - end if - - if (ivt(p) == ntmp_corn .or. ivt(p) == nirrig_tmp_corn .or. & - ivt(p) == ntrp_corn .or. ivt(p) == nirrig_trp_corn .or. & - ivt(p) == nsugarcane .or. ivt(p) == nirrig_sugarcane .or. & - ivt(p) == nmiscanthus .or. ivt(p) == nirrig_miscanthus .or. & - ivt(p) == nswitchgrass .or. ivt(p) == nirrig_switchgrass) then - gddmaturity(p) = max(950._r8, min(gdd820(p)*0.85_r8, hybgdd(ivt(p)))) + if (do_plant_normal) then + gddmaturity(p) = max(950._r8, min(gddmaturity(p)+150._r8, 1850._r8)) + end if end if if (ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & ivt(p) == ncotton .or. ivt(p) == nirrig_cotton .or. & @@ -1796,30 +1919,6 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & gddmaturity(p) = min(gdd020(p), hybgdd(ivt(p))) end if - leafc_xfer(p) = initial_seed_at_planting - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - crop_seedc_to_leaf(p) = leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = leafn_xfer(p)/dt - - ! because leafc_xfer is set above rather than incremneted through the normal process, must also set its isotope - ! pools here. use totvegc_patch as the closest analogue if nonzero, and use initial value otherwise - if (use_c13) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c13_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c13ratio - endif - endif - if (use_c14) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c14_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c14ratio - endif - endif - else gddmaturity(p) = 0._r8 end if @@ -2109,6 +2208,83 @@ subroutine CropPhenologyInit(bounds) end subroutine CropPhenologyInit + !----------------------------------------------------------------------- + subroutine PlantCrop(p, leafcn_in, jday, & + crop_inst, cnveg_state_inst, & + cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, & + cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & + c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst) + ! + ! !DESCRIPTION: + ! + ! subroutine calculates initializes variables to what they should be upon + ! planting. Includes only operations that apply to all crop types; + ! additional operations need to happen in CropPhenology(). + + ! !USES: + use clm_varctl , only : use_c13, use_c14 + use clm_varcon , only : c13ratio, c14ratio + ! + ! !ARGUMENTS: + integer , intent(in) :: p ! PATCH index running over + real(r8) , intent(in) :: leafcn_in ! leaf C:N (gC/gN) of this patch's vegetation type (pftcon%leafcn(ivt(p))) + integer , intent(in) :: jday ! julian day of the year + type(crop_type) , intent(inout) :: crop_inst + type(cnveg_state_type) , intent(inout) :: cnveg_state_inst + type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst + type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst + type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst + type(cnveg_carbonstate_type) , intent(inout) :: c13_cnveg_carbonstate_inst + type(cnveg_carbonstate_type) , intent(inout) :: c14_cnveg_carbonstate_inst + !------------------------------------------------------------------------ + + associate( & + croplive => crop_inst%croplive_patch , & ! Output: [logical (:) ] Flag, true if planted, not harvested + cropplant => crop_inst%cropplant_patch , & ! Output: [logical (:) ] Flag, true if crop may be planted + harvdate => crop_inst%harvdate_patch , & ! Output: [integer (:) ] harvest date + idop => cnveg_state_inst%idop_patch , & ! Output: [integer (:) ] date of planting + leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C transfer + leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) leaf N transfer + crop_seedc_to_leaf => cnveg_carbonflux_inst%crop_seedc_to_leaf_patch , & ! Output: [real(r8) (:) ] (gC/m2/s) seed source to leaf + crop_seedn_to_leaf => cnveg_nitrogenflux_inst%crop_seedn_to_leaf_patch & ! Output: [real(r8) (:) ] (gN/m2/s) seed source to leaf + ) + + ! impose limit on growing season length needed + ! for crop maturity - for cold weather constraints + croplive(p) = .true. + cropplant(p) = .true. + idop(p) = jday + harvdate(p) = NOT_Harvested + + leafc_xfer(p) = initial_seed_at_planting + leafn_xfer(p) = leafc_xfer(p) / leafcn_in ! with onset + crop_seedc_to_leaf(p) = leafc_xfer(p)/dt + crop_seedn_to_leaf(p) = leafn_xfer(p)/dt + + ! because leafc_xfer is set above rather than incremneted through the normal process, must also set its isotope + ! pools here. use totvegc_patch as the closest analogue if nonzero, and use initial value otherwise + if (use_c13) then + if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then + c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & + c13_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) + else + c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c13ratio + endif + endif + if (use_c14) then + if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then + c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & + c14_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) + else + c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c14ratio + endif + endif + + end associate + + end subroutine PlantCrop + !----------------------------------------------------------------------- subroutine vernalization(p, & canopystate_inst, temperature_inst, waterdiagnosticbulk_inst, cnveg_state_inst, crop_inst) diff --git a/src/biogeochem/CNPrecisionControlMod.F90 b/src/biogeochem/CNPrecisionControlMod.F90 index 2617dce9ac..d3427bec57 100644 --- a/src/biogeochem/CNPrecisionControlMod.F90 +++ b/src/biogeochem/CNPrecisionControlMod.F90 @@ -647,7 +647,7 @@ subroutine TruncateCandNStates( bounds, filter_soilp, num_soilp, carbon_patch, n use clm_varctl , only : use_c13, use_c14, use_nguardrail use clm_varctl , only : iulog use pftconMod , only : nc3crop - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_patch ! ! !ARGUMENTS: implicit none @@ -690,7 +690,8 @@ subroutine TruncateCandNStates( bounds, filter_soilp, num_soilp, carbon_patch, n if ( .not. lallowneg .and. ((carbon_patch(p) < cnegcrit) .or. (nitrogen_patch(p) < nnegcrit)) ) then write(iulog,*) 'ERROR: Carbon or Nitrogen patch negative = ', carbon_patch(p), nitrogen_patch(p) write(iulog,*) 'ERROR: limits = ', cnegcrit, nnegcrit - call endrun(msg='ERROR: carbon or nitrogen state critically negative '//errMsg(sourcefile, lineno)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, & + msg='ERROR: carbon or nitrogen state critically negative '//errMsg(sourcefile, lineno)) else if ( abs(carbon_patch(p)) < ccrit .or. (use_nguardrail .and. abs(nitrogen_patch(p)) < ncrit) ) then num_truncatep = num_truncatep + 1 filter_truncatep(num_truncatep) = p @@ -718,7 +719,7 @@ subroutine TruncateCStates( bounds, filter_soilp, num_soilp, carbon_patch, pc, l use shr_log_mod, only : errMsg => shr_log_errMsg use clm_varctl , only : use_c13, use_c14 use pftconMod , only : nc3crop - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_patch ! ! !ARGUMENTS: implicit none @@ -759,7 +760,8 @@ subroutine TruncateCStates( bounds, filter_soilp, num_soilp, carbon_patch, pc, l if ( .not. lallowneg .and. (carbon_patch(p) < cnegcrit) ) then write(iulog,*) 'ERROR: Carbon patch negative = ', carbon_patch(p) write(iulog,*) 'ERROR: limit = ', cnegcrit - call endrun(msg='ERROR: carbon state critically negative '//errMsg(sourcefile, lineno)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, & + msg='ERROR: carbon state critically negative '//errMsg(sourcefile, lineno)) else if ( abs(carbon_patch(p)) < ccrit) then num_truncatep = num_truncatep + 1 @@ -800,8 +802,9 @@ subroutine TruncateNStates( bounds, filter_soilp, num_soilp, nitrogen_patch, pn, do fp = 1,num_soilp p = filter_soilp(fp) if ( nitrogen_patch(p) < nnegcrit ) then - !write(iulog,*) 'WARNING: Nitrogen patch negative = ', nitrogen_patch - !call endrun(msg='ERROR: nitrogen state critically negative'//errMsg(sourcefile, lineno)) + ! write(iulog,*) 'WARNING: Nitrogen patch negative = ', nitrogen_patch + ! call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, & + ! msg='ERROR: nitrogen state critically negative'//errMsg(sourcefile, lineno)) else if ( abs(nitrogen_patch(p)) < ncrit) then pn(p) = pn(p) + nitrogen_patch(p) nitrogen_patch(p) = 0._r8 diff --git a/src/biogeochem/CNRootDynMod.F90 b/src/biogeochem/CNRootDynMod.F90 index 8929f7f904..4d34d54f7c 100644 --- a/src/biogeochem/CNRootDynMod.F90 +++ b/src/biogeochem/CNRootDynMod.F90 @@ -8,8 +8,9 @@ module CNRootDynMod ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use clm_time_manager , only : get_step_size_real + use abortutils , only : endrun use clm_varpar , only : nlevsoi, nlevgrnd - use clm_varctl , only : use_vertsoilc, use_bedrock + use clm_varctl , only : use_bedrock use decompMod , only : bounds_type use pftconMod , only : noveg, npcropmin, pftcon use ColumnType , only : col @@ -186,16 +187,7 @@ subroutine CNRootDyn(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & ! Calculate the nitrogen profile in each layer ! For now, the profile for each PFT is equivilent to the ! column profile, in the future, this could be changed to a weighted profile - if(use_vertsoilc) then !for vertical soil profile - rsmn(p,j) = sminn_vr(c,j) - else ! need to calculate a profile, top 0.2m are constant, and decrease linearly - if(zi(c,j) <= 0.2_r8)then - rsmn(p,j) = dz(c,j) - end if - if(zi(c,j) > 0.2_r8)then - rsmn(p,j) = dz(c,j) * (zi(c,nlevsoi) - zi(c,j)) / (zi(c,nlevsoi) - 0.2_r8) - end if - end if + rsmn(p,j) = sminn_vr(c,j) if (root_depth(p) >= zi(c,j).or. & (zi(c,j-1) < root_depth(p) .and. zi(c,j) > root_depth(p))) then sumrsmn(p) = sumrsmn(p) + rsmn(p,j) diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 index 706ef40cb7..9eb226d67f 100644 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ b/src/biogeochem/CNVegCarbonFluxType.F90 @@ -782,7 +782,6 @@ subroutine InitHistory(this, bounds, carbon_type) ! ! !LOCAL VARIABLES: integer :: k,l,ii,jj - character(1) :: k_str character(8) :: vr_suffix character(10) :: active integer :: begp,endp @@ -2894,11 +2893,10 @@ subroutine InitHistory(this, bounds, carbon_type) ptr_patch=this%dwt_slash_cflux_patch, default='inactive') do k = i_litr_min, i_litr_max - write(k_str,'(I1)') k ! convert 1-digit integer to string this%dwt_frootc_to_litr_c_col(begc:endc,:,k) = spval data2dptr => this%dwt_frootc_to_litr_c_col(begc:endc,:,k) - fieldname = 'DWT_FROOTC_TO_LITR_'//k_str//'_C' - longname = 'fine root to litter_'//k_str//' due to landcover change' + fieldname = 'DWT_FROOTC_TO_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'_C' + longname = 'fine root to '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' due to landcover change' call hist_addfld_decomp (fname=fieldname, units='gC/m^2/s', type2d='levdcmp', & avgflag='A', long_name=longname, & ptr_col=data2dptr, default='inactive') @@ -3073,11 +3071,10 @@ subroutine InitHistory(this, bounds, carbon_type) ptr_patch=this%dwt_slash_cflux_patch, default='inactive') do k = i_litr_min, i_litr_max - write(k_str,'(I1)') k ! convert 1-digit integer to string this%dwt_frootc_to_litr_c_col(begc:endc,:,k) = spval data2dptr => this%dwt_frootc_to_litr_c_col(begc:endc,:,k) - fieldname = 'C13_DWT_FROOTC_TO_LITR_'//k_str//'_C' - longname = 'C13 fine root to litter_'//k_str//' due to landcover change' + fieldname = 'C13_DWT_FROOTC_TO_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'_C' + longname = 'C13 fine root to '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' due to landcover change' call hist_addfld_decomp (fname=fieldname, units='gC/m^2/s', type2d='levdcmp', & avgflag='A', long_name=longname, & ptr_col=data2dptr, default='inactive') @@ -3234,11 +3231,10 @@ subroutine InitHistory(this, bounds, carbon_type) ptr_patch=this%dwt_slash_cflux_patch, default='inactive') do k = i_litr_min, i_litr_max - write(k_str,'(I1)') k ! convert 1-digit integer to string this%dwt_frootc_to_litr_c_col(begc:endc,:,k) = spval data2dptr => this%dwt_frootc_to_litr_c_col(begc:endc,:,k) - fieldname = 'C14_DWT_FROOTC_TO_LITR_'//k_str//'_C' - longname = 'C14 fine root to litter_'//k_str//' due to landcover change' + fieldname = 'C14_DWT_FROOTC_TO_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'_C' + longname = 'C14 fine root to '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' due to landcover change' call hist_addfld_decomp (fname=fieldname, units='gC/m^2/s', type2d='levdcmp', & avgflag='A', long_name=longname, & ptr_col=data2dptr, default='inactive') diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90 index 68952b5048..8e19f47f0d 100644 --- a/src/biogeochem/CNVegNitrogenFluxType.F90 +++ b/src/biogeochem/CNVegNitrogenFluxType.F90 @@ -6,7 +6,7 @@ module CNVegNitrogenFluxType use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools use clm_varpar , only : nlevdecomp_full, nlevdecomp, i_litr_min, i_litr_max use clm_varcon , only : spval, ispval, dzsoi_decomp - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, use_crop + use clm_varctl , only : use_nitrif_denitrif, use_crop use CNSharedParamsMod , only : use_fun use decompMod , only : bounds_type use abortutils , only : endrun @@ -518,7 +518,6 @@ subroutine InitHistory(this, bounds) integer :: begp, endp integer :: begc, endc integer :: begg, endg - character(1) :: k_str character(10) :: active character(24) :: fieldname character(100) :: longname @@ -1013,11 +1012,10 @@ subroutine InitHistory(this, bounds) ptr_patch=this%dwt_conv_nflux_patch, default='inactive') do k = i_litr_min, i_litr_max - write(k_str,'(I1)') k ! convert 1-digit integer to string this%dwt_frootn_to_litr_n_col(begc:endc,:,k) = spval data2dptr => this%dwt_frootn_to_litr_n_col(begc:endc,:,k) - fieldname = 'DWT_FROOTN_TO_LITR_'//k_str//'_N' - longname = 'fine root N to litter_'//k_str//' due to landcover change' + fieldname = 'DWT_FROOTN_TO_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'_N' + longname = 'fine root N to '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' due to landcover change' call hist_addfld_decomp (fname=fieldname, units='gN/m^2/s', type2d='levdcmp', & avgflag='A', long_name=longname, & ptr_col=data2dptr, default='inactive') diff --git a/src/biogeochem/CNVegNitrogenStateType.F90 b/src/biogeochem/CNVegNitrogenStateType.F90 index 10a191ded9..a0cc51e654 100644 --- a/src/biogeochem/CNVegNitrogenStateType.F90 +++ b/src/biogeochem/CNVegNitrogenStateType.F90 @@ -8,7 +8,6 @@ module CNVegNitrogenStateType use clm_varpar , only : nlevdecomp_full, nlevdecomp use clm_varcon , only : spval, ispval, dzsoi_decomp, zisoi use landunit_varcon , only : istcrop, istsoil - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, use_century_decomp use clm_varctl , only : iulog, override_bgc_restart_mismatch_dump use clm_varctl , only : use_crop use CNSharedParamsMod , only : use_fun diff --git a/src/biogeochem/CNVegStructUpdateMod.F90 b/src/biogeochem/CNVegStructUpdateMod.F90 index a3e0438544..01209c678f 100644 --- a/src/biogeochem/CNVegStructUpdateMod.F90 +++ b/src/biogeochem/CNVegStructUpdateMod.F90 @@ -187,9 +187,6 @@ subroutine CNVegStructUpdate(bounds,num_soilp, filter_soilp, & ! Assumes fbw (fraction of biomass that is water) is the same for leaves and stems leaf_biomass(p) = max(0.0025_r8,leafc(p)) & * c_to_b * 1.e-3_r8 / (1._r8 - fbw(ivt(p))) - - else - leaf_biomass(p) = 0_r8 end if if (woody(ivt(p)) == 1._r8) then @@ -219,8 +216,6 @@ subroutine CNVegStructUpdate(bounds,num_soilp, filter_soilp, & ! Assumes fbw (fraction of biomass that is water) is the same for leaves and stems stem_biomass(p) = (spinup_factor_deadwood*deadstemc(p) + livestemc(p)) & * c_to_b * 1.e-3_r8 / (1._r8 - fbw(ivt(p))) - else - stem_biomass(p) = 0_r8 end if ! diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 9134017bdc..a86531ba62 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -20,7 +20,7 @@ module DUSTMod use landunit_varcon , only : istcrop, istsoil use clm_varctl , only : iulog use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_landunit, subgrid_level_patch use atm2lndType , only : atm2lnd_type use SoilStateType , only : soilstate_type use CanopyStateType , only : canopystate_type @@ -297,7 +297,7 @@ subroutine DustEmission (bounds, & end do if (found) then write(iulog,*) subname//':: error: sumwt is greater than 1.0 at l= ',index - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_landunit, msg=errMsg(sourcefile, __LINE__)) end if ! Loop through patches @@ -333,7 +333,7 @@ subroutine DustEmission (bounds, & p = filter_nolakep(fp) if (lnd_frc_mbl(p)>1.0_r8 .or. lnd_frc_mbl(p)<0.0_r8) then write(iulog,*)'Error dstmbl: pft= ',p,' lnd_frc_mbl(p)= ',lnd_frc_mbl(p) - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) end if end do diff --git a/src/biogeochem/DryDepVelocity.F90 b/src/biogeochem/DryDepVelocity.F90 index 01aa51d52c..7646699ffa 100644 --- a/src/biogeochem/DryDepVelocity.F90 +++ b/src/biogeochem/DryDepVelocity.F90 @@ -64,8 +64,7 @@ Module DryDepVelocity use seq_drydep_mod , only : index_o3=>o3_ndx, index_o3a=>o3a_ndx, index_so2=>so2_ndx, index_h2=>h2_ndx use seq_drydep_mod , only : index_co=>co_ndx, index_ch4=>ch4_ndx, index_pan=>pan_ndx use seq_drydep_mod , only : index_xpan=>xpan_ndx - use decompMod , only : bounds_type - use clm_varcon , only : namep + use decompMod , only : bounds_type, subgrid_level_patch use atm2lndType , only : atm2lnd_type use CanopyStateType , only : canopystate_type use FrictionVelocityMod , only : frictionvel_type @@ -350,7 +349,7 @@ subroutine depvel_compute( bounds, & if (clmveg >= npcropmin .and. clmveg <= npcropmax ) wesveg = 2 if (wesveg == wveg_unset )then write(iulog,*) 'clmveg = ', clmveg, 'lun%itype = ', lun%itype(l) - call endrun(decomp_index=pi, clmlevel=namep, & + call endrun(subgrid_index=pi, subgrid_level=subgrid_level_patch, & msg='ERROR: Not able to determine Wesley vegetation type'//& errMsg(sourcefile, __LINE__)) end if diff --git a/src/biogeochem/EDBGCDynMod.F90 b/src/biogeochem/EDBGCDynMod.F90 index e4150e7789..7f30d9ef13 100644 --- a/src/biogeochem/EDBGCDynMod.F90 +++ b/src/biogeochem/EDBGCDynMod.F90 @@ -10,7 +10,7 @@ module EDBGCDynMod use perf_mod , only : t_startf, t_stopf use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun - use clm_varctl , only : use_century_decomp, use_nitrif_denitrif + use SoilBiogeochemDecompCascadeConType , only : century_decomp, decomp_method use CNVegCarbonStateType , only : cnveg_carbonstate_type use CNVegCarbonFluxType , only : cnveg_carbonflux_type use SoilBiogeochemStateType , only : soilbiogeochem_state_type @@ -72,7 +72,6 @@ subroutine EDBGCDyn(bounds, & use CNNStateUpdate2Mod , only: NStateUpdate2, NStateUpdate2h use CNGapMortalityMod , only: CNGapMortality use SoilBiogeochemDecompCascadeBGCMod , only: decomp_rate_constants_bgc - use SoilBiogeochemDecompCascadeCNMod , only: decomp_rate_constants_cn use SoilBiogeochemCompetitionMod , only: SoilBiogeochemCompetition use SoilBiogeochemDecompMod , only: SoilBiogeochemDecomp use SoilBiogeochemLittVertTranspMod , only: SoilBiogeochemLittVertTransp @@ -178,12 +177,9 @@ subroutine EDBGCDyn(bounds, & ! Soil Biogeochemistry !-------------------------------------------- - if (use_century_decomp) then + if (decomp_method == century_decomp) then call decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, & soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) - else - call decomp_rate_constants_cn(bounds, num_soilc, filter_soilc, & - soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) end if ! calculate potential decomp rates and total immobilization demand (previously inlined in CNDecompAlloc) diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90 index 63a5007da0..626068679d 100644 --- a/src/biogeochem/SatellitePhenologyMod.F90 +++ b/src/biogeochem/SatellitePhenologyMod.F90 @@ -16,7 +16,7 @@ module SatellitePhenologyMod use clm_varctl , only : iulog, use_lai_streams use perf_mod , only : t_startf, t_stopf use spmdMod , only : masterproc, mpicom, iam - use laiStreamMod , only : lai_init, lai_advance, lai_interp + use laiStreamMod , only : lai_init, lai_advance, lai_interp use ncdio_pio ! ! !PUBLIC TYPES: @@ -88,7 +88,7 @@ subroutine SatellitePhenologyInit (bounds) end subroutine SatellitePhenologyInit !================================================================ - subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & + subroutine SatellitePhenology(bounds, num_filter, filter, & waterdiagnosticbulk_inst, canopystate_inst) ! ! !DESCRIPTION: @@ -100,18 +100,20 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type use CanopyStateType , only : canopystate_type use PatchType , only : patch + use clm_varctl , only : use_fates_sp + ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter - integer , intent(in) :: filter_nolakep(bounds%endp-bounds%begp+1) ! patch filter for non-lake points + integer , intent(in) :: num_filter ! number of column non-lake points in patch filter + integer , intent(in) :: filter(bounds%endp-bounds%begp+1) ! patch filter for non-lake points type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst type(canopystate_type) , intent(inout) :: canopystate_inst ! ! !LOCAL VARIABLES: - integer :: fp,p,c ! indices - real(r8) :: ol ! thickness of canopy layer covered by snow (m) - real(r8) :: fb ! fraction of canopy layer covered by snow + integer :: fp,p,c ! indices + real(r8) :: ol ! thickness of canopy layer covered by snow (m) + real(r8) :: fb ! fraction of canopy layer covered by snow !----------------------------------------------------------------------- associate( & @@ -130,8 +132,8 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & call lai_interp(bounds, canopystate_inst) endif - do fp = 1, num_nolakep - p = filter_nolakep(fp) + do fp = 1, num_filter + p = filter(fp) c = patch%column(p) ! need to update elai and esai only every albedo time step so do not @@ -176,19 +178,23 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & endif ! area weight by snow covered fraction - elai(p) = max(tlai(p)*(1.0_r8 - frac_sno(c)) + tlai(p)*fb*frac_sno(c), 0.0_r8) - esai(p) = max(tsai(p)*(1.0_r8 - frac_sno(c)) + tsai(p)*fb*frac_sno(c), 0.0_r8) - if (elai(p) < 0.05_r8) elai(p) = 0._r8 - if (esai(p) < 0.05_r8) esai(p) = 0._r8 - - ! Fraction of vegetation free of snow - - if ((elai(p) + esai(p)) >= 0.05_r8) then - frac_veg_nosno_alb(p) = 1 - else - frac_veg_nosno_alb(p) = 0 - end if - + if(.not.use_fates_sp)then + + ! Do not set these in FATES_SP mode as they turn on the 'vegsol' filter and also + ! are duplicated by the FATE variables (in the FATES IFP indexing space) + elai(p) = max(tlai(p)*(1.0_r8 - frac_sno(c)) + tlai(p)*fb*frac_sno(c), 0.0_r8) + esai(p) = max(tsai(p)*(1.0_r8 - frac_sno(c)) + tsai(p)*fb*frac_sno(c), 0.0_r8) + if (elai(p) < 0.05_r8) elai(p) = 0._r8 + if (esai(p) < 0.05_r8) esai(p) = 0._r8 + + ! Fraction of vegetation free of snow + + if ((elai(p) + esai(p)) >= 0.05_r8) then + frac_veg_nosno_alb(p) = 1 + else + frac_veg_nosno_alb(p) = 0 + end if + endif !fates_sp end do ! end of patch loop end associate diff --git a/src/biogeochem/ch4Mod.F90 b/src/biogeochem/ch4Mod.F90 index 0768e702d1..d9fbe1ae68 100644 --- a/src/biogeochem/ch4Mod.F90 +++ b/src/biogeochem/ch4Mod.F90 @@ -19,7 +19,7 @@ module ch4Mod use clm_time_manager , only : get_step_size_real, get_nstep use clm_varctl , only : iulog, use_cn, use_nitrif_denitrif, use_lch4, use_cn, use_fates use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_gridcell, subgrid_level_column use atm2lndType , only : atm2lnd_type use CanopyStateType , only : canopystate_type use CNSharedParamsMod , only : CNParamsShareInst @@ -112,6 +112,7 @@ module ch4Mod real(r8) :: q10lakebase ! (K) base temperature for lake CH4 production (= 298._r8) real(r8) :: atmch4 ! Atmospheric CH4 mixing ratio to prescribe if not provided by the atmospheric model (= 1.7e-6_r8) (mol/mol) real(r8) :: rob ! ratio of root length to vertical depth ("root obliquity") (= 3._r8) + real(r8) :: om_frac_sf ! Scale factor for organic matter fraction (unitless) end type params_type type(params_type), private :: params_inst @@ -1565,6 +1566,11 @@ subroutine readParams ( ncid ) call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%capthick=tempr + + tString='om_frac_sf' + call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%om_frac_sf=tempr end subroutine readParams @@ -1678,6 +1684,8 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & use ch4varcon , only : replenishlakec, allowlakeprod, ch4offline use clm_varcon , only : secspday use ch4varcon , only : finundation_mtd, finundation_mtd_h2osfc + use clm_time_manager, only : is_beg_curr_year + use dynSubgridControlMod, only : get_do_transient_lakes ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -1852,7 +1860,8 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & if (forc_pch4(g) == 0._r8) then write(iulog,*)'not using ch4offline, but methane concentration not passed from the atmosphere', & 'to land model! CLM Model is stopping.' - call endrun(msg=' ERROR: Methane not being passed to atmosphere'//& + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & + msg=' ERROR: Methane not being passed to atmosphere'//& errMsg(sourcefile, __LINE__)) end if end if @@ -2254,7 +2263,8 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & write(iulog,*)'dtime*ch4_oxid_tot = ', dtime*ch4_oxid_tot(c) write(iulog,*)'dtime*ch4_surf_flux_tot*1000 = ', dtime*& ch4_surf_flux_tot_col(c)*1000._r8 - call endrun(msg=' ERROR: Methane conservation error'//errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=' ERROR: Methane conservation error'//errMsg(sourcefile, __LINE__)) end if end if @@ -2279,7 +2289,8 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & write(iulog,*)'dtime*ch4_oxid_tot = ', dtime*ch4_oxid_tot(c) write(iulog,*)'dtime*ch4_surf_flux_tot*1000 = ', dtime*& ch4_surf_flux_tot_col(c)*1000._r8 - call endrun(msg=' ERROR: Methane conservation error, allowlakeprod'//& + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=' ERROR: Methane conservation error, allowlakeprod'//& errMsg(sourcefile, __LINE__)) end if end if @@ -2309,7 +2320,16 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & ch4_inst%totcolch4_grc(begg:endg), & c2l_scale_type= 'unity', l2g_scale_type='unity' ) + ! ! Gricell level balance + ! + + ! Skip the check if it's the beginning of a new year and dynamic lakes are on + ! See (https://github.com/ESCOMP/CTSM/issues/1356#issuecomment-905963583) + ! + if ( is_beg_curr_year() .and. get_do_transient_lakes() )then + ch4_first_time_grc(begg:endg) = .true. + end if do g = begg, endg if (.not. ch4_first_time_grc(g)) then @@ -2325,7 +2345,8 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & write(iulog,*)'totcolch4_bef_grc =', totcolch4_bef_grc(g) write(iulog,*)'dtime * nem_grc =', dtime * nem_grc(g) write(iulog,*)'dtime * ch4_surf_flux_tot * 1000 =', dtime * ch4_surf_flux_tot_grc(g) * 1000._r8 - call endrun(msg=' ERROR: Methane conservation error'//errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & + msg=' ERROR: Methane conservation error'//errMsg(sourcefile, __LINE__)) end if end if end do @@ -3662,14 +3683,16 @@ subroutine ch4_tran (bounds, & source(c,j,1) + conc_ch4(c,j) / dtime, c, j g = col%gridcell(c) write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: Methane demands exceed methane available.'& + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=' ERROR: Methane demands exceed methane available.'& //errMsg(sourcefile, __LINE__)) else if (ch4stress(c,j) < 1._r8 .and. source(c,j,1) + conc_ch4(c,j) / dtime > 1.e-12_r8) then write(iulog,*) 'Methane limited, yet some left over. Error in methane competition (mol/m^3/s), c,j:', & source(c,j,1) + conc_ch4(c,j) / dtime, c, j g = col%gridcell(c) write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: Methane limited, yet some left over.'//& + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=' ERROR: Methane limited, yet some left over.'//& errMsg(sourcefile, __LINE__)) end if @@ -3679,14 +3702,16 @@ subroutine ch4_tran (bounds, & source(c,j,2) + conc_o2(c,j) / dtime, c, j g = col%gridcell(c) write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: Oxygen demands exceed oxygen available.'//& + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=' ERROR: Oxygen demands exceed oxygen available.'//& errMsg(sourcefile, __LINE__) ) else if (o2stress(c,j) < 1._r8 .and. source(c,j,2) + conc_o2(c,j) / dtime > 1.e-12_r8) then write(iulog,*) 'Oxygen limited, yet some left over. Error in oxygen competition (mol/m^3/s), c,j:', & source(c,j,2) + conc_o2(c,j) / dtime, c, j g = col%gridcell(c) write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: Oxygen limited, yet some left over.'//errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=' ERROR: Oxygen limited, yet some left over.'//errMsg(sourcefile, __LINE__)) end if conc_ch4_bef(c,j) = conc_ch4(c,j) !For Balance Check @@ -3837,7 +3862,7 @@ subroutine ch4_tran (bounds, & ! expression in Wania (for peat) & Moldrup (for mineral soil) eps = watsat(c,j)-h2osoi_vol_min(c,j) ! Air-filled fraction of total soil volume if (organic_max > 0._r8) then - om_frac = min(cellorg(c,j)/organic_max, 1._r8) + om_frac = min(params_inst%om_frac_sf*cellorg(c,j)/organic_max, 1._r8) ! Use first power, not square as in iniTimeConst else om_frac = 1._r8 @@ -4153,7 +4178,8 @@ subroutine ch4_tran (bounds, & nstep,c,errch4(c) g = col%gridcell(c) write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: CH4 Conservation Error in CH4Mod during diffusion'//& + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=' ERROR: CH4 Conservation Error in CH4Mod during diffusion'//& errMsg(sourcefile, __LINE__)) end if end do diff --git a/src/biogeochem/test/CMakeLists.txt b/src/biogeochem/test/CMakeLists.txt index 15d41be10a..ad91c7c995 100644 --- a/src/biogeochem/test/CMakeLists.txt +++ b/src/biogeochem/test/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory(Species_test) -add_subdirectory(CNVegComputeSeed_test) \ No newline at end of file +add_subdirectory(CNVegComputeSeed_test) +add_subdirectory(CNPhenology_test) diff --git a/src/biogeochem/test/CNPhenology_test/CMakeLists.txt b/src/biogeochem/test/CNPhenology_test/CMakeLists.txt new file mode 100644 index 0000000000..f265e12ab0 --- /dev/null +++ b/src/biogeochem/test/CNPhenology_test/CMakeLists.txt @@ -0,0 +1,7 @@ +set (pfunit_sources + test_CNPhenology.pf) + +create_pFUnit_test(CNPhenology test_CNPhenology_exe + "${pfunit_sources}" "") + +target_link_libraries(test_CNPhenology_exe clm csm_share esmf_wrf_timemgr) diff --git a/src/biogeochem/test/CNPhenology_test/test_CNPhenology.pf b/src/biogeochem/test/CNPhenology_test/test_CNPhenology.pf new file mode 100644 index 0000000000..c93f15cb8f --- /dev/null +++ b/src/biogeochem/test/CNPhenology_test/test_CNPhenology.pf @@ -0,0 +1,298 @@ +module test_CNPhenology + + ! Tests of CNPhenologyMod + + use pfunit_mod + use unittestSubgridMod + use CNPhenologyMod + use unittestTimeManagerMod, only : unittest_timemgr_setup, unittest_timemgr_teardown + use unittestTimeManagerMod, only : unittest_timemgr_set_curr_date + use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch, setup_n_veg_patches + use shr_kind_mod , only : r8 => shr_kind_r8 + use pftconMod + + implicit none + + @TestCase + type, extends(TestCase) :: TestCNPhenology + integer :: dtime + real(r8) :: fracday + real(r8) :: onset_gdd + real(r8) :: onset_gddflag + real(r8) :: soilt + real(r8) :: soila10 + real(r8) :: t_a5min + real(r8) :: dayl + real(r8) :: snow_5day + real(r8) :: ws_flag + real(r8) :: crit_onset_gdd + real(r8) :: season_decid_temperate + contains + procedure :: setUp + procedure :: tearDown + procedure :: calc_doonset + end type TestCNPhenology + + real(r8), parameter :: tol = 1.e-13_r8 + +contains + + subroutine setUp(this) + use clm_varctl, only : use_crop + use clm_varcon, only: clm_varcon_init, zisoi, secspday + use clm_varpar, only: nlevlak, nlevgrnd, nlevdecomp_full + class(TestCNPhenology), intent(inout) :: this + real(r8), parameter :: my_zisoi(5) = [0.01_r8, 0.02_r8, 2._r8, 4._r8, 6._r8] + + use_crop = .false. + this%dtime = 1800 + this%fracday = real(this%dtime,r8) / secspday + ! Setup time manager + call unittest_timemgr_setup(dtime=this%dtime) + + this%onset_gdd = 0._r8 ! Will be reset... + this%onset_gddflag = 0._r8 ! Will be reset... + ! Temperatures + this%soilt = 273._r8 ! Below freezing + this%soila10 = 273._r8 ! Below freezing + this%t_a5min = 273._r8 ! Below freezing + + this%dayl = 19500._r8 ! Below half of critical dayl + this%snow_5day = 1._r8 ! Above threshold + this%ws_flag = 1._r8 ! After winter solstice + this%crit_onset_gdd = 1._r8 + this%season_decid_temperate = 0._r8 ! Non temperate plant + + call setup_single_veg_patch(pft_type=1) + + nlevgrnd = size(my_zisoi) + nlevlak = 10 + nlevdecomp_full = nlevgrnd + call clm_varcon_init( is_simple_buildtemp = .true.) + zisoi(0) = 0._r8 + zisoi(1:nlevgrnd) = my_zisoi(:) + + call CNPhenologySetParams() + call CNPhenologyInit( bounds ) + call pftcon%InitForTesting() + pftcon%season_decid_temperate = this%season_decid_temperate + + end subroutine setUp + + subroutine tearDown(this) + use clm_varcon, only: clm_varcon_clean + class(TestCNPhenology), intent(inout) :: this + + call unittest_timemgr_teardown() + call clm_varcon_clean() + call unittest_subgrid_teardown() + call pftcon%Clean() + + end subroutine tearDown + + subroutine calc_doonset(this, do_onset) + class(TestCNPhenology), intent(inout) :: this + logical, intent(out) :: do_onset + + do_onset = SeasonalDecidOnset( this%onset_gdd, this%onset_gddflag, this%soilt, this%soila10, this%t_a5min, this%dayl, & + this%snow_5day, this%ws_flag, this%crit_onset_gdd, this%season_decid_temperate ) + end subroutine calc_doonset + + @Test + subroutine check_doonset_normal(this) + class(TestCNPhenology), intent(inout) :: this + logical :: do_onset + + call CNPhenologySetNML( input_onset_thresh_depends_on_veg=.false., & + input_critical_daylight_method = critical_daylight_constant ) + this%onset_gdd = 1.0_r8 + this%crit_onset_gdd = 2.0_r8 + call this%calc_doonset( do_onset ) + @assertFalse( do_onset ) + this%onset_gdd = 2.000001_r8 + call this%calc_doonset( do_onset ) + @assertTrue( do_onset ) + end subroutine check_doonset_normal + + @Test + subroutine check_doonset_vegdepend_buttemperate(this) + class(TestCNPhenology), intent(inout) :: this + logical :: do_onset + + ! This should be identical to the normal case + call CNPhenologySetNML( input_onset_thresh_depends_on_veg=.true., & + input_critical_daylight_method = critical_daylight_constant ) + this%onset_gdd = 1.0_r8 + this%crit_onset_gdd = 2.0_r8 + this%season_decid_temperate = 1._r8 + call this%calc_doonset( do_onset ) + @assertFalse( do_onset ) + this%onset_gdd = 2.000001_r8 + call this%calc_doonset( do_onset ) + @assertTrue( do_onset ) + end subroutine check_doonset_vegdepend_buttemperate + + @Test + subroutine check_doonset_vegdepend(this) + class(TestCNPhenology), intent(inout) :: this + logical :: do_onset + + call CNPhenologySetNML( input_onset_thresh_depends_on_veg=.true., & + input_critical_daylight_method = critical_daylight_constant ) + this%onset_gdd = 1.0_r8 + this%crit_onset_gdd = 2.0_r8 + this%season_decid_temperate = 0._r8 + call this%calc_doonset( do_onset ) + @assertFalse( do_onset ) + this%onset_gdd = 9999.000001_r8 ! No longer matters for veg dependent case + call this%calc_doonset( do_onset ) + @assertFalse( do_onset ) + ! Set soila10 above freezing should still be off + this%soila10 = 275._r8 + call this%calc_doonset( do_onset ) + @assertFalse( do_onset ) + ! Set t_a5min above freezing should still be off + this%t_a5min = 275._r8 + call this%calc_doonset( do_onset ) + @assertFalse( do_onset ) + ! Set snow_5day below threshold should still be off + this%snow_5day = 0._r8 + call this%calc_doonset( do_onset ) + @assertFalse( do_onset ) + ! Set dayl over half of critical and now should be on + this%dayl = 19700._r8 + call this%calc_doonset( do_onset ) + @assertTrue( do_onset ) + end subroutine check_doonset_vegdepend +! + @Test + subroutine check_onsetflag_winter(this) + class(TestCNPhenology), intent(inout) :: this + logical :: do_onset + + call CNPhenologySetNML( input_onset_thresh_depends_on_veg=.false., & + input_critical_daylight_method = critical_daylight_constant ) + this%onset_gdd = 1.0_r8 + this%onset_gddflag = 1.0_r8 + this%ws_flag = 0._r8 + call this%calc_doonset( do_onset ) + @assertEqual( this%onset_gddflag, 0._r8 ) + @assertEqual( this%onset_gdd, 0._r8 ) + @assertFalse( do_onset ) + end subroutine check_onsetflag_winter + + + @Test + subroutine check_onsetflag_spring(this) + use shr_const_mod , only: SHR_CONST_TKFRZ + class(TestCNPhenology), intent(inout) :: this + logical :: do_onset + real(r8), parameter :: temp = 5._r8 + + call CNPhenologySetNML( input_onset_thresh_depends_on_veg=.false., & + input_critical_daylight_method = critical_daylight_constant ) + this%onset_gdd = 0.0_r8 + this%onset_gddflag = 0._r8 + this%ws_flag = 1._r8 + this%soilt = 270._r8 + call this%calc_doonset( do_onset ) + @assertEqual( this%onset_gddflag, 1._r8 ) + @assertEqual( this%onset_gdd, 0._r8 ) + @assertFalse( do_onset ) + this%soilt = SHR_CONST_TKFRZ + temp + this%onset_gdd = 0.0_r8 + this%onset_gddflag = 0._r8 + call this%calc_doonset( do_onset ) + @assertEqual( this%onset_gddflag, 1._r8 ) + @assertEqual( this%onset_gdd, temp*this%fracday ) + @assertFalse( do_onset ) + end subroutine check_onsetflag_spring + + @Test + subroutine check_crit_dayl_normal(this) + class(TestCNPhenology), intent(inout) :: this + integer :: p, g + real(r8) :: crit_daylat + + call CNPhenologySetNML( input_onset_thresh_depends_on_veg=.false., & + input_critical_daylight_method = critical_daylight_constant ) + g = bounds%begg + p = bounds%begp + crit_daylat = SeasonalCriticalDaylength( g, p ) + @assertEqual( 39200._r8, crit_daylat, tolerance=tol ) + end subroutine check_crit_dayl_normal + + @Test + subroutine check_crit_dayl_dependsonlat(this) + use GridcellType , only : grc + class(TestCNPhenology), intent(inout) :: this + integer :: p, g + real(r8) :: crit_daylat + + call CNPhenologySetNML( input_onset_thresh_depends_on_veg=.false., & + input_critical_daylight_method = critical_daylight_depends_on_lat ) + g = bounds%begg + p = bounds%begp + grc%latdeg(g) = 0.0_r8 + crit_daylat = SeasonalCriticalDaylength( g, p ) + @assertEqual( 39200._r8, crit_daylat, tolerance=tol ) + grc%latdeg(g) = 65.0_r8 + crit_daylat = SeasonalCriticalDaylength( g, p ) + @assertEqual( 54000._r8, crit_daylat, tolerance=tol ) + grc%latdeg(g) = 90.0_r8 + crit_daylat = SeasonalCriticalDaylength( g, p ) + @assertEqual( 72000._r8, crit_daylat, tolerance=tol ) + grc%latdeg(g) = 44.4_r8 + crit_daylat = SeasonalCriticalDaylength( g, p ) + @assertEqual( 39200._r8, crit_daylat, tolerance=tol ) + end subroutine check_crit_dayl_dependsonlat + + @Test + subroutine check_crit_dayl_dependsonveg(this) + use PatchType , only : patch + class(TestCNPhenology), intent(inout) :: this + integer :: p, g + real(r8) :: crit_daylat + + call CNPhenologySetNML( input_onset_thresh_depends_on_veg=.false., & + input_critical_daylight_method = critical_daylight_depends_on_veg ) + g = bounds%begg + p = bounds%begp + crit_daylat = SeasonalCriticalDaylength( g, p ) + @assertEqual( 54000._r8, crit_daylat, tolerance=tol ) + pftcon%season_decid_temperate = 1 + crit_daylat = SeasonalCriticalDaylength( g, p ) + @assertEqual( 39200._r8, crit_daylat, tolerance=tol ) + end subroutine check_crit_dayl_dependsonveg + + + @Test + subroutine check_crit_dayl_dependsonlatnveg(this) + use GridcellType , only : grc + class(TestCNPhenology), intent(inout) :: this + integer :: p, g, lat + real(r8) :: crit_daylat + integer, parameter :: nlats = 4 + real(r8) :: test_lats(nlats) = (/ 0._r8, 65._r8, 90._r8, 44._r8 /) + real(r8) :: expected(nlats) = (/ 39200._r8, 54000._r8, 72000._r8, 39200._r8 /) + + call CNPhenologySetNML( input_onset_thresh_depends_on_veg=.false., & + input_critical_daylight_method = critical_daylight_depends_on_latnveg ) + g = bounds%begg + p = bounds%begp + do lat = 1, nlats + grc%latdeg(g) = test_lats(lat) + crit_daylat = SeasonalCriticalDaylength( g, p ) + @assertEqual( expected(lat), crit_daylat, tolerance=tol ) + end do + pftcon%season_decid_temperate = 1 + do lat = 1, nlats + grc%latdeg(g) = test_lats(lat) + crit_daylat = SeasonalCriticalDaylength( g, p ) + @assertEqual( 39200._r8, crit_daylat, tolerance=tol ) + end do + end subroutine check_crit_dayl_dependsonlatnveg + + + +end module test_CNPhenology diff --git a/src/biogeophys/BalanceCheckMod.F90 b/src/biogeophys/BalanceCheckMod.F90 index 8c6378d731..508e118b66 100644 --- a/src/biogeophys/BalanceCheckMod.F90 +++ b/src/biogeophys/BalanceCheckMod.F90 @@ -8,13 +8,12 @@ module BalanceCheckMod #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type + use decompMod , only : bounds_type, get_global_index + use decompMod , only : subgrid_level_gridcell, subgrid_level_column, subgrid_level_patch use abortutils , only : endrun use clm_varctl , only : iulog use clm_varctl , only : use_fates_planthydro - use clm_varcon , only : namep, namec, nameg use clm_varpar , only : nlevsoi - use GetGlobalValuesMod , only : GetGlobalIndex use atm2lndType , only : atm2lnd_type use EnergyFluxType , only : energyflux_type use SolarAbsorbedType , only : solarabs_type @@ -477,6 +476,7 @@ subroutine BalanceCheck( bounds, & integer :: nstep ! time step number integer :: DAnstep ! time step number since last Data Assimilation (DA) integer :: indexp,indexc,indexl,indexg ! index of first found in search loop + integer :: global_index ! index in global index space real(r8) :: errh2o_grc(bounds%begg:bounds%endg) ! grid cell level water conservation error [mm H2O] real(r8) :: forc_rain_col(bounds%begc:bounds%endc) ! column level rain rate [mm/s] real(r8) :: forc_snow_col(bounds%begc:bounds%endc) ! column level snow rate [mm/s] @@ -647,10 +647,11 @@ subroutine BalanceCheck( bounds, & if (errh2o_max_val > h2o_warning_thresh) then indexc = maxloc( abs(errh2o_col(bounds%begc:bounds%endc)), 1 ) + bounds%begc - 1 + global_index = get_global_index(subgrid_index=indexc, subgrid_level=subgrid_level_column) write(iulog,*)'WARNING: column-level water balance error ',& ' nstep= ',nstep, & ' local indexc= ',indexc,& - ! ' global indexc= ',GetGlobalIndex(decomp_index=indexc, clmlevel=namec), & + ' global indexc= ',global_index, & ' errh2o= ',errh2o_col(indexc) if ((errh2o_max_val > error_thresh) .and. (DAnstep > skip_steps)) then @@ -684,7 +685,7 @@ subroutine BalanceCheck( bounds, & end if write(iulog,*)'CTSM is stopping' - call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=indexc, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) end if end if @@ -760,7 +761,7 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'qflx_glcice_dyn_water_flux = ',qflx_glcice_dyn_water_flux_grc(indexg)*dtime write(iulog,*)'CTSM is stopping' - call endrun(decomp_index=indexg, clmlevel=nameg, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=indexg, subgrid_level=subgrid_level_gridcell, msg=errmsg(sourcefile, __LINE__)) end if end if @@ -828,10 +829,11 @@ subroutine BalanceCheck( bounds, & if (errh2osno_max_val > h2o_warning_thresh) then indexc = maxloc( abs(errh2osno(bounds%begc:bounds%endc)), 1) + bounds%begc -1 + global_index = get_global_index(subgrid_index=indexc, subgrid_level=subgrid_level_column) write(iulog,*)'WARNING: snow balance error ' write(iulog,*)'nstep= ',nstep, & ' local indexc= ',indexc, & - ! ' global indexc= ',GetGlobalIndex(decomp_index=indexc, clmlevel=namec), & + ' global indexc= ',global_index, & ' col%itype= ',col%itype(indexc), & ' lun%itype= ',lun%itype(col%landunit(indexc)), & ' errh2osno= ',errh2osno(indexc) @@ -861,7 +863,7 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'qflx_snwcp_discarded_liq = ',qflx_snwcp_discarded_liq_col(indexc)*dtime write(iulog,*)'qflx_sl_top_soil = ',qflx_sl_top_soil(indexc)*dtime write(iulog,*)'CTSM is stopping' - call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=indexc, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) end if end if @@ -942,7 +944,7 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'forc_tot = ',forc_solad(indexg,1)+forc_solad(indexg,2) & +forc_solai(indexg,1)+forc_solai(indexg,2) write(iulog,*)'CTSM is stopping' - call endrun(decomp_index=indexp, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=indexp, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) end if end if @@ -959,7 +961,7 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'errlon = ',errlon(indexp) if (errlon_max_val > error_thresh ) then write(iulog,*)'CTSM is stopping because errlon > ', error_thresh, ' W/m2' - call endrun(decomp_index=indexp, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=indexp, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) end if end if @@ -996,7 +998,7 @@ subroutine BalanceCheck( bounds, & write(iulog,*)'ftii ftdd ftid = ' ,ftii(indexp,:), ftdd(indexp,:),ftid(indexp,:) write(iulog,*)'elai esai = ' ,elai(indexp), esai(indexp) write(iulog,*)'CTSM is stopping' - call endrun(decomp_index=indexp, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=indexp, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) end if end if @@ -1013,7 +1015,7 @@ subroutine BalanceCheck( bounds, & if ((errsoi_col_max_val > 1.e-4_r8) .and. (DAnstep > skip_steps)) then write(iulog,*)'CTSM is stopping' - call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=indexc, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) end if end if diff --git a/src/biogeophys/CMakeLists.txt b/src/biogeophys/CMakeLists.txt index 1bb52accc5..3cf5e0eaf0 100644 --- a/src/biogeophys/CMakeLists.txt +++ b/src/biogeophys/CMakeLists.txt @@ -24,7 +24,9 @@ list(APPEND clm_sources SoilStateType.F90 SoilWaterRetentionCurveMod.F90 SolarAbsorbedType.F90 + PhotosynthesisMod.F90 SurfaceAlbedoType.F90 + OzoneBaseMod.F90 TemperatureType.F90 TotalWaterAndHeatMod.F90 UrbanParamsType.F90 diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 4f7b424cd2..1d5298bac2 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -15,10 +15,9 @@ module CanopyFluxesMod use abortutils , only : endrun use clm_varctl , only : iulog, use_cn, use_lch4, use_c13, use_c14, use_cndv, use_fates, & use_luna, use_hydrstress, use_biomass_heat_storage - use clm_varpar , only : nlevgrnd, nlevsno, mxpft - use clm_varcon , only : namep + use clm_varpar , only : nlevgrnd, nlevsno, nlevcan, mxpft use pftconMod , only : pftcon - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_patch use ActiveLayerMod , only : active_layer_type use PhotosynthesisMod , only : Photosynthesis, PhotoSynthesisHydraulicStress, PhotosynthesisTotal, Fractionation use EDAccumulateFluxesMod , only : AccumulateFluxes_ED @@ -224,10 +223,10 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, ! ! !USES: use shr_const_mod , only : SHR_CONST_RGAS, shr_const_pi - use clm_time_manager , only : get_step_size_real, get_prev_date,is_end_curr_day + use clm_time_manager , only : get_step_size_real, get_prev_date, is_near_local_noon use clm_varcon , only : sb, cpair, hvap, vkc, grav, denice, c_to_b use clm_varcon , only : denh2o, tfrz, tlsai_crit, alpha_aero - use clm_varcon , only : c14ratio + use clm_varcon , only : c14ratio, spval use clm_varcon , only : c_water, c_dry_biomass, c_to_b use perf_mod , only : t_startf, t_stopf use QSatMod , only : QSat @@ -237,6 +236,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, swbgt, hmdex, dis_coi, dis_coiS, THIndex, & SwampCoolEff, KtoC, VaporPres use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type + use LunaMod , only : is_time_to_run_LUNA ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -280,7 +280,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, !added by K.Sakaguchi for stability formulation real(r8), parameter :: ria = 0.5_r8 ! free parameter for stable formulation (currently = 0.5, "gamma" in Sakaguchi&Zeng,2008) - real(r8) :: dtime ! land model time step (sec) real(r8) :: zldis(bounds%begp:bounds%endp) ! reference height "minus" zero displacement height [m] real(r8) :: wc ! convective velocity [m/s] @@ -324,6 +323,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, real(r8) :: qsatldT(bounds%begp:bounds%endp) ! derivative of "qsatl" on "t_veg" real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] + real(r8) :: gs ! canopy conductance for iwue cal [molH2O/m2ground/s] real(r8) :: air(bounds%begp:bounds%endp) ! atmos. radiation temporay set real(r8) :: bir(bounds%begp:bounds%endp) ! atmos. radiation temporay set real(r8) :: cir(bounds%begp:bounds%endp) ! atmos. radiation temporay set @@ -401,8 +401,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, integer :: ft ! plant functional type index real(r8) :: h2ocan ! total canopy water (mm H2O) real(r8) :: dt_veg_temp(bounds%begp:bounds%endp) - integer :: iv - logical :: is_end_day ! is end of current day + integer, parameter :: iv=1 ! index for first canopy layer (iwue calculation) real(r8) :: dbh(bounds%begp:bounds%endp) ! diameter at breast height of vegetation real(r8) :: cp_leaf(bounds%begp:bounds%endp) ! heat capacity of leaves real(r8) :: cp_stem(bounds%begp:bounds%endp) ! heat capacity of stems @@ -497,6 +496,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, swmp80_ref2m_r => humanindex_inst%swmp80_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Swamp Cooler temperature 80% effi (C) sabv => solarabs_inst%sabv_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by vegetation (W/m**2) + par_z_sun => solarabs_inst%parsun_z_patch , & ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2) frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow @@ -547,6 +547,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, qg_h2osfc => waterdiagnosticbulk_inst%qg_h2osfc_col , & ! Input: [real(r8) (:) ] specific humidity at h2osfc surface [kg/kg] qg => waterdiagnosticbulk_inst%qg_col , & ! Input: [real(r8) (:) ] specific humidity at ground surface [kg/kg] dqgdT => waterdiagnosticbulk_inst%dqgdT_col , & ! Input: [real(r8) (:) ] temperature derivative of "qg" + h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] by F. Li and S. Levis h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) @@ -558,6 +559,8 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, rh_ref2m_r => waterdiagnosticbulk_inst%rh_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface relative humidity (%) rh_ref2m => waterdiagnosticbulk_inst%rh_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface relative humidity (%) rhaf => waterdiagnosticbulk_inst%rh_af_patch , & ! Output: [real(r8) (:) ] fractional humidity of canopy air [dimensionless] + vpd_ref2m => waterdiagnosticbulk_inst%vpd_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface vapor pressure deficit (Pa) + iwue_ln => waterdiagnosticbulk_inst%iwue_ln_patch , & ! Output: [real(r8) (:) ] local noon ecosystem-scale inherent water use efficiency (gC kgH2O-1 hPa) qflx_tran_veg => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Output: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) qflx_evap_veg => waterfluxbulk_inst%qflx_evap_veg_patch , & ! Output: [real(r8) (:) ] vegetation evaporation (mm H2O/s) (+ = to atm) @@ -565,9 +568,11 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, qflx_ev_snow => waterfluxbulk_inst%qflx_ev_snow_patch , & ! Output: [real(r8) (:) ] evaporation flux from snow (mm H2O/s) [+ to atm] qflx_ev_soil => waterfluxbulk_inst%qflx_ev_soil_patch , & ! Output: [real(r8) (:) ] evaporation flux from soil (mm H2O/s) [+ to atm] qflx_ev_h2osfc => waterfluxbulk_inst%qflx_ev_h2osfc_patch , & ! Output: [real(r8) (:) ] evaporation flux from h2osfc (mm H2O/s) [+ to atm] - + gs_mol_sun => photosyns_inst%gs_mol_sun_patch , & ! Input: [real(r8) (:) ] patch sunlit leaf stomatal conductance (umol H2O/m**2/s) + gs_mol_sha => photosyns_inst%gs_mol_sha_patch , & ! Input: [real(r8) (:) ] patch shaded leaf stomatal conductance (umol H2O/m**2/s) rssun => photosyns_inst%rssun_patch , & ! Output: [real(r8) (:) ] leaf sunlit stomatal resistance (s/m) (output from Photosynthesis) rssha => photosyns_inst%rssha_patch , & ! Output: [real(r8) (:) ] leaf shaded stomatal resistance (s/m) (output from Photosynthesis) + fpsn => photosyns_inst%fpsn_patch , & ! Input: [real(r8) (:) ] photosynthesis (umol CO2 /m**2 /s) grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] @@ -616,7 +621,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, ! Determine step size dtime = get_step_size_real() - is_end_day = is_end_curr_day() ! Make a local copy of the exposedvegp filter. With the current implementation, ! this is needed because the filter is modified in the iteration loop. @@ -924,7 +928,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, if (found) then if ( .not. use_fates ) then write(iulog,*)'Error: Forcing height is below canopy height for patch index ' - call endrun(decomp_index=index, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) end if end if @@ -1453,6 +1457,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) rh_ref2m_r(p) = rh_ref2m(p) + ! 2m vapor pressure deficit + vpd_ref2m(p) = e_ref2m*(1._r8-rh_ref2m(p)/100._r8) + ! Human Heat Stress if ( all_human_stress_indices .or. fast_human_stress_indices ) then call KtoC(t_ref2m(p), tc_ref2m(p)) @@ -1551,6 +1558,29 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, call PhotosynthesisTotal(fn, filterp, & atm2lnd_inst, canopystate_inst, photosyns_inst) + ! Calculate water use efficiency + ! does not support multi-layer canopy + if (nlevcan == 1) then + do f = 1, fn + p = filterp(f) + c = patch%column(p) + g = patch%gridcell(p) + + if ( is_near_local_noon( grc%londeg(g), deltasec=3600 ) .and. fpsn(p)>0._r8 )then + gs = 1.e-6_r8*(laisun(p)*gs_mol_sun(p,iv)+laisha(p)*gs_mol_sha(p,iv)) ! 1e-6 converts umolH2O->molH2O + if ( gs>0._r8 ) then + iwue_ln(p) = fpsn(p)/gs + else + iwue_ln(p) = spval + end if + else + iwue_ln(p) = spval + end if + end do + else + call endrun(msg=' ERROR: IWUELN calculation not compatible with nlevcan>1 ' // & + errMsg(sourcefile, __LINE__)) + end if ! Calculate ozone uptake. This needs to be done after rssun and rsshade are ! computed by the Photosynthesis routine. The updated ozone uptake computed here ! will be used in the next time step to calculate ozone stress for the next time @@ -1578,7 +1608,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, surfalb_inst, solarabs_inst, & temperature_inst) - if(is_end_day)then + if(is_time_to_run_LUNA())then call Acc240_Climate_LUNA(bounds, fn, filterp, & o2(begp:endp), & @@ -1601,7 +1631,8 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, surfalb_inst, & solarabs_inst, & waterdiagnosticbulk_inst,& - frictionvel_inst) + frictionvel_inst, & + ozone_inst) call Clear24_Climate_LUNA(bounds, fn, filterp, & canopystate_inst, photosyns_inst, & diff --git a/src/biogeophys/CanopyHydrologyMod.F90 b/src/biogeophys/CanopyHydrologyMod.F90 index dc83b70466..9ce9995ce6 100644 --- a/src/biogeophys/CanopyHydrologyMod.F90 +++ b/src/biogeophys/CanopyHydrologyMod.F90 @@ -14,7 +14,7 @@ module CanopyHydrologyMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg use shr_sys_mod , only : shr_sys_flush - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_patch use abortutils , only : endrun use clm_time_manager, only : get_step_size_real use clm_varctl , only : iulog @@ -46,7 +46,9 @@ module CanopyHydrologyMod type, private :: params_type real(r8) :: liq_canopy_storage_scalar ! Canopy-storage-of-liquid-water parameter (kg/m2) - real(r8) :: snow_canopy_storage_scalar ! Canopy-storage-of-snow parameter (kg/m2) + real(r8) :: snow_canopy_storage_scalar ! Canopy-storage-of-snow parameter (kg/m2) + real(r8) :: snowcan_unload_temp_fact ! Temperature canopy snow unload scaling (C2 in Eq. 14, Roesch et al. 2001) (K*s) + real(r8) :: snowcan_unload_wind_fact ! Wind canopy snow unload scaling (modifies 1.56e5, where 1.56e5 is C3 in Eq. 15, Roesch et al. 2001) (-) end type params_type type(params_type), private :: params_inst ! @@ -156,6 +158,10 @@ subroutine readParams( ncid ) call readNcdioScalar(ncid, 'liq_canopy_storage_scalar', subname, params_inst%liq_canopy_storage_scalar) ! Canopy-storage-of-snow parameter (kg/m2) call readNcdioScalar(ncid, 'snow_canopy_storage_scalar', subname, params_inst%snow_canopy_storage_scalar) + ! Temperature canopy snow unload scaling (C2 in Eq. 14, Roesch et al. 2001) (K*s) + call readNcdioScalar(ncid, 'snowcan_unload_temp_fact', subname, params_inst%snowcan_unload_temp_fact) + ! Wind canopy snow unload scaling (modifies 1.56e5, where 1.56e5 is C3 in Eq. 15, Roesch et al. 2001) (-) + call readNcdioScalar(ncid, 'snowcan_unload_wind_fact', subname, params_inst%snowcan_unload_wind_fact) end subroutine readParams @@ -619,6 +625,7 @@ subroutine TracerFlux_CanopyInterceptionAndThroughfall(bounds, num_nolakep, filt ) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_patch, & lb = begp, & num_pts = num_nolakep, & filter_pts = filter_nolakep, & @@ -628,6 +635,7 @@ subroutine TracerFlux_CanopyInterceptionAndThroughfall(bounds, num_nolakep, filt tracer_val = trac_qflx_through_snow(begp:endp)) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_patch, & lb = begp, & num_pts = num_nolakep, & filter_pts = filter_nolakep, & @@ -637,6 +645,7 @@ subroutine TracerFlux_CanopyInterceptionAndThroughfall(bounds, num_nolakep, filt tracer_val = trac_qflx_intercepted_snow(begp:endp)) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_patch, & lb = begp, & num_pts = num_nolakep, & filter_pts = filter_nolakep, & @@ -646,6 +655,7 @@ subroutine TracerFlux_CanopyInterceptionAndThroughfall(bounds, num_nolakep, filt tracer_val = trac_qflx_through_liq(begp:endp)) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_patch, & lb = begp, & num_pts = num_nolakep, & filter_pts = filter_nolakep, & @@ -800,6 +810,7 @@ subroutine TracerFlux_CanopyExcess(bounds, num_soilp, filter_soilp, & ) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_patch, & lb = begp, & num_pts = num_soilp, & filter_pts = filter_soilp, & @@ -809,6 +820,7 @@ subroutine TracerFlux_CanopyExcess(bounds, num_soilp, filter_soilp, & tracer_val = trac_qflx_liqcanfall(begp:endp)) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_patch, & lb = begp, & num_pts = num_soilp, & filter_pts = filter_soilp, & @@ -904,8 +916,8 @@ subroutine BulkFlux_SnowUnloading(bounds, num_soilp, filter_soilp, dtime, patch, c = patch%column(p) g = patch%gridcell(p) - qflx_snotempunload(p) = max(0._r8,snocan(p)*(forc_t(c)-270.15_r8)/1.87e5_r8) - qflx_snowindunload(p) = 0.5_r8*snocan(p)*forc_wind(g)/1.56e5_r8 + qflx_snotempunload(p) = max(0._r8,snocan(p)*(forc_t(c)-270.15_r8)/params_inst%snowcan_unload_temp_fact) + qflx_snowindunload(p) = params_inst%snowcan_unload_wind_fact*snocan(p)*forc_wind(g)/1.56e5_r8 qflx_snow_unload(p) = min(qflx_snotempunload(p) + qflx_snowindunload(p), snocan(p)/dtime) else qflx_snotempunload(p) = 0._r8 @@ -951,6 +963,7 @@ subroutine TracerFlux_SnowUnloading(bounds, num_soilp, filter_soilp, & ) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_patch, & lb = begp, & num_pts = num_soilp, & filter_pts = filter_soilp, & diff --git a/src/biogeophys/CanopyStateType.F90 b/src/biogeophys/CanopyStateType.F90 index c5f1bc30f6..78f15b71c2 100644 --- a/src/biogeophys/CanopyStateType.F90 +++ b/src/biogeophys/CanopyStateType.F90 @@ -9,10 +9,10 @@ module CanopyStateType use decompMod , only : bounds_type use landunit_varcon , only : istsoil, istcrop use clm_varpar , only : nlevcan, nvegwcs - use clm_varcon , only : spval - use clm_varctl , only : iulog, use_cn, use_fates, use_hydrstress - use LandunitType , only : lun - use PatchType , only : patch + use clm_varcon , only : spval + use clm_varctl , only : iulog, use_cn, use_fates, use_fates_sp, use_hydrstress + use LandunitType , only : lun + use PatchType , only : patch ! implicit none save @@ -21,28 +21,33 @@ module CanopyStateType ! !PUBLIC TYPES: type, public :: CanopyState_type - integer , pointer :: frac_veg_nosno_patch (:) ! patch fraction of vegetation not covered by snow (0 OR 1) [-] - integer , pointer :: frac_veg_nosno_alb_patch (:) ! patch fraction of vegetation not covered by snow (0 OR 1) [-] + integer , pointer :: frac_veg_nosno_patch (:) ! patch fraction of vegetation not covered by snow (0 OR 1) [-] + integer , pointer :: frac_veg_nosno_alb_patch (:) ! patch fraction of vegetation not covered by snow (0 OR 1) [-] real(r8) , pointer :: tlai_patch (:) ! patch canopy one-sided leaf area index, no burying by snow real(r8) , pointer :: tsai_patch (:) ! patch canopy one-sided stem area index, no burying by snow real(r8) , pointer :: elai_patch (:) ! patch canopy one-sided leaf area index with burying by snow real(r8) , pointer :: esai_patch (:) ! patch canopy one-sided stem area index with burying by snow - real(r8) , pointer :: elai240_patch (:) ! patch canopy one-sided leaf area index with burying by snow average over 10days - real(r8) , pointer :: laisun_patch (:) ! patch patch sunlit projected leaf area index - real(r8) , pointer :: laisha_patch (:) ! patch patch shaded projected leaf area index - real(r8) , pointer :: laisun_z_patch (:,:) ! patch patch sunlit leaf area for canopy layer - real(r8) , pointer :: laisha_z_patch (:,:) ! patch patch shaded leaf area for canopy layer + + real(r8) , pointer :: tlai_hist_patch (:) ! patch canopy one-sided leaf area index, for SP mode + real(r8) , pointer :: tsai_hist_patch (:) ! patch canopy one-sided stem area index, for SP mode + real(r8) , pointer :: htop_hist_patch (:) ! patch canopy height, for SP mode + + real(r8) , pointer :: elai240_patch (:) ! patch canopy one-sided leaf area index with burying by snow average over 10days + real(r8) , pointer :: laisun_patch (:) ! patch patch sunlit projected leaf area index + real(r8) , pointer :: laisha_patch (:) ! patch patch shaded projected leaf area index + real(r8) , pointer :: laisun_z_patch (:,:) ! patch patch sunlit leaf area for canopy layer + real(r8) , pointer :: laisha_z_patch (:,:) ! patch patch shaded leaf area for canopy layer real(r8) , pointer :: mlaidiff_patch (:) ! patch difference between lai month one and month two (for dry deposition of chemical tracers) - real(r8) , pointer :: annlai_patch (:,:) ! patch 12 months of monthly lai from input data set (for dry deposition of chemical tracers) + real(r8) , pointer :: annlai_patch (:,:) ! patch 12 months of monthly lai from input data set (for dry deposition of chemical tracers) real(r8) , pointer :: stem_biomass_patch (:) ! Aboveground stem biomass (kg/m**2) real(r8) , pointer :: leaf_biomass_patch (:) ! Aboveground leaf biomass (kg/m**2) real(r8) , pointer :: htop_patch (:) ! patch canopy top (m) real(r8) , pointer :: hbot_patch (:) ! patch canopy bottom (m) real(r8) , pointer :: z0m_patch (:) ! patch momentum roughness length (m) real(r8) , pointer :: displa_patch (:) ! patch displacement height (m) - real(r8) , pointer :: fsun_patch (:) ! patch sunlit fraction of canopy - real(r8) , pointer :: fsun24_patch (:) ! patch 24hr average of sunlit fraction of canopy + real(r8) , pointer :: fsun_patch (:) ! patch sunlit fraction of canopy + real(r8) , pointer :: fsun24_patch (:) ! patch 24hr average of sunlit fraction of canopy real(r8) , pointer :: fsun240_patch (:) ! patch 240hr average of sunlit fraction of canopy real(r8) , pointer :: dleaf_patch (:) ! patch characteristic leaf width (diameter) [m] @@ -57,15 +62,15 @@ module CanopyStateType contains - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold + procedure, public :: Init + procedure, private :: InitAllocate + procedure, private :: InitHistory + procedure, private :: InitCold procedure, public :: ReadNML procedure, public :: InitAccBuffer procedure, public :: InitAccVars procedure, public :: UpdateAccVars - procedure, public :: Restart + procedure, public :: Restart end type CanopyState_type @@ -73,13 +78,13 @@ module CanopyStateType __FILE__ !------------------------------------------------------------------------ -contains +contains !------------------------------------------------------------------------ subroutine Init(this, bounds) class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds call this%InitAllocate(bounds) call this%InitHistory(bounds) @@ -98,7 +103,7 @@ subroutine InitAllocate(this, bounds) ! ! !ARGUMENTS: class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: begp, endp @@ -112,6 +117,9 @@ subroutine InitAllocate(this, bounds) allocate(this%frac_veg_nosno_patch (begp:endp)) ; this%frac_veg_nosno_patch (:) = huge(1) allocate(this%frac_veg_nosno_alb_patch (begp:endp)) ; this%frac_veg_nosno_alb_patch (:) = 0 + allocate(this%tlai_hist_patch (begp:endp)) ; this%tlai_hist_patch (:) = nan + allocate(this%tsai_hist_patch (begp:endp)) ; this%tsai_hist_patch (:) = nan + allocate(this%htop_hist_patch (begp:endp)) ; this%htop_hist_patch (:) = nan allocate(this%tlai_patch (begp:endp)) ; this%tlai_patch (:) = nan allocate(this%tsai_patch (begp:endp)) ; this%tsai_patch (:) = nan allocate(this%elai_patch (begp:endp)) ; this%elai_patch (:) = nan @@ -135,7 +143,7 @@ subroutine InitAllocate(this, bounds) allocate(this%dleaf_patch (begp:endp)) ; this%dleaf_patch (:) = nan allocate(this%rscanopy_patch (begp:endp)) ; this%rscanopy_patch (:) = nan -! allocate(this%gccanopy_patch (begp:endp)) ; this%gccanopy_patch (:) = 0.0_r8 +! allocate(this%gccanopy_patch (begp:endp)) ; this%gccanopy_patch (:) = 0.0_r8 allocate(this%vegwp_patch (begp:endp,1:nvegwcs)) ; this%vegwp_patch (:,:) = nan allocate(this%vegwp_ln_patch (begp:endp,1:nvegwcs)) ; this%vegwp_ln_patch (:,:) = nan allocate(this%vegwp_pd_patch (begp:endp,1:nvegwcs)) ; this%vegwp_pd_patch (:,:) = nan @@ -149,7 +157,7 @@ subroutine InitHistory(this, bounds) ! ! !ARGUMENTS: class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: begc, endc @@ -170,16 +178,6 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='exposed one-sided stem area index', & ptr_patch=this%esai_patch) - this%tlai_patch(begp:endp) = spval - call hist_addfld1d (fname='TLAI', units='m^2/m^2', & - avgflag='A', long_name='total projected leaf area index', & - ptr_patch=this%tlai_patch) - - this%tsai_patch(begp:endp) = spval - call hist_addfld1d (fname='TSAI', units='m^2/m^2', & - avgflag='A', long_name='total projected stem area index', & - ptr_patch=this%tsai_patch) - this%laisun_patch(begp:endp) = spval call hist_addfld1d (fname='LAISUN', units='m^2/m^2', & avgflag='A', long_name='sunlit projected leaf area index', & @@ -206,11 +204,6 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='sunlit fraction of canopy', & ptr_patch=this%fsun_patch, default='inactive') - this%htop_patch(begp:endp) = spval - call hist_addfld1d (fname='HTOP', units='m', & - avgflag='A', long_name='canopy top', & - ptr_patch=this%htop_patch) - this%hbot_patch(begp:endp) = spval call hist_addfld1d (fname='HBOT', units='m', & avgflag='A', long_name='canopy bottom', & @@ -220,12 +213,50 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='DISPLA', units='m', & avgflag='A', long_name='displacement height', & ptr_patch=this%displa_patch, default='inactive') - end if - this%z0m_patch(begp:endp) = spval - call hist_addfld1d (fname='Z0M', units='m', & - avgflag='A', long_name='momentum roughness length', & - ptr_patch=this%z0m_patch, default='inactive') + if(use_fates_sp)then + this%htop_hist_patch(begp:endp) = spval + call hist_addfld1d (fname='HTOP', units='m', & + avgflag='A', long_name='HTOP weights for SP mode', & + ptr_patch=this%htop_hist_patch) + else + this%htop_patch(begp:endp) = spval + call hist_addfld1d (fname='HTOP', units='m', & + avgflag='A', long_name='canopy top', & + ptr_patch=this%htop_patch) + endif + + + endif !fates or CN + + if(use_fates_sp)then + this%tlai_hist_patch(begp:endp) = spval + call hist_addfld1d (fname='TLAI', units='m', & + avgflag='A', long_name='TLAI weights for SP mode', & + ptr_patch=this%tlai_hist_patch) + + this%tsai_hist_patch(begp:endp) = spval + call hist_addfld1d (fname='TSAI', units='m', & + avgflag='A', long_name='TSAI weights for SP mode', & + ptr_patch=this%tsai_hist_patch) + + else + this%tlai_patch(begp:endp) = spval + call hist_addfld1d (fname='TLAI', units='m^2/m^2', & + avgflag='A', long_name='total projected leaf area index', & + ptr_patch=this%tlai_patch) + + this%tsai_patch(begp:endp) = spval + call hist_addfld1d (fname='TSAI', units='m^2/m^2', & + avgflag='A', long_name='total projected stem area index', & + ptr_patch=this%tsai_patch) + + endif !FATES_SP + + this%z0m_patch(begp:endp) = spval + call hist_addfld1d (fname='Z0M', units='m', & + avgflag='A', long_name='momentum roughness length', & + ptr_patch=this%z0m_patch, default='inactive') ! Accumulated fields this%fsun24_patch(begp:endp) = spval @@ -253,7 +284,7 @@ subroutine InitHistory(this, bounds) ! call hist_addfld1d (fname='GCCANOPY', units='none', & ! avgflag='A', long_name='Canopy Conductance: mmol m-2 s-1', & -! ptr_patch=this%GCcanopy_patch, set_lake=0._r8, set_urb=0._r8) +! ptr_patch=this%GCcanopy_patch, set_lake=0._r8, set_urb=0._r8) if ( use_hydrstress ) then this%vegwp_patch(begp:endp,:) = spval @@ -280,12 +311,12 @@ subroutine InitAccBuffer (this, bounds) ! This routine set defaults values that are then overwritten by the ! restart file for restart or branch runs ! - ! !USES + ! !USES use accumulMod , only : init_accum_field ! ! !ARGUMENTS: class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds !--------------------------------------------------------------------- this%fsun24_patch(bounds%begp:bounds%endp) = spval @@ -311,16 +342,16 @@ subroutine InitAccVars(this, bounds) ! !DESCRIPTION: ! Initialize module variables that are associated with ! time accumulated fields. This routine is called for both an initial run - ! and a restart run (and must therefore must be called after the restart file + ! and a restart run (and must therefore must be called after the restart file ! is read in and the accumulation buffer is obtained) ! - ! !USES + ! !USES use accumulMod , only : extract_accum_field use clm_time_manager , only : get_nstep ! ! !ARGUMENTS: class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: begp, endp @@ -362,7 +393,7 @@ end subroutine InitAccVars subroutine ReadNML( this, NLFilename ) ! ! Read in canopy parameter namelist - ! + ! ! USES: use shr_mpi_mod , only : shr_mpi_bcast use abortutils , only : endrun @@ -423,7 +454,7 @@ subroutine UpdateAccVars (this, bounds) ! ! !ARGUMENTS: class(canopystate_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: g,p ! indices @@ -446,7 +477,7 @@ subroutine UpdateAccVars (this, bounds) call endrun(msg=errMsg(sourcefile, __LINE__)) endif - ! Accumulate and extract fsun24 & fsun240 + ! Accumulate and extract fsun24 & fsun240 do p = begp,endp rbufslp(p) = this%fsun_patch(p) end do @@ -471,10 +502,10 @@ subroutine InitCold(this, bounds) ! ! !ARGUMENTS: class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: - integer :: p,l,c,g + integer :: p,l,c,g !----------------------------------------------------------------------- do p = bounds%begp, bounds%endp @@ -495,6 +526,10 @@ subroutine InitCold(this, bounds) this%laisha_patch(p) = 0._r8 end if + this%tlai_hist_patch(p) = 0._r8 + this%tsai_hist_patch(p) = 0._r8 + this%htop_hist_patch(p) = 0._r8 + ! needs to be initialized to spval to avoid problems when averaging for the accum ! field this%fsun_patch(p) = spval @@ -504,14 +539,14 @@ end subroutine InitCold !------------------------------------------------------------------------ subroutine Restart(this, bounds, ncid, flag) - ! + ! ! !USES: use ncdio_pio , only : file_desc_t, ncd_double, ncd_int use restUtilMod ! ! !ARGUMENTS: class(canopystate_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds type(file_desc_t) , intent(inout) :: ncid ! netcdf id character(len=*) , intent(in) :: flag ! 'read' or 'write' ! @@ -538,11 +573,11 @@ subroutine Restart(this, bounds, ncid, flag) call restartvar(ncid=ncid, flag=flag, varname='elai', xtype=ncd_double, & dim1name='pft', long_name='one-sided leaf area index, with burying by snow', units='', & interpinic_flag='interp', readvar=readvar, data=this%elai_patch) - + call restartvar(ncid=ncid, flag=flag, varname='esai', xtype=ncd_double, & dim1name='pft', long_name='one-sided stem area index, with burying by snow', units='', & interpinic_flag='interp', readvar=readvar, data=this%esai_patch) - + call restartvar(ncid=ncid, flag=flag, varname='stem_biomass', xtype=ncd_double, & dim1name='pft', long_name='stem biomass', units='kg/m^2', & interpinic_flag='interp', readvar=readvar, data=this%stem_biomass_patch) @@ -582,7 +617,7 @@ subroutine Restart(this, bounds, ncid, flag) dim1name='pft', dim2name='vegwcs', switchdim=.true., & long_name='vegetation water matric potential', units='mm', & scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=this%vegwp_patch) + interpinic_flag='interp', readvar=readvar, data=this%vegwp_patch) call restartvar(ncid=ncid, flag=flag, varname='VEGWPLN', xtype=ncd_double, & dim1name='pft', dim2name='vegwcs', switchdim=.false., & diff --git a/src/biogeophys/FrictionVelocityMod.F90 b/src/biogeophys/FrictionVelocityMod.F90 index 6a9bb137c5..942da337cc 100644 --- a/src/biogeophys/FrictionVelocityMod.F90 +++ b/src/biogeophys/FrictionVelocityMod.F90 @@ -234,8 +234,8 @@ subroutine InitHistory(this, bounds) if (use_cn) then this%fv_patch(begp:endp) = spval call hist_addfld1d (fname='FV', units='m/s', & - avgflag='A', long_name='friction velocity for dust model', & - ptr_patch=this%fv_patch, default='inactive') + avgflag='A', long_name='friction velocity', & + ptr_patch=this%fv_patch) end if call hist_addfld1d (fname='RAH1', units='s/m', & diff --git a/src/biogeophys/HumanIndexMod.F90 b/src/biogeophys/HumanIndexMod.F90 index a231c0919d..9c3bc319e8 100644 --- a/src/biogeophys/HumanIndexMod.F90 +++ b/src/biogeophys/HumanIndexMod.F90 @@ -125,12 +125,14 @@ module HumanIndexMod ! Modified 03-21-14--- Changed Specific Humidity to Mixing ! Ratio. ! Modified 04-08-16--- Added new convergence routine for -! Wet_Bulb. CLM4.5 Inputs at 50C 100% RH cause NaN. -! Davies-Jones is not calibrated for Tw above 40C. -! Modification makes all moisture calculations -! internal to Wet_Bulb. External input of RH used, -! Not external Q due to differences in QSat_2 and -! QSatMod at high RH and T>45C. +! Wet_Bulb. CLM4.5 Inputs at 50C 100% RH cause NaN. +! Davies-Jones is not calibrated for Tw above 40C. +! Modification makes all moisture calculations +! internal to Wet_Bulb. External input of RH used, +! Not external Q due to differences in QSat_2 and +! QSatMod at high RH and T>45C. +! Modified JRBuzan 12-29-20--- Qinqin Kong discovered an error in +! QSat_2Mod. The derivative of F(Tw;pi) = F(Tw;pi) * dlnF(Tw;pi)/dTw. !EOP !----------------------------------------------------------------------- @@ -807,12 +809,12 @@ subroutine Wet_Bulb (Tin_1,vape,pin,relhum,qin,Teq,epott,wb_it) ! Modified JRBuzan 03-21-14: Minor Revision. Changed specific humidity to mixing ! ratio. ! Modified JRBuzan 04-08-16: Added new convergence routine for -! Wet_Bulb. CLM4.5 Inputs at 50C 100% RH cause NaN. -! Davies-Jones is not calibrated for Tw above 40C. -! Modification makes all moisture calculations -! internal to Wet_Bulb. External input of RH used, -! Not external Q due to differences in QSat_2 and -! QSatMod at high RH and T>45C. +! Wet_Bulb. CLM4.5 Inputs at 50C 100% RH cause NaN. Davies-Jones is not +! calibrated for Tw above 40C. Modification makes all moisture calculations +! internal to Wet_Bulb. External input of RH used, not external Q due to +! differences in QSat_2 and QSatMod at high RH and T>45C. +! Modified JRBuzan 12-29-20--- Qinqin Kong discovered an error in +! QSat_2Mod. The derivative of F(Tw;pi) = F(Tw;pi) * dlnF(Tw;pi)/dTw. ! ! !USES: use shr_kind_mod , only: r8 => shr_kind_r8 @@ -955,7 +957,7 @@ subroutine Wet_Bulb (Tin_1,vape,pin,relhum,qin,Teq,epott,wb_it) do while ( converged .eq. 0 .and. iter < max_iter) iter = iter + 1 - if ( wb_temp > 100._r8 ) exit + if ( wb_temp > 50._r8 ) exit call QSat_2(wb_temp+C, pin, es_mb_wb_temp, de_mbdwb_temp, dlnes_mbdwb_temp, & rs_wb_temp, rsdwb_temp, foftk_wb_temp, fdwb_temp) wb_temp_new = wb_temp - ((foftk_wb_temp - X)/fdwb_temp) @@ -1366,7 +1368,9 @@ subroutine QSat_2 (T_k, p_t, es_mb, de_mbdT, dlnes_mbdT, rs, rsdT, foftk, fdT) ! Calculations for used to calculate f(T,ndimpress) foftk = ((Cf/T_k)**lambd_a)*(1._r8 - es_mb/p0ndplam)**(vkp*lambd_a)* & exp(-lambd_a*goftk) - fdT = -lambd_a*(1._r8/T_k + vkp*de_mbdT/pminuse + gdT) + ! 12-29-20 Correct derivative error found by Qinqin Kong. Original was dlnf/dTw. + ! Now f(Tw) * dlnf/dTw. + fdT = -lambd_a*(1._r8/T_k + vkp*de_mbdT/pminuse + gdT) * foftk d2fdT2 = lambd_a*(1._r8/(T_k*T_k) - vkp*de_mbdT*de_mbdT/(pminuse*pminuse) - & vkp*d2e_mbdT2/pminuse - d2gdT2) diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 279e15f0df..8f294c652e 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -554,10 +554,10 @@ subroutine HydrologyNoDrainage(bounds, & ! t_grnd is weighted average of exposed soil and snow if (snl(c) < 0) then t_grnd(c) = frac_sno_eff(c) * t_soisno(c,snl(c)+1) & - + (1 - frac_sno_eff(c)- frac_h2osfc(c)) * t_soisno(c,1) & + + (1.0_r8 - frac_sno_eff(c)- frac_h2osfc(c)) * t_soisno(c,1) & + frac_h2osfc(c) * t_h2osfc(c) else - t_grnd(c) = (1 - frac_h2osfc(c)) * t_soisno(c,1) + frac_h2osfc(c) * t_h2osfc(c) + t_grnd(c) = (1.0_r8 - frac_h2osfc(c)) * t_soisno(c,1) + frac_h2osfc(c) * t_h2osfc(c) endif if (lun%urbpoi(l)) then diff --git a/src/biogeophys/IrrigationMod.F90 b/src/biogeophys/IrrigationMod.F90 index 0c6573bfb5..27cf050dd3 100644 --- a/src/biogeophys/IrrigationMod.F90 +++ b/src/biogeophys/IrrigationMod.F90 @@ -73,12 +73,13 @@ module IrrigationMod #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type, get_proc_global + use decompMod , only : subgrid_level_gridcell, subgrid_level_column, subgrid_level_patch use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun use clm_instur , only : irrig_method use pftconMod , only : pftcon use clm_varctl , only : iulog - use clm_varcon , only : isecspday, denh2o, spval, ispval, namep, namec, nameg + use clm_varcon , only : isecspday, denh2o, spval, ispval use clm_varpar , only : nlevsoi, nlevgrnd use clm_time_manager , only : get_step_size use SoilHydrologyMod , only : CalcIrrigWithdrawals @@ -761,7 +762,7 @@ subroutine SetIrrigMethod(this, bounds) this%irrig_method_patch(p) = this%params%irrig_method_default else if (irrig_method(g,m) /= irrig_method_drip .and. irrig_method(g,m) /= irrig_method_sprinkler) then write(iulog,*) subname //' invalid irrigation method specified' - call endrun(decomp_index=g, clmlevel=nameg, msg='bad irrig_method '// & + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, msg='bad irrig_method '// & errMsg(sourcefile, __LINE__)) end if else @@ -1120,6 +1121,7 @@ subroutine CalcOneTracerWithdrawals(this, bounds, num_soilc, filter_soilc, & if (this%params%use_groundwater_irrigation) then call CalcTracerFromBulk( & + subgrid_level = subgrid_level_column, & lb = begc, & num_pts = num_soilc, & filter_pts = filter_soilc, & @@ -1129,6 +1131,7 @@ subroutine CalcOneTracerWithdrawals(this, bounds, num_soilc, filter_soilc, & tracer_val = waterflux_tracer_inst%qflx_gw_con_irrig_col(begc:endc)) do j = 1, nlevsoi call CalcTracerFromBulk( & + subgrid_level = subgrid_level_column, & lb = begc, & num_pts = num_soilc, & filter_pts = filter_soilc, & @@ -1262,7 +1265,7 @@ subroutine CalcApplicationFluxes(this, bounds, num_soilc, filter_soilc, num_soil write(iulog,*) 'qflx_sfc_irrig_bulk_patch = ', qflx_sfc_irrig_bulk_patch(p) write(iulog,*) 'waterflux_inst%qflx_sfc_irrig_col = ', & waterflux_inst%qflx_sfc_irrig_col(c) - call endrun(decomp_index=p, clmlevel=namep, & + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, & msg = 'If qflx_sfc_irrig_bulk_col <= 0, ' // & 'expect qflx_sfc_irrig_bulk_patch = waterflux_inst%qflx_sfc_irrig_col = 0', & additional_msg = errMsg(sourcefile, __LINE__)) @@ -1295,7 +1298,7 @@ subroutine CalcApplicationFluxes(this, bounds, num_soilc, filter_soilc, num_soil write(iulog,*) 'qflx_gw_demand_bulk_col = ', qflx_gw_demand_bulk_col(c) write(iulog,*) 'qflx_gw_demand_bulk_patch = ', qflx_gw_demand_bulk_patch(p) write(iulog,*) 'qflx_gw_irrig_withdrawn_col = ', qflx_gw_irrig_withdrawn_col(c) - call endrun(decomp_index=p, clmlevel=namep, & + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, & msg = 'If qflx_gw_demand_bulk_col <= 0, expect qflx_gw_demand_bulk_patch = qflx_gw_irrig_withdrawn_col = 0', & additional_msg = errMsg(sourcefile, __LINE__)) end if @@ -1314,7 +1317,8 @@ subroutine CalcApplicationFluxes(this, bounds, num_soilc, filter_soilc, num_soil else if(this%irrig_method_patch(p) == irrig_method_sprinkler) then waterflux_inst%qflx_irrig_sprinkler_patch(p) = qflx_irrig_tot else - call endrun(msg=' ERROR: irrig_method_patch set to invalid value ' // & + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, & + msg=' ERROR: irrig_method_patch set to invalid value ' // & errMsg(sourcefile, __LINE__)) endif @@ -1547,7 +1551,7 @@ subroutine CalcIrrigationNeeded(this, bounds, num_exposedvegp, filter_exposedveg write(iulog,*) subname//' ERROR: deficit < 0' write(iulog,*) 'This implies that irrigation target is less than irrigatio& &n threshold, which should never happen' - call endrun(decomp_index=c, clmlevel=namec, msg='deficit < 0 '// & + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg='deficit < 0 '// & errMsg(sourcefile, __LINE__)) end if else diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 604b2b5709..dbd39daedf 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -12,9 +12,8 @@ module LunaMod use clm_varcon , only : rgas, tfrz,spval use abortutils , only : endrun use clm_varctl , only : iulog - use clm_varcon , only : namep use clm_varpar , only : nlevcan - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_patch use pftconMod , only : pftcon use FrictionvelocityMod , only : frictionvel_type use atm2lndType , only : atm2lnd_type @@ -31,7 +30,7 @@ module LunaMod implicit none save - + !------------------------------------------------------------------------------ ! PUBLIC MEMBER FUNCTIONS: public :: LunaReadNML !subroutine to read in the Luna namelist @@ -40,6 +39,7 @@ module LunaMod public :: Acc240_Climate_LUNA !subroutine to accumulate 10 day climates public :: Clear24_Climate_LUNA !subroutine to clear 24 hr climates public :: readParams ! Read in parameters on parameter file + public :: is_time_to_run_LUNA !check if we should we run luna type, private :: params_type ! cp25, kc25, ko25: Bernacchi et al (2001) Plant, Cell & Environment 24:253-259 @@ -190,11 +190,34 @@ subroutine readParams( ncid ) end subroutine readParams + !----------------------------------------------------------------------- + function is_time_to_run_LUNA() result(run_luna) + ! + ! !DESCRIPTION: + ! A logical check to see if we are on the end of our current day and + ! if it is time to run the LUNA module + ! + ! !USES + use clm_time_manager , only : is_end_curr_day + ! + ! !ARGUMENTS + logical :: run_luna + + if (is_end_curr_day()) then + run_luna = .true. + else + run_luna = .false. + end if + + end function is_time_to_run_LUNA + + + !********************************************************************************************************************************************************************** ! this subroutine updates the photosynthetic capacity as determined by Vcmax25 and Jmax25 subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & dayl_factor, atm2lnd_inst, temperature_inst, canopystate_inst, photosyns_inst, & - surfalb_inst, solarabs_inst, waterdiagnosticbulk_inst, frictionvel_inst) + surfalb_inst, solarabs_inst, waterdiagnosticbulk_inst, frictionvel_inst, ozone_inst) ! ! !DESCRIPTION: ! Calculates Nitrogen fractionation within the leaf, based on optimum calculated fractions in rubisco, cholorophyll, @@ -209,13 +232,14 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & ! subroutine CanopyFluxes ! !USES: - use clm_time_manager , only : get_step_size_real, is_end_curr_day + use clm_time_manager , only : get_step_size_real use clm_varpar , only : nlevsoi, mxpft use perf_mod , only : t_startf, t_stopf use clm_varctl , only : use_cn use quadraticMod , only : quadratic use CNSharedParamsMod , only : CNParamsShareInst use shr_infnan_mod, only : isnan => shr_infnan_isnan + use OzoneBaseMod, only : ozone_base_type implicit none @@ -234,7 +258,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & type(solarabs_type) , intent(inout) :: solarabs_inst type(waterdiagnosticbulk_type) , intent(inout) :: waterdiagnosticbulk_inst type(frictionvel_type) , intent(inout) :: frictionvel_inst - + class(ozone_base_type) , intent(in) :: ozone_inst ! !LOCAL VARIABLES: ! @@ -285,7 +309,6 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & real (r8) :: jmx25_opt ! optimal Jmax25 (umol electron/m**2/s) real (r8) :: chg ! change in Vcmax25 or Jmax25 real (r8) :: chg_constrn ! constrained change in Vcmax25 or Jmax25 - logical :: is_end_day ! is end of current day !------------------------------------------------------------------------------------------------------------------------------------------------- associate( & c3psn => pftcon%c3psn , & ! photosynthetic pathway: 0. = c4, 1. = c3 @@ -321,15 +344,14 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & pnlc_z => photosyns_inst%pnlc_z_patch , & ! Output: [real(r8) (:,:) ] patch proportion of leaf nitrogen allocated for light capture for canopy layer enzs_z => photosyns_inst%enzs_z_patch , & ! Output: [real(r8) (:,:) ] enzyme decay status 1.0-fully active; 0-all decayed during stress vcmx25_z_last_valid_patch => photosyns_inst%vcmx25_z_last_valid_patch , & ! Output: [real(r8) (:,:) ] patch leaf Vc,max25 from end of the growing season for the previous year - jmx25_z_last_valid_patch => photosyns_inst%jmx25_z_last_valid_patch & ! Output: [real(r8) (:,:) ] patch leaf Jmax25 from the end of the growing season for the previous year - ) + jmx25_z_last_valid_patch => photosyns_inst%jmx25_z_last_valid_patch , & ! Output: [real(r8) (:,:) ] patch leaf Jmax25 from the end of the growing season for the previous year + o3coefjmax => ozone_inst%o3coefjmaxsun_patch & ! Input: [real(r8) (:)] ozone coef jmax sun + ) !---------------------------------------------------------------------------------------------------------------------------------------------------------- !set timestep - !Initialize enzyme decay Q10 + !Initialize enzyme decay Q10 dtime = get_step_size_real() - - is_end_day = is_end_curr_day() fnps = 0.15_r8 call t_startf('LUNA') do f = 1,fn @@ -417,7 +439,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & PNcbold = 0.0_r8 call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, & tair10, tleafd10, tleafn10, & - Jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), & + Jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), o3coefjmax(p), & PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) vcmx25_opt= PNcbopt * FNCa * Fc25 jmx25_opt= PNetopt * FNCa * Fj25 @@ -446,7 +468,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & p, 'z=', z, "pft=", ft write(iulog, *) 'LUNA env:',FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, & hourpd, tair10, tleafd10, tleafn10 - call endrun(msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) endif if(vcmx25_z(p, z)>1000._r8 .or. vcmx25_z(p, z)<0._r8)then write(iulog, *) 'Warning: Vc,mx25 become unrealistic (>1000 or negative) for patch=', & @@ -460,7 +482,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & p, 'z=', z, "pft=", ft write(iulog, *) 'LUNA env:', FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, & hourpd, tair10, tleafd10, tleafn10 - call endrun(msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) endif if(jmx25_z(p, z)>2000._r8 .or. jmx25_z(p, z)<0._r8)then write(iulog, *) 'Warning: Jmx25 become unrealistic (>2000, or negative) for patch=', & @@ -517,7 +539,7 @@ subroutine Acc240_Climate_LUNA(bounds, fn, filterp, oair, cair, & ! subroutine CanopyFluxes ! !USES: - use clm_time_manager , only : get_step_size_real, is_end_curr_day + use clm_time_manager , only : get_step_size_real implicit none ! !ARGUMENTS: @@ -549,7 +571,6 @@ subroutine Acc240_Climate_LUNA(bounds, fn, filterp, oair, cair, & real (r8) :: t_veg_dayi ! daytime mean vegetation temperature (Kelvin) real (r8) :: t_veg_nighti ! nighttime mean vegetation temperature (Kelvin) real (r8) :: par24d_z_i(1:nlevcan) ! daytime mean radiation (w/m**2) - logical :: is_end_day ! is end of current day !------------------------------------------------------------------------------------------------------------------------------------------------- associate( & par24d_z => solarabs_inst%par24d_z_patch , & ! Input: [real(r8) (:,:) ] daily accumulated absorbed PAR for leaves in canopy layer (W/m**2) @@ -572,7 +593,6 @@ subroutine Acc240_Climate_LUNA(bounds, fn, filterp, oair, cair, & !Initialize enzyme decay Q10 dtime = get_step_size_real() - is_end_day = is_end_curr_day() do f = 1,fn p = filterp(f) ft = patch%itype(p) @@ -744,7 +764,7 @@ subroutine Clear24_Climate_LUNA(bounds, fn, filterp, canopystate_inst, photosyns ! subroutine CanopyFluxes ! !USES: - use clm_time_manager , only : get_step_size_real, is_end_curr_day + use clm_time_manager , only : get_step_size_real implicit none ! !ARGUMENTS: @@ -767,7 +787,6 @@ subroutine Clear24_Climate_LUNA(bounds, fn, filterp, canopystate_inst, photosyns integer :: ft ! plant functional type integer :: z ! the index across leaf layers real (r8) :: dtime ! stepsize in seconds - logical :: is_end_day ! is end of current day !------------------------------------------------------------------------------------------------------------------------------------------------- associate( & par24d_z => solarabs_inst%par24d_z_patch , & ! Output: [real(r8) (:,:) ] daily accumulated absorbed PAR for leaves in canopy layer (W/m**2) @@ -783,7 +802,6 @@ subroutine Clear24_Climate_LUNA(bounds, fn, filterp, canopystate_inst, photosyns !Initialize enzyme decay Q10 dtime = get_step_size_real() - is_end_day = is_end_curr_day() do f = 1,fn p = filterp(f) ft = patch%itype(p) @@ -807,7 +825,7 @@ end subroutine Clear24_Climate_LUNA !************************************************************************************************************************************************ !Use the LUNA model to calculate the Nitrogen partioning subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PARimx10,rb10, hourpd, tair10, tleafd10, tleafn10, & - Jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor, & + Jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor,o3coefjmax, & PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) implicit none real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) @@ -828,6 +846,8 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR real(r8), intent (in) :: PNrespold !old value of the proportion of nitrogen allocated to respiration (unitless) real(r8), intent (in) :: PNcbold !old value of the proportion of nitrogen allocated to carboxylation (unitless) real(r8), intent (in) :: dayl_factor !daylight scale factor + real(r8), intent (in) :: o3coefjmax !ozone coef jmax + real(r8), intent (out):: PNstoreopt !optimal proportion of nitrogen for storage real(r8), intent (out):: PNlcopt !optimal proportion of nitrogen for light capture real(r8), intent (out):: PNetopt !optimal proportion of nitrogen for electron transport @@ -921,7 +941,8 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR call NUE(O2a10, ci, tair10, tleafd10c, NUEj, NUEc, Kj2Kc) call Nitrogen_investments (KcKjFlag,FNCa, Nlc, forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, tair10, & tleafd10c,tleafn10c, & - Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, Kc, Kj, ci, & + Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, o3coefjmax, & + Kc, Kj, ci, & Vcmax, Jmax,JmeanL,JmaxL, Net, Ncb, Nresp, PSN, RESP) Npsntarget = Nlc + Ncb + Net !target nitrogen allocated to photosynthesis, which may be lower or higher than Npsn_avail @@ -935,7 +956,8 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR KcKjFlag = 1 call Nitrogen_investments (KcKjFlag,FNCa, Nlc2, forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, & tair10, tleafd10c,tleafn10c, & - Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, Kc, Kj, ci, & + Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, o3coefjmax, & + Kc, Kj, ci, & Vcmax, Jmax,JmeanL,JmaxL, Net2, Ncb2, Nresp2, PSN2, RESP2) Npsntarget2 = Nlc2 + Ncb2 + Net2 @@ -963,7 +985,8 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR KcKjFlag = 1 call Nitrogen_investments (KcKjFlag,FNCa, Nlc1,forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, & tair10, tleafd10c,tleafn10c, & - Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, Kc, Kj, ci,& + Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, o3coefjmax, & + Kc, Kj, ci,& Vcmax, Jmax,JmeanL,JmaxL, Net1, Ncb1, Nresp1, PSN1, RESP1) Npsntarget1 = Nlc1 + Ncb1 + Net1 Carboncost1 = (Npsntarget - Npsntarget1) * NMCp25 * Cv * (RespTBernacchi(tleafd10c) * hourpd + & @@ -993,8 +1016,8 @@ end subroutine NitrogenAllocation subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & CO2a10, O2a10, PARi10, PARimx10, rb10, hourpd, tair10, tleafd10, tleafn10, & - Kj2Kc, JmaxCoef, Fc, Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, Kc, & - Kj, ci, Vcmax, Jmax, JmeanL, JmaxL, Net, Ncb, Nresp, PSN, RESP) + Kj2Kc, JmaxCoef, Fc, Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, o3coefjmax, & + Kc, Kj, ci, Vcmax, Jmax, JmeanL, JmaxL, Net, Ncb, Nresp, PSN, RESP) implicit none integer, intent (in) :: KcKjFlag !flag to indicate whether to update the Kc and Kj using the photosynthesis subroutine; 0--Kc and Kj need to be calculated; 1--Kc and Kj is prescribed. real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) @@ -1019,9 +1042,12 @@ subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & real(r8), intent (in) :: NUEcref !nitrogen use efficiency for carboxylation under reference climates real(r8), intent (in) :: NUEjref !nitrogen use efficiency for electron transport under reference climates real(r8), intent (in) :: NUEr !nitrogen use efficiency for respiration + real(r8), intent (in) :: o3coefjmax !ozone coef jmax + real(r8), intent (inout) :: Kc !conversion factors from Vc,max to Wc real(r8), intent (inout) :: Kj !conversion factor from electron transport rate to Wj real(r8), intent (inout) :: ci !inter-cellular CO2 concentration (Pa) + real(r8), intent (out) :: Vcmax !the maximum carboxyaltion rate (umol/m2/s) real(r8), intent (out) :: Jmax !the maximum electron transport rate (umol/m2/s) real(r8), intent (out) :: JmaxL !the electron transport rate with maximum daily radiation (umol/m2/s) @@ -1047,7 +1073,13 @@ subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & theta = 0.292_r8 / (1.0_r8 + 0.076_r8 / (Nlc * Cb)) ELTRNabsorb = theta * PARi10 Jmaxb0act = params_inst%jmaxb0 * FNCa * Fj - Jmax = Jmaxb0act + JmaxCoef * ELTRNabsorb + + ! Default value of o3coefjmax is 1 --> + ! o3coefjmax is only different from 1 if ozone_inst%stress_method == 'stress_falk' + ! BUG(si, 2021-05-26, ESCOMP/CTSM#1381) + Jmax = Jmaxb0act + JmaxCoef * ELTRNabsorb * o3coefjmax + + JmaxL = theta * PARimx10 / (sqrt(1.0_r8 + (theta * PARimx10 / Jmax)**2.0_r8)) NUEchg = (NUEc / NUEcref) * (NUEjref / NUEj) Wc2Wj = params_inst%wc2wjb0 * (NUEchg**0.5_r8) diff --git a/src/biogeophys/OzoneBaseMod.F90 b/src/biogeophys/OzoneBaseMod.F90 index a93a22f4eb..36964e55c8 100644 --- a/src/biogeophys/OzoneBaseMod.F90 +++ b/src/biogeophys/OzoneBaseMod.F90 @@ -21,12 +21,12 @@ module OzoneBaseMod ! Public data members ! These should be treated as read-only by other modules (except that they can be ! modified by extensions of the ozone_base_type) - real(r8), pointer, public :: o3coefvsha_patch(:) ! ozone coefficient for photosynthesis, shaded leaves (0 - 1) - real(r8), pointer, public :: o3coefvsun_patch(:) ! ozone coefficient for photosynthesis, sunlit leaves (0 - 1) - real(r8), pointer, public :: o3coefgsha_patch(:) ! ozone coefficient for conductance, shaded leaves (0 - 1) - real(r8), pointer, public :: o3coefgsun_patch(:) ! ozone coefficient for conductance, sunlit leaves (0 - 1) - - + real(r8), pointer, public :: o3coefvsha_patch(:) ! ozone coefficient for photosynthesis, shaded leaves (0 - 1) + real(r8), pointer, public :: o3coefvsun_patch(:) ! ozone coefficient for photosynthesis, sunlit leaves (0 - 1) + real(r8), pointer, public :: o3coefgsha_patch(:) ! ozone coefficient for conductance, shaded leaves (0 - 1) + real(r8), pointer, public :: o3coefgsun_patch(:) ! ozone coefficient for conductance, sunlit leaves (0 - 1) + real(r8), pointer, public :: o3coefjmaxsha_patch(:) ! ozone coefficient for max electron transport rate, shaded leaves (0 - 1) + real(r8), pointer, public :: o3coefjmaxsun_patch(:) ! ozone coefficient for max electron transport rate, sunlit leaves (0 - 1) contains ! The following routines need to be implemented by all type extensions procedure(Init_interface) , public, deferred :: Init @@ -42,12 +42,14 @@ module OzoneBaseMod abstract interface - subroutine Init_interface(this, bounds) + subroutine Init_interface(this, bounds, o3_veg_stress_method) use decompMod, only : bounds_type import :: ozone_base_type class(ozone_base_type), intent(inout) :: this type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: o3_veg_stress_method + end subroutine Init_interface subroutine Restart_interface(this, bounds, ncid, flag) @@ -80,14 +82,18 @@ subroutine CalcOzoneUptake_interface(this, bounds, num_exposedvegp, filter_expos real(r8) , intent(in) :: tlai( bounds%begp: ) ! one-sided leaf area index, no burying by snow end subroutine CalcOzoneUptake_interface - subroutine CalcOzoneStress_interface(this, bounds, num_exposedvegp, filter_exposedvegp) + subroutine CalcOzoneStress_interface(this, bounds, & + num_exposedvegp, filter_exposedvegp, & + num_noexposedvegp, filter_noexposedvegp) use decompMod, only : bounds_type import :: ozone_base_type class(ozone_base_type) , intent(inout) :: this type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp - integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter for veg where frac_veg_nosno is 0 end subroutine CalcOzoneStress_interface end interface @@ -115,11 +121,14 @@ subroutine InitAllocateBase(this, bounds) begp = bounds%begp endp = bounds%endp - allocate(this%o3coefvsha_patch(begp:endp)) ; this%o3coefvsha_patch(:) = nan - allocate(this%o3coefvsun_patch(begp:endp)) ; this%o3coefvsun_patch(:) = nan - allocate(this%o3coefgsha_patch(begp:endp)) ; this%o3coefgsha_patch(:) = nan - allocate(this%o3coefgsun_patch(begp:endp)) ; this%o3coefgsun_patch(:) = nan + allocate(this%o3coefvsha_patch(begp:endp)) ; this%o3coefvsha_patch(:) = nan + allocate(this%o3coefvsun_patch(begp:endp)) ; this%o3coefvsun_patch(:) = nan + allocate(this%o3coefgsha_patch(begp:endp)) ; this%o3coefgsha_patch(:) = nan + allocate(this%o3coefgsun_patch(begp:endp)) ; this%o3coefgsun_patch(:) = nan + allocate(this%o3coefjmaxsha_patch(begp:endp)) ; this%o3coefjmaxsha_patch(:) = nan + allocate(this%o3coefjmaxsun_patch(begp:endp)) ; this%o3coefjmaxsun_patch(:) = nan + end subroutine InitAllocateBase @@ -146,10 +155,12 @@ subroutine InitColdBase(this, bounds) begp = bounds%begp endp = bounds%endp - this%o3coefvsha_patch(begp:endp) = 1._r8 - this%o3coefvsun_patch(begp:endp) = 1._r8 - this%o3coefgsha_patch(begp:endp) = 1._r8 - this%o3coefgsun_patch(begp:endp) = 1._r8 + this%o3coefvsha_patch(begp:endp) = 1._r8 + this%o3coefvsun_patch(begp:endp) = 1._r8 + this%o3coefgsha_patch(begp:endp) = 1._r8 + this%o3coefgsun_patch(begp:endp) = 1._r8 + this%o3coefjmaxsha_patch(begp:endp) = 1._r8 + this%o3coefjmaxsun_patch(begp:endp) = 1._r8 end subroutine InitColdBase diff --git a/src/biogeophys/OzoneFactoryMod.F90 b/src/biogeophys/OzoneFactoryMod.F90 index fa68b31851..2cb9b7d06a 100644 --- a/src/biogeophys/OzoneFactoryMod.F90 +++ b/src/biogeophys/OzoneFactoryMod.F90 @@ -23,10 +23,10 @@ function create_and_init_ozone_type(bounds) result(ozone) ! ! !DESCRIPTION: ! Create and initialize an object of ozone_base_type, and return this object. The - ! particular type is determined based on the use_ozone namelist parameter. + ! particular type is determined based on the o3_veg_stress_method namelist parameter. ! ! !USES: - use clm_varctl , only : use_ozone + use clm_varctl , only : o3_veg_stress_method use OzoneBaseMod , only : ozone_base_type use OzoneOffMod , only : ozone_off_type use OzoneMod , only : ozone_type @@ -39,14 +39,14 @@ function create_and_init_ozone_type(bounds) result(ozone) character(len=*), parameter :: subname = 'create_and_init_ozone_type' !----------------------------------------------------------------------- - - if (use_ozone) then - allocate(ozone_type :: ozone) - else + + if (o3_veg_stress_method=='unset') then allocate(ozone_off_type :: ozone) - end if + else + allocate(ozone_type :: ozone) + endif - call ozone%Init(bounds) + call ozone%Init(bounds, o3_veg_stress_method) end function create_and_init_ozone_type diff --git a/src/biogeophys/OzoneMod.F90 b/src/biogeophys/OzoneMod.F90 index 8e3a5d0dc2..892c134662 100644 --- a/src/biogeophys/OzoneMod.F90 +++ b/src/biogeophys/OzoneMod.F90 @@ -70,16 +70,20 @@ module OzoneMod ! Calculate ozone uptake for a single point, for just sunlit or shaded leaves procedure, private, nopass :: CalcOzoneUptakeOnePoint - ! Original ozone stress parameterization, from Danica Lombardozzi 2015 - procedure, private :: CalcOzoneStressLombardozzi2015 + ! Original ozone stress functions from Danica Lombardozzi 2015 + procedure, private :: CalcOzoneStressLombardozzi2015 ! Stress parameterization + procedure, private, nopass :: CalcOzoneStressLombardozzi2015OnePoint ! Ozone stress calculation for single point + + ! Ozone stress functions from Stefanie Falk + procedure, private :: CalcOzoneStressFalk ! Stress parameterization + procedure, private, nopass :: CalcOzoneStressFalkOnePoint ! Ozone stress calculation for single point - ! Calculate ozone stress for a single point, for just sunlit or shaded leaves - procedure, private, nopass :: CalcOzoneStressLombardozzi2015OnePoint end type ozone_type ! !PRIVATE TYPES: integer, parameter :: stress_method_lombardozzi2015 = 1 - + integer, parameter :: stress_method_falk = 2 + ! TODO(wjs, 2014-09-29) This parameter will eventually become a spatially-varying ! value, obtained from ATM real(r8), parameter :: forc_ozone = 100._r8 * 1.e-9_r8 ! ozone partial pressure [mol/mol] @@ -112,34 +116,54 @@ module OzoneMod real(r8), parameter :: broadleafCondSlope = 0._r8 ! units = per mmol m^-2 real(r8), parameter :: nonwoodyCondInt = 0.7511_r8 ! units = unitless real(r8), parameter :: nonwoodyCondSlope = 0._r8 ! units = per mmol m^-2 + + ! Data is currently only available for broadleaf species (Dec 2020) + ! o3 intercepts and slopes for JmaxO3/Jmax0 + real(r8), parameter :: needleleafJmaxInt = 1._r8 ! units = unitless + real(r8), parameter :: needleleafJmaxSlope = 0._r8 ! units = per mmol m^-2 + real(r8), parameter :: broadleafJmaxInt = 1._r8 ! units = unitless + real(r8), parameter :: broadleafJmaxSlope = -0.0037_r8 ! units = per mmol m^-2 + real(r8), parameter :: nonwoodyJmaxInt = 1._r8 ! units = unitless + real(r8), parameter :: nonwoodyJmaxSlope = 0._r8 ! units = per mmol m^-2 + character(len=*), parameter, private :: sourcefile = & __FILE__ contains - + ! ======================================================================== ! Infrastructure routines (initialization, restart, etc.) ! ======================================================================== !----------------------------------------------------------------------- - subroutine Init(this, bounds) + subroutine Init(this, bounds, o3_veg_stress_method) ! ! !DESCRIPTION: ! Initialize ozone data structure ! + ! !USES: + use clm_varctl , only : use_luna + ! ! !ARGUMENTS: class(ozone_type), intent(inout) :: this type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: o3_veg_stress_method !----------------------------------------------------------------------- - ! TODO(wjs, 2021-02-06) This will be based on a namelist variable - this%stress_method = stress_method_lombardozzi2015 + if (o3_veg_stress_method=='stress_lombardozzi2015') then + this%stress_method = stress_method_lombardozzi2015 + else if (o3_veg_stress_method=='stress_falk') then + this%stress_method = stress_method_falk + if (.not. use_luna ) call endrun(' use_luna=.true. is required when o3_veg_stress_method = stress_falk.') + else + call endrun('unknown ozone stress method') + end if call this%InitAllocate(bounds) call this%InitHistory(bounds) call this%InitCold(bounds) - + end subroutine Init @@ -186,10 +210,10 @@ subroutine InitHistory(this, bounds) ! ! !LOCAL VARIABLES: integer :: begp, endp - + character(len=*), parameter :: subname = 'InitHistory' !----------------------------------------------------------------------- - + begp = bounds%begp endp = bounds%endp @@ -203,6 +227,63 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='total ozone flux into shaded leaves', & ptr_patch=this%o3uptakesha_patch) + if (this%stress_method==stress_method_lombardozzi2015) then + ! For this and the following variables: how should we include leaf area in the + ! patch averaging? + ! + ! Note that for now we need to reset these o3 coefficients over non-exposed veg + ! points each time step for the sake of these diagnostics - to avoid weirdness and + ! non-exact restarts due to coefficients over non-exposed patches "remembering" + ! their value from when they were last exposed. (This resetting to 1 is done below, + ! in the CalcOzoneStress* routines.) But if we could set the scaling so that the + ! coefficients are only averaged over currently-exposed veg patches, then we could + ! avoid needing to reset the coefficients to 1 each time step over non-exposed + ! patches. + ! + ! An alternative would be to set these values to spval over non-exposed patches: + ! that way, averages would just be taken over exposed patches (as opposed to + ! averaging in 1 values for non-exposed patches). However, that would conflict with + ! the goals of https://github.com/ESCOMP/CTSM/projects/35 (specifically, having + ! frac fields that can be used to determine the appropriate weighting of each grid + ! cell in producing regional / global averages), so if we want to exclude + ! non-exposed patches from the gridcell average, we should probably come up with a + ! way to do so via a more explicit mechanism similar to l2g_scale_type (maybe with + ! a new p2c_scale_type that allows excluding non-exposed patches???). + this%o3coefvsha_patch(begp:endp) = spval + call hist_addfld1d (fname='O3COEFPSNSHA', units='unitless', & + avgflag='A', long_name='ozone coefficient for photosynthesis for shaded leaves', & + ptr_patch=this%o3coefvsha_patch, l2g_scale_type='veg') + + this%o3coefvsun_patch(begp:endp) = spval + call hist_addfld1d (fname='O3COEFPSNSUN', units='unitless', & + avgflag='A', long_name='ozone coefficient for photosynthesis for sunlit leaves', & + ptr_patch=this%o3coefvsun_patch, l2g_scale_type='veg') + + this%o3coefgsha_patch(begp:endp) = spval + call hist_addfld1d (fname='O3COEFGSSHA', units='unitless', & + avgflag='A', long_name='ozone coefficient for stomatal conductance for shaded leaves', & + ptr_patch=this%o3coefgsha_patch, l2g_scale_type='veg') + + this%o3coefgsun_patch(begp:endp) = spval + call hist_addfld1d (fname='O3COEFGSSUN', units='unitless', & + avgflag='A', long_name='ozone coefficient for stomatal conductance for sunlit leaves', & + ptr_patch=this%o3coefgsun_patch, l2g_scale_type='veg') + + elseif (this%stress_method==stress_method_falk) then + ! + this%o3coefjmaxsha_patch(begp:endp) = spval + call hist_addfld1d (fname='O3COEFJMAXSHA', units='unitless', & + avgflag='A', long_name='ozone coefficient for maximum electron transport rate for shaded leaves', & + ptr_patch=this%o3coefjmaxsha_patch, l2g_scale_type='veg') + + this%o3coefjmaxsun_patch(begp:endp) = spval + call hist_addfld1d (fname='O3COEFJMAXSUN', units='unitless', & + avgflag='A', long_name='ozone coefficient for maximum electron transport rate sunlit leaves', & + ptr_patch=this%o3coefjmaxsun_patch, l2g_scale_type='veg') + else + call endrun('unknown ozone stress method') + end if + end subroutine InitHistory !----------------------------------------------------------------------- @@ -217,7 +298,7 @@ subroutine InitCold(this, bounds) ! ! !LOCAL VARIABLES: integer :: begp, endp - + character(len=*), parameter :: subname = 'InitCold' !----------------------------------------------------------------------- @@ -253,7 +334,7 @@ subroutine Restart(this, bounds, ncid, flag) character(len=*), parameter :: subname = 'Restart' !----------------------------------------------------------------------- - + call restartvar(ncid=ncid, flag=flag, varname='o3_tlaiold', xtype=ncd_double, & dim1name='pft', & long_name='one-sided leaf area index, from previous timestep, for ozone calculations', units='', & @@ -268,7 +349,7 @@ subroutine Restart(this, bounds, ncid, flag) dim1name='pft', & long_name='ozone uptake for sunlit leaves', units='mmol m^-3', & readvar=readvar, interpinic_flag='interp', data=this%o3uptakesun_patch) - + end subroutine Restart ! ======================================================================== @@ -302,7 +383,7 @@ subroutine CalcOzoneUptake(this, bounds, num_exposedvegp, filter_exposedvegp, & character(len=*), parameter :: subname = 'CalcOzoneUptake' !----------------------------------------------------------------------- - + ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(forc_pbot) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(forc_th) == (/bounds%endc/)), sourcefile, __LINE__) @@ -317,28 +398,28 @@ subroutine CalcOzoneUptake(this, bounds, num_exposedvegp, filter_exposedvegp, & o3uptakesun => this%o3uptakesun_patch , & ! Output: [real(r8) (:)] ozone dose tlai_old => this%tlai_old_patch & ! Output: [real(r8) (:)] tlai from last time step ) - - do fp = 1, num_exposedvegp - p = filter_exposedvegp(fp) - c = patch%column(p) - ! Ozone uptake for shaded leaves - call CalcOzoneUptakeOnePoint( & - forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & - rs=rssha(p), rb=rb(p), ram=ram(p), & - tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & - o3uptake=o3uptakesha(p)) + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + c = patch%column(p) + + ! Ozone uptake for shaded leaves + call CalcOzoneUptakeOnePoint( & + forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & + rs=rssha(p), rb=rb(p), ram=ram(p), & + tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & + o3uptake=o3uptakesha(p)) - ! Ozone uptake for sunlit leaves - call CalcOzoneUptakeOnePoint( & - forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & - rs=rssun(p), rb=rb(p), ram=ram(p), & - tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & - o3uptake=o3uptakesun(p)) + ! Ozone uptake for sunlit leaves + call CalcOzoneUptakeOnePoint( & + forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & + rs=rssun(p), rb=rb(p), ram=ram(p), & + tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & + o3uptake=o3uptakesun(p)) - tlai_old(p) = tlai(p) + tlai_old(p) = tlai(p) - end do + end do end associate @@ -430,7 +511,9 @@ subroutine CalcOzoneUptakeOnePoint( & end subroutine CalcOzoneUptakeOnePoint !----------------------------------------------------------------------- - subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp) + subroutine CalcOzoneStress(this, bounds, & + num_exposedvegp, filter_exposedvegp, & + num_noexposedvegp, filter_noexposedvegp) ! ! !DESCRIPTION: ! Calculate ozone stress. @@ -438,8 +521,10 @@ subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp) ! !ARGUMENTS: class(ozone_type), intent(inout) :: this type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp - integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter for veg where frac_veg_nosno is 0 ! ! !LOCAL VARIABLES: @@ -448,7 +533,13 @@ subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp) select case (this%stress_method) case (stress_method_lombardozzi2015) - call this%CalcOzoneStressLombardozzi2015(bounds, num_exposedvegp, filter_exposedvegp) + call this%CalcOzoneStressLombardozzi2015(bounds, & + num_exposedvegp, filter_exposedvegp, & + num_noexposedvegp, filter_noexposedvegp) + case (stress_method_falk) + call this%CalcOzoneStressFalk(bounds, & + num_exposedvegp, filter_exposedvegp, & + num_noexposedvegp, filter_noexposedvegp) case default write(iulog,*) 'ERROR: unknown ozone stress method: ', this%stress_method call endrun('Unknown ozone stress method') @@ -457,7 +548,9 @@ subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp) end subroutine CalcOzoneStress !----------------------------------------------------------------------- - subroutine CalcOzoneStressLombardozzi2015(this, bounds, num_exposedvegp, filter_exposedvegp) + subroutine CalcOzoneStressLombardozzi2015(this, bounds, & + num_exposedvegp, filter_exposedvegp, & + num_noexposedvegp, filter_noexposedvegp) ! ! !DESCRIPTION: ! Calculate ozone stress. @@ -467,8 +560,10 @@ subroutine CalcOzoneStressLombardozzi2015(this, bounds, num_exposedvegp, filter_ ! !ARGUMENTS: class(ozone_type), intent(inout) :: this type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp - integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter for veg where frac_veg_nosno is 0 ! ! !LOCAL VARIABLES: integer :: fp ! filter index @@ -486,20 +581,30 @@ subroutine CalcOzoneStressLombardozzi2015(this, bounds, num_exposedvegp, filter_ o3coefgsun => this%o3coefgsun_patch & ! Output: [real(r8) (:)] ozone coef ) - do fp = 1, num_exposedvegp - p = filter_exposedvegp(fp) + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) - ! Ozone stress for shaded leaves - call CalcOzoneStressLombardozzi2015OnePoint( & - pft_type=patch%itype(p), o3uptake=o3uptakesha(p), & - o3coefv=o3coefvsha(p), o3coefg=o3coefgsha(p)) + ! Ozone stress for shaded leaves + call CalcOzoneStressLombardozzi2015OnePoint( & + pft_type=patch%itype(p), o3uptake=o3uptakesha(p), & + o3coefv=o3coefvsha(p), o3coefg=o3coefgsha(p)) - ! Ozone stress for sunlit leaves - call CalcOzoneStressLombardozzi2015OnePoint( & - pft_type=patch%itype(p), o3uptake=o3uptakesun(p), & - o3coefv=o3coefvsun(p), o3coefg=o3coefgsun(p)) - end do + ! Ozone stress for sunlit leaves + call CalcOzoneStressLombardozzi2015OnePoint( & + pft_type=patch%itype(p), o3uptake=o3uptakesun(p), & + o3coefv=o3coefvsun(p), o3coefg=o3coefgsun(p)) + end do + do fp = 1, num_noexposedvegp + p = filter_noexposedvegp(fp) + + ! See notes above in InitHistory about why these need to be set to 1 over + ! non-exposed veg points each time step. + o3coefvsha(p) = 1._r8 + o3coefgsha(p) = 1._r8 + o3coefvsun(p) = 1._r8 + o3coefgsun(p) = 1._r8 + end do end associate @@ -565,4 +670,115 @@ subroutine CalcOzoneStressLombardozzi2015OnePoint( & end subroutine CalcOzoneStressLombardozzi2015OnePoint + + !----------------------------------------------------------------------- + subroutine CalcOzoneStressFalk(this, bounds, & + num_exposedvegp, filter_exposedvegp, & + num_noexposedvegp, filter_noexposedvegp) + ! + ! !DESCRIPTION: + ! Calculate ozone stress. + ! + ! This subroutine uses the Falk formulation for ozone stress + ! + ! !USES: + use LunaMod , only : is_time_to_run_LUNA + ! + ! !ARGUMENTS: + class(ozone_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter for veg where frac_veg_nosno is 0 + ! + ! !LOCAL VARIABLES: + integer :: fp ! filter index + integer :: p ! patch index + + character(len=*), parameter :: subname = 'CalcOzoneStressFalk' + !----------------------------------------------------------------------- + + if (is_time_to_run_LUNA()) then + + associate( & + o3uptakesha => this%o3uptakesha_patch , & ! Input: [real(r8) (:)] ozone dose + o3uptakesun => this%o3uptakesun_patch , & ! Input: [real(r8) (:)] ozone dose + o3coefjmaxsha => this%o3coefjmaxsha_patch , & ! Output: [real(r8) (:)] ozone coef jmax sha + o3coefjmaxsun => this%o3coefjmaxsun_patch & ! Output: [real(r8) (:)] ozone coef jmax sun + ) + + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + + ! Ozone stress for shaded leaves + call CalcOzoneStressFalkOnePoint( & + pft_type=patch%itype(p), o3uptake=o3uptakesha(p), & + o3coefjmax=o3coefjmaxsha(p)) + + ! Ozone stress for sunlit leaves + call CalcOzoneStressFalkOnePoint( & + pft_type=patch%itype(p), o3uptake=o3uptakesun(p), & + o3coefjmax=o3coefjmaxsun(p)) + + end do + + do fp = 1, num_noexposedvegp + p = filter_noexposedvegp(fp) + + ! See notes above in InitHistory about why these need to be set to 1 over + ! non-exposed veg points each time step. + o3coefjmaxsha(p) = 1._r8 + o3coefjmaxsun(p) = 1._r8 + end do + + end associate + + end if + + end subroutine CalcOzoneStressFalk + + !----------------------------------------------------------------------- + subroutine CalcOzoneStressFalkOnePoint( pft_type, o3uptake, o3coefjmax) + ! + ! !DESCRIPTION: + ! Calculates ozone stress for a single point, for just sunlit or shaded leaves + ! + ! This subroutine uses the Falk formulation for ozone stress + ! + ! !ARGUMENTS: + integer , intent(in) :: pft_type ! vegetation type, for indexing into pftvarcon arrays + real(r8) , intent(in) :: o3uptake ! ozone entering the leaf + real(r8) , intent(inout) :: o3coefjmax ! ozone coefficient for max. electron transport rate + ! + ! !LOCAL VARIABLES: + real(r8) :: jmaxInt ! intercept for max. electron transport rate + real(r8) :: jmaxSlope ! slope for max. electron transport rate + character(len=*), parameter :: subname = 'CalcOzoneStressFalkOnePoint' + !----------------------------------------------------------------------- + + if (o3uptake == 0._r8) then + o3coefjmax = 1._r8 + else + ! Determine parameter values for this pft + ! TODO(wjs, 2014-10-01) Once these parameters are moved into the params file, this + ! logic can be removed. + if (pft_type>3) then + if (pftcon%woody(pft_type)==0) then + jmaxInt = nonwoodyJmaxInt + jmaxSlope = nonwoodyJmaxSlope + else + jmaxInt = broadleafJmaxInt + jmaxSlope = broadleafJmaxSlope + end if + else + jmaxInt = needleleafJmaxInt + jmaxSlope = needleleafJmaxSlope + end if + ! Apply parameter values to compute o3 coefficients + o3coefjmax = max(0._r8, min(1._r8, jmaxInt + jmaxSlope * o3uptake)) + end if + + end subroutine CalcOzoneStressFalkOnePoint + end module OzoneMod diff --git a/src/biogeophys/OzoneOffMod.F90 b/src/biogeophys/OzoneOffMod.F90 index f42707f667..b2b7f8863a 100644 --- a/src/biogeophys/OzoneOffMod.F90 +++ b/src/biogeophys/OzoneOffMod.F90 @@ -60,12 +60,25 @@ function constructor() result(ozone_off) end function constructor - subroutine Init(this, bounds) + subroutine Init(this, bounds, o3_veg_stress_method) + ! + ! !DESCRIPTION: + ! Initialize ozone data structure + ! + ! ! USES: + use abortutils,only : endrun + ! + ! !ARGUMENTS: class(ozone_off_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds + character(len=*), intent(in) :: o3_veg_stress_method + !----------------------------------------------------------------------- + if (o3_veg_stress_method /= 'unset' ) call endrun(' unconsistent choice of o3_veg_stress_method in init OzoneOffMod.') + call this%InitAllocateBase(bounds) call this%InitColdBase(bounds) + end subroutine Init subroutine Restart(this, bounds, ncid, flag) @@ -109,13 +122,18 @@ subroutine CalcOzoneUptake(this, bounds, num_exposedvegp, filter_exposedvegp, & end subroutine CalcOzoneUptake - subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp) + subroutine CalcOzoneStress(this, bounds, & + num_exposedvegp, filter_exposedvegp, & + num_noexposedvegp, filter_noexposedvegp) class(ozone_off_type), intent(inout) :: this type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_exposedvegp integer , intent(in) :: filter_exposedvegp(:) + integer , intent(in) :: num_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) + + ! Outputs (stress terms) are already fixed at 1 from cold start initialization - ! Do nothing: Outputs (stress terms) are already fixed at 1 from cold start initialization end subroutine CalcOzoneStress end module OzoneOffMod diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 18aabe59b1..5b2c68a0fb 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -17,8 +17,8 @@ module PhotosynthesisMod use clm_varctl , only : use_c13, use_c14, use_cn, use_cndv, use_fates, use_luna, use_hydrstress use clm_varctl , only : iulog use clm_varpar , only : nlevcan, nvegwcs, mxpft - use clm_varcon , only : namep, c14ratio, spval, isecspday - use decompMod , only : bounds_type + use clm_varcon , only : c14ratio, spval, isecspday + use decompMod , only : bounds_type, subgrid_level_patch use QuadraticMod , only : quadratic use pftconMod , only : pftcon use CIsoAtmTimeseriesMod, only : C14BombSpike, use_c14_bombspike, C13TimeSeries, use_c13_timeseries, nsectors_c14 @@ -48,6 +48,9 @@ module PhotosynthesisMod ! Gentine/Daniel Kennedy plant hydraulic stress method public :: plc ! Return value of vulnerability curve at x + ! PRIVATE FUNCTIONS MADE PUBLIC Juse for unit-testing: + public :: d1plc ! compute 1st deriv of conductance attenuation for each segment + ! !PRIVATE MEMBER FUNCTIONS: private :: hybrid ! hybrid solver for ci private :: ci_func ! ci function @@ -64,19 +67,26 @@ module PhotosynthesisMod private :: getqflx ! calculate sunlit and shaded transpiration private :: spacF ! flux divergence across each vegetation segment private :: spacA ! the inverse Jacobian matrix relating delta(vegwp) to f, d(vegwp)=A*f - private :: d1plc ! compute 1st deriv of conductance attenuation for each segment ! !PRIVATE DATA: integer, parameter, private :: leafresp_mtd_ryan1991 = 1 ! Ryan 1991 method for lmr25top integer, parameter, private :: leafresp_mtd_atkin2015 = 2 ! Atkin 2015 method for lmr25top - integer, parameter, private :: sun=1 ! index for sunlit - integer, parameter, private :: sha=2 ! index for shaded - integer, parameter, private :: xyl=3 ! index for xylem - integer, parameter, private :: root=4 ! index for root - integer, parameter, private :: veg=0 ! index for vegetation - integer, parameter, private :: soil=1 ! index for soil + integer, parameter, private :: vegetation_weibull=0 ! PLC method type + ! These are public for unit-tests + integer, parameter, public :: sun=1 ! index for sunlit + integer, parameter, public :: sha=2 ! index for shaded + integer, parameter, public :: xyl=3 ! index for xylem + integer, parameter, public :: root=4 ! index for root + integer, parameter, public :: veg=vegetation_weibull ! index for vegetation + integer, parameter, public :: soil=1 ! index for soil integer, parameter, private :: stomatalcond_mtd_bb1987 = 1 ! Ball-Berry 1987 method for photosynthesis integer, parameter, private :: stomatalcond_mtd_medlyn2011 = 2 ! Medlyn 2011 method for photosynthesis + + real(r8), parameter, private :: bbbopt_c3 = 10000._r8 ! Ball-Berry Photosynthesis intercept to use for C3 vegetation + real(r8), parameter, private :: bbbopt_c4 = 40000._r8 ! Ball-Berry Photosynthesis intercept to use for C4 vegetation + real(r8), parameter, private :: medlyn_rh_can_max = 50._r8 ! Maximum to put on RH in the canopy used for Medlyn Photosynthesis + real(r8), parameter, private :: medlyn_rh_can_fact = 0.001_r8 ! Multiplicitive factor to use for Canopy RH used for Medlyn photosynthesis + real(r8), parameter, private :: max_cs = 1.e-06_r8 ! Max CO2 partial pressure at leaf surface (Pa) for PHS ! !PUBLIC VARIABLES: type :: photo_params_type @@ -102,6 +112,10 @@ module PhotosynthesisMod real(r8) :: lmrse ! Entropy term for lmr (J/mol/K) real(r8) :: tpu25ratio ! Ratio of tpu25top to vcmax25top (unitless) real(r8) :: kp25ratio ! Ratio of kp25top to vcmax25top (unitless) + real(r8) :: vcmaxse_sf ! Scale factor for vcmaxse (unitless) + real(r8) :: jmaxse_sf ! Scale factor for jmaxse (unitless) + real(r8) :: tpuse_sf ! Scale factor for tpuse (unitless) + real(r8) :: jmax25top_sf ! Scale factor for jmax25top (unitless) real(r8), allocatable, public :: krmax (:) real(r8), allocatable, private :: kmax (:,:) real(r8), allocatable, private :: psi50 (:,:) @@ -109,7 +123,8 @@ module PhotosynthesisMod real(r8), allocatable, private :: lmr_intercept_atkin(:) real(r8), allocatable, private :: theta_cj (:) ! Empirical curvature parameter for ac, aj photosynthesis co-limitation (unitless) contains - procedure, private :: allocParams + procedure, private :: allocParams ! Allocate the parameters + procedure, private :: cleanParams ! Deallocate parameters from member end type photo_params_type ! type(photo_params_type), public, protected :: params_inst ! params_inst is populated in readParamsMod @@ -127,8 +142,8 @@ module PhotosynthesisMod real(r8), pointer, private :: vcmax_z_phs_patch (:,:,:) ! patch maximum rate of carboxylation (umol co2/m**2/s) real(r8), pointer, private :: kp_z_phs_patch (:,:,:) ! patch initial slope of CO2 response curve (C4 plants) real(r8), pointer, private :: tpu_z_phs_patch (:,:,:) ! patch triose phosphate utilization rate (umol CO2/m**2/s) - real(r8), pointer, private :: gs_mol_sun_patch (:,:) ! patch sunlit leaf stomatal conductance (umol H2O/m**2/s) - real(r8), pointer, private :: gs_mol_sha_patch (:,:) ! patch shaded leaf stomatal conductance (umol H2O/m**2/s) + real(r8), pointer, public :: gs_mol_sun_patch (:,:) ! patch sunlit leaf stomatal conductance (umol H2O/m**2/s) + real(r8), pointer, public :: gs_mol_sha_patch (:,:) ! patch shaded leaf stomatal conductance (umol H2O/m**2/s) real(r8), pointer, private :: gs_mol_sun_ln_patch (:,:) ! patch sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) real(r8), pointer, private :: gs_mol_sha_ln_patch (:,:) ! patch shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) real(r8), pointer, private :: ac_patch (:,:) ! patch Rubisco-limited gross photosynthesis (umol CO2/m**2/s) @@ -221,6 +236,10 @@ module PhotosynthesisMod procedure, public :: ReadParams procedure, public :: TimeStepInit procedure, public :: NewPatchInit + procedure, public :: Clean + + ! Procedures for unit-testing + procedure, public :: SetParamsForTesting ! Private procedures procedure, private :: InitAllocate @@ -355,6 +374,104 @@ subroutine InitAllocate(this, bounds) end subroutine InitAllocate + !------------------------------------------------------------------------ + subroutine Clean(this) + ! + ! !ARGUMENTS: + class(photosyns_type) :: this + ! + ! !LOCAL VARIABLES: + !------------------------------------------------------------------------ + + call params_inst%cleanParams() + deallocate(this%c3flag_patch ) + deallocate(this%ac_phs_patch ) + deallocate(this%aj_phs_patch ) + deallocate(this%ap_phs_patch ) + deallocate(this%ag_phs_patch ) + deallocate(this%an_sun_patch ) + deallocate(this%an_sha_patch ) + deallocate(this%vcmax_z_phs_patch ) + deallocate(this%tpu_z_phs_patch ) + deallocate(this%kp_z_phs_patch ) + deallocate(this%gs_mol_sun_patch ) + deallocate(this%gs_mol_sha_patch ) + deallocate(this%gs_mol_sun_ln_patch ) + deallocate(this%gs_mol_sha_ln_patch ) + deallocate(this%ac_patch ) + deallocate(this%aj_patch ) + deallocate(this%ap_patch ) + deallocate(this%ag_patch ) + deallocate(this%an_patch ) + deallocate(this%vcmax_z_patch ) + deallocate(this%tpu_z_patch ) + deallocate(this%kp_z_patch ) + deallocate(this%gs_mol_patch ) + deallocate(this%cp_patch ) + deallocate(this%kc_patch ) + deallocate(this%ko_patch ) + deallocate(this%qe_patch ) + deallocate(this%bbb_patch ) + deallocate(this%mbb_patch ) + deallocate(this%gb_mol_patch ) + deallocate(this%rh_leaf_patch ) + deallocate(this%vpd_can_patch ) + deallocate(this%psnsun_patch ) + deallocate(this%psnsha_patch ) + deallocate(this%c13_psnsun_patch ) + deallocate(this%c13_psnsha_patch ) + deallocate(this%c14_psnsun_patch ) + deallocate(this%c14_psnsha_patch ) + + deallocate(this%psnsun_z_patch ) + deallocate(this%psnsha_z_patch ) + deallocate(this%psnsun_wc_patch ) + deallocate(this%psnsha_wc_patch ) + deallocate(this%psnsun_wj_patch ) + deallocate(this%psnsha_wj_patch ) + deallocate(this%psnsun_wp_patch ) + deallocate(this%psnsha_wp_patch ) + deallocate(this%fpsn_patch ) + deallocate(this%fpsn_wc_patch ) + deallocate(this%fpsn_wj_patch ) + deallocate(this%fpsn_wp_patch ) + + deallocate(this%lnca_patch ) + + deallocate(this%lmrsun_z_patch ) + deallocate(this%lmrsha_z_patch ) + deallocate(this%lmrsun_patch ) + deallocate(this%lmrsha_patch ) + + deallocate(this%alphapsnsun_patch ) + deallocate(this%alphapsnsha_patch ) + deallocate(this%rc13_canair_patch ) + deallocate(this%rc13_psnsun_patch ) + deallocate(this%rc13_psnsha_patch ) + + deallocate(this%cisun_z_patch ) + deallocate(this%cisha_z_patch ) + + deallocate(this%rssun_z_patch ) + deallocate(this%rssha_z_patch ) + deallocate(this%rssun_patch ) + deallocate(this%rssha_patch ) + deallocate(this%luvcmax25top_patch) + deallocate(this%lujmax25top_patch ) + deallocate(this%lutpu25top_patch ) +!! + if(use_luna)then + deallocate(this%vcmx25_z_patch ) + deallocate(this%jmx25_z_patch ) + deallocate(this%vcmx25_z_last_valid_patch ) + deallocate(this%jmx25_z_last_valid_patch ) + deallocate(this%pnlc_z_patch ) + deallocate(this%fpsn24_patch ) + deallocate(this%enzs_z_patch ) + endif + + end subroutine Clean + !----------------------------------------------------------------------- subroutine InitHistory(this, bounds) ! @@ -654,6 +771,29 @@ subroutine allocParams ( this ) end subroutine allocParams + + !----------------------------------------------------------------------- + subroutine cleanParams ( this ) + ! + implicit none + + ! !ARGUMENTS: + class(photo_params_type) :: this + ! + ! !LOCAL VARIABLES: + character(len=32) :: subname = 'cleanParams' + !----------------------------------------------------------------------- + + ! deallocate parameters + + deallocate( this%krmax ) + deallocate( this%theta_cj ) + deallocate( this%kmax ) + deallocate( this%psi50 ) + deallocate( this%ck ) + + end subroutine cleanParams + !----------------------------------------------------------------------- subroutine readParams ( this, ncid ) ! @@ -751,9 +891,38 @@ subroutine readParams ( this, ncid ) call readNcdioScalar(ncid, 'tpu25ratio', subname, params_inst%tpu25ratio) ! Ratio of kp25top to vcmax25top (unitless) call readNcdioScalar(ncid, 'kp25ratio', subname, params_inst%kp25ratio) + ! Scale factor for vcmaxse (unitless) + call readNcdioScalar(ncid, 'vcmaxse_sf', subname, params_inst%vcmaxse_sf) + ! Scale factor for jmaxse (unitless) + call readNcdioScalar(ncid, 'jmaxse_sf', subname, params_inst%jmaxse_sf) + ! Scale factor for tpuse (unitless) + call readNcdioScalar(ncid, 'tpuse_sf', subname, params_inst%tpuse_sf) + ! Scale factor for jmax25top (unitless) + call readNcdioScalar(ncid, 'jmax25top_sf', subname, params_inst%jmax25top_sf) end subroutine readParams + !----------------------------------------------------------------------- + subroutine setParamsForTesting ( this ) + ! + ! !USES: + implicit none + + ! !ARGUMENTS: + class(photosyns_type) :: this + ! + ! !LOCAL VARIABLES: + character(len=32) :: subname = 'setParamsForTesting' + !----------------------------------------------------------------------- + + call params_inst%allocParams() + params_inst%ck = 3.95_r8 + params_inst%psi50(1,:) = -150000._r8 + params_inst%psi50(2,:) = -530000._r8 + params_inst%psi50(3:12,:) = -400000._r8 + params_inst%psi50(13:,:) = -340000._r8 + + end subroutine setParamsForTesting !------------------------------------------------------------------------ subroutine ReadNML(this, NLFilename) @@ -1239,6 +1408,8 @@ subroutine Photosynthesis ( bounds, fn, filterp, & gs_mol => photosyns_inst%gs_mol_patch , & ! Output: [real(r8) (:,:) ] leaf stomatal conductance (umol H2O/m**2/s) gs_mol_sun_ln => photosyns_inst%gs_mol_sun_ln_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) gs_mol_sha_ln => photosyns_inst%gs_mol_sha_ln_patch , & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) + gs_mol_sun => photosyns_inst%gs_mol_sun_patch , & ! Output: [real(r8) (:,:) ] patch sunlit leaf stomatal conductance (umol H2O/m**2/s) + gs_mol_sha => photosyns_inst%gs_mol_sha_patch , & ! Output: [real(r8) (:,:) ] patch shaded leaf stomatal conductance (umol H2O/m**2/s) vcmax_z => photosyns_inst%vcmax_z_patch , & ! Output: [real(r8) (:,:) ] maximum rate of carboxylation (umol co2/m**2/s) cp => photosyns_inst%cp_patch , & ! Output: [real(r8) (:) ] CO2 compensation point (Pa) kc => photosyns_inst%kc_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for CO2 (Pa) @@ -1253,6 +1424,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & lnc => photosyns_inst%lnca_patch , & ! Output: [real(r8) (:) ] top leaf layer leaf N concentration (gN leaf/m^2) light_inhibit=> photosyns_inst%light_inhibit , & ! Input: [logical ] flag if light should inhibit respiration leafresp_method=> photosyns_inst%leafresp_method , & ! Input: [integer ] method type to use for leaf-maint.-respiration at 25C canopy top + medlynintercept => pftcon%medlynintercept , & ! Input: [real(r8) (:) ] Intercept for Medlyn stomatal conductance model method stomatalcond_mtd=> photosyns_inst%stomatalcond_mtd , & ! Input: [integer ] method type to use for stomatal conductance.GC.fnlprmsn15_r22845 leaf_mr_vcm => canopystate_inst%leaf_mr_vcm & ! Input: [real(r8) ] scalar constant of leaf respiration with Vcmax ) @@ -1331,16 +1503,18 @@ subroutine Photosynthesis ( bounds, fn, filterp, & if (c3flag(p)) then qe(p) = 0._r8 - bbbopt(p) = 10000._r8 + if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 ) bbbopt(p) = bbbopt_c3 else qe(p) = 0.05_r8 - bbbopt(p) = 40000._r8 + if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 ) bbbopt(p) = bbbopt_c4 end if ! Soil water stress applied to Ball-Berry parameters - bbb(p) = max (bbbopt(p)*btran(p), 1._r8) - mbb(p) = mbbopt(patch%itype(p)) + if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 ) then + bbb(p) = max (bbbopt(p)*btran(p), 1._r8) + mbb(p) = mbbopt(patch%itype(p)) + end if ! kc, ko, cp, from: Bernacchi et al (2001) Plant, Cell and Environment 24:253-259 ! @@ -1374,7 +1548,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & ! Leaf nitrogen concentration at the top of the canopy (g N leaf / m**2 leaf) if ( (slatop(patch%itype(p)) *leafcn(patch%itype(p))) .le. 0.0_r8)then - call endrun( "ERROR: slatop or leafcn is zero" ) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg="ERROR: slatop or leafcn is zero") end if lnc(p) = 1._r8 / (slatop(patch%itype(p)) * leafcn(patch%itype(p))) end if @@ -1459,7 +1633,8 @@ subroutine Photosynthesis ( bounds, fn, filterp, & ! Parameters derived from vcmax25top. Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 ! used jmax25 = 1.97 vcmax25, from Wullschleger (1993) Journal of Experimental Botany 44:907-920. - jmax25top = (2.59_r8 - 0.035_r8*min(max((t10(p)-tfrz),11._r8),35._r8)) * vcmax25top + jmax25top = ((2.59_r8 - 0.035_r8*min(max((t10(p)-tfrz),11._r8),35._r8)) * vcmax25top) * & + params_inst%jmax25top_sf tpu25top = params_inst%tpu25ratio * vcmax25top kp25top = params_inst%kp25ratio * vcmax25top @@ -1590,9 +1765,9 @@ subroutine Photosynthesis ( bounds, fn, filterp, & ! Adjust for temperature - vcmaxse = 668.39_r8 - 1.07_r8 * min(max((t10(p)-tfrz),11._r8),35._r8) - jmaxse = 659.70_r8 - 0.75_r8 * min(max((t10(p)-tfrz),11._r8),35._r8) - tpuse = vcmaxse + vcmaxse = (668.39_r8 - 1.07_r8 * min(max((t10(p)-tfrz),11._r8),35._r8)) * params_inst%vcmaxse_sf + jmaxse = (659.70_r8 - 0.75_r8 * min(max((t10(p)-tfrz),11._r8),35._r8)) * params_inst%jmaxse_sf + tpuse = (668.39_r8 - 1.07_r8 * min(max((t10(p)-tfrz),11._r8),35._r8)) * params_inst%tpuse_sf vcmaxc = fth25 (params_inst%vcmaxhd, vcmaxse) jmaxc = fth25 (params_inst%jmaxhd, jmaxse) tpuc = fth25 (params_inst%tpuhd, tpuse) @@ -1659,7 +1834,11 @@ subroutine Photosynthesis ( bounds, fn, filterp, & psn_wc_z(p,iv) = 0._r8 psn_wj_z(p,iv) = 0._r8 psn_wp_z(p,iv) = 0._r8 - rs_z(p,iv) = min(rsmax0, 1._r8/bbb(p) * cf) + if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then + rs_z(p,iv) = min(rsmax0, 1._r8/bbb(p) * cf) + else if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then + rs_z(p,iv) = min(rsmax0, 1._r8/medlynintercept(patch%itype(p)) * cf) + end if ci_z(p,iv) = 0._r8 rh_leaf(p) = 0._r8 @@ -1671,7 +1850,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & rh_can = ceair / esat_tv(p) else if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then ! Put some constraints on RH in the canopy when Medlyn stomatal conductance is being used - rh_can = max((esat_tv(p) - ceair), 50._r8) * 0.001_r8 + rh_can = max((esat_tv(p) - ceair), medlyn_rh_can_max) * medlyn_rh_can_fact vpd_can(p) = rh_can end if @@ -1710,7 +1889,23 @@ subroutine Photosynthesis ( bounds, fn, filterp, & ! End of ci iteration. Check for an < 0, in which case gs_mol = bbb - if (an(p,iv) < 0._r8) gs_mol(p,iv) = bbb(p) + if (an(p,iv) < 0._r8) then + if (stomatalcond_mtd == stomatalcond_mtd_bb1987) then + gs_mol(p,iv) = bbb(p) + else if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then + gs_mol(p,iv) = medlynintercept(patch%itype(p)) + end if + end if + + ! + ! This sets the variables GSSUN and GSSHA + ! + ! Write stomatal conductance to the appropriate phase + if (phase=='sun') then + gs_mol_sun(p,iv) = gs_mol(p,iv) + else if (phase=='sha') then + gs_mol_sha(p,iv) = gs_mol(p,iv) + end if ! Use time period 1 hour before and 1 hour after local noon inclusive (11AM-1PM) if ( is_near_local_noon( grc%londeg(g), deltasec=3600 ) )then @@ -1730,7 +1925,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) cs = cair(p) - 1.4_r8/gb_mol(p) * an(p,iv) * forc_pbot(c) - cs = max(cs,1.e-06_r8) + cs = max(cs,max_cs) ci_z(p,iv) = cair(p) - an(p,iv) * forc_pbot(c) * (1.4_r8*gs_mol(p,iv)+1.6_r8*gb_mol(p)) / (gb_mol(p)*gs_mol(p,iv)) ! Trap for values of ci_z less than 1.e-06. This is needed for @@ -1765,20 +1960,20 @@ subroutine Photosynthesis ( bounds, fn, filterp, & if (gs_mol(p,iv) < 0._r8) then write (iulog,*)'Negative stomatal conductance:' write (iulog,*)'p,iv,gs_mol= ',p,iv,gs_mol(p,iv) - call endrun(decomp_index=p, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) end if ! Compare with Ball-Berry model: gs_mol = m * an * hs/cs p + b - - hs = (gb_mol(p)*ceair + gs_mol(p,iv)*esat_tv(p)) / ((gb_mol(p)+gs_mol(p,iv))*esat_tv(p)) - rh_leaf(p) = hs - gs_mol_err = mbb(p)*max(an(p,iv), 0._r8)*hs/cs*forc_pbot(c) + bbb(p) - - if (abs(gs_mol(p,iv)-gs_mol_err) > 1.e-01_r8) then - write (iulog,*) 'Ball-Berry error check - stomatal conductance error:' - write (iulog,*) gs_mol(p,iv), gs_mol_err - end if - + if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then + hs = (gb_mol(p)*ceair + gs_mol(p,iv)*esat_tv(p)) / ((gb_mol(p)+gs_mol(p,iv))*esat_tv(p)) + rh_leaf(p) = hs + gs_mol_err = mbb(p)*max(an(p,iv), 0._r8)*hs/cs*forc_pbot(c) + bbb(p) + + if (abs(gs_mol(p,iv)-gs_mol_err) > 1.e-01_r8) then + write (iulog,*) 'Ball-Berry error check - stomatal conductance error:' + write (iulog,*) gs_mol(p,iv), gs_mol_err + end if + endif end if ! night or day if branch end do ! canopy layer loop end do ! patch loop @@ -2200,7 +2395,7 @@ subroutine brent(x, x1,x2,f1, f2, tol, ip, iv, ic, gb_mol, je, cair, oair,& fb=f2 if((fa > 0._r8 .and. fb > 0._r8).or.(fa < 0._r8 .and. fb < 0._r8))then write(iulog,*) 'root must be bracketed for brent' - call endrun(msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=ip, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) endif c=b fc=fb @@ -2380,7 +2575,7 @@ subroutine ci_func(ci, fval, p, iv, c, gb_mol, je, cair, oair, lmr_z, par_z,& !local variables real(r8) :: ai ! intermediate co-limited photosynthesis (umol CO2/m**2/s) real(r8) :: cs ! CO2 partial pressure at leaf surface (Pa) - + real(r8) :: term ! intermediate in Medlyn stomatal model real(r8) :: aquad, bquad, cquad ! terms for quadratic equations real(r8) :: r1, r2 ! roots of quadratic equation !------------------------------------------------------------------------------ @@ -2389,6 +2584,9 @@ subroutine ci_func(ci, fval, p, iv, c, gb_mol, je, cair, oair, lmr_z, par_z,& forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Output: [real(r8) (:) ] atmospheric pressure (Pa) c3flag => photosyns_inst%c3flag_patch , & ! Output: [logical (:) ] true if C3 and false if C4 ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type + medlynslope => pftcon%medlynslope , & ! Input: [real(r8) (:) ] Slope for Medlyn stomatal conductance model method + medlynintercept => pftcon%medlynintercept , & ! Input: [real(r8) (:) ] Intercept for Medlyn stomatal conductance model method + stomatalcond_mtd => photosyns_inst%stomatalcond_mtd , & ! Input: [integer ] method type to use for stomatal conductance ac => photosyns_inst%ac_patch , & ! Output: [real(r8) (:,:) ] Rubisco-limited gross photosynthesis (umol CO2/m**2/s) aj => photosyns_inst%aj_patch , & ! Output: [real(r8) (:,:) ] RuBP-limited gross photosynthesis (umol CO2/m**2/s) ap => photosyns_inst%ap_patch , & ! Output: [real(r8) (:,:) ] product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) @@ -2450,15 +2648,30 @@ subroutine ci_func(ci, fval, p, iv, c, gb_mol, je, cair, oair, lmr_z, par_z,& return endif ! Quadratic gs_mol calculation with an known. Valid for an >= 0. - ! With an <= 0, then gs_mol = bbb - + ! With an <= 0, then gs_mol = bbb or medlyn intercept cs = cair - 1.4_r8/gb_mol * an(p,iv) * forc_pbot(c) - cs = max(cs,1.e-06_r8) - aquad = cs - bquad = cs*(gb_mol - bbb(p)) - mbb(p)*an(p,iv)*forc_pbot(c) - cquad = -gb_mol*(cs*bbb(p) + mbb(p)*an(p,iv)*forc_pbot(c)*rh_can) - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol = max(r1,r2) + cs = max(cs,max_cs) + if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then + term = 1.6_r8 * an(p,iv) / (cs / forc_pbot(c) * 1.e06_r8) + aquad = 1.0_r8 + bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & + (gb_mol*1.e-06_r8 * rh_can)) + cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + & + (2.0*medlynintercept(patch%itype(p))*1.e-06_r8 + term * & + (1.0 - medlynslope(patch%itype(p))* medlynslope(patch%itype(p)) / rh_can)) * term + + call quadratic (aquad, bquad, cquad, r1, r2) + gs_mol = max(r1,r2) * 1.e06_r8 + else if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then + aquad = cs + bquad = cs*(gb_mol - bbb(p)) - mbb(p)*an(p,iv)*forc_pbot(c) + cquad = -gb_mol*(cs*bbb(p) + mbb(p)*an(p,iv)*forc_pbot(c)*rh_can) + call quadratic (aquad, bquad, cquad, r1, r2) + gs_mol = max(r1,r2) + end if + + + ! Derive new estimate for ci @@ -2854,7 +3067,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & soil_conductance = min(hksat(c,j),hk_l(c,j))/(1.e3_r8*r_soil) ! use vegetation plc function to adjust root conductance - fs(j)= plc(smp(c,j),p,c,root,veg) + fs(j)= plc(smp(c,j),p,root,veg) ! krmax is root conductance per area per length root_conductance = (fs(j)*rai(j)*params_inst%krmax(ivt(p)))/(croot_average_length + z(c,j)) @@ -2897,10 +3110,10 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & if (c3flag(p)) then qe(p) = 0._r8 - bbbopt(p) = 10000._r8 + if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 ) bbbopt(p) = bbbopt_c3 else qe(p) = 0.05_r8 - bbbopt(p) = 40000._r8 + if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 ) bbbopt(p) = bbbopt_c4 end if if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then @@ -3020,7 +3233,8 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! Parameters derived from vcmax25top. Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 ! used jmax25 = 1.97 vcmax25, from Wullschleger (1993) Journal of Experimental Botany 44:907-920. - jmax25top = (2.59_r8 - 0.035_r8*min(max((t10(p)-tfrz),11._r8),35._r8)) * vcmax25top + jmax25top = ((2.59_r8 - 0.035_r8*min(max((t10(p)-tfrz),11._r8),35._r8)) * vcmax25top) * & + params_inst%jmax25top_sf tpu25top = params_inst%tpu25ratio * vcmax25top kp25top = params_inst%kp25ratio * vcmax25top luvcmax25top(p) = vcmax25top @@ -3177,12 +3391,14 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! Adjust for temperature ! Acclimation is done for Kattge - vcmaxse = 668.39_r8 - 1.07_r8 * min(max((t10(p)-tfrz),11._r8),35._r8) - jmaxse = 659.70_r8 - 0.75_r8 * min(max((t10(p)-tfrz),11._r8),35._r8) + vcmaxse = (668.39_r8 - 1.07_r8 * min(max((t10(p)-tfrz),11._r8),35._r8)) * params_inst%vcmaxse_sf + jmaxse = (659.70_r8 - 0.75_r8 * min(max((t10(p)-tfrz),11._r8),35._r8)) * params_inst%jmaxse_sf ! These values are used for Leuning !vcmaxse = 486.0_r8 !jmaxse = 495.0_r8 - tpuse = vcmaxse + + ! NOTE: tpuse acts the same as vcmaxse (same constants) + tpuse = (668.39_r8 - 1.07_r8 * min(max((t10(p)-tfrz),11._r8),35._r8)) * params_inst%tpuse_sf vcmaxc = fth25 (params_inst%vcmaxhd, vcmaxse) jmaxc = fth25 (params_inst%jmaxhd, jmaxse) tpuc = fth25 (params_inst%tpuhd, tpuse) @@ -3308,7 +3524,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & rh_can = ceair / esat_tv(p) else if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then ! Put some constraints on RH in the canopy when Medlyn stomatal conductance is being used - rh_can = max((esat_tv(p) - ceair), 50._r8) * 0.001_r8 + rh_can = max((esat_tv(p) - ceair), medlyn_rh_can_max) * medlyn_rh_can_fact vpd_can(p) = rh_can end if @@ -3375,7 +3591,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) cs_sun = cair(p) - 1.4_r8/gb_mol(p) * an_sun(p,iv) * forc_pbot(c) - cs_sun = max(cs_sun,1.e-06_r8) + cs_sun = max(cs_sun,max_cs) ci_z_sun(p,iv) = cair(p) - an_sun(p,iv) * forc_pbot(c) * & (1.4_r8*gs_mol_sun(p,iv)+1.6_r8*gb_mol(p)) / & (gb_mol(p)*gs_mol_sun(p,iv)) @@ -3385,7 +3601,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & ci_z_sun(p,iv) = max( ci_z_sun(p,iv), 1.e-06_r8 ) cs_sha = cair(p) - 1.4_r8/gb_mol(p) * an_sha(p,iv) * forc_pbot(c) - cs_sha = max(cs_sha,1.e-06_r8) + cs_sha = max(cs_sha,max_cs) ci_z_sha(p,iv) = cair(p) - an_sha(p,iv) * forc_pbot(c) * & (1.4_r8*gs_mol_sha(p,iv)+1.6_r8*gb_mol(p)) / & (gb_mol(p)*gs_mol_sha(p,iv)) @@ -3440,7 +3656,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & if (gs_mol_sun(p,iv) < 0._r8 .or. gs_mol_sha(p,iv) < 0._r8) then write (iulog,*)'Negative stomatal conductance:' write (iulog,*)'p,iv,gs_mol_sun,gs_mol_sha= ',p,iv,gs_mol_sun(p,iv),gs_mol_sha(p,iv) - call endrun(decomp_index=p, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) end if ! Compare with Ball-Berry model: gs_mol = m * an * hs/cs p + b @@ -3884,7 +4100,7 @@ subroutine brent_PHS(xsun, x1sun, x2sun, f1sun, f2sun, xsha, x1sha, x2sha, f1sha do phase=1, nphs if ( (fa(phase) > 0._r8 .and. fb(phase) > 0._r8) .or. (fa(phase) < 0._r8 .and. fb(phase) < 0._r8) ) then write(iulog,*) 'root must be bracketed for brent' - call endrun(msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=ip, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) endif enddo @@ -4153,14 +4369,18 @@ subroutine ci_func_PHS(x,cisun, cisha, fvalsun, fvalsha, p, iv, c, bsun, bsha, b ! Sunlit if (an_sun(p,iv) >= 0._r8) then cs_sun = cair - 1.4_r8/gb_mol * an_sun(p,iv) * forc_pbot(c) - cs_sun = max(cs_sun,10.e-06_r8) + cs_sun = max(cs_sun,max_cs) end if if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then + ! Note for Medlyn we are NOT modifying the intercept by water stress as we do for + ! Ball-Berry below. + ! Whether the intercept should be modified by water stress is an open + ! science quesiton. if (an_sun(p,iv) >= 0._r8) then term = 1.6_r8 * an_sun(p,iv) / (cs_sun / forc_pbot(c) * 1.e06_r8) aquad = 1.0_r8 - bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & + bquad = -(2.0_r8 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & (gb_mol*1.e-06_r8 * rh_can)) cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + & (2.0_r8*medlynintercept(patch%itype(p))*1.e-06_r8 + term * & @@ -4173,20 +4393,24 @@ subroutine ci_func_PHS(x,cisun, cisha, fvalsun, fvalsha, p, iv, c, bsun, bsha, b ! Shaded if (an_sha(p,iv) >= 0._r8) then cs_sha = cair - 1.4_r8/gb_mol * an_sha(p,iv) * forc_pbot(c) - cs_sha = max(cs_sha,10.e-06_r8) + cs_sha = max(cs_sha,max_cs) term = 1.6_r8 * an_sha(p,iv) / (cs_sha / forc_pbot(c) * 1.e06_r8) aquad = 1.0_r8 - bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & + bquad = -(2.0_r8 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & (gb_mol*1.e-06_r8 * rh_can)) cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + & - (2.0*medlynintercept(patch%itype(p))*1.e-06_r8 + term * (1.0 - medlynslope(patch%itype(p))* & + (2.0_r8*medlynintercept(patch%itype(p))*1.e-06_r8 + term * (1.0 - medlynslope(patch%itype(p))* & medlynslope(patch%itype(p)) / rh_can)) * term call quadratic (aquad, bquad, cquad, r1, r2) gs_mol_sha = max(r1,r2)* 1.e06_r8 end if else if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then + ! Note for Ball-Berry we modify the intercept (bbb) by water stress (see + ! the multipling factor of bsun and bsha to bbb below). + ! Whether the intercept should be modified by water stress is an open + ! science quesiton. if (an_sun(p,iv) >= 0._r8) then aquad = cs_sun bquad = cs_sun*(gb_mol - max(bsun*bbb(p),1._r8)) - mbb(p)*an_sun(p,iv)*forc_pbot(c) @@ -4198,7 +4422,7 @@ subroutine ci_func_PHS(x,cisun, cisha, fvalsun, fvalsha, p, iv, c, bsun, bsha, b ! Shaded if (an_sha(p,iv) >= 0._r8) then cs_sha = cair - 1.4_r8/gb_mol * an_sha(p,iv) * forc_pbot(c) - cs_sha = max(cs_sha,10.e-06_r8) + cs_sha = max(cs_sha,max_cs) aquad = cs_sha bquad = cs_sha*(gb_mol - max(bsha*bbb(p),1._r8)) - mbb(p)*an_sha(p,iv)*forc_pbot(c) @@ -4396,12 +4620,12 @@ subroutine calcstress(p,c,x,bsun,bsha,gb_mol,gs_mol_sun,gs_mol_sha,qsatl,qaf, & ! solve algebraically call getvegwp(p, c, x, gb_mol, gs0sun, gs0sha, qsatl, qaf, soilflux, & atm2lnd_inst, canopystate_inst, waterdiagnosticbulk_inst, soilstate_inst, temperature_inst) - bsun = plc(x(sun),p,c,sun,veg) - bsha = plc(x(sha),p,c,sha,veg) + bsun = plc(x(sun),p,sun,veg) + bsha = plc(x(sha),p,sha,veg) else ! compute attenuated flux - qsun=qflx_sun*plc(x(sun),p,c,sun,veg) - qsha=qflx_sha*plc(x(sha),p,c,sha,veg) + qsun=qflx_sun*plc(x(sun),p,sun,veg) + qsha=qflx_sha*plc(x(sha),p,sha,veg) ! retrieve stressed stomatal conductance havegs=.FALSE. @@ -4414,12 +4638,12 @@ subroutine calcstress(p,c,x,bsun,bsha,gb_mol,gs_mol_sun,gs_mol_sha,qsatl,qaf, & if (qflx_sun>0._r8) then bsun = gs0sun/gs_mol_sun else - bsun = plc(x(sun),p,c,sun,veg) + bsun = plc(x(sun),p,sun,veg) endif if (qflx_sha>0._r8) then bsha = gs0sha/gs_mol_sha else - bsha = plc(x(sha),p,c,sha,veg) + bsha = plc(x(sha),p,sha,veg) endif endif if ( bsun < 0.01_r8 ) bsun = 0._r8 @@ -4507,7 +4731,8 @@ subroutine spacA(p,c,x,invA,qflx_sun,qflx_sha,flag, & #ifndef NDEBUG ! Only execute this code if DEBUG=TRUE if ( nvegwcs /= 4 )then - call endrun(msg='Error:: this function is hardcoded for 4x4 matrices with nvegwcs==4'//errMsg(__FILE__, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, & + msg='Error:: this function is hardcoded for 4x4 matrices with nvegwcs==4'//errMsg(__FILE__, __LINE__)) end if #endif @@ -4527,16 +4752,16 @@ subroutine spacA(p,c,x,invA,qflx_sun,qflx_sha,flag, & grav1 = htop(p)*1000._r8 !compute conductance attentuation for each segment - fsto1= plc(x(sun),p,c,sun,veg) - fsto2= plc(x(sha),p,c,sha,veg) - fx= plc(x(xyl),p,c,xyl,veg) - fr= plc(x(root),p,c,root,veg) + fsto1= plc(x(sun),p,sun,veg) + fsto2= plc(x(sha),p,sha,veg) + fx= plc(x(xyl),p,xyl,veg) + fr= plc(x(root),p,root,veg) !compute 1st deriv of conductance attenuation for each segment - dfsto1= d1plc(x(sun),p,c,sun,veg) - dfsto2= d1plc(x(sha),p,c,sha,veg) - dfx= d1plc(x(xyl),p,c,xyl,veg) - dfr= d1plc(x(root),p,c,root,veg) + dfsto1= d1plc(x(sun),p,sun,veg) + dfsto2= d1plc(x(sha),p,sha,veg) + dfx= d1plc(x(xyl),p,xyl,veg) + dfr= d1plc(x(root),p,root,veg) !A - f=A*d(vegwp) A(1,1)= - laisun(p) * params_inst%kmax(ivt(p),sun) * fx& @@ -4688,10 +4913,10 @@ subroutine spacF(p,c,x,f,qflx_sun,qflx_sha, & grav1 = htop(p) * 1000._r8 grav2(1:nlevsoi) = z(c,1:nlevsoi) * 1000._r8 - fsto1= plc(x(sun),p,c,sun,veg) - fsto2= plc(x(sha),p,c,sha,veg) - fx= plc(x(xyl),p,c,xyl,veg) - fr= plc(x(root),p,c,root,veg) + fsto1= plc(x(sun),p,sun,veg) + fsto2= plc(x(sha),p,sha,veg) + fx= plc(x(xyl),p,xyl,veg) + fr= plc(x(root),p,root,veg) !compute flux divergence across each plant segment f(sun)= qflx_sun * fsto1 - laisun(p) * params_inst%kmax(ivt(p),sun) * fx * (x(xyl)-x(sun)) @@ -4786,7 +5011,7 @@ subroutine getvegwp(p, c, x, gb_mol, gs_mol_sun, gs_mol_sha, qsatl, qaf, soilflu endif !calculate xylem water potential - fr = plc(x(root),p,c,root,veg) + fr = plc(x(root),p,root,veg) if ( (tsai(p) > 0._r8) .and. (fr > 0._r8) ) then x(xyl) = x(root) - grav1 - (qflx_sun+qflx_sha)/(fr*params_inst%kmax(ivt(p),root)/htop(p)*tsai(p))!removed htop conversion else @@ -4794,7 +5019,7 @@ subroutine getvegwp(p, c, x, gb_mol, gs_mol_sun, gs_mol_sha, qsatl, qaf, soilflu endif !calculate sun/sha leaf water potential - fx = plc(x(xyl),p,c,xyl,veg) + fx = plc(x(xyl),p,xyl,veg) if ( (laisha(p) > 0._r8) .and. (fx > 0._r8) ) then x(sha) = x(xyl) - (qflx_sha/(fx*params_inst%kmax(ivt(p),xyl)*laisha(p))) else @@ -4904,20 +5129,17 @@ subroutine getqflx(p,c,gb_mol,gs_mol_sun,gs_mol_sha,qflx_sun,qflx_sha,qsatl,qaf, end subroutine getqflx !-------------------------------------------------------------------------------- - function plc(x,p,c,level,plc_method) + function plc(x,p,level,plc_method) ! !DESCRIPTION ! Return value of vulnerability curve at x ! ! !ARGUMENTS real(r8) , intent(in) :: x ! water potential input integer , intent(in) :: p ! index for pft - integer , intent(in) :: c ! index for column integer , intent(in) :: level ! veg segment lvl (1:nvegwcs) integer , intent(in) :: plc_method ! real(r8) :: plc ! attenuated conductance [0:1] 0=no flow ! - ! !PARAMETERS - integer , parameter :: vegetation_weibull=0 ! case number !------------------------------------------------------------------------------ associate( & ivt => patch%itype & ! Input: [integer (:) ] patch vegetation type @@ -4929,7 +5151,8 @@ function plc(x,p,c,level,plc_method) plc=2._r8**(-(x/params_inst%psi50(ivt(p),level))**params_inst%ck(ivt(p),level)) if ( plc < 0.005_r8) plc = 0._r8 case default - print *,'must choose plc method' + plc = nan + call endrun( 'ERROR:: Photosynthesis::PLC must choose plc method' ) end select end associate @@ -4938,20 +5161,17 @@ end function plc !-------------------------------------------------------------------------------- !-------------------------------------------------------------------------------- - function d1plc(x,p,c,level,plc_method) + function d1plc(x,p,level,plc_method) ! !DESCRIPTION ! Return 1st derivative of vulnerability curve at x ! ! !ARGUMENTS real(r8) , intent(in) :: x ! water potential input integer , intent(in) :: p ! index for pft - integer , intent(in) :: c ! index for column integer , intent(in) :: level ! veg segment lvl (1:nvegwcs) integer , intent(in) :: plc_method ! 0 for vegetation, 1 for soil real(r8) :: d1plc ! first deriv of plc curve at x ! - ! !PARAMETERS - integer , parameter :: vegetation_weibull=0 ! case number !------------------------------------------------------------------------------ associate( & ivt => patch%itype & ! Input: [integer (:) ] patch vegetation type @@ -4964,7 +5184,8 @@ function d1plc(x,p,c,level,plc_method) **params_inst%ck(ivt(p),level))) & * ((x/params_inst%psi50(ivt(p),level))**params_inst%ck(ivt(p),level)) / x case default - print *,'must choose plc method' + d1plc = nan + call endrun( 'ERROR:: Photosynthesis::D1PLC must choose plc method' ) end select end associate diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 index 6e5c39f8a6..242f6ac359 100644 --- a/src/biogeophys/SnowHydrologyMod.F90 +++ b/src/biogeophys/SnowHydrologyMod.F90 @@ -18,12 +18,12 @@ module SnowHydrologyMod ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_column use abortutils , only : endrun use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use clm_varpar , only : nlevsno, nlevsoi, nlevgrnd, nlevmaxurbgrnd use clm_varctl , only : iulog, use_subgrid_fluxes - use clm_varcon , only : namec, h2osno_max, hfus, denh2o, denice, rpi, spval, tfrz + use clm_varcon , only : h2osno_max, hfus, denh2o, denice, rpi, spval, tfrz use clm_varcon , only : cpice, cpliq use atm2lndType , only : atm2lnd_type use AerosolMod , only : aerosol_type, AerosolFluxes @@ -70,11 +70,16 @@ module SnowHydrologyMod public :: SnowHydrologySetControlForTesting ! Set some of the control settings type, private :: params_type - real(r8) :: wimp ! Water impremeable if porosity less than wimp (unitless) - real(r8) :: ssi ! Irreducible water saturation of snow (unitless) - real(r8) :: drift_gs ! Wind drift compaction / grain size (fixed value for now) (unitless) - real(r8) :: eta0_anderson ! Viscosity coefficent from Anderson1976 (kg*s/m2) - real(r8) :: eta0_vionnet ! Viscosity coefficent from Vionnet2012 (kg*s/m2) + real(r8) :: wimp ! Water impremeable if porosity less than wimp (unitless) + real(r8) :: ssi ! Irreducible water saturation of snow (unitless) + real(r8) :: drift_gs ! Wind drift compaction / grain size (fixed value for now) (unitless) + real(r8) :: eta0_anderson ! Viscosity coefficent from Anderson1976 (kg*s/m2) + real(r8) :: eta0_vionnet ! Viscosity coefficent from Vionnet2012 (kg*s/m2) + real(r8) :: wind_snowcompact_fact ! Reference wind above which fresh snow density is (substantially) increased (m/s) + real(r8) :: rho_max ! Wind drift compaction / maximum density (kg/m3) + real(r8) :: tau_ref ! Wind drift compaction / reference time (48*3600) (s) + real(r8) :: scvng_fct_mlt_sf ! Scaling factor modifying scavenging factors for BC, OC, and dust species inclusion in meltwater (-) + real(r8) :: ceta ! Overburden compaction constant (kg/m3) end type params_type type(params_type), private :: params_inst @@ -147,7 +152,6 @@ module SnowHydrologyMod integer :: new_snow_density = LoTmpDnsSlater2017 ! Snow density type real(r8) :: upplim_destruct_metamorph = 100.0_r8 ! Upper Limit on Destructive Metamorphism Compaction [kg/m3] real(r8) :: overburden_compress_Tfactor = 0.08_r8 ! snow compaction overburden exponential factor (1/K) - real(r8) :: min_wind_snowcompact = 5._r8 ! minimum wind speed tht results in compaction (m/s) ! ------------------------------------------------------------------------ ! Parameters controlling the resetting of the snow pack @@ -207,7 +211,7 @@ subroutine SnowHydrology_readnl( NLFilename) namelist /clm_snowhydrology_inparm/ & wind_dependent_snow_density, snow_overburden_compaction_method, & lotmp_snowdensity_method, upplim_destruct_metamorph, & - overburden_compress_Tfactor, min_wind_snowcompact, & + overburden_compress_Tfactor, & reset_snow, reset_snow_glc, reset_snow_glc_ela, & snow_dzmin_1, snow_dzmax_l_1, snow_dzmax_u_1, & snow_dzmin_2, snow_dzmax_l_2, snow_dzmax_u_2 @@ -243,7 +247,6 @@ subroutine SnowHydrology_readnl( NLFilename) call shr_mpi_bcast (lotmp_snowdensity_method , mpicom) call shr_mpi_bcast (upplim_destruct_metamorph , mpicom) call shr_mpi_bcast (overburden_compress_Tfactor, mpicom) - call shr_mpi_bcast (min_wind_snowcompact , mpicom) call shr_mpi_bcast (reset_snow , mpicom) call shr_mpi_bcast (reset_snow_glc , mpicom) call shr_mpi_bcast (reset_snow_glc_ela , mpicom) @@ -305,6 +308,16 @@ subroutine readParams( ncid ) call readNcdioScalar(ncid, 'eta0_anderson', subname, params_inst%eta0_anderson) ! Viscosity coefficent from Vionnet2012 (kg*s/m2) call readNcdioScalar(ncid, 'eta0_vionnet', subname, params_inst%eta0_vionnet) + ! Reference wind above which fresh snow density is (substantially) increased (m/s) + call readNcdioScalar(ncid, 'wind_snowcompact_fact', subname, params_inst%wind_snowcompact_fact) + ! Wind drift compaction / maximum density (kg/m3) + call readNcdioScalar(ncid, 'rho_max', subname, params_inst%rho_max) + ! Wind drift compaction / reference time (48*3600) (s) + call readNcdioScalar(ncid, 'tau_ref', subname, params_inst%tau_ref) + ! Scaling factor modifying scavenging factors for BC, OC, and dust species inclusion in meltwater (-) + call readNcdioScalar(ncid, 'scvng_fct_mlt_sf', subname, params_inst%scvng_fct_mlt_sf) + ! Overburden compaction constant (kg/m3) + call readNcdioScalar(ncid, 'ceta', subname, params_inst%ceta) end subroutine readParams @@ -1229,7 +1242,8 @@ subroutine UpdateState_TopLayerFluxes(bounds, num_snowc, filter_snowc, & write(iulog,*) "frac_sno_eff = ", frac_sno_eff(c) write(iulog,*) "qflx_soliddew_to_top_layer*dtime = ", qflx_soliddew_to_top_layer(c)*dtime write(iulog,*) "qflx_solidevap_from_top_layer*dtime = ", qflx_solidevap_from_top_layer(c)*dtime - call endrun("In UpdateState_TopLayerFluxes, h2osoi_ice has gone significantly negative") + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg="In UpdateState_TopLayerFluxes, h2osoi_ice has gone significantly negative") end if if (h2osoi_liq(c,lev_top(c)) < 0._r8) then @@ -1242,7 +1256,8 @@ subroutine UpdateState_TopLayerFluxes(bounds, num_snowc, filter_snowc, & write(iulog,*) "qflx_liq_grnd*dtime = ", qflx_liq_grnd(c)*dtime write(iulog,*) "qflx_liqdew_to_top_layer*dtime = ", qflx_liqdew_to_top_layer(c)*dtime write(iulog,*) "qflx_liqevap_from_top_layer*dtime = ", qflx_liqevap_from_top_layer(c)*dtime - call endrun("In UpdateState_TopLayerFluxes, h2osoi_liq has gone significantly negative") + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg="In UpdateState_TopLayerFluxes, h2osoi_liq has gone significantly negative") end if end do @@ -1393,6 +1408,7 @@ subroutine TracerFlux_SnowPercolation(bounds, num_snowc, filter_snowc, & end do call CalcTracerFromBulkMasked( & + subgrid_level = subgrid_level_column, & lb = begc, & num_pts = num_snowc, & filter_pts = filter_snowc, & @@ -1559,7 +1575,8 @@ subroutine CalcAndApplyAerosolFluxes(bounds, num_snowc, filter_snowc, & ! BCPHI: ! 1. flux with meltwater: - qout_bc_phi(c) = qflx_snow_percolation(c,j)*scvng_fct_mlt_bcphi*(mss_bcphi(c,j)/mss_liqice) + qout_bc_phi(c) = qflx_snow_percolation(c,j)*params_inst%scvng_fct_mlt_sf* & + scvng_fct_mlt_bcphi*(mss_bcphi(c,j)/mss_liqice) if (qout_bc_phi(c)*dtime > mss_bcphi(c,j)) then qout_bc_phi(c) = mss_bcphi(c,j)/dtime mss_bcphi(c,j) = 0._r8 @@ -1570,7 +1587,8 @@ subroutine CalcAndApplyAerosolFluxes(bounds, num_snowc, filter_snowc, & ! BCPHO: ! 1. flux with meltwater: - qout_bc_pho(c) = qflx_snow_percolation(c,j)*scvng_fct_mlt_bcpho*(mss_bcpho(c,j)/mss_liqice) + qout_bc_pho(c) = qflx_snow_percolation(c,j)*params_inst%scvng_fct_mlt_sf* & + scvng_fct_mlt_bcpho*(mss_bcpho(c,j)/mss_liqice) if (qout_bc_pho(c)*dtime > mss_bcpho(c,j)) then qout_bc_pho(c) = mss_bcpho(c,j)/dtime mss_bcpho(c,j) = 0._r8 @@ -1581,7 +1599,8 @@ subroutine CalcAndApplyAerosolFluxes(bounds, num_snowc, filter_snowc, & ! OCPHI: ! 1. flux with meltwater: - qout_oc_phi(c) = qflx_snow_percolation(c,j)*scvng_fct_mlt_ocphi*(mss_ocphi(c,j)/mss_liqice) + qout_oc_phi(c) = qflx_snow_percolation(c,j)*params_inst%scvng_fct_mlt_sf* & + scvng_fct_mlt_ocphi*(mss_ocphi(c,j)/mss_liqice) if (qout_oc_phi(c)*dtime > mss_ocphi(c,j)) then qout_oc_phi(c) = mss_ocphi(c,j)/dtime mss_ocphi(c,j) = 0._r8 @@ -1592,7 +1611,8 @@ subroutine CalcAndApplyAerosolFluxes(bounds, num_snowc, filter_snowc, & ! OCPHO: ! 1. flux with meltwater: - qout_oc_pho(c) = qflx_snow_percolation(c,j)*scvng_fct_mlt_ocpho*(mss_ocpho(c,j)/mss_liqice) + qout_oc_pho(c) = qflx_snow_percolation(c,j)*params_inst%scvng_fct_mlt_sf* & + scvng_fct_mlt_ocpho*(mss_ocpho(c,j)/mss_liqice) if (qout_oc_pho(c)*dtime > mss_ocpho(c,j)) then qout_oc_pho(c) = mss_ocpho(c,j)/dtime mss_ocpho(c,j) = 0._r8 @@ -1603,7 +1623,8 @@ subroutine CalcAndApplyAerosolFluxes(bounds, num_snowc, filter_snowc, & ! DUST 1: ! 1. flux with meltwater: - qout_dst1(c) = qflx_snow_percolation(c,j)*scvng_fct_mlt_dst1*(mss_dst1(c,j)/mss_liqice) + qout_dst1(c) = qflx_snow_percolation(c,j)*params_inst%scvng_fct_mlt_sf* & + scvng_fct_mlt_dst1*(mss_dst1(c,j)/mss_liqice) if (qout_dst1(c)*dtime > mss_dst1(c,j)) then qout_dst1(c) = mss_dst1(c,j)/dtime mss_dst1(c,j) = 0._r8 @@ -1614,7 +1635,8 @@ subroutine CalcAndApplyAerosolFluxes(bounds, num_snowc, filter_snowc, & ! DUST 2: ! 1. flux with meltwater: - qout_dst2(c) = qflx_snow_percolation(c,j)*scvng_fct_mlt_dst2*(mss_dst2(c,j)/mss_liqice) + qout_dst2(c) = qflx_snow_percolation(c,j)*params_inst%scvng_fct_mlt_sf* & + scvng_fct_mlt_dst2*(mss_dst2(c,j)/mss_liqice) if (qout_dst2(c)*dtime > mss_dst2(c,j)) then qout_dst2(c) = mss_dst2(c,j)/dtime mss_dst2(c,j) = 0._r8 @@ -1625,7 +1647,8 @@ subroutine CalcAndApplyAerosolFluxes(bounds, num_snowc, filter_snowc, & ! DUST 3: ! 1. flux with meltwater: - qout_dst3(c) = qflx_snow_percolation(c,j)*scvng_fct_mlt_dst3*(mss_dst3(c,j)/mss_liqice) + qout_dst3(c) = qflx_snow_percolation(c,j)*params_inst%scvng_fct_mlt_sf* & + scvng_fct_mlt_dst3*(mss_dst3(c,j)/mss_liqice) if (qout_dst3(c)*dtime > mss_dst3(c,j)) then qout_dst3(c) = mss_dst3(c,j)/dtime mss_dst3(c,j) = 0._r8 @@ -1636,7 +1659,8 @@ subroutine CalcAndApplyAerosolFluxes(bounds, num_snowc, filter_snowc, & ! DUST 4: ! 1. flux with meltwater: - qout_dst4(c) = qflx_snow_percolation(c,j)*scvng_fct_mlt_dst4*(mss_dst4(c,j)/mss_liqice) + qout_dst4(c) = qflx_snow_percolation(c,j)*params_inst%scvng_fct_mlt_sf* & + scvng_fct_mlt_dst4*(mss_dst4(c,j)/mss_liqice) if (qout_dst4(c)*dtime > mss_dst4(c,j)) then qout_dst4(c) = mss_dst4(c,j)/dtime mss_dst4(c,j) = 0._r8 @@ -2813,14 +2837,14 @@ subroutine DivideSnowLayers(bounds, num_snowc, filter_snowc, & if ( abs(dztot(c)) > 1.e-10_r8) then write(iulog,*)'Inconsistency in SnowDivision_Lake! c, remainders', & 'dztot = ',c,dztot(c) - call endrun(decomp_index=c, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) end if do wi = water_inst%bulk_and_tracers_beg, water_inst%bulk_and_tracers_end if ( abs(snwicetot(wi,c)) > 1.e-7_r8 .or. abs(snwliqtot(wi,c)) > 1.e-7_r8 ) then write(iulog,*)'Inconsistency in SnowDivision_Lake! wi, c, remainders', & 'snwicetot, snwliqtot = ',wi,c,snwicetot(wi,c),snwliqtot(wi,c) - call endrun(decomp_index=c, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) end if end do end if @@ -3279,7 +3303,7 @@ subroutine BulkFlux_SnowCappingFluxes(bounds, num_snowc, filter_snowc, & ! Always keep at least this fraction of the bottom snow layer when doing snow capping ! This needs to be slightly greater than 0 to avoid roundoff problems - real(r8), parameter :: min_snow_to_keep = 1.e-9_r8 ! fraction of bottom snow layer to keep with capping + real(r8), parameter :: min_snow_to_keep = 1.e-3_r8 ! fraction of bottom snow layer to keep with capping character(len=*), parameter :: subname = 'BulkFlux_SnowCappingFluxes' !----------------------------------------------------------------------- @@ -3478,6 +3502,7 @@ subroutine TracerFlux_SnowCappingFluxes(bounds, snow_capping_filterc, & ) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_column, & lb = begc, & num_pts = snow_capping_filterc%num, & filter_pts = snow_capping_filterc%indices, & @@ -3487,6 +3512,7 @@ subroutine TracerFlux_SnowCappingFluxes(bounds, snow_capping_filterc, & tracer_val = trac_qflx_snwcp_ice(begc:endc)) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_column, & lb = begc, & num_pts = snow_capping_filterc%num, & filter_pts = snow_capping_filterc%indices, & @@ -3496,6 +3522,7 @@ subroutine TracerFlux_SnowCappingFluxes(bounds, snow_capping_filterc, & tracer_val = trac_qflx_snwcp_liq(begc:endc)) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_column, & lb = begc, & num_pts = snow_capping_filterc%num, & filter_pts = snow_capping_filterc%indices, & @@ -3505,6 +3532,7 @@ subroutine TracerFlux_SnowCappingFluxes(bounds, snow_capping_filterc, & tracer_val = trac_qflx_snwcp_discarded_ice(begc:endc)) call CalcTracerFromBulk( & + subgrid_level = subgrid_level_column, & lb = begc, & num_pts = snow_capping_filterc%num, & filter_pts = snow_capping_filterc%indices, & @@ -3558,7 +3586,7 @@ subroutine UpdateState_RemoveSnowCappingFluxes(bounds, snow_capping_filterc, & if (h2osoi_ice_bottom(c) < 0._r8 .or. h2osoi_liq_bottom(c) < 0._r8 ) then write(iulog,*)'ERROR: capping procedure failed (negative mass remaining) c = ',c write(iulog,*)'h2osoi_ice_bottom = ', h2osoi_ice_bottom(c), ' h2osoi_liq_bottom = ', h2osoi_liq_bottom(c) - call endrun(decomp_index=c, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) end if end do @@ -3698,7 +3726,8 @@ subroutine NewSnowBulkDensity(bounds, num_c, filter_c, atm2lnd_inst, bifall) ! Density offset for wind-driven compaction, initial ideas based on Liston et. al (2007) J. Glaciology, ! 53(181), 241-255. Modified for a continuous wind impact and slightly more sensitive ! to wind - Andrew Slater, 2016 - bifall(c) = bifall(c) + (266.861_r8 * ((1._r8 + TANH(forc_wind(g)/5.0_r8))/2._r8)**8.8_r8) + bifall(c) = bifall(c) + (266.861_r8 * ((1._r8 + & + TANH(forc_wind(g)/params_inst%wind_snowcompact_fact))/2._r8)**8.8_r8) end if end do @@ -3763,7 +3792,6 @@ function OverburdenCompactionVionnet2012(h2osoi_liq, dz, burden, wx, td, bi) & real(r8) :: f1, f2 ! overburden compaction modifiers to viscosity real(r8) :: eta ! Viscosity - real(r8), parameter :: ceta = 450._r8 ! overburden compaction constant [kg/m3] real(r8), parameter :: aeta = 0.1_r8 ! overburden compaction constant [1/K] real(r8), parameter :: beta = 0.023_r8 ! overburden compaction constant [m3/kg] @@ -3772,7 +3800,7 @@ function OverburdenCompactionVionnet2012(h2osoi_liq, dz, burden, wx, td, bi) & f1 = 1._r8 / (1._r8 + 60._r8 * h2osoi_liq / (denh2o * dz)) f2 = 4.0_r8 ! currently fixed to maximum value, holds in absence of angular grains - eta = f1*f2*(bi/ceta)*exp(aeta*td + beta*bi)*params_inst%eta0_vionnet + eta = f1*f2*(bi/params_inst%ceta)*exp(aeta*td + beta*bi)*params_inst%eta0_vionnet compaction_rate = -(burden+wx/2._r8) / eta end function OverburdenCompactionVionnet2012 @@ -3811,9 +3839,7 @@ subroutine WindDriftCompaction(bi, forc_wind, dz, & real(r8) :: tau_inverse ! Inverse of the effective time scale [1/s] real(r8), parameter :: rho_min = 50._r8 ! wind drift compaction / minimum density [kg/m3] - real(r8), parameter :: rho_max = 350._r8 ! wind drift compaction / maximum density [kg/m3] real(r8), parameter :: drift_sph = 1.0_r8 ! wind drift compaction / sphericity - real(r8), parameter :: tau_ref = 48._r8 * 3600._r8 ! wind drift compaction / reference time [s] character(len=*), parameter :: subname = 'WindDriftCompaction' !----------------------------------------------------------------------- @@ -3830,8 +3856,8 @@ subroutine WindDriftCompaction(bi, forc_wind, dz, & ! the pseudo-node for the sake of the following calculation zpseudo = zpseudo + 0.5_r8 * dz * (3.25_r8 - SI) gamma_drift = SI*exp(-zpseudo/0.1_r8) - tau_inverse = gamma_drift / tau_ref - compaction_rate = -max(0.0_r8, rho_max-bi) * tau_inverse + tau_inverse = gamma_drift / params_inst%tau_ref + compaction_rate = -max(0.0_r8, params_inst%rho_max-bi) * tau_inverse ! Further increase zpseudo to the bottom of the pseudo-node for ! the sake of calculations done on the underlying layer (i.e., ! the next time through the j loop). @@ -3996,6 +4022,8 @@ subroutine SnowHydrologySetControlForTesting( set_winddep_snowdensity, set_new_s snow_dzmax_u_1 = 0.02_r8 ! user_nl_clm snow_dzmax_u_2 = 0.05_r8 + params_inst%wind_snowcompact_fact = 5.0_r8 + end subroutine SnowHydrologySetControlForTesting !----------------------------------------------------------------------- diff --git a/src/biogeophys/SnowSnicarMod.F90 b/src/biogeophys/SnowSnicarMod.F90 index 196d239460..77cc5b53d6 100644 --- a/src/biogeophys/SnowSnicarMod.F90 +++ b/src/biogeophys/SnowSnicarMod.F90 @@ -12,10 +12,10 @@ module SnowSnicarMod use shr_sys_mod , only : shr_sys_flush use shr_log_mod , only : errMsg => shr_log_errMsg use clm_varctl , only : iulog - use clm_varcon , only : namec , tfrz + use clm_varcon , only : tfrz use shr_const_mod , only : SHR_CONST_RHOICE use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_column use AerosolMod , only : snw_rds_min use atm2lndType , only : atm2lnd_type use WaterStateBulkType , only : waterstatebulk_type @@ -34,6 +34,14 @@ module SnowSnicarMod public :: SnowAge_grain ! Snow effective grain size evolution public :: SnowAge_init ! Initial read in of snow-aging file public :: SnowOptics_init ! Initial read in of snow-optics file + + type, private :: params_type + real(r8) :: xdrdt ! Arbitrary factor applied to snow aging rate (-) + real(r8) :: snw_rds_refrz ! Effective radius of re-frozen snow (microns) + real(r8) :: C2_liq_Brun89 ! Constant for liquid water grain growth [m3 s-1], + ! from Brun89: corrected for LWC in units of percent + end type params_type + type(params_type), private :: params_inst ! ! !PUBLIC DATA MEMBERS: integer, public, parameter :: sno_nbr_aer = 8 ! number of aerosol species in snowpack @@ -59,7 +67,6 @@ module SnowSnicarMod integer, parameter :: snw_rds_min_tbl = 30 ! minimium effective radius defined in Mie lookup table [microns] integer, parameter :: snw_rds_min_int = nint(snw_rds_min) ! minimum allowed snow effective radius as integer [microns] real(r8), parameter :: snw_rds_max = 1500._r8 ! maximum allowed snow effective radius [microns] - real(r8), parameter :: snw_rds_refrz = 1000._r8 ! effective radius of re-frozen snow [microns] real(r8), parameter :: min_snw = 1.0E-30_r8 ! minimum snow mass required for SNICAR RT calculation [kg m-2] @@ -67,8 +74,6 @@ module SnowSnicarMod ! from Brun89 real(r8), parameter :: C1_liq_Brun89 = 0._r8 ! constant for liquid water grain growth [m3 s-1], ! from Brun89: zeroed to accomodate dry snow aging - real(r8), parameter :: C2_liq_Brun89 = 4.22E-13_r8 ! constant for liquid water grain growth [m3 s-1], - ! from Brun89: corrected for LWC in units of percent real(r8), parameter :: tim_cns_bc_rmv = 2.2E-8_r8 ! time constant for removal of BC in snow on sea-ice ! [s-1] (50% mass removal/year) @@ -79,7 +84,6 @@ module SnowSnicarMod ! scaling of the snow aging rate (tuning option): logical :: flg_snoage_scl = .false. ! flag for scaling the snow aging rate by some arbitrary factor - real(r8), parameter :: xdrdt = 1.0_r8 ! arbitrary factor applied to snow aging rate ! snow and aerosol Mie parameters: ! (arrays declared here, but are set in iniTimeConst) @@ -153,6 +157,30 @@ module SnowSnicarMod contains + !---------------------------------------------------------------------------- + subroutine readParams( ncid ) + ! + ! !USES: + use ncdio_pio, only: file_desc_t + use paramUtilMod, only: readNcdioScalar + ! + ! !ARGUMENTS: + implicit none + type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id + ! + ! !LOCAL VARIABLES: + character(len=*), parameter :: subname = 'readParams_SnowSnicar' + !-------------------------------------------------------------------- + + ! Arbitrary factor applied to snow aging rate (-) + call readNcdioScalar(ncid, 'xdrdt', subname, params_inst%xdrdt) + ! Effective radius of re-frozen snow (microns) + call readNcdioScalar(ncid, 'snw_rds_refrz', subname, params_inst%snw_rds_refrz) + ! constant for liquid water grain growth [m3 s-1], from Brun89: corrected for LWC in units of percent + call readNcdioScalar(ncid, 'C2_liq_Brun89', subname, params_inst%C2_liq_Brun89) + + end subroutine readParams + !----------------------------------------------------------------------- subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & coszen, flg_slr_in, h2osno_liq, h2osno_ice, h2osno_total, snw_rds, & @@ -427,7 +455,7 @@ subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & write (iulog,*) "column: ", c_idx, " level: ", i, " snl(c)= ", snl_lcl write (iulog,*) "lat= ", lat_coord, " lon= ", lon_coord write (iulog,*) "h2osno_total(c)= ", h2osno_lcl - call endrun(decomp_index=c_idx, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_idx, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) endif enddo @@ -899,7 +927,7 @@ subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & write(iulog,*) "column index: ", c_idx write(iulog,*) "landunit type", lun%itype(l_idx) write(iulog,*) "frac_sno: ", frac_sno(c_idx) - call endrun(decomp_index=c_idx, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_idx, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) else flg_dover = 0 endif @@ -912,7 +940,7 @@ subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & if (abs(energy_sum) > 0.00001_r8) then write (iulog,"(a,e12.6,a,i6,a,i6)") "SNICAR ERROR: Energy conservation error of : ", energy_sum, & " at timestep: ", nstep, " at column: ", c_idx - call endrun(decomp_index=c_idx, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_idx, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) endif albout_lcl(bnd_idx) = albedo @@ -946,7 +974,7 @@ subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & write (iulog,*) "SNICAR STATS: snw_rds(-1)= ", snw_rds(c_idx,-1) write (iulog,*) "SNICAR STATS: snw_rds(0)= ", snw_rds(c_idx,0) - call endrun(decomp_index=c_idx, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_idx, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) endif enddo ! loop over wvl bands @@ -1191,7 +1219,8 @@ subroutine SnowAge_grain(bounds, & !dr_wet = 1E6_r8*(dtime*(C1_liq_Brun89 + C2_liq_Brun89*(frc_liq**(3))) / (4*SHR_CONST_PI*(snw_rds(c_idx,i)/1E6)**(2))) !simplified, units of microns: - dr_wet = 1E18_r8*(dtime*(C2_liq_Brun89*(frc_liq**(3))) / (4*SHR_CONST_PI*snw_rds(c_idx,i)**(2))) + dr_wet = 1E18_r8*(dtime*(params_inst%C2_liq_Brun89*(frc_liq**(3))) / & + (4*SHR_CONST_PI*snw_rds(c_idx,i)**(2))) dr = dr + dr_wet @@ -1200,7 +1229,7 @@ subroutine SnowAge_grain(bounds, & ! ! Multiply rate of change of effective radius by some constant, xdrdt if (flg_snoage_scl) then - dr = dr*xdrdt + dr = dr*params_inst%xdrdt endif @@ -1239,7 +1268,8 @@ subroutine SnowAge_grain(bounds, & snw_rds_fresh = FreshSnowRadius(c_idx, atm2lnd_inst) ! mass-weighted mean of fresh snow, old snow, and re-frozen snow effective radius - snw_rds(c_idx,i) = (snw_rds(c_idx,i)+dr)*frc_oldsnow + snw_rds_fresh*frc_newsnow + snw_rds_refrz*frc_refrz + snw_rds(c_idx,i) = (snw_rds(c_idx,i)+dr)*frc_oldsnow + snw_rds_fresh*frc_newsnow + & + params_inst%snw_rds_refrz*frc_refrz ! !********** 5. CHECK BOUNDARIES *********** ! diff --git a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 b/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 index 384c843760..5f38830891 100644 --- a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 +++ b/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 @@ -20,11 +20,17 @@ module SoilHydrologyInitTimeConstMod ! ! !PUBLIC MEMBER FUNCTIONS: public :: SoilHydrologyInitTimeConst + public :: readParams ! ! !PRIVATE MEMBER FUNCTIONS: private :: initSoilParVIC ! Convert default CLM soil properties to VIC parameters private :: initCLMVICMap ! Initialize map from VIC to CLM layers private :: linear_interp ! function for linear interperation + type, private :: params_type + real(r8) :: pc ! Threshold probability for surface water (unitless) + real(r8) :: om_frac_sf ! Scale factor for organic matter fraction (unitless) + end type params_type + type(params_type), private :: params_inst character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -32,6 +38,28 @@ module SoilHydrologyInitTimeConstMod ! contains + !----------------------------------------------------------------------- + subroutine readParams( ncid ) + ! + ! !USES: + use ncdio_pio, only: file_desc_t + use paramUtilMod, only: readNcdioScalar + ! + ! !ARGUMENTS: + implicit none + type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id + ! + ! !LOCAL VARIABLES: + character(len=*), parameter :: subname = 'readParams_SoilHydrologyInitTimeConst' + !-------------------------------------------------------------------- + + ! Threshold probability for surface water (unitless) + call readNcdioScalar(ncid, 'pc', subname, params_inst%pc) + ! Scale factor for om_frac (unitless) + call readNcdioScalar(ncid, 'om_frac_sf', subname, params_inst%om_frac_sf) + + end subroutine readParams + !----------------------------------------------------------------------- subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, soilstate_inst) ! @@ -43,7 +71,7 @@ subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, soilstate_inst use clm_varctl , only : fsurdat, iulog, use_vichydro use clm_varpar , only : toplev_equalspace use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert - use clm_varcon , only : dzsoi, spval, nlvic, dzvic, pc, grlnd + use clm_varcon , only : dzsoi, spval, nlvic, dzvic, grlnd use clm_varcon , only : aquifer_water_baseline use landunit_varcon , only : istwet, istdlak, istice use column_varcon , only : icol_shadewall, icol_road_perv, icol_road_imperv, icol_roof, icol_sunwall @@ -159,7 +187,7 @@ subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, soilstate_inst if ( lev <= nlevsoi )then claycol(c,lev) = soilstate_inst%cellclay_col(c,lev) sandcol(c,lev) = soilstate_inst%cellsand_col(c,lev) - om_fraccol(c,lev) = min(soilstate_inst%cellorg_col(c,lev) / organic_max, 1._r8) + om_fraccol(c,lev) = min(params_inst%om_frac_sf*soilstate_inst%cellorg_col(c,lev) / organic_max, 1._r8) else claycol(c,lev) = soilstate_inst%cellclay_col(c,nlevsoi) sandcol(c,lev) = soilstate_inst%cellsand_col(c,nlevsoi) @@ -192,7 +220,7 @@ subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, soilstate_inst if (micro_sigma(c) > 1.e-6_r8 .and. (soilhydrology_inst%h2osfcflag /= 0)) then d = 0.0_r8 do p = 1,4 - fd = 0.5_r8*(1.0_r8+shr_spfn_erf(d/(micro_sigma(c)*sqrt(2.0_r8)))) - pc + fd = 0.5_r8*(1.0_r8+shr_spfn_erf(d/(micro_sigma(c)*sqrt(2.0_r8)))) - params_inst%pc dfdd = exp(-d**2/(2.0_r8*micro_sigma(c)**2))/(micro_sigma(c)*sqrt(2.0_r8*shr_const_pi)) d = d - fd/dfdd enddo diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 index 817280c7f4..0a62d45c38 100644 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ b/src/biogeophys/SoilHydrologyMod.F90 @@ -8,7 +8,7 @@ module SoilHydrologyMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_column use clm_varctl , only : iulog, use_vichydro use clm_varcon , only : denh2o, denice, rpi use clm_varcon , only : pondmx_urban @@ -1221,7 +1221,8 @@ subroutine Drainage(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filte !should never be positive... but include for completeness if(rsub_top_tot > 0.) then !rising water table - call endrun(msg="RSUB_TOP IS POSITIVE in Drainage!"//errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg="RSUB_TOP IS POSITIVE in Drainage!"//errmsg(sourcefile, __LINE__)) else ! deepening water table if (use_vichydro) then @@ -2064,7 +2065,8 @@ subroutine LateralFlowPowerLaw(bounds, num_hydrologyc, filter_hydrologyc, & !should never be positive... but include for completeness if(rsub_top_tot > 0.) then !rising water table - call endrun(msg="RSUB_TOP IS POSITIVE in Drainage!"//errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg="RSUB_TOP IS POSITIVE in Drainage!"//errmsg(sourcefile, __LINE__)) else ! deepening water table do j = jwt(c)+1, nbedrock(c) @@ -2313,7 +2315,8 @@ subroutine RenewCondensation(bounds, num_hydrologyc, filter_hydrologyc, & write(iulog,*) "h2osoi_ice_before_evap = ", h2osoi_ice_before_evap(c) write(iulog,*) "h2osoi_ice(c,1) = ", h2osoi_ice(c,1) write(iulog,*) "qflx_solidevap_from_top_layer*dtime = ", qflx_solidevap_from_top_layer(c)*dtime - call endrun("In RenewCondensation, h2osoi_ice has gone significantly negative") + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg="In RenewCondensation, h2osoi_ice has gone significantly negative") end if end do @@ -2392,7 +2395,8 @@ subroutine CalcIrrigWithdrawals(bounds, & ! should never be negative... but include for completeness if(irrig_demand_remaining < 0.) then - call endrun(msg="negative groundwater irrigation demand! "//errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg="negative groundwater irrigation demand! "//errmsg(sourcefile, __LINE__)) else jwt(c) = nlevsoi diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 8bacda1c99..9122b56890 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -34,10 +34,13 @@ module SoilStateInitTimeConstMod real(r8) :: csol_clay ! Heat capacity of clay *10^6 (J/K/m3) real(r8) :: csol_om ! Heat capacity of peat soil *10^6 (Farouki, 1986) (J/K/m3) real(r8) :: csol_sand ! Heat capacity of sand *10^6 (J/K/m3) - real(r8) :: bsw_adjustfactor ! Adjustment factor for bsw (unitless) - real(r8) :: hksat_adjustfactor ! Adjustment factor for hksat (unitless) - real(r8) :: sucsat_adjustfactor ! Adjustment factor for sucsat (unitless) - real(r8) :: watsat_adjustfactor ! Adjustment factor for watsat (unitless) + real(r8) :: bsw_sf ! Scale factor for bsw (unitless) + real(r8) :: hksat_sf ! Scale factor for hksat (unitless) + real(r8) :: sucsat_sf ! Scale factor for sucsat (unitless) + real(r8) :: watsat_sf ! Scale factor for watsat (unitless) + real(r8) :: sand_pf ! Perturbation factor (via addition) for percent sand (percent) + real(r8) :: clay_pf ! Perturbation factor (via addition) for percent clay of clay+silt (percent) + real(r8) :: om_frac_sf ! Scale factor for organic matter fraction (unitless) end type params_type type(params_type), private :: params_inst @@ -135,14 +138,20 @@ subroutine readParams( ncid ) call readNcdioScalar(ncid, 'csol_om', subname, params_inst%csol_om) ! Heat capacity of sand *10^6 (J/K/m3) call readNcdioScalar(ncid, 'csol_sand', subname, params_inst%csol_sand) - ! Adjustment factor for bsw (unitless) - call readNcdioScalar(ncid, 'bsw_adjustfactor', subname, params_inst%bsw_adjustfactor) - ! Adjustment factor for hksat (unitless) - call readNcdioScalar(ncid, 'hksat_adjustfactor', subname, params_inst%hksat_adjustfactor) - ! Adjustment factor for sucsat (unitless) - call readNcdioScalar(ncid, 'sucsat_adjustfactor', subname, params_inst%sucsat_adjustfactor) - ! Adjustment factor for watsat (unitless) - call readNcdioScalar(ncid, 'watsat_adjustfactor', subname, params_inst%watsat_adjustfactor) + ! Scale factor for bsw (unitless) + call readNcdioScalar(ncid, 'bsw_sf', subname, params_inst%bsw_sf) + ! Scale factor for hksat (unitless) + call readNcdioScalar(ncid, 'hksat_sf', subname, params_inst%hksat_sf) + ! Scale factor for sucsat (unitless) + call readNcdioScalar(ncid, 'sucsat_sf', subname, params_inst%sucsat_sf) + ! Scale factor for watsat (unitless) + call readNcdioScalar(ncid, 'watsat_sf', subname, params_inst%watsat_sf) + ! Perturbation factor (via addition) for percent sand (percent) + call readNcdioScalar(ncid, 'sand_pf', subname, params_inst%sand_pf) + ! Perturbation factor (via addition) for percent clay of clay+silt (percent) + call readNcdioScalar(ncid, 'clay_pf', subname, params_inst%clay_pf) + ! Scale factor for organic matter fraction (unitless) + call readNcdioScalar(ncid, 'om_frac_sf', subname, params_inst%om_frac_sf) end subroutine readParams @@ -152,7 +161,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) ! !USES: use shr_log_mod , only : errMsg => shr_log_errMsg use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_gridcell use abortutils , only : endrun use spmdMod , only : masterproc use ncdio_pio , only : file_desc_t, ncd_io, ncd_double, ncd_int, ncd_inqvdlen @@ -160,7 +169,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) use clm_varpar , only : numrad use clm_varpar , only : nlevsoi, nlevgrnd, nlevlak, nlevsoifl, nlayer, nlayert, nlevmaxurbgrnd, nlevsno use clm_varcon , only : zsoi, dzsoi, zisoi, spval - use clm_varcon , only : secspday, pc, mu, denh2o, denice, grlnd + use clm_varcon , only : secspday, denh2o, denice, grlnd use clm_varctl , only : use_cn, use_lch4, use_fates use clm_varctl , only : iulog, fsurdat, paramfile, soil_layerstruct_predefined use landunit_varcon , only : istdlak, istwet, istsoil, istcrop, istice @@ -199,6 +208,9 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) real(r8) :: tkm ! mineral conductivity real(r8) :: xksat ! maximum hydraulic conductivity of soil [mm/s] real(r8) :: clay,sand ! temporaries + real(r8) :: perturbed_sand ! temporary for paramfile implementation of +/- sand percentage + real(r8) :: residual_clay_frac ! temporary for paramfile implementation of +/- residual clay percentage + real(r8) :: perturbed_residual_clay_frac ! temporary for paramfile implementation of +/- residual clay percentage integer :: dimid ! dimension id logical :: readvar type(file_desc_t) :: ncid ! netcdf id @@ -324,14 +336,16 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) g = patch%gridcell(p) if ( sand3d(g,1)+clay3d(g,1) == 0.0_r8 )then if ( any( sand3d(g,:)+clay3d(g,:) /= 0.0_r8 ) )then - call endrun(msg='found depth points that do NOT sum to zero when surface does'//& + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & + msg='found depth points that do NOT sum to zero when surface does'//& errMsg(sourcefile, __LINE__)) end if sand3d(g,:) = 1.0_r8 clay3d(g,:) = 1.0_r8 end if if ( any( sand3d(g,:)+clay3d(g,:) == 0.0_r8 ) )then - call endrun(msg='after setting, found points sum to zero'//errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & + msg='after setting, found points sum to zero'//errMsg(sourcefile, __LINE__)) end if soilstate_inst%sandfrac_patch(p) = sand3d(g,1)/100.0_r8 @@ -430,20 +444,20 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) if (lev .eq. 1) then clay = clay3d(g,1) sand = sand3d(g,1) - om_frac = min(organic3d(g,1)/organic_max, 1._r8) + om_frac = min(params_inst%om_frac_sf*organic3d(g,1)/organic_max, 1._r8) else if (lev <= nlevsoi) then found = 0 ! reset value if (zsoi(lev) <= zisoifl(1)) then ! Search above the dataset's range of zisoifl depths clay = clay3d(g,1) sand = sand3d(g,1) - om_frac = min(organic3d(g,1)/organic_max, 1._r8) + om_frac = min(params_inst%om_frac_sf*organic3d(g,1)/organic_max, 1._r8) found = 1 else if (zsoi(lev) > zisoifl(nlevsoifl)) then ! Search below the dataset's range of zisoifl depths clay = clay3d(g,nlevsoifl) sand = sand3d(g,nlevsoifl) - om_frac = min(organic3d(g,nlevsoifl)/organic_max, 1._r8) + om_frac = min(params_inst%om_frac_sf*organic3d(g,nlevsoifl)/organic_max, 1._r8) found = 1 else ! For remaining model soil levels, search within dataset's @@ -453,7 +467,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) if (zsoi(lev) > zisoifl(j) .AND. zsoi(lev) <= zisoifl(j+1)) then clay = clay3d(g,j+1) sand = sand3d(g,j+1) - om_frac = min(organic3d(g,j+1)/organic_max, 1._r8) + om_frac = min(params_inst%om_frac_sf*organic3d(g,j+1)/organic_max, 1._r8) found = 1 endif if (found == 1) exit ! no need to stay in the loop @@ -479,8 +493,27 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) end if if (lev <= nlevsoi) then - soilstate_inst%cellsand_col(c,lev) = sand - soilstate_inst%cellclay_col(c,lev) = clay + ! This is separated into sections for non-perturbation and perturbation of sand/clay + ! because the perturbation code is not bfb when sand_pf=clay_pf=0. This occurs because + ! of a divide and then a multiply in the code. + if (params_inst%sand_pf == 0._r8 .and. params_inst%clay_pf == 0._r8) then + soilstate_inst%cellsand_col(c,lev) = sand + soilstate_inst%cellclay_col(c,lev) = clay + else + ! by default, will read sand and clay from the surface dataset + ! - sand_pf can be used to perturb the absolute percent sand + ! - clay_pf can be used to perturb what percent of (clay+silt) is clay + if (sand<100._r8) then + residual_clay_frac = clay/(100._r8-sand) + else + residual_clay_frac = 0.5_r8 + end if + perturbed_sand = min(100._r8,max(0._r8,sand+params_inst%sand_pf)) + perturbed_residual_clay_frac = min(1._r8,max(0._r8,residual_clay_frac + & + params_inst%clay_pf/100._r8)) + soilstate_inst%cellsand_col(c,lev) = perturbed_sand + soilstate_inst%cellclay_col(c,lev) = (100._r8-perturbed_sand)*perturbed_residual_clay_frac + end if soilstate_inst%cellorg_col(c,lev) = om_frac*organic_max end if @@ -504,13 +537,13 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) soilstate_inst%bd_col(c,lev) = (1._r8 - soilstate_inst%watsat_col(c,lev))*params_inst%pd ! do not allow watsat_sf to push watsat above 0.93 - soilstate_inst%watsat_col(c,lev) = min(params_inst%watsat_adjustfactor * ( (1._r8 - om_frac) * & + soilstate_inst%watsat_col(c,lev) = min(params_inst%watsat_sf * ( (1._r8 - om_frac) * & soilstate_inst%watsat_col(c,lev) + om_watsat*om_frac ), 0.93_r8) tkm = (1._r8-om_frac) * (params_inst%tkd_sand*sand+params_inst%tkd_clay*clay)/ & (sand+clay)+params_inst%tkm_om*om_frac ! W/(m K) - soilstate_inst%bsw_col(c,lev) = params_inst%bsw_adjustfactor * ( (1._r8-om_frac) * & + soilstate_inst%bsw_col(c,lev) = params_inst%bsw_sf * ( (1._r8-om_frac) * & (2.91_r8 + 0.159_r8*clay) + om_frac*om_b ) - soilstate_inst%sucsat_col(c,lev) = params_inst%sucsat_adjustfactor * ( (1._r8-om_frac) * & + soilstate_inst%sucsat_col(c,lev) = params_inst%sucsat_sf * ( (1._r8-om_frac) * & soilstate_inst%sucsat_col(c,lev) + om_sucsat*om_frac ) soilstate_inst%hksat_min_col(c,lev) = xksat @@ -532,7 +565,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) else uncon_hksat = 0._r8 end if - soilstate_inst%hksat_col(c,lev) = params_inst%hksat_adjustfactor * ( uncon_frac*uncon_hksat + & + soilstate_inst%hksat_col(c,lev) = params_inst%hksat_sf * ( uncon_frac*uncon_hksat + & (perc_frac*om_frac)*om_hksat ) soilstate_inst%tkmg_col(c,lev) = tkm ** (1._r8- soilstate_inst%watsat_col(c,lev)) @@ -587,9 +620,9 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) clay = soilstate_inst%cellclay_col(c,lev) sand = soilstate_inst%cellsand_col(c,lev) if ( organic_frac_squared )then - om_frac = min( (soilstate_inst%cellorg_col(c,lev)/organic_max)**2._r8, 1._r8) + om_frac = min( params_inst%om_frac_sf*(soilstate_inst%cellorg_col(c,lev)/organic_max)**2._r8, 1._r8) else - om_frac = min(soilstate_inst%cellorg_col(c,lev)/organic_max, 1._r8) + om_frac = min(params_inst%om_frac_sf*soilstate_inst%cellorg_col(c,lev)/organic_max, 1._r8) end if else clay = soilstate_inst%cellclay_col(c,nlevsoi) @@ -606,16 +639,16 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) bd = (1._r8-soilstate_inst%watsat_col(c,lev))*params_inst%pd ! do not allow watsat_sf to push watsat above 0.93 - soilstate_inst%watsat_col(c,lev) = min(params_inst%watsat_adjustfactor * ( (1._r8 - om_frac) * & + soilstate_inst%watsat_col(c,lev) = min(params_inst%watsat_sf * ( (1._r8 - om_frac) * & soilstate_inst%watsat_col(c,lev) + om_watsat_lake * om_frac), 0.93_r8) tkm = (1._r8-om_frac)*(params_inst%tkd_sand*sand+params_inst%tkd_clay*clay)/(sand+clay) + & params_inst%tkm_om * om_frac ! W/(m K) - soilstate_inst%bsw_col(c,lev) = params_inst%bsw_adjustfactor * ( (1._r8-om_frac) * & + soilstate_inst%bsw_col(c,lev) = params_inst%bsw_sf * ( (1._r8-om_frac) * & (2.91_r8 + 0.159_r8*clay) + om_frac * om_b_lake ) - soilstate_inst%sucsat_col(c,lev) = params_inst%sucsat_adjustfactor * ( (1._r8-om_frac) * & + soilstate_inst%sucsat_col(c,lev) = params_inst%sucsat_sf * ( (1._r8-om_frac) * & soilstate_inst%sucsat_col(c,lev) + om_sucsat_lake * om_frac ) xksat = 0.0070556_r8 *( 10._r8**(-0.884_r8+0.0153_r8*sand) ) ! mm/s @@ -639,7 +672,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) uncon_hksat = 0._r8 end if - soilstate_inst%hksat_col(c,lev) = params_inst%hksat_adjustfactor * ( uncon_frac*uncon_hksat + & + soilstate_inst%hksat_col(c,lev) = params_inst%hksat_sf * ( uncon_frac*uncon_hksat + & (perc_frac*om_frac)*om_hksat_lake ) soilstate_inst%tkmg_col(c,lev) = tkm ** (1._r8- soilstate_inst%watsat_col(c,lev)) soilstate_inst%tksatu_col(c,lev) = soilstate_inst%tkmg_col(c,lev)*0.57_r8**soilstate_inst%watsat_col(c,lev) diff --git a/src/biogeophys/SoilWaterMovementMod.F90 b/src/biogeophys/SoilWaterMovementMod.F90 index 65dafcefae..70da14a713 100644 --- a/src/biogeophys/SoilWaterMovementMod.F90 +++ b/src/biogeophys/SoilWaterMovementMod.F90 @@ -1068,7 +1068,7 @@ subroutine soilwater_moisture_form(bounds, num_hydrologyc, & use shr_kind_mod , only : r8 => shr_kind_r8 use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_LATICE,SHR_CONST_G use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_column use clm_varctl , only : iulog, use_hydrstress use clm_varcon , only : denh2o, denice use clm_varpar , only : nlevsoi @@ -1307,7 +1307,8 @@ subroutine soilwater_moisture_form(bounds, num_hydrologyc, & rhs, & ! intent(inout): [r8(nlayers )] RHS vector; becomes the solution vector on output nlayers, & ! intent(in): [integer] the leading dimension of matrix rhs err) - if(err/=0) call endrun(subname // ':: problem with the lapack solver') + if(err/=0) call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg = subname // ':: problem with the lapack solver') ! save the iteration increment dwat(filter_hydrologyc(fc),1:nlayers) = rhs(1:nlayers) diff --git a/src/biogeophys/SurfaceAlbedoMod.F90 b/src/biogeophys/SurfaceAlbedoMod.F90 index 1b6eb1888f..151d8751d7 100644 --- a/src/biogeophys/SurfaceAlbedoMod.F90 +++ b/src/biogeophys/SurfaceAlbedoMod.F90 @@ -9,10 +9,10 @@ module SurfaceAlbedoMod ! !PUBLIC TYPES: use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_patch use abortutils , only : endrun use landunit_varcon , only : istsoil, istcrop, istdlak - use clm_varcon , only : grlnd, namep + use clm_varcon , only : grlnd use clm_varpar , only : numrad, nlevcan, nlevsno, nlevcan use clm_varctl , only : fsurdat, iulog, use_snicar_frc, use_SSRE use pftconMod , only : pftcon @@ -908,7 +908,7 @@ subroutine SurfaceAlbedo(bounds,nc, & if (abs(laisum-elai(p)) > 1.e-06_r8 .or. abs(saisum-esai(p)) > 1.e-06_r8) then write (iulog,*) 'multi-layer canopy error 01 in SurfaceAlbedo: ',& nrad(p),elai(p),laisum,esai(p),saisum - call endrun(decomp_index=p, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) end if ! Repeat to find canopy layers buried by snow @@ -948,7 +948,7 @@ subroutine SurfaceAlbedo(bounds,nc, & if (abs(laisum-tlai(p)) > 1.e-06_r8 .or. abs(saisum-tsai(p)) > 1.e-06_r8) then write (iulog,*) 'multi-layer canopy error 02 in SurfaceAlbedo: ',nrad(p),ncan(p) write (iulog,*) tlai(p),elai(p),blai(p),laisum,tsai(p),esai(p),bsai(p),saisum - call endrun(decomp_index=p, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errmsg(sourcefile, __LINE__)) end if end if diff --git a/src/biogeophys/SurfaceRadiationMod.F90 b/src/biogeophys/SurfaceRadiationMod.F90 index e14c31dc62..5378e6315c 100644 --- a/src/biogeophys/SurfaceRadiationMod.F90 +++ b/src/biogeophys/SurfaceRadiationMod.F90 @@ -8,8 +8,7 @@ module SurfaceRadiationMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg use clm_varctl , only : use_snicar_frc, use_fates - use decompMod , only : bounds_type - use clm_varcon , only : namec + use decompMod , only : bounds_type, subgrid_level_column use atm2lndType , only : atm2lnd_type use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type use CanopyStateType , only : canopystate_type @@ -843,7 +842,7 @@ subroutine SurfaceRadiation(bounds, num_nourbanp, filter_nourbanp, & write(iulog,*)"flx_absin2 = ",sum(flx_absin(c,:))*tri(p,2) write(iulog,*)"albgrd_nir = ",albgrd(c,2) write(iulog,*)"coszen = ",coszen(c) - call endrun(decomp_index=c, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errmsg(sourcefile, __LINE__)) endif ! Diagnostic: shortwave penetrating ground (e.g. top layer) diff --git a/src/biogeophys/SurfaceWaterMod.F90 b/src/biogeophys/SurfaceWaterMod.F90 index 031313e9e5..b293dd792c 100644 --- a/src/biogeophys/SurfaceWaterMod.F90 +++ b/src/biogeophys/SurfaceWaterMod.F90 @@ -9,11 +9,11 @@ module SurfaceWaterMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_const_mod , only : shr_const_pi use shr_spfn_mod , only : erf => shr_spfn_erf - use clm_varcon , only : denh2o, denice, roverg, tfrz, pc, mu, rpi + use clm_varcon , only : denh2o, denice, roverg, tfrz, rpi use clm_varpar , only : nlevsno, nlevmaxurbgrnd use clm_time_manager , only : get_step_size_real use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_column use ColumnType , only : col use NumericsMod , only : truncate_small_values use InfiltrationExcessRunoffMod , only : infiltration_excess_runoff_type @@ -32,17 +32,45 @@ module SurfaceWaterMod ! !PUBLIC MEMBER FUNCTIONS: public :: UpdateFracH2oSfc ! Determine fraction of land surfaces which are submerged public :: UpdateH2osfc ! Calculate fluxes out of h2osfc and update the h2osfc state + public :: readParams ! !PRIVATE MEMBER FUNCTIONS: private :: BulkDiag_FracH2oSfc ! Determine fraction of land surfaces which are submerged private :: QflxH2osfcSurf ! Compute qflx_h2osfc_surf private :: QflxH2osfcDrain ! Compute qflx_h2osfc_drain + type, private :: params_type + real(r8) :: pc ! Threshold probability for surface water (unitless) + real(r8) :: mu ! Connectivity exponent for surface water (unitless) + end type params_type + type(params_type), private :: params_inst character(len=*), parameter, private :: sourcefile = & __FILE__ contains + !----------------------------------------------------------------------- + subroutine readParams( ncid ) + ! + ! !USES: + use ncdio_pio, only: file_desc_t + use paramUtilMod, only: readNcdioScalar + ! + ! !ARGUMENTS: + implicit none + type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id + ! + ! !LOCAL VARIABLES: + character(len=*), parameter :: subname = 'readParams_SurfaceWater' + !-------------------------------------------------------------------- + + ! Threshold probability for surface water (unitless) + call readNcdioScalar(ncid, 'pc', subname, params_inst%pc) + ! Connectivity exponent for surface water (unitless) + call readNcdioScalar(ncid, 'mu', subname, params_inst%mu) + + end subroutine readParams + !----------------------------------------------------------------------- subroutine UpdateFracH2oSfc(bounds, num_soilc, filter_soilc, & water_inst) @@ -121,6 +149,7 @@ subroutine UpdateFracH2oSfc(bounds, num_soilc, filter_soilc, & associate(w => water_inst%bulk_and_tracers(i)) call CalcTracerFromBulk( & ! Inputs + subgrid_level = subgrid_level_column, & lb = begc, & num_pts = num_soilc, & filter_pts = filter_soilc, & @@ -443,10 +472,10 @@ subroutine QflxH2osfcSurf(bounds, num_hydrologyc, filter_hydrologyc, & c = filter_hydrologyc(fc) if (h2osfcflag==1) then - if (frac_h2osfc_nosnow(c) <= pc) then + if (frac_h2osfc_nosnow(c) <= params_inst%pc) then frac_infclust=0.0_r8 else - frac_infclust=(frac_h2osfc_nosnow(c)-pc)**mu + frac_infclust=(frac_h2osfc_nosnow(c)-params_inst%pc)**params_inst%mu endif endif diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index f32ec83ac6..f2d9317f82 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -56,7 +56,7 @@ module TemperatureType real(r8), pointer :: thv_col (:) ! col virtual potential temperature (kelvin) real(r8), pointer :: thm_patch (:) ! patch intermediate variable (forc_t+0.0098*forc_hgt_t_patch) real(r8), pointer :: t_a10_patch (:) ! patch 10-day running mean of the 2 m temperature (K) - real(r8), pointer :: soila10_patch (:) ! patch 10-day running mean of the soil layer 3 temperature (K) + real(r8), pointer :: soila10_col (:) ! col 10-day running mean of the 12cm soil layer temperature (K) real(r8), pointer :: t_a10min_patch (:) ! patch 10-day running mean of min 2-m temperature real(r8), pointer :: t_a5min_patch (:) ! patch 5-day running mean of min 2-m temperature @@ -231,7 +231,7 @@ subroutine InitAllocate(this, bounds) allocate(this%thv_col (begc:endc)) ; this%thv_col (:) = nan allocate(this%thm_patch (begp:endp)) ; this%thm_patch (:) = nan allocate(this%t_a10_patch (begp:endp)) ; this%t_a10_patch (:) = nan - allocate(this%soila10_patch (begp:endp)) ; this%soila10_patch (:) = nan + allocate(this%soila10_col (begc:endc)) ; this%soila10_col (:) = nan allocate(this%t_a10min_patch (begp:endp)) ; this%t_a10min_patch (:) = nan allocate(this%t_a5min_patch (begp:endp)) ; this%t_a5min_patch (:) = nan @@ -465,10 +465,10 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) avgflag='A', long_name='10-day running mean of 2-m temperature', & ptr_patch=this%t_a10_patch, default='inactive') - this%soila10_patch(begp:endp) = spval + this%soila10_col(begc:endc) = spval call hist_addfld1d (fname='SOIL10', units='K', & avgflag='A', long_name='10-day running mean of 12cm layer soil', & - ptr_patch=this%soila10_patch, default='inactive') + ptr_col=this%soila10_col, default='inactive') this%t_a5min_patch(begp:endp) = spval call hist_addfld1d (fname='A5TMIN', units='K', & @@ -732,7 +732,7 @@ subroutine InitCold(this, bounds, & end if else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - this%t_soisno_col(c,1:nlevgrnd) = 274._r8 + this%t_soisno_col(c,1:nlevgrnd) = 272._r8 else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & .or. col%itype(c) == icol_roof) then ! Set sunwall, shadewall, roof to fairly high temperature to avoid initialization @@ -1187,7 +1187,7 @@ subroutine InitAccBuffer (this, bounds) subgrid_type='pft', numlev=1,init_value=SHR_CONST_TKFRZ+20._r8) call init_accum_field (name='SOIL10', units='K', & desc='10-day running mean of 3rd layer soil temp.', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1,init_value=SHR_CONST_TKFRZ) + subgrid_type='column', numlev=1,init_value=SHR_CONST_TKFRZ) call init_accum_field (name='TDM5', units='K', & desc='5-day running mean of min 2-m temperature', accum_type='runmean', accum_period=-5, & subgrid_type='pft', numlev=1, init_value=SHR_CONST_TKFRZ) @@ -1247,12 +1247,15 @@ subroutine InitAccVars(this, bounds) ! ! !LOCAL VARIABLES: integer :: begp, endp + integer :: begc, endc integer :: nstep integer :: ier - real(r8), pointer :: rbufslp(:) ! temporary + real(r8), pointer :: rbufslp(:) ! temporary for patch + real(r8), pointer :: rbufslc(:) ! temporary for columns !--------------------------------------------------------------------- begp = bounds%begp; endp = bounds%endp + begc = bounds%begc; endc = bounds%endc ! Allocate needed dynamic memory for single level pft field allocate(rbufslp(begp:endp), stat=ier) @@ -1261,6 +1264,13 @@ subroutine InitAccVars(this, bounds) call endrun(msg="extract_accum_hist allocation error for rbufslp"//& errMsg(sourcefile, __LINE__)) endif + ! Allocate needed dynamic memory for single level column field + allocate(rbufslc(begc:endc), stat=ier) + if (ier/=0) then + write(iulog,*)' in ' + call endrun(msg="extract_accum_hist allocation error for rbufslc"//& + errMsg(sourcefile, __LINE__)) + endif ! Determine time step nstep = get_nstep() @@ -1274,8 +1284,8 @@ subroutine InitAccVars(this, bounds) call extract_accum_field ('T10', rbufslp, nstep) this%t_a10_patch(begp:endp) = rbufslp(begp:endp) - call extract_accum_field ('SOIL10', rbufslp, nstep) - this%soila10_patch(begp:endp) = rbufslp(begp:endp) + call extract_accum_field ('SOIL10', rbufslc, nstep) + this%soila10_col(begc:endc) = rbufslc(begc:endc) call extract_accum_field ('TDM5', rbufslp, nstep) this%t_a5min_patch(begp:endp) = rbufslp(begp:endp) @@ -1321,6 +1331,7 @@ subroutine InitAccVars(this, bounds) end if deallocate(rbufslp) + deallocate(rbufslc) end subroutine InitAccVars @@ -1349,10 +1360,13 @@ subroutine UpdateAccVars (this, bounds) integer :: secs ! seconds into current date for nstep logical :: end_cd ! temporary for is_end_curr_day() value integer :: begp, endp + integer :: begc, endc real(r8), pointer :: rbufslp(:) ! temporary single level - pft level + real(r8), pointer :: rbufslc(:) ! temporary single level - column level !--------------------------------------------------------------------- begp = bounds%begp; endp = bounds%endp + begc = bounds%begc; endc = bounds%endc dtime = get_step_size() nstep = get_nstep() @@ -1366,6 +1380,14 @@ subroutine UpdateAccVars (this, bounds) call endrun(msg=errMsg(sourcefile, __LINE__)) endif + ! Allocate needed dynamic memory for single level column field + + allocate(rbufslc(begc:endc), stat=ier) + if (ier/=0) then + write(iulog,*)'update_accum_hist allocation error for rbuf1dc' + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif + ! Accumulate and extract T_VEG24 & T_VEG240 do p = begp,endp rbufslp(p) = this%t_veg_patch(p) @@ -1466,12 +1488,11 @@ subroutine UpdateAccVars (this, bounds) ! Accumulate and extract SOIL10, for a sepcific soil layer !(acumulates SOIL10 as 10-day running mean) - do p = begp,endp - c = patch%column(p) - rbufslp(p) = this%t_soisno_col(c,upper_soil_layer) + do c = begc,endc + rbufslc(c) = this%t_soisno_col(c,upper_soil_layer) end do - call update_accum_field ('SOIL10', rbufslp, nstep) - call extract_accum_field ('SOIL10', this%soila10_patch, nstep) + call update_accum_field ('SOIL10', rbufslc, nstep) + call extract_accum_field ('SOIL10', this%soila10_col, nstep) ! Accumulate and extract TDM5 @@ -1556,6 +1577,7 @@ subroutine UpdateAccVars (this, bounds) end if deallocate(rbufslp) + deallocate(rbufslc) end subroutine UpdateAccVars diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index e0cd0a375f..0ace2868d6 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -8,7 +8,7 @@ module UrbBuildTempOleson2015Mod ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_landunit use abortutils , only : endrun use perf_mod , only : t_startf, t_stopf use clm_varctl , only : iulog @@ -447,19 +447,19 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, if (abs(sum-1._r8) > 1.e-06_r8 ) then write (iulog,*) 'urban floor view factor error',sum write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) endif sum = vf_rw(l) + vf_fw(l) + vf_ww(l) if (abs(sum-1._r8) > 1.e-06_r8 ) then write (iulog,*) 'urban wall view factor error',sum write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) endif sum = vf_fr(l) + vf_wr(l) + vf_wr(l) if (abs(sum-1._r8) > 1.e-06_r8 ) then write (iulog,*) 'urban roof view factor error',sum write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) endif endif @@ -662,7 +662,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, write(iulog,*)'dgesv info: ',info write (iulog,*) 'dgesv error' write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) end if ! Assign new temperatures t_roof_inner(l) = result(1) @@ -835,7 +835,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, if (abs(qrd_building(l)) > .10_r8 ) then write (iulog,*) 'urban inside building net longwave radiation balance error ',qrd_building(l) write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) end if qcv_roof(l) = 0.5_r8*hcv_roofi(l)*(t_roof_inner(l) - t_building(l)) + 0.5_r8*hcv_roofi(l)*(t_roof_inner_bef(l) & @@ -847,7 +847,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, if (abs(enrgy_bal_roof(l)) > .10_r8 ) then write (iulog,*) 'urban inside roof energy balance error ',enrgy_bal_roof(l) write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) end if qcv_sunw(l) = 0.5_r8*hcv_sunwi(l)*(t_sunw_inner(l) - t_building(l)) + 0.5_r8*hcv_sunwi(l)*(t_sunw_inner_bef(l) & @@ -859,7 +859,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, if (abs(enrgy_bal_sunw(l)) > .10_r8 ) then write (iulog,*) 'urban inside sunwall energy balance error ',enrgy_bal_sunw(l) write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) end if qcv_shdw(l) = 0.5_r8*hcv_shdwi(l)*(t_shdw_inner(l) - t_building(l)) + 0.5_r8*hcv_shdwi(l)*(t_shdw_inner_bef(l) & @@ -871,7 +871,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, if (abs(enrgy_bal_shdw(l)) > .10_r8 ) then write (iulog,*) 'urban inside shadewall energy balance error ',enrgy_bal_shdw(l) write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) end if qcv_floor(l) = 0.5_r8*hcv_floori(l)*(t_floor(l) - t_building(l)) + 0.5_r8*hcv_floori(l)*(t_floor_bef(l) & @@ -881,7 +881,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, if (abs(enrgy_bal_floor(l)) > .10_r8 ) then write (iulog,*) 'urban inside floor energy balance error ',enrgy_bal_floor(l) write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) end if enrgy_bal_buildair(l) = (ht_roof(l)*rho_dair(l)*cpair/dtime)*(t_building(l) - t_building_bef(l)) & @@ -897,7 +897,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, if (abs(enrgy_bal_buildair(l)) > .10_r8 ) then write (iulog,*) 'urban building air energy balance error ',enrgy_bal_buildair(l) write (iulog,*) 'clm model is stopping' - call endrun() + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit) end if end if end do diff --git a/src/biogeophys/UrbanAlbedoMod.F90 b/src/biogeophys/UrbanAlbedoMod.F90 index 21278c7ef0..73fd3db08d 100644 --- a/src/biogeophys/UrbanAlbedoMod.F90 +++ b/src/biogeophys/UrbanAlbedoMod.F90 @@ -10,9 +10,9 @@ module UrbanAlbedoMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_sys_mod , only : shr_sys_flush use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_landunit use clm_varpar , only : numrad - use clm_varcon , only : isecspday, degpsec, namel + use clm_varcon , only : isecspday, degpsec use clm_varctl , only : iulog use abortutils , only : endrun use UrbanParamsType , only : urbanparams_type @@ -623,7 +623,7 @@ subroutine incident_direct (bounds , & if (abs(err1(l)) > 0.001_r8) then write (iulog,*) 'urban direct beam solar radiation balance error',err1(l) write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif endif end do @@ -660,12 +660,12 @@ subroutine incident_direct (bounds , & if (abs(err2(l)) > 0.0006_r8 ) then write (iulog,*) 'urban road incident direct beam solar radiation error',err2(l) write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif if (abs(err3(l)) > 0.0006_r8 ) then write (iulog,*) 'urban wall incident direct beam solar radiation error',err3(l) write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) end if end if end do @@ -737,7 +737,7 @@ subroutine incident_diffuse (bounds, & if (abs(err(l)) > 0.001_r8) then write (iulog,*) 'urban diffuse solar radiation balance error',err(l) write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif end do @@ -1136,7 +1136,7 @@ subroutine net_solar (bounds if (iter_dir >= n) then write (iulog,*) 'urban net solar radiation error: no convergence, direct beam' write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif ! reflected diffuse @@ -1208,7 +1208,7 @@ subroutine net_solar (bounds if (iter_dif >= n) then write (iulog,*) 'urban net solar radiation error: no convergence, diffuse' write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif ! total reflected by canyon - sum of solar reflection to sky from canyon. @@ -1254,7 +1254,7 @@ subroutine net_solar (bounds write(iulog,*)' sref_canyon_dir = ',sref_canyon_dir(l) write(iulog,*)' sref_canyon_dif = ',sref_canyon_dir(l) write(iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif ! canyon albedo diff --git a/src/biogeophys/UrbanFluxesMod.F90 b/src/biogeophys/UrbanFluxesMod.F90 index b00de6c5dc..d02433a5bb 100644 --- a/src/biogeophys/UrbanFluxesMod.F90 +++ b/src/biogeophys/UrbanFluxesMod.F90 @@ -8,9 +8,8 @@ module UrbanFluxesMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_sys_mod , only : shr_sys_flush use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_landunit use clm_varpar , only : numrad - use clm_varcon , only : namel use clm_varctl , only : iulog use abortutils , only : endrun use UrbanParamsType , only : urbanparams_type @@ -359,7 +358,7 @@ subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, write (iulog,*) 'ht_roof, z_d_town, z_0_town: ', ht_roof(l), z_d_town(l), & z_0_town(l) write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) end if if (forc_hgt_u_patch(lun%patchi(l)) - z_d_town(l) <= z_0_town(l)) then write (iulog,*) 'aerodynamic parameter error in UrbanFluxes' @@ -367,7 +366,7 @@ subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, write (iulog,*) 'forc_hgt_u_patch, z_d_town, z_0_town: ', forc_hgt_u_patch(lun%patchi(l)), z_d_town(l), & z_0_town(l) write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) end if ! Magnitude of atmospheric wind @@ -604,7 +603,8 @@ subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, write(iulog,*) 'c, ctype, pi = ', c, ctype(c), pi write(iulog,*) 'Column indices for: shadewall, sunwall, road_imperv, road_perv, roof: ' write(iulog,*) icol_shadewall, icol_sunwall, icol_road_imperv, icol_road_perv, icol_roof - call endrun(decomp_index=l, clmlevel=namel, msg="ERROR, ctype out of range"//errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, & + msg="ERROR, ctype out of range"//errmsg(sourcefile, __LINE__)) end if taf_numer(l) = taf_numer(l) + t_grnd(c)*wtus(c) @@ -824,7 +824,7 @@ subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, write(iulog,*)'eflx_scale = ',eflx_scale(indexl) write(iulog,*)'eflx_sh_grnd_scale: ',eflx_sh_grnd_scale(lun%patchi(indexl):lun%patchf(indexl)) write(iulog,*)'eflx = ',eflx(indexl) - call endrun(decomp_index=indexl, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=indexl, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) end if end if @@ -845,7 +845,7 @@ subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, write(iulog,*)'clm model is stopping - error is greater than 4.e-9 kg/m**2/s' write(iulog,*)'qflx_scale = ',qflx_scale(indexl) write(iulog,*)'qflx = ',qflx(indexl) - call endrun(decomp_index=indexl, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=indexl, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) end if end if diff --git a/src/biogeophys/UrbanParamsType.F90 b/src/biogeophys/UrbanParamsType.F90 index 74b2315a10..9a27601187 100644 --- a/src/biogeophys/UrbanParamsType.F90 +++ b/src/biogeophys/UrbanParamsType.F90 @@ -8,9 +8,9 @@ module UrbanParamsType use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_gridcell, subgrid_level_landunit use clm_varctl , only : iulog, fsurdat - use clm_varcon , only : namel, grlnd, spval + use clm_varcon , only : grlnd, spval use LandunitType , only : lun ! implicit none @@ -296,13 +296,13 @@ subroutine Init(this, bounds) if (abs(sumvf-1._r8) > 1.e-06_r8 ) then write (iulog,*) 'urban road view factor error',sumvf write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif sumvf = this%vf_sw(l) + this%vf_rw(l) + this%vf_ww(l) if (abs(sumvf-1._r8) > 1.e-06_r8 ) then write (iulog,*) 'urban wall view factor error',sumvf write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif !---------------------------------------------------------------------------------- @@ -811,7 +811,7 @@ subroutine CheckUrban(begg, endg, pcturb, caller) write(iulog,*)'tk_improad: ',urbinp%tk_improad(nindx,dindx,1:nlev) write(iulog,*)'cv_improad: ',urbinp%cv_improad(nindx,dindx,1:nlev) end if - call endrun(msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=nindx, subgrid_level=subgrid_level_gridcell, msg=errmsg(sourcefile, __LINE__)) end if end subroutine CheckUrban diff --git a/src/biogeophys/UrbanRadiationMod.F90 b/src/biogeophys/UrbanRadiationMod.F90 index 895659e44f..0b6412f2d2 100644 --- a/src/biogeophys/UrbanRadiationMod.F90 +++ b/src/biogeophys/UrbanRadiationMod.F90 @@ -10,9 +10,8 @@ module UrbanRadiationMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_sys_mod , only : shr_sys_flush use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_landunit use clm_varpar , only : numrad - use clm_varcon , only : namel use clm_varctl , only : iulog use abortutils , only : endrun use UrbanParamsType , only : urbanparams_type @@ -491,7 +490,7 @@ subroutine net_longwave (bounds write(iulog,*) 'vf_sw = ',vf_sw(l) write(iulog,*) 'canyon_hwr = ',canyon_hwr(l) write(iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif end do @@ -671,7 +670,7 @@ subroutine net_longwave (bounds if (iter >= n) then write (iulog,*) 'urban net longwave radiation error: no convergence' write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif ! total net longwave radiation for canyon. project wall fluxes to horizontal surface @@ -696,7 +695,7 @@ subroutine net_longwave (bounds if (abs(err) > .10_r8 ) then write (iulog,*) 'urban net longwave radiation balance error',err write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) end if end do diff --git a/src/biogeophys/WaterBalanceType.F90 b/src/biogeophys/WaterBalanceType.F90 index 0bf0573913..8325f62013 100644 --- a/src/biogeophys/WaterBalanceType.F90 +++ b/src/biogeophys/WaterBalanceType.F90 @@ -10,7 +10,7 @@ module WaterBalanceType ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type - use decompMod , only : BOUNDS_SUBGRID_PATCH, BOUNDS_SUBGRID_COLUMN, BOUNDS_SUBGRID_GRIDCELL + use decompMod , only : subgrid_level_patch, subgrid_level_column, subgrid_level_gridcell use clm_varcon , only : spval use WaterInfoBaseType, only : water_info_base_type use WaterTracerContainerType, only : water_tracer_container_type @@ -95,51 +95,51 @@ subroutine InitAllocate(this, bounds, tracer_vars) call AllocateVar1d(var = this%h2osno_old_col, name = 'h2osno_old_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%liq1_grc, name = 'liq1_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL) + bounds = bounds, subgrid_level = subgrid_level_gridcell) call AllocateVar1d(var = this%liq2_grc, name = 'liq2_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL) + bounds = bounds, subgrid_level = subgrid_level_gridcell) call AllocateVar1d(var = this%ice1_grc, name = 'ice1_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL) + bounds = bounds, subgrid_level = subgrid_level_gridcell) call AllocateVar1d(var = this%ice2_grc, name = 'ice2_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL) + bounds = bounds, subgrid_level = subgrid_level_gridcell) call AllocateVar1d(var = this%snow_sources_col, name = 'snow_sources_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%snow_sinks_col, name = 'snow_sinks_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%wa_reset_nonconservation_gain_col, name = 'wa_reset_nonconservation_gain_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%begwb_grc, name = 'begwb_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL) + bounds = bounds, subgrid_level = subgrid_level_gridcell) call AllocateVar1d(var = this%endwb_grc, name = 'endwb_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL) + bounds = bounds, subgrid_level = subgrid_level_gridcell) call AllocateVar1d(var = this%begwb_col, name = 'begwb_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%endwb_col, name = 'endwb_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%errh2o_patch, name = 'errh2o_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%errh2o_col, name = 'errh2o_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%errh2osno_col, name = 'errh2osno_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) end subroutine InitAllocate diff --git a/src/biogeophys/WaterDiagnosticBulkType.F90 b/src/biogeophys/WaterDiagnosticBulkType.F90 index 796909209f..7804fa3746 100644 --- a/src/biogeophys/WaterDiagnosticBulkType.F90 +++ b/src/biogeophys/WaterDiagnosticBulkType.F90 @@ -17,7 +17,7 @@ module WaterDiagnosticBulkType use decompMod , only : bounds_type use abortutils , only : endrun use clm_varctl , only : use_cn, iulog, use_luna - use clm_varpar , only : nlevgrnd, nlevsno + use clm_varpar , only : nlevgrnd, nlevsno, nlevcan use clm_varcon , only : spval use LandunitType , only : lun use ColumnType , only : col @@ -54,6 +54,8 @@ module WaterDiagnosticBulkType real(r8), pointer :: h2osno_top_col (:) ! col top-layer mass of snow [kg] real(r8), pointer :: sno_liq_top_col (:) ! col snow liquid water fraction (mass), top layer [fraction] + real(r8), pointer :: iwue_ln_patch (:) ! patch intrinsic water use efficiency near local noon (umolCO2/molH2O) + real(r8), pointer :: vpd_ref2m_patch (:) ! patch 2 m height surface vapor pressure deficit (Pa) real(r8), pointer :: rh_ref2m_patch (:) ! patch 2 m height surface relative humidity (%) real(r8), pointer :: rh_ref2m_r_patch (:) ! patch 2 m height surface relative humidity - rural (%) real(r8), pointer :: rh_ref2m_u_patch (:) ! patch 2 m height surface relative humidity - urban (%) @@ -198,7 +200,9 @@ subroutine InitBulkAllocate(this, bounds) allocate(this%h2osno_top_col (begc:endc)) ; this%h2osno_top_col (:) = nan allocate(this%sno_liq_top_col (begc:endc)) ; this%sno_liq_top_col (:) = nan - allocate(this%dqgdT_col (begc:endc)) ; this%dqgdT_col (:) = nan + allocate(this%dqgdT_col (begc:endc)) ; this%dqgdT_col (:) = nan + allocate(this%iwue_ln_patch (begp:endp)) ; this%iwue_ln_patch (:) = nan + allocate(this%vpd_ref2m_patch (begp:endp)) ; this%vpd_ref2m_patch (:) = nan allocate(this%rh_ref2m_patch (begp:endp)) ; this%rh_ref2m_patch (:) = nan allocate(this%rh_ref2m_u_patch (begp:endp)) ; this%rh_ref2m_u_patch (:) = nan allocate(this%rh_ref2m_r_patch (begp:endp)) ; this%rh_ref2m_r_patch (:) = nan @@ -276,6 +280,22 @@ subroutine InitBulkHistory(this, bounds) long_name=this%info%lname('vertically summed soil cie (veg landunits only)'), & ptr_col=this%h2osoi_ice_tot_col, l2g_scale_type='veg') + this%iwue_ln_patch(begp:endp) = spval + call hist_addfld1d ( & + fname=this%info%fname('IWUELN'), & + units='umolCO2/molH2O', & + avgflag='A', & + long_name=this%info%lname('local noon intrinsic water use efficiency'), & + ptr_patch=this%iwue_ln_patch, set_lake=spval, set_urb=spval) + + this%vpd_ref2m_patch(begp:endp) = spval + call hist_addfld1d ( & + fname=this%info%fname('VPD2M'), & + units='Pa', & + avgflag='A', & + long_name=this%info%lname('2m vapor pressure deficit'), & + ptr_patch=this%vpd_ref2m_patch) + this%rh_ref2m_patch(begp:endp) = spval call hist_addfld1d ( & fname=this%info%fname('RH2M'), & @@ -791,6 +811,22 @@ subroutine RestartBulk(this, bounds, ncid, flag, writing_finidat_interp_dest_fil writing_finidat_interp_dest_file = writing_finidat_interp_dest_file, & waterstatebulk_inst = waterstatebulk_inst) + call restartvar(ncid=ncid, flag=flag, & + varname=this%info%fname('IWUELN'), & + xtype=ncd_double, & + dim1name='pft', & + long_name=this%info%lname('local noon intrinsic water use efficiency'), & + units='umolCO2/molH2O', & + interpinic_flag='interp', readvar=readvar, data=this%iwue_ln_patch) + + call restartvar(ncid=ncid, flag=flag, & + varname=this%info%fname('VPD2M'), & + xtype=ncd_double, & + dim1name='pft', & + long_name=this%info%lname('2m vapor pressure deficit'), & + units='Pa', & + interpinic_flag='interp', readvar=readvar, data=this%vpd_ref2m_patch) + call restartvar(ncid=ncid, flag=flag, & varname=this%info%fname('FWET'), & xtype=ncd_double, & diff --git a/src/biogeophys/WaterDiagnosticType.F90 b/src/biogeophys/WaterDiagnosticType.F90 index d3ef72849f..7fa76b42b0 100644 --- a/src/biogeophys/WaterDiagnosticType.F90 +++ b/src/biogeophys/WaterDiagnosticType.F90 @@ -12,7 +12,7 @@ module WaterDiagnosticType ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type - use decompMod , only : BOUNDS_SUBGRID_PATCH, BOUNDS_SUBGRID_COLUMN, BOUNDS_SUBGRID_LANDUNIT, BOUNDS_SUBGRID_GRIDCELL + use decompMod , only : subgrid_level_patch, subgrid_level_column, subgrid_level_landunit, subgrid_level_gridcell use clm_varctl , only : use_vancouver, use_mexicocity use clm_varcon , only : spval use LandunitType , only : lun @@ -104,40 +104,40 @@ subroutine InitAllocate(this, bounds, tracer_vars) call AllocateVar1d(var = this%snowice_col, name = 'snowice_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%snowliq_col, name = 'snowliq_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%h2ocan_patch, name = 'h2ocan_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%total_plant_stored_h2o_col, name = 'total_plant_stored_h2o_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%h2osoi_liqice_10cm_col, name = 'h2osoi_liqice_10cm_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%tws_grc, name = 'tws_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL) + bounds = bounds, subgrid_level = subgrid_level_gridcell) call AllocateVar1d(var = this%qg_snow_col, name = 'qg_snow_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qg_soil_col, name = 'qg_soil_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qg_h2osfc_col, name = 'qg_h2osfc_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qg_col, name = 'qg_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qaf_lun, name = 'qaf_lun', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_LANDUNIT) + bounds = bounds, subgrid_level = subgrid_level_landunit) call AllocateVar1d(var = this%q_ref2m_patch, name = 'q_ref2m_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) end subroutine InitAllocate diff --git a/src/biogeophys/WaterFluxType.F90 b/src/biogeophys/WaterFluxType.F90 index a2d57c1e51..f7c55d44e1 100644 --- a/src/biogeophys/WaterFluxType.F90 +++ b/src/biogeophys/WaterFluxType.F90 @@ -10,7 +10,7 @@ module WaterFluxType use clm_varpar , only : nlevsno, nlevsoi use clm_varcon , only : spval use decompMod , only : bounds_type - use decompMod , only : BOUNDS_SUBGRID_PATCH, BOUNDS_SUBGRID_COLUMN, BOUNDS_SUBGRID_GRIDCELL + use decompMod , only : subgrid_level_patch, subgrid_level_column, subgrid_level_gridcell use LandunitType , only : lun use ColumnType , only : col use AnnualFluxDribbler, only : annual_flux_dribbler_type, annual_flux_dribbler_gridcell @@ -156,218 +156,218 @@ subroutine InitAllocate(this, bounds, tracer_vars) call AllocateVar1d(var = this%qflx_through_snow_patch, name = 'qflx_through_snow_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_through_liq_patch, name = 'qflx_through_liq_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_intercepted_snow_patch, name = 'qflx_intercepted_snow_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_intercepted_liq_patch, name = 'qflx_intercepted_liq_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_snocanfall_patch, name = 'qflx_snocanfall_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_liqcanfall_patch, name = 'qflx_liqcanfall_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_snow_unload_patch, name = 'qflx_snow_unload_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_solidevap_from_top_layer_patch, name = 'qflx_solidevap_from_top_layer_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH, & + bounds = bounds, subgrid_level = subgrid_level_patch, & ival = 0.0_r8) call AllocateVar1d(var = this%qflx_tran_veg_patch, name = 'qflx_tran_veg_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_liqdew_to_top_layer_patch, name = 'qflx_liqdew_to_top_layer_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_soliddew_to_top_layer_patch, name = 'qflx_soliddew_to_top_layer_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_liq_grnd_col, name = 'qflx_liq_grnd_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_snow_grnd_col, name = 'qflx_snow_grnd_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_rain_plus_snomelt_col, name = 'qflx_rain_plus_snomelt_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_solidevap_from_top_layer_col, name = 'qflx_solidevap_from_top_layer_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & ival = 0.0_r8) call AllocateVar1d(var = this%qflx_snwcp_liq_col, name = 'qflx_snwcp_liq_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_snwcp_ice_col, name = 'qflx_snwcp_ice_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_snwcp_discarded_liq_col, name = 'qflx_snwcp_discarded_liq_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_snwcp_discarded_ice_col, name = 'qflx_snwcp_discarded_ice_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_glcice_col, name = 'qflx_glcice_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_glcice_frz_col, name = 'qflx_glcice_frz_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_glcice_melt_col, name = 'qflx_glcice_melt_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_glcice_dyn_water_flux_col, name = 'qflx_glcice_dyn_water_flux_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_tran_veg_col, name = 'qflx_tran_veg_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_evap_veg_col, name = 'qflx_evap_veg_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_evap_can_col, name = 'qflx_evap_can_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_evap_soi_col, name = 'qflx_evap_soi_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_evap_tot_col, name = 'qflx_evap_tot_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_liqevap_from_top_layer_col, name = 'qflx_liqevap_from_top_layer_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_liqdew_to_top_layer_col, name = 'qflx_liqdew_to_top_layer_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_soliddew_to_top_layer_col, name = 'qflx_soliddew_to_top_layer_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_evap_veg_patch, name = 'qflx_evap_veg_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_evap_can_patch, name = 'qflx_evap_can_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_evap_soi_patch, name = 'qflx_evap_soi_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_evap_tot_patch, name = 'qflx_evap_tot_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_liqevap_from_top_layer_patch, name = 'qflx_liqevap_from_top_layer_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_infl_col, name = 'qflx_infl_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_surf_col, name = 'qflx_surf_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_drain_col, name = 'qflx_drain_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_drain_perched_col, name = 'qflx_drain_perched_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_top_soil_col, name = 'qflx_top_soil_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_snomelt_col, name = 'qflx_snomelt_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_snofrz_col, name = 'qflx_snofrz_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar2d(var = this%qflx_snofrz_lyr_col, name = 'qflx_snofrz_lyr_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & dim2beg = -nlevsno+1, dim2end = 0) call AllocateVar1d(var = this%qflx_snow_drain_col, name = 'qflx_snow_drain_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_ice_runoff_snwcp_col, name = 'qflx_ice_runoff_snwcp_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_ice_runoff_xs_col, name = 'qflx_ice_runoff_xs_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_qrgwl_col, name = 'qflx_qrgwl_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_floodc_col, name = 'qflx_floodc_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_sl_top_soil_col, name = 'qflx_sl_top_soil_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_runoff_col, name = 'qflx_runoff_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_runoff_r_col, name = 'qflx_runoff_r_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_runoff_u_col, name = 'qflx_runoff_u_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_rsub_sat_col, name = 'qflx_rsub_sat_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_h2osfc_to_ice_col, name = 'qflx_h2osfc_to_ice_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_snow_h2osfc_col, name = 'qflx_snow_h2osfc_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_too_small_h2osfc_to_soil_col, name = 'qflx_too_small_h2osfc_to_soil_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar2d(var = this%qflx_snow_percolation_col, name = 'qflx_snow_percolation_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & dim2beg = -nlevsno+1, dim2end = 0) call AllocateVar1d(var = this%qflx_liq_dynbal_grc, name = 'qflx_liq_dynbal_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL) + bounds = bounds, subgrid_level = subgrid_level_gridcell) call AllocateVar1d(var = this%qflx_ice_dynbal_grc, name = 'qflx_ice_dynbal_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL) + bounds = bounds, subgrid_level = subgrid_level_gridcell) call AllocateVar1d(var = this%qflx_sfc_irrig_col, name = 'qflx_sfc_irrig_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_gw_uncon_irrig_col, name = 'qflx_gw_uncon_irrig_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar2d(var = this%qflx_gw_uncon_irrig_lyr_col, name = 'qflx_gw_uncon_irrig_lyr_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & dim2beg = 1, dim2end = nlevsoi) call AllocateVar1d(var = this%qflx_gw_con_irrig_col, name = 'qflx_gw_con_irrig_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%qflx_irrig_drip_patch, name = 'qflx_irrig_drip_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%qflx_irrig_sprinkler_patch, name = 'qflx_irrig_sprinkler_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) this%qflx_liq_dynbal_dribbler = annual_flux_dribbler_gridcell( & bounds = bounds, & diff --git a/src/biogeophys/WaterStateType.F90 b/src/biogeophys/WaterStateType.F90 index 63304dfd9f..c06f2333c9 100644 --- a/src/biogeophys/WaterStateType.F90 +++ b/src/biogeophys/WaterStateType.F90 @@ -12,11 +12,11 @@ module WaterStateType use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun use decompMod , only : bounds_type - use decompMod , only : BOUNDS_SUBGRID_PATCH, BOUNDS_SUBGRID_COLUMN, BOUNDS_SUBGRID_GRIDCELL + use decompMod , only : subgrid_level_patch, subgrid_level_column, subgrid_level_gridcell use clm_varctl , only : use_bedrock, iulog use clm_varctl , only : use_fates_planthydro use clm_varpar , only : nlevgrnd, nlevsoi, nlevurb, nlevmaxurbgrnd, nlevsno - use clm_varcon , only : spval, namec + use clm_varcon , only : spval use LandunitType , only : lun use ColumnType , only : col use WaterInfoBaseType, only : water_info_base_type @@ -115,41 +115,41 @@ subroutine InitAllocate(this, bounds, tracer_vars) call AllocateVar1d(var = this%h2osno_no_layers_col, name = 'h2osno_no_layers_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar2d(var = this%h2osoi_vol_col, name = 'h2osoi_vol_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & dim2beg = 1, dim2end = nlevmaxurbgrnd) call AllocateVar2d(var = this%h2osoi_vol_prs_grc, name = 'h2osoi_vol_prs_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & dim2beg = 1, dim2end = nlevgrnd) call AllocateVar2d(var = this%h2osoi_ice_col, name = 'h2osoi_ice_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & dim2beg = -nlevsno+1, dim2end = nlevmaxurbgrnd) call AllocateVar2d(var = this%h2osoi_liq_col, name = 'h2osoi_liq_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & dim2beg = -nlevsno+1, dim2end = nlevmaxurbgrnd) call AllocateVar1d(var = this%snocan_patch, name = 'snocan_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%liqcan_patch, name = 'liqcan_patch', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) + bounds = bounds, subgrid_level = subgrid_level_patch) call AllocateVar1d(var = this%h2osfc_col, name = 'h2osfc_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%wa_col, name = 'wa_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%dynbal_baseline_liq_col, name = 'dynbal_baseline_liq_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%dynbal_baseline_ice_col, name = 'dynbal_baseline_ice_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) end subroutine InitAllocate @@ -392,7 +392,7 @@ subroutine InitCold(this, bounds, & end do else write(iulog,*) 'water_state_type InitCold: unhandled landunit type ', lun%itype(l) - call endrun(msg = 'unhandled landunit type', & + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg = 'unhandled landunit type', & additional_msg = errMsg(sourcefile, __LINE__)) endif do j = 1, nlevs @@ -770,7 +770,7 @@ subroutine CheckSnowConsistency(this, num_c, filter_c, caller) write(iulog,*) '(Called from: ', trim(caller), ')' write(iulog,*) 'c, snl, h2osno_no_layers = ', c, col%snl(c), & this%h2osno_no_layers_col(c) - call endrun(decomp_index=c, clmlevel=namec, & + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & msg = subname//' ERROR: col has snow layers but non-zero h2osno_no_layers') end if end if @@ -783,7 +783,7 @@ subroutine CheckSnowConsistency(this, num_c, filter_c, caller) write(iulog,*) '(Called from: ', trim(caller), ')' write(iulog,*) 'c, j, snl, h2osoi_ice, h2osoi_liq = ', c, j, col%snl(c), & this%h2osoi_ice_col(c,j), this%h2osoi_liq_col(c,j) - call endrun(decomp_index=c, clmlevel=namec, & + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & msg = subname//' ERROR: col has non-zero h2osoi_ice or h2osoi_liq outside resolved snow layers') end if end do diff --git a/src/biogeophys/WaterTracerContainerType.F90 b/src/biogeophys/WaterTracerContainerType.F90 index 42fd1daa89..46539cbba2 100644 --- a/src/biogeophys/WaterTracerContainerType.F90 +++ b/src/biogeophys/WaterTracerContainerType.F90 @@ -59,6 +59,7 @@ module WaterTracerContainerType procedure, public :: complete_setup procedure, public :: get_num_vars procedure, public :: get_description + procedure, public :: get_subgrid_level procedure, public :: get_bounds procedure, public :: get_data end type water_tracer_container_type @@ -225,6 +226,28 @@ function get_description(this, var_num) result(description) end function get_description + !----------------------------------------------------------------------- + function get_subgrid_level(this, var_num) result(subgrid_level) + ! + ! !DESCRIPTION: + ! Returns the subgrid level of the variable with the given index. + ! + ! This is one of the subgrid_level_* constants defined in decompMod. + ! + ! !ARGUMENTS: + integer :: subgrid_level ! function result + class(water_tracer_container_type), intent(in) :: this + integer, intent(in) :: var_num + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'get_subgrid_level' + !----------------------------------------------------------------------- + + subgrid_level = this%tracers(var_num)%subgrid_level + + end function get_subgrid_level + !----------------------------------------------------------------------- subroutine get_bounds(this, var_num, bounds, begi, endi) ! diff --git a/src/biogeophys/WaterTracerUtils.F90 b/src/biogeophys/WaterTracerUtils.F90 index 2c6e1dce71..14179d2d5b 100644 --- a/src/biogeophys/WaterTracerUtils.F90 +++ b/src/biogeophys/WaterTracerUtils.F90 @@ -8,7 +8,7 @@ module WaterTracerUtils #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type, get_beg, get_end + use decompMod , only : bounds_type, get_beg, get_end, subgrid_level_unspecified use clm_varctl , only : iulog use abortutils , only : endrun use shr_infnan_mod , only : shr_infnan_isnan @@ -53,7 +53,7 @@ subroutine AllocateVar1d(var, name, container, bounds, subgrid_level, ival) character(len=*) , intent(in) :: name ! variable name type(water_tracer_container_type) , intent(inout) :: container type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: subgrid_level ! one of the BOUNDS_SUBGRID levels defined in decompMod + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined in decompMod real(r8) , intent(in), optional :: ival ! initial value, if not NaN ! ! !LOCAL VARIABLES: @@ -94,7 +94,7 @@ subroutine AllocateVar2d(var, name, container, bounds, subgrid_level, dim2beg, d character(len=*) , intent(in) :: name ! variable name type(water_tracer_container_type) , intent(inout) :: container type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: subgrid_level ! one of the BOUNDS_SUBGRID levels defined in decompMod + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined in decompMod integer , intent(in) :: dim2beg integer , intent(in) :: dim2end real(r8) , intent(in), optional :: ival ! initial value, if not NaN @@ -130,7 +130,7 @@ subroutine AllocateVar2d(var, name, container, bounds, subgrid_level, dim2beg, d end subroutine AllocateVar2d !----------------------------------------------------------------------- - subroutine CalcTracerFromBulk(lb, num_pts, filter_pts, & + subroutine CalcTracerFromBulk(subgrid_level, lb, num_pts, filter_pts, & bulk_source, bulk_val, tracer_source, tracer_val) ! ! !DESCRIPTION: @@ -145,6 +145,7 @@ subroutine CalcTracerFromBulk(lb, num_pts, filter_pts, & ! values elsewhere ! ! !ARGUMENTS: + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined in decompMod (just needed for error messages; subgrid_level_unspecified is allowed here, in which case some information will not be printed) integer , intent(in) :: lb ! lower bound for arrays integer , intent(in) :: num_pts ! number of points in the filter integer , intent(in) :: filter_pts(:) ! filter in which tracer_val should be updated @@ -171,6 +172,7 @@ subroutine CalcTracerFromBulk(lb, num_pts, filter_pts, & call CalcTracerFromBulk1Pt( & caller = subname, & n = n, & + subgrid_level = subgrid_level, & bulk_source = bulk_source(n), & bulk_val = bulk_val(n), & tracer_source = tracer_source(n), & @@ -180,7 +182,7 @@ subroutine CalcTracerFromBulk(lb, num_pts, filter_pts, & end subroutine CalcTracerFromBulk !----------------------------------------------------------------------- - subroutine CalcTracerFromBulkMasked(lb, num_pts, filter_pts, mask_array, & + subroutine CalcTracerFromBulkMasked(subgrid_level, lb, num_pts, filter_pts, mask_array, & bulk_source, bulk_val, tracer_source, tracer_val) ! ! !DESCRIPTION: @@ -189,6 +191,7 @@ subroutine CalcTracerFromBulkMasked(lb, num_pts, filter_pts, mask_array, & ! See documentation in CalcTracerFromBulk for details ! ! !ARGUMENTS: + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined in decompMod (just needed for error messages; subgrid_level_unspecified is allowed here, in which case some information will not be printed) integer , intent(in) :: lb ! lower bound for arrays integer , intent(in) :: num_pts ! number of points in the filter integer , intent(in) :: filter_pts(:) ! filter in which tracer_val should be updated @@ -218,6 +221,7 @@ subroutine CalcTracerFromBulkMasked(lb, num_pts, filter_pts, mask_array, & call CalcTracerFromBulk1Pt( & caller = subname, & n = n, & + subgrid_level = subgrid_level, & bulk_source = bulk_source(n), & bulk_val = bulk_val(n), & tracer_source = tracer_source(n), & @@ -229,7 +233,7 @@ end subroutine CalcTracerFromBulkMasked !----------------------------------------------------------------------- - subroutine CalcTracerFromBulk1Pt(caller, n, bulk_source, bulk_val, tracer_source, tracer_val) + subroutine CalcTracerFromBulk1Pt(caller, n, subgrid_level, bulk_source, bulk_val, tracer_source, tracer_val) ! ! !DESCRIPTION: ! For a single point: Calculate a tracer variable from a corresponding bulk variable @@ -239,6 +243,7 @@ subroutine CalcTracerFromBulk1Pt(caller, n, bulk_source, bulk_val, tracer_source ! !ARGUMENTS: character(len=*), intent(in) :: caller ! name of caller (just used for error messages) integer , intent(in) :: n ! index of point (just used for error messages) + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined in decompMod (just needed for error messages; subgrid_level_unspecified is allowed here, in which case some information will not be printed) real(r8), intent(in) :: bulk_source ! value of the source for this variable, for bulk real(r8), intent(in) :: bulk_val ! value of the variable of interest, for bulk real(r8), intent(in) :: tracer_source ! value of the source for this variable, for the tracer @@ -260,7 +265,8 @@ subroutine CalcTracerFromBulk1Pt(caller, n, bulk_source, bulk_val, tracer_source write(iulog,*) 'bulk_val = ', bulk_val write(iulog,*) 'at n = ', n write(iulog,*) 'This would lead to an indeterminate tracer val.' - call endrun(msg=caller//': Non-zero bulk val despite zero bulk source', & + call endrun(subgrid_index=n, subgrid_level=subgrid_level, & + msg=caller//': Non-zero bulk val despite zero bulk source', & additional_msg=errMsg(sourcefile, __LINE__)) else if (tracer_source /= 0._r8) then ! NOTE(wjs, 2018-09-28) To avoid this error, we might need code elsewhere that @@ -272,7 +278,8 @@ subroutine CalcTracerFromBulk1Pt(caller, n, bulk_source, bulk_val, tracer_source write(iulog,*) 'tracer_source = ', tracer_source write(iulog,*) 'at n = ', n write(iulog,*) 'This would lead to an indeterminate tracer val.' - call endrun(msg=caller//': Non-zero tracer source despite zero bulk source', & + call endrun(subgrid_index=n, subgrid_level=subgrid_level, & + msg=caller//': Non-zero tracer source despite zero bulk source', & additional_msg=errMsg(sourcefile, __LINE__)) else write(iulog,*) caller//' ERROR: unhandled condition; we should never get here.' @@ -281,7 +288,8 @@ subroutine CalcTracerFromBulk1Pt(caller, n, bulk_source, bulk_val, tracer_source write(iulog,*) 'bulk_source = ', bulk_source write(iulog,*) 'tracer_source = ', tracer_source write(iulog,*) 'at n = ', n - call endrun(msg=caller//': unhandled condition; we should never get here', & + call endrun(subgrid_index=n, subgrid_level=subgrid_level, & + msg=caller//': unhandled condition; we should never get here', & additional_msg=errMsg(sourcefile, __LINE__)) end if @@ -316,13 +324,14 @@ end subroutine CalcTracerFromBulkFixedRatio !----------------------------------------------------------------------- - subroutine CompareBulkToTracer(bounds_beg, bounds_end, & + subroutine CompareBulkToTracer(subgrid_level, bounds_beg, bounds_end, & bulk, tracer, ratio, caller_location, name) ! ! !DESCRIPTION: ! Compare the bulk and tracer quantities; abort if they differ ! ! !ARGUMENTS: + integer, intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined in decompMod (just needed for error messages; subgrid_level_unspecified is allowed here, in which case some information will not be printed) ! We could get bounds_beg and bounds_end from the lbound and ubound of the bulk or ! tracer arrays, but passing them in helps catch any accidental omission of bounds ! slicing in the caller (e.g., passing in foo_col rather than @@ -359,7 +368,7 @@ subroutine CompareBulkToTracer(bounds_beg, bounds_end, & val1 = val1 * ratio end if if (val1 == 0.0_r8 .and. val2 == 0.0_r8) then - ! trap special case were both are zero to avoid division by zero. values equal + ! trap special case where both are zero to avoid division by zero. values equal else if (abs(val1 - val2) / max(abs(val1), abs(val2)) > tolerance) then arrays_equal = .false. diffloc = i @@ -389,7 +398,8 @@ subroutine CompareBulkToTracer(bounds_beg, bounds_end, & write(iulog, '(a, e25.17)') 'Bulk*ratio: ',bulk(diffloc)*ratio end if call shr_sys_flush(iulog) - call endrun(msg=subname//': tracer does not agree with bulk water') + call endrun(subgrid_index=diffloc, subgrid_level=subgrid_level, & + msg=subname//': tracer does not agree with bulk water') end if end subroutine CompareBulkToTracer diff --git a/src/biogeophys/WaterType.F90 b/src/biogeophys/WaterType.F90 index 3bed3ff19f..b8a05308b2 100644 --- a/src/biogeophys/WaterType.F90 +++ b/src/biogeophys/WaterType.F90 @@ -936,7 +936,10 @@ subroutine TracerConsistencyCheck(this, bounds, caller_location) call bulk_vars%get_data(var_num, bulk) call tracer_vars%get_data(var_num, tracer) - call CompareBulkToTracer(begi, endi, & + call CompareBulkToTracer( & + subgrid_level = tracer_vars%get_subgrid_level(var_num), & + bounds_beg = begi, & + bounds_end = endi, & bulk = bulk(begi:endi), & tracer = tracer(begi:endi), & ratio = tracer_info%get_ratio(), & diff --git a/src/biogeophys/Wateratm2lndType.F90 b/src/biogeophys/Wateratm2lndType.F90 index cc7358d3c5..44fe39e58d 100644 --- a/src/biogeophys/Wateratm2lndType.F90 +++ b/src/biogeophys/Wateratm2lndType.F90 @@ -9,7 +9,7 @@ module Wateratm2lndType #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type - use decompMod , only : BOUNDS_SUBGRID_COLUMN, BOUNDS_SUBGRID_GRIDCELL + use decompMod , only : subgrid_level_column, subgrid_level_gridcell use clm_varcon , only : spval use ColumnType , only : col use WaterInfoBaseType, only : water_info_base_type @@ -94,38 +94,38 @@ subroutine InitAllocate(this, bounds, tracer_vars) call AllocateVar1d(var = this%forc_q_not_downscaled_grc, name = 'forc_q_not_downscaled_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%forc_rain_not_downscaled_grc, name = 'forc_rain_not_downscaled_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%forc_snow_not_downscaled_grc, name = 'forc_snow_not_downscaled_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%forc_q_downscaled_col, name = 'forc_q_downscaled_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & ival=ival) call AllocateVar1d(var = this%forc_flood_grc, name = 'forc_flood_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%forc_rain_downscaled_col, name = 'forc_rain_downscaled_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & ival=ival) call AllocateVar1d(var = this%forc_snow_downscaled_col, name = 'forc_snow_downscaled_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & ival=ival) call AllocateVar1d(var = this%rain_to_snow_conversion_col, name = 'rain_to_snow_conversion_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) call AllocateVar1d(var = this%snow_to_rain_conversion_col, name = 'snow_to_rain_conversion_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN) + bounds = bounds, subgrid_level = subgrid_level_column) end subroutine InitAllocate @@ -385,6 +385,7 @@ subroutine SetOneDownscaledTracer(bulk_not_downscaled, tracer_not_downscaled, & end do call CalcTracerFromBulk( & + subgrid_level = subgrid_level_column, & lb = begc, & num_pts = num_allc, & filter_pts = filter_allc, & diff --git a/src/biogeophys/Waterlnd2atmType.F90 b/src/biogeophys/Waterlnd2atmType.F90 index fb59d1c83c..54972e9b00 100644 --- a/src/biogeophys/Waterlnd2atmType.F90 +++ b/src/biogeophys/Waterlnd2atmType.F90 @@ -10,7 +10,7 @@ module Waterlnd2atmType ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type - use decompMod , only : BOUNDS_SUBGRID_COLUMN, BOUNDS_SUBGRID_GRIDCELL + use decompMod , only : subgrid_level_column, subgrid_level_gridcell use WaterInfoBaseType, only : water_info_base_type use WaterTracerContainerType, only : water_tracer_container_type use WaterTracerUtils, only : AllocateVar1d @@ -90,51 +90,51 @@ subroutine InitAllocate(this, bounds, tracer_vars) call AllocateVar1d(var = this%q_ref2m_grc, name = 'q_ref2m_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%h2osno_grc, name = 'h2osno_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%qflx_evap_tot_grc, name = 'qflx_evap_tot_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%qflx_rofliq_grc, name = 'qflx_rofliq_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%qflx_rofliq_qsur_grc, name = 'qflx_rofliq_qsur_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%qflx_rofliq_qsub_grc, name = 'qflx_rofliq_qsub_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%qflx_rofliq_qgwl_grc, name = 'qflx_rofliq_qgwl_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%qflx_rofliq_drain_perched_grc, name = 'qflx_rofliq_drain_perched_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%qflx_ice_runoff_col, name = 'qflx_ice_runoff_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & ival=ival) call AllocateVar1d(var = this%qflx_rofice_grc, name = 'qflx_rofice_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) call AllocateVar1d(var = this%qflx_liq_from_ice_col, name = 'qflx_liq_from_ice_col', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & + bounds = bounds, subgrid_level = subgrid_level_column, & ival=ival) call AllocateVar1d(var = this%qirrig_grc, name = 'qirrig_grc', & container = tracer_vars, & - bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & + bounds = bounds, subgrid_level = subgrid_level_gridcell, & ival=ival) end subroutine InitAllocate diff --git a/src/biogeophys/test/CMakeLists.txt b/src/biogeophys/test/CMakeLists.txt index ac43260605..49f80533de 100644 --- a/src/biogeophys/test/CMakeLists.txt +++ b/src/biogeophys/test/CMakeLists.txt @@ -2,6 +2,7 @@ add_subdirectory(Daylength_test) add_subdirectory(Irrigation_test) add_subdirectory(HumanStress_test) add_subdirectory(SnowHydrology_test) +add_subdirectory(Photosynthesis_test) add_subdirectory(Balance_test) add_subdirectory(TotalWaterAndHeat_test) add_subdirectory(Wateratm2lnd_test) diff --git a/src/biogeophys/test/Photosynthesis_test/CMakeLists.txt b/src/biogeophys/test/Photosynthesis_test/CMakeLists.txt new file mode 100644 index 0000000000..149ec47c1d --- /dev/null +++ b/src/biogeophys/test/Photosynthesis_test/CMakeLists.txt @@ -0,0 +1,7 @@ +set (pfunit_sources + test_Photosynthesis.pf) + +create_pFUnit_test(Photosynthesis test_Photosynthesis_exe + "${pfunit_sources}" "") + +target_link_libraries(test_Photosynthesis_exe clm csm_share esmf_wrf_timemgr) diff --git a/src/biogeophys/test/Photosynthesis_test/test_Photosynthesis.pf b/src/biogeophys/test/Photosynthesis_test/test_Photosynthesis.pf new file mode 100644 index 0000000000..78c82e1bf4 --- /dev/null +++ b/src/biogeophys/test/Photosynthesis_test/test_Photosynthesis.pf @@ -0,0 +1,107 @@ +module test_Photosynthesis + + ! Tests of PhotosynthesisMod.F90 + + use pfunit_mod + use PhotosynthesisMod + use shr_kind_mod , only : r8 => shr_kind_r8 + use unittestSubgridMod, only : unittest_subgrid_teardown, bounds + use unittestSimpleSubgridSetupsMod, only : setup_ncells_single_veg_patch + use unittestUtils , only : endrun_msg + use clm_varpar + use clm_varctl + + implicit none + + @TestCase + type, extends(TestCase) :: TestPhotosynthesis + type(photosyns_type) :: photo + real(r8) :: x(nvegwcs) + contains + procedure :: setUp + procedure :: tearDown + end type TestPhotosynthesis + + real(r8), parameter :: tol = 1.e-13_r8 + +contains + + subroutine setUp(this) + class(TestPhotosynthesis), intent(inout) :: this + + use_luna = .false. + use_cn = .false. + use_hydrstress = .false. + use_c13 = .false. + use_c14 = .false. + use_fates = .false. + soil_layerstruct_predefined = '20SL_8.5m' + + call setup_ncells_single_veg_patch(ncells=1, pft_type=1) + call clm_varpar_init( actual_maxsoil_patches=17, actual_numcft=2 ) + call this%photo%Init( bounds ) + call this%photo%setParamsForTesting( ) + + this%x(root) = -1000._r8 * nlevgrnd + + end subroutine setUp + + subroutine tearDown(this) + class(TestPhotosynthesis), intent(inout) :: this + + call this%photo%Clean( ) + call unittest_subgrid_teardown + + end subroutine tearDown + + @Test + subroutine check_default_veg( this ) + use PatchType, only: patch + class(TestPhotosynthesis), intent(inout) :: this + integer :: p + real(r8) :: fs, der + + p = bounds%begp + fs = plc(this%x(root), p, root, veg) + print *, 'plc = ', fs + @assertEqual( fs, 0.999415208562283_r8, tolerance=tol) + der = d1plc(this%x(root), p, root, veg) + print *, 'd1plc = ', der + @assertEqual( der, 9.237002539040872d-008, tolerance=tol) + end subroutine check_default_veg + + @Test + subroutine check_bad_veg_plc( this ) + use PatchType, only: patch + class(TestPhotosynthesis), intent(inout) :: this + integer :: p + real(r8) :: fs + character(len=256) :: expected_msg + + p = bounds%begp + fs = plc(this%x(root), p, root, plc_method=1) + + expected_msg = endrun_msg( & + "ERROR:: Photosynthesis::PLC must choose plc method" ) + @assertExceptionRaised(expected_msg) + + end subroutine check_bad_veg_plc + + @Test + subroutine check_bad_veg_d1plc( this ) + use PatchType, only: patch + class(TestPhotosynthesis), intent(inout) :: this + integer :: p + real(r8) :: der + character(len=256) :: expected_msg + + p = bounds%begp + + der = d1plc(this%x(root), p, root, plc_method=1) + + expected_msg = endrun_msg( & + "ERROR:: Photosynthesis::D1PLC must choose plc method" ) + @assertExceptionRaised(expected_msg) + end subroutine check_bad_veg_d1plc + +end module test_Photosynthesis diff --git a/src/biogeophys/test/WaterTracerContainerType_test/test_water_tracer_container.pf b/src/biogeophys/test/WaterTracerContainerType_test/test_water_tracer_container.pf index a6946e87d0..58bee7792b 100644 --- a/src/biogeophys/test/WaterTracerContainerType_test/test_water_tracer_container.pf +++ b/src/biogeophys/test/WaterTracerContainerType_test/test_water_tracer_container.pf @@ -5,7 +5,7 @@ module test_water_tracer_container use pfunit_mod use WaterTracerContainerType use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod, only : BOUNDS_SUBGRID_GRIDCELL + use decompMod, only : subgrid_level_gridcell use unittestUtils, only : endrun_msg implicit none @@ -50,9 +50,9 @@ contains data1 = [1._r8, 2._r8, 3._r8] ! Add enough variables that we can be pretty confident that there has been a resize ! sometime after adding the pointer to data1 - call container%add_var(data1, 1, 'my data1', BOUNDS_SUBGRID_GRIDCELL) + call container%add_var(data1, 1, 'my data1', subgrid_level_gridcell) do i = 1, 4 - call container%add_var(more_data(:,i), 1, 'more data', BOUNDS_SUBGRID_GRIDCELL) + call container%add_var(more_data(:,i), 1, 'more data', subgrid_level_gridcell) end do call container%complete_setup() data1 = [11._r8, 12._r8, 13._r8] @@ -73,7 +73,7 @@ contains character(len=:), allocatable :: expected_msg call container%init() - call container%add_var(data, 1, 'my data', BOUNDS_SUBGRID_GRIDCELL) + call container%add_var(data, 1, 'my data', subgrid_level_gridcell) num_vars = container%get_num_vars() expected_msg = endrun_msg( & 'Attempt to call get_num_vars without calling complete_setup') @@ -90,9 +90,9 @@ contains character(len=:), allocatable :: expected_msg call container%init() - call container%add_var(data1, 1, 'my data1', BOUNDS_SUBGRID_GRIDCELL) + call container%add_var(data1, 1, 'my data1', subgrid_level_gridcell) call container%complete_setup() - call container%add_var(data2, 1, 'my data2', BOUNDS_SUBGRID_GRIDCELL) + call container%add_var(data2, 1, 'my data2', subgrid_level_gridcell) expected_msg = endrun_msg( & 'Attempt to call add_var after complete_setup was called') @assertExceptionRaised(expected_msg) diff --git a/src/biogeophys/test/WaterTracerUtils_test/test_calc_tracer_from_bulk.pf b/src/biogeophys/test/WaterTracerUtils_test/test_calc_tracer_from_bulk.pf index 38dbcf8352..df3afd8d0f 100644 --- a/src/biogeophys/test/WaterTracerUtils_test/test_calc_tracer_from_bulk.pf +++ b/src/biogeophys/test/WaterTracerUtils_test/test_calc_tracer_from_bulk.pf @@ -5,6 +5,7 @@ module test_calc_tracer_from_bulk use pfunit_mod use WaterTracerUtils use shr_kind_mod , only : r8 => shr_kind_r8 + use decompMod, only : subgrid_level_unspecified use unittestFilterBuilderMod, only : filter_from_range use unittestUtils, only : endrun_msg @@ -80,6 +81,7 @@ contains bulk_vals(:) = [bulk_val_other, bulk_val, bulk_val_other] tracer_sources(:) = [tracer_source_other, tracer_source, tracer_source_other] call CalcTracerFromBulk( & + subgrid_level = subgrid_level_unspecified, & lb = 1, & num_pts = l_num_pts, & filter_pts = l_filter_pts, & @@ -194,6 +196,7 @@ contains call filter_from_range(1, 3, num_pts, filter_pts) call CalcTracerFromBulkMasked( & + subgrid_level = subgrid_level_unspecified, & lb = 1, & num_pts = num_pts, & filter_pts = filter_pts, & diff --git a/src/biogeophys/test/WaterTracerUtils_test/test_compare_bulk_to_tracer.pf b/src/biogeophys/test/WaterTracerUtils_test/test_compare_bulk_to_tracer.pf index 582ab72364..01292402ff 100644 --- a/src/biogeophys/test/WaterTracerUtils_test/test_compare_bulk_to_tracer.pf +++ b/src/biogeophys/test/WaterTracerUtils_test/test_compare_bulk_to_tracer.pf @@ -6,6 +6,7 @@ module test_compare_bulk_to_tracer use WaterTracerUtils, only : CompareBulkToTracer use shr_kind_mod , only : r8 => shr_kind_r8 use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + use decompMod, only : subgrid_level_unspecified use unittestUtils, only : endrun_msg use clm_varcon, only : spval @@ -40,7 +41,8 @@ contains real(r8), intent(in) :: bulk real(r8), intent(in) :: tracer real(r8), intent(in) :: ratio - call CompareBulkToTracer(bounds_beg = 1, bounds_end = 1, & + call CompareBulkToTracer(subgrid_level = subgrid_level_unspecified, & + bounds_beg = 1, bounds_end = 1, & bulk = [bulk], tracer = [tracer], & ratio = ratio, & caller_location = 'test', name = 'myvar') diff --git a/src/cpl/lilac/lnd_comp_esmf.F90 b/src/cpl/lilac/lnd_comp_esmf.F90 index c01e454211..e9b9e7f407 100644 --- a/src/cpl/lilac/lnd_comp_esmf.F90 +++ b/src/cpl/lilac/lnd_comp_esmf.F90 @@ -24,7 +24,7 @@ module lnd_comp_esmf ! ctsm code use spmdMod , only : masterproc, spmd_init, mpicom - use decompMod , only : bounds_type, ldecomp, get_proc_bounds + use decompMod , only : bounds_type, get_proc_bounds use domainMod , only : ldomain use controlMod , only : control_setNL use clm_varorb , only : eccen, obliqr, lambm0, mvelpp @@ -342,7 +342,7 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc) call ESMF_LogWrite(subname//"ctsm initialize1 done...", ESMF_LOGMSG_INFO) !---------------------- - ! Initialize decomposition (ldecomp) and domain (ldomain) types and generate land mesh + ! Initialize decomposition and domain (ldomain) types and generate land mesh !---------------------- ! TODO: generalize this so that a mask mesh is read in like for nuopc/cmeps ! For now set the meshfile_mask equal to the model_meshfile diff --git a/src/cpl/mct/FireDataBaseType.F90 b/src/cpl/mct/FireDataBaseType.F90 index 281073f9cb..2d95422fd7 100644 --- a/src/cpl/mct/FireDataBaseType.F90 +++ b/src/cpl/mct/FireDataBaseType.F90 @@ -7,19 +7,19 @@ module FireDataBaseType ! module for handling of fire data ! ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print - use shr_strdata_mod , only : shr_strdata_advance - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog, inst_name - use spmdMod , only : masterproc, mpicom, comp_id - use fileutils , only : getavu, relavu - use decompMod , only : gsmap_lnd_gdc2glo - use domainMod , only : ldomain - use abortutils , only : endrun - use decompMod , only : bounds_type + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL + use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print + use shr_strdata_mod , only : shr_strdata_advance + use shr_log_mod , only : errMsg => shr_log_errMsg + use clm_varctl , only : iulog, inst_name + use spmdMod , only : masterproc, mpicom, comp_id + use fileutils , only : getavu, relavu + use domainMod , only : ldomain + use abortutils , only : endrun + use decompMod , only : bounds_type + use FireMethodType , only : fire_method_type + use lnd_set_decomp_and_domain, only : gsmap_global use mct_mod - use FireMethodType , only : fire_method_type ! implicit none private @@ -38,7 +38,6 @@ module FireDataBaseType type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream - contains ! ! !PUBLIC MEMBER FUNCTIONS: @@ -171,7 +170,6 @@ subroutine hdm_init( this, bounds, NLFilename ) character(len=CL) :: popdensmapalgo = 'bilinear' ! mapping alogrithm for population density character(len=CL) :: popdens_tintalgo = 'nearest'! time interpolation alogrithm for population density character(len=CL) :: stream_meshfile_popdens ! not used - character(*), parameter :: subName = "('hdmdyn_init')" character(*), parameter :: F00 = "('(hdmdyn_init) ',4a)" !----------------------------------------------------------------------- @@ -225,31 +223,31 @@ subroutine hdm_init( this, bounds, NLFilename ) call clm_domain_mct (bounds, dom_clm) - call shr_strdata_create(this%sdat_hdm,name="clmhdm", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_popdens, & - yearLast=stream_year_last_popdens, & - yearAlign=model_year_align_popdens, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_popdens), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & + call shr_strdata_create(this%sdat_hdm,name="clmhdm", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=stream_year_first_popdens, & + yearLast=stream_year_last_popdens, & + yearAlign=model_year_align_popdens, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_fldFileName_popdens), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domAreaName='area', & + domMaskName='mask', & + filePath='', & filename=(/trim(stream_fldFileName_popdens)/) , & - fldListFile='hdm', & - fldListModel='hdm', & - fillalgo='none', & - mapalgo=popdensmapalgo, & - calendar=get_calendar(), & - tintalgo=popdens_tintalgo, & + fldListFile='hdm', & + fldListModel='hdm', & + fillalgo='none', & + mapalgo=popdensmapalgo, & + calendar=get_calendar(), & + tintalgo=popdens_tintalgo, & taxmode='extend' ) if (masterproc) then @@ -381,31 +379,31 @@ subroutine lnfm_init( this, bounds, NLFilename ) call clm_domain_mct (bounds, dom_clm) - call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", & - pio_subsystem=pio_subsystem, & + call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", & + pio_subsystem=pio_subsystem, & pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_lightng, & - yearLast=stream_year_last_lightng, & - yearAlign=model_year_align_lightng, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_lightng), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_lightng)/),& - fldListFile='lnfm', & - fldListModel='lnfm', & - fillalgo='none', & - tintalgo=lightng_tintalgo, & - mapalgo=lightngmapalgo, & - calendar=get_calendar(), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=stream_year_first_lightng, & + yearLast=stream_year_last_lightng, & + yearAlign=model_year_align_lightng, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_fldFileName_lightng), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domAreaName='area', & + domMaskName='mask', & + filePath='', & + filename=(/trim(stream_fldFileName_lightng)/), & + fldListFile='lnfm', & + fldListModel='lnfm', & + fillalgo='none', & + tintalgo=lightng_tintalgo, & + mapalgo=lightngmapalgo, & + calendar=get_calendar(), & taxmode='cycle' ) if (masterproc) then diff --git a/src/cpl/mct/SoilMoistureStreamMod.F90 b/src/cpl/mct/SoilMoistureStreamMod.F90 index eab6d26c02..8b366d6c8e 100644 --- a/src/cpl/mct/SoilMoistureStreamMod.F90 +++ b/src/cpl/mct/SoilMoistureStreamMod.F90 @@ -16,26 +16,24 @@ module SoilMoistureStreamMod ! Read in soil moisture from data stream ! ! !USES: - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create - use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_kind_mod , only : CL => shr_kind_CL, CXX => shr_kind_CXX - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog, use_soil_moisture_streams, inst_name - use clm_varcon , only : grlnd - use controlMod , only : NLFilename - use decompMod , only : gsMap_lnd2Dsoi_gdc2glo - use domainMod , only : ldomain - use fileutils , only : getavu, relavu - use LandunitType , only : lun - use ColumnType , only : col - use SoilStateType , only : soilstate_type - use WaterStateBulkType, only : waterstatebulk_type - use perf_mod , only : t_startf, t_stopf - use spmdMod , only : masterproc - use spmdMod , only : mpicom, comp_id + use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create + use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance + use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_kind_mod , only : CL => shr_kind_CL, CXX => shr_kind_CXX + use shr_log_mod , only : errMsg => shr_log_errMsg + use decompMod , only : bounds_type, subgrid_level_column + use abortutils , only : endrun + use clm_varctl , only : iulog, use_soil_moisture_streams, inst_name + use clm_varcon , only : grlnd + use controlMod , only : NLFilename + use domainMod , only : ldomain + use LandunitType , only : lun + use ColumnType , only : col + use SoilStateType , only : soilstate_type + use WaterStateBulkType , only : waterstatebulk_type + use perf_mod , only : t_startf, t_stopf + use spmdMod , only : masterproc, mpicom, comp_id + use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo use mct_mod use ncdio_pio ! @@ -127,8 +125,7 @@ subroutine PrescribedSoilMoistureInit(bounds) ! Read soilm_streams namelist if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) call find_nlgroup_name(nu_nml, 'soil_moisture_streams', status=nml_error) if (nml_error == 0) then read(nu_nml, nml=soil_moisture_streams,iostat=nml_error) @@ -139,7 +136,6 @@ subroutine PrescribedSoilMoistureInit(bounds) call endrun(subname // ':: ERROR finding soilm_streams namelist') end if close(nu_nml) - call relavu( nu_nml ) endif call shr_mpi_bcast(stream_year_first_soilm, mpicom) @@ -170,11 +166,8 @@ subroutine PrescribedSoilMoistureInit(bounds) call clm_domain_mct (bounds, dom_clm, nlevels=nlevsoi) - ! ! create the field list for these fields...use in shr_strdata_create - ! fldList = trim(soilmString) - if (masterproc) write(iulog,*) 'fieldlist: ', trim(fldList) call shr_strdata_create(sdat_soilm,name="soil_moisture", & @@ -387,7 +380,9 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & else write(iulog,*) 'Input soil moisture dataset is not vegetated as expected: gridcell=', & g, ' active = ', col%active(c) - call endrun(subname // ' ERROR:: The input soil moisture stream is NOT vegetated for one of the land points' ) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg = subname // & + ' ERROR:: The input soil moisture stream is NOT vegetated for one of the land points' ) end if end if @@ -409,7 +404,8 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & h2osoi_ice(c,j) = h2osoi_ice(c,j) + (soilm_ice_frac * moisture_increment * dz(c, j) * denice) else - call endrun(subname // ':: ERROR h2osoil liquid plus ice is zero') + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg = subname // ':: ERROR h2osoil liquid plus ice is zero') endif enddo endif diff --git a/src/cpl/mct/UrbanTimeVarType.F90 b/src/cpl/mct/UrbanTimeVarType.F90 index 7a907bb9b9..805ac47fbf 100644 --- a/src/cpl/mct/UrbanTimeVarType.F90 +++ b/src/cpl/mct/UrbanTimeVarType.F90 @@ -8,7 +8,7 @@ module UrbanTimeVarType use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_landunit use clm_varctl , only : iulog, inst_name use landunit_varcon , only : isturb_MIN, isturb_MAX use clm_varcon , only : spval @@ -100,10 +100,10 @@ subroutine urbantv_init(this, bounds, NLFilename) use shr_mpi_mod , only : shr_mpi_bcast use shr_string_mod , only : shr_string_listAppend use shr_strdata_mod , only : shr_strdata_create, shr_strdata_print - use decompMod , only : gsmap_lnd_gdc2glo use domainMod , only : ldomain use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use landunit_varcon , only : isturb_TBD, isturb_HD, isturb_MD + use lnd_set_decomp_and_domain , only : gsmap_global ! ! !ARGUMENTS: implicit none @@ -190,31 +190,31 @@ subroutine urbantv_init(this, bounds, NLFilename) call shr_string_listAppend( fldList, stream_var_name(ifield) ) end do - call shr_strdata_create(this%sdat_urbantv,name="clmurbantv", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_urbantv, & - yearLast=stream_year_last_urbantv, & - yearAlign=model_year_align_urbantv, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_urbantv), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='LANDMASK', & - filePath='', & - filename=(/trim(stream_fldFileName_urbantv)/) , & - fldListFile=fldList, & - fldListModel=fldList, & - fillalgo='none', & - mapalgo=urbantvmapalgo, & - calendar=get_calendar(), & - tintalgo=urbantv_tintalgo, & + call shr_strdata_create(this%sdat_urbantv,name="clmurbantv", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=stream_year_first_urbantv, & + yearLast=stream_year_last_urbantv, & + yearAlign=model_year_align_urbantv, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_fldFileName_urbantv), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domAreaName='area', & + domMaskName='LANDMASK', & + filePath='', & + filename=(/trim(stream_fldFileName_urbantv)/) , & + fldListFile=fldList, & + fldListModel=fldList, & + fillalgo='none', & + mapalgo=urbantvmapalgo, & + calendar=get_calendar(), & + tintalgo=urbantv_tintalgo, & taxmode='extend' ) if (masterproc) then @@ -299,10 +299,11 @@ subroutine urbantv_interp(this, bounds) end do if ( found ) then write(iulog,*)'ERROR: no valid urban data for g= ',gindx - write(iulog,*)'landunit type: ',lun%itype(l) + write(iulog,*)'landunit type: ',lun%itype(lindx) write(iulog,*)'urban_valid: ',urban_valid(gindx) write(iulog,*)'t_building_max: ',this%t_building_max(lindx) - call endrun(msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=lindx, subgrid_level=subgrid_level_landunit, & + msg=errmsg(sourcefile, __LINE__)) end if diff --git a/src/cpl/mct/ch4FInundatedStreamType.F90 b/src/cpl/mct/ch4FInundatedStreamType.F90 index dcdc76fa08..3c26f4d109 100644 --- a/src/cpl/mct/ch4FInundatedStreamType.F90 +++ b/src/cpl/mct/ch4FInundatedStreamType.F90 @@ -70,13 +70,14 @@ subroutine Init(this, bounds, NLFilename) use shr_mpi_mod , only : shr_mpi_bcast use ndepStreamMod , only : clm_domain_mct use domainMod , only : ldomain - use decompMod , only : bounds_type, gsmap_lnd_gdc2glo + use decompMod , only : bounds_type use mct_mod , only : mct_ggrid, mct_avect_indexra use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance use spmdMod , only : comp_id, iam use ch4varcon , only : finundation_mtd_h2osfc use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion + use lnd_set_decomp_and_domain , only : gsmap_global ! ! arguments implicit none @@ -108,30 +109,30 @@ subroutine Init(this, bounds, NLFilename) if ( this%useStreams() )then call clm_domain_mct (bounds, dom_clm) - call shr_strdata_create(sdat,name=stream_name,& - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=1996, & - yearLast=1996, & - yearAlign=1, & - offset=0, & - domFilePath='', & - domFileName=trim(control%stream_fldFileName_ch4finundated), & - domTvarName='time', & - domXvarName='LONGXY' , & - domYvarName='LATIXY' , & - domAreaName='AREA', & - domMaskName='LANDMASK', & - filePath='', & - filename=(/trim(control%stream_fldFileName_ch4finundated)/),& - fldListFile=control%fldList, & - fldListModel=control%fldList, & - fillalgo='none', & - mapalgo=control%ch4finundatedmapalgo, & - calendar=get_calendar(), & + call shr_strdata_create(sdat,name=stream_name, & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=1996, & + yearLast=1996, & + yearAlign=1, & + offset=0, & + domFilePath='', & + domFileName=trim(control%stream_fldFileName_ch4finundated), & + domTvarName='time', & + domXvarName='LONGXY' , & + domYvarName='LATIXY' , & + domAreaName='AREA', & + domMaskName='LANDMASK', & + filePath='', & + filename=(/trim(control%stream_fldFileName_ch4finundated)/), & + fldListFile=control%fldList, & + fldListModel=control%fldList, & + fillalgo='none', & + mapalgo=control%ch4finundatedmapalgo, & + calendar=get_calendar(), & taxmode='extend' ) if (masterproc) then diff --git a/src/cpl/mct/laiStreamMod.F90 b/src/cpl/mct/laiStreamMod.F90 index df12d6912e..47d25287b7 100644 --- a/src/cpl/mct/laiStreamMod.F90 +++ b/src/cpl/mct/laiStreamMod.F90 @@ -53,8 +53,8 @@ subroutine lai_init(bounds) use ndepStreamMod , only : clm_domain_mct use histFileMod , only : hist_addfld1d use domainMod , only : ldomain - use decompMod , only : gsmap_lnd_gdc2glo use controlMod , only : NLFilename + use lnd_set_decomp_and_domain , only : gsmap_global ! ! !ARGUMENTS: implicit none @@ -131,7 +131,7 @@ subroutine lai_init(bounds) pio_subsystem=pio_subsystem, & pio_iotype=shr_pio_getiotype(inst_name), & mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & + gsmap=gsmap_global, ggrid=dom_clm, & nxg=ldomain%ni, nyg=ldomain%nj, & yearFirst=stream_year_first_lai, & yearLast=stream_year_last_lai, & diff --git a/src/cpl/mct/lnd_comp_mct.F90 b/src/cpl/mct/lnd_comp_mct.F90 index f94a3544dc..1595611a72 100644 --- a/src/cpl/mct/lnd_comp_mct.F90 +++ b/src/cpl/mct/lnd_comp_mct.F90 @@ -11,12 +11,11 @@ module lnd_comp_mct use shr_sys_mod , only : shr_sys_flush use shr_log_mod , only : errMsg => shr_log_errMsg use mct_mod , only : mct_avect, mct_gsmap, mct_gGrid - use decompmod , only : bounds_type, ldecomp + use decompmod , only : bounds_type use lnd_import_export, only : lnd_import, lnd_export ! ! !public member functions: implicit none - save private ! by default make data private ! ! !public member functions: @@ -25,7 +24,6 @@ module lnd_comp_mct public :: lnd_final_mct ! clm finalization/cleanup ! ! !private member functions: - private :: lnd_setgsmap_mct ! set the land model mct gs map private :: lnd_domain_mct ! set the land model domain information private :: lnd_handle_resume ! handle pause/resume signals from the coupler @@ -67,8 +65,9 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) use spmdMod , only : masterproc, spmd_init use clm_varctl , only : nsrStartup, nsrContinue, nsrBranch use clm_cpl_indices , only : clm_cpl_indices_set - use mct_mod , only : mct_aVect_init, mct_aVect_zero, mct_gsMap_lsize - use lnd_set_decomp_and_domain, only : lnd_set_decomp_and_domain_from_surfrd + use mct_mod , only : mct_aVect_init, mct_aVect_zero, mct_gsMap, mct_gsMap_init + use decompMod , only : gindex_global + use lnd_set_decomp_and_domain, only : lnd_set_decomp_and_domain_from_surfrd, gsmap_global use ESMF ! ! !ARGUMENTS: @@ -84,6 +83,7 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) type(mct_gGrid), pointer :: dom_l ! Land model domain type(seq_infodata_type), pointer :: infodata ! CESM driver level info data integer :: lsize ! size of attribute vector + integer :: gsize ! global size integer :: g,i,j ! indices integer :: dtime_sync ! coupling time-step from the input synchronization clock logical :: exists ! true if file exists @@ -208,7 +208,7 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) ! Read namelists call initialize1(dtime=dtime_sync) - ! Initialize decomposition (ldecomp) and domain (ldomain) types + ! Initialize decomposition and domain (ldomain) type call lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj) ! If no land then exit out of initialization @@ -227,8 +227,10 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) ! Initialize clm gsMap, clm domain and clm attribute vectors call get_proc_bounds( bounds ) - call lnd_SetgsMap_mct( bounds, mpicom_lnd, LNDID, gsMap_lnd ) - lsize = mct_gsMap_lsize(gsMap_lnd, mpicom_lnd) + lsize = bounds%endg - bounds%begg + 1 + gsize = ldomain%ni * ldomain%nj + call mct_gsMap_init( gsMap_lnd, gindex_global, mpicom_lnd, LNDID, lsize, gsize ) + gsmap_global => gsmap_lnd ! module variable in lnd_set_decomp_and_domain call lnd_domain_mct( bounds, lsize, gsMap_lnd, dom_l ) call mct_aVect_init(x2l_l, rList=seq_flds_x2l_fields, lsize=lsize) call mct_aVect_zero(x2l_l) @@ -513,49 +515,6 @@ subroutine lnd_final_mct( EClock, cdata_l, x2l_l, l2x_l) ! fill this in end subroutine lnd_final_mct - !==================================================================================== - subroutine lnd_setgsmap_mct( bounds, mpicom_lnd, LNDID, gsMap_lnd ) - ! - ! !DESCRIPTION: - ! Set the MCT GS map for the land model - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use domainMod , only : ldomain - use mct_mod , only : mct_gsMap, mct_gsMap_init - implicit none - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: mpicom_lnd ! MPI communicator for the clm land model - integer , intent(in) :: LNDID ! Land model identifyer number - type(mct_gsMap) , intent(out) :: gsMap_lnd ! Resulting MCT GS map for the land model - ! - ! !LOCAL VARIABLES: - integer,allocatable :: gindex(:) ! Number the local grid points - integer :: i, j, n, gi ! Indices - integer :: lsize,gsize ! GS Map size - integer :: ier ! Error code - !--------------------------------------------------------------------------- - - ! Build the land grid numbering for MCT - ! NOTE: Numbering scheme is: West to East and South to North - ! starting at south pole. Should be the same as what's used in SCRIP - allocate(gindex(bounds%begg:bounds%endg),stat=ier) - - ! number the local grid - do n = bounds%begg, bounds%endg - gindex(n) = ldecomp%gdc2glo(n) - end do - lsize = bounds%endg - bounds%begg + 1 - gsize = ldomain%ni * ldomain%nj - - call mct_gsMap_init( gsMap_lnd, gindex, mpicom_lnd, LNDID, lsize, gsize ) - - deallocate(gindex) - - end subroutine lnd_SetgsMap_mct - !==================================================================================== subroutine lnd_domain_mct( bounds, lsize, gsMap_l, dom_l ) ! diff --git a/src/cpl/mct/lnd_import_export.F90 b/src/cpl/mct/lnd_import_export.F90 index 9015b98988..4f24da54d7 100644 --- a/src/cpl/mct/lnd_import_export.F90 +++ b/src/cpl/mct/lnd_import_export.F90 @@ -2,7 +2,7 @@ module lnd_import_export use shr_kind_mod , only: r8 => shr_kind_r8, cl=>shr_kind_cl use abortutils , only: endrun - use decompmod , only: bounds_type + use decompmod , only: bounds_type, subgrid_level_gridcell use lnd2atmType , only: lnd2atm_type use lnd2glcMod , only: lnd2glc_type use atm2lndType , only: atm2lnd_type @@ -179,7 +179,8 @@ subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst, wat co2_ppmv_val = co2_ppmv end if if ( (co2_ppmv_val < 10.0_r8) .or. (co2_ppmv_val > 15000.0_r8) )then - call endrun( sub//' ERROR: CO2 is outside of an expected range' ) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & + msg = sub//' ERROR: CO2 is outside of an expected range' ) end if atm2lnd_inst%forc_pco2_grc(g) = co2_ppmv_val * 1.e-6_r8 * forc_pbot if (use_c13) then diff --git a/src/cpl/mct/lnd_set_decomp_and_domain.F90 b/src/cpl/mct/lnd_set_decomp_and_domain.F90 index f5f6046df0..0a37554313 100644 --- a/src/cpl/mct/lnd_set_decomp_and_domain.F90 +++ b/src/cpl/mct/lnd_set_decomp_and_domain.F90 @@ -1,9 +1,9 @@ module lnd_set_decomp_and_domain - use shr_kind_mod , only : r8 => shr_kind_r8, cl=>shr_kind_cl + use shr_kind_mod , only : r8 => shr_kind_r8 use spmdMod , only : masterproc use clm_varctl , only : iulog - use perf_mod , only : t_startf, t_stopf, t_barrierf + use mct_mod , only : mct_gsMap implicit none private ! except @@ -15,6 +15,13 @@ module lnd_set_decomp_and_domain private :: surfrd_get_globmask ! Reads global land mask (needed for setting domain decomp) private :: surfrd_get_grid ! Read grid/ladnfrac data into domain (after domain decomp) + ! translation between local and global indices at gridcell level + type(mct_gsmap), pointer, public :: gsmap_global + + ! translation between local and global indices at gridcell level for multiple levels + ! needed for 3d soil moisture stream + type(mct_gsmap), target , public :: gsMap_lnd2Dsoi_gdc2glo + character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -24,13 +31,13 @@ module lnd_set_decomp_and_domain subroutine lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj) - ! Initialize ldecomp and ldomain data types + ! Initialize ldomain data types use clm_varpar , only: nlevsoi use clm_varctl , only: fatmlndfrc, use_soil_moisture_streams use decompInitMod , only: decompInit_lnd use decompMod , only: bounds_type, get_proc_bounds - use domainMod , only: ldomain, domain_init, domain_check + use domainMod , only: ldomain, domain_check ! input/output variables logical, intent(out) :: noland @@ -61,7 +68,6 @@ subroutine lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj) noland = .false. end if - ! Initialize ldecomp data type ! Determine ctsm gridcell decomposition and processor bounds for gridcells call decompInit_lnd(ni, nj, amask) deallocate(amask) @@ -112,7 +118,6 @@ subroutine surfrd_get_globmask(filename, mask, ni, nj) integer :: n,i,j ! index integer :: ier ! error status type(file_desc_t) :: ncid ! netcdf id - character(len=256) :: varname ! variable name character(len=256) :: locfn ! local file name logical :: readvar ! read variable in or not integer , allocatable :: idata2d(:,:) @@ -174,7 +179,7 @@ subroutine surfrd_get_globmask(filename, mask, ni, nj) end subroutine surfrd_get_globmask !----------------------------------------------------------------------- - subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename) + subroutine surfrd_get_grid(begg, endg, ldomain, filename) ! Read the surface dataset grid related information: ! This is called after the domain decomposition has been created @@ -182,28 +187,24 @@ subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename) ! - real longitude of grid cell (degrees) use clm_varcon , only : spval, re, grlnd - use domainMod , only : domain_type, domain_init, domain_clean, lon1d, lat1d + use domainMod , only : domain_type, lon1d, lat1d, domain_init use fileutils , only : getfil use abortutils , only : endrun use shr_log_mod , only : errMsg => shr_log_errMsg - use ncdio_pio , only : file_desc_t, var_desc_t, ncd_pio_openfile, ncd_pio_closefile - use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim_size, ncd_inqdid, ncd_inqdlen + use ncdio_pio , only : file_desc_t, ncd_pio_openfile, ncd_pio_closefile + use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim_size use pio ! input/output variables integer , intent(in) :: begg, endg type(domain_type) , intent(inout) :: ldomain ! domain to init character(len=*) , intent(in) :: filename ! grid filename - character(len=*) ,optional , intent(in) :: glcfilename ! glc mask filename ! local variables type(file_desc_t) :: ncid ! netcdf id integer :: beg ! local beg index integer :: end ! local end index integer :: ni,nj,ns ! size of grid on file - integer :: dimid,varid ! netCDF id's - integer :: start(1), count(1) ! 1d lat/lon array sections - integer :: ier,ret ! error status logical :: readvar ! true => variable is on input file logical :: isgrid2d ! true => file is 2d lat/lon logical :: istype_domain ! true => input file is of type domain @@ -295,12 +296,11 @@ end subroutine surfrd_get_grid subroutine decompInit_lnd3D(lni,lnj,lnk) ! ! !DESCRIPTION: - ! - ! Create a 3D decomposition gsmap for the global 2D grid with soil levels - ! as the 3rd dimesnion. + ! Create a 3D decomposition gsmap for the global 2D grid with soil levels + ! as the 3rd dimesnion. ! ! !USES: - use decompMod, only : ldecomp, gsmap_lnd2dsoi_gdc2glo, get_proc_bounds + use decompMod, only : gindex_global, bounds_type, get_proc_bounds use spmdMod , only : comp_id, mpicom use mct_mod , only : mct_gsmap_init ! @@ -308,14 +308,17 @@ subroutine decompInit_lnd3D(lni,lnj,lnk) integer , intent(in) :: lni,lnj,lnk ! domain global size ! ! !LOCAL VARIABLES: - integer :: m,n,k ! indices - integer :: begg,endg,lsize,gsize ! used for gsmap init - integer :: begg3d,endg3d - integer, pointer :: gindex(:) ! global index for gsmap init + integer :: m,n,k ! indices + integer :: begg,endg,lsize,gsize ! used for gsmap init + integer :: begg3d,endg3d + integer, pointer :: gindex(:) ! global index for gsmap init + type(bounds_type) :: bounds !------------------------------------------------------------------------------ - ! Set gsMap_lnd_gdc2glo (the global index here includes mask=0 or ocean points) - call get_proc_bounds(begg, endg) + ! Initialize gsmap_lnd2dsoi_gdc2glo + call get_proc_bounds(bounds) + begg = bounds%begg; endg=bounds%endg + begg3d = (begg-1)*lnk + 1 endg3d = endg*lnk lsize = (endg3d - begg3d + 1 ) @@ -323,7 +326,7 @@ subroutine decompInit_lnd3D(lni,lnj,lnk) do k = 1, lnk do n = begg,endg m = (begg-1)*lnk + (k-1)*(endg-begg+1) + (n-begg+1) - gindex(m) = ldecomp%gdc2glo(n) + (k-1)*(lni*lnj) + gindex(m) = gindex_global(n-begg+1) + (k-1)*(lni*lnj) enddo enddo gsize = lni * lnj * lnk diff --git a/src/cpl/mct/ndepStreamMod.F90 b/src/cpl/mct/ndepStreamMod.F90 index e99afd81f3..af03ca5c35 100644 --- a/src/cpl/mct/ndepStreamMod.F90 +++ b/src/cpl/mct/ndepStreamMod.F90 @@ -14,14 +14,12 @@ module ndepStreamMod use spmdMod , only: mpicom, masterproc, comp_id, iam use clm_varctl , only: iulog, inst_name use abortutils , only: endrun - use fileutils , only: getavu, relavu - use decompMod , only: bounds_type, ldecomp + use decompMod , only: bounds_type use domainMod , only: ldomain ! !PUBLIC TYPES: implicit none private - save ! !PUBLIC MEMBER FUNCTIONS: public :: ndep_init ! position datasets for dynamic ndep @@ -58,7 +56,7 @@ subroutine ndep_init(bounds, NLFilename) use shr_nl_mod , only : shr_nl_find_group_name use shr_log_mod , only : errMsg => shr_log_errMsg use shr_mpi_mod , only : shr_mpi_bcast - use decompMod , only : gsmap_lnd_gdc2glo + use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global ! ! arguments implicit none @@ -96,8 +94,7 @@ subroutine ndep_init(bounds, NLFilename) ! Read ndepdyn_nml namelist if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) call shr_nl_find_group_name(nu_nml, 'ndepdyn_nml', status=nml_error) if (nml_error == 0) then read(nu_nml, nml=ndepdyn_nml,iostat=nml_error) @@ -108,7 +105,6 @@ subroutine ndep_init(bounds, NLFilename) call endrun(msg=' ERROR finding ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__)) end if close(nu_nml) - call relavu( nu_nml ) endif call shr_mpi_bcast(stream_year_first_ndep , mpicom) @@ -141,7 +137,7 @@ subroutine ndep_init(bounds, NLFilename) pio_subsystem=pio_subsystem, & pio_iotype=shr_pio_getiotype(inst_name), & mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & + gsmap=gsmap_global, ggrid=dom_clm, & nxg=ldomain%ni, nyg=ldomain%nj, & yearFirst=stream_year_first_ndep, & yearLast=stream_year_last_ndep, & @@ -268,13 +264,12 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels) !------------------------------------------------------------------- ! Set domain data type for internal clm grid - use clm_varcon , only : re - use domainMod , only : ldomain - use mct_mod , only : mct_ggrid, mct_gsMap_lsize, mct_gGrid_init - use mct_mod , only : mct_gsMap_orderedPoints, mct_gGrid_importIAttr - use mct_mod , only : mct_gGrid_importRAttr - use mct_mod , only : mct_gsMap - use decompMod , only : gsmap_lnd_gdc2glo, gsMap_lnd2Dsoi_gdc2glo + use clm_varcon , only : re + use domainMod , only : ldomain + use mct_mod , only : mct_ggrid, mct_gsMap_lsize, mct_gGrid_init + use mct_mod , only : mct_gsMap_orderedPoints, mct_gGrid_importIAttr + use mct_mod , only : mct_gGrid_importRAttr, mct_gsMap + use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global implicit none ! ! arguments @@ -294,7 +289,7 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels) nlevs = 1 if ( present(nlevels) ) nlevs = nlevels if ( nlevs == 1 ) then - gsmap => gsmap_lnd_gdc2glo + gsmap => gsmap_global else gsmap => gsMap_lnd2Dsoi_gdc2glo end if diff --git a/src/cpl/nuopc/lnd_comp_nuopc.F90 b/src/cpl/nuopc/lnd_comp_nuopc.F90 index 19c7748297..18ac163aee 100644 --- a/src/cpl/nuopc/lnd_comp_nuopc.F90 +++ b/src/cpl/nuopc/lnd_comp_nuopc.F90 @@ -76,9 +76,9 @@ module lnd_comp_nuopc real(R8) :: orb_mvelp ! attribute - moving vernal equinox longitude real(R8) :: orb_eccen ! attribute and update- orbital eccentricity - logical :: scol_valid ! if single_column, does point have a mask of zero + logical :: scol_valid ! if single_column, does point have a mask of zero - integer :: nthrds ! Number of threads per task in this component + integer :: nthrds ! Number of threads per task in this component character(len=*) , parameter :: orb_fixed_year = 'fixed_year' character(len=*) , parameter :: orb_variable_year = 'variable_year' @@ -88,6 +88,8 @@ module lnd_comp_nuopc character(len=*) , parameter :: continue_run = 'continue' character(len=*) , parameter :: branch_run = 'branch' + logical :: write_restart_at_endofrun = .false. + character(len=*) , parameter :: u_FILE_u = & __FILE__ @@ -321,10 +323,10 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) use ESMF , only : ESMF_VM, ESMF_VMGet use clm_instMod , only : lnd2atm_inst, lnd2glc_inst, water_inst use domainMod , only : ldomain - use decompMod , only : ldecomp, bounds_type, get_proc_bounds + use decompMod , only : bounds_type, get_proc_bounds use lnd_set_decomp_and_domain , only : lnd_set_decomp_and_domain_from_readmesh use lnd_set_decomp_and_domain , only : lnd_set_mesh_for_single_column - use lnd_set_decomp_and_domain , only : lnd_set_decomp_and_domain_for_single_column + use lnd_set_decomp_and_domain , only : lnd_set_decomp_and_domain_for_single_column ! input/output variables type(ESMF_GridComp) :: gcomp @@ -356,7 +358,6 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) integer :: nsrest ! ctsm restart type integer :: lbnum ! input to memory diagnostic integer :: shrlogunit ! original log unit - type(bounds_type) :: bounds ! bounds integer :: n, ni, nj ! Indices character(len=CL) :: cvalue ! config data character(len=CL) :: meshfile_mask ! filename of mesh file with land mask @@ -369,15 +370,18 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) integer :: scol_mask ! single-column mask real(r8) :: scol_spval ! single-column special value to indicate it isn't set character(len=CL) :: single_column_lnd_domainfile ! domain filename to use for single-column mode (i.e. SCAM) + type(bounds_type) :: bounds ! bounds type(ESMF_Field) :: lfield ! Land field read in character(CL) ,pointer :: lfieldnamelist(:) => null() ! Land field namelist item sent with land field integer :: fieldCount ! Number of fields on export state integer :: rank ! Rank of field (1D or 2D) real(r8), pointer :: fldptr1d(:) ! 1D field pointer real(r8), pointer :: fldptr2d(:,:) ! 2D field pointer - character(len=CL) :: model_version ! Model version - character(len=CL) :: hostname ! hostname of machine running on - character(len=CL) :: username ! user running the model + logical :: isPresent ! If attribute is present + logical :: isSet ! If attribute is present and also set + character(len=CL) :: model_version ! Model version + character(len=CL) :: hostname ! hostname of machine running on + character(len=CL) :: username ! user running the model character(len=*),parameter :: subname=trim(modName)//':(InitializeRealize) ' !------------------------------------------------------------------------------- @@ -385,7 +389,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO) !---------------------------------------------------------------------------- - ! Single column logic - if mask is zero for nearest neighbor search then + ! Single column logic - if mask is zero for nearest neighbor search then ! set all export state fields to zero and return !---------------------------------------------------------------------------- @@ -477,24 +481,24 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) call memmon_dump_fort('memmon.out','lnd_comp_nuopc_InitializeRealize:start::',lbnum) endif #endif - !---------------------------------------------------------------------------- - ! Initialize component threading - !---------------------------------------------------------------------------- - - call ESMF_GridCompGet(gcomp, vm=vm, localPet=localPet, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call ESMF_VMGet(vm, pet=localPet, peCount=localPeCount, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - if(localPeCount == 1) then - call NUOPC_CompAttributeGet(gcomp, "nthreads", value=cvalue, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=u_FILE_u)) return - read(cvalue,*) nthrds - else - nthrds = localPeCount - endif - - !$ call omp_set_num_threads(nthrds) + !---------------------------------------------------------------------------- + ! Initialize component threading + !---------------------------------------------------------------------------- + + call ESMF_GridCompGet(gcomp, vm=vm, localPet=localPet, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + call ESMF_VMGet(vm, pet=localPet, peCount=localPeCount, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + + if(localPeCount == 1) then + call NUOPC_CompAttributeGet(gcomp, "nthreads", value=cvalue, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=u_FILE_u)) return + read(cvalue,*) nthrds + else + nthrds = localPeCount + endif + + !$ call omp_set_num_threads(nthrds) !---------------------- ! Consistency check on namelist filename @@ -563,6 +567,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! Set model clock in lnd_comp_shr model_clock = clock + call NUOPC_CompAttributeGet(gcomp, name="write_restart_at_endofrun", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + if (isPresent .and. isSet) then + if (trim(cvalue) .eq. '.true.') write_restart_at_endofrun = .true. + end if ! --------------------- ! Initialize first phase of ctsm ! --------------------- @@ -814,22 +823,6 @@ subroutine ModelAdvance(gcomp, rc) end if call update_rad_dtime(doalb) - !-------------------------------- - ! Determine if time to write restart - !-------------------------------- - - call ESMF_ClockGetAlarm(clock, alarmname='alarm_restart', alarm=alarm, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - - if (ESMF_AlarmIsRinging(alarm, rc=rc)) then - if (ChkErr(rc,__LINE__,u_FILE_u)) return - rstwr = .true. - call ESMF_AlarmRingerOff( alarm, rc=rc ) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - else - rstwr = .false. - endif - !-------------------------------- ! Determine if time to stop !-------------------------------- @@ -846,6 +839,25 @@ subroutine ModelAdvance(gcomp, rc) nlend = .false. endif + !-------------------------------- + ! Determine if time to write restart + !-------------------------------- + rstwr = .false. + if (nlend .and. write_restart_at_endofrun) then + rstwr = .true. + else + call ESMF_ClockGetAlarm(clock, alarmname='alarm_restart', alarm=alarm, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + if (ESMF_AlarmIsCreated(alarm, rc=rc)) then + if (ESMF_AlarmIsRinging(alarm, rc=rc)) then + if (ChkErr(rc,__LINE__,u_FILE_u)) return + rstwr = .true. + call ESMF_AlarmRingerOff( alarm, rc=rc ) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + endif + endif + end if + !-------------------------------- ! Run CTSM !-------------------------------- @@ -1004,7 +1016,7 @@ subroutine ModelSetRunClock(gcomp, rc) call ESMF_GridCompGet(gcomp, name=name, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - call ESMF_LogWrite(subname//'setting alarms for' // trim(name), ESMF_LOGMSG_INFO) + call ESMF_LogWrite(subname//'setting alarms for ' // trim(name), ESMF_LOGMSG_INFO) !---------------- ! Restart alarm diff --git a/src/cpl/share_esmf/SoilMoistureStreamMod.F90 b/src/cpl/share_esmf/SoilMoistureStreamMod.F90 index 7972a85b9e..d5ef28f924 100644 --- a/src/cpl/share_esmf/SoilMoistureStreamMod.F90 +++ b/src/cpl/share_esmf/SoilMoistureStreamMod.F90 @@ -15,7 +15,7 @@ module SoilMoistureStreamMod use shr_kind_mod , only : r8 => shr_kind_r8, cl => shr_kind_CL, cxx => shr_kind_CXX use shr_log_mod , only : errMsg => shr_log_errMsg use shr_mpi_mod , only : shr_mpi_bcast - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_column use abortutils , only : endrun use clm_varctl , only : iulog, use_soil_moisture_streams use controlMod , only : NLFilename @@ -343,7 +343,8 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, waterstatebulk_i else write(iulog,*) 'Input soil moisture dataset is not vegetated as expected: gridcell=', & g, ' active = ', col%active(c) - call endrun(subname //& + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg = subname //& ' ERROR:: The input soil moisture stream is NOT vegetated for one of the land points' ) end if end if @@ -365,7 +366,8 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, waterstatebulk_i h2osoi_ice(c,j) = h2osoi_ice(c,j) + (soilm_ice_frac * moisture_increment * dz(c, j) * denice) else - call endrun(subname // ':: ERROR h2osoil liquid plus ice is zero') + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg = subname // ':: ERROR h2osoil liquid plus ice is zero') endif enddo endif diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index 68ba3655cd..cc48bf4833 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -10,7 +10,7 @@ module UrbanTimeVarType use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_landunit use clm_varctl , only : iulog use landunit_varcon , only : isturb_MIN, isturb_MAX use clm_varcon , only : spval @@ -287,10 +287,11 @@ subroutine urbantv_interp(this, bounds) end do if ( found ) then write(iulog,*)'ERROR: no valid urban data for g= ',gindx - write(iulog,*)'landunit type: ',lun%itype(l) + write(iulog,*)'landunit type: ',lun%itype(lindx) write(iulog,*)'urban_valid: ',urban_valid(gindx) write(iulog,*)'t_building_max: ',this%t_building_max(lindx) - call endrun(msg=errmsg(sourcefile, __LINE__)) + call endrun(subgrid_index=lindx, subgrid_level=subgrid_level_landunit, & + msg=errmsg(sourcefile, __LINE__)) end if end subroutine urbantv_interp diff --git a/src/cpl/share_esmf/lnd_set_decomp_and_domain.F90 b/src/cpl/share_esmf/lnd_set_decomp_and_domain.F90 index 40f43e7f4d..c881282132 100644 --- a/src/cpl/share_esmf/lnd_set_decomp_and_domain.F90 +++ b/src/cpl/share_esmf/lnd_set_decomp_and_domain.F90 @@ -37,7 +37,7 @@ subroutine lnd_set_decomp_and_domain_from_readmesh(driver, vm, meshfile_lnd, mes use decompInitMod , only : decompInit_lnd use domainMod , only : ldomain, domain_init - use decompMod , only : ldecomp, bounds_type, get_proc_bounds + use decompMod , only : gindex_global, bounds_type, get_proc_bounds use clm_varpar , only : nlevsoi use clm_varctl , only : use_soil_moisture_streams @@ -134,7 +134,7 @@ subroutine lnd_set_decomp_and_domain_from_readmesh(driver, vm, meshfile_lnd, mes allocate(gindex_lnd(nlnd)) do g = begg, endg n = 1 + (g - begg) - gindex_lnd(n) = ldecomp%gdc2glo(g) + gindex_lnd(n) = gindex_global(g-begg+1) end do ! Initialize domain data structure @@ -241,7 +241,7 @@ subroutine lnd_set_decomp_and_domain_for_single_column(scol_lon, scol_lat, scol_ type(bounds_type) :: bounds ! bounds !------------------------------------------------------------------------------- - ! Determine ldecomp and ldomain + ! Determine decomp and ldomain call decompInit_lnd(lni=1, lnj=1, amask=(/1/)) ! Initialize processor bounds diff --git a/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 b/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 index c1168cbfd7..b5373247ff 100644 --- a/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 +++ b/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 @@ -93,8 +93,8 @@ module dynColumnStateUpdaterMod use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun use clm_varctl , only : iulog - use clm_varcon , only : namec, spval - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC + use clm_varcon , only : spval + use decompMod , only : bounds_type, bounds_level_proc, subgrid_level_column use ColumnType , only : col use LandunitType , only : lun use landunit_varcon , only : max_lunit, landunit_is_special @@ -187,7 +187,7 @@ function constructor(bounds, nclumps) character(len=*), parameter :: subname = 'constructor' !----------------------------------------------------------------------- - SHR_ASSERT_FL(bounds%level == BOUNDS_LEVEL_PROC, sourcefile, __LINE__) + SHR_ASSERT_FL(bounds%level == bounds_level_proc, sourcefile, __LINE__) allocate(constructor%cwtgcell_old(bounds%begc:bounds%endc)) constructor%cwtgcell_old(:) = nan @@ -891,7 +891,7 @@ subroutine update_column_state(this, bounds, & if (this%area_gained_col(c) < 0._r8) then if (.not. vals_input_valid(c)) then write(iulog,*) subname//' ERROR: shrinking column without valid input value' - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end if area_lost = -1._r8 * this%area_gained_col(c) total_area_lost_grc(g) = total_area_lost_grc(g) + area_lost diff --git a/src/dyn_subgrid/dynHarvestMod.F90 b/src/dyn_subgrid/dynHarvestMod.F90 index c16c15906c..913ed85be3 100644 --- a/src/dyn_subgrid/dynHarvestMod.F90 +++ b/src/dyn_subgrid/dynHarvestMod.F90 @@ -10,7 +10,7 @@ module dynHarvestMod ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC + use decompMod , only : bounds_type, bounds_level_proc use abortutils , only : endrun use dynFileMod , only : dyn_file_type use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type @@ -87,7 +87,7 @@ subroutine dynHarvest_init(bounds, harvest_filename) character(len=*), parameter :: subname = 'dynHarvest_init' !----------------------------------------------------------------------- - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') ! we only need to keep this summary variable in CN veg type if ( .not. use_fates ) then @@ -153,7 +153,7 @@ subroutine dynHarvest_interp(bounds) character(len=*), parameter :: subname = 'dynHarvest_interp' !----------------------------------------------------------------------- - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') call dynHarvest_file%time_info%set_current_year() diff --git a/src/dyn_subgrid/dynInitColumnsMod.F90 b/src/dyn_subgrid/dynInitColumnsMod.F90 index f135ec0cc1..753e50c5ff 100644 --- a/src/dyn_subgrid/dynInitColumnsMod.F90 +++ b/src/dyn_subgrid/dynInitColumnsMod.F90 @@ -9,10 +9,9 @@ module dynInitColumnsMod #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun + use decompMod , only : bounds_type, subgrid_level_column + use abortutils , only : endrun, write_point_context use clm_varctl , only : iulog - use clm_varcon , only : namec use TemperatureType , only : temperature_type use WaterType , only : water_type use SoilHydrologyType , only : soilhydrology_type @@ -51,9 +50,6 @@ subroutine initialize_new_columns(bounds, cactive_prior, & ! !DESCRIPTION: ! Do initialization for all columns that are newly-active in this time step ! - ! !USES: - use GetGlobalValuesMod , only : GetGlobalWrite - ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds ! bounds logical , intent(in) :: cactive_prior( bounds%begc: ) ! column-level active flags from prior time step @@ -79,7 +75,7 @@ subroutine initialize_new_columns(bounds, cactive_prior, & else write(iulog,*) subname// ' WARNING: No template column found to initialize newly-active column' write(iulog,*) '-- keeping the state that was already in memory, possibly from arbitrary initialization' - call GetGlobalWrite(decomp_index=c, clmlevel=namec) + call write_point_context(subgrid_index=c, subgrid_level=subgrid_level_column) end if end if end do @@ -124,19 +120,19 @@ function initial_template_col_dispatcher(bounds, c_new, cactive_prior) result(c_ case(istice) write(iulog,*) subname// ' ERROR: Ability to initialize a newly-active glacier mec column not yet implemented' write(iulog,*) 'Expectation is that glacier mec columns should be active from the start of the run wherever they can grow' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_new, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) case(istdlak) write(iulog,*) subname// ' ERROR: Ability to initialize a newly-active lake column not yet implemented' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_new, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) case(istwet) write(iulog,*) subname// ' ERROR: Ability to initialize a newly-active wetland column not yet implemented' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_new, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) case(isturb_MIN:isturb_MAX) write(iulog,*) subname// ' ERROR: Ability to initialize a newly-active urban column not yet implemented' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_new, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) case default write(iulog,*) subname// ' ERROR: Unknown landunit type: ', ltype - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_new, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end select end function initial_template_col_dispatcher @@ -167,7 +163,7 @@ function initial_template_col_soil(c_new) result(c_template) if (col%wtgcell(c_new) > 0._r8) then write(iulog,*) subname// ' ERROR: Expectation is that the only vegetated columns that& & can newly become active are ones with 0 weight on the grid cell' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c_new, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end if c_template = TEMPLATE_NONE_FOUND diff --git a/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 b/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 index ae625f6f0d..a3ed9d5467 100644 --- a/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 +++ b/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 @@ -20,7 +20,7 @@ module dynPatchStateUpdaterMod #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC + use decompMod , only : bounds_type, bounds_level_proc use PatchType , only : patch use ColumnType , only : col use clm_varpar , only : mxpft @@ -110,7 +110,7 @@ function constructor(bounds) result(this) character(len=*), parameter :: subname = 'constructor' !----------------------------------------------------------------------- - SHR_ASSERT_FL(bounds%level == BOUNDS_LEVEL_PROC, sourcefile, __LINE__) + SHR_ASSERT_FL(bounds%level == bounds_level_proc, sourcefile, __LINE__) begp = bounds%begp endp = bounds%endp diff --git a/src/dyn_subgrid/dynPriorWeightsMod.F90 b/src/dyn_subgrid/dynPriorWeightsMod.F90 index 577676f217..770836a78f 100644 --- a/src/dyn_subgrid/dynPriorWeightsMod.F90 +++ b/src/dyn_subgrid/dynPriorWeightsMod.F90 @@ -15,7 +15,7 @@ module dynPriorWeightsMod ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC + use decompMod , only : bounds_type, bounds_level_proc use ColumnType , only : col use PatchType , only : patch ! @@ -58,7 +58,7 @@ type(prior_weights_type) function constructor(bounds) character(len=*), parameter :: subname = 'prior_weights_type constructor' ! ---------------------------------------------------------------------- - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') allocate(constructor%pwtgcell(bounds%begp:bounds%endp)) allocate(constructor%cactive(bounds%begc:bounds%endc)) diff --git a/src/dyn_subgrid/dynSubgridDriverMod.F90 b/src/dyn_subgrid/dynSubgridDriverMod.F90 index e34791ce75..a1063032bb 100644 --- a/src/dyn_subgrid/dynSubgridDriverMod.F90 +++ b/src/dyn_subgrid/dynSubgridDriverMod.F90 @@ -9,7 +9,7 @@ module dynSubgridDriverMod ! dynamic landunits). ! ! !USES: - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC, BOUNDS_LEVEL_CLUMP + use decompMod , only : bounds_type, bounds_level_proc, bounds_level_clump use decompMod , only : get_proc_clumps, get_clump_bounds use dynSubgridControlMod , only : get_flanduse_timeseries use dynSubgridControlMod , only : get_do_transient_pfts, get_do_transient_crops, get_do_transient_lakes @@ -96,7 +96,7 @@ subroutine dynSubgrid_init(bounds_proc, glc_behavior, crop_inst) character(len=*), parameter :: subname = 'dynSubgrid_init' !----------------------------------------------------------------------- - SHR_ASSERT(bounds_proc%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds_proc%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') nclumps = get_proc_clumps() @@ -219,7 +219,7 @@ subroutine dynSubgrid_driver(bounds_proc, character(len=*), parameter :: subname = 'dynSubgrid_driver' !----------------------------------------------------------------------- - SHR_ASSERT(bounds_proc%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds_proc%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') nclumps = get_proc_clumps() @@ -344,7 +344,7 @@ subroutine dynSubgrid_wrapup_weight_changes(bounds_clump, glc_behavior) character(len=*), parameter :: subname = 'dynSubgrid_wrapup_weight_changes' !----------------------------------------------------------------------- - SHR_ASSERT(bounds_clump%level == BOUNDS_LEVEL_CLUMP, subname // ': argument must be CLUMP-level bounds') + SHR_ASSERT(bounds_clump%level == bounds_level_clump, subname // ': argument must be CLUMP-level bounds') call update_landunit_weights(bounds_clump) diff --git a/src/dyn_subgrid/dyncropFileMod.F90 b/src/dyn_subgrid/dyncropFileMod.F90 index 4ea7a4ff12..61ad9dbd02 100644 --- a/src/dyn_subgrid/dyncropFileMod.F90 +++ b/src/dyn_subgrid/dyncropFileMod.F90 @@ -9,11 +9,11 @@ module dyncropFileMod #include "shr_assert.h" use shr_log_mod , only : errMsg => shr_log_errMsg use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC + use decompMod , only : bounds_type, bounds_level_proc, subgrid_level_column use dynFileMod , only : dyn_file_type use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type use clm_varctl , only : iulog - use clm_varcon , only : grlnd, namec + use clm_varcon , only : grlnd use abortutils , only : endrun use spmdMod , only : masterproc, mpicom use LandunitType , only : lun @@ -68,7 +68,7 @@ subroutine dyncrop_init(bounds, dyncrop_filename) character(len=*), parameter :: subname = 'dyncrop_init' !----------------------------------------------------------------------- - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') if (masterproc) then write(iulog,*) 'Attempting to read crop dynamic landuse data .....' @@ -145,7 +145,7 @@ subroutine dyncrop_interp(bounds,crop_inst) character(len=*), parameter :: subname = 'dyncrop_interp' !----------------------------------------------------------------------- - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') call dyncrop_file%time_info%set_current_year() @@ -199,7 +199,7 @@ subroutine dyncrop_interp(bounds,crop_inst) if (col_set(c)) then write(iulog,*) subname//' ERROR: attempt to set a column that has already been set.' write(iulog,*) 'This may happen if there are multiple crops on a single column.' - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end if col%wtlunit(c) = wtcft_cur(g,m) diff --git a/src/dyn_subgrid/dynlakeFileMod.F90 b/src/dyn_subgrid/dynlakeFileMod.F90 index 317f98ec75..829ce4b0dc 100644 --- a/src/dyn_subgrid/dynlakeFileMod.F90 +++ b/src/dyn_subgrid/dynlakeFileMod.F90 @@ -9,7 +9,7 @@ module dynlakeFileMod #include "shr_assert.h" use shr_log_mod , only : errMsg => shr_log_errMsg use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC + use decompMod , only : bounds_type, bounds_level_proc use dynFileMod , only : dyn_file_type use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type use clm_varctl , only : iulog @@ -57,7 +57,7 @@ subroutine dynlake_init(bounds, dynlake_filename) character(len=*), parameter :: subname = 'dynlake_init' !----------------------------------------------------------------------- - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') if (masterproc) then write(iulog,*) 'Attempting to read lake dynamic landuse data .....' @@ -113,7 +113,7 @@ subroutine dynlake_interp(bounds) character(len=*), parameter :: subname = 'dynlake_interp' !----------------------------------------------------------------------- - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') call dynlake_file%time_info%set_current_year() diff --git a/src/dyn_subgrid/dynpftFileMod.F90 b/src/dyn_subgrid/dynpftFileMod.F90 index 836b3cd6ee..834d2b355a 100644 --- a/src/dyn_subgrid/dynpftFileMod.F90 +++ b/src/dyn_subgrid/dynpftFileMod.F90 @@ -9,13 +9,13 @@ module dynpftFileMod ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC + use decompMod , only : bounds_type, bounds_level_proc, subgrid_level_gridcell use dynFileMod , only : dyn_file_type use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type use clm_varctl , only : iulog use abortutils , only : endrun use spmdMod , only : masterproc, mpicom - use clm_varcon , only : grlnd, nameg + use clm_varcon , only : grlnd use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch @@ -66,7 +66,7 @@ subroutine dynpft_init(bounds, dynpft_filename) character(len= 32) :: subname='dynpft_init'! subroutine name !----------------------------------------------------------------------- - SHR_ASSERT_ALL(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT_ALL(bounds%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') if (masterproc) then write(iulog,*) 'Attempting to read pft dynamic landuse data .....' @@ -159,7 +159,7 @@ subroutine dynpft_check_consistency(bounds) write(iulog,*) ' check_dynpft_consistency = .false.' write(iulog,*) 'in user_nl_clm' write(iulog,*) ' ' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end do @@ -259,7 +259,7 @@ subroutine dynpft_interp(bounds) ! NOTE(wjs, 2014-12-10) I'm not sure if there is still the requirement that SCAM ! hasn't been defined - SHR_ASSERT_ALL(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT_ALL(bounds%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') ! Get pft weights for this time step diff --git a/src/main/GetGlobalValuesMod.F90 b/src/main/GetGlobalValuesMod.F90 deleted file mode 100644 index 9e06672c45..0000000000 --- a/src/main/GetGlobalValuesMod.F90 +++ /dev/null @@ -1,215 +0,0 @@ -module GetGlobalValuesMod - - !----------------------------------------------------------------------- - ! Obtain and Write Global Index information - !----------------------------------------------------------------------- - implicit none - private - - ! PUBLIC MEMBER FUNCTIONS: - - public :: GetGlobalIndex - public :: GetGlobalIndexArray - public :: GetGlobalWrite - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - integer function GetGlobalIndex(decomp_index, clmlevel) - - !---------------------------------------------------------------- - ! Description - ! Determine global index space value for target point at given clmlevel - ! - ! Uses: - use shr_log_mod, only: errMsg => shr_log_errMsg - use decompMod , only: bounds_type, get_clmlevel_gsmap, get_proc_bounds - use spmdMod , only: iam - use clm_varcon , only: nameg, namel, namec, namep - use clm_varctl , only: iulog - use mct_mod , only: mct_gsMap, mct_gsMap_orderedPoints - use shr_sys_mod, only: shr_sys_abort - ! - ! Arguments - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel - ! - ! Local Variables: - type(bounds_type) :: bounds_proc ! processor bounds - type(mct_gsMap),pointer :: gsmap ! global seg map - integer, pointer,dimension(:) :: gsmap_ordered ! gsmap ordered points - integer :: beg_index ! beginning proc index for clmlevel - !---------------------------------------------------------------- - - call get_proc_bounds(bounds_proc) - - if (trim(clmlevel) == nameg) then - beg_index = bounds_proc%begg - else if (trim(clmlevel) == namel) then - beg_index = bounds_proc%begl - else if (trim(clmlevel) == namec) then - beg_index = bounds_proc%begc - else if (trim(clmlevel) == namep) then - beg_index = bounds_proc%begp - else - call shr_sys_abort('clmlevel of '//trim(clmlevel)//' not supported' // & - errmsg(sourcefile, __LINE__)) - end if - - call get_clmlevel_gsmap(clmlevel=trim(clmlevel), gsmap=gsmap) - call mct_gsMap_orderedPoints(gsmap, iam, gsmap_ordered) - GetGlobalIndex = gsmap_ordered(decomp_index - beg_index + 1) - deallocate(gsmap_ordered) - - end function GetGlobalIndex - - !----------------------------------------------------------------------- - function GetGlobalIndexArray(decomp_index, bounds1, bounds2, clmlevel) - - !---------------------------------------------------------------- - ! Description - ! Determine global index space value for target array at given clmlevel - ! - ! Example from histFileMod.F90: - ! ilarr = GetGlobalIndexArray(lun%gridcell(bounds%begl:bounds%endl), bounds%begl, bounds%endl, clmlevel=nameg) - ! Note that the last argument (clmlevel) is set to nameg, which corresponds - ! to the "gridcell" not the "lun" of the first argument. - ! - ! Uses: -#include "shr_assert.h" - use shr_log_mod, only: errMsg => shr_log_errMsg - use decompMod , only: bounds_type, get_clmlevel_gsmap, get_proc_bounds - use spmdMod , only: iam - use clm_varcon , only: nameg, namel, namec, namep - use clm_varctl , only: iulog - use mct_mod - ! - ! Arguments - integer, intent(in) :: bounds1 ! lower bound of the input & returned arrays - integer, intent(in) :: bounds2 ! upper bound of the input & returned arrays - integer, intent(in) :: decomp_index(bounds1:) - character(len=*) , intent(in) :: clmlevel - integer :: GetGlobalIndexArray(bounds1:bounds2) - ! - ! Local Variables: - type(bounds_type) :: bounds_proc ! processor bounds - type(mct_gsMap),pointer :: gsmap ! global seg map - integer, pointer,dimension(:) :: gsmap_ordered ! gsmap ordered points - integer :: beg_index ! beginning proc index for clmlevel - integer :: i - !---------------------------------------------------------------- - - SHR_ASSERT_ALL_FL((ubound(decomp_index) == (/bounds2/)), sourcefile, __LINE__) - call get_proc_bounds(bounds_proc) - - if (trim(clmlevel) == nameg) then - beg_index = bounds_proc%begg - else if (trim(clmlevel) == namel) then - beg_index = bounds_proc%begl - else if (trim(clmlevel) == namec) then - beg_index = bounds_proc%begc - else if (trim(clmlevel) == namep) then - beg_index = bounds_proc%begp - else - call shr_sys_abort('clmlevel of '//trim(clmlevel)//' not supported' // & - errmsg(__FILE__, __LINE__)) - end if - - call get_clmlevel_gsmap(clmlevel=trim(clmlevel), gsmap=gsmap) - call mct_gsMap_orderedPoints(gsmap, iam, gsmap_ordered) - do i=bounds1,bounds2 - GetGlobalIndexArray(i) = gsmap_ordered(decomp_index(i) - beg_index + 1) - enddo - deallocate(gsmap_ordered) - - end function GetGlobalIndexArray - - !----------------------------------------------------------------------- - subroutine GetGlobalWrite(decomp_index, clmlevel) - - !----------------------------------------------------------------------- - ! Description: - ! Write global index information for input local indices - ! - use shr_sys_mod , only : shr_sys_flush - use shr_sys_mod , only : shr_sys_abort - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use clm_varcon , only : nameg, namel, namec, namep - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! Arguments: - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel - ! - ! Local Variables: - integer :: igrc, ilun, icol, ipft - !----------------------------------------------------------------------- - - if (trim(clmlevel) == nameg) then - - igrc = decomp_index - write(iulog,*)'local gridcell index = ',igrc - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - - else if (trim(clmlevel) == namel) then - - ilun = decomp_index - igrc = lun%gridcell(ilun) - write(iulog,*)'local landunit index = ',ilun - write(iulog,*)'global landunit index = ',GetGlobalIndex(decomp_index=ilun, clmlevel=namel) - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - write(iulog,*)'landunit type = ',lun%itype(decomp_index) - - else if (trim(clmlevel) == namec) then - - icol = decomp_index - ilun = col%landunit(icol) - igrc = col%gridcell(icol) - write(iulog,*)'local column index = ',icol - write(iulog,*)'global column index = ',GetGlobalIndex(decomp_index=icol, clmlevel=namec) - write(iulog,*)'global landunit index = ',GetGlobalIndex(decomp_index=ilun, clmlevel=namel) - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - write(iulog,*)'column type = ',col%itype(icol) - write(iulog,*)'landunit type = ',lun%itype(ilun) - - else if (trim(clmlevel) == namep) then - - ipft = decomp_index - icol = patch%column(ipft) - ilun = patch%landunit(ipft) - igrc = patch%gridcell(ipft) - write(iulog,*)'local patch index = ',ipft - write(iulog,*)'global patch index = ',GetGlobalIndex(decomp_index=ipft, clmlevel=namep) - write(iulog,*)'global column index = ',GetGlobalIndex(decomp_index=icol, clmlevel=namec) - write(iulog,*)'global landunit index = ',GetGlobalIndex(decomp_index=ilun, clmlevel=namel) - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - write(iulog,*)'pft type = ',patch%itype(ipft) - write(iulog,*)'column type = ',col%itype(icol) - write(iulog,*)'landunit type = ',lun%itype(ilun) - - else - call shr_sys_abort('clmlevel '//trim(clmlevel)//'not supported '//errmsg(sourcefile, __LINE__)) - - end if - - call shr_sys_flush(iulog) - - end subroutine GetGlobalWrite - -end module GetGlobalValuesMod diff --git a/src/main/GridcellType.F90 b/src/main/GridcellType.F90 index 30fe988eff..9d31d41e86 100644 --- a/src/main/GridcellType.F90 +++ b/src/main/GridcellType.F90 @@ -21,7 +21,6 @@ module GridcellType type, public :: gridcell_type ! topological mapping functionality, local 1d gdc arrays - integer , pointer :: gindex (:) ! global index real(r8), pointer :: area (:) ! total land area, gridcell (km^2) real(r8), pointer :: lat (:) ! latitude (radians) real(r8), pointer :: lon (:) ! longitude (radians) @@ -63,7 +62,6 @@ subroutine Init(this, begg, endg) !------------------------------------------------------------------------ ! The following is set in InitGridCells - allocate(this%gindex (begg:endg)) ; this%gindex (:) = ispval allocate(this%area (begg:endg)) ; this%area (:) = nan allocate(this%lat (begg:endg)) ; this%lat (:) = nan allocate(this%lon (begg:endg)) ; this%lon (:) = nan @@ -88,7 +86,6 @@ subroutine Clean(this) class(gridcell_type) :: this !------------------------------------------------------------------------ - deallocate(this%gindex ) deallocate(this%area ) deallocate(this%lat ) deallocate(this%lon ) diff --git a/src/main/PatchType.F90 b/src/main/PatchType.F90 index d00f5588b0..78b339dce8 100644 --- a/src/main/PatchType.F90 +++ b/src/main/PatchType.F90 @@ -116,7 +116,7 @@ module PatchType logical , pointer :: is_veg (:) ! This is an ACTIVE fates patch logical , pointer :: is_bareground (:) real(r8), pointer :: wt_ed (:) !TODO mv ? can this be removed - + real(r8), pointer :: sp_pftorder_index (:) ! index to map 'p' onto the order of ED patches in SP mode. logical, pointer :: is_fates (:) ! true for patch vector space reserved ! for FATES. @@ -174,6 +174,7 @@ subroutine Init(this, begp, endp) allocate(this%is_veg (begp:endp)); this%is_veg (:) = .false. allocate(this%is_bareground (begp:endp)); this%is_bareground (:) = .false. allocate(this%wt_ed (begp:endp)); this%wt_ed (:) = nan + allocate(this%sp_pftorder_index (begp:endp)); this%sp_pftorder_index (:) = nan end if end subroutine Init @@ -200,6 +201,7 @@ subroutine Clean(this) deallocate(this%is_veg) deallocate(this%is_bareground) deallocate(this%wt_ed) + deallocate(this%sp_pftorder_index) end if end subroutine Clean diff --git a/src/main/abortutils.F90 b/src/main/abortutils.F90 index eb276ca044..c93fd761bf 100644 --- a/src/main/abortutils.F90 +++ b/src/main/abortutils.F90 @@ -4,20 +4,27 @@ module abortutils ! !MODULE: abortutils ! ! !DESCRIPTION: - ! Abort the model for abnormal termination + ! Functions to abort the model for abnormal termination. + ! + ! Also a related function to write information about a point, since this is often done + ! in conjunction with aborting the model, or at least issuing a warning. !----------------------------------------------------------------------- + implicit none private - save - public :: endrun + public :: endrun ! Abort the model for abnormal termination + public :: write_point_context ! Write context for the given index, including global index information and more interface endrun module procedure endrun_vanilla - module procedure endrun_globalindex + module procedure endrun_write_point_context end interface -CONTAINS + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains !----------------------------------------------------------------------- subroutine endrun_vanilla(msg, additional_msg) @@ -30,8 +37,6 @@ subroutine endrun_vanilla(msg, additional_msg) use clm_varctl , only: iulog ! ! !ARGUMENTS: - implicit none - ! Generally you want to at least provide msg. The main reason to separate msg from ! additional_msg is to supported expected-exception unit testing: you can put ! volatile stuff in additional_msg, as in: @@ -52,20 +57,21 @@ subroutine endrun_vanilla(msg, additional_msg) end subroutine endrun_vanilla !----------------------------------------------------------------------- - subroutine endrun_globalindex(decomp_index, clmlevel, msg, additional_msg) + subroutine endrun_write_point_context(subgrid_index, subgrid_level, msg, additional_msg) !----------------------------------------------------------------------- ! Description: ! Abort the model for abnormal termination ! - use shr_sys_mod , only: shr_sys_abort - use clm_varctl , only: iulog - use GetGlobalValuesMod, only: GetGlobalWrite + ! This version also prints additional information about the point causing the error. + ! + use shr_sys_mod , only: shr_sys_abort + use clm_varctl , only: iulog + use decompMod , only: subgrid_level_unspecified ! ! Arguments: - implicit none - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel + integer , intent(in) :: subgrid_index ! index of interest (can be at any subgrid level or gridcell level) + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined in decompMod; subgrid_level_unspecified is allowed here, in which case the additional information will not be printed ! Generally you want to at least provide msg. The main reason to separate msg from ! additional_msg is to supported expected-exception unit testing: you can put @@ -79,8 +85,9 @@ subroutine endrun_globalindex(decomp_index, clmlevel, msg, additional_msg) integer :: igrc, ilun, icol !----------------------------------------------------------------------- - write(6,*)'calling getglobalwrite with decomp_index= ',decomp_index,' and clmlevel= ',trim(clmlevel) - call GetGlobalWrite(decomp_index, clmlevel) + if (subgrid_level /= subgrid_level_unspecified) then + call write_point_context(subgrid_index, subgrid_level) + end if if (present (additional_msg)) then write(iulog,*)'ENDRUN: ', additional_msg @@ -90,6 +97,102 @@ subroutine endrun_globalindex(decomp_index, clmlevel, msg, additional_msg) call shr_sys_abort(msg) - end subroutine endrun_globalindex + end subroutine endrun_write_point_context + + !----------------------------------------------------------------------- + subroutine write_point_context(subgrid_index, subgrid_level) + + !----------------------------------------------------------------------- + ! Description: + ! Write various information giving context for the given index at the given subgrid + ! level, including global index information and more. + ! + use shr_sys_mod , only : shr_sys_flush, shr_sys_abort + use shr_log_mod , only : errMsg => shr_log_errMsg + use clm_varctl , only : iulog + use decompMod , only : subgrid_level_gridcell, subgrid_level_landunit, subgrid_level_column, subgrid_level_patch + use decompMod , only : get_global_index + use GridcellType , only : grc + use LandunitType , only : lun + use ColumnType , only : col + use PatchType , only : patch + use spmdMod , only : iam + ! + ! Arguments: + integer , intent(in) :: subgrid_index ! index of interest (can be at any subgrid level or gridcell level) + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined in decompMod + ! + ! Local Variables: + integer :: igrc, ilun, icol, ipft + !----------------------------------------------------------------------- + + if (subgrid_level == subgrid_level_gridcell) then + + igrc = subgrid_index + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': local gridcell index = ', igrc + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global gridcell index = ', & + get_global_index(subgrid_index=igrc, subgrid_level=subgrid_level_gridcell) + write(iulog,'(a, i0, a, f12.7)') 'iam = ', iam, ': gridcell longitude = ', grc%londeg(igrc) + write(iulog,'(a, i0, a, f12.7)') 'iam = ', iam, ': gridcell latitude = ', grc%latdeg(igrc) + + else if (subgrid_level == subgrid_level_landunit) then + + ilun = subgrid_index + igrc = lun%gridcell(ilun) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': local landunit index = ', ilun + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global landunit index = ', & + get_global_index(subgrid_index=ilun, subgrid_level=subgrid_level_landunit) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global gridcell index = ', & + get_global_index(subgrid_index=igrc, subgrid_level=subgrid_level_gridcell) + write(iulog,'(a, i0, a, f12.7)') 'iam = ', iam, ': gridcell longitude = ', grc%londeg(igrc) + write(iulog,'(a, i0, a, f12.7)') 'iam = ', iam, ': gridcell latitude = ', grc%latdeg(igrc) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': landunit type = ', lun%itype(subgrid_index) + + else if (subgrid_level == subgrid_level_column) then + + icol = subgrid_index + ilun = col%landunit(icol) + igrc = col%gridcell(icol) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': local column index = ', icol + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global column index = ', & + get_global_index(subgrid_index=icol, subgrid_level=subgrid_level_column) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global landunit index = ', & + get_global_index(subgrid_index=ilun, subgrid_level=subgrid_level_landunit) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global gridcell index = ', & + get_global_index(subgrid_index=igrc, subgrid_level=subgrid_level_gridcell) + write(iulog,'(a, i0, a, f12.7)') 'iam = ', iam, ': gridcell longitude = ', grc%londeg(igrc) + write(iulog,'(a, i0, a, f12.7)') 'iam = ', iam, ': gridcell latitude = ', grc%latdeg(igrc) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': column type = ', col%itype(icol) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': landunit type = ', lun%itype(ilun) + + else if (subgrid_level == subgrid_level_patch) then + + ipft = subgrid_index + icol = patch%column(ipft) + ilun = patch%landunit(ipft) + igrc = patch%gridcell(ipft) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': local patch index = ', ipft + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global patch index = ', & + get_global_index(subgrid_index=ipft, subgrid_level=subgrid_level_patch) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global column index = ', & + get_global_index(subgrid_index=icol, subgrid_level=subgrid_level_column) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global landunit index = ', & + get_global_index(subgrid_index=ilun, subgrid_level=subgrid_level_landunit) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': global gridcell index = ', & + get_global_index(subgrid_index=igrc, subgrid_level=subgrid_level_gridcell) + write(iulog,'(a, i0, a, f12.7)') 'iam = ', iam, ': gridcell longitude = ', grc%londeg(igrc) + write(iulog,'(a, i0, a, f12.7)') 'iam = ', iam, ': gridcell latitude = ', grc%latdeg(igrc) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': pft type = ', patch%itype(ipft) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': column type = ', col%itype(icol) + write(iulog,'(a, i0, a, i0)') 'iam = ', iam, ': landunit type = ', lun%itype(ilun) + + else + write(iulog,*) 'subgrid_level not supported: ', subgrid_level + call shr_sys_abort('subgrid_level not supported '//errmsg(sourcefile, __LINE__)) + end if + + call shr_sys_flush(iulog) + + end subroutine write_point_context end module abortutils diff --git a/src/main/accumulMod.F90 b/src/main/accumulMod.F90 index 3baba13814..55ac2bfa7d 100644 --- a/src/main/accumulMod.F90 +++ b/src/main/accumulMod.F90 @@ -150,9 +150,9 @@ subroutine init_accum_field (name, units, desc, & ! possible that init_value doesn't matter even in this case). ! ! !USES: - use shr_const_mod, only: SHR_CONST_CDAY - use clm_time_manager, only : get_step_size - use decompMod, only : get_proc_bounds + use shr_const_mod , only: SHR_CONST_CDAY + use clm_time_manager , only : get_step_size + use decompMod , only : get_proc_bounds, bounds_type ! ! !ARGUMENTS: implicit none @@ -175,6 +175,7 @@ subroutine init_accum_field (name, units, desc, & integer :: begl, endl ! per-proc beginning and ending landunit indices integer :: begg, endg ! per-proc gridcell ending gridcell indices integer :: begCohort, endCohort ! per-proc beg end cohort indices + type(bounds_type) :: bounds character(len=*), parameter :: subname = 'init_accum_field' !------------------------------------------------------------------------ @@ -188,8 +189,12 @@ subroutine init_accum_field (name, units, desc, & ! Determine necessary indices - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort ) + call get_proc_bounds(bounds) + begg = bounds%begg; endg = bounds%endg + begl = bounds%begl; endl = bounds%endl + begc = bounds%begc; endc = bounds%endc + begp = bounds%begp; endp = bounds%endp + begCohort = bounds%begCoHort; endCohort = bounds%endCoHort ! update field index ! Consistency check that number of accumulated does not exceed maximum. diff --git a/src/main/atm2lndMod.F90 b/src/main/atm2lndMod.F90 index 71b8afeb63..11e05f1496 100644 --- a/src/main/atm2lndMod.F90 +++ b/src/main/atm2lndMod.F90 @@ -15,7 +15,7 @@ module atm2lndMod use clm_varcon , only : wv_to_dair_weight_ratio use clm_varctl , only : iulog, use_c13, use_cn, use_lch4, iulog use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_gridcell, subgrid_level_column use atm2lndType , only : atm2lnd_type use TopoMod , only : topo_type use filterColMod , only : filter_col_type @@ -556,7 +556,8 @@ subroutine downscale_longwave(bounds, downscale_filter_c, & if (abs((newsum_lwrad_g(g) / sum_wts_g(g)) - forc_lwrad_g(g)) > 1.e-8_r8) then write(iulog,*) 'g, newsum_lwrad_g, sum_wts_g, forc_lwrad_g: ', & g, newsum_lwrad_g(g), sum_wts_g(g), forc_lwrad_g(g) - call endrun(msg=' ERROR: Energy conservation error downscaling longwave'//& + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & + msg=' ERROR: Energy conservation error downscaling longwave'//& errMsg(sourcefile, __LINE__)) end if end if @@ -707,7 +708,8 @@ subroutine check_downscale_consistency(bounds, atm2lnd_inst, wateratm2lndbulk_in write(iulog,*) 'forc_pbot_c, forc_pbot_g = ', forc_pbot_c(c), forc_pbot_g(g) write(iulog,*) 'forc_rho_c, forc_rho_g = ', forc_rho_c(c), forc_rho_g(g) write(iulog,*) 'forc_lwrad_c, forc_lwrad_g = ', forc_lwrad_c(c), forc_lwrad_g(g) - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=errMsg(sourcefile, __LINE__)) end if ! inequal end if ! urbpoi end if ! active diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 0ac5a10e3e..8b211bb52e 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -9,7 +9,7 @@ module clm_driver ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : wrtdia, iulog, use_fates + use clm_varctl , only : iulog, use_fates, use_fates_sp use clm_varctl , only : use_cn, use_lch4, use_noio, use_c13, use_c14 use clm_varctl , only : use_crop, irrigate, ndep_from_cpl use clm_varctl , only : use_soil_moisture_streams @@ -237,7 +237,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! vegetation top [mhvt1,mhvt2] and vegetation bottom [mhvb1,mhvb2]. The ! weights obtained here are used in subroutine SatellitePhenology to obtain time ! interpolated values. - if (doalb .or. ( n_drydep > 0 .and. drydep_method == DD_XLND )) then + if (doalb .or. ( n_drydep > 0 .and. drydep_method == DD_XLND ) .or. use_fates_sp) then call t_startf('interpMonthlyVeg') call interpMonthlyVeg(bounds_proc, canopystate_inst) call t_stopf('interpMonthlyVeg') @@ -443,7 +443,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! When LAI streams are being used ! NOTE: This call needs to happen outside loops over nclumps (as streams are not threadsafe) - if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb) .and. use_lai_streams) then + if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb) .and. use_lai_streams) then call lai_advance( bounds_proc ) endif @@ -620,7 +620,9 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro water_inst%wateratm2lndbulk_inst, water_inst%waterdiagnosticbulk_inst, & water_inst%waterstatebulk_inst) - call ozone_inst%CalcOzoneStress(bounds_clump, filter(nc)%num_exposedvegp, filter(nc)%exposedvegp) + call ozone_inst%CalcOzoneStress(bounds_clump, & + filter(nc)%num_exposedvegp, filter(nc)%exposedvegp, & + filter(nc)%num_noexposedvegp, filter(nc)%noexposedvegp) ! TODO(wjs, 2019-10-02) I'd like to keep moving this down until it is below ! LakeFluxes... I'll probably leave it in place there. @@ -1002,15 +1004,22 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro end if - ! Prescribed biogeography - prescribed canopy structure, some prognostic carbon fluxes + ! Prescribed biogeography - prescribed canopy structure, some prognostic carbon fluxes - if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb)) then + if (((.not. use_cn) .and. (.not. use_fates) .and. (doalb))) then call t_startf('SatellitePhenology') call SatellitePhenology(bounds_clump, filter(nc)%num_nolakep, filter(nc)%nolakep, & water_inst%waterdiagnosticbulk_inst, canopystate_inst) call t_stopf('SatellitePhenology') end if + if (use_fates_sp.and.doalb) then + call t_startf('SatellitePhenology') + call SatellitePhenology(bounds_clump, filter(nc)%num_all_soil_patches, filter(nc)%all_soil_patches, & + water_inst%waterdiagnosticbulk_inst, canopystate_inst) + call t_stopf('SatellitePhenology') + end if + ! Dry Deposition of chemical tracers (Wesely (1998) parameterizaion) call t_startf('depvel') @@ -1058,7 +1067,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro end if - + if ( use_fates) then call EDBGCDyn(bounds_clump, & @@ -1091,8 +1100,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! This call updates some history diagnostics and must be called ! after wrap_update_hifrq_hist call clm_fates%WrapUpdateFatesRmean(nc,temperature_inst) - - + if( is_beg_curr_day() ) then ! -------------------------------------------------------------------------- @@ -1102,19 +1110,19 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro if ( masterproc ) then write(iulog,*) 'clm: calling FATES model ', get_nstep() end if - + call clm_fates%dynamics_driv( nc, bounds_clump, & atm2lnd_inst, soilstate_inst, temperature_inst, active_layer_inst, & water_inst%waterstatebulk_inst, water_inst%waterdiagnosticbulk_inst, & water_inst%wateratm2lndbulk_inst, canopystate_inst, soilbiogeochem_carbonflux_inst, & frictionvel_inst) - + ! TODO(wjs, 2016-04-01) I think this setFilters call should be replaced by a ! call to reweight_wrapup, if it's needed at all. call setFilters( bounds_clump, glc_behavior ) end if - + end if ! use_fates branch ! ============================================================================ @@ -1309,10 +1317,6 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! ============================================================================ nstep = get_nstep() - if (wrtdia) call mpi_barrier(mpicom,ier) - call t_startf('wrtdiag') - call write_diagnostic(bounds_proc, wrtdia, nstep, lnd2atm_inst) - call t_stopf('wrtdiag') ! ============================================================================ ! Update accumulators @@ -1395,11 +1399,13 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! Create history and write history tapes if appropriate call t_startf('clm_drv_io_htapes') - call hist_htapes_wrapup( rstwr, nlend, bounds_proc, & - soilstate_inst%watsat_col(bounds_proc%begc:bounds_proc%endc, 1:), & - soilstate_inst%sucsat_col(bounds_proc%begc:bounds_proc%endc, 1:), & - soilstate_inst%bsw_col(bounds_proc%begc:bounds_proc%endc, 1:), & - soilstate_inst%hksat_col(bounds_proc%begc:bounds_proc%endc, 1:)) + call hist_htapes_wrapup( rstwr, nlend, bounds_proc, & + soilstate_inst%watsat_col(bounds_proc%begc:bounds_proc%endc, 1:), & + soilstate_inst%sucsat_col(bounds_proc%begc:bounds_proc%endc, 1:), & + soilstate_inst%bsw_col(bounds_proc%begc:bounds_proc%endc, 1:), & + soilstate_inst%hksat_col(bounds_proc%begc:bounds_proc%endc, 1:), & + soilstate_inst%cellsand_col(bounds_proc%begc:bounds_proc%endc, 1:), & + soilstate_inst%cellclay_col(bounds_proc%begc:bounds_proc%endc, 1:)) call t_stopf('clm_drv_io_htapes') @@ -1618,7 +1624,7 @@ subroutine clm_drv_patch2col (bounds, & end subroutine clm_drv_patch2col !------------------------------------------------------------------------ - subroutine write_diagnostic (bounds, wrtdia, nstep, lnd2atm_inst) + subroutine write_diagnostic (bounds, nstep, lnd2atm_inst) ! ! !DESCRIPTION: ! Write diagnostic surface temperature output each timestep. Written to @@ -1636,7 +1642,6 @@ subroutine write_diagnostic (bounds, wrtdia, nstep, lnd2atm_inst) ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds - logical , intent(in) :: wrtdia !true => write diagnostic integer , intent(in) :: nstep !model time step type(lnd2atm_type) , intent(in) :: lnd2atm_inst ! @@ -1655,31 +1660,10 @@ subroutine write_diagnostic (bounds, wrtdia, nstep, lnd2atm_inst) call get_proc_global(ng=numg) - if (wrtdia) then - - call t_barrierf('sync_write_diag', mpicom) - psum = sum(lnd2atm_inst%t_rad_grc(bounds%begg:bounds%endg)) - call mpi_reduce(psum, tsum, 1, MPI_REAL8, MPI_SUM, 0, mpicom, ier) - if (ier/=0) then - write(iulog,*) 'write_diagnostic: Error in mpi_reduce()' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if (masterproc) then - tsxyav = tsum / numg - write(iulog,1000) nstep, tsxyav - call shr_sys_flush(iulog) - end if - - else - - if (masterproc) then - write(iulog,*)'clm: completed timestep ',nstep - call shr_sys_flush(iulog) - end if - - endif - -1000 format (1x,'nstep = ',i10,' TS = ',f21.15) + if (masterproc) then + write(iulog,*)'clm: completed timestep ',nstep + call shr_sys_flush(iulog) + end if end subroutine write_diagnostic diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 76dd9e23a8..a22057e851 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -10,7 +10,7 @@ module clm_initializeMod use spmdMod , only : masterproc use decompMod , only : bounds_type, get_proc_bounds, get_proc_clumps, get_clump_bounds use abortutils , only : endrun - use clm_varctl , only : nsrest, nsrStartup, nsrContinue, nsrBranch + use clm_varctl , only : nsrest, nsrStartup, nsrContinue, nsrBranch, use_fates_sp use clm_varctl , only : is_cold_start, is_interpolated_start use clm_varctl , only : iulog use clm_varctl , only : use_lch4, use_cn, use_cndv, use_c13, use_c14, use_fates @@ -60,6 +60,7 @@ subroutine initialize1(dtime) use initGridCellsMod , only: initGridCells use UrbanParamsType , only: IsSimpleBuildTemp use dynSubgridControlMod , only: dynSubgridControl_init + use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_par_init ! ! !ARGUMENTS integer, intent(in) :: dtime ! model time step (seconds) @@ -95,6 +96,7 @@ subroutine initialize1(dtime) call ncd_pio_init() call surfrd_get_num_patches(fsurdat, actual_maxsoil_patches, actual_numcft) call clm_varpar_init(actual_maxsoil_patches, actual_numcft) + call decomp_cascade_par_init( NLFilename ) call clm_varcon_init( IsSimpleBuildTemp() ) call landunit_varcon_init() if (masterproc) call control_print() @@ -116,7 +118,7 @@ subroutine initialize2(ni,nj) use clm_varpar , only : nlevsno use clm_varctl , only : fsurdat use clm_varctl , only : finidat, finidat_interp_source, finidat_interp_dest, fsurdat - use clm_varctl , only : use_century_decomp, use_cn, use_fates + use clm_varctl , only : use_cn, use_fates use clm_varctl , only : use_crop, ndep_from_cpl, fates_spitfire_mode use clm_varorb , only : eccen, mvelpp, lambm0, obliqr use landunit_varcon , only : landunit_varcon_init, max_lunit @@ -147,7 +149,7 @@ subroutine initialize2(ni,nj) use restFileMod , only : restFile_read, restFile_write use ndepStreamMod , only : ndep_init, ndep_interp use LakeCon , only : LakeConInit - use SatellitePhenologyMod , only : SatellitePhenologyInit, readAnnualVegetation, interpMonthlyVeg + use SatellitePhenologyMod , only : SatellitePhenologyInit, readAnnualVegetation, interpMonthlyVeg, SatellitePhenology use SnowSnicarMod , only : SnowAge_init, SnowOptics_init use lnd2atmMod , only : lnd2atm_minimal use controlMod , only : NLFilename @@ -181,22 +183,19 @@ subroutine initialize2(ni,nj) type(bounds_type) :: bounds_clump ! clump bounds integer :: nclumps ! number of clumps on this processor integer :: nc ! clump index - logical :: lexist logical :: reset_dynbal_baselines_all_columns logical :: reset_dynbal_baselines_lake_columns integer :: begg, endg - integer :: begp, endp - integer :: begc, endc - integer :: begl, endl real(r8), pointer :: data2dptr(:,:) ! temp. pointers for slicing larger arrays - character(len=32) :: subname = 'initialize2' ! subroutine name + character(len=32) :: subname = 'initialize2' ! subroutine name !----------------------------------------------------------------------- call t_startf('clm_init2') - ! Get processor bounds - call get_proc_bounds(begg, endg) - + ! Get processor bounds for gridcells + call get_proc_bounds(bounds_proc) + begg = bounds_proc%begg; endg = bounds_proc%endg + ! Initialize glc behavior call glc_behavior%Init(begg, endg, NLFilename) @@ -242,7 +241,13 @@ subroutine initialize2(ni,nj) ! Build hierarchy and topological info for derived types ! This is needed here for the following call to decompInit_glcp - call initGridCells(glc_behavior) + nclumps = get_proc_clumps() + !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) + do nc = 1, nclumps + call get_clump_bounds(nc, bounds_clump) + call initGridCells(bounds_clump, glc_behavior) + end do + !$OMP END PARALLEL DO ! Set global seg maps for gridcells, landlunits, columns and patches call decompInit_glcp(ni, nj, glc_behavior) @@ -250,7 +255,6 @@ subroutine initialize2(ni,nj) ! Set filters call allocFilters() - nclumps = get_proc_clumps() !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) do nc = 1, nclumps call get_clump_bounds(nc, bounds_clump) @@ -589,6 +593,10 @@ subroutine initialize2(ni,nj) ! This needs to be done even if CN or CNDV is on! call interpMonthlyVeg(bounds_proc, canopystate_inst) end if + ! If fates has satellite phenology enabled, get the monthly veg values + ! prior to the first call to SatellitePhenology() + elseif ( use_fates_sp ) then + call interpMonthlyVeg(bounds_proc, canopystate_inst) end if ! Determine gridcell averaged properties to send to atm @@ -620,6 +628,17 @@ subroutine initialize2(ni,nj) ! Initialise the fates model state structure if ( use_fates .and. .not.is_restart() .and. finidat == ' ') then + ! If fates is using satellite phenology mode, make sure to call the SatellitePhenology + ! procedure prior to init_coldstart which will eventually call leaf_area_profile + if ( use_fates_sp ) then + !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) + do nc = 1,nclumps + call get_clump_bounds(nc, bounds_clump) + call SatellitePhenology(bounds_clump, filter(nc)%num_nolakep, filter(nc)%nolakep, & + water_inst%waterdiagnosticbulk_inst, canopystate_inst) + end do + !$OMP END PARALLEL DO + end if call clm_fates%init_coldstart(water_inst%waterstatebulk_inst, & water_inst%waterdiagnosticbulk_inst, canopystate_inst, & soilstate_inst) diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index 440d45c76c..44ab2f8ef2 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -9,7 +9,8 @@ module clm_instMod use decompMod , only : bounds_type use clm_varpar , only : ndecomp_pools, nlevdecomp_full use clm_varctl , only : use_cn, use_c13, use_c14, use_lch4, use_cndv, use_fates - use clm_varctl , only : use_century_decomp, use_crop, snow_cover_fraction_method, paramfile + use clm_varctl , only : use_crop, snow_cover_fraction_method, paramfile + use SoilBiogeochemDecompCascadeConType , only : century_decomp, decomp_method use clm_varcon , only : bdsno, c13ratio, c14ratio use landunit_varcon , only : istice, istsoil use perf_mod , only : t_startf, t_stopf @@ -188,7 +189,6 @@ subroutine clm_instInit(bounds) use controlMod , only : nlfilename, fsurdat use domainMod , only : ldomain use SoilBiogeochemDecompCascadeBGCMod , only : init_decompcascade_bgc - use SoilBiogeochemDecompCascadeCNMod , only : init_decompcascade_cn use SoilBiogeochemDecompCascadeContype , only : init_decomp_cascade_constants use SoilBiogeochemCompetitionMod , only : SoilBiogeochemCompetitionInit @@ -376,15 +376,13 @@ subroutine clm_instInit(bounds) call soilbiogeochem_state_inst%Init(bounds) ! Initialize decompcascade constants - ! Note that init_decompcascade_bgc and init_decompcascade_cn need + ! Note that init_decompcascade_bgc need ! soilbiogeochem_state_inst to be initialized - call init_decomp_cascade_constants( use_century_decomp ) - if (use_century_decomp) then + call init_decomp_cascade_constants( ) + if (decomp_method == century_decomp ) then call init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, & soilstate_inst ) - else - call init_decompcascade_cn(bounds, soilbiogeochem_state_inst) end if ! Initalize soilbiogeochem carbon types diff --git a/src/main/clm_varcon.F90 b/src/main/clm_varcon.F90 index 895c7a4b80..c8d84a3b07 100644 --- a/src/main/clm_varcon.F90 +++ b/src/main/clm_varcon.F90 @@ -44,8 +44,6 @@ module clm_varcon ! Initialize physical constants !------------------------------------------------------------------ - real(r8), public, parameter :: pc = 0.4_r8 ! threshold probability - real(r8), public, parameter :: mu = 0.13889_r8 ! connectivity exponent real(r8), public, parameter :: secsphr = 3600._r8 ! Seconds in an hour integer, public, parameter :: isecsphr = int(secsphr) ! Integer seconds in an hour integer, public, parameter :: isecspmin= 60 ! Integer seconds in a minute @@ -190,7 +188,6 @@ module clm_varcon !------------------------------------------------------------------ character(len=16), public, parameter :: grlnd = 'lndgrid' ! name of lndgrid - character(len=16), public, parameter :: namea = 'gridcellatm' ! name of atmgrid character(len=16), public, parameter :: nameg = 'gridcell' ! name of gridcells character(len=16), public, parameter :: namel = 'landunit' ! name of landunits character(len=16), public, parameter :: namec = 'column' ! name of columns diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 796fa086fa..3ad4b14bef 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -197,12 +197,14 @@ module clm_varctl ! which snow cover fraction parameterization to use character(len=64), public :: snow_cover_fraction_method - ! true => write global average diagnostics to std out - logical, public :: wrtdia = .false. - ! atmospheric CO2 molar ratio (by volume) (umol/mol) real(r8), public :: co2_ppmv = 355._r8 ! + ! ozone vegitation stress method, valid values: unset, stress_lombardozzi2015, stress_falk + character(len=64), public :: o3_veg_stress_method = 'unset' + + real(r8), public :: o3_ppbv = 100._r8 + !---------------------------------------------------------- ! C isotopes !---------------------------------------------------------- @@ -238,6 +240,8 @@ module clm_varctl logical, public :: use_fates_ed_prescribed_phys = .false. ! true => prescribed physiology logical, public :: use_fates_inventory_init = .false. ! true => initialize fates from inventory logical, public :: use_fates_fixed_biogeog = .false. ! true => use fixed biogeography mode + logical, public :: use_fates_nocomp = .false. ! true => use no comopetition mode + logical, public :: use_fates_sp = .false. ! true => use FATES satellite phenology mode character(len=256), public :: fates_inventory_ctrl_filename = '' ! filename for inventory control !---------------------------------------------------------- @@ -370,17 +374,14 @@ module clm_varctl ! Migration of CPP variables !---------------------------------------------------------- - logical, public :: use_lch4 = .false. - logical, public :: use_nitrif_denitrif = .false. - logical, public :: use_vertsoilc = .false. + logical, public :: use_lch4 = .true. + logical, public :: use_nitrif_denitrif = .true. logical, public :: use_extralakelayers = .false. logical, public :: use_vichydro = .false. - logical, public :: use_century_decomp = .false. logical, public :: use_cn = .false. logical, public :: use_cndv = .false. logical, public :: use_grainproduct = .false. logical, public :: use_fertilizer = .false. - logical, public :: use_ozone = .false. logical, public :: use_snicar_frc = .false. logical, public :: use_vancouver = .false. logical, public :: use_mexicocity = .false. diff --git a/src/main/clm_varpar.F90 b/src/main/clm_varpar.F90 index 5a18d52d0e..e8d62453d3 100644 --- a/src/main/clm_varpar.F90 +++ b/src/main/clm_varpar.F90 @@ -8,14 +8,14 @@ module clm_varpar use shr_kind_mod , only: r8 => shr_kind_r8 use shr_sys_mod , only: shr_sys_abort use spmdMod , only: masterproc - use clm_varctl , only: use_extralakelayers, use_vertsoilc - use clm_varctl , only: use_century_decomp, use_c13, use_c14 + use clm_varctl , only: use_extralakelayers + use clm_varctl , only: use_c13, use_c14 use clm_varctl , only: iulog, use_crop, create_crop_landunit, irrigate use clm_varctl , only: use_vichydro, rundef use clm_varctl , only: soil_layerstruct_predefined use clm_varctl , only: soil_layerstruct_userdefined use clm_varctl , only: soil_layerstruct_userdefined_nlevsoi - use clm_varctl , only: use_fates + use clm_varctl , only: use_fates, use_cn ! ! !PUBLIC TYPES: @@ -207,9 +207,12 @@ subroutine clm_varpar_init(actual_maxsoil_patches, actual_numcft) nlayert = nlayer + (nlevgrnd -nlevsoi) endif - ! here is a switch to set the number of soil levels for the biogeochemistry calculations. - ! currently it works on either a single level or on nlevsoi and nlevgrnd levels - if (use_vertsoilc) then + ! + ! Number of layers for soil decomposition + ! + if ( use_cn .or. use_fates )then + ! to set the number of soil levels for the biogeochemistry calculations. + ! currently it works on nlevsoi and nlevgrnd levels nlevdecomp = nlevsoi nlevdecomp_full = nlevgrnd else @@ -233,34 +236,6 @@ subroutine clm_varpar_init(actual_maxsoil_patches, actual_numcft) write(iulog, *) end if - ! We hardwire these parameters here because we use them - ! in InitAllocate (in SoilBiogeochemStateType) which is called earlier than - ! init_decompcascade_bgc where they might have otherwise been derived on the - ! fly. For reference, if they were determined in init_decompcascade_bgc: - ! ndecomp_pools would get the value of i_avl_som or i_cwd and - ! ndecomp_cascade_transitions would get the value of i_s3s1 or i_cwdl3 - ! depending on how use_fates is set. - if ( use_fates ) then - if (use_century_decomp) then - ndecomp_pools = 6 - ndecomp_cascade_transitions = 8 - else ! TODO slevis: Currently for CN. MIMICS will get its own. - ndecomp_pools = 7 - ndecomp_cascade_transitions = 7 - end if - else - if (use_century_decomp) then - ndecomp_pools = 7 - ndecomp_cascade_transitions = 10 - else ! TODO slevis: Currently for CN. MIMICS will get its own. - ndecomp_pools = 8 - ndecomp_cascade_transitions = 9 - end if - endif - ! The next param also appears as a dimension in the params files dated - ! c210418.nc and later - ndecomp_pools_max = 8 ! largest ndecomp_pools value above - end subroutine clm_varpar_init end module clm_varpar diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index a5dd42d89c..082d68e8eb 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -17,7 +17,7 @@ module controlMod use abortutils , only: endrun use spmdMod , only: masterproc, mpicom use spmdMod , only: MPI_CHARACTER, MPI_INTEGER, MPI_LOGICAL, MPI_REAL8 - use decompMod , only: clump_pproc + use decompInitMod , only: clump_pproc use clm_varcon , only: h2osno_max use clm_varpar , only: maxpatch_glc, numrad, nlevsno use fileutils , only: getavu, relavu, get_filename @@ -196,7 +196,7 @@ subroutine control_init(dtime) ! Other options namelist /clm_inparm/ & - clump_pproc, wrtdia, & + clump_pproc, & create_crop_landunit, nsegspc, co2_ppmv, & albice, soil_layerstruct_predefined, soil_layerstruct_userdefined, & soil_layerstruct_userdefined_nlevsoi, use_subgrid_fluxes, snow_cover_fraction_method, & @@ -224,9 +224,13 @@ subroutine control_init(dtime) use_fates_ed_prescribed_phys, & use_fates_inventory_init, & use_fates_fixed_biogeog, & + use_fates_nocomp, & + use_fates_sp, & fates_inventory_ctrl_filename, & fates_parteh_mode + ! Ozone vegetation stress method + namelist / clm_inparam / o3_veg_stress_method ! CLM 5.0 nitrogen flags namelist /clm_inparm/ use_flexibleCN, use_luna @@ -271,8 +275,8 @@ subroutine control_init(dtime) namelist /clm_inparm/ use_SSRE namelist /clm_inparm/ & - use_lch4, use_nitrif_denitrif, use_vertsoilc, use_extralakelayers, & - use_vichydro, use_century_decomp, use_cn, use_cndv, use_crop, use_fertilizer, use_ozone, & + use_lch4, use_nitrif_denitrif, use_extralakelayers, & + use_vichydro, use_cn, use_cndv, use_crop, use_fertilizer, o3_veg_stress_method, & use_grainproduct, use_snicar_frc, use_vancouver, use_mexicocity, use_noio, & use_nguardrail @@ -418,7 +422,7 @@ subroutine control_init(dtime) errMsg(sourcefile, __LINE__)) end if - if (use_lch4 .and. use_vertsoilc) then + if (use_lch4 ) then anoxia = .true. else anoxia = .false. @@ -453,7 +457,7 @@ subroutine control_init(dtime) errMsg(sourcefile, __LINE__)) end if - if (use_ozone ) then + if (o3_veg_stress_method /= 'unset' ) then call endrun(msg=' ERROR: ozone is not compatible with FATES.'//& errMsg(sourcefile, __LINE__)) end if @@ -617,17 +621,15 @@ subroutine control_spmd() call mpi_bcast (use_lch4, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_nitrif_denitrif, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_vertsoilc, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_extralakelayers, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_vichydro, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_century_decomp, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_cn, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_cndv, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_nguardrail, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_crop, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fertilizer, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_grainproduct, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_ozone, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (o3_veg_stress_method, len(o3_veg_stress_method), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (use_snicar_frc, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_vancouver, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_mexicocity, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -703,6 +705,8 @@ subroutine control_spmd() call mpi_bcast (use_fates_ed_prescribed_phys, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_inventory_init, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_fixed_biogeog, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_nocomp, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_sp, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_paramfile, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_parteh_mode, 1, MPI_INTEGER, 0, mpicom, ier) @@ -739,7 +743,7 @@ subroutine control_spmd() call mpi_bcast (use_dynroot, 1, MPI_LOGICAL, 0, mpicom, ier) - if (use_cn .and. use_vertsoilc) then + if (use_cn ) then ! vertical soil mixing variables call mpi_bcast (som_adv_flux, 1, MPI_REAL8, 0, mpicom, ier) call mpi_bcast (max_depth_cryoturb, 1, MPI_REAL8, 0, mpicom, ier) @@ -775,7 +779,6 @@ subroutine control_spmd() call mpi_bcast (nsegspc, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (use_subgrid_fluxes , 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (snow_cover_fraction_method , len(snow_cover_fraction_method), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (wrtdia, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (single_column,1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (scmlat, 1, MPI_REAL8,0, mpicom, ier) call mpi_bcast (scmlon, 1, MPI_REAL8,0, mpicom, ier) @@ -861,16 +864,14 @@ subroutine control_print () write(iulog,*) 'process control parameters:' write(iulog,*) ' use_lch4 = ', use_lch4 write(iulog,*) ' use_nitrif_denitrif = ', use_nitrif_denitrif - write(iulog,*) ' use_vertsoilc = ', use_vertsoilc write(iulog,*) ' use_extralakelayers = ', use_extralakelayers write(iulog,*) ' use_vichydro = ', use_vichydro - write(iulog,*) ' use_century_decomp = ', use_century_decomp write(iulog,*) ' use_cn = ', use_cn write(iulog,*) ' use_cndv = ', use_cndv write(iulog,*) ' use_crop = ', use_crop write(iulog,*) ' use_fertilizer = ', use_fertilizer write(iulog,*) ' use_grainproduct = ', use_grainproduct - write(iulog,*) ' use_ozone = ', use_ozone + write(iulog,*) ' o3_veg_stress_method = ', o3_veg_stress_method write(iulog,*) ' use_snicar_frc = ', use_snicar_frc write(iulog,*) ' use_vancouver = ', use_vancouver write(iulog,*) ' use_mexicocity = ', use_mexicocity @@ -928,7 +929,7 @@ subroutine control_print () write(iulog,*) ' override_bgc_restart_mismatch_dump : ', override_bgc_restart_mismatch_dump end if - if (use_cn .and. use_vertsoilc) then + if (use_cn ) then write(iulog, *) ' som_adv_flux, the advection term in soil mixing (m/s) : ', som_adv_flux write(iulog, *) ' max_depth_cryoturb (m) : ', max_depth_cryoturb write(iulog, *) ' surfprof_exp : ', surfprof_exp @@ -1045,6 +1046,7 @@ subroutine control_print () write(iulog, *) ' carbon_resp_opt = ', carbon_resp_opt end if write(iulog, *) ' use_luna = ', use_luna + write(iulog, *) ' ozone vegetation stress method = ', o3_veg_stress_method write(iulog, *) ' ED/FATES: ' write(iulog, *) ' use_fates = ', use_fates @@ -1059,6 +1061,8 @@ subroutine control_print () write(iulog, *) ' use_fates_ed_prescribed_phys = ',use_fates_ed_prescribed_phys write(iulog, *) ' use_fates_inventory_init = ',use_fates_inventory_init write(iulog, *) ' use_fates_fixed_biogeog = ', use_fates_fixed_biogeog + write(iulog, *) ' use_fates_nocomp = ', use_fates_nocomp + write(iulog, *) ' use_fates_sp = ', use_fates_sp write(iulog, *) ' fates_inventory_ctrl_filename = ',fates_inventory_ctrl_filename end if end subroutine control_print diff --git a/src/main/decompInitMod.F90 b/src/main/decompInitMod.F90 index a6dbdda578..160c6a9349 100644 --- a/src/main/decompInitMod.F90 +++ b/src/main/decompInitMod.F90 @@ -6,42 +6,42 @@ module decompInitMod ! be mapped back to atmosphere physics chunks. ! ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc, iam, npes, mpicom, comp_id - use abortutils , only : endrun - use clm_varctl , only : iulog, use_fates - use clm_varcon , only : grlnd - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use glcBehaviorMod , only : glc_behavior_type - use decompMod - use mct_mod , only : mct_gsMap_init, mct_gsmap_gsize - use FatesInterfaceTypesMod, only : fates_maxElementsPerSite + use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_sys_mod , only : shr_sys_flush + use shr_log_mod , only : errMsg => shr_log_errMsg + use spmdMod , only : masterproc, iam, npes, mpicom + use abortutils , only : endrun + use clm_varctl , only : iulog ! - ! !PUBLIC TYPES: implicit none + private + ! + ! !PUBLIC TYPES: ! ! !PUBLIC MEMBER FUNCTIONS: - public decompInit_lnd ! initializes lnd grid decomposition into clumps and processors - public decompInit_clumps ! initializes atm grid decomposition into clumps - public decompInit_glcp ! initializes g,l,c,p decomp info + public :: decompInit_lnd ! initializes lnd grid decomposition into clumps and processors + public :: decompInit_clumps ! initializes atm grid decomposition into clumps + public :: decompInit_glcp ! initializes g,l,c,p decomp info + ! + ! !PRIVATE MEMBER FUNCTIONS: + ! + ! PUBLIC TYPES: + integer, public :: clump_pproc ! number of clumps per MPI process ! ! !PRIVATE TYPES: - private - integer, pointer :: lcid(:) ! temporary for setting ldecomp - - character(len=*), parameter, private :: sourcefile = & + integer, pointer :: lcid(:) ! temporary for setting decomposition + integer :: nglob_x, nglob_y ! global sizes + integer, parameter :: dbug=0 ! 0 = min, 1=normal, 2=much, 3=max + character(len=*), parameter :: sourcefile = & __FILE__ + +#include ! mpi library include file !------------------------------------------------------------------------------ contains !------------------------------------------------------------------------------ - subroutine decompInit_lnd(lni,lnj,amask) + subroutine decompInit_lnd(lni, lnj, amask) ! ! !DESCRIPTION: ! This subroutine initializes the land surface decomposition into a clump @@ -49,16 +49,17 @@ subroutine decompInit_lnd(lni,lnj,amask) ! set by clump_pproc ! ! !USES: - use clm_varctl, only : nsegspc + use clm_varctl , only : nsegspc + use decompMod , only : gindex_global, nclumps, clumps + use decompMod , only : bounds_type, get_proc_bounds, procinfo ! ! !ARGUMENTS: - implicit none integer , intent(in) :: amask(:) integer , intent(in) :: lni,lnj ! domain global size ! ! !LOCAL VARIABLES: integer :: lns ! global domain size - integer :: ln,lj ! indices + integer :: ln ! indices integer :: ag,an,ai,aj ! indices integer :: numg ! number of land gridcells logical :: seglen1 ! is segment length one @@ -67,9 +68,10 @@ subroutine decompInit_lnd(lni,lnj,amask) integer :: cid,pid ! indices integer :: n,m,ng ! indices integer :: ier ! error code - integer :: beg,end,lsize,gsize ! used for gsmap init - integer, pointer :: gindex(:) ! global index for gsmap init - integer, pointer :: clumpcnt(:) ! clump index counter + integer :: begg, endg ! beg and end gridcells + integer, pointer :: clumpcnt(:) ! clump index counter + integer, allocatable :: gdc2glo(:)! used to create gindex_global + type(bounds_type) :: bounds ! contains subgrid bounds data !------------------------------------------------------------------------------ lns = lni * lnj @@ -236,24 +238,23 @@ subroutine decompInit_lnd(lni,lnj,amask) end if enddo - ! Set ldecomp + ! Set gindex_global - allocate(ldecomp%gdc2glo(numg), stat=ier) + allocate(gdc2glo(numg), stat=ier) if (ier /= 0) then - write(iulog,*) 'decompInit_lnd(): allocation error1 for ldecomp, etc' + write(iulog,*) 'decompInit_lnd(): allocation error1 for gdc2glo , etc' call endrun(msg=errMsg(sourcefile, __LINE__)) end if + gdc2glo(:) = 0 allocate(clumpcnt(nclumps),stat=ier) if (ier /= 0) then write(iulog,*) 'decompInit_lnd(): allocation error1 for clumpcnt' call endrun(msg=errMsg(sourcefile, __LINE__)) end if - ldecomp%gdc2glo(:) = 0 - ag = 0 - ! clumpcnt is the start gdc index of each clump + ag = 0 clumpcnt = 0 ag = 1 do pid = 0,npes-1 @@ -274,29 +275,26 @@ subroutine decompInit_lnd(lni,lnj,amask) cid = lcid(an) if (cid > 0) then ag = clumpcnt(cid) - ldecomp%gdc2glo(ag) = an + gdc2glo(ag) = an clumpcnt(cid) = clumpcnt(cid) + 1 end if end do end do - deallocate(clumpcnt) - - ! Set gsMap_lnd_gdc2glo (the global index here includes mask=0 or ocean points) - - call get_proc_bounds(beg, end) - - allocate(gindex(beg:end)) - do n = beg,end - gindex(n) = ldecomp%gdc2glo(n) + ! Initialize global gindex (non-compressed, includes ocean points) + ! Note that gindex_global goes from (1:endg) + nglob_x = lni ! decompMod module variables + nglob_y = lnj ! decompMod module variables + call get_proc_bounds(bounds) + allocate(gindex_global(1:bounds%endg)) + do n = procinfo%begg,procinfo%endg + gindex_global(n-procinfo%begg+1) = gdc2glo(n) enddo - lsize = end-beg+1 - gsize = lni * lnj - call mct_gsMap_init(gsMap_lnd_gdc2glo, gindex, mpicom, comp_id, lsize, gsize) - deallocate(gindex) - ! Diagnostic output + deallocate(clumpcnt) + deallocate(gdc2glo) + ! Diagnostic output if (masterproc) then write(iulog,*)' Surface Grid Characteristics' write(iulog,*)' longitude points = ',lni @@ -306,7 +304,6 @@ subroutine decompInit_lnd(lni,lnj,amask) write(iulog,*)' clumps per process = ',clump_pproc write(iulog,*) end if - call shr_sys_flush(iulog) end subroutine decompInit_lnd @@ -320,35 +317,41 @@ subroutine decompInit_clumps(lni,lnj,glc_behavior) ! set by clump_pproc ! ! !USES: - use subgridMod, only : subgrid_get_gcellinfo - use spmdMod + use subgridMod , only : subgrid_get_gcellinfo + use decompMod , only : bounds_type, clumps, nclumps, procinfo + use decompMod , only : get_proc_global, get_proc_bounds + use decompMod , only : numg, numl, numc, nump, numCohort + use decompMod , only : gindex_global + use glcBehaviorMod , only : glc_behavior_type ! ! !ARGUMENTS: - implicit none - integer , intent(in) :: lni,lnj ! land domain global size - type(glc_behavior_type), intent(in) :: glc_behavior + integer , intent(in) :: lni,lnj ! land domain global size + type(glc_behavior_type) , intent(in) :: glc_behavior ! ! !LOCAL VARIABLES: - integer :: ln,an ! indices - integer :: i,g,l,k ! indices - integer :: cid,pid ! indices - integer :: n,m,np ! indices - integer :: anumg ! lnd num gridcells - integer :: icells ! temporary - integer :: begg, endg ! temporary - integer :: ilunits ! temporary - integer :: icols ! temporary - integer :: ipatches ! temporary - integer :: icohorts ! temporary - integer :: ier ! error code - integer, allocatable :: allvecg(:,:) ! temporary vector "global" + integer :: ln,an ! indices + integer :: i,g,l,k ! indices + integer :: cid,pid ! indices + integer :: n,m,np ! indices + integer :: anumg ! lnd num gridcells + integer :: icells ! temporary + integer :: begg, endg ! temporary + integer :: ilunits ! temporary + integer :: icols ! temporary + integer :: ipatches ! temporary + integer :: icohorts ! temporary + integer :: ier ! error code + integer :: npmin,npmax,npint ! do loop values for printing + integer :: clmin,clmax ! do loop values for printing + type(bounds_type) :: bounds ! bounds + integer, allocatable :: allvecg(:,:) ! temporary vector "global" integer, allocatable :: allvecl(:,:) ! temporary vector "local" - integer :: ntest character(len=32), parameter :: subname = 'decompInit_clumps' !------------------------------------------------------------------------------ !--- assign gridcells to clumps (and thus pes) --- - call get_proc_bounds(begg, endg) + call get_proc_bounds(bounds) + begg = bounds%begg; endg = bounds%endg allocate(allvecl(nclumps,5)) ! local clumps [gcells,lunit,cols,patches,coh] allocate(allvecg(nclumps,5)) ! global clumps [gcells,lunit,cols,patches,coh] @@ -366,7 +369,7 @@ subroutine decompInit_clumps(lni,lnj,glc_behavior) allvecg= 0 allvecl= 0 do anumg = begg,endg - an = ldecomp%gdc2glo(anumg) + an = gindex_global(anumg - begg + 1) cid = lcid(an) ln = anumg call subgrid_get_gcellinfo (ln, nlunits=ilunits, ncols=icols, npatches=ipatches, & @@ -471,97 +474,186 @@ subroutine decompInit_clumps(lni,lnj,glc_behavior) deallocate(allvecg,allvecl) deallocate(lcid) + ! Diagnostic output + + call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump, nCohorts=numCohort) + if (masterproc) then + write(iulog,*)' Surface Grid Characteristics' + write(iulog,*)' longitude points = ',lni + write(iulog,*)' latitude points = ',lnj + write(iulog,*)' total number of gridcells = ',numg + write(iulog,*)' total number of landunits = ',numl + write(iulog,*)' total number of columns = ',numc + write(iulog,*)' total number of patches = ',nump + write(iulog,*)' total number of cohorts = ',numCohort + write(iulog,*)' Decomposition Characteristics' + write(iulog,*)' clumps per process = ',clump_pproc + write(iulog,*) + end if + + ! Write out clump and proc info, one pe at a time, + ! barrier to control pes overwriting each other on stdout + call shr_sys_flush(iulog) + call mpi_barrier(mpicom,ier) + npmin = 0 + npmax = npes-1 + npint = 1 + if (dbug == 0) then + npmax = 0 + elseif (dbug == 1) then + npmax = min(npes-1,4) + elseif (dbug == 2) then + npint = npes/8 + endif + do np = npmin,npmax,npint + pid = np + if (dbug == 1) then + if (np == 2) pid=npes/2-1 + if (np == 3) pid=npes-2 + if (np == 4) pid=npes-1 + endif + pid = max(pid,0) + pid = min(pid,npes-1) + + if (iam == pid) then + write(iulog,*) + write(iulog,'(4(a,2x,i10))')'proc = ',pid, & + ' beg gridcell= ',procinfo%begg,' end gridcell= ',procinfo%endg, & + ' gridcells per proc = ',procinfo%ncells + write(iulog,'(4(a,2x,i10))')'proc = ',pid, & + ' beg landunit= ',procinfo%begl,' end landunit= ',procinfo%endl, & + ' landunits per proc = ',procinfo%nlunits + write(iulog,'(4(a,2x,i10))')'proc = ',pid, & + ' beg column = ',procinfo%begc,' end column = ',procinfo%endc, & + ' columns per proc = ',procinfo%ncols + write(iulog,'(4(a,2x,i10))')'proc = ',pid, & + ' beg patch = ',procinfo%begp,' end patch = ',procinfo%endp, & + ' patches per proc = ',procinfo%npatches + write(iulog,'(4(a,2x,i10))')'proc = ',pid, & + ' beg cohort = ',procinfo%begCohort,' end cohort = ',procinfo%endCohort, & + ' coh per proc = ',procinfo%nCohorts + write(iulog,'(2(a,2x,i10))')'proc = ',pid,' nclumps = ',procinfo%nclumps + if (dbug == 0) then + clmax = -1 + else + clmax = procinfo%nclumps + endif + do n = 1,clmax + cid = procinfo%cid(n) + write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, & + ' clump id= ',procinfo%cid(n), & + ' beg gridcell= ',clumps(cid)%begg,' end gridcell= ',clumps(cid)%endg, & + ' gridcells per clump= ',clumps(cid)%ncells + write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, & + ' clump id= ',procinfo%cid(n), & + ' beg landunit= ',clumps(cid)%begl,' end landunit= ',clumps(cid)%endl, & + ' landunits per clump = ',clumps(cid)%nlunits + write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, & + ' clump id= ',procinfo%cid(n), & + ' beg column = ',clumps(cid)%begc,' end column = ',clumps(cid)%endc, & + ' columns per clump = ',clumps(cid)%ncols + write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, & + ' clump id= ',procinfo%cid(n), & + ' beg patch = ',clumps(cid)%begp,' end patch = ',clumps(cid)%endp, & + ' patches per clump = ',clumps(cid)%npatches + write(iulog,'(6(a,2x,i10))')'proc = ',pid,' clump no = ',n, & + ' clump id= ',procinfo%cid(n), & + ' beg cohort = ',clumps(cid)%begCohort,' end cohort = ',clumps(cid)%endCohort, & + ' cohorts per clump = ',clumps(cid)%nCohorts + + end do + end if + call shr_sys_flush(iulog) + call mpi_barrier(mpicom,ier) + end do + write(iulog,*) + call shr_sys_flush(iulog) + end subroutine decompInit_clumps !------------------------------------------------------------------------------ subroutine decompInit_glcp(lni,lnj,glc_behavior) ! ! !DESCRIPTION: - ! Determine gsMaps for landunits, columns, patches and cohorts + ! Determine gindex for landunits, columns, patches and cohorts ! ! !USES: - use spmdMod - use spmdGathScatMod - use subgridMod, only : subgrid_get_gcellinfo + use clm_varctl , only : use_fates + use subgridMod , only : subgrid_get_gcellinfo + use decompMod , only : bounds_type, get_proc_global, get_proc_bounds + use decompMod , only : gindex_global + use decompMod , only : gindex_grc, gindex_lun, gindex_col, gindex_patch, gindex_Cohort + use decompMod , only : procinfo, clump_type, clumps, get_proc_global + use LandunitType , only : lun + use ColumnType , only : col + use PatchType , only : patch + use FatesInterfaceTypesMod , only : fates_maxElementsPerSite + use glcBehaviorMod , only : glc_behavior_type ! ! !ARGUMENTS: - implicit none - integer , intent(in) :: lni,lnj ! land domain global size - type(glc_behavior_type), intent(in) :: glc_behavior + integer , intent(in) :: lni,lnj ! land domain global size + type(glc_behavior_type) , intent(in) :: glc_behavior ! ! !LOCAL VARIABLES: - integer :: gi,li,ci,pi,coi ! indices - integer :: i,g,k,l,n,np ! indices - integer :: cid,pid ! indices - integer :: begg,endg ! beg,end gridcells - integer :: begl,endl ! beg,end landunits - integer :: begc,endc ! beg,end columns - integer :: begp,endp ! beg,end patches - integer :: begCohort,endCohort! beg,end cohorts - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of patches across all processors - integer :: numCohort ! fates cohorts - integer :: icells ! temporary - integer :: ilunits ! temporary - integer :: icols ! temporary - integer :: ipatches ! temporary - integer :: icohorts ! temporary - integer :: ier ! error code - integer :: npmin,npmax,npint ! do loop values for printing - integer :: clmin,clmax ! do loop values for printing - integer :: locsize,globsize ! used for gsMap init - integer :: ng ! number of gridcells in gsMap_lnd_gdc2glo - integer :: val1, val2 ! temporaries - integer, pointer :: gindex(:) ! global index for gsMap init - integer, pointer :: arrayglob(:) ! temporaroy - integer, pointer :: gstart(:), gcount(:) - integer, pointer :: lstart(:), lcount(:) - integer, pointer :: cstart(:), ccount(:) - integer, pointer :: pstart(:), pcount(:) - integer, pointer :: coStart(:), coCount(:) - integer, pointer :: ioff(:) - integer, parameter :: dbug=1 ! 0 = min, 1=normal, 2=much, 3=max - character(len=32), parameter :: subname = 'decompInit_glcp' + integer :: gi,li,ci,pi,coi ! indices + integer :: i,l,n,np ! indices + integer :: cid,pid ! indices + integer :: numg ! total number of land gridcells across all processors + integer :: numl ! total number of landunits across all processors + integer :: numc ! total number of columns across all processors + integer :: nump ! total number of patches across all processors + integer :: numCohort ! fates cohorts + integer :: ilunits ! temporary + integer :: icols ! temporary + integer :: ipatches ! temporary + integer :: icohorts ! temporary + integer :: ier ! error code + integer, pointer :: gcount(:) + integer, pointer :: lcount(:) + integer, pointer :: ccount(:) + integer, pointer :: pcount(:) + integer, pointer :: coCount(:) + type(bounds_type) :: bounds + integer, allocatable :: ioff(:) + integer, allocatable :: gridcells_per_pe(:) ! needed for gindex at all levels + integer, allocatable :: gridcell_offsets(:) ! needed for gindex at all levels + integer, allocatable :: index_gridcells(:) ! needed for gindex at all levels + integer, allocatable :: start_global(:) + integer, allocatable :: start(:) + integer, allocatable :: index_lndgridcells(:) + integer :: count + integer :: temp + integer :: lsize_g, lsize_l, lsize_c, lsize_p, lsize_cohort + integer :: gsize + Character(len=32), parameter :: subname = 'decompInit_glcp' !------------------------------------------------------------------------------ - !init + ! Get processor bounds - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort) + call get_proc_bounds(bounds) call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump, nCohorts=numCohort) - ! Determine global seg megs - - allocate(gstart(begg:endg)) - gstart(:) = 0 - allocate(gcount(begg:endg)) - gcount(:) = 0 - allocate(lstart(begg:endg)) - lstart(:) = 0 - allocate(lcount(begg:endg)) - lcount(:) = 0 - allocate(cstart(begg:endg)) - cstart(:) = 0 - allocate(ccount(begg:endg)) - ccount(:) = 0 - allocate(pstart(begg:endg)) - pstart(:) = 0 - allocate(pcount(begg:endg)) - pcount(:) = 0 - if ( use_fates ) then - allocate(coStart(begg:endg)) - coStart(:) = 0 - endif - allocate(coCount(begg:endg)) - coCount(:) = 0 - allocate(ioff(begg:endg)) - ioff(:) = 0 - - ! Determine gcount, lcount, ccount and pcount - - do gi = begg,endg + lsize_g = bounds%endg + lsize_l = bounds%endl + lsize_c = bounds%endc + lsize_p = bounds%endp + lsize_cohort = bounds%endCohort + gsize = nglob_x * nglob_y + + ! allocate module variables in decompMod.F90 + allocate(gindex_grc(lsize_g)) + allocate(gindex_lun(lsize_l)) + allocate(gindex_col(lsize_c)) + allocate(gindex_patch(lsize_p)) + allocate(gindex_cohort(lsize_cohort)) + + ! Determine counts + allocate(gcount(lsize_g)) ; gcount(:) = 0 + allocate(lcount(lsize_g)) ; lcount(:) = 0 + allocate(ccount(lsize_g)) ; ccount(:) = 0 + allocate(pcount(lsize_g)) ; pcount(:) = 0 + allocate(coCount(lsize_g)) ; coCount(:) = 0 + do gi = 1,lsize_g call subgrid_get_gcellinfo (gi, nlunits=ilunits, ncols=icols, npatches=ipatches, & ncohorts=icohorts, glc_behavior=glc_behavior) gcount(gi) = 1 ! number of gridcells for local gridcell index gi @@ -571,291 +663,195 @@ subroutine decompInit_glcp(lni,lnj,glc_behavior) coCount(gi) = icohorts ! number of fates cohorts for local gricell index gi enddo - ! Determine gstart, lstart, cstart, pstart, coStart for the OUTPUT 1d data structures - - ! gather the gdc subgrid counts to masterproc in glo order - ! compute glo ordered start indices from the counts - ! scatter the subgrid start indices back out to the gdc gridcells - ! set the local gindex array for the subgrid from the subgrid start and count arrays + ! --------------------------------------- + ! Arrays needed to determine gindex_xxx(:) + ! --------------------------------------- - ng = mct_gsmap_gsize(gsmap_lnd_gdc2glo) - allocate(arrayglob(ng)) + allocate(ioff(lsize_g)) - arrayglob(:) = 0 - call gather_data_to_master(gcount, arrayglob, grlnd) if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo + allocate (gridcells_per_pe(0:npes-1)) + else + allocate(gridcells_per_pe(0)) endif - call scatter_data_from_master(gstart, arrayglob, grlnd) - - ! lstart for gridcell (n) is the total number of the landunits - ! over gridcells 1->n-1 + call mpi_gather(lsize_g, 1, MPI_INTEGER, gridcells_per_pe, 1, MPI_INTEGER, 0, mpicom, ier) - arrayglob(:) = 0 - call gather_data_to_master(lcount, arrayglob, grlnd) if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(lstart, arrayglob, grlnd) + allocate(gridcell_offsets(0:npes-1)) + gridcell_offsets(0) = 0 + do n = 1 ,npes-1 + gridcell_offsets(n) = gridcell_offsets(n-1) + gridcells_per_pe(n-1) + end do + else + allocate(gridcell_offsets(0)) + end if - arrayglob(:) = 0 - call gather_data_to_master(ccount, arrayglob, grlnd) if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(cstart, arrayglob, grlnd) + allocate(start_global(numg)) ! number of landunits in a gridcell + else + allocate(start_global(0)) + end if - arrayglob(:) = 0 - call gather_data_to_master(pcount, arrayglob, grlnd) - if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(pstart, arrayglob, grlnd) + allocate(start(lsize_g)) - if ( use_fates ) then - arrayglob(:) = 0 - call gather_data_to_master(coCount, arrayglob, grlnd) - if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(coStart, arrayglob, grlnd) - endif + ! --------------------------------------- + ! Gridcell gindex (compressed, no ocean points) + ! --------------------------------------- - deallocate(arrayglob) + ! gstart_global the global index of all of the land points in task order + call mpi_gatherv(gindex_global, lsize_g, MPI_INTEGER, start_global, & + gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier) - ! Gridcell gsmap (compressed, no ocean points) + if (masterproc) then + ! Create a global size index_gridcells that will have 0 for all ocean points + ! Fill the location of each land point with the gatherv location of that land point + allocate(index_gridcells(gsize)) + index_gridcells(:) = 0 + do n = 1,numg + ! if n = 3, start_global(3)=100, index_gridcells(100)=3 + ! n is the task order location - so for global index 100 - the task order location is 3 + index_gridcells(start_global(n)) = n + end do + + ! Create a land-only global index based on the original global index ordering + ! Count is the running global land index + allocate(index_lndgridcells(numg)) + count = 0 + do n = 1,gsize + if (index_gridcells(n) > 0) then + count = count + 1 + ! e.g. n=20, count=4 and index_gridcells(20)=100, then start_global(100)=4 + start_global(index_gridcells(n)) = count + index_lndgridcells(count) = index_gridcells(n) + end if + end do + deallocate(index_gridcells) + end if - allocate(gindex(begg:endg)) - i = begg-1 - do gi = begg,endg - if (gcount(gi) < 1) then - write(iulog,*) 'decompInit_glcp warning count g ',k,iam,g,gcount(g) - endif - do l = 1,gcount(gi) - i = i + 1 - if (i < begg .or. i > endg) then - write(iulog,*) 'decompInit_glcp error i ',i,begg,endg - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - gindex(i) = gstart(gi) + l - 1 - enddo - enddo - if (i /= endg) then - write(iulog,*) 'decompInit_glcp error size ',i,begg,endg - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - locsize = endg-begg+1 - globsize = numg - call mct_gsMap_init(gsmap_gce_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) + ! Determine gindex_grc + call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, gindex_grc, & + lsize_g, MPI_INTEGER, 0, mpicom, ier) + deallocate(gcount) - ! Landunit gsmap + ! --------------------------------------- + ! Landunit gindex + ! --------------------------------------- + + start(:) = 0 + call mpi_gatherv(lcount, lsize_g, MPI_INTEGER, start_global, & + gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier) + if (masterproc) then + count = 1 + do n = 1,numg + temp = start_global(index_lndgridcells(n)) + start_global(index_lndgridcells(n)) = count + count = count + temp + end do + endif + call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, start, & + lsize_g, MPI_INTEGER, 0, mpicom, ier) - allocate(gindex(begl:endl)) ioff(:) = 0 - do li = begl,endl - gi = lun%gridcell(li) !===this is determined internally from how landunits are spread out in memory - gindex(li) = lstart(gi) + ioff(gi) !=== the output gindex is ALWAYS the same regardless of how landuntis are spread out in memory + do li = 1,lsize_l + gi = lun%gridcell(li) + gindex_lun(li) = start(gi) + ioff(gi) ioff(gi) = ioff(gi) + 1 - ! check that this is less than [lstart(gi) + lcount(gi)] enddo - locsize = endl-begl+1 - globsize = numl - call mct_gsMap_init(gsmap_lun_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) + deallocate(lcount) + + ! --------------------------------------- + ! Column gindex + ! --------------------------------------- - ! Column gsmap + start(:) = 0 + call mpi_gatherv(ccount, lsize_g, MPI_INTEGER, start_global, & + gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier) + if (masterproc) then + count = 1 + do n = 1,numg + temp = start_global(index_lndgridcells(n)) + start_global(index_lndgridcells(n)) = count + count = count + temp + end do + endif + call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, start, & + lsize_g, MPI_INTEGER, 0, mpicom, ier) - allocate(gindex(begc:endc)) ioff(:) = 0 - do ci = begc,endc + do ci = 1,lsize_c gi = col%gridcell(ci) - gindex(ci) = cstart(gi) + ioff(gi) + gindex_col(ci) = start(gi) + ioff(gi) ioff(gi) = ioff(gi) + 1 - ! check that this is less than [cstart(gi) + ccount(gi)] enddo - locsize = endc-begc+1 - globsize = numc - call mct_gsMap_init(gsmap_col_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) + deallocate(ccount) - ! PATCH gsmap + ! --------------------------------------- + ! PATCH gindex + ! --------------------------------------- + + start(:) = 0 + call mpi_gatherv(pcount, lsize_g, MPI_INTEGER, start_global, & + gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier) + if (masterproc) then + count = 1 + do n = 1,numg + temp = start_global(index_lndgridcells(n)) + start_global(index_lndgridcells(n)) = count + count = count + temp + end do + endif + call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, start, & + lsize_g, MPI_INTEGER, 0, mpicom, ier) - allocate(gindex(begp:endp)) ioff(:) = 0 - do pi = begp,endp + do pi = 1,lsize_p gi = patch%gridcell(pi) - gindex(pi) = pstart(gi) + ioff(gi) + gindex_patch(pi) = start(gi) + ioff(gi) ioff(gi) = ioff(gi) + 1 - ! check that this is less than [pstart(gi) + pcount(gi)] enddo - locsize = endp-begp+1 - globsize = nump - call mct_gsMap_init(gsmap_patch_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) + deallocate(pcount) - ! FATES gsmap for the cohort/element vector + ! --------------------------------------- + ! FATES gindex for the cohort/element vector + ! --------------------------------------- if ( use_fates ) then - allocate(gindex(begCohort:endCohort)) + start(:) = 0 + call mpi_gatherv(coCount, lsize_g, MPI_INTEGER, start_global, & + gridcells_per_pe, gridcell_offsets, MPI_INTEGER, 0, mpicom, ier) + if (masterproc) then + count = 1 + do n = 1,numg + temp = start_global(index_lndgridcells(n)) + start_global(index_lndgridcells(n)) = count + count = count + temp + end do + endif + call mpi_scatterv(start_global, gridcells_per_pe, gridcell_offsets, MPI_INTEGER, start, & + lsize_g, MPI_INTEGER, 0, mpicom, ier) + ioff(:) = 0 - gi = begg - do coi = begCohort,endCohort - gindex(coi) = coStart(gi) + ioff(gi) + gi = 1 + do coi = 1, lsize_cohort + gindex_cohort(coi) = start(gi) + ioff(gi) ioff(gi) = ioff(gi) + 1 - if ( mod(coi, fates_maxElementsPerSite ) == 0 ) gi = gi + 1 + if ( mod(coi, fates_maxElementsPerSite ) == 0 ) then + gi = gi + 1 + end if enddo - locsize = endCohort-begCohort+1 - globsize = numCohort - call mct_gsMap_init(gsMap_cohort_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) + deallocate(coCount) endif - ! Deallocate start/count arrays - deallocate(gstart, gcount) - deallocate(lstart, lcount) - deallocate(cstart, ccount) - deallocate(pstart, pcount) - if ( use_fates ) then - deallocate(coStart,coCount) - endif - deallocate(ioff) - - ! Diagnostic output - - if (masterproc) then - write(iulog,*)' Surface Grid Characteristics' - write(iulog,*)' longitude points = ',lni - write(iulog,*)' latitude points = ',lnj - write(iulog,*)' total number of gridcells = ',numg - write(iulog,*)' total number of landunits = ',numl - write(iulog,*)' total number of columns = ',numc - write(iulog,*)' total number of patches = ',nump - write(iulog,*)' total number of cohorts = ',numCohort - write(iulog,*)' Decomposition Characteristics' - write(iulog,*)' clumps per process = ',clump_pproc - write(iulog,*) - end if - - ! Write out clump and proc info, one pe at a time, - ! barrier to control pes overwriting each other on stdout - - call shr_sys_flush(iulog) - call mpi_barrier(mpicom,ier) - npmin = 0 - npmax = npes-1 - npint = 1 - if (dbug == 0) then - npmax = 0 - elseif (dbug == 1) then - npmax = min(npes-1,4) - elseif (dbug == 2) then - npint = npes/8 - endif - do np = npmin,npmax,npint - pid = np - if (dbug == 1) then - if (np == 2) pid=npes/2-1 - if (np == 3) pid=npes-2 - if (np == 4) pid=npes-1 - endif - pid = max(pid,0) - pid = min(pid,npes-1) + ! --------------------------------------- + ! Deallocate memory + ! --------------------------------------- - if (iam == pid) then - write(iulog,*) - write(iulog,*)'proc= ',pid,& - ' beg gridcell= ',procinfo%begg, & - ' end gridcell= ',procinfo%endg, & - ' total gridcells per proc= ',procinfo%ncells - write(iulog,*)'proc= ',pid,& - ' beg landunit= ',procinfo%begl, & - ' end landunit= ',procinfo%endl, & - ' total landunits per proc= ',procinfo%nlunits - write(iulog,*)'proc= ',pid,& - ' beg column = ',procinfo%begc, & - ' end column = ',procinfo%endc, & - ' total columns per proc = ',procinfo%ncols - write(iulog,*)'proc= ',pid,& - ' beg patch = ',procinfo%begp, & - ' end patch = ',procinfo%endp, & - ' total patches per proc = ',procinfo%npatches - write(iulog,*)'proc= ',pid,& - ' beg coh = ',procinfo%begCohort, & - ' end coh = ',procinfo%endCohort, & - ' total coh per proc = ',procinfo%nCohorts - write(iulog,*)'proc= ',pid,' nclumps = ',procinfo%nclumps - - clmin = 1 - clmax = procinfo%nclumps - if (dbug == 1) then - clmax = 1 - elseif (dbug == 0) then - clmax = -1 - endif - do n = clmin,clmax - cid = procinfo%cid(n) - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg gridcell= ',clumps(cid)%begg, & - ' end gridcell= ',clumps(cid)%endg, & - ' total gridcells per clump= ',clumps(cid)%ncells - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg landunit= ',clumps(cid)%begl, & - ' end landunit= ',clumps(cid)%endl, & - ' total landunits per clump = ',clumps(cid)%nlunits - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg column = ',clumps(cid)%begc, & - ' end column = ',clumps(cid)%endc, & - ' total columns per clump = ',clumps(cid)%ncols - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg patch = ',clumps(cid)%begp, & - ' end patch = ',clumps(cid)%endp, & - ' total patches per clump = ',clumps(cid)%npatches - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg cohort = ',clumps(cid)%begCohort, & - ' end cohort = ',clumps(cid)%endCohort, & - ' total cohorts per clump = ',clumps(cid)%nCohorts - end do - end if - call shr_sys_flush(iulog) - call mpi_barrier(mpicom,ier) - end do - call shr_sys_flush(iulog) + deallocate(ioff) + deallocate(gridcells_per_pe) + deallocate(gridcell_offsets) + deallocate(start) + deallocate(start_global) + if (allocated(index_lndgridcells)) deallocate(index_lndgridcells) end subroutine decompInit_glcp diff --git a/src/main/decompMod.F90 b/src/main/decompMod.F90 index 3f885e090b..940ba724bf 100644 --- a/src/main/decompMod.F90 +++ b/src/main/decompMod.F90 @@ -7,86 +7,75 @@ module decompMod ! ! !USES: use shr_kind_mod, only : r8 => shr_kind_r8 - ! Must use shr_sys_abort rather than endrun here to avoid circular dependency - use shr_sys_mod , only : shr_sys_abort + + use shr_sys_mod , only : shr_sys_abort ! use shr_sys_abort instead of endrun here to avoid circular dependency use clm_varctl , only : iulog - use clm_varcon , only : grlnd, nameg, namel, namec, namep, nameCohort - use mct_mod , only : mct_gsMap ! ! !PUBLIC TYPES: implicit none - integer, public :: clump_pproc ! number of clumps per MPI process ! Define possible bounds subgrid levels - integer, parameter, public :: BOUNDS_SUBGRID_GRIDCELL = 1 - integer, parameter, public :: BOUNDS_SUBGRID_LANDUNIT = 2 - integer, parameter, public :: BOUNDS_SUBGRID_COLUMN = 3 - integer, parameter, public :: BOUNDS_SUBGRID_PATCH = 4 - integer, parameter, public :: BOUNDS_SUBGRID_COHORT = 5 + ! + ! subgrid_level_unspecified can be used in some situations where a subgrid level is + ! generally needed but it would be hard for the caller to provide it; in this case, + ! some code that depends on subgrid level will be skipped. (But this should only be + ! used if you know what you're doing: places where this value is allowed will have a + ! comment documenting this.) + integer, parameter, public :: subgrid_level_unspecified = -1 + integer, parameter, public :: subgrid_level_lndgrid = 0 + integer, parameter, public :: subgrid_level_gridcell = 1 + integer, parameter, public :: subgrid_level_landunit = 2 + integer, parameter, public :: subgrid_level_column = 3 + integer, parameter, public :: subgrid_level_patch = 4 + integer, parameter, public :: subgrid_level_cohort = 5 ! Define possible bounds levels - integer, parameter, public :: BOUNDS_LEVEL_PROC = 1 - integer, parameter, public :: BOUNDS_LEVEL_CLUMP = 2 + integer, parameter, public :: bounds_level_proc = 1 + integer, parameter, public :: bounds_level_clump = 2 ! ! !PUBLIC MEMBER FUNCTIONS: - - public get_beg ! get beg bound for a given subgrid level - public get_end ! get end bound for a given subgrid level - public get_proc_clumps ! number of clumps for this processor - public get_proc_total ! total no. of gridcells, landunits, columns and patchs for any processor - public get_proc_global ! total gridcells, landunits, columns, patchs across all processors - public get_clmlevel_gsize ! get global size associated with clmlevel - public get_clmlevel_gsmap ! get gsmap associated with clmlevel - - interface get_clump_bounds - module procedure get_clump_bounds_old - module procedure get_clump_bounds_new - end interface - public get_clump_bounds ! clump beg and end gridcell,landunit,column,patch - - interface get_proc_bounds - module procedure get_proc_bounds_old - module procedure get_proc_bounds_new - end interface - public get_proc_bounds ! this processor beg and end gridcell,landunit,column,patch + public :: get_beg ! get beg bound for a given subgrid level + public :: get_end ! get end bound for a given subgrid level + public :: get_clump_bounds ! clump beg and end gridcell,landunit,column,patch + public :: get_proc_bounds ! this processor beg and end gridcell,landunit,column,patch + public :: get_proc_total ! total no. of gridcells, landunits, columns and patchs for any processor + public :: get_proc_global ! total gridcells, landunits, columns, patchs across all processors + public :: get_proc_clumps ! number of clumps for this processor + public :: get_global_index ! Determine global index space value for target point + public :: get_global_index_array ! Determine global index space value for target array + public :: get_subgrid_level_from_name ! Given a name like nameg, return a subgrid level index like subgrid_level_gridcell + public :: get_subgrid_level_gsize ! get global size associated with subgrid_level + public :: get_subgrid_level_gindex ! get global index array associated with subgrid_level ! !PRIVATE MEMBER FUNCTIONS: ! ! !PRIVATE TYPES: private ! (now mostly public for decompinitmod) - integer,public :: nclumps ! total number of clumps across all processors - integer,public :: numg ! total number of gridcells on all procs - integer,public :: numl ! total number of landunits on all procs - integer,public :: numc ! total number of columns on all procs - integer,public :: nump ! total number of patchs on all procs - integer,public :: numCohort ! total number of fates cohorts on all procs - type bounds_type - integer :: begg, endg ! beginning and ending gridcell index - integer :: begl, endl ! beginning and ending landunit index - integer :: begc, endc ! beginning and ending column index - integer :: begp, endp ! beginning and ending patch index + integer :: begg, endg ! beginning and ending gridcell index + integer :: begl, endl ! beginning and ending landunit index + integer :: begc, endc ! beginning and ending column index + integer :: begp, endp ! beginning and ending patch index integer :: begCohort, endCohort ! beginning and ending cohort indices - - integer :: level ! whether defined on the proc or clump level - integer :: clump_index ! if defined on the clump level, this gives the clump index + integer :: level ! whether defined on the proc or clump level + integer :: clump_index ! if defined on the clump level, this gives the clump index end type bounds_type - public bounds_type + public :: bounds_type !---global information on each pe type processor_type - integer :: nclumps ! number of clumps for processor_type iam - integer,pointer :: cid(:) ! clump indices - integer :: ncells ! number of gridcells in proc - integer :: nlunits ! number of landunits in proc - integer :: ncols ! number of columns in proc - integer :: npatches ! number of patchs in proc - integer :: nCohorts ! number of cohorts in proc - integer :: begg, endg ! beginning and ending gridcell index - integer :: begl, endl ! beginning and ending landunit index - integer :: begc, endc ! beginning and ending column index - integer :: begp, endp ! beginning and ending patch index + integer :: nclumps ! number of clumps for processor_type iam + integer,pointer :: cid(:) ! clump indices + integer :: ncells ! number of gridcells in proc + integer :: nlunits ! number of landunits in proc + integer :: ncols ! number of columns in proc + integer :: npatches ! number of patchs in proc + integer :: nCohorts ! number of cohorts in proc + integer :: begg, endg ! beginning and ending gridcell index + integer :: begl, endl ! beginning and ending landunit index + integer :: begc, endc ! beginning and ending column index + integer :: begp, endp ! beginning and ending patch index integer :: begCohort, endCohort ! beginning and ending cohort indices end type processor_type public processor_type @@ -98,7 +87,7 @@ module decompMod integer :: ncells ! number of gridcells in clump integer :: nlunits ! number of landunits in clump integer :: ncols ! number of columns in clump - integer :: npatches ! number of patchs in clump + integer :: npatches ! number of patchs in clump integer :: nCohorts ! number of cohorts in proc integer :: begg, endg ! beginning and ending gridcell index integer :: begl, endl ! beginning and ending landunit index @@ -109,25 +98,26 @@ module decompMod public clump_type type(clump_type),public, allocatable :: clumps(:) - !---global information on each pe - !--- glo = 1d global sn ordered - !--- gdc = 1d global dc ordered compressed - type decomp_type - integer,pointer :: gdc2glo(:) ! 1d gdc to 1d glo - end type decomp_type - public decomp_type - type(decomp_type),public,target :: ldecomp - - type(mct_gsMap) ,public,target :: gsMap_lnd_gdc2glo ! GS map for full 2D land grid - type(mct_gsMap) ,public,target :: gsMap_gce_gdc2glo ! GS map for 1D gridcells - type(mct_gsMap) ,public,target :: gsMap_lun_gdc2glo ! GS map for 1D landunits - type(mct_gsMap) ,public,target :: gsMap_col_gdc2glo ! GS map for 1d columns - type(mct_gsMap) ,public,target :: gsMap_patch_gdc2glo ! GS map for 1D patches - type(mct_gsMap) ,public,target :: gsMap_cohort_gdc2glo ! GS map for 1D cohorts (only for FATES) - - type(mct_gsMap) ,public,target :: gsMap_lnd2Dsoi_gdc2glo ! GS map for full 3D land grid with soil levels as 3rd dim + ! ---global sizes + integer,public :: nclumps ! total number of clumps across all processors + integer,public :: numg ! total number of gridcells on all procs + integer,public :: numl ! total number of landunits on all procs + integer,public :: numc ! total number of columns on all procs + integer,public :: nump ! total number of patchs on all procs + integer,public :: numCohort ! total number of fates cohorts on all procs + + ! ---NOTE: the following are allocated with a lower bound of 1! + integer, public, pointer :: gindex_global(:) => null() ! includes ocean points + integer, public, pointer :: gindex_grc(:) => null() ! does not include ocean points + integer, public, pointer :: gindex_lun(:) => null() + integer, public, pointer :: gindex_col(:) => null() + integer, public, pointer :: gindex_patch(:) => null() + integer, public, pointer :: gindex_cohort(:) => null() !------------------------------------------------------------------------------ + character(len=*), parameter, private :: sourcefile = & + __FILE__ + contains !----------------------------------------------------------------------- @@ -137,7 +127,7 @@ pure function get_beg(bounds, subgrid_level) result(beg_index) ! Get beginning bounds for a given subgrid level ! ! subgrid_level should be one of the constants defined in this module: - ! BOUNDS_SUBGRID_GRIDCELL, BOUNDS_SUBGRID_LANDUNIT, etc. + ! subgrid_level_gridcell, subgrid_level_landunit, etc. ! ! Returns -1 for invalid subgrid_level (does not abort in this case, in order to keep ! this function pure). @@ -155,15 +145,15 @@ pure function get_beg(bounds, subgrid_level) result(beg_index) !----------------------------------------------------------------------- select case (subgrid_level) - case (BOUNDS_SUBGRID_GRIDCELL) + case (subgrid_level_gridcell) beg_index = bounds%begg - case (BOUNDS_SUBGRID_LANDUNIT) + case (subgrid_level_landunit) beg_index = bounds%begl - case (BOUNDS_SUBGRID_COLUMN) + case (subgrid_level_column) beg_index = bounds%begc - case (BOUNDS_SUBGRID_PATCH) + case (subgrid_level_patch) beg_index = bounds%begp - case (BOUNDS_SUBGRID_COHORT) + case (subgrid_level_cohort) beg_index = bounds%begCohort case default beg_index = -1 @@ -178,7 +168,7 @@ pure function get_end(bounds, subgrid_level) result(end_index) ! Get end bounds for a given subgrid level ! ! subgrid_level should be one of the constants defined in this module: - ! BOUNDS_SUBGRID_GRIDCELL, BOUNDS_SUBGRID_LANDUNIT, etc. + ! subgrid_level_gridcell, subgrid_level_landunit, etc. ! ! Returns -1 for invalid subgrid_level (does not abort in this case, in order to keep ! this function pure). @@ -186,25 +176,24 @@ pure function get_end(bounds, subgrid_level) result(end_index) ! !USES: ! ! !ARGUMENTS: - integer :: end_index ! function result - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: subgrid_level + integer :: end_index ! function result + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: subgrid_level ! ! !LOCAL VARIABLES: - character(len=*), parameter :: subname = 'get_end' !----------------------------------------------------------------------- select case (subgrid_level) - case (BOUNDS_SUBGRID_GRIDCELL) + case (subgrid_level_gridcell) end_index = bounds%endg - case (BOUNDS_SUBGRID_LANDUNIT) + case (subgrid_level_landunit) end_index = bounds%endl - case (BOUNDS_SUBGRID_COLUMN) + case (subgrid_level_column) end_index = bounds%endc - case (BOUNDS_SUBGRID_PATCH) + case (subgrid_level_patch) end_index = bounds%endp - case (BOUNDS_SUBGRID_COHORT) + case (subgrid_level_cohort) end_index = bounds%endCohort case default end_index = -1 @@ -213,273 +202,344 @@ pure function get_end(bounds, subgrid_level) result(end_index) end function get_end !------------------------------------------------------------------------------ - subroutine get_clump_bounds_new (n, bounds) - ! - ! !DESCRIPTION: - ! Determine clump bounds - ! - ! !ARGUMENTS: - integer, intent(in) :: n ! processor clump index - type(bounds_type), intent(out) :: bounds ! clump bounds - ! - ! !LOCAL VARIABLES: - character(len=32), parameter :: subname = 'get_clump_bounds' ! Subroutine name - integer :: cid ! clump id + subroutine get_clump_bounds (n, bounds) + ! + ! !DESCRIPTION: + ! Determine clump bounds + ! + ! !ARGUMENTS: + integer, intent(in) :: n ! processor clump index + type(bounds_type), intent(out) :: bounds ! clump bounds + ! + ! !LOCAL VARIABLES: + character(len=32), parameter :: subname = 'get_clump_bounds' ! Subroutine name + integer :: cid ! clump id #ifdef _OPENMP - integer, external :: OMP_GET_MAX_THREADS - integer, external :: OMP_GET_NUM_THREADS - integer, external :: OMP_GET_THREAD_NUM + integer, external :: OMP_GET_MAX_THREADS + integer, external :: OMP_GET_NUM_THREADS #endif - !------------------------------------------------------------------------------ - ! Make sure this IS being called from a threaded region + !------------------------------------------------------------------------------ + ! Make sure this IS being called from a threaded region #ifdef _OPENMP - ! FIX(SPM, 090314) - for debugging fates and openMP - !write(iulog,*) 'SPM omp debug decompMod 1 ', & - !OMP_GET_NUM_THREADS(),OMP_GET_MAX_THREADS(),OMP_GET_THREAD_NUM() - - if ( OMP_GET_NUM_THREADS() == 1 .and. OMP_GET_MAX_THREADS() > 1 )then - call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a non-threaded region)') - end if + if ( OMP_GET_NUM_THREADS() == 1 .and. OMP_GET_MAX_THREADS() > 1 )then + call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a non-threaded region)') + end if #endif - cid = procinfo%cid(n) - bounds%begp = clumps(cid)%begp - bounds%endp = clumps(cid)%endp - bounds%begc = clumps(cid)%begc - bounds%endc = clumps(cid)%endc - bounds%begl = clumps(cid)%begl - bounds%endl = clumps(cid)%endl - bounds%begg = clumps(cid)%begg - bounds%endg = clumps(cid)%endg - bounds%begCohort = clumps(cid)%begCohort - bounds%endCohort = clumps(cid)%endCohort - - bounds%level = BOUNDS_LEVEL_CLUMP - bounds%clump_index = n - - end subroutine get_clump_bounds_new - - !------------------------------------------------------------------------------ - subroutine get_clump_bounds_old (n, begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort) - integer, intent(in) :: n ! proc clump index - integer, intent(out) :: begp, endp ! clump beg and end patch indices - integer, intent(out) :: begc, endc ! clump beg and end column indices - integer, intent(out) :: begl, endl ! clump beg and end landunit indices - integer, intent(out) :: begg, endg ! clump beg and end gridcell indices - integer, intent(out) :: begCohort, endCohort ! cohort beg and end gridcell indices - integer :: cid ! clump id - !------------------------------------------------------------------------------ - - cid = procinfo%cid(n) - begp = clumps(cid)%begp - endp = clumps(cid)%endp - begc = clumps(cid)%begc - endc = clumps(cid)%endc - begl = clumps(cid)%begl - endl = clumps(cid)%endl - begg = clumps(cid)%begg - endg = clumps(cid)%endg - begCohort = clumps(cid)%begCohort - endCohort = clumps(cid)%endCohort - end subroutine get_clump_bounds_old - - !------------------------------------------------------------------------------ - subroutine get_proc_bounds_new (bounds) - ! - ! !DESCRIPTION: - ! Retrieve processor bounds - ! - ! !ARGUMENTS: - type(bounds_type), intent(out) :: bounds ! processor bounds bounds - ! - ! !LOCAL VARIABLES: + cid = procinfo%cid(n) + bounds%begp = clumps(cid)%begp - procinfo%begp + 1 + bounds%endp = clumps(cid)%endp - procinfo%begp + 1 + bounds%begc = clumps(cid)%begc - procinfo%begc + 1 + bounds%endc = clumps(cid)%endc - procinfo%begc + 1 + bounds%begl = clumps(cid)%begl - procinfo%begl + 1 + bounds%endl = clumps(cid)%endl - procinfo%begl + 1 + bounds%begg = clumps(cid)%begg - procinfo%begg + 1 + bounds%endg = clumps(cid)%endg - procinfo%begg + 1 + bounds%begCohort = clumps(cid)%begCohort - procinfo%begCohort + 1 + bounds%endCohort = clumps(cid)%endCohort - procinfo%begCohort + 1 + + bounds%level = bounds_level_clump + bounds%clump_index = n + + end subroutine get_clump_bounds + + !------------------------------------------------------------------------------ + subroutine get_proc_bounds (bounds, allow_call_from_threaded_region) + ! + ! !DESCRIPTION: + ! Retrieve processor bounds + ! + ! !ARGUMENTS: + type(bounds_type), intent(out) :: bounds ! processor bounds bounds + + ! Normally this routine will abort if it is called from within a threaded region, + ! because in most cases you should be calling get_clump_bounds in that situation. If + ! you really want to be using this routine from within a threaded region, then set + ! allow_call_from_threaded_region to .true. + logical, intent(in), optional :: allow_call_from_threaded_region + ! + ! !LOCAL VARIABLES: + logical :: l_allow_call_from_threaded_region #ifdef _OPENMP - integer, external :: OMP_GET_NUM_THREADS - integer, external :: OMP_GET_MAX_THREADS - integer, external :: OMP_GET_THREAD_NUM + integer, external :: OMP_GET_NUM_THREADS #endif - character(len=32), parameter :: subname = 'get_proc_bounds' ! Subroutine name - !------------------------------------------------------------------------------ - ! Make sure this is NOT being called from a threaded region + character(len=32), parameter :: subname = 'get_proc_bounds' ! Subroutine name + !------------------------------------------------------------------------------ + ! Make sure this is NOT being called from a threaded region + if (present(allow_call_from_threaded_region)) then + l_allow_call_from_threaded_region = allow_call_from_threaded_region + else + l_allow_call_from_threaded_region = .false. + end if #ifdef _OPENMP - ! FIX(SPM, 090314) - for debugging fates and openMP - !write(*,*) 'SPM omp debug decompMod 2 ', & - !OMP_GET_NUM_THREADS(),OMP_GET_MAX_THREADS(),OMP_GET_THREAD_NUM() - - if ( OMP_GET_NUM_THREADS() > 1 )then - call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a threaded region') - end if + if ( OMP_GET_NUM_THREADS() > 1 .and. .not. l_allow_call_from_threaded_region )then + call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a threaded region') + end if #endif - bounds%begp = procinfo%begp - bounds%endp = procinfo%endp - bounds%begc = procinfo%begc - bounds%endc = procinfo%endc - bounds%begl = procinfo%begl - bounds%endl = procinfo%endl - bounds%begg = procinfo%begg - bounds%endg = procinfo%endg - bounds%begCohort = procinfo%begCohort - bounds%endCohort = procinfo%endCohort - - bounds%level = BOUNDS_LEVEL_PROC - bounds%clump_index = -1 ! irrelevant for proc, so assigned a bogus value - - end subroutine get_proc_bounds_new - - !------------------------------------------------------------------------------ - subroutine get_proc_bounds_old (begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort) - - integer, optional, intent(out) :: begp, endp ! proc beg and end patch indices - integer, optional, intent(out) :: begc, endc ! proc beg and end column indices - integer, optional, intent(out) :: begl, endl ! proc beg and end landunit indices - integer, optional, intent(out) :: begg, endg ! proc beg and end gridcell indices - integer, optional, intent(out) :: begCohort, endCohort ! cohort beg and end gridcell indices - !------------------------------------------------------------------------------ - - if (present(begp)) begp = procinfo%begp - if (present(endp)) endp = procinfo%endp - if (present(begc)) begc = procinfo%begc - if (present(endc)) endc = procinfo%endc - if (present(begl)) begl = procinfo%begl - if (present(endl)) endl = procinfo%endl - if (present(begg)) begg = procinfo%begg - if (present(endg)) endg = procinfo%endg - if (present(begCohort)) begCohort = procinfo%begCohort - if (present(endCohort)) endCohort = procinfo%endCohort - end subroutine get_proc_bounds_old - - !------------------------------------------------------------------------------ - subroutine get_proc_total(pid, ncells, nlunits, ncols, npatches, nCohorts) - ! - ! !DESCRIPTION: - ! Count up gridcells, landunits, columns, and patchs on process. - ! - ! !ARGUMENTS: - integer, intent(in) :: pid ! proc id - integer, intent(out) :: ncells ! total number of gridcells on the processor - integer, intent(out) :: nlunits ! total number of landunits on the processor - integer, intent(out) :: ncols ! total number of columns on the processor - integer, intent(out) :: npatches ! total number of patchs on the processor - integer, intent(out) :: nCohorts! total number of cohorts on the processor - ! - ! !LOCAL VARIABLES: - integer :: cid ! clump index - !------------------------------------------------------------------------------ - - npatches = 0 - nlunits = 0 - ncols = 0 - ncells = 0 - nCohorts = 0 - do cid = 1,nclumps - if (clumps(cid)%owner == pid) then - ncells = ncells + clumps(cid)%ncells - nlunits = nlunits + clumps(cid)%nlunits - ncols = ncols + clumps(cid)%ncols - npatches = npatches + clumps(cid)%npatches - nCohorts = nCohorts + clumps(cid)%nCohorts - end if - end do - end subroutine get_proc_total - - !------------------------------------------------------------------------------ - subroutine get_proc_global(ng, nl, nc, np, nCohorts) - ! - ! !DESCRIPTION: - ! Return number of gridcells, landunits, columns, and patchs across all processes. - ! - ! !ARGUMENTS: - integer, optional, intent(out) :: ng ! total number of gridcells across all processors - integer, optional, intent(out) :: nl ! total number of landunits across all processors - integer, optional, intent(out) :: nc ! total number of columns across all processors - integer, optional, intent(out) :: np ! total number of patchs across all processors - integer, optional, intent(out) :: nCohorts ! total number fates cohorts - !------------------------------------------------------------------------------ - - if (present(np)) np = nump - if (present(nc)) nc = numc - if (present(nl)) nl = numl - if (present(ng)) ng = numg - if (present(nCohorts)) nCohorts = numCohort - - end subroutine get_proc_global - - !------------------------------------------------------------------------------ - integer function get_proc_clumps() - ! - ! !DESCRIPTION: - ! Return the number of clumps. - !------------------------------------------------------------------------------ - - get_proc_clumps = procinfo%nclumps - - end function get_proc_clumps - - !----------------------------------------------------------------------- - integer function get_clmlevel_gsize (clmlevel) - ! - ! !DESCRIPTION: - ! Determine 1d size from clmlevel - ! - ! !USES: - use domainMod , only : ldomain - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: clmlevel !type of clm 1d array - !----------------------------------------------------------------------- - - select case (clmlevel) - case(grlnd) - get_clmlevel_gsize = ldomain%ns - case(nameg) - get_clmlevel_gsize = numg - case(namel) - get_clmlevel_gsize = numl - case(namec) - get_clmlevel_gsize = numc - case(namep) - get_clmlevel_gsize = nump - case(nameCohort) - get_clmlevel_gsize = numCohort - case default - write(iulog,*) 'get_clmlevel_gsize does not match clmlevel type: ', trim(clmlevel) - call shr_sys_abort() - end select - - end function get_clmlevel_gsize - - !----------------------------------------------------------------------- - subroutine get_clmlevel_gsmap (clmlevel, gsmap) - ! - ! !DESCRIPTION: - ! Compute arguments for gatherv, scatterv for vectors - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: clmlevel ! type of input data - type(mct_gsmap) , pointer :: gsmap - !---------------------------------------------------------------------- - - select case (clmlevel) + bounds%begp = 1 + bounds%endp = procinfo%endp - procinfo%begp + 1 + bounds%begc = 1 + bounds%endc = procinfo%endc - procinfo%begc + 1 + bounds%begl = 1 + bounds%endl = procinfo%endl - procinfo%begl + 1 + bounds%begg = 1 + bounds%endg = procinfo%endg - procinfo%begg + 1 + bounds%begCohort = 1 + bounds%endCohort = procinfo%endCohort - procinfo%begCohort + 1 + + bounds%level = bounds_level_proc + bounds%clump_index = -1 ! irrelevant for proc, so assigned a bogus value + + end subroutine get_proc_bounds + + !------------------------------------------------------------------------------ + subroutine get_proc_total(pid, ncells, nlunits, ncols, npatches, nCohorts) + ! + ! !DESCRIPTION: + ! Count up gridcells, landunits, columns, and patchs on process. + ! + ! !ARGUMENTS: + integer, intent(in) :: pid ! proc id + integer, intent(out) :: ncells ! total number of gridcells on the processor + integer, intent(out) :: nlunits ! total number of landunits on the processor + integer, intent(out) :: ncols ! total number of columns on the processor + integer, intent(out) :: npatches ! total number of patchs on the processor + integer, intent(out) :: nCohorts! total number of cohorts on the processor + ! + ! !LOCAL VARIABLES: + integer :: cid ! clump index + !------------------------------------------------------------------------------ + + npatches = 0 + nlunits = 0 + ncols = 0 + ncells = 0 + nCohorts = 0 + do cid = 1,nclumps + if (clumps(cid)%owner == pid) then + ncells = ncells + clumps(cid)%ncells + nlunits = nlunits + clumps(cid)%nlunits + ncols = ncols + clumps(cid)%ncols + npatches = npatches + clumps(cid)%npatches + nCohorts = nCohorts + clumps(cid)%nCohorts + end if + end do + end subroutine get_proc_total + + !------------------------------------------------------------------------------ + subroutine get_proc_global(ng, nl, nc, np, nCohorts) + ! + ! !DESCRIPTION: + ! Return number of gridcells, landunits, columns, and patchs across all processes. + ! + ! !ARGUMENTS: + integer, optional, intent(out) :: ng ! total number of gridcells across all processors + integer, optional, intent(out) :: nl ! total number of landunits across all processors + integer, optional, intent(out) :: nc ! total number of columns across all processors + integer, optional, intent(out) :: np ! total number of patchs across all processors + integer, optional, intent(out) :: nCohorts ! total number fates cohorts + !------------------------------------------------------------------------------ + + if (present(np)) np = nump + if (present(nc)) nc = numc + if (present(nl)) nl = numl + if (present(ng)) ng = numg + if (present(nCohorts)) nCohorts = numCohort + + end subroutine get_proc_global + + !------------------------------------------------------------------------------ + integer function get_proc_clumps() + ! + ! !DESCRIPTION: + ! Return the number of clumps. + !------------------------------------------------------------------------------ + + get_proc_clumps = procinfo%nclumps + + end function get_proc_clumps + + !----------------------------------------------------------------------- + integer function get_global_index(subgrid_index, subgrid_level) + + !---------------------------------------------------------------- + ! Description + ! Determine global index space value for target point at given subgrid level + ! + ! Uses: + use shr_log_mod, only: errMsg => shr_log_errMsg + ! + ! Arguments + integer , intent(in) :: subgrid_index ! index of interest (can be at any subgrid level or gridcell level) + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined above + ! + ! Local Variables: + type(bounds_type) :: bounds_proc ! processor bounds + integer :: beg_index ! beginning proc index for subgrid_level + integer, pointer :: gindex(:) + !---------------------------------------------------------------- + + call get_proc_bounds(bounds_proc, allow_call_from_threaded_region=.true.) + beg_index = get_beg(bounds_proc, subgrid_level) + if (beg_index == -1) then + write(iulog,*) 'get_global_index: subgrid_level not supported: ', subgrid_level + call shr_sys_abort('subgrid_level not supported' // & + errmsg(sourcefile, __LINE__)) + end if + + call get_subgrid_level_gindex(subgrid_level=subgrid_level, gindex=gindex) + get_global_index = gindex(subgrid_index - beg_index + 1) + + end function get_global_index + + !----------------------------------------------------------------------- + function get_global_index_array(subgrid_index, bounds1, bounds2, subgrid_level) + + !---------------------------------------------------------------- + ! Description + ! Determine global index space value for target array at given subgrid level + ! + ! Example from histFileMod.F90: + ! ilarr = get_global_index_array(lun%gridcell(bounds%begl:bounds%endl), bounds%begl, bounds%endl, subgrid_level=subgrid_level_gridcell) + ! Note that the last argument (subgrid_level) is set to nameg, which corresponds + ! to the "gridcell" not the "lun" of the first argument. + ! + ! Uses: +#include "shr_assert.h" + use shr_log_mod, only: errMsg => shr_log_errMsg + ! + ! Arguments + integer , intent(in) :: bounds1 ! lower bound of the input & returned arrays + integer , intent(in) :: bounds2 ! upper bound of the input & returned arrays + integer , intent(in) :: subgrid_index(bounds1:) ! array of indices of interest (can be at any subgrid level or gridcell level) + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined above + integer :: get_global_index_array(bounds1:bounds2) + ! + ! Local Variables: + type(bounds_type) :: bounds_proc ! processor bounds + integer :: beg_index ! beginning proc index for subgrid_level + integer :: i + integer , pointer :: gindex(:) + !---------------------------------------------------------------- + + SHR_ASSERT_ALL_FL((ubound(subgrid_index) == (/bounds2/)), sourcefile, __LINE__) + call get_proc_bounds(bounds_proc, allow_call_from_threaded_region=.true.) + beg_index = get_beg(bounds_proc, subgrid_level) + if (beg_index == -1) then + write(iulog,*) 'get_global_index_array: subgrid_level not supported: ', subgrid_level + call shr_sys_abort('subgrid_level not supported' // & + errmsg(sourcefile, __LINE__)) + end if + + call get_subgrid_level_gindex(subgrid_level=subgrid_level, gindex=gindex) + do i = bounds1, bounds2 + get_global_index_array(i) = gindex(subgrid_index(i) - beg_index + 1) + end do + + end function get_global_index_array + + !----------------------------------------------------------------------- + function get_subgrid_level_from_name(subgrid_level_name) result(subgrid_level) + ! + ! !DESCRIPTION: + ! Given a name like nameg, return a subgrid level index like subgrid_level_gridcell + ! + ! !USES: + use clm_varcon, only : grlnd, nameg, namel, namec, namep, nameCohort + ! + ! !ARGUMENTS: + character(len=*), intent(in) :: subgrid_level_name ! grlnd, nameg, namel, namec, namep, or nameCohort + integer :: subgrid_level ! function result + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'get_subgrid_level_from_name' + !----------------------------------------------------------------------- + + select case (subgrid_level_name) case(grlnd) - gsmap => gsmap_lnd_gdc2glo + subgrid_level = subgrid_level_lndgrid case(nameg) - gsmap => gsmap_gce_gdc2glo + subgrid_level = subgrid_level_gridcell case(namel) - gsmap => gsmap_lun_gdc2glo + subgrid_level = subgrid_level_landunit case(namec) - gsmap => gsmap_col_gdc2glo + subgrid_level = subgrid_level_column case(namep) - gsmap => gsmap_patch_gdc2glo + subgrid_level = subgrid_level_patch case(nameCohort) - gsmap => gsMap_cohort_gdc2glo + subgrid_level = subgrid_level_cohort + case default + write(iulog,*) subname//': unknown subgrid_level_name: ', trim(subgrid_level_name) + call shr_sys_abort() + end select + + end function get_subgrid_level_from_name + + + !----------------------------------------------------------------------- + integer function get_subgrid_level_gsize (subgrid_level) + ! + ! !DESCRIPTION: + ! Determine 1d size from subgrid_level + ! + ! !USES: + use domainMod , only : ldomain + ! + ! !ARGUMENTS: + integer, intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined above + !----------------------------------------------------------------------- + + select case (subgrid_level) + case(subgrid_level_lndgrid) + get_subgrid_level_gsize = ldomain%ns + case(subgrid_level_gridcell) + get_subgrid_level_gsize = numg + case(subgrid_level_landunit) + get_subgrid_level_gsize = numl + case(subgrid_level_column) + get_subgrid_level_gsize = numc + case(subgrid_level_patch) + get_subgrid_level_gsize = nump + case(subgrid_level_cohort) + get_subgrid_level_gsize = numCohort + case default + write(iulog,*) 'get_subgrid_level_gsize: unknown subgrid_level: ', subgrid_level + call shr_sys_abort() + end select + + end function get_subgrid_level_gsize + + !----------------------------------------------------------------------- + subroutine get_subgrid_level_gindex (subgrid_level, gindex) + ! + ! !DESCRIPTION: + ! Get subgrid global index space + ! + ! !ARGUMENTS: + integer , intent(in) :: subgrid_level ! one of the subgrid_level_* constants defined above + integer , pointer :: gindex(:) + !---------------------------------------------------------------------- + + select case (subgrid_level) + case(subgrid_level_lndgrid) + gindex => gindex_global + case(subgrid_level_gridcell) + gindex => gindex_grc + case(subgrid_level_landunit) + gindex => gindex_lun + case(subgrid_level_column) + gindex => gindex_col + case(subgrid_level_patch) + gindex => gindex_patch + case(subgrid_level_cohort) + gindex => gindex_cohort case default - write(iulog,*) 'get_clmlevel_gsmap: Invalid expansion character: ',trim(clmlevel) + write(iulog,*) 'get_subgrid_level_gindex: unknown subgrid_level: ', subgrid_level call shr_sys_abort() end select - end subroutine get_clmlevel_gsmap + end subroutine get_subgrid_level_gindex end module decompMod diff --git a/src/main/filterMod.F90 b/src/main/filterMod.F90 index 98e4cc073d..a6ca2d8f8f 100644 --- a/src/main/filterMod.F90 +++ b/src/main/filterMod.F90 @@ -13,10 +13,10 @@ module filterMod use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun use clm_varctl , only : iulog - use decompMod , only : bounds_type + use decompMod , only : bounds_type use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col + use LandunitType , only : lun + use ColumnType , only : col use PatchType , only : patch use glcBehaviorMod , only : glc_behavior_type ! @@ -37,6 +37,9 @@ module filterMod integer, pointer :: soilnopcropp(:) ! soil w/o prog. crops (pfts) integer :: num_soilnopcropp ! number of pfts in soil w/o prog crops + integer, pointer :: all_soil_patches(:) ! all soil or crop patches. Used for updating FATES SP drivers + integer :: num_all_soil_patches ! number of pfts in all_soil_patches filter + integer, pointer :: lakep(:) ! lake filter (pfts) integer :: num_lakep ! number of pfts in lake filter integer, pointer :: nolakep(:) ! non-lake filter (pfts) @@ -47,19 +50,19 @@ module filterMod integer :: num_nolakec ! number of columns in non-lake filter integer, pointer :: soilc(:) ! soil filter (columns) - integer :: num_soilc ! number of columns in soil filter + integer :: num_soilc ! number of columns in soil filter integer, pointer :: soilp(:) ! soil filter (pfts) - integer :: num_soilp ! number of pfts in soil filter + integer :: num_soilp ! number of pfts in soil filter - integer, pointer :: snowc(:) ! snow filter (columns) - integer :: num_snowc ! number of columns in snow filter - integer, pointer :: nosnowc(:) ! non-snow filter (columns) - integer :: num_nosnowc ! number of columns in non-snow filter + integer, pointer :: snowc(:) ! snow filter (columns) + integer :: num_snowc ! number of columns in snow filter + integer, pointer :: nosnowc(:) ! non-snow filter (columns) + integer :: num_nosnowc ! number of columns in non-snow filter - integer, pointer :: lakesnowc(:) ! snow filter (columns) - integer :: num_lakesnowc ! number of columns in snow filter - integer, pointer :: lakenosnowc(:) ! non-snow filter (columns) - integer :: num_lakenosnowc ! number of columns in non-snow filter + integer, pointer :: lakesnowc(:) ! snow filter (columns) + integer :: num_lakesnowc ! number of columns in snow filter + integer, pointer :: lakenosnowc(:) ! non-snow filter (columns) + integer :: num_lakenosnowc ! number of columns in non-snow filter integer, pointer :: exposedvegp(:) ! patches where frac_veg_nosno is non-zero integer :: num_exposedvegp ! number of patches in exposedvegp filter @@ -67,12 +70,12 @@ module filterMod integer :: num_noexposedvegp ! number of patches in noexposedvegp filter integer, pointer :: hydrologyc(:) ! hydrology filter (columns) - integer :: num_hydrologyc ! number of columns in hydrology filter + integer :: num_hydrologyc ! number of columns in hydrology filter integer, pointer :: urbanl(:) ! urban filter (landunits) - integer :: num_urbanl ! number of landunits in urban filter + integer :: num_urbanl ! number of landunits in urban filter integer, pointer :: nourbanl(:) ! non-urban filter (landunits) - integer :: num_nourbanl ! number of landunits in non-urban filter + integer :: num_nourbanl ! number of landunits in non-urban filter integer, pointer :: urbanc(:) ! urban filter (columns) integer :: num_urbanc ! number of columns in urban filter @@ -89,9 +92,9 @@ module filterMod integer, pointer :: icec(:) ! glacier filter (cols) integer :: num_icec ! number of columns in glacier filter - + integer, pointer :: do_smb_c(:) ! glacier+bareland SMB calculations-on filter (cols) - integer :: num_do_smb_c ! number of columns in glacier+bareland SMB mec filter + integer :: num_do_smb_c ! number of columns in glacier+bareland SMB mec filter end type clumpfilter public clumpfilter @@ -99,7 +102,7 @@ module filterMod ! This is the standard set of filters, which should be used in most places in the code. ! These filters only include 'active' points. type(clumpfilter), allocatable, public :: filter(:) - + ! --- DO NOT USING THE FOLLOWING VARIABLE UNLESS YOU KNOW WHAT YOU'RE DOING! --- ! ! This is a separate set of filters that contains both inactive and active points. It is @@ -120,7 +123,7 @@ module filterMod public allocFilters ! allocate memory for filters public setFilters ! set filters public setExposedvegpFilter ! set the exposedvegp and noexposedvegp filters - + private allocFiltersOneGroup ! allocate memory for one group of filters private setFiltersOneGroup ! set one group of filters @@ -131,7 +134,7 @@ module filterMod ! Created by Mariana Vertenstein ! 11/13/03, Peter Thornton: Added soilp and num_soilp ! Jan/08, S. Levis: Added crop-related filters - ! June/13, Bill Sacks: Change main filters to just work over 'active' points; + ! June/13, Bill Sacks: Change main filters to just work over 'active' points; ! add filter_inactive_and_active !----------------------------------------------------------------------- @@ -168,7 +171,7 @@ subroutine allocFiltersOneGroup(this_filter) integer :: nc ! clump index integer :: nclumps ! total number of clumps on this processor integer :: ier ! error status - type(bounds_type) :: bounds + type(bounds_type) :: bounds !------------------------------------------------------------------------ ! Determine clump variables for this processor @@ -195,6 +198,7 @@ subroutine allocFiltersOneGroup(this_filter) allocate(this_filter(nc)%lakep(bounds%endp-bounds%begp+1)) allocate(this_filter(nc)%nolakep(bounds%endp-bounds%begp+1)) allocate(this_filter(nc)%nolakeurbanp(bounds%endp-bounds%begp+1)) + allocate(this_filter(nc)%all_soil_patches(bounds%endp-bounds%begp+1)) allocate(this_filter(nc)%lakec(bounds%endc-bounds%begc+1)) allocate(this_filter(nc)%nolakec(bounds%endc-bounds%begc+1)) @@ -228,8 +232,8 @@ subroutine allocFiltersOneGroup(this_filter) allocate(this_filter(nc)%soilnopcropp(bounds%endp-bounds%begp+1)) allocate(this_filter(nc)%icec(bounds%endc-bounds%begc+1)) - allocate(this_filter(nc)%do_smb_c(bounds%endc-bounds%begc+1)) - + allocate(this_filter(nc)%do_smb_c(bounds%endc-bounds%begc+1)) + end do !$OMP END PARALLEL DO @@ -240,14 +244,14 @@ subroutine setFilters(bounds, glc_behavior) ! ! !DESCRIPTION: ! Set CLM filters. - use decompMod , only : BOUNDS_LEVEL_CLUMP + use decompMod , only : bounds_level_clump ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds type(glc_behavior_type) , intent(in) :: glc_behavior !------------------------------------------------------------------------ - SHR_ASSERT_FL(bounds%level == BOUNDS_LEVEL_CLUMP, sourcefile, __LINE__) + SHR_ASSERT_FL(bounds%level == bounds_level_clump, sourcefile, __LINE__) call setFiltersOneGroup(bounds, & filter, include_inactive = .false., & @@ -263,11 +267,11 @@ subroutine setFilters(bounds, glc_behavior) ! filters are updated. But if this proves to be a performance problem, we could ! introduce an argument saying whether we're in initialization, and if so, skip this ! call. - + call setFiltersOneGroup(bounds, & filter_inactive_and_active, include_inactive = .true., & glc_behavior = glc_behavior) - + end subroutine setFilters @@ -287,12 +291,12 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio ! is called at the right time in the driver loop. ! ! !USES: - use decompMod , only : BOUNDS_LEVEL_CLUMP + use decompMod , only : bounds_level_clump use pftconMod , only : npcropmin use landunit_varcon , only : istsoil, istcrop, istice ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds type(clumpfilter) , intent(inout) :: this_filter(:) ! the group of filters to set logical , intent(in) :: include_inactive ! whether inactive points should be included in the filters type(glc_behavior_type) , intent(in) :: glc_behavior @@ -304,10 +308,11 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio integer :: fnl,fnlu ! non-lake filter index integer :: fs ! soil filter index integer :: f, fn ! general indices + integer :: f_asp ! all soil patches index integer :: g !gridcell index !------------------------------------------------------------------------ - SHR_ASSERT_FL(bounds%level == BOUNDS_LEVEL_CLUMP, sourcefile, __LINE__) + SHR_ASSERT_FL(bounds%level == bounds_level_clump, sourcefile, __LINE__) nc = bounds%clump_index @@ -321,7 +326,7 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio end do this_filter(nc)%num_allc = fl - ! Create lake and non-lake filters at column-level + ! Create lake and non-lake filters at column-level fl = 0 fnl = 0 @@ -340,7 +345,7 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio this_filter(nc)%num_lakec = fl this_filter(nc)%num_nolakec = fnl - ! Create lake and non-lake filters at patch-level + ! Create lake and non-lake filters at patch-level fl = 0 fnl = 0 @@ -393,7 +398,7 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio end do this_filter(nc)%num_soilp = fs - ! Create column-level hydrology filter (soil and Urban pervious road cols) + ! Create column-level hydrology filter (soil and Urban pervious road cols) f = 0 do c = bounds%begc,bounds%endc @@ -425,6 +430,25 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio end if end if end do + + ! thise filter will include all soil P's irrespective of whether or not they are active. + ! its purpose is to allow the TLAI, TSAI and HTOP drivers to be interpolated when in + ! FATES-SP mode. + ! e.g. in FATES, an active PFT vector of 1, 0, 0, 0, 1, 0, 1, 0 + ! would be mapped inot the host land model as + ! 1, 1, 1, 0, 0, 0, 0 + ! thus the 'active' filter will only use the first three points. + ! this filter will stay on for all the + f_asp = 0 + do p = bounds%begp,bounds%endp + l =patch%landunit(p) + if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then + f_asp = f_asp +1 + this_filter(nc)%all_soil_patches(f_asp) = p + end if + enddo + this_filter(nc)%num_all_soil_patches = f_asp + this_filter(nc)%num_pcropp = fl this_filter(nc)%num_soilnopcropp = fnl ! This wasn't being set before... @@ -477,7 +501,7 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio this_filter(nc)%urbanp(f) = p else fn = fn + 1 - this_filter(nc)%nourbanp(fn) = p + this_filter(nc)%nourbanp(fn) = p end if end if end do @@ -516,7 +540,7 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio end if end if end do - this_filter(nc)%num_do_smb_c = f + this_filter(nc)%num_do_smb_c = f ! Note: snow filters are reconstructed each time step in ! LakeHydrology and SnowHydrology @@ -538,15 +562,15 @@ subroutine setExposedvegpFilter(bounds, frac_veg_nosno) ! ! Only sets this filter in the main 'filter' variable, NOT in ! filter_inactive_and_active. - ! + ! ! Note that this is done separately from the main setFilters routine, because it may - ! need to be called at a different time in the driver loop. + ! need to be called at a different time in the driver loop. ! ! !USES: - use decompMod , only : BOUNDS_LEVEL_CLUMP + use decompMod , only : bounds_level_clump ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: frac_veg_nosno( bounds%begp: ) ! fraction of vegetation not covered by snow [patch] ! ! !LOCAL VARIABLES: @@ -554,11 +578,11 @@ subroutine setExposedvegpFilter(bounds, frac_veg_nosno) integer :: fp ! filter index integer :: p ! patch index integer :: fe, fn ! filter counts - + character(len=*), parameter :: subname = 'setExposedvegpFilter' !----------------------------------------------------------------------- - SHR_ASSERT_FL(bounds%level == BOUNDS_LEVEL_CLUMP, sourcefile, __LINE__) + SHR_ASSERT_FL(bounds%level == bounds_level_clump, sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(frac_veg_nosno) == (/bounds%endp/)), sourcefile, __LINE__) nc = bounds%clump_index diff --git a/src/main/glc2lndMod.F90 b/src/main/glc2lndMod.F90 index 5cbb5b9187..ecd6818210 100644 --- a/src/main/glc2lndMod.F90 +++ b/src/main/glc2lndMod.F90 @@ -6,13 +6,13 @@ module glc2lndMod ! ! !USES: #include "shr_assert.h" - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_gridcell use shr_log_mod , only : errMsg => shr_log_errMsg use shr_kind_mod , only : r8 => shr_kind_r8 use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use clm_varpar , only : maxpatch_glc use clm_varctl , only : iulog, glc_do_dynglacier - use clm_varcon , only : nameg, spval, ispval + use clm_varcon , only : spval, ispval use abortutils , only : endrun use GridcellType , only : grc use LandunitType , only : lun @@ -450,7 +450,7 @@ subroutine check_glc2lnd_icemask(this, bounds) write(iulog,'(a)') 'by modifying GLACIER_REGION on the surface dataset.' write(iulog,'(a)') '(Expand the region that corresponds to the GLC domain' write(iulog,'(a)') '- i.e., the region specified as "virtual" in glacier_region_behavior.)' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if ! Ensure that icemask is a subset of melt_replaced_by_ice. This is needed @@ -465,7 +465,7 @@ subroutine check_glc2lnd_icemask(this, bounds) write(iulog,'(a)') 'by modifying GLACIER_REGION on the surface dataset.' write(iulog,'(a)') '(Expand the region that corresponds to the GLC domain' write(iulog,'(a)') '- i.e., the region specified as "replaced_by_ice" in glacier_region_melt_behavior.)' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end if @@ -499,7 +499,7 @@ subroutine check_glc2lnd_icemask_coupled_fluxes(this, bounds) ! future can rely on it. if (this%icemask_coupled_fluxes_grc(g) > 0._r8 .and. this%icemask_grc(g) == 0._r8) then write(iulog,*) subname//' ERROR: icemask_coupled_fluxes must be a subset of icemask.' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end do @@ -594,7 +594,7 @@ subroutine update_glc2lnd_dyn_runoff_routing(this, bounds) write(iulog,'(a)') 'by modifying GLACIER_REGION on the surface dataset.' write(iulog,'(a)') '(Expand the region that corresponds to the GLC domain' write(iulog,'(a)') '- i.e., the region specified as "replaced_by_ice" in glacier_region_melt_behavior.)' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end if end do @@ -648,7 +648,8 @@ subroutine update_glc2lnd_fracs(this, bounds) l_ice = grc%landunit_indices(istice, g) if (l_ice == ispval) then write(iulog,*) subname//' ERROR: no ice landunit found within the icemask, for g = ', g - call endrun() + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & + msg="no ice landunit found within the icemask") end if frac_assigned(1:maxpatch_glc) = .false. @@ -674,7 +675,8 @@ subroutine update_glc2lnd_fracs(this, bounds) this%frac_grc(g, 1:maxpatch_glc) write(iulog,*) 'frac_assigned(1:maxpatch_glc) = ', & frac_assigned(1:maxpatch_glc) - call endrun() + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & + msg="at least one glc column has non-zero area from cpl but has no slot in memory") end if ! error end if ! area_ice > 0 end if ! this%icemask_grc(g) > 0 diff --git a/src/main/glcBehaviorMod.F90 b/src/main/glcBehaviorMod.F90 index f7d98f805e..0476fe3ecb 100644 --- a/src/main/glcBehaviorMod.F90 +++ b/src/main/glcBehaviorMod.F90 @@ -13,7 +13,7 @@ module glcBehaviorMod use clm_varctl , only : iulog use landunit_varcon, only : istice use clm_instur , only : wt_lunit, wt_glc_mec - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_gridcell, subgrid_level_column use filterColMod , only : filter_col_type use ColumnType , only : col use PatchType , only : patch @@ -758,7 +758,8 @@ subroutine glc_col_exists(this, gi, elev_class, atm_topo, exists, col_wt_lunit) else write(iulog,*) subname, ': ERROR getting elevation class for topo = ', atm_topo write(iulog,*) glc_errcode_to_string(err_code) - call endrun(msg=subname//': ERROR getting elevation class') + call endrun(subgrid_index=gi, subgrid_level=subgrid_level_gridcell, & + msg=subname//': ERROR getting elevation class') end if if (elev_class == atm_elev_class) then @@ -1001,7 +1002,8 @@ subroutine update_collapsed_columns_classes(this, bounds, collapse_filterc, topo write(iulog,*) subname, ': ERROR getting elevation class for topo = ', & topo_col(c) write(iulog,*) glc_errcode_to_string(err_code) - call endrun(msg=subname//': ERROR getting elevation class') + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=subname//': ERROR getting elevation class') end if new_coltype = ice_class_to_col_itype(elev_class) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 9ce24163ff..cc4e23293e 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -12,11 +12,11 @@ module histFileMod use shr_sys_mod , only : shr_sys_flush use spmdMod , only : masterproc use abortutils , only : endrun - use clm_varctl , only : iulog, use_vertsoilc, use_fates, compname + use clm_varctl , only : iulog, use_fates, compname, use_cn, use_crop use clm_varcon , only : spval, ispval - use clm_varcon , only : grlnd, nameg, namel, namec, namep, nameCohort - use decompMod , only : get_proc_bounds, get_proc_global, bounds_type - use GetGlobalValuesMod , only : GetGlobalIndexArray + use clm_varcon , only : grlnd, nameg, namel, namec, namep + use decompMod , only : get_proc_bounds, get_proc_global, bounds_type, get_global_index_array + use decompMod , only : subgrid_level_gridcell, subgrid_level_landunit, subgrid_level_column use GridcellType , only : grc use LandunitType , only : lun use ColumnType , only : col @@ -29,7 +29,7 @@ module histFileMod use FatesLitterMod , only : ncwd use PRTGenericMod , only : num_elements_fates => num_elements use FatesInterfaceTypesMod , only : numpft_fates => numpft - use ncdio_pio + use ncdio_pio ! implicit none @@ -44,7 +44,7 @@ module histFileMod integer , public, parameter :: max_flds = 2500 ! max number of history fields integer , public, parameter :: max_namlen = 64 ! maximum number of characters for field name integer , public, parameter :: scale_type_strlen = 32 ! maximum number of characters for scale types - integer , private, parameter :: avgflag_strlen = 3 ! maximum number of characters for avgflag + integer , private, parameter :: avgflag_strlen = 10 ! maximum number of characters for avgflag integer , private, parameter :: hist_dim_name_length = 16 ! lenngth of character strings in dimension names ! Possible ways to treat multi-layer snow fields at times when no snow is present in a @@ -164,6 +164,7 @@ module histFileMod private :: hfields_1dinfo ! Define/output 1d subgrid info if appropriate private :: hist_update_hbuf_field_1d ! Updates history buffer for specific field and tape private :: hist_update_hbuf_field_2d ! Updates history buffer for specific field and tape + private :: calc_weight_local_time ! Calculate weight for time interpolation for local time flag private :: hist_set_snow_field_2d ! Set values in history field dimensioned by levsno private :: list_index ! Find index of field in exclude list private :: set_hist_filename ! Determine history dataset filenames @@ -333,6 +334,8 @@ subroutine hist_printflds() integer width_col_sum ! widths of columns summed, including spaces character(len=3) str_width_col(ncol) ! string version of width_col character(len=3) str_w_col_sum ! string version of width_col_sum + character(len=7) file_identifier ! fates identifier used in file_name + character(len=23) file_name ! master_list_file.rst with or without fates character(len=99) fmt_txt ! format statement character(len=*),parameter :: subname = 'CLM_hist_printflds' !----------------------------------------------------------------------- @@ -377,14 +380,29 @@ subroutine hist_printflds() ! Open master_list_file master_list_file = getavu() ! get next available file unit number - open(unit = master_list_file, file = 'master_list_file.rst', & - status = 'new', action = 'write', form = 'formatted') + if (use_fates) then + file_identifier = 'fates' + else + file_identifier = 'nofates' + end if + file_name = 'master_list_' // trim(file_identifier) // '.rst' + open(unit = master_list_file, file = file_name, & + status = 'replace', action = 'write', form = 'formatted') ! File title fmt_txt = '(a)' - write(master_list_file,fmt_txt) '===================' - write(master_list_file,fmt_txt) 'CTSM History Fields' - write(master_list_file,fmt_txt) '===================' + write(master_list_file,fmt_txt) '=============================' + write(master_list_file,fmt_txt) 'CTSM History Fields (' // trim(file_identifier) // ')' + write(master_list_file,fmt_txt) '=============================' + write(master_list_file,*) + + ! A warning message and flags from the current CTSM case + write(master_list_file,fmt_txt) 'CAUTION: Not all variables are relevant / present for all CTSM cases.' + write(master_list_file,fmt_txt) 'Key flags used in this CTSM case:' + fmt_txt = '(a,l)' + write(master_list_file,fmt_txt) 'use_cn = ', use_cn + write(master_list_file,fmt_txt) 'use_crop = ', use_crop + write(master_list_file,fmt_txt) 'use_fates = ', use_fates write(master_list_file,*) ! Table header @@ -1286,7 +1304,9 @@ subroutine hist_update_hbuf_field_1d (t, f, bounds) ! ! !USES: use subgridAveMod , only : p2g, c2g, l2g, p2l, c2l, p2c - use decompMod , only : BOUNDS_LEVEL_PROC + use decompMod , only : bounds_level_proc + use clm_varcon , only : degpsec, isecspday + use clm_time_manager, only : get_curr_date ! ! !ARGUMENTS: integer, intent(in) :: t ! tape index @@ -1315,9 +1335,20 @@ subroutine hist_update_hbuf_field_1d (t, f, bounds) integer j character(len=*),parameter :: subname = 'hist_update_hbuf_field_1d' integer k_offset ! offset for mapping sliced subarray pointers when outputting variables in PFT/col vector form + integer :: year ! year (0, ...) for nstep + integer :: month ! month (1, ..., 12) for nstep + integer :: day ! day of month (1, ..., 31) for nstep + integer :: secs ! seconds into current date for nstep + integer :: local_secpl ! seconds into current date in local time + integer :: tod ! Desired local solar time of output in seconds + integer :: weight ! Weight for linear interpolation in time for local time avgflag + integer, allocatable :: grid_index(:) ! Grid cell index for longitude + integer, allocatable :: tods(:) + character(len=1) :: avgflag_trim ! first character of avgflag + !----------------------------------------------------------------------- - SHR_ASSERT_FL(bounds%level == BOUNDS_LEVEL_PROC, sourcefile, __LINE__) + SHR_ASSERT_FL(bounds%level == bounds_level_proc, sourcefile, __LINE__) avgflag = tape(t)%hlist(f)%avgflag nacs => tape(t)%hlist(f)%nacs @@ -1334,6 +1365,8 @@ subroutine hist_update_hbuf_field_1d (t, f, bounds) hpindex = tape(t)%hlist(f)%field%hpindex field => clmptr_rs(hpindex)%ptr + call get_curr_date (year, month, day, secs) + ! set variables to check weights when allocate all pfts map2gcell = .false. @@ -1419,7 +1452,8 @@ subroutine hist_update_hbuf_field_1d (t, f, bounds) if (map2gcell) then ! Map to gridcell ! note that in this case beg1d = begg and end1d=endg - select case (avgflag) + avgflag_trim = avgflag(1:1) + select case (avgflag_trim) case ('I') ! Instantaneous do k = beg1d_out, end1d_out if (field_gcell(k) /= spval) then @@ -1429,7 +1463,7 @@ subroutine hist_update_hbuf_field_1d (t, f, bounds) end if nacs(k,1) = 1 end do - case ('A', 'SUM') ! Time average / sum + case ('A', 'S') ! Time average / sum do k = beg1d_out, end1d_out if (field_gcell(k) /= spval) then if (nacs(k,1) == 0) hbuf(k,1) = 0._r8 @@ -1459,6 +1493,22 @@ subroutine hist_update_hbuf_field_1d (t, f, bounds) endif nacs(k,1) = 1 end do + case ('L') ! Local solar time + read(avgflag(2:6), *) tod + do k = beg1d_out, end1d_out + if (field_gcell(k) /= spval) then + local_secpl = secs + grc%londeg(k)/degpsec + local_secpl = mod(local_secpl,isecspday) + weight = calc_weight_local_time(local_secpl, tod) + if (weight > 0) then + if (nacs(k,1) == 0) hbuf(k,1) = 0._r8 + hbuf(k,1) = hbuf(k,1) + field_gcell(k)*real(weight) + nacs(k,1) = nacs(k,1) + weight + end if + else + if (nacs(k,1) == 0) hbuf(k,1) = spval + end if + end do case default write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag call endrun(msg=errMsg(sourcefile, __LINE__)) @@ -1467,22 +1517,29 @@ subroutine hist_update_hbuf_field_1d (t, f, bounds) else ! Do not map to gridcell + allocate( grid_index(beg1d:end1d) ) + ! For data defined on the pft, col or landunit, we need to check if a point is active ! to determine whether that point should be assigned spval if (type1d == namep) then check_active = .true. active => patch%active + grid_index = patch%gridcell else if (type1d == namec) then check_active = .true. active => col%active + grid_index = col%gridcell else if (type1d == namel) then check_active = .true. active =>lun%active + grid_index = lun%gridcell else check_active = .false. end if - select case (avgflag) + avgflag_trim = avgflag(1:1) + + select case (avgflag_trim) case ('I') ! Instantaneous do k = beg1d,end1d valid = .true. @@ -1500,7 +1557,7 @@ subroutine hist_update_hbuf_field_1d (t, f, bounds) end if nacs(k,1) = 1 end do - case ('A', 'SUM') ! Time average / sum + case ('A', 'S') ! Time average / sum ! create mappings for array slice pointers (which go from 1 to size(field) rather than beg1d to end1d) if ( end1d .eq. ubound(field,1) ) then k_offset = 0 @@ -1560,6 +1617,36 @@ subroutine hist_update_hbuf_field_1d (t, f, bounds) end if nacs(k,1) = 1 end do + case ('L') ! Local solar time + read(avgflag(2:6), *) tod + if ( end1d .eq. ubound(field,1) ) then + k_offset = 0 + else + k_offset = 1 - beg1d + endif + do k = beg1d, end1d + valid = .true. + if (check_active) then + if (.not. active(k)) then + valid = .false. + else + local_secpl = secs + grc%londeg(grid_index(k))/degpsec + end if + else + local_secpl = secs + grc%londeg(k)/degpsec + end if + local_secpl = mod(local_secpl,isecspday) + if (valid) then + weight = calc_weight_local_time(local_secpl, tod) + if (weight > 0 .and. field(k+k_offset) /= spval) then + if (nacs(k,1) == 0) hbuf(k,1) = 0._r8 + hbuf(k,1) = hbuf(k,1) + field(k+k_offset)*real(weight) + nacs(k,1) = nacs(k,1) + weight + end if + else + if (nacs(k,1) == 0) hbuf(k,1) = spval + end if + end do case default write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag call endrun(msg=errMsg(sourcefile, __LINE__)) @@ -1580,8 +1667,10 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) ! ! !USES: use subgridAveMod , only : p2g, c2g, l2g, p2l, c2l, p2c - use decompMod , only : BOUNDS_LEVEL_PROC + use decompMod , only : bounds_level_proc use clm_varctl , only : iulog + use clm_varcon , only : degpsec, isecspday + use clm_time_manager, only : get_curr_date ! ! !ARGUMENTS: integer, intent(in) :: t ! tape index @@ -1613,9 +1702,20 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) !(this refers to a point being active, NOT a history field being active) real(r8), allocatable :: field_gcell(:,:) ! gridcell level field (used if mapping to gridcell is done) character(len=*),parameter :: subname = 'hist_update_hbuf_field_2d' + integer :: year ! year (0, ...) for nstep + integer :: month ! month (1, ..., 12) for nstep + integer :: day ! day of month (1, ..., 31) for nstep + integer :: secs ! seconds into current date for nstep + integer :: local_secpl ! seconds into current date in local time + integer :: tod ! Desired local solar time of output in seconds + integer :: weight ! Weight for linear interpolation in time for local time avgflag + integer, allocatable :: grid_index(:) ! Grid cell index for longitude + integer, allocatable :: tods(:) + character(len=1) :: avgflag_trim ! first character of avgflag + !----------------------------------------------------------------------- - SHR_ASSERT_FL(bounds%level == BOUNDS_LEVEL_PROC, sourcefile, __LINE__) + SHR_ASSERT_FL(bounds%level == bounds_level_proc, sourcefile, __LINE__) avgflag = tape(t)%hlist(f)%avgflag nacs => tape(t)%hlist(f)%nacs @@ -1632,6 +1732,7 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) no_snow_behavior = tape(t)%hlist(f)%field%no_snow_behavior hpindex = tape(t)%hlist(f)%field%hpindex + call get_curr_date (year, month, day, secs) if (no_snow_behavior /= no_snow_unset) then ! For multi-layer snow fields, build a special output variable that handles @@ -1652,7 +1753,7 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) call hist_set_snow_field_2d(field, clmptr_ra(hpindex)%ptr, no_snow_behavior, type1d, & beg1d, end1d) else - + field => clmptr_ra(hpindex)%ptr(:,1:num2d) field_allocated = .false. end if @@ -1739,8 +1840,9 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) if (map2gcell) then ! Map to gridcell + avgflag_trim = avgflag(1:1) ! note that in this case beg1d = begg and end1d=endg - select case (avgflag) + select case (avgflag_trim) case ('I') ! Instantaneous do j = 1,num2d do k = beg1d_out, end1d_out @@ -1752,7 +1854,7 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) nacs(k,j) = 1 end do end do - case ('A', 'SUM') ! Time average / sum + case ('A', 'S') ! Time average / sum do j = 1,num2d do k = beg1d_out, end1d_out if (field_gcell(k,j) /= spval) then @@ -1788,6 +1890,24 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) nacs(k,j) = 1 end do end do + case ('L') ! Local solar time + read(avgflag(2:6), *) tod + do j = 1,num2d + do k = beg1d_out, end1d_out + if (field_gcell(k,j) /= spval) then + local_secpl = secs + grc%londeg(k)/degpsec + local_secpl = mod(local_secpl,isecspday) + weight = calc_weight_local_time(local_secpl, tod) + if (weight > 0) then + if (nacs(k,j) == 0) hbuf(k,j) = 0._r8 + hbuf(k,j) = hbuf(k,j) + field_gcell(k,j)*real(weight) + nacs(k,j) = nacs(k,j) + weight + end if + else + if (nacs(k,j) == 0) hbuf(k,j) = spval + end if + end do + end do case default write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag call endrun(msg=errMsg(sourcefile, __LINE__)) @@ -1801,12 +1921,18 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) if (type1d == namep) then check_active = .true. active => patch%active + allocate(grid_index(bounds%begg:bounds%endg) ) + grid_index = patch%gridcell else if (type1d == namec) then check_active = .true. active => col%active + allocate(grid_index(bounds%begg:bounds%endg) ) + grid_index = col%gridcell else if (type1d == namel) then check_active = .true. active =>lun%active + allocate(grid_index(bounds%begg:bounds%endg) ) + grid_index = lun%gridcell else check_active = .false. end if @@ -1814,8 +1940,8 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) ! Note that since field points to an array section the ! bounds are field(1:end1d-beg1d+1, num2d) - therefore ! need to do the shifting below - - select case (avgflag) + avgflag_trim = avgflag(1:1) + select case (avgflag_trim) case ('I') ! Instantaneous do j = 1,num2d do k = beg1d,end1d @@ -1835,7 +1961,7 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) nacs(k,j) = 1 end do end do - case ('A', 'SUM') ! Time average / sum + case ('A', 'S') ! Time average / sum do j = 1,num2d do k = beg1d,end1d valid = .true. @@ -1895,6 +2021,33 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) nacs(k,j) = 1 end do end do + case ('L') ! Local solar time + read(avgflag(2:6), *) tod + do j = 1,num2d + do k = beg1d, end1d + valid = .true. + if (check_active) then + if (.not. active(k)) then + valid = .false. + else + local_secpl = secs + grc%londeg(grid_index(k))/degpsec + end if + else + local_secpl = secs + grc%londeg(k)/degpsec + end if + local_secpl = mod(local_secpl,isecspday) + if (valid) then + weight = calc_weight_local_time(local_secpl, tod) + if (weight > 0 .and. field(k-beg1d+1,j) /= spval) then + if (nacs(k,j) == 0) hbuf(k,j) = 0._r8 + hbuf(k,j) = hbuf(k,j) + field(k-beg1d+1,j)*real(weight) + nacs(k,j) = nacs(k,j) + weight + end if + else + if (nacs(k,j) == 0) hbuf(k,j) = spval + end if + end do + end do case default write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag call endrun(msg=errMsg(sourcefile, __LINE__)) @@ -1907,6 +2060,43 @@ subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) end subroutine hist_update_hbuf_field_2d + !----------------------------------------------------------------------- + function calc_weight_local_time(local_secpl, tod) result(weight) + ! + ! !DESCRIPTION: + ! Calculates weight for linear intepolation in time for local time + ! average flag + ! + ! !USES: + use clm_varcon , only : isecspday + use clm_time_manager, only : get_step_size + ! + ! !ARGUMENTS: + integer :: weight ! function result + integer, intent(inout) :: local_secpl ! seconds into current date in local time + integer, intent(in) :: tod ! Desired local solar time of output in seconds + + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'calc_weight_local_time' + integer :: dtime ! timestep size [seconds] + !----------------------------------------------------------------------- + + weight = 0 + dtime = get_step_size() + + if (tod < dtime .and. local_secpl > isecspday-dtime ) then + local_secpl = local_secpl - isecspday + end if + if (local_secpl >= tod - dtime .and. local_secpl < tod ) then + weight = dtime-tod+local_secpl + else if (local_secpl >= tod .and. local_secpl < tod + dtime ) then + weight = dtime+tod-local_secpl + end if + + end function calc_weight_local_time + !----------------------------------------------------------------------- subroutine hist_set_snow_field_2d (field_out, field_in, no_snow_behavior, type1d, beg1d, end1d) ! @@ -2039,7 +2229,7 @@ subroutine hfields_normalize (t) nacs => tape(t)%hlist(f)%nacs hbuf => tape(t)%hlist(f)%hbuf - if (avgflag == 'A') then + if (avgflag == 'A' .or. avgflag(1:1) == 'L') then aflag = .true. else aflag = .false. @@ -2049,6 +2239,8 @@ subroutine hfields_normalize (t) do k = beg1d, end1d if (aflag .and. nacs(k,j) /= 0) then hbuf(k,j) = hbuf(k,j) / float(nacs(k,j)) + elseif (avgflag(1:1) == 'L' .and. nacs(k,j) == 0) then + hbuf(k,j) = spval end if end do end do @@ -2246,7 +2438,7 @@ subroutine htape_create (t, histrest) call ncd_defdim(lnfid, 'string_length', hist_dim_name_length, strlen_dimid) call ncd_defdim(lnfid, 'scale_type_string_length', scale_type_strlen, dimid) call ncd_defdim( lnfid, 'levdcmp', nlevdecomp_full, dimid) - + if(use_fates)then call ncd_defdim(lnfid, 'fates_levscag', nlevsclass * nlevage, dimid) @@ -2400,7 +2592,8 @@ end subroutine htape_add_cft_metadata !----------------------------------------------------------------------- subroutine htape_timeconst3D(t, & - bounds, watsat_col, sucsat_col, bsw_col, hksat_col, mode) + bounds, watsat_col, sucsat_col, bsw_col, hksat_col, & + cellsand_col, cellclay_col, mode) ! ! !DESCRIPTION: ! Write time constant 3D variables to history tapes. @@ -2411,7 +2604,7 @@ subroutine htape_timeconst3D(t, & ! ! !USES: use subgridAveMod , only : c2g - use clm_varpar , only : nlevgrnd ,nlevlak, nlevmaxurbgrnd + use clm_varpar , only : nlevgrnd ,nlevlak, nlevmaxurbgrnd, nlevsoi use shr_string_mod , only : shr_string_listAppend use domainMod , only : ldomain ! @@ -2422,6 +2615,8 @@ subroutine htape_timeconst3D(t, & real(r8) , intent(in) :: sucsat_col( bounds%begc:,1: ) real(r8) , intent(in) :: bsw_col( bounds%begc:,1: ) real(r8) , intent(in) :: hksat_col( bounds%begc:,1: ) + real(r8) , intent(in) :: cellsand_col( bounds%begc:,1: ) + real(r8) , intent(in) :: cellclay_col( bounds%begc:,1: ) character(len=*) , intent(in) :: mode ! 'define' or 'write' ! ! !LOCAL VARIABLES: @@ -2467,7 +2662,14 @@ subroutine htape_timeconst3D(t, & character(len=*),parameter :: varnamesl(nfldsl) = (/ & 'ZLAKE ', & 'DZLAKE' & - /) + /) + real(r8), pointer :: histit(:,:) ! temporary + real(r8), pointer :: histot(:,:) + integer, parameter :: nfldst = 2 + character(len=*),parameter :: varnamest(nfldst) = (/ & + 'PCT_SAND ', & + 'PCT_CLAY ' & + /) ! Scale type for subgrid averaging of landunits to grid cells, for lake fields character(len=scale_type_strlen) :: l2g_scale_typel(nfldsl) = [ & 'lake', & ! ZLAKE @@ -2475,10 +2677,12 @@ subroutine htape_timeconst3D(t, & ] !----------------------------------------------------------------------- - SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(sucsat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(bsw_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(hksat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(sucsat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(bsw_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(hksat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(cellsand_col) == (/bounds%endc, nlevsoi/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(cellclay_col) == (/bounds%endc, nlevsoi/)), sourcefile, __LINE__) !------------------------------------------------------------------------------- !*** Non-time varying 3D fields *** @@ -2672,6 +2876,85 @@ subroutine htape_timeconst3D(t, & end if ! (define/write mode + if (mode == 'define') then + do ifld = 1,nfldst + ! Field indices MUST match varnamest array order above! + if (ifld == 1) then + long_name='percent sand'; units = 'percent' + else if (ifld == 2) then + long_name='percent clay'; units = 'percent' + else + call endrun(msg=' ERROR: bad 3D time-constant field index'//errMsg(sourcefile, __LINE__)) + end if + if (tape(t)%dov2xy) then + if (ldomain%isgrid2d) then + call ncd_defvar(ncid=nfid(t), varname=trim(varnamest(ifld)), xtype=tape(t)%ncprec,& + dim1name='lon', dim2name='lat', dim3name='levsoi', & + long_name=long_name, units=units, missing_value=spval, fill_value=spval) + else + call ncd_defvar(ncid=nfid(t), varname=trim(varnamest(ifld)), xtype=tape(t)%ncprec, & + dim1name=grlnd, dim2name='levsoi', & + long_name=long_name, units=units, missing_value=spval, fill_value=spval) + end if + else + call ncd_defvar(ncid=nfid(t), varname=trim(varnamest(ifld)), xtype=tape(t)%ncprec, & + dim1name=namec, dim2name='levsoi', & + long_name=long_name, units=units, missing_value=spval, fill_value=spval) + end if + call shr_string_listAppend(TimeConst3DVars,varnamest(ifld)) + end do + + else if (mode == 'write') then + + allocate(histit(bounds%begc:bounds%endc,nlevsoi), stat=ier) + if (ier /= 0) then + write(iulog,*) trim(subname),' ERROR: allocation error for histit' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + + ! Write time constant fields + + if (tape(t)%dov2xy) then + allocate(histot(bounds%begg:bounds%endg,nlevsoi), stat=ier) + if (ier /= 0) then + write(iulog,*) trim(subname),' ERROR: allocation error for histot' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end if + + do ifld = 1,nfldst + histit(:,:) = spval + do lev = 1,nlevsoi + do c = bounds%begc,bounds%endc + ! Field indices MUST match varnamesl array order above! + if (ifld ==1) histit(c,lev) = cellsand_col(c,lev) + if (ifld ==2) histit(c,lev) = cellclay_col(c,lev) + end do + end do + if (tape(t)%dov2xy) then + histot(:,:) = spval + call c2g(bounds, nlevsoi, & + histit(bounds%begc:bounds%endc, :), & + histot(bounds%begg:bounds%endg, :), & + c2l_scale_type='unity', l2g_scale_type='veg') + if (ldomain%isgrid2d) then + call ncd_io(varname=trim(varnamest(ifld)), dim1name=grlnd, & + data=histot, ncid=nfid(t), flag='write') + else + call ncd_io(varname=trim(varnamest(ifld)), dim1name=grlnd, & + data=histot, ncid=nfid(t), flag='write') + end if + else + call ncd_io(varname=trim(varnamest(ifld)), dim1name=namec, & + data=histit, ncid=nfid(t), flag='write') + end if + end do + + if (tape(t)%dov2xy) deallocate(histot) + deallocate(histit) + + end if ! (define/write mode + end subroutine htape_timeconst3D !----------------------------------------------------------------------- @@ -2680,6 +2963,7 @@ subroutine htape_timeconst(t, mode) ! !DESCRIPTION: ! Write time constant values to primary history tape. use clm_time_manager, only : get_step_size + use SoilBiogeochemDecompCascadeConType, only : decomp_method, no_soil_decomp ! Issue the required netcdf wrapper calls to define the history file ! contents. ! @@ -2844,7 +3128,7 @@ subroutine htape_timeconst(t, mode) call ncd_io(varname='levgrnd', data=zsoi, ncid=nfid(t), flag='write') call ncd_io(varname='levsoi', data=zsoi(1:nlevsoi), ncid=nfid(t), flag='write') call ncd_io(varname='levlak' , data=zlak, ncid=nfid(t), flag='write') - if (use_vertsoilc) then + if ( decomp_method /= no_soil_decomp )then call ncd_io(varname='levdcmp', data=zsoi, ncid=nfid(t), flag='write') else zsoi_1d(1) = 1._r8 @@ -3175,7 +3459,7 @@ subroutine hfields_write(t, mode) if (mode == 'define') then - select case (avgflag) + select case (avgflag(1:1)) case ('A') avgstr = 'mean' case ('I') @@ -3184,8 +3468,10 @@ subroutine hfields_write(t, mode) avgstr = 'maximum' case ('M') avgstr = 'minimum' - case ('SUM') + case ('S') avgstr = 'sum' + case ('L') + avgstr = 'local solar time' case default write(iulog,*) trim(subname),' ERROR: unknown time averaging flag (avgflag)=',avgflag call endrun(msg=errMsg(sourcefile, __LINE__)) @@ -3282,7 +3568,7 @@ subroutine hfields_1dinfo(t, mode) ! Write/define 1d info for history tape. ! ! !USES: - use decompMod , only : ldecomp + use decompMod , only : gindex_global use domainMod , only : ldomain, ldomain ! ! !ARGUMENTS: @@ -3294,6 +3580,7 @@ subroutine hfields_1dinfo(t, mode) integer :: k ! 1d index integer :: g,c,l,p ! indices integer :: ier ! errir status + integer :: gindex ! global gridcell index real(r8), pointer :: rgarr(:) ! temporary real(r8), pointer :: rcarr(:) ! temporary real(r8), pointer :: rlarr(:) ! temporary @@ -3302,7 +3589,7 @@ subroutine hfields_1dinfo(t, mode) integer , pointer :: icarr(:) ! temporary integer , pointer :: ilarr(:) ! temporary integer , pointer :: iparr(:) ! temporary - type(file_desc_t), pointer :: ncid ! netcdf file + type(file_desc_t), pointer :: ncid ! netcdf file type(bounds_type) :: bounds character(len=*),parameter :: subname = 'hfields_1dinfo' !----------------------------------------------------------------------- @@ -3463,11 +3750,13 @@ subroutine hfields_1dinfo(t, mode) call ncd_io(varname='grid1d_lon', data=grc%londeg, dim1name=nameg, ncid=ncid, flag='write') call ncd_io(varname='grid1d_lat', data=grc%latdeg, dim1name=nameg, ncid=ncid, flag='write') do g = bounds%begg,bounds%endg - igarr(g)= mod(ldecomp%gdc2glo(g)-1,ldomain%ni) + 1 + gindex = gindex_global(g-bounds%begg+1) + igarr(g)= mod(gindex-1,ldomain%ni) + 1 enddo call ncd_io(varname='grid1d_ixy', data=igarr , dim1name=nameg, ncid=ncid, flag='write') do g = bounds%begg,bounds%endg - igarr(g)= (ldecomp%gdc2glo(g) - 1)/ldomain%ni + 1 + gindex = gindex_global(g-bounds%begg+1) + igarr(g)= (gindex-1)/ldomain%ni + 1 enddo call ncd_io(varname='grid1d_jxy', data=igarr , dim1name=nameg, ncid=ncid, flag='write') @@ -3482,14 +3771,17 @@ subroutine hfields_1dinfo(t, mode) enddo call ncd_io(varname='land1d_lat', data=rlarr, dim1name=namel, ncid=ncid, flag='write') do l= bounds%begl,bounds%endl - ilarr(l) = mod(ldecomp%gdc2glo(lun%gridcell(l))-1,ldomain%ni) + 1 + gindex = gindex_global(lun%gridcell(l)-bounds%begg+1) + ilarr(l) = mod(gindex-1,ldomain%ni) + 1 enddo call ncd_io(varname='land1d_ixy', data=ilarr, dim1name=namel, ncid=ncid, flag='write') do l = bounds%begl,bounds%endl - ilarr(l) = (ldecomp%gdc2glo(lun%gridcell(l))-1)/ldomain%ni + 1 + gindex = gindex_global(lun%gridcell(l)-bounds%begg+1) + ilarr(l) = (gindex-1)/ldomain%ni + 1 enddo call ncd_io(varname='land1d_jxy' , data=ilarr , dim1name=namel, ncid=ncid, flag='write') - ilarr = GetGlobalIndexArray(lun%gridcell(bounds%begl:bounds%endl), bounds%begl, bounds%endl, clmlevel=nameg) + ilarr = get_global_index_array(lun%gridcell(bounds%begl:bounds%endl), bounds%begl, bounds%endl, & + subgrid_level=subgrid_level_gridcell) call ncd_io(varname='land1d_gi' , data=ilarr, dim1name=namel, ncid=ncid, flag='write') call ncd_io(varname='land1d_wtgcell' , data=lun%wtgcell , dim1name=namel, ncid=ncid, flag='write') call ncd_io(varname='land1d_ityplunit', data=lun%itype , dim1name=namel, ncid=ncid, flag='write') @@ -3506,16 +3798,20 @@ subroutine hfields_1dinfo(t, mode) enddo call ncd_io(varname='cols1d_lat', data=rcarr, dim1name=namec, ncid=ncid, flag='write') do c = bounds%begc,bounds%endc - icarr(c) = mod(ldecomp%gdc2glo(col%gridcell(c))-1,ldomain%ni) + 1 + gindex = gindex_global(col%gridcell(c)-bounds%begg+1) + icarr(c) = mod(gindex-1,ldomain%ni) + 1 enddo call ncd_io(varname='cols1d_ixy', data=icarr, dim1name=namec, ncid=ncid, flag='write') do c = bounds%begc,bounds%endc - icarr(c) = (ldecomp%gdc2glo(col%gridcell(c))-1)/ldomain%ni + 1 + gindex = gindex_global(col%gridcell(c)-bounds%begg+1) + icarr(c) = (gindex-1)/ldomain%ni + 1 enddo call ncd_io(varname='cols1d_jxy' , data=icarr ,dim1name=namec, ncid=ncid, flag='write') - icarr = GetGlobalIndexArray(col%gridcell(bounds%begc:bounds%endc), bounds%begc, bounds%endc, clmlevel=nameg) + icarr = get_global_index_array(col%gridcell(bounds%begc:bounds%endc), bounds%begc, bounds%endc, & + subgrid_level=subgrid_level_gridcell) call ncd_io(varname='cols1d_gi' , data=icarr, dim1name=namec, ncid=ncid, flag='write') - icarr = GetGlobalIndexArray(col%landunit(bounds%begc:bounds%endc), bounds%begc, bounds%endc, clmlevel=namel) + icarr = get_global_index_array(col%landunit(bounds%begc:bounds%endc), bounds%begc, bounds%endc, & + subgrid_level=subgrid_level_landunit) call ncd_io(varname='cols1d_li', data=icarr , dim1name=namec, ncid=ncid, flag='write') call ncd_io(varname='cols1d_wtgcell', data=col%wtgcell , dim1name=namec, ncid=ncid, flag='write') @@ -3540,19 +3836,24 @@ subroutine hfields_1dinfo(t, mode) enddo call ncd_io(varname='pfts1d_lat', data=rparr, dim1name=namep, ncid=ncid, flag='write') do p = bounds%begp,bounds%endp - iparr(p) = mod(ldecomp%gdc2glo(patch%gridcell(p))-1,ldomain%ni) + 1 + gindex = gindex_global(patch%gridcell(p)-bounds%begg+1) + iparr(p) = mod(gindex-1,ldomain%ni) + 1 enddo call ncd_io(varname='pfts1d_ixy', data=iparr, dim1name=namep, ncid=ncid, flag='write') do p = bounds%begp,bounds%endp - iparr(p) = (ldecomp%gdc2glo(patch%gridcell(p))-1)/ldomain%ni + 1 + gindex = gindex_global(patch%gridcell(p)-bounds%begg+1) + iparr(p) = (gindex-1)/ldomain%ni + 1 enddo call ncd_io(varname='pfts1d_jxy' , data=iparr , dim1name=namep, ncid=ncid, flag='write') - iparr = GetGlobalIndexArray(patch%gridcell(bounds%begp:bounds%endp), bounds%begp, bounds%endp, clmlevel=nameg) + iparr = get_global_index_array(patch%gridcell(bounds%begp:bounds%endp), bounds%begp, bounds%endp, & + subgrid_level=subgrid_level_gridcell) call ncd_io(varname='pfts1d_gi' , data=iparr, dim1name=namep, ncid=ncid, flag='write') - iparr = GetGlobalIndexArray(patch%landunit(bounds%begp:bounds%endp), bounds%begp, bounds%endp, clmlevel=namel) + iparr = get_global_index_array(patch%landunit(bounds%begp:bounds%endp), bounds%begp, bounds%endp, & + subgrid_level=subgrid_level_landunit) call ncd_io(varname='pfts1d_li' , data=iparr, dim1name=namep, ncid=ncid, flag='write') - iparr = GetGlobalIndexArray(patch%column(bounds%begp:bounds%endp), bounds%begp, bounds%endp, clmlevel=namec) + iparr = get_global_index_array(patch%column(bounds%begp:bounds%endp), bounds%begp, bounds%endp, & + subgrid_level=subgrid_level_column) call ncd_io(varname='pfts1d_ci' , data=iparr , dim1name=namep, ncid=ncid, flag='write') call ncd_io(varname='pfts1d_wtgcell' , data=patch%wtgcell , dim1name=namep, ncid=ncid, flag='write') @@ -3581,7 +3882,7 @@ end subroutine hfields_1dinfo !----------------------------------------------------------------------- subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & - watsat_col, sucsat_col, bsw_col, hksat_col) + watsat_col, sucsat_col, bsw_col, hksat_col, cellsand_col, cellclay_col) ! ! !DESCRIPTION: ! Write history tape(s) @@ -3607,7 +3908,7 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time, get_prev_date use clm_varcon , only : secspday use perf_mod , only : t_startf, t_stopf - use clm_varpar , only : nlevgrnd, nlevmaxurbgrnd + use clm_varpar , only : nlevgrnd, nlevmaxurbgrnd, nlevsoi ! ! !ARGUMENTS: logical, intent(in) :: rstwr ! true => write restart file this step @@ -3617,6 +3918,8 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & real(r8) , intent(in) :: sucsat_col( bounds%begc:,1: ) real(r8) , intent(in) :: bsw_col( bounds%begc:,1: ) real(r8) , intent(in) :: hksat_col( bounds%begc:,1: ) + real(r8) , intent(in) :: cellsand_col( bounds%begc:,1: ) + real(r8) , intent(in) :: cellclay_col( bounds%begc:,1: ) ! ! !LOCAL VARIABLES: integer :: t ! tape index @@ -3640,10 +3943,12 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & character(len=*),parameter :: subname = 'hist_htapes_wrapup' !----------------------------------------------------------------------- - SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(sucsat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(bsw_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(hksat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(sucsat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(bsw_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(hksat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(cellsand_col) == (/bounds%endc, nlevsoi/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(cellclay_col) == (/bounds%endc, nlevsoi/)), sourcefile, __LINE__) ! get current step @@ -3716,7 +4021,8 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & ! Define 3D time-constant field variables on first history tapes if ( do_3Dtconst) then call htape_timeconst3D(t, & - bounds, watsat_col, sucsat_col, bsw_col, hksat_col, mode='define') + bounds, watsat_col, sucsat_col, bsw_col, hksat_col, & + cellsand_col, cellclay_col, mode='define') TimeConst3DVars_Filename = trim(locfnh(t)) end if @@ -3735,7 +4041,8 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & ! Write 3D time constant history variables to first history tapes if ( do_3Dtconst .and. tape(t)%ntimes == 1 )then call htape_timeconst3D(t, & - bounds, watsat_col, sucsat_col, bsw_col, hksat_col, mode='write') + bounds, watsat_col, sucsat_col, bsw_col, hksat_col, & + cellsand_col, cellclay_col, mode='write') do_3Dtconst = .false. end if @@ -4678,7 +4985,7 @@ character(len=max_namlen) function getname (inname) end function getname !----------------------------------------------------------------------- - character(len=1) function getflag (inname) + character(len=avgflag_strlen) function getflag (inname) ! ! !DESCRIPTION: ! Retrieve flag portion of inname. If an averaging flag separater character @@ -4703,7 +5010,7 @@ character(len=1) function getflag (inname) getflag = ' ' do i = 1,length if (inname(i:i) == ':') then - getflag = inname(i+1:i+1) + getflag = trim(inname(i+1:length)) exit end if end do @@ -5186,7 +5493,7 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, ! History buffer pointer hpindex = pointer_index() - + if (present(ptr_lnd)) then l_type1d = grlnd @@ -5546,6 +5853,8 @@ function avgflag_valid(avgflag, blank_valid) result(valid) ! Returns true if the given avgflag is a valid option, false if not ! ! !USES: + use clm_varcon , only : isecspday + use clm_time_manager, only : get_step_size ! ! !ARGUMENTS: logical :: valid ! function result @@ -5555,6 +5864,8 @@ function avgflag_valid(avgflag, blank_valid) result(valid) ! !LOCAL VARIABLES: character(len=*), parameter :: subname = 'avgflag_valid' + integer :: tod ! Desired local solar time of output in seconds + integer :: dtime ! timestep size [seconds] !----------------------------------------------------------------------- ! This initial check is mainly here to catch the possibility that someone has added a @@ -5568,6 +5879,22 @@ function avgflag_valid(avgflag, blank_valid) result(valid) avgflag == 'X' .or. avgflag == 'M' .or. & avgflag == 'SUM') then valid = .true. + else if (avgflag(1:1) == 'L') then + dtime = get_step_size() + if ( len_trim(avgflag) < 6 )then + valid = .false. + else + read(avgflag(2:6), *) tod + if (tod >= 0 .and. tod <= isecspday) then + valid = .true. + if(tod < dtime .or. isecspday - tod <= dtime) then + write(iulog,*) 'Warning: Local time history output ', avgflag, ' is closer than ', & + 'dtime to midnight! This is problematic particularly for daily output.' + end if + else + valid = .false. + end if + end if else valid = .false. end if diff --git a/src/main/initGridCellsMod.F90 b/src/main/initGridCellsMod.F90 index eb34161f47..7a8a9404c0 100644 --- a/src/main/initGridCellsMod.F90 +++ b/src/main/initGridCellsMod.F90 @@ -18,7 +18,7 @@ module initGridCellsMod use abortutils , only : endrun use clm_varctl , only : iulog use clm_varcon , only : namep, namec, namel, nameg - use decompMod , only : bounds_type, ldecomp + use decompMod , only : bounds_type use GridcellType , only : grc use LandunitType , only : lun use ColumnType , only : col @@ -48,7 +48,7 @@ module initGridCellsMod contains !------------------------------------------------------------------------ - subroutine initGridcells(glc_behavior) + subroutine initGridcells(bounds_clump, glc_behavior) ! ! !DESCRIPTION: ! Initialize sub-grid mapping and allocates space for derived type hierarchy. @@ -56,7 +56,6 @@ subroutine initGridcells(glc_behavior) ! ! !USES use domainMod , only : ldomain - use decompMod , only : get_proc_bounds, get_clump_bounds, get_proc_clumps use subgridWeightsMod , only : compute_higher_order_weights use landunit_varcon , only : istsoil, istwet, istdlak, istice use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md, istcrop @@ -64,13 +63,11 @@ subroutine initGridcells(glc_behavior) use shr_const_mod , only : SHR_CONST_PI ! ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds_clump type(glc_behavior_type), intent(in) :: glc_behavior ! ! !LOCAL VARIABLES: integer :: nc,li,ci,pi,gdc ! indices - integer :: nclumps ! number of clumps on this processor - type(bounds_type) :: bounds_proc - type(bounds_type) :: bounds_clump !------------------------------------------------------------------------ ! Notes about how this routine is arranged, and its implications for the arrangement @@ -117,98 +114,86 @@ subroutine initGridcells(glc_behavior) ! Column: 1 1 2 2 3 3 4 4 5 5 6 6 ! Cohort: 1 2 1 2 1 2 1 2 1 2 1 2 - nclumps = get_proc_clumps() + ! For each land gridcell on global grid determine landunit, column and patch properties + + li = bounds_clump%begl-1 + ci = bounds_clump%begc-1 + pi = bounds_clump%begp-1 - ! FIX(SPM,032414) add private vars for cohort and perhaps patch dimension - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump, li, ci, pi, gdc) - do nc = 1, nclumps - - call get_clump_bounds(nc, bounds_clump) - - ! For each land gridcell on global grid determine landunit, column and patch properties - - li = bounds_clump%begl-1 - ci = bounds_clump%begc-1 - pi = bounds_clump%begp-1 - - ! Determine naturally vegetated landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_veg_compete( & - ltype=istsoil, gi=gdc, li=li, ci=ci, pi=pi) - end do - - ! Determine crop landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_crop_noncompete( & - ltype=istcrop, gi=gdc, li=li, ci=ci, pi=pi) - end do + ! Determine naturally vegetated landunit + do gdc = bounds_clump%begg,bounds_clump%endg + call set_landunit_veg_compete( & + ltype=istsoil, gi=gdc, li=li, ci=ci, pi=pi) + end do - ! Determine urban tall building district landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_urban( & - ltype=isturb_tbd, gi=gdc, li=li, ci=ci, pi=pi) + ! Determine crop landunit + do gdc = bounds_clump%begg,bounds_clump%endg + call set_landunit_crop_noncompete( & + ltype=istcrop, gi=gdc, li=li, ci=ci, pi=pi) + end do - end do + ! Determine urban tall building district landunit + do gdc = bounds_clump%begg,bounds_clump%endg + call set_landunit_urban( & + ltype=isturb_tbd, gi=gdc, li=li, ci=ci, pi=pi) - ! Determine urban high density landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_urban( & - ltype=isturb_hd, gi=gdc, li=li, ci=ci, pi=pi) - end do + end do - ! Determine urban medium density landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_urban( & - ltype=isturb_md, gi=gdc, li=li, ci=ci, pi=pi) - end do + ! Determine urban high density landunit + do gdc = bounds_clump%begg,bounds_clump%endg + call set_landunit_urban( & + ltype=isturb_hd, gi=gdc, li=li, ci=ci, pi=pi) + end do - ! Determine lake, wetland and glacier landunits - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_wet_lake( & - ltype=istdlak, gi=gdc, li=li, ci=ci, pi=pi) - end do + ! Determine urban medium density landunit + do gdc = bounds_clump%begg,bounds_clump%endg + call set_landunit_urban( & + ltype=isturb_md, gi=gdc, li=li, ci=ci, pi=pi) + end do - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_wet_lake( & - ltype=istwet, gi=gdc, li=li, ci=ci, pi=pi) - end do + ! Determine lake, wetland and glacier landunits + do gdc = bounds_clump%begg,bounds_clump%endg + call set_landunit_wet_lake( & + ltype=istdlak, gi=gdc, li=li, ci=ci, pi=pi) + end do - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_ice( & - glc_behavior = glc_behavior, & - ltype=istice, gi=gdc, li=li, ci=ci, pi=pi) - end do + do gdc = bounds_clump%begg,bounds_clump%endg + call set_landunit_wet_lake( & + ltype=istwet, gi=gdc, li=li, ci=ci, pi=pi) + end do - ! Ensure that we have set the expected number of patchs, cols and landunits for this clump - SHR_ASSERT_FL(li == bounds_clump%endl, sourcefile, __LINE__) - SHR_ASSERT_FL(ci == bounds_clump%endc, sourcefile, __LINE__) - SHR_ASSERT_FL(pi == bounds_clump%endp, sourcefile, __LINE__) + do gdc = bounds_clump%begg,bounds_clump%endg + call set_landunit_ice( & + glc_behavior = glc_behavior, & + ltype=istice, gi=gdc, li=li, ci=ci, pi=pi) + end do - ! Set some other gridcell-level variables + ! Ensure that we have set the expected number of patchs, cols and landunits for this clump + SHR_ASSERT_FL(li == bounds_clump%endl, sourcefile, __LINE__) + SHR_ASSERT_FL(ci == bounds_clump%endc, sourcefile, __LINE__) + SHR_ASSERT_FL(pi == bounds_clump%endp, sourcefile, __LINE__) - do gdc = bounds_clump%begg,bounds_clump%endg - grc%gindex(gdc) = ldecomp%gdc2glo(gdc) - grc%area(gdc) = ldomain%area(gdc) - grc%latdeg(gdc) = ldomain%latc(gdc) - grc%londeg(gdc) = ldomain%lonc(gdc) - grc%lat(gdc) = grc%latdeg(gdc) * SHR_CONST_PI/180._r8 - grc%lon(gdc) = grc%londeg(gdc) * SHR_CONST_PI/180._r8 - enddo + ! Set some other gridcell-level variables - ! Fill in subgrid datatypes + do gdc = bounds_clump%begg,bounds_clump%endg + grc%area(gdc) = ldomain%area(gdc) + grc%latdeg(gdc) = ldomain%latc(gdc) + grc%londeg(gdc) = ldomain%lonc(gdc) + grc%lat(gdc) = grc%latdeg(gdc) * SHR_CONST_PI/180._r8 + grc%lon(gdc) = grc%londeg(gdc) * SHR_CONST_PI/180._r8 + enddo - call clm_ptrs_compdown(bounds_clump) + ! Fill in subgrid datatypes - ! By putting this check within the loop over clumps, we ensure that (for example) - ! if a clump is responsible for landunit L, then that same clump is also - ! responsible for all columns and patchs in L. - call clm_ptrs_check(bounds_clump) + call clm_ptrs_compdown(bounds_clump) - ! Set patch%wtlunit, patch%wtgcell and col%wtgcell - call compute_higher_order_weights(bounds_clump) + ! By putting this check within the loop over clumps, we ensure that (for example) + ! if a clump is responsible for landunit L, then that same clump is also + ! responsible for all columns and patchs in L. + call clm_ptrs_check(bounds_clump) - end do - !$OMP END PARALLEL DO + ! Set patch%wtlunit, patch%wtgcell and col%wtgcell + call compute_higher_order_weights(bounds_clump) end subroutine initGridcells @@ -513,7 +498,6 @@ subroutine set_landunit_urban (ltype, gi, li, ci, pi) use subgridMod , only : subgrid_get_info_urban_tbd, subgrid_get_info_urban_hd use subgridMod , only : subgrid_get_info_urban_md use UrbanParamsType , only : urbinp - use decompMod , only : ldecomp use pftconMod , only : noveg ! ! !ARGUMENTS: diff --git a/src/main/initSubgridMod.F90 b/src/main/initSubgridMod.F90 index c2ad61c4bf..be30dae009 100644 --- a/src/main/initSubgridMod.F90 +++ b/src/main/initSubgridMod.F90 @@ -11,8 +11,7 @@ module initSubgridMod use spmdMod , only : masterproc use abortutils , only : endrun use clm_varctl , only : iulog, use_fates - use clm_varcon , only : namep, namec, namel - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_landunit, subgrid_level_column, subgrid_level_patch use GridcellType , only : grc use LandunitType , only : lun use ColumnType , only : col @@ -93,7 +92,7 @@ subroutine clm_ptrs_compdown(bounds) curc = patch%column(p) if (curc < bounds%begc .or. curc > bounds%endc) then write(iulog,*) 'clm_ptrs_compdown ERROR: pcolumn ',p,curc,bounds%begc,bounds%endc - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) endif col%patchi(curc) = p endif @@ -103,7 +102,7 @@ subroutine clm_ptrs_compdown(bounds) curl = patch%landunit(p) if (curl < bounds%begl .or. curl > bounds%endl) then write(iulog,*) 'clm_ptrs_compdown ERROR: plandunit ',p,curl,bounds%begl,bounds%endl - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) endif lun%patchi(curl) = p endif @@ -117,7 +116,7 @@ subroutine clm_ptrs_compdown(bounds) curl = col%landunit(c) if (curl < bounds%begl .or. curl > bounds%endl) then write(iulog,*) 'clm_ptrs_compdown ERROR: clandunit ',c,curl,bounds%begl,bounds%endl - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) endif lun%coli(curl) = c endif @@ -133,7 +132,7 @@ subroutine clm_ptrs_compdown(bounds) curg = lun%gridcell(l) if (curg < bounds%begg .or. curg > bounds%endg) then write(iulog,*) 'clm_ptrs_compdown ERROR: landunit_indices ', l,curg,bounds%begg,bounds%endg - call endrun(decomp_index=l, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errMsg(sourcefile, __LINE__)) end if if (grc%landunit_indices(ltype, curg) == ispval) then @@ -141,7 +140,7 @@ subroutine clm_ptrs_compdown(bounds) else write(iulog,*) 'clm_ptrs_compdown ERROR: This landunit type has already been set for this gridcell' write(iulog,*) 'l, ltype, curg = ', l, ltype, curg - call endrun(decomp_index=l, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errMsg(sourcefile, __LINE__)) end if end do @@ -241,7 +240,7 @@ subroutine clm_ptrs_check(bounds) if (lun%patchi(l) < lun%patchi(l-1)) error = .true. if (lun%patchf(l) < lun%patchf(l-1)) error = .true. if (error) then - call endrun(decomp_index=l, clmlevel=namel, & + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, & msg = 'clm_ptrs_check: l mono increasing - ERROR', & additional_msg = errMsg(sourcefile, __LINE__)) endif @@ -260,7 +259,7 @@ subroutine clm_ptrs_check(bounds) if (col%patchi(c) < col%patchi(c-1)) error = .true. if (col%patchf(c) < col%patchf(c-1)) error = .true. if (error) then - call endrun(decomp_index=c, clmlevel=namec, & + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & msg = 'clm_ptrs_check: c mono increasing - ERROR', & additional_msg = errMsg(sourcefile, __LINE__)) endif @@ -278,7 +277,7 @@ subroutine clm_ptrs_check(bounds) if (patch%landunit(p) < patch%landunit(p-1)) error = .true. if (patch%column (p) < patch%column (p-1)) error = .true. if (error) then - call endrun(decomp_index=p, clmlevel=namep, & + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, & msg = 'clm_ptrs_check: p mono increasing - ERROR', & additional_msg = errMsg(sourcefile, __LINE__)) endif @@ -295,7 +294,7 @@ subroutine clm_ptrs_check(bounds) if (lun%itype(l) /= ltype) error = .true. if (lun%gridcell(l) /= g) error = .true. if (error) then - call endrun(decomp_index=l, clmlevel=namel, & + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, & msg = 'clm_ptrs_check: tree consistent - ERROR', & additional_msg = errMsg(sourcefile, __LINE__)) endif @@ -303,7 +302,7 @@ subroutine clm_ptrs_check(bounds) if (col%gridcell(c) /= g) error = .true. if (col%landunit(c) /= l) error = .true. if (error) then - call endrun(decomp_index=c, clmlevel=namec, & + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & msg = 'clm_ptrs_check: tree consistent - ERROR', & additional_msg = errMsg(sourcefile, __LINE__)) endif @@ -312,7 +311,7 @@ subroutine clm_ptrs_check(bounds) if (patch%landunit(p) /= l) error = .true. if (patch%column(p) /= c) error = .true. if (error) then - call endrun(decomp_index=p, clmlevel=namep, & + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, & msg = 'clm_ptrs_check: tree consistent - ERROR', & additional_msg = errMsg(sourcefile, __LINE__)) endif diff --git a/src/main/initVerticalMod.F90 b/src/main/initVerticalMod.F90 index 69368f217a..1bf79706f9 100644 --- a/src/main/initVerticalMod.F90 +++ b/src/main/initVerticalMod.F90 @@ -16,7 +16,7 @@ module initVerticalMod use clm_varpar , only : toplev_equalspace, nlev_equalspace use clm_varpar , only : nlevsoi, nlevsoifl, nlevurb, nlevmaxurbgrnd use clm_varctl , only : fsurdat, iulog - use clm_varctl , only : use_vancouver, use_mexicocity, use_vertsoilc, use_extralakelayers + use clm_varctl , only : use_vancouver, use_mexicocity, use_extralakelayers use clm_varctl , only : use_bedrock, rundef use clm_varctl , only : soil_layerstruct_predefined, soil_layerstruct_userdefined use clm_varctl , only : use_fates @@ -39,9 +39,15 @@ module initVerticalMod ! !PUBLIC MEMBER FUNCTIONS: public :: initVertical public :: find_soil_layer_containing_depth + public :: readParams ! !PRIVATE MEMBER FUNCTIONS: private :: hasBedrock ! true if the given column type includes bedrock layers + type, private :: params_type + real(r8) :: slopebeta ! exponent for microtopography pdf sigma (unitless) + real(r8) :: slopemax ! max topographic slope for microtopography pdf sigma (unitless) + end type params_type + type(params_type), private :: params_inst ! character(len=*), parameter, private :: sourcefile = & @@ -52,6 +58,28 @@ module initVerticalMod contains + !----------------------------------------------------------------------- + subroutine readParams( ncid ) + ! + ! !USES: + use ncdio_pio, only: file_desc_t + use paramUtilMod, only: readNcdioScalar + ! + ! !ARGUMENTS: + implicit none + type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id + ! + ! !LOCAL VARIABLES: + character(len=*), parameter :: subname = 'readParams_initVertical' + !-------------------------------------------------------------------- + + ! Exponent for microtopography pdf sigma (unitless) + call readNcdioScalar(ncid, 'slopebeta', subname, params_inst%slopebeta) + ! Max topographic slope for microtopography pdf sigma (unitless) + call readNcdioScalar(ncid, 'slopemax', subname, params_inst%slopemax) + + end subroutine readParams + !------------------------------------------------------------------------ subroutine initVertical(bounds, glc_behavior, thick_wall, thick_roof) use clm_varcon, only : zmin_bedrock @@ -71,8 +99,6 @@ subroutine initVertical(bounds, glc_behavior, thick_wall, thick_roof) real(r8) ,pointer :: std (:) ! read in - topo_std real(r8) ,pointer :: tslope (:) ! read in - topo_slope real(r8) :: slope0 ! temporary - real(r8) :: slopebeta ! temporary - real(r8) :: slopemax ! temporary integer :: ier ! error status real(r8) :: scalez = 0.025_r8 ! Soil layer thickness discretization (m) real(r8) :: thick_equal = 0.2 @@ -247,12 +273,8 @@ subroutine initVertical(bounds, glc_behavior, thick_wall, thick_roof) end if ! calc_method is node-based or thickness-based ! define a vertical grid spacing such that it is the normal dzsoi if - ! nlevdecomp =nlevgrnd, or else 1 meter - if (use_vertsoilc) then - dzsoi_decomp = dzsoi !thickness b/n two interfaces - else - dzsoi_decomp(1) = 1._r8 - end if + ! nlevdecomp =nlevgrnd + dzsoi_decomp = dzsoi !thickness b/n two interfaces if (masterproc) then write(iulog, *) 'zsoi', zsoi(:) @@ -684,10 +706,8 @@ subroutine initVertical(bounds, glc_behavior, thick_wall, thick_roof) do c = begc,endc ! microtopographic parameter, units are meters (try smooth function of slope) - slopebeta = 3._r8 - slopemax = 0.4_r8 - slope0 = slopemax**(-1._r8/slopebeta) - col%micro_sigma(c) = (col%topo_slope(c) + slope0)**(-slopebeta) + slope0 = params_inst%slopemax**(1._r8/params_inst%slopebeta) + col%micro_sigma(c) = (col%topo_slope(c) + slope0)**(params_inst%slopebeta) end do call ncd_pio_closefile(ncid) diff --git a/src/main/lnd2glcMod.F90 b/src/main/lnd2glcMod.F90 index 7d4fad7791..34f50266ad 100644 --- a/src/main/lnd2glcMod.F90 +++ b/src/main/lnd2glcMod.F90 @@ -17,11 +17,11 @@ module lnd2glcMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : get_proc_bounds, bounds_type + use decompMod , only : get_proc_bounds, bounds_type, subgrid_level_column use domainMod , only : ldomain use clm_varpar , only : maxpatch_glc use clm_varctl , only : iulog - use clm_varcon , only : spval, tfrz, namec + use clm_varcon , only : spval, tfrz use column_varcon , only : col_itype_to_ice_class use landunit_varcon , only : istice, istsoil use abortutils , only : endrun @@ -209,7 +209,7 @@ subroutine update_lnd2glc(this, bounds, num_do_smb_c, filter_do_smb_c, & write(iulog,*) 'One possible cause is having multiple columns in the istsoil landunit,' write(iulog,*) 'which this routine cannot handle.' write(iulog,*) 'g, n = ', g, n - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end if ! Send surface temperature, topography, and SMB flux (qice) to coupler. diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in index b321dc04bc..6d58ded872 100644 --- a/src/main/ncdio_pio.F90.in +++ b/src/main/ncdio_pio.F90.in @@ -17,13 +17,12 @@ module ncdio_pio use shr_log_mod , only : errMsg => shr_log_errMsg use spmdMod , only : masterproc, mpicom, iam, npes use spmdMod , only : MPI_REAL8, MPI_INTEGER, MPI_LOGICAL - use clm_varcon , only : spval,ispval, grlnd, nameg, namel, namec, namep + use clm_varcon , only : spval, ispval, grlnd use clm_varctl , only : single_column, iulog use shr_sys_mod , only : shr_sys_flush - use decompMod , only : get_clmlevel_gsize,get_clmlevel_gsmap + use decompMod , only : get_subgrid_level_from_name, get_subgrid_level_gsize, get_subgrid_level_gindex use perf_mod , only : t_startf, t_stopf use fileutils , only : getavu, relavu - use mct_mod , only : mct_gsMap, mct_gsMap_lsize, mct_gsMap_gsize, mct_gsMap_orderedPoints use pio , only : file_desc_t, io_desc_t, iosystem_desc_t use pio , only : pio_bcast_error, pio_char, pio_clobber, pio_closefile, pio_createfile, pio_def_dim use pio , only : pio_def_var, pio_double, pio_redef, pio_enddef, pio_get_att, pio_get_var, pio_global, pio_initdecomp @@ -1665,7 +1664,7 @@ contains logical , optional, intent(in) :: cnvrtnan2fill ! true => convert any NaN's to _FillValue (spval) ! ! Local Variables - character(len=8) :: clmlevel ! clmlevel + character(len=8) :: subgrid_level_name ! nameg, namel, etc. character(len=32) :: dimname ! temporary integer :: n ! index integer :: iodnum ! iodesc num in list @@ -1689,10 +1688,10 @@ contains start(:) = 0 count(:) = 0 - clmlevel = dim1name + subgrid_level_name = dim1name if (masterproc .and. debug > 1) then - write(iulog,*) subname//' ',trim(flag),' ',trim(varname),' ',trim(clmlevel) + write(iulog,*) subname//' ',trim(flag),' ',trim(varname),' ',trim(subgrid_level_name) end if #if ({ITYPE}==TYPEDOUBLE) @@ -1710,8 +1709,8 @@ contains if (varpresent) then if (single_column) then start(:) = 1 ; count(:) = 1 - call scam_field_offsets(ncid,clmlevel,vardesc,start,count) - if (trim(clmlevel) == grlnd) then + call scam_field_offsets(ncid,subgrid_level_name,vardesc,start,count) + if (trim(subgrid_level_name) == grlnd) then n=2 if (present(nt)) then start(3) = nt ; count(3) = 1 @@ -1756,7 +1755,7 @@ contains enddo status = pio_inq_vartype(ncid, vardesc, xtype) - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + call ncd_getiodesc(ncid, subgrid_level_name, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & xtype, iodnum) iodesc_plus => iodesc_list(iodnum) @@ -1785,7 +1784,7 @@ contains status = pio_inq_dimlen(ncid,dids(n),dims(n)) enddo status = pio_inq_vartype(ncid, vardesc, xtype) - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + call ncd_getiodesc(ncid, subgrid_level_name, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & xtype, iodnum) iodesc_plus => iodesc_list(iodnum) if (present(nt)) then @@ -1848,7 +1847,7 @@ contains real(r8), pointer :: temp(:,:) #endif integer :: ndim1,ndim2 - character(len=8) :: clmlevel ! clmlevel + character(len=8) :: subgrid_level_name ! nameg, namel, etc. character(len=32) :: dimname ! temporary integer :: status ! error status integer :: ndims ! ndims total for var @@ -1873,10 +1872,10 @@ contains start(:)=0 count(:)=0 - clmlevel = dim1name + subgrid_level_name = dim1name if (masterproc .and. debug > 1) then - write(iulog,*) trim(subname),' ',trim(flag),' ',trim(varname),' ',trim(clmlevel) + write(iulog,*) trim(subname),' ',trim(flag),' ',trim(varname),' ',trim(subgrid_level_name) end if #if ({ITYPE}==TYPEDOUBLE) @@ -1905,8 +1904,8 @@ contains if (varpresent) then if (single_column) then start(:) = 1 ; count(:) = 1 - call scam_field_offsets(ncid, clmlevel, vardesc, start, count) - if (trim(clmlevel) == grlnd) then + call scam_field_offsets(ncid, subgrid_level_name, vardesc, start, count) + if (trim(subgrid_level_name) == grlnd) then count(3) = size(data,dim=2) n=3 if (present(nt)) then @@ -1952,7 +1951,7 @@ contains call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) end if if (present(switchdim)) then - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + call ncd_getiodesc(ncid, subgrid_level_name, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & xtype, iodnum, switchdim=.true.) iodesc_plus => iodesc_list(iodnum) call read_darray_dispatcher(ncid, vardesc, iodesc_plus%iodesc, varname, xtype, temp) @@ -1962,7 +1961,7 @@ contains end do end do else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + call ncd_getiodesc(ncid, subgrid_level_name, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & xtype, iodnum) iodesc_plus => iodesc_list(iodnum) call read_darray_dispatcher(ncid, vardesc, iodesc_plus%iodesc, varname, xtype, data) @@ -2003,10 +2002,10 @@ contains enddo status = pio_inq_vartype(ncid, vardesc, xtype) if (present(switchdim)) then - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + call ncd_getiodesc(ncid, subgrid_level_name, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & xtype, iodnum, switchdim=.true.) else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + call ncd_getiodesc(ncid, subgrid_level_name, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & xtype, iodnum) end if iodesc_plus => iodesc_list(iodnum) @@ -2084,7 +2083,7 @@ contains ! ! !LOCAL VARIABLES: integer :: ndim1,ndim2 - character(len=8) :: clmlevel ! clmlevel + character(len=8) :: subgrid_level_name ! nameg, namel, etc. character(len=32) :: dimname ! temporary integer :: status ! error status integer :: ndims ! ndims total for var @@ -2103,10 +2102,10 @@ contains character(len=*),parameter :: subname='ncd_io_3d_{TYPE}' ! subroutine name !----------------------------------------------------------------------- - clmlevel = dim1name + subgrid_level_name = dim1name if (masterproc .and. debug > 1) then - write(iulog,*) trim(subname),' ',trim(flag),' ',trim(varname),' ',trim(clmlevel) + write(iulog,*) trim(subname),' ',trim(flag),' ',trim(varname),' ',trim(subgrid_level_name) end if if (flag == 'read') then @@ -2116,8 +2115,8 @@ contains if (single_column) then start(:) = 1 count(:) = 1 - call scam_field_offsets(ncid, clmlevel, vardesc, start, count) - if (trim(clmlevel) == grlnd) then + call scam_field_offsets(ncid, subgrid_level_name, vardesc, start, count) + if (trim(subgrid_level_name) == grlnd) then count(3) = size(data,dim=2); count(4) = size(data,dim=3) n=4 @@ -2154,7 +2153,7 @@ contains status = pio_inq_dimlen(ncid,dids(n),dims(n)) enddo status = pio_inq_vartype(ncid, vardesc, xtype) - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + call ncd_getiodesc(ncid, subgrid_level_name, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & xtype, iodnum) iodesc_plus => iodesc_list(iodnum) if (present(nt)) then @@ -2185,7 +2184,7 @@ contains status = pio_inq_dimlen(ncid,dids(n),dims(n)) enddo status = pio_inq_vartype(ncid, vardesc, xtype) - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + call ncd_getiodesc(ncid, subgrid_level_name, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & xtype, iodnum) iodesc_plus => iodesc_list(iodnum) if (present(nt)) then @@ -2557,7 +2556,7 @@ contains !------------------------------------------------------------------------ - subroutine ncd_getiodesc(ncid, clmlevel, ndims, dims, dimids, & + subroutine ncd_getiodesc(ncid, subgrid_level_name, ndims, dims, dimids, & xtype, iodnum, switchdim) ! ! !DESCRIPTION: @@ -2565,7 +2564,7 @@ contains ! ! !ARGUMENTS: class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor - character(len=8) , intent(in) :: clmlevel ! clmlevel + character(len=8) , intent(in) :: subgrid_level_name ! one of nameg, namel, etc. integer , intent(in) :: ndims ! ndims for var integer , intent(in) :: dims(:) ! dim sizes integer , intent(in) :: dimids(:) ! dim ids @@ -2576,19 +2575,18 @@ contains ! !LOCAL VARIABLES: integer :: k,m,n,cnt ! indices integer :: basetype ! pio basetype - integer :: gsmap_lsize ! local size of gsmap - integer :: gsmap_gsize ! global size of gsmap integer :: fullsize ! size of entire array on cdf - integer :: gsize ! global size of clmlevel + integer :: subgrid_level ! integer version of subgrid_level_name + integer :: lsize ! local size of subgrid_level gindex + integer :: gsize ! global size of subgrid_level integer :: vsize ! other dimensions integer :: vsize1, vsize2 ! other dimensions integer :: status ! error status logical :: found ! true => found created iodescriptor integer :: ndims_file ! temporary - character(len=64) dimname_file ! dimension name on file - character(len=64) dimname_iodesc ! dimension name from io descriptor - type(mct_gsMap),pointer :: gsmap ! global seg map - integer, pointer,dimension(:) :: gsmOP ! gsmap ordered points + character(len=64) :: dimname_file ! dimension name on file + character(len=64) :: dimname_iodesc ! dimension name from io descriptor + integer, pointer :: gindex(:) ! global index space integer(pio_offset_kind), pointer :: compDOF(:) character(len=32) :: subname = 'ncd_getiodesc' !------------------------------------------------------------------------ @@ -2662,12 +2660,13 @@ contains call shr_sys_abort(errMsg(sourcefile,__LINE__)) end if - call get_clmlevel_gsmap(clmlevel,gsmap) - gsize = get_clmlevel_gsize(clmlevel) - gsmap_lsize = mct_gsmap_lsize(gsmap,mpicom) - gsmap_gsize = mct_gsmap_gsize(gsmap) - - call mct_gsMap_orderedPoints(gsmap,iam,gsmOP) + subgrid_level = get_subgrid_level_from_name(subgrid_level_name) + call get_subgrid_level_gindex(subgrid_level, gindex) + if (.not. associated(gindex)) then + call shr_sys_abort('gindex for subgrid level '//trim(subgrid_level_name)//' is not associated') + end if + gsize = get_subgrid_level_gsize(subgrid_level) + lsize = size(gindex) fullsize = 1 do n = 1,ndims @@ -2680,15 +2679,15 @@ contains call shr_sys_abort(errMsg(sourcefile, __LINE__)) endif - allocate(compDOF(gsmap_lsize*vsize)) + allocate(compDOF(lsize*vsize)) if (present(switchdim)) then if (switchdim) then cnt = 0 - do m = 1,gsmap_lsize + do m = 1,lsize do n = 1,vsize cnt = cnt + 1 - compDOF(cnt) = (gsmOP(m)-1)*vsize + n + compDOF(cnt) = (gindex(m)-1)*vsize + n enddo enddo else @@ -2706,18 +2705,18 @@ contains cnt = 0 do k = 1,vsize2 do n = 1,vsize1 - do m = 1,gsmap_lsize + do m = 1,lsize cnt = cnt + 1 - compDOF(cnt) = (k-1)*vsize1*gsmap_gsize + (n-1)*gsmap_gsize + gsmOP(m) + compDOF(cnt) = (k-1)*vsize1*gsize + (n-1)*gsize + gindex(m) enddo enddo end do else cnt = 0 do n = 1,vsize - do m = 1,gsmap_lsize + do m = 1,lsize cnt = cnt + 1 - compDOF(cnt) = (n-1)*gsmap_gsize + gsmOP(m) + compDOF(cnt) = (n-1)*gsize + gindex(m) enddo enddo end if @@ -2726,17 +2725,15 @@ contains if (debug > 1) then do m = 0,npes-1 if (iam == m) then - write(iulog,*) trim(subname),' sizes1 = ',iam,gsize,gsmap_gsize,gsmap_lsize - write(iulog,*) trim(subname),' sizes2 = ',iam,fullsize,npes,vsize - write(iulog,*) trim(subname),' compDOF = ',iam,size(compDOF),minval(compDOF),maxval(compDOF) + write(iulog,'(a,3(i10,2x))') trim(subname)//' sizes1 = ',iam,gsize,lsize + write(iulog,'(a,4(i10,2x))') trim(subname)//' sizes2 = ',iam,fullsize,npes,vsize + write(iulog,'(a,5(i10,2x))') trim(subname)//' compDOF = ',iam,size(compDOF),minval(compDOF),maxval(compDOF) call shr_sys_flush(iulog) endif call mpi_barrier(mpicom,status) enddo endif - deallocate(gsmOP) - call pio_initdecomp(pio_subsystem, xTYPE, dims(1:ndims), compDOF, iodesc_list(iodnum)%iodesc) deallocate(compDOF) diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 27c6375344..2ac733505f 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -9,7 +9,7 @@ module pftconMod use shr_kind_mod, only : r8 => shr_kind_r8 use abortutils , only : endrun use clm_varpar , only : mxpft, numrad, ivis, inir, cft_lb, cft_ub, ndecomp_pools - use clm_varctl , only : iulog, use_cndv, use_vertsoilc, use_crop + use clm_varctl , only : iulog, use_cndv, use_crop ! ! !PUBLIC TYPES: implicit none diff --git a/src/main/readParamsMod.F90 b/src/main/readParamsMod.F90 index 38d412414e..6cad023781 100644 --- a/src/main/readParamsMod.F90 +++ b/src/main/readParamsMod.F90 @@ -38,7 +38,6 @@ subroutine readParameters (nutrient_competition_method, photosyns_inst) use SoilBiogeochemPotentialMod , only : readSoilBiogeochemPotentialParams => readParams use SoilBiogeochemDecompMod , only : readSoilBiogeochemDecompParams => readParams use SoilBiogeochemDecompCascadeBGCMod , only : readSoilBiogeochemDecompBgcParams => readParams - use SoilBiogeochemDecompCascadeCNMod , only : readSoilBiogeochemDecompCnParams => readParams use ch4Mod , only : readCH4Params => readParams use LunaMod , only : readParams_Luna => readParams use BareGroundFluxesMod , only : readParams_BareGroundFluxes => readParams @@ -54,6 +53,10 @@ subroutine readParameters (nutrient_competition_method, photosyns_inst) use SurfaceResistanceMod , only : readParams_SurfaceResistance => readParams use WaterDiagnosticBulkType , only : readParams_WaterDiagnosticBulk => readParams use SnowHydrologyMod , only : readParams_SnowHydrology => readParams + use SnowSnicarMod , only : readParams_SnowSnicar => readParams + use initVerticalMod , only : readParams_initVertical => readParams + use SurfaceWaterMod , only : readParams_SurfaceWater => readParams + use SoilHydrologyInitTimeConstMod , only : readParams_SoilHydrologyInitTimeConst => readParams use NutrientCompetitionMethodMod , only : nutrient_competition_method_type use clm_varctl, only : NLFilename_in use PhotosynthesisMod , only : photosyns_type @@ -96,7 +99,6 @@ subroutine readParameters (nutrient_competition_method, photosyns_inst) if (use_cn .or. use_fates) then call readSoilBiogeochemCompetitionParams(ncid) call readSoilBiogeochemDecompBgcParams(ncid) - call readSoilBiogeochemDecompCnParams(ncid) call readSoilBiogeochemDecompParams(ncid) call readSoilBiogeochemLittVertTranspParams(ncid) call readSoilBiogeochemNitrifDenitrifParams(ncid) @@ -124,8 +126,11 @@ subroutine readParameters (nutrient_competition_method, photosyns_inst) call readParams_InfiltrationExcessRunoff ( ncid ) call readParams_SurfaceResistance ( ncid ) call readParams_WaterDiagnosticBulk ( ncid ) - call readParams_SnowHydrology (ncid) - + call readParams_SnowHydrology ( ncid ) + call readParams_SnowSnicar ( ncid ) + call readParams_initVertical ( ncid ) + call readParams_SurfaceWater ( ncid ) + call readParams_SoilHydrologyInitTimeConst ( ncid ) ! call ncd_pio_closefile(ncid) diff --git a/src/main/restFileMod.F90 b/src/main/restFileMod.F90 index 2f62795c7e..f0b2b4fb01 100644 --- a/src/main/restFileMod.F90 +++ b/src/main/restFileMod.F90 @@ -8,7 +8,7 @@ module restFileMod #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type, get_proc_clumps, get_clump_bounds - use decompMod , only : BOUNDS_LEVEL_PROC + use decompMod , only : bounds_level_proc use spmdMod , only : masterproc, mpicom use abortutils , only : endrun use shr_log_mod , only : errMsg => shr_log_errMsg @@ -182,7 +182,7 @@ subroutine restFile_read( bounds_proc, file, glc_behavior, reset_dynbal_baseline ! The provided bounds need to be proc-level bounds. This is in part because of logic ! below that divides this into clump-level bounds for the sake of reweight_wrapup. ! But it *MAY* also be necessary to have proc-level bounds for these i/o routines. - SHR_ASSERT(bounds_proc%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + SHR_ASSERT(bounds_proc%level == bounds_level_proc, subname // ': argument must be PROC-level bounds') ! Open file diff --git a/src/main/reweightMod.F90 b/src/main/reweightMod.F90 index 0c283631cc..38b2433935 100644 --- a/src/main/reweightMod.F90 +++ b/src/main/reweightMod.F90 @@ -40,7 +40,7 @@ subroutine reweight_wrapup(bounds, glc_behavior) ! !USES: use filterMod , only : setFilters use subgridWeightsMod , only : set_active, check_weights - use decompMod , only : bounds_type, BOUNDS_LEVEL_CLUMP + use decompMod , only : bounds_type, bounds_level_clump use glcBehaviorMod , only : glc_behavior_type ! ! !ARGUMENTS: @@ -48,7 +48,7 @@ subroutine reweight_wrapup(bounds, glc_behavior) type(glc_behavior_type), intent(in) :: glc_behavior !------------------------------------------------------------------------ - SHR_ASSERT_FL(bounds%level == BOUNDS_LEVEL_CLUMP, sourcefile, __LINE__) + SHR_ASSERT_FL(bounds%level == bounds_level_clump, sourcefile, __LINE__) call set_active(bounds, glc_behavior) call check_weights(bounds, active_only=.false.) diff --git a/src/main/subgridAveMod.F90 b/src/main/subgridAveMod.F90 index a808aa49d0..c5ce4a4a98 100644 --- a/src/main/subgridAveMod.F90 +++ b/src/main/subgridAveMod.F90 @@ -11,10 +11,10 @@ module subgridAveMod use shr_log_mod , only : errMsg => shr_log_errMsg use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_perv , icol_road_imperv - use clm_varcon , only : grlnd, nameg, namel, namec, namep,spval + use clm_varcon , only : spval use clm_varctl , only : iulog use abortutils , only : endrun - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_gridcell, subgrid_level_landunit, subgrid_level_column use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch @@ -156,7 +156,7 @@ subroutine p2c_1d (bounds, parr, carr, p2c_scale_type) end do if (found) then write(iulog,*)'p2c_1d error: sumwt is greater than 1.0' - call endrun(decomp_index=index, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end if end subroutine p2c_1d @@ -219,7 +219,7 @@ subroutine p2c_2d (bounds, num2d, parr, carr, p2c_scale_type) end do if (found) then write(iulog,*)'p2c_2d error: sumwt is greater than 1.0 at c= ',index,' lev= ',j - call endrun(decomp_index=index, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end if end do end subroutine p2c_2d @@ -386,7 +386,7 @@ subroutine p2l_1d (bounds, parr, larr, p2c_scale_type, c2l_scale_type) end do if (found) then write(iulog,*)'p2l_1d error: sumwt is greater than 1.0 at l= ',index - call endrun(decomp_index=index, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_landunit, msg=errMsg(sourcefile, __LINE__)) end if end subroutine p2l_1d @@ -495,7 +495,7 @@ subroutine p2l_2d(bounds, num2d, parr, larr, p2c_scale_type, c2l_scale_type) end do if (found) then write(iulog,*)'p2l_2d error: sumwt is greater than 1.0 at l= ',index,' j= ',j - call endrun(decomp_index=index, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_landunit, msg=errMsg(sourcefile, __LINE__)) end if end do @@ -609,7 +609,7 @@ subroutine p2g_1d(bounds, parr, garr, p2c_scale_type, c2l_scale_type, l2g_scale_ end do if (found) then write(iulog,*)'p2g_1d error: sumwt is greater than 1.0 at g= ',index - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end subroutine p2g_1d @@ -726,7 +726,7 @@ subroutine p2g_2d(bounds, num2d, parr, garr, p2c_scale_type, c2l_scale_type, l2g end do if (found) then write(iulog,*)'p2g_2d error: sumwt gt 1.0 at g/sumwt = ',index,sumwt(index) - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end do @@ -836,7 +836,7 @@ subroutine c2l_1d (bounds, carr, larr, c2l_scale_type, include_inactive) end do if (found) then write(iulog,*)'c2l_1d error: sumwt is greater than 1.0 at l= ',index - call endrun(decomp_index=index, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_landunit, msg=errMsg(sourcefile, __LINE__)) end if end subroutine c2l_1d @@ -933,7 +933,7 @@ subroutine c2l_2d (bounds, num2d, carr, larr, c2l_scale_type) end do if (found) then write(iulog,*)'c2l_2d error: sumwt is greater than 1.0 at l= ',index,' lev= ',j - call endrun(decomp_index=index, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_landunit, msg=errMsg(sourcefile, __LINE__)) end if end do @@ -1035,7 +1035,7 @@ subroutine c2g_1d(bounds, carr, garr, c2l_scale_type, l2g_scale_type) end do if (found) then write(iulog,*)'c2g_1d error: sumwt is greater than 1.0 at g= ',index - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end subroutine c2g_1d @@ -1138,7 +1138,7 @@ subroutine c2g_2d(bounds, num2d, carr, garr, c2l_scale_type, l2g_scale_type) end do if (found) then write(iulog,*)'c2g_2d error: sumwt is greater than 1.0 at g= ',index - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end do @@ -1194,7 +1194,7 @@ subroutine l2g_1d(bounds, larr, garr, l2g_scale_type) end do if (found) then write(iulog,*)'l2g_1d error: sumwt is greater than 1.0 at g= ',index - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end subroutine l2g_1d @@ -1252,7 +1252,7 @@ subroutine l2g_2d(bounds, num2d, larr, garr, l2g_scale_type) end do if (found) then write(iulog,*)'l2g_2d error: sumwt is greater than 1.0 at g= ',index,' lev= ',j - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=index, subgrid_level=subgrid_level_gridcell, msg=errMsg(sourcefile, __LINE__)) end if end do diff --git a/src/main/subgridRestMod.F90 b/src/main/subgridRestMod.F90 index 78a00b5492..de148de200 100644 --- a/src/main/subgridRestMod.F90 +++ b/src/main/subgridRestMod.F90 @@ -8,15 +8,14 @@ module subgridRestMod use shr_log_mod , only : errMsg => shr_log_errMsg use glc_elevclass_mod , only : glc_get_num_elevation_classes, glc_get_elevclass_bounds use abortutils , only : endrun - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC, ldecomp + use decompMod , only : bounds_type, bounds_level_proc, gindex_global, get_global_index_array + use decompMod , only : subgrid_level_gridcell, subgrid_level_landunit, subgrid_level_column, subgrid_level_patch use domainMod , only : ldomain use clm_time_manager , only : get_curr_date - use clm_varcon , only : nameg, namel, namec, namep use clm_varpar , only : nlevsno, nlevmaxurbgrnd use pio , only : file_desc_t use ncdio_pio , only : ncd_int, ncd_double - use GetGlobalValuesMod , only : GetGlobalIndexArray - use GridcellType , only : grc + use GridcellType , only : grc use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch @@ -115,6 +114,7 @@ subroutine subgridRest_write_only(bounds, ncid, flag) integer , pointer :: ilarr(:) ! temporary integer , pointer :: icarr(:) ! temporary integer , pointer :: iparr(:) ! temporary + integer :: gindex ! global index real(r8), pointer :: elevclass_bounds(:) @@ -141,7 +141,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag) interpinic_flag='skip', readvar=readvar, data=grc%latdeg) do g=bounds%begg,bounds%endg - igarr(g)= mod(ldecomp%gdc2glo(g)-1,ldomain%ni) + 1 + gindex = gindex_global(g-bounds%begg+1) + igarr(g)= mod(gindex-1,ldomain%ni) + 1 enddo call restartvar(ncid=ncid, flag=flag, varname='grid1d_ixy', xtype=ncd_int, & dim1name='gridcell', & @@ -149,7 +150,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag) interpinic_flag='skip', readvar=readvar, data=igarr) do g=bounds%begg,bounds%endg - igarr(g)= (ldecomp%gdc2glo(g) - 1)/ldomain%ni + 1 + gindex = gindex_global(g-bounds%begg+1) + igarr(g)= (gindex - 1)/ldomain%ni + 1 enddo call restartvar(ncid=ncid, flag=flag, varname='grid1d_jxy', xtype=ncd_int, & dim1name='gridcell', & @@ -182,7 +184,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag) interpinic_flag='skip', readvar=readvar, data=rlarr) do l=bounds%begl,bounds%endl - ilarr(l) = mod(ldecomp%gdc2glo(lun%gridcell(l))-1,ldomain%ni) + 1 + gindex = gindex_global(lun%gridcell(l)-bounds%begg+1) + ilarr(l) = mod(gindex-1,ldomain%ni) + 1 enddo call restartvar(ncid=ncid, flag=flag, varname='land1d_ixy', xtype=ncd_int, & dim1name='landunit', & @@ -190,14 +193,16 @@ subroutine subgridRest_write_only(bounds, ncid, flag) interpinic_flag='skip', readvar=readvar, data=ilarr) do l=bounds%begl,bounds%endl - ilarr(l) = (ldecomp%gdc2glo(lun%gridcell(l))-1)/ldomain%ni + 1 + gindex = gindex_global(lun%gridcell(l)-bounds%begg+1) + ilarr(l) = (gindex-1)/ldomain%ni + 1 end do call restartvar(ncid=ncid, flag=flag, varname='land1d_jxy', xtype=ncd_int, & dim1name='landunit', & long_name='2d latitude index of corresponding landunit', & interpinic_flag='skip', readvar=readvar, data=ilarr) - ilarr = GetGlobalIndexArray(lun%gridcell(bounds%begl:bounds%endl), bounds%begl, bounds%endl, clmlevel=nameg) + ilarr = get_global_index_array(lun%gridcell(bounds%begl:bounds%endl), bounds%begl, bounds%endl, & + subgrid_level=subgrid_level_gridcell) call restartvar(ncid=ncid, flag=flag, varname='land1d_gridcell_index', xtype=ncd_int, & dim1name='landunit', & long_name='gridcell index of corresponding landunit', & @@ -245,7 +250,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag) interpinic_flag='skip', readvar=readvar, data=rcarr) do c= bounds%begc, bounds%endc - icarr(c) = mod(ldecomp%gdc2glo(col%gridcell(c))-1,ldomain%ni) + 1 + gindex = gindex_global(col%gridcell(c)-bounds%begg+1) + icarr(c) = mod(gindex-1,ldomain%ni) + 1 enddo call restartvar(ncid=ncid, flag=flag, varname='cols1d_ixy', xtype=ncd_int, & dim1name='column', & @@ -253,20 +259,23 @@ subroutine subgridRest_write_only(bounds, ncid, flag) interpinic_flag='skip', readvar=readvar, data=icarr) do c= bounds%begc, bounds%endc - icarr(c) = (ldecomp%gdc2glo(col%gridcell(c))-1)/ldomain%ni + 1 + gindex = gindex_global(col%gridcell(c)-bounds%begg+1) + icarr(c) = (gindex-1)/ldomain%ni + 1 enddo call restartvar(ncid=ncid, flag=flag, varname='cols1d_jxy', xtype=ncd_int, & dim1name='column', & long_name='2d latitude index of corresponding column', units=' ', & interpinic_flag='skip', readvar=readvar, data=icarr) - icarr = GetGlobalIndexArray(col%gridcell(bounds%begc:bounds%endc), bounds%begc, bounds%endc, clmlevel=nameg) + icarr = get_global_index_array(col%gridcell(bounds%begc:bounds%endc), bounds%begc, bounds%endc, & + subgrid_level=subgrid_level_gridcell) call restartvar(ncid=ncid, flag=flag, varname='cols1d_gridcell_index', xtype=ncd_int, & dim1name='column', & long_name='gridcell index of corresponding column', & interpinic_flag='skip', readvar=readvar, data=icarr) - icarr = GetGlobalIndexArray(col%landunit(bounds%begc:bounds%endc), bounds%begc, bounds%endc, clmlevel=namel) + icarr = get_global_index_array(col%landunit(bounds%begc:bounds%endc), bounds%begc, bounds%endc, & + subgrid_level=subgrid_level_landunit) call restartvar(ncid=ncid, flag=flag, varname='cols1d_landunit_index', xtype=ncd_int, & dim1name='column', & long_name='landunit index of corresponding column', & @@ -346,7 +355,8 @@ subroutine subgridRest_write_only(bounds, ncid, flag) interpinic_flag='skip', readvar=readvar, data=rparr) do p=bounds%begp,bounds%endp - iparr(p) = mod(ldecomp%gdc2glo(patch%gridcell(p))-1,ldomain%ni) + 1 + gindex = gindex_global(patch%gridcell(p)-bounds%begg+1) + iparr(p) = mod(gindex-1,ldomain%ni) + 1 enddo call restartvar(ncid=ncid, flag=flag, varname='pfts1d_ixy', xtype=ncd_int, & dim1name='pft', & @@ -354,26 +364,30 @@ subroutine subgridRest_write_only(bounds, ncid, flag) interpinic_flag='skip', readvar=readvar, data=iparr) do p=bounds%begp,bounds%endp - iparr(p) = (ldecomp%gdc2glo(patch%gridcell(p))-1)/ldomain%ni + 1 + gindex = gindex_global(patch%gridcell(p)-bounds%begg+1) + iparr(p) = (gindex-1)/ldomain%ni + 1 enddo call restartvar(ncid=ncid, flag=flag, varname='pfts1d_jxy', xtype=ncd_int, & dim1name='pft', & long_name='2d latitude index of corresponding pft', units='', & interpinic_flag='skip', readvar=readvar, data=iparr) - iparr = GetGlobalIndexArray(patch%gridcell(bounds%begp:bounds%endp), bounds%begp, bounds%endp, clmlevel=nameg) + iparr = get_global_index_array(patch%gridcell(bounds%begp:bounds%endp), bounds%begp, bounds%endp, & + subgrid_level=subgrid_level_gridcell) call restartvar(ncid=ncid, flag=flag, varname='pfts1d_gridcell_index', xtype=ncd_int, & dim1name='pft', & long_name='gridcell index of corresponding pft', & interpinic_flag='skip', readvar=readvar, data=iparr) - iparr = GetGlobalIndexArray(patch%landunit(bounds%begp:bounds%endp), bounds%begp, bounds%endp, clmlevel=namel) + iparr = get_global_index_array(patch%landunit(bounds%begp:bounds%endp), bounds%begp, bounds%endp, & + subgrid_level=subgrid_level_landunit) call restartvar(ncid=ncid, flag=flag, varname='pfts1d_landunit_index', xtype=ncd_int, & dim1name='pft', & long_name='landunit index of corresponding pft', & interpinic_flag='skip', readvar=readvar, data=iparr) - iparr = GetGlobalIndexArray(patch%column(bounds%begp:bounds%endp), bounds%begp, bounds%endp, clmlevel=namec) + iparr = get_global_index_array(patch%column(bounds%begp:bounds%endp), bounds%begp, bounds%endp, & + subgrid_level=subgrid_level_column) call restartvar(ncid=ncid, flag=flag, varname='pfts1d_column_index', xtype=ncd_int, & dim1name='pft', & long_name='column index of corresponding pft', & @@ -585,7 +599,7 @@ subroutine save_old_weights(bounds) character(len=*), parameter :: subname = 'save_old_weights' !----------------------------------------------------------------------- - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname//' ERROR: expect proc-level bounds') + SHR_ASSERT(bounds%level == bounds_level_proc, subname//' ERROR: expect proc-level bounds') allocate(pft_wtlunit_before_rest_read(bounds%begp:bounds%endp)) pft_wtlunit_before_rest_read(bounds%begp:bounds%endp) = patch%wtlunit(bounds%begp:bounds%endp) @@ -712,7 +726,7 @@ subroutine check_weights(bounds) write(iulog,*) ' in user_nl_clm' write(iulog,*) ' In this case, CLM will take the weights from the initial conditions file.' write(iulog,*) ' ' - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) end if end if end do diff --git a/src/main/subgridWeightsMod.F90 b/src/main/subgridWeightsMod.F90 index 68b858c682..224155914c 100644 --- a/src/main/subgridWeightsMod.F90 +++ b/src/main/subgridWeightsMod.F90 @@ -13,14 +13,14 @@ module subgridWeightsMod ! Note: in the following, 'active' refers to a pft, column, landunit or grid cell over ! which computations are performed, and 'inactive' refers to a pft, column or landunit ! where computations are NOT performed (grid cells are always active). - ! + ! ! (1) For all columns, landunits and grid cells, the sum of all subgrid weights of its ! children (or grandchildren, etc.) is equal to 1. For example: ! - For all columns, the sum of all patch weights on the column equals 1 ! - For all landunits, the sum of all col weights on the landunit equals 1 ! - For all grid cells, the sum of all patch weights on the grid cell equals 1 ! - etc. - ! + ! ! (2) For all ACTIVE columns, landunits and grid cells, the sum of all subgrid weights of ! its ACTIVE children (or grandchildren, etc.) is equal to 1. For example: ! - For all active columns, the sum of all patch weights on the column equals 1 when @@ -92,13 +92,12 @@ module subgridWeightsMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun - use clm_varctl , only : iulog, all_active, run_zero_weight_urban, use_fates - use clm_varcon , only : nameg, namel, namec, namep - use decompMod , only : bounds_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch + use clm_varctl , only : iulog, all_active, run_zero_weight_urban, use_fates, use_fates_sp + use decompMod , only : bounds_type, subgrid_level_landunit, subgrid_level_column, subgrid_level_patch + use GridcellType , only : grc + use LandunitType , only : lun + use ColumnType , only : col + use PatchType , only : patch use glcBehaviorMod , only : glc_behavior_type ! ! PUBLIC TYPES: @@ -128,7 +127,7 @@ module subgridWeightsMod real(r8), pointer :: pct_cft(:,:) ! % of each crop functional type, as % of landunit [begg:endg, cft_lb:cft_ub] real(r8), pointer :: pct_glc_mec(:,:) ! % of each glacier elevation class, as % of landunit [begg:endg, 1:maxpatch_glc] end type subgrid_weights_diagnostics_type - + type(subgrid_weights_diagnostics_type) :: subgrid_weights_diagnostics ! @@ -157,18 +156,18 @@ subroutine init_subgrid_weights_mod(bounds) use landunit_varcon, only : max_lunit use clm_varpar , only : maxpatch_glc, natpft_size, cft_size use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : BOUNDS_LEVEL_PROC + use decompMod , only : bounds_level_proc use histFileMod , only : hist_addfld2d ! ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds ! proc bounds ! ! !LOCAL VARIABLES: - + character(len=*), parameter :: subname = 'init_subgrid_weights_mod' !----------------------------------------------------------------------- - - SHR_ASSERT_FL(bounds%level == BOUNDS_LEVEL_PROC, sourcefile, __LINE__) + + SHR_ASSERT_FL(bounds%level == bounds_level_proc, sourcefile, __LINE__) ! ------------------------------------------------------------------------ ! Allocate variables in subgrid_weights_diagnostics @@ -194,12 +193,12 @@ subroutine init_subgrid_weights_mod(bounds) avgflag='A', long_name='% of each landunit on grid cell', & ptr_lnd=subgrid_weights_diagnostics%pct_landunit) - if(.not.use_fates) then + if(.not.use_fates.or.use_fates_sp) then call hist_addfld2d (fname='PCT_NAT_PFT', units='%', type2d='natpft', & avgflag='A', long_name='% of each PFT on the natural vegetation (i.e., soil) landunit', & ptr_lnd=subgrid_weights_diagnostics%pct_nat_pft) end if - + if (cft_size > 0) then call hist_addfld2d (fname='PCT_CFT', units='%', type2d='cft', & avgflag='A', long_name='% of each crop on the crop landunit', & @@ -278,7 +277,7 @@ subroutine set_active(bounds, glc_behavior) if (col%active(c) .and. .not. lun%active(l)) then write(iulog,*) trim(subname),' ERROR: active column found on inactive landunit', & 'at c = ', c, ', l = ', l - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__)) end if end do @@ -288,7 +287,7 @@ subroutine set_active(bounds, glc_behavior) if (patch%active(p) .and. .not. col%active(c)) then write(iulog,*) trim(subname),' ERROR: active patch found on inactive column', & 'at p = ', p, ', c = ', c - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) end if end do @@ -361,15 +360,15 @@ logical function is_active_l(l, glc_behavior) if (lun%itype(l) == istsoil) then is_active_l = .true. end if - + ! Set all lake land units to active ! By doing this, lakes are also run virtually in grid cells which will grow - ! lakes during the transient run. - + ! lakes during the transient run. + if (lun%itype(l) == istdlak) then is_active_l = .true. end if - + end if end function is_active_l @@ -451,7 +450,7 @@ logical function is_active_p(p) else c =patch%column(p) - + is_active_p = .false. ! ------------------------------------------------------------------------ @@ -483,7 +482,7 @@ function get_landunit_weight(g, ltype) result(weight) character(len=*), parameter :: subname = 'get_landunit_weight' !----------------------------------------------------------------------- - + l = grc%landunit_indices(ltype, g) if (l == ispval) then weight = 0._r8 @@ -509,7 +508,7 @@ subroutine set_landunit_weight(g, ltype, weight) ! ! !LOCAL VARIABLES: integer :: l ! landunit index - + character(len=*), parameter :: subname = 'set_landunit_weight' !----------------------------------------------------------------------- @@ -519,9 +518,9 @@ subroutine set_landunit_weight(g, ltype, weight) else if (weight > 0._r8) then write(iulog,*) subname//' ERROR: Attempt to assign non-zero weight to a non-existent landunit' write(iulog,*) 'g, l, ltype, weight = ', g, l, ltype, weight - call endrun(decomp_index=l, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errMsg(sourcefile, __LINE__)) end if - + end subroutine set_landunit_weight @@ -564,7 +563,7 @@ subroutine check_weights (bounds, active_only) ! This routine operates in two different modes, depending on the value of active_only. If ! active_only is true, then we check the sum of weights of the ACTIVE children, ! grandchildren, etc. of a given point. If active_only is false, then we check the sum of - ! weights of ALL children, grandchildren, etc. of a given point. + ! weights of ALL children, grandchildren, etc. of a given point. ! ! Normally this routine will be called twice: once with active_only=false, and once with ! active_only=true. @@ -599,7 +598,7 @@ subroutine check_weights (bounds, active_only) l = patch%landunit(p) g = patch%gridcell(p) - if ((active_only .and. patch%active(p)) .or. .not. active_only) then + if ((active_only .and. patch%active(p)) .or. .not. active_only) then sumwtcol(c) = sumwtcol(c) + patch%wtcol(p) sumwtlunit(l) = sumwtlunit(l) + patch%wtlunit(p) sumwtgcell(g) = sumwtgcell(g) + patch%wtgcell(p) @@ -651,7 +650,7 @@ subroutine check_weights (bounds, active_only) error_found = .true. end if end do - + do g = bounds%begg,bounds%endg if (.not. weights_okay(sumwtgcell(g), active_only, i_am_active=.true.)) then write(iulog,*) trim(subname),' ERROR: at g = ',g,'total col weight is ',sumwtgcell(g), & @@ -748,19 +747,19 @@ subroutine set_subgrid_diagnostic_fields(bounds) type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: - + character(len=*), parameter :: subname = 'set_subgrid_diagnostic_fields' !----------------------------------------------------------------------- - + call set_pct_landunit_diagnostics(bounds) ! Note: (MV, 10-17-14): The following has an use_fates if-block around it since ! the pct_pft_diagnostics referens to patch%itype(p) which is not used by ED - ! Note: (SPM, 10-20-15): If this isn't set then debug mode with intel and + ! Note: (SPM, 10-20-15): If this isn't set then debug mode with intel and ! yellowstone will fail when trying to write pct_nat_pft since it contains ! all NaN's. call set_pct_pft_diagnostics(bounds) - + call set_pct_glc_mec_diagnostics(bounds) end subroutine set_subgrid_diagnostic_fields @@ -779,12 +778,12 @@ subroutine set_pct_landunit_diagnostics(bounds) ! !LOCAL VARIABLES: integer :: g, l ! grid cell & landunit indices integer :: ltype ! landunit type - + character(len=*), parameter :: subname = 'set_pct_landunit_diagnostics' !----------------------------------------------------------------------- subgrid_weights_diagnostics%pct_landunit(bounds%begg:bounds%endg, :) = 0._r8 - + do l = bounds%begl, bounds%endl g = lun%gridcell(l) ltype = lun%itype(l) @@ -813,10 +812,10 @@ subroutine set_pct_glc_mec_diagnostics(bounds) ! !LOCAL VARIABLES: integer :: c,l,g ! indices integer :: ice_class ! ice class (1..maxpatch_glc) - + character(len=*), parameter :: subname = 'set_pct_glc_mec_diagnostics' !----------------------------------------------------------------------- - + subgrid_weights_diagnostics%pct_glc_mec(bounds%begg:bounds%endg, :) = 0._r8 do c = bounds%begc, bounds%endc @@ -847,10 +846,10 @@ subroutine set_pct_pft_diagnostics(bounds) integer :: p,l,g ! indices integer :: ptype ! patch itype integer :: ptype_1indexing ! patch itype, translated into 1-indexing for the given landunit type - + character(len=*), parameter :: subname = 'set_pct_pft_diagnostics' !----------------------------------------------------------------------- - + subgrid_weights_diagnostics%pct_nat_pft(bounds%begg:bounds%endg, :) = 0._r8 ! Note that pct_cft will be 0-size if cft_size is 0 (which can happen if we don't @@ -858,12 +857,12 @@ subroutine set_pct_pft_diagnostics(bounds) ! to 0, and doing this always allows us to avoid extra logic which could be a ! maintenance problem. subgrid_weights_diagnostics%pct_cft(bounds%begg:bounds%endg, :) = 0._r8 - + do p = bounds%begp,bounds%endp g = patch%gridcell(p) l = patch%landunit(p) ptype = patch%itype(p) - if (lun%itype(l) == istsoil .and. (.not.use_fates) ) then + if (lun%itype(l) == istsoil .and. (.not.use_fates.or.use_fates_sp) ) then ptype_1indexing = ptype + (1 - natpft_lb) subgrid_weights_diagnostics%pct_nat_pft(g, ptype_1indexing) = patch%wtlunit(p) * 100._r8 else if (lun%itype(l) == istcrop) then diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 24aeac40dc..4e121a2c54 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -150,7 +150,7 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) end if call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, clmlevel=grlnd) + call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, subgrid_level=grlnd) call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=surfdata_domain%lonc, & dim1name=grlnd, readvar=readvar) diff --git a/src/soilbiogeochem/CMakeLists.txt b/src/soilbiogeochem/CMakeLists.txt index 380582f236..6d9a02f312 100644 --- a/src/soilbiogeochem/CMakeLists.txt +++ b/src/soilbiogeochem/CMakeLists.txt @@ -3,6 +3,9 @@ list(APPEND clm_sources SoilBiogeochemStateType.F90 + SoilBiogeochemDecompCascadeConType.F90 + SoilBiogeochemStateType.F90 + SoilBiogeochemNitrogenStateType.F90 ) sourcelist_to_parent(clm_sources) diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 index 0e4879fb4a..cb8f3beef4 100644 --- a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 @@ -599,7 +599,6 @@ subroutine Restart(this, bounds, ncid, flag) ! !USES: use restUtilMod use ncdio_pio - use clm_varctl, only : use_vertsoilc ! ! !ARGUMENTS: class(soilbiogeochem_carbonflux_type) :: this @@ -619,42 +618,23 @@ subroutine Restart(this, bounds, ncid, flag) ! if ( use_fates ) then - if (use_vertsoilc) then - ptr2d => this%FATES_c_to_litr_lab_c_col - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lab_c_col', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gC/m3/s', scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) + ptr2d => this%FATES_c_to_litr_lab_c_col + call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lab_c_col', xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gC/m3/s', scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) - ptr2d => this%FATES_c_to_litr_cel_c_col - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_cel_c_col', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gC/m3/s', scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) + ptr2d => this%FATES_c_to_litr_cel_c_col + call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_cel_c_col', xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gC/m3/s', scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) - ptr2d => this%FATES_c_to_litr_lig_c_col - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lig_c_col', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gC/m3/s', scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - - else - ptr1d => this%FATES_c_to_litr_lab_c_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lab_c_col', xtype=ncd_double, & - dim1name='column', long_name='', units='gC/m3/s', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - - ptr1d => this%FATES_c_to_litr_cel_c_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_cel_c_col', xtype=ncd_double, & - dim1name='column', long_name='', units='gC/m3/s', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - - ptr1d => this%FATES_c_to_litr_lig_c_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lig_c_col', xtype=ncd_double, & - dim1name='column', long_name='', units='gC/m3/s', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - - end if + ptr2d => this%FATES_c_to_litr_lig_c_col + call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lig_c_col', xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gC/m3/s', scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) ! Copy last 3 variables to an array of litter pools for use in do loops. ! Repeat copy in src/utils/clmfates_interfaceMod.F90. diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 index d7ab333ed9..a8f312a55c 100644 --- a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 @@ -7,7 +7,7 @@ module SoilBiogeochemCarbonStateType use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools, nlevcan use clm_varpar , only : nlevdecomp_full, nlevdecomp, nlevsoi use clm_varcon , only : spval, ispval, dzsoi_decomp, zisoi, zsoi, c3_r2 - use clm_varctl , only : iulog, use_vertsoilc, spinup_state, use_fates + use clm_varctl , only : iulog, spinup_state, use_fates use landunit_varcon , only : istcrop, istsoil use abortutils , only : endrun use spmdMod , only : masterproc @@ -518,38 +518,24 @@ subroutine Restart ( this, bounds, ncid, flag, carbon_type, totvegc_col, c12_so do k = 1, ndecomp_pools varname=trim(decomp_cascade_con%decomp_pool_name_restart(k))//'c' - if (use_vertsoilc) then - ptr2d => this%decomp_cpools_vr_col(:,:,k) - call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='g/m3', fill_value=spval, & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%decomp_cpools_vr_col(:,1,k) ! nlevdecomp = 1; so treat as 1D variable - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name='column', long_name='', units='g/m3', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if + ptr2d => this%decomp_cpools_vr_col(:,:,k) + call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='g/m3', fill_value=spval, & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) if (flag=='read' .and. .not. readvar) then call endrun(msg='ERROR:: '//trim(varname)//' is required on an initialization dataset'//& errMsg(sourcefile, __LINE__)) end if end do - if (use_vertsoilc) then - ptr2d => this%ctrunc_vr_col - call restartvar(ncid=ncid, flag=flag, varname='col_ctrunc_vr', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gC/m3', fill_value=spval, & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%ctrunc_vr_col(:,1) ! nlevdecomp = 1; so treat as 1D variable - call restartvar(ncid=ncid, flag=flag, varname='col_ctrunc', xtype=ncd_double, & - dim1name='column', long_name='', units='gC/m3', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if + ptr2d => this%ctrunc_vr_col + call restartvar(ncid=ncid, flag=flag, varname='col_ctrunc_vr', xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gC/m3', fill_value=spval, & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) if (flag=='read' .and. .not. readvar) then call endrun(msg='ERROR:: '//trim(varname)//' is required on an initialization dataset'//& errMsg(sourcefile, __LINE__)) @@ -565,19 +551,12 @@ subroutine Restart ( this, bounds, ncid, flag, carbon_type, totvegc_col, c12_so do k = 1, ndecomp_pools varname = trim(decomp_cascade_con%decomp_pool_name_restart(k))//'c_13' - if (use_vertsoilc) then - ptr2d => this%decomp_cpools_vr_col(:,:,k) - call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='g/m3', fill_value=spval, & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%decomp_cpools_vr_col(:,1,k) ! nlevdecomp = 1; so treat as 1D variable - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name='column', long_name='', units='g/m3', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if + ptr2d => this%decomp_cpools_vr_col(:,:,k) + call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='g/m3', fill_value=spval, & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) if (flag=='read' .and. .not. readvar) then write(iulog,*) 'initializing soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col' & // ' with atmospheric c13 value for: '//trim(varname) @@ -591,19 +570,12 @@ subroutine Restart ( this, bounds, ncid, flag, carbon_type, totvegc_col, c12_so end if end do - if (use_vertsoilc) then - ptr2d => this%ctrunc_vr_col - call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c13_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gC/m3', fill_value=spval, & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%ctrunc_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c13", xtype=ncd_double, & - dim1name='column', long_name='', units='gC/m3', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if + ptr2d => this%ctrunc_vr_col + call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c13_vr", xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gC/m3', fill_value=spval, & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) end if !-------------------------------- @@ -614,20 +586,12 @@ subroutine Restart ( this, bounds, ncid, flag, carbon_type, totvegc_col, c12_so do k = 1, ndecomp_pools varname = trim(decomp_cascade_con%decomp_pool_name_restart(k))//'c_14' - if (use_vertsoilc) then - ptr2d => this%decomp_cpools_vr_col(:,:,k) - call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='g/m3', fill_value=spval, & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%decomp_cpools_vr_col(:,1,k) ! nlevdecomp = 1; so treat as 1D variable - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name='column', & - long_name='', units='g/m3', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if + ptr2d => this%decomp_cpools_vr_col(:,:,k) + call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='g/m3', fill_value=spval, & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) if (flag=='read' .and. .not. readvar) then write(iulog,*) 'initializing soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col with atmospheric c14 value for: '//& trim(varname) @@ -641,19 +605,12 @@ subroutine Restart ( this, bounds, ncid, flag, carbon_type, totvegc_col, c12_so end if end do - if (use_vertsoilc) then - ptr2d => this%ctrunc_vr_col - call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c14_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gC/m3', fill_value=spval, & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%ctrunc_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c14", xtype=ncd_double, & - dim1name='column', long_name='', units='gC/m3', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if + ptr2d => this%ctrunc_vr_col + call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c14_vr", xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gC/m3', fill_value=spval, & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) end if diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 index 75fa3c0089..4554d98fb2 100644 --- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 @@ -11,7 +11,7 @@ module SoilBiogeochemDecompCascadeBGCMod use shr_log_mod , only : errMsg => shr_log_errMsg use clm_varpar , only : nlevdecomp, ndecomp_pools_max use clm_varpar , only : i_litr_min, i_litr_max, i_met_lit, i_cwd - use clm_varctl , only : iulog, spinup_state, anoxia, use_lch4, use_vertsoilc, use_fates + use clm_varctl , only : iulog, spinup_state, anoxia, use_lch4, use_fates use clm_varcon , only : zsoi use decompMod , only : bounds_type use spmdMod , only : masterproc @@ -42,9 +42,9 @@ module SoilBiogeochemDecompCascadeBGCMod real(r8), public :: normalization_tref = 15._r8 ! reference temperature for normalizaion (degrees C) ! ! !PRIVATE DATA MEMBERS - integer, private :: i_pro_som ! index of protected Soil Organic Matter (SOM) - integer, private :: i_rec_som ! index of recalcitrant SOM - integer, private :: i_avl_som ! index of available SOM + integer, private :: i_pas_som ! index of passive (aka protected) Soil Organic Matter (SOM) + integer, private :: i_slo_som ! index of slow (aka recalcitrant) SOM + integer, private :: i_act_som ! index of active (aka available) SOM integer, private :: i_cel_lit ! index of cellulose litter pool integer, private :: i_lig_lit ! index of lignin litter pool @@ -353,8 +353,8 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i i_met_lit = i_litr_min floating_cn_ratio_decomp_pools(i_met_lit) = .true. decomp_cascade_con%decomp_pool_name_restart(i_met_lit) = 'litr1' - decomp_cascade_con%decomp_pool_name_history(i_met_lit) = 'LITR1' - decomp_cascade_con%decomp_pool_name_long(i_met_lit) = 'litter 1' + decomp_cascade_con%decomp_pool_name_history(i_met_lit) = 'MET_LIT' + decomp_cascade_con%decomp_pool_name_long(i_met_lit) = 'metabolic litter' decomp_cascade_con%decomp_pool_name_short(i_met_lit) = 'L1' is_litter(i_met_lit) = .true. is_soil(i_met_lit) = .false. @@ -368,8 +368,8 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i i_cel_lit = i_met_lit + 1 floating_cn_ratio_decomp_pools(i_cel_lit) = .true. decomp_cascade_con%decomp_pool_name_restart(i_cel_lit) = 'litr2' - decomp_cascade_con%decomp_pool_name_history(i_cel_lit) = 'LITR2' - decomp_cascade_con%decomp_pool_name_long(i_cel_lit) = 'litter 2' + decomp_cascade_con%decomp_pool_name_history(i_cel_lit) = 'CEL_LIT' + decomp_cascade_con%decomp_pool_name_long(i_cel_lit) = 'cellulosic litter' decomp_cascade_con%decomp_pool_name_short(i_cel_lit) = 'L2' is_litter(i_cel_lit) = .true. is_soil(i_cel_lit) = .false. @@ -383,8 +383,8 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i i_lig_lit = i_cel_lit + 1 floating_cn_ratio_decomp_pools(i_lig_lit) = .true. decomp_cascade_con%decomp_pool_name_restart(i_lig_lit) = 'litr3' - decomp_cascade_con%decomp_pool_name_history(i_lig_lit) = 'LITR3' - decomp_cascade_con%decomp_pool_name_long(i_lig_lit) = 'litter 3' + decomp_cascade_con%decomp_pool_name_history(i_lig_lit) = 'LIG_LIT' + decomp_cascade_con%decomp_pool_name_long(i_lig_lit) = 'lignin litter' decomp_cascade_con%decomp_pool_name_short(i_lig_lit) = 'L3' is_litter(i_lig_lit) = .true. is_soil(i_lig_lit) = .false. @@ -405,54 +405,54 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i errMsg(sourcefile, __LINE__)) end if - i_pro_som = i_lig_lit + 1 - floating_cn_ratio_decomp_pools(i_pro_som) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_pro_som) = 'soil1' - decomp_cascade_con%decomp_pool_name_history(i_pro_som) = 'SOIL1' - decomp_cascade_con%decomp_pool_name_long(i_pro_som) = 'soil 1' - decomp_cascade_con%decomp_pool_name_short(i_pro_som) = 'S1' - is_litter(i_pro_som) = .false. - is_soil(i_pro_som) = .true. - is_cwd(i_pro_som) = .false. - initial_cn_ratio(i_pro_som) = cn_s1 - initial_stock(i_pro_som) = params_inst%initial_Cstocks(i_pro_som) - is_metabolic(i_pro_som) = .false. - is_cellulose(i_pro_som) = .false. - is_lignin(i_pro_som) = .false. - - i_rec_som = i_pro_som + 1 - floating_cn_ratio_decomp_pools(i_rec_som) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_rec_som) = 'soil2' - decomp_cascade_con%decomp_pool_name_history(i_rec_som) = 'SOIL2' - decomp_cascade_con%decomp_pool_name_long(i_rec_som) = 'soil 2' - decomp_cascade_con%decomp_pool_name_short(i_rec_som) = 'S2' - is_litter(i_rec_som) = .false. - is_soil(i_rec_som) = .true. - is_cwd(i_rec_som) = .false. - initial_cn_ratio(i_rec_som) = cn_s2 - initial_stock(i_rec_som) = params_inst%initial_Cstocks(i_rec_som) - is_metabolic(i_rec_som) = .false. - is_cellulose(i_rec_som) = .false. - is_lignin(i_rec_som) = .false. - - i_avl_som = i_rec_som + 1 - floating_cn_ratio_decomp_pools(i_avl_som) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_avl_som) = 'soil3' - decomp_cascade_con%decomp_pool_name_history(i_avl_som) = 'SOIL3' - decomp_cascade_con%decomp_pool_name_long(i_avl_som) = 'soil 3' - decomp_cascade_con%decomp_pool_name_short(i_avl_som) = 'S3' - is_litter(i_avl_som) = .false. - is_soil(i_avl_som) = .true. - is_cwd(i_avl_som) = .false. - initial_cn_ratio(i_avl_som) = cn_s3 - initial_stock(i_avl_som) = params_inst%initial_Cstocks(i_avl_som) - is_metabolic(i_avl_som) = .false. - is_cellulose(i_avl_som) = .false. - is_lignin(i_avl_som) = .false. + i_act_som = i_lig_lit + 1 + floating_cn_ratio_decomp_pools(i_act_som) = .false. + decomp_cascade_con%decomp_pool_name_restart(i_act_som) = 'soil1' + decomp_cascade_con%decomp_pool_name_history(i_act_som) = 'ACT_SOM' + decomp_cascade_con%decomp_pool_name_long(i_act_som) = 'active soil organic matter' + decomp_cascade_con%decomp_pool_name_short(i_act_som) = 'S1' + is_litter(i_act_som) = .false. + is_soil(i_act_som) = .true. + is_cwd(i_act_som) = .false. + initial_cn_ratio(i_act_som) = cn_s1 + initial_stock(i_act_som) = params_inst%initial_Cstocks(i_act_som) + is_metabolic(i_act_som) = .false. + is_cellulose(i_act_som) = .false. + is_lignin(i_act_som) = .false. + + i_slo_som = i_act_som + 1 + floating_cn_ratio_decomp_pools(i_slo_som) = .false. + decomp_cascade_con%decomp_pool_name_restart(i_slo_som) = 'soil2' + decomp_cascade_con%decomp_pool_name_history(i_slo_som) = 'SLO_SOM' + decomp_cascade_con%decomp_pool_name_long(i_slo_som) = 'slow soil organic matter' + decomp_cascade_con%decomp_pool_name_short(i_slo_som) = 'S2' + is_litter(i_slo_som) = .false. + is_soil(i_slo_som) = .true. + is_cwd(i_slo_som) = .false. + initial_cn_ratio(i_slo_som) = cn_s2 + initial_stock(i_slo_som) = params_inst%initial_Cstocks(i_slo_som) + is_metabolic(i_slo_som) = .false. + is_cellulose(i_slo_som) = .false. + is_lignin(i_slo_som) = .false. + + i_pas_som = i_slo_som + 1 + floating_cn_ratio_decomp_pools(i_pas_som) = .false. + decomp_cascade_con%decomp_pool_name_restart(i_pas_som) = 'soil3' + decomp_cascade_con%decomp_pool_name_history(i_pas_som) = 'PAS_SOM' + decomp_cascade_con%decomp_pool_name_long(i_pas_som) = 'passive soil organic matter' + decomp_cascade_con%decomp_pool_name_short(i_pas_som) = 'S3' + is_litter(i_pas_som) = .false. + is_soil(i_pas_som) = .true. + is_cwd(i_pas_som) = .false. + initial_cn_ratio(i_pas_som) = cn_s3 + initial_stock(i_pas_som) = params_inst%initial_Cstocks(i_pas_som) + is_metabolic(i_pas_som) = .false. + is_cellulose(i_pas_som) = .false. + is_lignin(i_pas_som) = .false. if (.not. use_fates) then ! CWD - i_cwd = i_avl_som + 1 + i_cwd = i_pas_som + 1 floating_cn_ratio_decomp_pools(i_cwd) = .true. decomp_cascade_con%decomp_pool_name_restart(i_cwd) = 'cwd' decomp_cascade_con%decomp_pool_name_history(i_cwd) = 'CWD' @@ -480,10 +480,10 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i spinup_factor(i_cwd) = max(1._r8, (speedup_fac * params_inst%tau_cwd_bgc / 2._r8 )) end if !som1 - spinup_factor(i_pro_som) = 1._r8 + spinup_factor(i_act_som) = 1._r8 !som2,3 - spinup_factor(i_rec_som) = max(1._r8, (speedup_fac * params_inst%tau_s2_bgc)) - spinup_factor(i_avl_som) = max(1._r8, (speedup_fac * params_inst%tau_s3_bgc)) + spinup_factor(i_slo_som) = max(1._r8, (speedup_fac * params_inst%tau_s2_bgc)) + spinup_factor(i_pas_som) = max(1._r8, (speedup_fac * params_inst%tau_s3_bgc)) if ( masterproc ) then write(iulog,*) 'Spinup_state ',spinup_state @@ -495,56 +495,56 @@ subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_i decomp_cascade_con%cascade_step_name(i_l1s1) = 'L1S1' rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = rf_l1s1 cascade_donor_pool(i_l1s1) = i_met_lit - cascade_receiver_pool(i_l1s1) = i_pro_som + cascade_receiver_pool(i_l1s1) = i_act_som pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = 1.0_r8 i_l2s1 = 2 decomp_cascade_con%cascade_step_name(i_l2s1) = 'L2S1' rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s1) = rf_l2s1 cascade_donor_pool(i_l2s1) = i_cel_lit - cascade_receiver_pool(i_l2s1) = i_pro_som + cascade_receiver_pool(i_l2s1) = i_act_som pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s1)= 1.0_r8 i_l3s2 = 3 decomp_cascade_con%cascade_step_name(i_l3s2) = 'L3S2' rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s2) = rf_l3s2 cascade_donor_pool(i_l3s2) = i_lig_lit - cascade_receiver_pool(i_l3s2) = i_rec_som + cascade_receiver_pool(i_l3s2) = i_slo_som pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s2) = 1.0_r8 i_s1s2 = 4 decomp_cascade_con%cascade_step_name(i_s1s2) = 'S1S2' rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = rf_s1s2(bounds%begc:bounds%endc,1:nlevdecomp) - cascade_donor_pool(i_s1s2) = i_pro_som - cascade_receiver_pool(i_s1s2) = i_rec_som + cascade_donor_pool(i_s1s2) = i_act_som + cascade_receiver_pool(i_s1s2) = i_slo_som pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = f_s1s2(bounds%begc:bounds%endc,1:nlevdecomp) i_s1s3 = 5 decomp_cascade_con%cascade_step_name(i_s1s3) = 'S1S3' rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s3) = rf_s1s3(bounds%begc:bounds%endc,1:nlevdecomp) - cascade_donor_pool(i_s1s3) = i_pro_som - cascade_receiver_pool(i_s1s3) = i_avl_som + cascade_donor_pool(i_s1s3) = i_act_som + cascade_receiver_pool(i_s1s3) = i_pas_som pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s3) = f_s1s3(bounds%begc:bounds%endc,1:nlevdecomp) i_s2s1 = 6 decomp_cascade_con%cascade_step_name(i_s2s1) = 'S2S1' rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s1) = rf_s2s1 - cascade_donor_pool(i_s2s1) = i_rec_som - cascade_receiver_pool(i_s2s1) = i_pro_som + cascade_donor_pool(i_s2s1) = i_slo_som + cascade_receiver_pool(i_s2s1) = i_act_som pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s1) = f_s2s1 i_s2s3 = 7 decomp_cascade_con%cascade_step_name(i_s2s3) = 'S2S3' rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = rf_s2s3 - cascade_donor_pool(i_s2s3) = i_rec_som - cascade_receiver_pool(i_s2s3) = i_avl_som + cascade_donor_pool(i_s2s3) = i_slo_som + cascade_receiver_pool(i_s2s3) = i_pas_som pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = f_s2s3 i_s3s1 = 8 decomp_cascade_con%cascade_step_name(i_s3s1) = 'S3S1' rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s1) = rf_s3s1 - cascade_donor_pool(i_s3s1) = i_avl_som - cascade_receiver_pool(i_s3s1) = i_pro_som + cascade_donor_pool(i_s3s1) = i_pas_som + cascade_receiver_pool(i_s3s1) = i_act_som pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s1) = 1.0_r8 if (.not. use_fates) then @@ -700,20 +700,20 @@ subroutine decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, & endif endif ! - if ( abs(spinup_factor(i_pro_som) - 1._r8) .gt. .000001_r8) then - spinup_geogterm_s1(c) = spinup_factor(i_pro_som) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) + if ( abs(spinup_factor(i_act_som) - 1._r8) .gt. .000001_r8) then + spinup_geogterm_s1(c) = spinup_factor(i_act_som) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) else spinup_geogterm_s1(c) = 1._r8 endif ! - if ( abs(spinup_factor(i_rec_som) - 1._r8) .gt. .000001_r8) then - spinup_geogterm_s2(c) = spinup_factor(i_rec_som) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) + if ( abs(spinup_factor(i_slo_som) - 1._r8) .gt. .000001_r8) then + spinup_geogterm_s2(c) = spinup_factor(i_slo_som) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) else spinup_geogterm_s2(c) = 1._r8 endif ! - if ( abs(spinup_factor(i_avl_som) - 1._r8) .gt. .000001_r8) then - spinup_geogterm_s3(c) = spinup_factor(i_avl_som) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) + if ( abs(spinup_factor(i_pas_som) - 1._r8) .gt. .000001_r8) then + spinup_geogterm_s3(c) = spinup_factor(i_pas_som) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) else spinup_geogterm_s3(c) = 1._r8 endif @@ -927,11 +927,7 @@ subroutine decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, & do j = 1, nlevdecomp do fc = 1, num_soilc c = filter_soilc(fc) - if (use_vertsoilc) then - depth_scalar(c,j) = exp(-zsoi(j) / decomp_depth_efolding) - else - depth_scalar(c,j) = 1.0_r8 - end if + depth_scalar(c,j) = exp(-zsoi(j) / decomp_depth_efolding) end do end do @@ -945,11 +941,11 @@ subroutine decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, & depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c) decomp_k(c,j,i_lig_lit) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * & depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c) - decomp_k(c,j,i_pro_som) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * & + decomp_k(c,j,i_act_som) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * & depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s1(c) - decomp_k(c,j,i_rec_som) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * & + decomp_k(c,j,i_slo_som) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * & depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s2(c) - decomp_k(c,j,i_avl_som) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * & + decomp_k(c,j,i_pas_som) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * & depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s3(c) ! same for cwd but only if fates is not enabled; fates handles CWD ! on its own structure diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 deleted file mode 100644 index 5a198483e5..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 +++ /dev/null @@ -1,855 +0,0 @@ -module SoilBiogeochemDecompCascadeCNMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Sets the coeffiecients used in the decomposition cascade submodel. - ! This uses the CN parameters as in CLMCN 4.0 - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : nlevsoi, nlevgrnd, nlevdecomp, ndecomp_cascade_transitions, ndecomp_pools - use clm_varpar , only : i_litr1, i_litr2, i_litr3, i_cwd - use clm_varctl , only : iulog, spinup_state, anoxia, use_lch4, use_vertsoilc, use_fates - use clm_varcon , only : zsoi - use decompMod , only : bounds_type - use abortutils , only : endrun - use CNSharedParamsMod , only : CNParamsShareInst, nlev_soildecomp_standard - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use ch4Mod , only : ch4_type - use ColumnType , only : col - - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: readParams - public :: init_decompcascade_cn - public :: decomp_rate_constants_cn - - ! !PRIVATE DATA MEMBERS - integer, private :: i_soil1 = -9 ! Soil Organic Matter (SOM) first pool - integer, private :: i_soil2 = -9 ! SOM second pool - integer, private :: i_soil3 = -9 ! SOM third pool - integer, private :: i_soil4 = -9 ! SOM fourth pool - - type, private :: params_type - real(r8):: cn_s1_cn !C:N for SOM 1 - real(r8):: cn_s2_cn !C:N for SOM 2 - real(r8):: cn_s3_cn !C:N for SOM 3 - real(r8):: cn_s4_cn !C:N for SOM 4 - - real(r8):: rf_l1s1_cn !respiration fraction litter 1 -> SOM 1 - real(r8):: rf_l2s2_cn !respiration fraction litter 2 -> SOM 2 - real(r8):: rf_l3s3_cn !respiration fraction litter 3 -> SOM 3 - real(r8):: rf_s1s2_cn !respiration fraction SOM 1 -> SOM 2 - real(r8):: rf_s2s3_cn !respiration fraction SOM 2 -> SOM 3 - real(r8):: rf_s3s4_cn !respiration fraction SOM 3 -> SOM 4 - - real(r8) :: cwd_fcel_cn !cellulose fraction for CWD - real(r8) :: cwd_flig_cn ! - - real(r8) :: k_l1_cn !decomposition rate for litter 1 - real(r8) :: k_l2_cn !decomposition rate for litter 2 - real(r8) :: k_l3_cn !decomposition rate for litter 3 - real(r8) :: k_s1_cn !decomposition rate for SOM 1 - real(r8) :: k_s2_cn !decomposition rate for SOM 2 - real(r8) :: k_s3_cn !decomposition rate for SOM 3 - real(r8) :: k_s4_cn !decomposition rate for SOM 4 - - real(r8) :: k_frag_cn !fragmentation rate for CWD - real(r8) :: minpsi_cn !minimum soil water potential for heterotrophic resp - real(r8) :: maxpsi_cn !maximum soil water potential for heterotrophic resp - - integer :: nsompools = 4 - real(r8), allocatable :: spinup_vector(:) ! multipliers for soil decomp during accelerated spinup - - end type params_type - ! - type(params_type), private :: params_inst - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !USES: - use ncdio_pio , only : file_desc_t,ncd_io - ! - ! !ARGUMENTS: - implicit none - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !CALLED FROM: readParamsMod.F90::CNParamsReadFile - ! - ! !REVISION HISTORY: - ! Dec 3 2012 : Created by S. Muszala - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'SoilBiogeochemDecompCnParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - - !EOP - !----------------------------------------------------------------------- - - ! These are not read off of netcdf file - allocate(params_inst%spinup_vector(params_inst%nsompools)) - params_inst%spinup_vector(:) = (/ 1.0_r8, 1.0_r8, 5.0_r8, 70.0_r8 /) - - ! Read off of netcdf file - tString='cn_s1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s1_cn=tempr - - tString='cn_s2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s2_cn=tempr - - tString='cn_s3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s3_cn=tempr - - tString='cn_s4' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s4_cn=tempr - - tString='rf_l1s1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_l1s1_cn=tempr - - tString='rf_l2s2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_l2s2_cn=tempr - - tString='rf_l3s3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_l3s3_cn=tempr - - tString='rf_s1s2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_s1s2_cn=tempr - - tString='rf_s2s3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_s2s3_cn=tempr - - tString='rf_s3s4' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_s3s4_cn=tempr - - tString='cwd_fcel' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cwd_fcel_cn=tempr - - tString='k_l1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_l1_cn=tempr - - tString='k_l2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_l2_cn=tempr - - tString='k_l3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_l3_cn=tempr - - tString='k_s1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_s1_cn=tempr - - tString='k_s2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_s2_cn=tempr - - tString='k_s3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_s3_cn=tempr - - tString='k_s4' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_s4_cn=tempr - - tString='k_frag_cn' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_frag_cn=tempr - - tString='minpsi_hr' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%minpsi_cn=tempr - - tString='maxpsi_hr' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%maxpsi_cn=tempr - - tString='cwd_flig' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cwd_flig_cn=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst) - ! - ! !DESCRIPTION: - ! initialize rate constants and decomposition pathways for the BGC model originally implemented in CLM-CN - ! written by C. Koven based on original CLM4 decomposition cascade by P. Thornton - ! - ! !USES: - use SoilBiogeochemDecompCascadeConType, only : i_atm - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - ! - !-- properties of each pathway along decomposition cascade - !-- properties of each decomposing pool - real(r8) :: rf_l1s1 !respiration fraction litter 1 -> SOM 1 - real(r8) :: rf_l2s2 !respiration fraction litter 2 -> SOM 2 - real(r8) :: rf_l3s3 !respiration fraction litter 3 -> SOM 3 - real(r8) :: rf_s1s2 !respiration fraction SOM 1 -> SOM 2 - real(r8) :: rf_s2s3 !respiration fraction SOM 2 -> SOM 3 - real(r8) :: rf_s3s4 !respiration fraction SOM 3 -> SOM 4 - real(r8) :: cwd_fcel - real(r8) :: cwd_flig - real(r8) :: cn_s1 - real(r8) :: cn_s2 - real(r8) :: cn_s3 - real(r8) :: cn_s4 - - integer :: i_l1s1 - integer :: i_l2s2 - integer :: i_l3s3 - integer :: i_s1s2 - integer :: i_s2s3 - integer :: i_s3s4 - integer :: i_s4atm - integer :: i_cwdl2 - integer :: i_cwdl3 - !----------------------------------------------------------------------- - - associate( & - rf_decomp_cascade => soilbiogeochem_state_inst%rf_decomp_cascade_col , & ! Output: [real(r8) (:,:,:) ] respired fraction in decomposition step (frac) - pathfrac_decomp_cascade => soilbiogeochem_state_inst%pathfrac_decomp_cascade_col , & ! Output: [real(r8) (:,:,:) ] what fraction of C leaving a given pool passes through a given transition (frac) - - cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Output: [integer (:) ] which pool is C taken from for a given decomposition step - cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Output: [integer (:) ] which pool is C added to for a given decomposition step - floating_cn_ratio_decomp_pools => decomp_cascade_con%floating_cn_ratio_decomp_pools , & ! Output: [logical (:) ] TRUE => pool has fixed C:N ratio - is_litter => decomp_cascade_con%is_litter , & ! Output: [logical (:) ] TRUE => pool is a litter pool - is_soil => decomp_cascade_con%is_soil , & ! Output: [logical (:) ] TRUE => pool is a soil pool - is_cwd => decomp_cascade_con%is_cwd , & ! Output: [logical (:) ] TRUE => pool is a cwd pool - initial_cn_ratio => decomp_cascade_con%initial_cn_ratio , & ! Output: [real(r8) (:) ] c:n ratio for initialization of pools - initial_stock => decomp_cascade_con%initial_stock , & ! Output: [real(r8) (:) ] initial concentration for seeding at spinup - is_metabolic => decomp_cascade_con%is_metabolic , & ! Output: [logical (:) ] TRUE => pool is metabolic material - is_cellulose => decomp_cascade_con%is_cellulose , & ! Output: [logical (:) ] TRUE => pool is cellulose - is_lignin => decomp_cascade_con%is_lignin , & ! Output: [logical (:) ] TRUE => pool is lignin - spinup_factor => decomp_cascade_con%spinup_factor & ! Output: [real(r8) (:) ] factor for AD spinup associated with each pool - ) - - !------- time-constant coefficients ---------- ! - ! set soil organic matter compartment C:N ratios (from Biome-BGC v4.2.0) - cn_s1=params_inst%cn_s1_cn - cn_s2=params_inst%cn_s2_cn - cn_s3=params_inst%cn_s3_cn - cn_s4=params_inst%cn_s4_cn - - ! set respiration fractions for fluxes between compartments - ! (from Biome-BGC v4.2.0) - rf_l1s1=params_inst%rf_l1s1_cn - rf_l2s2=params_inst%rf_l2s2_cn - rf_l3s3=params_inst%rf_l3s3_cn - rf_s1s2=params_inst%rf_s1s2_cn - rf_s2s3=params_inst%rf_s2s3_cn - rf_s3s4=params_inst%rf_s3s4_cn - - ! set the cellulose and lignin fractions for coarse woody debris - cwd_fcel=params_inst%cwd_fcel_cn - cwd_flig=params_inst%cwd_flig_cn - - !------------------- list of pools and their attributes ------------ - - floating_cn_ratio_decomp_pools(i_litr1) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_litr1) = 'litr1' - decomp_cascade_con%decomp_pool_name_history(i_litr1) = 'LITR1' - decomp_cascade_con%decomp_pool_name_long(i_litr1) = 'litter 1' - decomp_cascade_con%decomp_pool_name_short(i_litr1) = 'L1' - is_litter(i_litr1) = .true. - is_soil(i_litr1) = .false. - is_cwd(i_litr1) = .false. - initial_cn_ratio(i_litr1) = 90._r8 - initial_stock(i_litr1) = 0._r8 - is_metabolic(i_litr1) = .true. - is_cellulose(i_litr1) = .false. - is_lignin(i_litr1) = .false. - - i_litr2 = i_litr1 + 1 - floating_cn_ratio_decomp_pools(i_litr2) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_litr2) = 'litr2' - decomp_cascade_con%decomp_pool_name_history(i_litr2) = 'LITR2' - decomp_cascade_con%decomp_pool_name_long(i_litr2) = 'litter 2' - decomp_cascade_con%decomp_pool_name_short(i_litr2) = 'L2' - is_litter(i_litr2) = .true. - is_soil(i_litr2) = .false. - is_cwd(i_litr2) = .false. - initial_cn_ratio(i_litr2) = 90._r8 - initial_stock(i_litr2) = 0._r8 - is_metabolic(i_litr2) = .false. - is_cellulose(i_litr2) = .true. - is_lignin(i_litr2) = .false. - - i_litr3 = i_litr2 + 1 - floating_cn_ratio_decomp_pools(i_litr3) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_litr3) = 'litr3' - decomp_cascade_con%decomp_pool_name_history(i_litr3) = 'LITR3' - decomp_cascade_con%decomp_pool_name_long(i_litr3) = 'litter 3' - decomp_cascade_con%decomp_pool_name_short(i_litr3) = 'L3' - is_litter(i_litr3) = .true. - is_soil(i_litr3) = .false. - is_cwd(i_litr3) = .false. - initial_cn_ratio(i_litr3) = 90._r8 - initial_stock(i_litr3) = 0._r8 - is_metabolic(i_litr3) = .false. - is_cellulose(i_litr3) = .false. - is_lignin(i_litr3) = .true. - - i_soil1 = i_litr3 + 1 - floating_cn_ratio_decomp_pools(i_soil1) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil1) = 'soil1' - decomp_cascade_con%decomp_pool_name_history(i_soil1) = 'SOIL1' - decomp_cascade_con%decomp_pool_name_long(i_soil1) = 'soil 1' - decomp_cascade_con%decomp_pool_name_short(i_soil1) = 'S1' - is_litter(i_soil1) = .false. - is_soil(i_soil1) = .true. - is_cwd(i_soil1) = .false. - initial_cn_ratio(i_soil1) = cn_s1 - initial_stock(i_soil1) = 0._r8 - is_metabolic(i_soil1) = .false. - is_cellulose(i_soil1) = .false. - is_lignin(i_soil1) = .false. - - i_soil2 = i_soil1 + 1 - floating_cn_ratio_decomp_pools(i_soil2) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil2) = 'soil2' - decomp_cascade_con%decomp_pool_name_history(i_soil2) = 'SOIL2' - decomp_cascade_con%decomp_pool_name_long(i_soil2) = 'soil 2' - decomp_cascade_con%decomp_pool_name_short(i_soil2) = 'S2' - is_litter(i_soil2) = .false. - is_soil(i_soil2) = .true. - is_cwd(i_soil2) = .false. - initial_cn_ratio(i_soil2) = cn_s2 - initial_stock(i_soil2) = 0._r8 - is_metabolic(i_soil2) = .false. - is_cellulose(i_soil2) = .false. - is_lignin(i_soil2) = .false. - - i_soil3 = i_soil2 + 1 - floating_cn_ratio_decomp_pools(i_soil3) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil3) = 'soil3' - decomp_cascade_con%decomp_pool_name_history(i_soil3) = 'SOIL3' - decomp_cascade_con%decomp_pool_name_long(i_soil3) = 'soil 3' - decomp_cascade_con%decomp_pool_name_short(i_soil3) = 'S3' - is_litter(i_soil3) = .false. - is_soil(i_soil3) = .true. - is_cwd(i_soil3) = .false. - initial_cn_ratio(i_soil3) = cn_s3 - initial_stock(i_soil3) = 0._r8 - is_metabolic(i_soil3) = .false. - is_cellulose(i_soil3) = .false. - is_lignin(i_soil3) = .false. - - i_soil4 = i_soil3 + 1 - floating_cn_ratio_decomp_pools(i_soil4) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil4) = 'soil4' - decomp_cascade_con%decomp_pool_name_history(i_soil4) = 'SOIL4' - decomp_cascade_con%decomp_pool_name_long(i_soil4) = 'soil 4' - decomp_cascade_con%decomp_pool_name_short(i_soil4) = 'S4' - is_litter(i_soil4) = .false. - is_soil(i_soil4) = .true. - is_cwd(i_soil4) = .false. - initial_cn_ratio(i_soil4) = cn_s4 - initial_stock(i_soil4) = 10._r8 - is_metabolic(i_soil4) = .false. - is_cellulose(i_soil4) = .false. - is_lignin(i_soil4) = .false. - - if (.not. use_fates) then - i_cwd = i_soil4 + 1 - floating_cn_ratio_decomp_pools(i_cwd) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_cwd) = 'cwd' - decomp_cascade_con%decomp_pool_name_history(i_cwd) = 'CWD' - decomp_cascade_con%decomp_pool_name_long(i_cwd) = 'coarse woody debris' - decomp_cascade_con%decomp_pool_name_short(i_cwd) = 'CWD' - is_litter(i_cwd) = .false. - is_soil(i_cwd) = .false. - is_cwd(i_cwd) = .true. - initial_cn_ratio(i_cwd) = 500._r8 - initial_stock(i_cwd) = 0._r8 - is_metabolic(i_cwd) = .false. - is_cellulose(i_cwd) = .false. - is_lignin(i_cwd) = .false. - end if - - floating_cn_ratio_decomp_pools(i_atm) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_atm) = 'atmosphere' - decomp_cascade_con%decomp_pool_name_history(i_atm) = 'atmosphere' - decomp_cascade_con%decomp_pool_name_long(i_atm) = 'atmosphere' - decomp_cascade_con%decomp_pool_name_short(i_atm) = '' - is_litter(i_atm) = .true. - is_soil(i_atm) = .false. - is_cwd(i_atm) = .false. - initial_cn_ratio(i_atm) = 0._r8 - initial_stock(i_atm) = 0._r8 - is_metabolic(i_atm) = .false. - is_cellulose(i_atm) = .false. - is_lignin(i_atm) = .false. - - - spinup_factor(i_litr1) = 1._r8 - spinup_factor(i_litr2) = 1._r8 - spinup_factor(i_litr3) = 1._r8 - if (.not. use_fates) then - spinup_factor(i_cwd) = 1._r8 - end if - spinup_factor(i_soil1) = params_inst%spinup_vector(1) - spinup_factor(i_soil2) = params_inst%spinup_vector(2) - spinup_factor(i_soil3) = params_inst%spinup_vector(3) - spinup_factor(i_soil4) = params_inst%spinup_vector(4) - - - !---------------- list of transitions and their time-independent coefficients ---------------! - i_l1s1 = 1 - decomp_cascade_con%cascade_step_name(i_l1s1) = 'L1S1' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = rf_l1s1 - cascade_donor_pool(i_l1s1) = i_litr1 - cascade_receiver_pool(i_l1s1) = i_soil1 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = 1.0_r8 - - i_l2s2 = 2 - decomp_cascade_con%cascade_step_name(i_l2s2) = 'L2S2' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s2) = rf_l2s2 - cascade_donor_pool(i_l2s2) = i_litr2 - cascade_receiver_pool(i_l2s2) = i_soil2 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s2) = 1.0_r8 - - i_l3s3 = 3 - decomp_cascade_con%cascade_step_name(i_l3s3) = 'L3S3' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s3) = rf_l3s3 - cascade_donor_pool(i_l3s3) = i_litr3 - cascade_receiver_pool(i_l3s3) = i_soil3 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s3) = 1.0_r8 - - i_s1s2 = 4 - decomp_cascade_con%cascade_step_name(i_s1s2) = 'S1S2' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = rf_s1s2 - cascade_donor_pool(i_s1s2) = i_soil1 - cascade_receiver_pool(i_s1s2) = i_soil2 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = 1.0_r8 - - i_s2s3 = 5 - decomp_cascade_con%cascade_step_name(i_s2s3) = 'S2S3' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = rf_s2s3 - cascade_donor_pool(i_s2s3) = i_soil2 - cascade_receiver_pool(i_s2s3) = i_soil3 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = 1.0_r8 - - i_s3s4 = 6 - decomp_cascade_con%cascade_step_name(i_s3s4) = 'S3S4' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s4) = rf_s3s4 - cascade_donor_pool(i_s3s4) = i_soil3 - cascade_receiver_pool(i_s3s4) = i_soil4 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s4) = 1.0_r8 - - i_s4atm = 7 - decomp_cascade_con%cascade_step_name(i_s4atm) = 'S4' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s4atm) = 1. - cascade_donor_pool(i_s4atm) = i_soil4 - cascade_receiver_pool(i_s4atm) = i_atm - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s4atm) = 1.0_r8 - - if (.not. use_fates) then - i_cwdl2 = 8 - decomp_cascade_con%cascade_step_name(i_cwdl2) = 'CWDL2' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl2) = 0._r8 - cascade_donor_pool(i_cwdl2) = i_cwd - cascade_receiver_pool(i_cwdl2) = i_litr2 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl2) = cwd_fcel - - i_cwdl3 = 9 - decomp_cascade_con%cascade_step_name(i_cwdl3) = 'CWDL3' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl3) = 0._r8 - cascade_donor_pool(i_cwdl3) = i_cwd - cascade_receiver_pool(i_cwdl3) = i_litr3 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl3) = cwd_flig - end if - - end associate - - end subroutine init_decompcascade_cn - - !----------------------------------------------------------------------- - subroutine decomp_rate_constants_cn(bounds, & - num_soilc, filter_soilc, & - soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) - ! - ! !DESCRIPTION: - ! calculate rate constants and decomposition pathways for the BGC model - ! originally implemented in CLM-CN - ! written by C. Koven based on original CLM4 decomposition cascade by P. Thornton - ! - ! !USES: - use clm_time_manager, only : get_step_size_real - use clm_varcon , only : secspday - use clm_varpar , only : i_cwd - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(ch4_type) , intent(in) :: ch4_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - ! - ! !LOCAL VARIABLES: - real(r8):: dt ! decomp timestep (seconds) - real(r8):: dtd ! decomp timestep (days) - real(r8):: frw(bounds%begc:bounds%endc) ! rooting fraction weight - real(r8), allocatable:: fr(:,:) ! column-level rooting fraction by soil depth - real(r8):: minpsi, maxpsi ! limits for soil water scalar for decomp - real(r8):: psi ! temporary soilpsi for water scalar - real(r8):: rate_scalar ! combined rate scalar for decomp - real(r8):: k_l1 ! decomposition rate constant litter 1 - real(r8):: k_l2 ! decomposition rate constant litter 2 - real(r8):: k_l3 ! decomposition rate constant litter 3 - real(r8):: k_s1 ! decomposition rate constant SOM 1 - real(r8):: k_s2 ! decomposition rate constant SOM 2 - real(r8):: k_s3 ! decomposition rate constant SOM 3 - real(r8):: k_s4 ! decomposition rate constant SOM 4 - real(r8):: k_frag ! fragmentation rate constant CWD - integer :: c, fc, j, k, l - real(r8):: Q10 ! temperature dependence - real(r8):: froz_q10 ! separate q10 for frozen soil respiration rates. default to same as above zero rates - real(r8):: decomp_depth_efolding ! (meters) e-folding depth for reduction in decomposition [ - real(r8):: depth_scalar(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8) :: mino2lim ! minimum anaerobic decomposition rate as a - ! fraction of potential aerobic rate - !----------------------------------------------------------------------- - - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] soil layer thickness (m) - - soilpsi => soilstate_inst%soilpsi_col , & ! Input: [real(r8) (:,:) ] soil water potential in each soil layer (MPa) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - - o2stress_sat => ch4_inst%o2stress_sat_col , & ! Input: [real(r8) (:,:) ] Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - o2stress_unsat => ch4_inst%o2stress_unsat_col , & ! Input: [real(r8) (:,:) ] Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area (excluding dedicated wetland columns) - - t_scalar => soilbiogeochem_carbonflux_inst%t_scalar_col , & ! Output: [real(r8) (:,:) ] soil temperature scalar for decomp - w_scalar => soilbiogeochem_carbonflux_inst%w_scalar_col , & ! Output: [real(r8) (:,:) ] soil water scalar for decomp - o_scalar => soilbiogeochem_carbonflux_inst%o_scalar_col , & ! Output: [real(r8) (:,:) ] fraction by which decomposition is limited by anoxia - decomp_k => soilbiogeochem_carbonflux_inst%decomp_k_col & ! Output: [real(r8) (:,:,:) ] rate constant for decomposition (1./sec) - ) - - mino2lim = CNParamsShareInst%mino2lim - - ! set time steps - dt = get_step_size_real() - dtd = dt/secspday - - ! set initial base rates for decomposition mass loss (1/day) - ! (from Biome-BGC v4.2.0, using three SOM pools) - ! Value inside log function is the discrete-time values for a - ! daily time step model, and the result of the log function is - ! the corresponding continuous-time decay rate (1/day), following - ! Olson, 1963. - k_l1=params_inst%k_l1_cn - k_l2=params_inst%k_l2_cn - k_l3=params_inst%k_l3_cn - - k_s1=params_inst%k_s1_cn - k_s2=params_inst%k_s2_cn - k_s3=params_inst%k_s3_cn - k_s4=params_inst%k_s4_cn - - k_frag=params_inst%k_frag_cn - - ! calculate the new discrete-time decay rate for model timestep - k_l1 = 1.0_r8-exp(-k_l1*dtd) - k_l2 = 1.0_r8-exp(-k_l2*dtd) - k_l3 = 1.0_r8-exp(-k_l3*dtd) - - k_s1 = 1.0_r8-exp(-k_s1*dtd) - k_s2 = 1.0_r8-exp(-k_s2*dtd) - k_s3 = 1.0_r8-exp(-k_s3*dtd) - k_s4 = 1.0_r8-exp(-k_s4*dtd) - - k_frag = 1.0_r8-exp(-k_frag*dtd) - - minpsi = params_inst%minpsi_cn - maxpsi = params_inst%maxpsi_cn - - Q10 = CNParamsShareInst%Q10 - - ! set "froz_q10" parameter - froz_q10 = CNParamsShareInst%froz_q10 - - if (use_vertsoilc) then - ! Set "decomp_depth_efolding" parameter - decomp_depth_efolding = CNParamsShareInst%decomp_depth_efolding - end if - - ! The following code implements the acceleration part of the AD spinup - ! algorithm, by multiplying all of the SOM decomposition base rates by - ! spinup_vector, scalar between 1 and 70X, defined as a constant for each - ! pool here - - if ( spinup_state .eq. 1 ) then - k_s1 = k_s1 * params_inst%spinup_vector(1) - k_s2 = k_s2 * params_inst%spinup_vector(2) - k_s3 = k_s3 * params_inst%spinup_vector(3) - k_s4 = k_s4 * params_inst%spinup_vector(4) - endif - - !--- time dependent coefficients-----! - if ( nlevdecomp .eq. 1 ) then - - ! calculate function to weight the temperature and water potential scalars - ! for decomposition control. - - - ! the following normalizes values in fr so that they - ! sum to 1.0 across top nlevdecomp levels on a column - frw(bounds%begc:bounds%endc) = 0._r8 - nlev_soildecomp_standard=5 - allocate(fr(bounds%begc:bounds%endc,nlev_soildecomp_standard)) - do j=1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - frw(c) = frw(c) + dz(c,j) - end do - end do - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (frw(c) /= 0._r8) then - fr(c,j) = dz(c,j) / frw(c) - else - fr(c,j) = 0._r8 - end if - end do - end do - - ! calculate rate constant scalar for soil temperature - ! assuming that the base rate constants are assigned for non-moisture - ! limiting conditions at 25 C. - ! Peter Thornton: 3/13/09 - ! Replaced the Lloyd and Taylor function with a Q10 formula, with Q10 = 1.5 - ! as part of the modifications made to improve the seasonal cycle of - ! atmospheric CO2 concentration in global simulations. This does not impact - ! the base rates at 25 C, which are calibrated from microcosm studies. - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (j==1) t_scalar(c,:) = 0._r8 - !! use separate (possibly equal) t funcs above and below freezing point - !! t_scalar(c,1)=t_scalar(c,1) + (1.5**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8))*fr(c,j) - if (t_soisno(c,j) >= SHR_CONST_TKFRZ) then - t_scalar(c,1)=t_scalar(c,1) + & - (Q10**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8))*fr(c,j) - else - t_scalar(c,1)=t_scalar(c,1) + & - (Q10**(-25._r8/10._r8))*(froz_q10**((t_soisno(c,j)-SHR_CONST_TKFRZ)/10._r8))*fr(c,j) - endif - end do - end do - - ! calculate the rate constant scalar for soil water content. - ! Uses the log relationship with water potential given in - ! Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: - ! a comparison of models. Ecology, 68(5):1190-1200. - ! and supported by data in - ! Orchard, V.A., and F.J. Cook, 1983. Relationship between soil respiration - ! and soil moisture. Soil Biol. Biochem., 15(4):447-453. - - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (j==1) w_scalar(c,:) = 0._r8 - psi = min(soilpsi(c,j),maxpsi) - ! decomp only if soilpsi is higher than minpsi - if (psi > minpsi) then - w_scalar(c,1) = w_scalar(c,1) + (log(minpsi/psi)/log(minpsi/maxpsi))*fr(c,j) - end if - end do - end do - - if (use_lch4) then - ! Calculate ANOXIA - if (anoxia) then - ! Check for anoxia w/o LCH4 now done in controlMod. - - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (j==1) o_scalar(c,:) = 0._r8 - - o_scalar(c,1) = o_scalar(c,1) + fr(c,j) * max(o2stress_unsat(c,j), mino2lim) - end do - end do - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - - deallocate(fr) - - else - - ! calculate rate constant scalar for soil temperature - ! assuming that the base rate constants are assigned for non-moisture - ! limiting conditions at 25 C. - ! Peter Thornton: 3/13/09 - ! Replaced the Lloyd and Taylor function with a Q10 formula, with Q10 = 1.5 - ! as part of the modifications made to improve the seasonal cycle of - ! atmospheric CO2 concentration in global simulations. This does not impact - ! the base rates at 25 C, which are calibrated from microcosm studies. - - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - !! use separate (possibly equal) t funcs above and below freezing point - !! t_scalar(c,j)= (1.5**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8)) - if (t_soisno(c,j) >= SHR_CONST_TKFRZ) then - t_scalar(c,j)= (Q10**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8)) - else - t_scalar(c,j)= (Q10**(-25._r8/10._r8))*(froz_q10**((t_soisno(c,j)-SHR_CONST_TKFRZ)/10._r8)) - endif - end do - end do - - - ! calculate the rate constant scalar for soil water content. - ! Uses the log relationship with water potential given in - ! Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: - ! a comparison of models. Ecology, 68(5):1190-1200. - ! and supported by data in - ! Orchard, V.A., and F.J. Cook, 1983. Relationship between soil respiration - ! and soil moisture. Soil Biol. Biochem., 15(4):447-453. - - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - psi = min(soilpsi(c,j),maxpsi) - ! decomp only if soilpsi is higher than minpsi - if (psi > minpsi) then - w_scalar(c,j) = (log(minpsi/psi)/log(minpsi/maxpsi)) - else - w_scalar(c,j) = 0._r8 - end if - end do - end do - - end if - - if (use_lch4) then - ! Calculate ANOXIA - ! Check for anoxia w/o LCH4 now done in controlMod. - - if (anoxia) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - o_scalar(c,j) = max(o2stress_unsat(c,j), mino2lim) - end do - end do - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - - ! add a term to reduce decomposition rate at depth - ! for now used a fixed e-folding depth - do j = 1, nlevdecomp - do fc = 1, num_soilc - c = filter_soilc(fc) - if (use_vertsoilc) then - depth_scalar(c,j) = exp(-zsoi(j) / decomp_depth_efolding) - else - depth_scalar(c,j) = 1.0_r8 - end if - end do - end do - - ! calculate rate constants for all litter and som pools - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_litr2) = k_l2 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_litr3) = k_l3 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil4) = k_s4 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) / dt - ! same for cwd but only if fates is not enabled; fates handles CWD - ! on its own structure - if (.not. use_fates) then - decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) / dt - end if - end do - end do - - end associate - - end subroutine decomp_rate_constants_cn - - end module SoilBiogeochemDecompCascadeCNMod diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 index 3d45afef75..e62971ce59 100644 --- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 @@ -6,14 +6,17 @@ module SoilBiogeochemDecompCascadeConType ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 + use abortutils , only : endrun use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools + use clm_varcon , only : ispval ! implicit none private ! ! !PUBLIC MEMBER FUNCTIONS: - public :: init_decomp_cascade_constants + public :: decomp_cascade_par_init ! Initialize the parameters + public :: init_decomp_cascade_constants ! Initialize the constants ! type, public :: decomp_cascade_type !-- properties of each pathway along decomposition cascade @@ -40,69 +43,161 @@ module SoilBiogeochemDecompCascadeConType end type decomp_cascade_type integer, public, parameter :: i_atm = 0 ! for terminal pools (i.e. 100% respiration) (only used for CN not for BGC) + integer, public, parameter :: no_soil_decomp = 0 ! No soil decomposition is done + integer, public, parameter :: century_decomp = 1 ! CENTURY decomposition method type + integer, public :: decomp_method = ispval ! Type of decomposition to use type(decomp_cascade_type), public :: decomp_cascade_con !------------------------------------------------------------------------ contains !------------------------------------------------------------------------ - subroutine init_decomp_cascade_constants( use_century_decomp ) - ! - ! !DESCRIPTION: - ! Initialize decomposition cascade state - !------------------------------------------------------------------------ + subroutine decomp_cascade_par_init( NLFilename ) + use clm_varctl , only : use_fates, use_cn + use clm_varpar , only : ndecomp_pools_max + use spmdMod , only : masterproc, mpicom + use clm_nlUtilsMod , only : find_nlgroup_name + use shr_mpi_mod , only : shr_mpi_bcast ! !ARGUMENTS: - logical, intent(IN) :: use_century_decomp + character(len=*), intent(in) :: NLFilename ! Namelist filename ! !LOGAL VARIABLES: - integer :: ibeg ! Beginning index for allocated arrays + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + character(len=20) :: soil_decomp_method ! String description of soil decomposition method to use + character(len=*), parameter :: nmlname = 'soilbgc_decomp' + namelist/soilbgc_decomp/ soil_decomp_method - if ( use_century_decomp ) then - ibeg = 1 + ! Default value + soil_decomp_method = 'UNSET' + ! Read in soil BGC decomposition namelist + if (masterproc) then + open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call find_nlgroup_name(nu_nml, nmlname, status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=soilbgc_decomp,iostat=nml_error) + if (nml_error /= 0) then + call endrun('trouble reading '//nmlname//' namelist') + end if + else + call endrun('trouble finding '//nmlname//' namelist') + end if + close(nu_nml) + select case( soil_decomp_method ) + case( 'None' ) + decomp_method = no_soil_decomp + case( 'CENTURYKoven2013' ) + decomp_method = century_decomp + case default + call endrun('Bad soil_decomp_method = '//soil_decomp_method ) + end select + endif + ! Broadcast namelist items to all processors + call shr_mpi_bcast(decomp_method, mpicom) + ! Don't do anything if neither FATES or BGC is on + if ( use_fates .or. use_cn ) then + if ( decomp_method == no_soil_decomp )then + call endrun('When running with FATES or BGC an active soil_decomp_method must be used') + end if + ! We hardwire these parameters here because we use them + ! in InitAllocate (in SoilBiogeochemStateType) which is called earlier than + ! init_decompcascade_bgc where they might have otherwise been derived on the + ! fly. For reference, if they were determined in init_decompcascade_bgc: + ! ndecomp_pools would get the value of i_pas_som or i_cwd and + ! ndecomp_cascade_transitions would get the value of i_s3s1 or i_cwdl3 + ! depending on how use_fates is set. + if ( use_fates ) then + if (decomp_method == century_decomp) then + ndecomp_pools = 6 + ndecomp_cascade_transitions = 8 + else ! TODO slevis: Currently for CN. MIMICS will get its own. + ndecomp_pools = 7 + ndecomp_cascade_transitions = 7 + end if + else + if (decomp_method == century_decomp) then + ndecomp_pools = 7 + ndecomp_cascade_transitions = 10 + else ! TODO slevis: Currently for CN. MIMICS will get its own. + ndecomp_pools = 8 + ndecomp_cascade_transitions = 9 + end if + endif + ! The next param also appears as a dimension in the params files dated + ! c210418.nc and later + ndecomp_pools_max = 8 ! largest ndecomp_pools value above else - ibeg = i_atm + if ( decomp_method /= no_soil_decomp )then + call endrun('When running without FATES or BGC soil_decomp_method must be None') + end if + + ndecomp_pools = 7 + ndecomp_cascade_transitions = 7 + ndecomp_pools_max = 8 end if - !-- properties of each pathway along decomposition cascade - allocate(decomp_cascade_con%cascade_step_name(1:ndecomp_cascade_transitions)) - allocate(decomp_cascade_con%cascade_donor_pool(1:ndecomp_cascade_transitions)) - allocate(decomp_cascade_con%cascade_receiver_pool(1:ndecomp_cascade_transitions)) - !-- properties of each decomposing pool - allocate(decomp_cascade_con%floating_cn_ratio_decomp_pools(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%decomp_pool_name_restart(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%decomp_pool_name_history(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%decomp_pool_name_long(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%decomp_pool_name_short(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%is_litter(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%is_soil(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%is_cwd(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%initial_cn_ratio(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%initial_stock(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%is_metabolic(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%is_cellulose(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%is_lignin(ibeg:ndecomp_pools)) - allocate(decomp_cascade_con%spinup_factor(1:ndecomp_pools)) + end subroutine decomp_cascade_par_init + + !------------------------------------------------------------------------ + subroutine init_decomp_cascade_constants( ) + ! + ! !DESCRIPTION: + ! Initialize decomposition cascade state + !------------------------------------------------------------------------ + ! !LOGAL VARIABLES: + integer :: ibeg ! Beginning index for allocated arrays + + ! + ! NOTE: Return early if soil decomposition isn't being done + ! + if ( decomp_method == ispval ) then + call endrun('soil_decomp_method was not set, but soil decomposition cascade initialization is being called' ) + else if ( decomp_method /= no_soil_decomp ) then - !-- properties of each pathway along decomposition cascade - decomp_cascade_con%cascade_step_name(1:ndecomp_cascade_transitions) = '' - decomp_cascade_con%cascade_donor_pool(1:ndecomp_cascade_transitions) = 0 - decomp_cascade_con%cascade_receiver_pool(1:ndecomp_cascade_transitions) = 0 + ibeg = 1 - !-- first initialization of properties of each decomposing pool - decomp_cascade_con%floating_cn_ratio_decomp_pools(ibeg:ndecomp_pools) = .false. - decomp_cascade_con%decomp_pool_name_history(ibeg:ndecomp_pools) = '' - decomp_cascade_con%decomp_pool_name_restart(ibeg:ndecomp_pools) = '' - decomp_cascade_con%decomp_pool_name_long(ibeg:ndecomp_pools) = '' - decomp_cascade_con%decomp_pool_name_short(ibeg:ndecomp_pools) = '' - decomp_cascade_con%is_litter(ibeg:ndecomp_pools) = .false. - decomp_cascade_con%is_soil(ibeg:ndecomp_pools) = .false. - decomp_cascade_con%is_cwd(ibeg:ndecomp_pools) = .false. - decomp_cascade_con%initial_cn_ratio(ibeg:ndecomp_pools) = nan - decomp_cascade_con%initial_stock(ibeg:ndecomp_pools) = nan - decomp_cascade_con%initial_stock_soildepth = 0.3 - decomp_cascade_con%is_metabolic(ibeg:ndecomp_pools) = .false. - decomp_cascade_con%is_cellulose(ibeg:ndecomp_pools) = .false. - decomp_cascade_con%is_lignin(ibeg:ndecomp_pools) = .false. - decomp_cascade_con%spinup_factor(1:ndecomp_pools) = nan + !-- properties of each pathway along decomposition cascade + allocate(decomp_cascade_con%cascade_step_name(1:ndecomp_cascade_transitions)) + allocate(decomp_cascade_con%cascade_donor_pool(1:ndecomp_cascade_transitions)) + allocate(decomp_cascade_con%cascade_receiver_pool(1:ndecomp_cascade_transitions)) + + !-- properties of each decomposing pool + allocate(decomp_cascade_con%floating_cn_ratio_decomp_pools(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%decomp_pool_name_restart(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%decomp_pool_name_history(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%decomp_pool_name_long(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%decomp_pool_name_short(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%is_litter(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%is_soil(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%is_cwd(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%initial_cn_ratio(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%initial_stock(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%is_metabolic(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%is_cellulose(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%is_lignin(ibeg:ndecomp_pools)) + allocate(decomp_cascade_con%spinup_factor(1:ndecomp_pools)) + + !-- properties of each pathway along decomposition cascade + decomp_cascade_con%cascade_step_name(1:ndecomp_cascade_transitions) = '' + decomp_cascade_con%cascade_donor_pool(1:ndecomp_cascade_transitions) = 0 + decomp_cascade_con%cascade_receiver_pool(1:ndecomp_cascade_transitions) = 0 + + !-- first initialization of properties of each decomposing pool + decomp_cascade_con%floating_cn_ratio_decomp_pools(ibeg:ndecomp_pools) = .false. + decomp_cascade_con%decomp_pool_name_history(ibeg:ndecomp_pools) = '' + decomp_cascade_con%decomp_pool_name_restart(ibeg:ndecomp_pools) = '' + decomp_cascade_con%decomp_pool_name_long(ibeg:ndecomp_pools) = '' + decomp_cascade_con%decomp_pool_name_short(ibeg:ndecomp_pools) = '' + decomp_cascade_con%is_litter(ibeg:ndecomp_pools) = .false. + decomp_cascade_con%is_soil(ibeg:ndecomp_pools) = .false. + decomp_cascade_con%is_cwd(ibeg:ndecomp_pools) = .false. + decomp_cascade_con%initial_cn_ratio(ibeg:ndecomp_pools) = nan + decomp_cascade_con%initial_stock(ibeg:ndecomp_pools) = nan + decomp_cascade_con%initial_stock_soildepth = 0.3 + decomp_cascade_con%is_metabolic(ibeg:ndecomp_pools) = .false. + decomp_cascade_con%is_cellulose(ibeg:ndecomp_pools) = .false. + decomp_cascade_con%is_lignin(ibeg:ndecomp_pools) = .false. + decomp_cascade_con%spinup_factor(1:ndecomp_pools) = nan + end if end subroutine init_decomp_cascade_constants diff --git a/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 b/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 index 0e3b3b69e7..852852733d 100644 --- a/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 @@ -5,7 +5,7 @@ module SoilBiogeochemLittVertTranspMod ! use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog, use_c13, use_c14, spinup_state, use_vertsoilc, use_fates, use_cn + use clm_varctl , only : iulog, use_c13, use_c14, spinup_state, use_fates, use_cn use clm_varcon , only : secspday use decompMod , only : bounds_type use abortutils , only : endrun @@ -186,57 +186,54 @@ subroutine SoilBiogeochemLittVertTransp(bounds, num_soilc, filter_soilc, & spinup_term = 1._r8 epsilon = 1.e-30 - if (use_vertsoilc) then - !------ first get diffusivity / advection terms -------! - ! use different mixing rates for bioturbation and cryoturbation, with fixed bioturbation and cryoturbation set to a maximum depth - do fc = 1, num_soilc - c = filter_soilc (fc) - if (( max(altmax(c), altmax_lastyear(c)) <= max_altdepth_cryoturbation ) .and. & - ( max(altmax(c), altmax_lastyear(c)) > 0._r8) ) then - ! use mixing profile modified slightly from Koven et al. (2009): constant through active layer, linear decrease from base of active layer to zero at a fixed depth - do j = 1,nlevdecomp+1 - if ( j <= col%nbedrock(c)+1 ) then - if ( zisoi(j) < max(altmax(c), altmax_lastyear(c)) ) then - som_diffus_coef(c,j) = cryoturb_diffusion_k - som_adv_coef(c,j) = 0._r8 - else - som_diffus_coef(c,j) = max(cryoturb_diffusion_k * & - ( 1._r8 - ( zisoi(j) - max(altmax(c), altmax_lastyear(c)) ) / & - ( min(max_depth_cryoturb, zisoi(col%nbedrock(c)+1)) - max(altmax(c), altmax_lastyear(c)) ) ), 0._r8) ! go linearly to zero between ALT and max_depth_cryoturb - som_adv_coef(c,j) = 0._r8 - endif - else + !------ first get diffusivity / advection terms -------! + ! use different mixing rates for bioturbation and cryoturbation, with fixed bioturbation and cryoturbation set to a maximum depth + do fc = 1, num_soilc + c = filter_soilc (fc) + if (( max(altmax(c), altmax_lastyear(c)) <= max_altdepth_cryoturbation ) .and. & + ( max(altmax(c), altmax_lastyear(c)) > 0._r8) ) then + ! use mixing profile modified slightly from Koven et al. (2009): constant through active layer, linear decrease from base of active layer to zero at a fixed depth + do j = 1,nlevdecomp+1 + if ( j <= col%nbedrock(c)+1 ) then + if ( zisoi(j) < max(altmax(c), altmax_lastyear(c)) ) then + som_diffus_coef(c,j) = cryoturb_diffusion_k som_adv_coef(c,j) = 0._r8 - som_diffus_coef(c,j) = 0._r8 - endif - end do - elseif ( max(altmax(c), altmax_lastyear(c)) > 0._r8 ) then - ! constant advection, constant diffusion - do j = 1,nlevdecomp+1 - if ( j <= col%nbedrock(c)+1 ) then - som_adv_coef(c,j) = som_adv_flux - som_diffus_coef(c,j) = som_diffus else + som_diffus_coef(c,j) = max(cryoturb_diffusion_k * & + ( 1._r8 - ( zisoi(j) - max(altmax(c), altmax_lastyear(c)) ) / & + ( min(max_depth_cryoturb, zisoi(col%nbedrock(c)+1)) - max(altmax(c), altmax_lastyear(c)) ) ), 0._r8) ! go linearly to zero between ALT and max_depth_cryoturb som_adv_coef(c,j) = 0._r8 - som_diffus_coef(c,j) = 0._r8 endif - end do - else - ! completely frozen soils--no mixing - do j = 1,nlevdecomp+1 + else som_adv_coef(c,j) = 0._r8 som_diffus_coef(c,j) = 0._r8 - end do - endif - end do - - ! Set the distance between the node and the one ABOVE it - dz_node(1) = zsoi(1) - do j = 2,nlevdecomp+1 - dz_node(j)= zsoi(j) - zsoi(j-1) - enddo + endif + end do + elseif ( max(altmax(c), altmax_lastyear(c)) > 0._r8 ) then + ! constant advection, constant diffusion + do j = 1,nlevdecomp+1 + if ( j <= col%nbedrock(c)+1 ) then + som_adv_coef(c,j) = som_adv_flux + som_diffus_coef(c,j) = som_diffus + else + som_adv_coef(c,j) = 0._r8 + som_diffus_coef(c,j) = 0._r8 + endif + end do + else + ! completely frozen soils--no mixing + do j = 1,nlevdecomp+1 + som_adv_coef(c,j) = 0._r8 + som_diffus_coef(c,j) = 0._r8 + end do + endif + end do - endif + ! Set the distance between the node and the one ABOVE it + dz_node(1) = zsoi(1) + do j = 2,nlevdecomp+1 + dz_node(j)= zsoi(j) - zsoi(j-1) + enddo !------ loop over litter/som types do i_type = 1, ntype @@ -276,230 +273,210 @@ subroutine SoilBiogeochemLittVertTransp(bounds, num_soilc, filter_soilc, & endif end select - if (use_vertsoilc) then - - do s = 1, ndecomp_pools + do s = 1, ndecomp_pools - if ( .not. is_cwd(s) ) then + if ( .not. is_cwd(s) ) then - do j = 1,nlevdecomp+1 - do fc = 1, num_soilc - c = filter_soilc (fc) - ! - if ( spinup_state >= 1 ) then - ! increase transport (both advection and diffusion) by the same factor as accelerated decomposition for a given pool - spinup_term = spinup_factor(s) - else - spinup_term = 1._r8 - endif + do j = 1,nlevdecomp+1 + do fc = 1, num_soilc + c = filter_soilc (fc) + ! + if ( spinup_state >= 1 ) then + ! increase transport (both advection and diffusion) by the same factor as accelerated decomposition for a given pool + spinup_term = spinup_factor(s) + else + spinup_term = 1._r8 + endif - if (abs(spinup_term - 1._r8) > .000001_r8 ) then - spinup_term = spinup_term * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - endif + if (abs(spinup_term - 1._r8) > .000001_r8 ) then + spinup_term = spinup_term * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) + endif - if ( abs(som_adv_coef(c,j)) * spinup_term < epsilon ) then - adv_flux(c,j) = epsilon - else - adv_flux(c,j) = som_adv_coef(c,j) * spinup_term - endif - ! - if ( abs(som_diffus_coef(c,j)) * spinup_term < epsilon ) then - diffus(c,j) = epsilon - else - diffus(c,j) = som_diffus_coef(c,j) * spinup_term - endif - ! - end do + if ( abs(som_adv_coef(c,j)) * spinup_term < epsilon ) then + adv_flux(c,j) = epsilon + else + adv_flux(c,j) = som_adv_coef(c,j) * spinup_term + endif + ! + if ( abs(som_diffus_coef(c,j)) * spinup_term < epsilon ) then + diffus(c,j) = epsilon + else + diffus(c,j) = som_diffus_coef(c,j) * spinup_term + endif + ! end do + end do - ! Set Pe (Peclet #) and D/dz throughout column + ! Set Pe (Peclet #) and D/dz throughout column - do fc = 1, num_soilc ! dummy terms here - c = filter_soilc (fc) - conc_trcr(c,0) = 0._r8 - conc_trcr(c,col%nbedrock(c)+1:nlevdecomp+1) = 0._r8 - end do + do fc = 1, num_soilc ! dummy terms here + c = filter_soilc (fc) + conc_trcr(c,0) = 0._r8 + conc_trcr(c,col%nbedrock(c)+1:nlevdecomp+1) = 0._r8 + end do - do j = 1,nlevdecomp+1 - do fc = 1, num_soilc - c = filter_soilc (fc) - - conc_trcr(c,j) = conc_ptr(c,j,s) - - ! dz_tracer below is the difference between gridcell edges (dzsoi_decomp) - ! dz_node_tracer is difference between cell centers - - ! Calculate the D and F terms in the Patankar algorithm - if (j == 1) then - d_m1_zm1(c,j) = 0._r8 - w_p1 = (zsoi(j+1) - zisoi(j)) / dz_node(j+1) - if ( diffus(c,j+1) > 0._r8 .and. diffus(c,j) > 0._r8) then - d_p1 = 1._r8 / ((1._r8 - w_p1) / diffus(c,j) + w_p1 / diffus(c,j+1)) ! Harmonic mean of diffus - else - d_p1 = 0._r8 - endif - d_p1_zp1(c,j) = d_p1 / dz_node(j+1) - f_m1(c,j) = adv_flux(c,j) ! Include infiltration here - f_p1(c,j) = adv_flux(c,j+1) - pe_m1(c,j) = 0._r8 - pe_p1(c,j) = f_p1(c,j) / d_p1_zp1(c,j) ! Peclet # - elseif (j >= col%nbedrock(c)+1) then - ! At the bottom, assume no gradient in d_z (i.e., they're the same) - w_m1 = (zisoi(j-1) - zsoi(j-1)) / dz_node(j) - if ( diffus(c,j) > 0._r8 .and. diffus(c,j-1) > 0._r8) then - d_m1 = 1._r8 / ((1._r8 - w_m1) / diffus(c,j) + w_m1 / diffus(c,j-1)) ! Harmonic mean of diffus - else - d_m1 = 0._r8 - endif - d_m1_zm1(c,j) = d_m1 / dz_node(j) - d_p1_zp1(c,j) = d_m1_zm1(c,j) ! Set to be the same - f_m1(c,j) = adv_flux(c,j) - !f_p1(c,j) = adv_flux(c,j+1) - f_p1(c,j) = 0._r8 - pe_m1(c,j) = f_m1(c,j) / d_m1_zm1(c,j) ! Peclet # - pe_p1(c,j) = f_p1(c,j) / d_p1_zp1(c,j) ! Peclet # + do j = 1,nlevdecomp+1 + do fc = 1, num_soilc + c = filter_soilc (fc) + + conc_trcr(c,j) = conc_ptr(c,j,s) + + ! dz_tracer below is the difference between gridcell edges (dzsoi_decomp) + ! dz_node_tracer is difference between cell centers + + ! Calculate the D and F terms in the Patankar algorithm + if (j == 1) then + d_m1_zm1(c,j) = 0._r8 + w_p1 = (zsoi(j+1) - zisoi(j)) / dz_node(j+1) + if ( diffus(c,j+1) > 0._r8 .and. diffus(c,j) > 0._r8) then + d_p1 = 1._r8 / ((1._r8 - w_p1) / diffus(c,j) + w_p1 / diffus(c,j+1)) ! Harmonic mean of diffus else - ! Use distance from j-1 node to interface with j divided by distance between nodes - w_m1 = (zisoi(j-1) - zsoi(j-1)) / dz_node(j) - if ( diffus(c,j-1) > 0._r8 .and. diffus(c,j) > 0._r8) then - d_m1 = 1._r8 / ((1._r8 - w_m1) / diffus(c,j) + w_m1 / diffus(c,j-1)) ! Harmonic mean of diffus - else - d_m1 = 0._r8 - endif - w_p1 = (zsoi(j+1) - zisoi(j)) / dz_node(j+1) - if ( diffus(c,j+1) > 0._r8 .and. diffus(c,j) > 0._r8) then - d_p1 = 1._r8 / ((1._r8 - w_p1) / diffus(c,j) + w_p1 / diffus(c,j+1)) ! Harmonic mean of diffus - else - d_p1 = (1._r8 - w_m1) * diffus(c,j) + w_p1 * diffus(c,j+1) ! Arithmetic mean of diffus - endif - d_m1_zm1(c,j) = d_m1 / dz_node(j) - d_p1_zp1(c,j) = d_p1 / dz_node(j+1) - f_m1(c,j) = adv_flux(c,j) - f_p1(c,j) = adv_flux(c,j+1) - pe_m1(c,j) = f_m1(c,j) / d_m1_zm1(c,j) ! Peclet # - pe_p1(c,j) = f_p1(c,j) / d_p1_zp1(c,j) ! Peclet # - end if - enddo ! fc - enddo ! j; nlevdecomp - - - ! Calculate the tridiagonal coefficients - do j = 0,nlevdecomp +1 - do fc = 1, num_soilc - c = filter_soilc (fc) - ! g = cgridcell(c) - - if (j > 0 .and. j < nlevdecomp+1) then - a_p_0 = dzsoi_decomp(j) / dtime + d_p1 = 0._r8 endif - - if (j == 0) then ! top layer (atmosphere) - a_tri(c,j) = 0._r8 - b_tri(c,j) = 1._r8 - c_tri(c,j) = -1._r8 - r_tri(c,j) = 0._r8 - elseif (j == 1) then - a_tri(c,j) = -(d_m1_zm1(c,j) * aaa(pe_m1(c,j)) + max( f_m1(c,j), 0._r8)) ! Eqn 5.47 Patankar - c_tri(c,j) = -(d_p1_zp1(c,j) * aaa(pe_p1(c,j)) + max(-f_p1(c,j), 0._r8)) - b_tri(c,j) = -a_tri(c,j) - c_tri(c,j) + a_p_0 - r_tri(c,j) = source(c,j,s) * dzsoi_decomp(j) /dtime + (a_p_0 - adv_flux(c,j)) * conc_trcr(c,j) - elseif (j < nlevdecomp+1) then - a_tri(c,j) = -(d_m1_zm1(c,j) * aaa(pe_m1(c,j)) + max( f_m1(c,j), 0._r8)) ! Eqn 5.47 Patankar - c_tri(c,j) = -(d_p1_zp1(c,j) * aaa(pe_p1(c,j)) + max(-f_p1(c,j), 0._r8)) - b_tri(c,j) = -a_tri(c,j) - c_tri(c,j) + a_p_0 - r_tri(c,j) = source(c,j,s) * dzsoi_decomp(j) /dtime + a_p_0 * conc_trcr(c,j) - else ! j==nlevdecomp+1; 0 concentration gradient at bottom - a_tri(c,j) = -1._r8 - b_tri(c,j) = 1._r8 - c_tri(c,j) = 0._r8 - r_tri(c,j) = 0._r8 + d_p1_zp1(c,j) = d_p1 / dz_node(j+1) + f_m1(c,j) = adv_flux(c,j) ! Include infiltration here + f_p1(c,j) = adv_flux(c,j+1) + pe_m1(c,j) = 0._r8 + pe_p1(c,j) = f_p1(c,j) / d_p1_zp1(c,j) ! Peclet # + elseif (j >= col%nbedrock(c)+1) then + ! At the bottom, assume no gradient in d_z (i.e., they're the same) + w_m1 = (zisoi(j-1) - zsoi(j-1)) / dz_node(j) + if ( diffus(c,j) > 0._r8 .and. diffus(c,j-1) > 0._r8) then + d_m1 = 1._r8 / ((1._r8 - w_m1) / diffus(c,j) + w_m1 / diffus(c,j-1)) ! Harmonic mean of diffus + else + d_m1 = 0._r8 endif - enddo ! fc; column - enddo ! j; nlevdecomp + d_m1_zm1(c,j) = d_m1 / dz_node(j) + d_p1_zp1(c,j) = d_m1_zm1(c,j) ! Set to be the same + f_m1(c,j) = adv_flux(c,j) + !f_p1(c,j) = adv_flux(c,j+1) + f_p1(c,j) = 0._r8 + pe_m1(c,j) = f_m1(c,j) / d_m1_zm1(c,j) ! Peclet # + pe_p1(c,j) = f_p1(c,j) / d_p1_zp1(c,j) ! Peclet # + else + ! Use distance from j-1 node to interface with j divided by distance between nodes + w_m1 = (zisoi(j-1) - zsoi(j-1)) / dz_node(j) + if ( diffus(c,j-1) > 0._r8 .and. diffus(c,j) > 0._r8) then + d_m1 = 1._r8 / ((1._r8 - w_m1) / diffus(c,j) + w_m1 / diffus(c,j-1)) ! Harmonic mean of diffus + else + d_m1 = 0._r8 + endif + w_p1 = (zsoi(j+1) - zisoi(j)) / dz_node(j+1) + if ( diffus(c,j+1) > 0._r8 .and. diffus(c,j) > 0._r8) then + d_p1 = 1._r8 / ((1._r8 - w_p1) / diffus(c,j) + w_p1 / diffus(c,j+1)) ! Harmonic mean of diffus + else + d_p1 = (1._r8 - w_m1) * diffus(c,j) + w_p1 * diffus(c,j+1) ! Arithmetic mean of diffus + endif + d_m1_zm1(c,j) = d_m1 / dz_node(j) + d_p1_zp1(c,j) = d_p1 / dz_node(j+1) + f_m1(c,j) = adv_flux(c,j) + f_p1(c,j) = adv_flux(c,j+1) + pe_m1(c,j) = f_m1(c,j) / d_m1_zm1(c,j) ! Peclet # + pe_p1(c,j) = f_p1(c,j) / d_p1_zp1(c,j) ! Peclet # + end if + enddo ! fc + enddo ! j; nlevdecomp - do fc = 1, num_soilc - c = filter_soilc (fc) - jtop(c) = 0 - enddo - ! subtract initial concentration and source terms for tendency calculation + ! Calculate the tridiagonal coefficients + do j = 0,nlevdecomp +1 do fc = 1, num_soilc c = filter_soilc (fc) - do j = 1, nlevdecomp - trcr_tendency_ptr(c,j,s) = 0.-(conc_trcr(c,j) + source(c,j,s)) - end do - end do + ! g = cgridcell(c) - ! Solve for the concentration profile for this time step - call Tridiagonal(bounds, 0, nlevdecomp+1, & - jtop(bounds%begc:bounds%endc), & - num_soilc, filter_soilc, & - a_tri(bounds%begc:bounds%endc, :), & - b_tri(bounds%begc:bounds%endc, :), & - c_tri(bounds%begc:bounds%endc, :), & - r_tri(bounds%begc:bounds%endc, :), & - conc_trcr(bounds%begc:bounds%endc,0:nlevdecomp+1)) - - ! add post-transport concentration to calculate tendency term - do fc = 1, num_soilc - c = filter_soilc (fc) - do j = 1, nlevdecomp - trcr_tendency_ptr(c,j,s) = trcr_tendency_ptr(c,j,s) + conc_trcr(c,j) - trcr_tendency_ptr(c,j,s) = trcr_tendency_ptr(c,j,s) / dtime - end do - end do + if (j > 0 .and. j < nlevdecomp+1) then + a_p_0 = dzsoi_decomp(j) / dtime + endif - else - ! for CWD pools, just add - do j = 1,nlevdecomp - do fc = 1, num_soilc - c = filter_soilc (fc) - conc_trcr(c,j) = conc_ptr(c,j,s) + source(c,j,s) - if (j > col%nbedrock(c) .and. source(c,j,s) > 0._r8) then - write(iulog,*) 'source >0',c,j,s,source(c,j,s) - end if - if (j > col%nbedrock(c) .and. conc_ptr(c,j,s) > 0._r8) then - write(iulog,*) 'conc_ptr >0',c,j,s,conc_ptr(c,j,s) - end if - - end do + if (j == 0) then ! top layer (atmosphere) + a_tri(c,j) = 0._r8 + b_tri(c,j) = 1._r8 + c_tri(c,j) = -1._r8 + r_tri(c,j) = 0._r8 + elseif (j == 1) then + a_tri(c,j) = -(d_m1_zm1(c,j) * aaa(pe_m1(c,j)) + max( f_m1(c,j), 0._r8)) ! Eqn 5.47 Patankar + c_tri(c,j) = -(d_p1_zp1(c,j) * aaa(pe_p1(c,j)) + max(-f_p1(c,j), 0._r8)) + b_tri(c,j) = -a_tri(c,j) - c_tri(c,j) + a_p_0 + r_tri(c,j) = source(c,j,s) * dzsoi_decomp(j) /dtime + (a_p_0 - adv_flux(c,j)) * conc_trcr(c,j) + elseif (j < nlevdecomp+1) then + a_tri(c,j) = -(d_m1_zm1(c,j) * aaa(pe_m1(c,j)) + max( f_m1(c,j), 0._r8)) ! Eqn 5.47 Patankar + c_tri(c,j) = -(d_p1_zp1(c,j) * aaa(pe_p1(c,j)) + max(-f_p1(c,j), 0._r8)) + b_tri(c,j) = -a_tri(c,j) - c_tri(c,j) + a_p_0 + r_tri(c,j) = source(c,j,s) * dzsoi_decomp(j) /dtime + a_p_0 * conc_trcr(c,j) + else ! j==nlevdecomp+1; 0 concentration gradient at bottom + a_tri(c,j) = -1._r8 + b_tri(c,j) = 1._r8 + c_tri(c,j) = 0._r8 + r_tri(c,j) = 0._r8 + endif + enddo ! fc; column + enddo ! j; nlevdecomp + + do fc = 1, num_soilc + c = filter_soilc (fc) + jtop(c) = 0 + enddo + + ! subtract initial concentration and source terms for tendency calculation + do fc = 1, num_soilc + c = filter_soilc (fc) + do j = 1, nlevdecomp + trcr_tendency_ptr(c,j,s) = 0.-(conc_trcr(c,j) + source(c,j,s)) end do + end do - end if ! not CWD - - do j = 1,nlevdecomp - do fc = 1, num_soilc - c = filter_soilc (fc) - conc_ptr(c,j,s) = conc_trcr(c,j) - ! Correct for small amounts of carbon that leak into bedrock - if (j > col%nbedrock(c)) then - conc_ptr(c,col%nbedrock(c),s) = conc_ptr(c,col%nbedrock(c),s) + & - conc_trcr(c,j) * (dzsoi_decomp(j) / dzsoi_decomp(col%nbedrock(c))) - conc_ptr(c,j,s) = 0._r8 - end if + ! Solve for the concentration profile for this time step + call Tridiagonal(bounds, 0, nlevdecomp+1, & + jtop(bounds%begc:bounds%endc), & + num_soilc, filter_soilc, & + a_tri(bounds%begc:bounds%endc, :), & + b_tri(bounds%begc:bounds%endc, :), & + c_tri(bounds%begc:bounds%endc, :), & + r_tri(bounds%begc:bounds%endc, :), & + conc_trcr(bounds%begc:bounds%endc,0:nlevdecomp+1)) + + ! add post-transport concentration to calculate tendency term + do fc = 1, num_soilc + c = filter_soilc (fc) + do j = 1, nlevdecomp + trcr_tendency_ptr(c,j,s) = trcr_tendency_ptr(c,j,s) + conc_trcr(c,j) + trcr_tendency_ptr(c,j,s) = trcr_tendency_ptr(c,j,s) / dtime end do end do - end do ! s (pool loop) - - else - - !! for single level case, no transport; just update the fluxes calculated in the StateUpdate1 subroutines - do l = 1, ndecomp_pools + else + ! for CWD pools, just add do j = 1,nlevdecomp do fc = 1, num_soilc c = filter_soilc (fc) - - conc_ptr(c,j,l) = conc_ptr(c,j,l) + source(c,j,l) - - trcr_tendency_ptr(c,j,l) = 0._r8 + conc_trcr(c,j) = conc_ptr(c,j,s) + source(c,j,s) + if (j > col%nbedrock(c) .and. source(c,j,s) > 0._r8) then + write(iulog,*) 'source >0',c,j,s,source(c,j,s) + end if + if (j > col%nbedrock(c) .and. conc_ptr(c,j,s) > 0._r8) then + write(iulog,*) 'conc_ptr >0',c,j,s,conc_ptr(c,j,s) + end if end do end do + + end if ! not CWD + + do j = 1,nlevdecomp + do fc = 1, num_soilc + c = filter_soilc (fc) + conc_ptr(c,j,s) = conc_trcr(c,j) + ! Correct for small amounts of carbon that leak into bedrock + if (j > col%nbedrock(c)) then + conc_ptr(c,col%nbedrock(c),s) = conc_ptr(c,col%nbedrock(c),s) + & + conc_trcr(c,j) * (dzsoi_decomp(j) / dzsoi_decomp(col%nbedrock(c))) + conc_ptr(c,j,s) = 0._r8 + end if + end do end do - endif + end do ! s (pool loop) end do ! i_type diff --git a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 index 7e8d847b5d..02d22d6613 100644 --- a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 @@ -7,9 +7,10 @@ module SoilBiogeochemNLeachingMod ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 + use abortutils , only : endrun use decompMod , only : bounds_type use clm_varcon , only : dzsoi_decomp, zisoi - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc + use clm_varctl , only : use_nitrif_denitrif use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type use WaterStateBulkType , only : waterstatebulk_type @@ -45,7 +46,6 @@ subroutine readParams ( ncid ) ! ! !USES: use ncdio_pio , only : file_desc_t,ncd_io - use abortutils , only : endrun use shr_log_mod , only : errMsg => shr_log_errMsg ! ! !ARGUMENTS: @@ -173,31 +173,17 @@ subroutine SoilBiogeochemNLeaching(bounds, num_soilc, filter_soilc, & do fc = 1,num_soilc c = filter_soilc(fc) - if (.not. use_vertsoilc) then - ! calculate the dissolved mineral N concentration (gN/kg water) - ! assumes that 10% of mineral nitrogen is soluble - disn_conc = 0._r8 - if (tot_water(c) > 0._r8) then - disn_conc = (sf * sminn_vr(c,j) ) / tot_water(c) - end if - - ! calculate the N leaching flux as a function of the dissolved - ! concentration and the sub-surface drainage flux - sminn_leached_vr(c,j) = disn_conc * drain_tot(c) - else - ! calculate the dissolved mineral N concentration (gN/kg water) - ! assumes that 10% of mineral nitrogen is soluble - disn_conc = 0._r8 - if (h2osoi_liq(c,j) > 0._r8) then - disn_conc = (sf * sminn_vr(c,j) * col%dz(c,j) )/(h2osoi_liq(c,j) ) - end if - - ! calculate the N leaching flux as a function of the dissolved - ! concentration and the sub-surface drainage flux - sminn_leached_vr(c,j) = disn_conc * drain_tot(c) * h2osoi_liq(c,j) / ( tot_water(c) * col%dz(c,j) ) - + ! calculate the dissolved mineral N concentration (gN/kg water) + ! assumes that 10% of mineral nitrogen is soluble + disn_conc = 0._r8 + if (h2osoi_liq(c,j) > 0._r8) then + disn_conc = (sf * sminn_vr(c,j) * col%dz(c,j) )/(h2osoi_liq(c,j) ) end if + ! calculate the N leaching flux as a function of the dissolved + ! concentration and the sub-surface drainage flux + sminn_leached_vr(c,j) = disn_conc * drain_tot(c) * h2osoi_liq(c,j) / ( tot_water(c) * col%dz(c,j) ) + ! limit the flux based on current sminn state ! only let at most the assumed soluble fraction ! of sminn be leached on any given timestep @@ -220,56 +206,42 @@ subroutine SoilBiogeochemNLeaching(bounds, num_soilc, filter_soilc, & do fc = 1,num_soilc c = filter_soilc(fc) - if (.not. use_vertsoilc) then - ! calculate the dissolved mineral N concentration (gN/kg water) - ! assumes that 10% of mineral nitrogen is soluble - disn_conc = 0._r8 - if (tot_water(c) > 0._r8) then - disn_conc = (sf_no3 * smin_no3_vr(c,j) )/tot_water(c) - end if - - ! calculate the N leaching flux as a function of the dissolved - ! concentration and the sub-surface drainage flux - smin_no3_leached_vr(c,j) = disn_conc * drain_tot(c) + ! calculate the dissolved mineral N concentration (gN/kg water) + ! assumes that 10% of mineral nitrogen is soluble + disn_conc = 0._r8 + if (h2osoi_liq(c,j) > 0._r8) then + disn_conc = (sf_no3 * smin_no3_vr(c,j) * col%dz(c,j) )/(h2osoi_liq(c,j) ) + end if + ! + ! calculate the N leaching flux as a function of the dissolved + ! concentration and the sub-surface drainage flux + smin_no3_leached_vr(c,j) = disn_conc * drain_tot(c) * h2osoi_liq(c,j) / ( tot_water(c) * col%dz(c,j) ) + ! + ! ensure that leaching rate isn't larger than soil N pool + smin_no3_leached_vr(c,j) = min(smin_no3_leached_vr(c,j), smin_no3_vr(c,j) / dt ) + ! + ! limit the leaching flux to a positive value + smin_no3_leached_vr(c,j) = max(smin_no3_leached_vr(c,j), 0._r8) + ! + ! + ! calculate the N loss from surface runoff, assuming a shallow mixing of surface waters into soil and removal based on runoff + if ( zisoi(j) <= depth_runoff_Nloss ) then + smin_no3_runoff_vr(c,j) = disn_conc * qflx_surf(c) * & + h2osoi_liq(c,j) / ( surface_water(c) * col%dz(c,j) ) + elseif ( zisoi(j-1) < depth_runoff_Nloss ) then + smin_no3_runoff_vr(c,j) = disn_conc * qflx_surf(c) * & + h2osoi_liq(c,j) * ((depth_runoff_Nloss - zisoi(j-1)) / & + col%dz(c,j)) / ( surface_water(c) * (depth_runoff_Nloss-zisoi(j-1) )) else - ! calculate the dissolved mineral N concentration (gN/kg water) - ! assumes that 10% of mineral nitrogen is soluble - disn_conc = 0._r8 - if (h2osoi_liq(c,j) > 0._r8) then - disn_conc = (sf_no3 * smin_no3_vr(c,j) * col%dz(c,j) )/(h2osoi_liq(c,j) ) - end if - ! - ! calculate the N leaching flux as a function of the dissolved - ! concentration and the sub-surface drainage flux - smin_no3_leached_vr(c,j) = disn_conc * drain_tot(c) * h2osoi_liq(c,j) / ( tot_water(c) * col%dz(c,j) ) - ! - ! ensure that leaching rate isn't larger than soil N pool - smin_no3_leached_vr(c,j) = min(smin_no3_leached_vr(c,j), smin_no3_vr(c,j) / dt ) - ! - ! limit the leaching flux to a positive value - smin_no3_leached_vr(c,j) = max(smin_no3_leached_vr(c,j), 0._r8) - ! - ! - ! calculate the N loss from surface runoff, assuming a shallow mixing of surface waters into soil and removal based on runoff - if ( zisoi(j) <= depth_runoff_Nloss ) then - smin_no3_runoff_vr(c,j) = disn_conc * qflx_surf(c) * & - h2osoi_liq(c,j) / ( surface_water(c) * col%dz(c,j) ) - elseif ( zisoi(j-1) < depth_runoff_Nloss ) then - smin_no3_runoff_vr(c,j) = disn_conc * qflx_surf(c) * & - h2osoi_liq(c,j) * ((depth_runoff_Nloss - zisoi(j-1)) / & - col%dz(c,j)) / ( surface_water(c) * (depth_runoff_Nloss-zisoi(j-1) )) - else - smin_no3_runoff_vr(c,j) = 0._r8 - endif - ! - ! ensure that runoff rate isn't larger than soil N pool - smin_no3_runoff_vr(c,j) = min(smin_no3_runoff_vr(c,j), smin_no3_vr(c,j) / dt - smin_no3_leached_vr(c,j)) - ! - ! limit the flux to a positive value - smin_no3_runoff_vr(c,j) = max(smin_no3_runoff_vr(c,j), 0._r8) - - + smin_no3_runoff_vr(c,j) = 0._r8 endif + ! + ! ensure that runoff rate isn't larger than soil N pool + smin_no3_runoff_vr(c,j) = min(smin_no3_runoff_vr(c,j), smin_no3_vr(c,j) / dt - smin_no3_leached_vr(c,j)) + ! + ! limit the flux to a positive value + smin_no3_runoff_vr(c,j) = max(smin_no3_runoff_vr(c,j), 0._r8) + ! limit the flux based on current smin_no3 state ! only let at most the assumed soluble fraction ! of smin_no3 be leached on any given timestep diff --git a/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 b/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 index 0bdbaa2032..3993439a1c 100644 --- a/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 @@ -12,7 +12,7 @@ module SoilBiogeochemNitrifDenitrifMod use clm_varpar , only : nlevdecomp use clm_varcon , only : rpi, grav use clm_varcon , only : d_con_g, d_con_w, secspday - use clm_varctl , only : use_lch4 + use clm_varctl , only : use_lch4, use_fates use abortutils , only : endrun use decompMod , only : bounds_type use SoilStatetype , only : soilstate_type @@ -42,6 +42,7 @@ module SoilBiogeochemNitrifDenitrifMod real(r8) :: denitrif_respiration_exponent ! Exponents for heterotrophic respiration for max denitrif rates real(r8) :: denitrif_nitrateconc_coefficient ! Multiplier for nitrate concentration for max denitrif rates real(r8) :: denitrif_nitrateconc_exponent ! Exponent for nitrate concentration for max denitrif rates + real(r8) :: om_frac_sf ! Scale factor for organic matter fraction (unitless) end type params_type type(params_type), private :: params_inst @@ -128,6 +129,11 @@ subroutine readParams ( ncid ) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%denitrif_respiration_exponent=tempr + tString='om_frac_sf' + call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%om_frac_sf=tempr + end subroutine readParams !----------------------------------------------------------------------- @@ -267,7 +273,7 @@ subroutine SoilBiogeochemNitrifDenitrif(bounds, num_soilc, filter_soilc, & if (use_lch4) then if (organic_max > 0._r8) then - om_frac = min(cellorg(c,j)/organic_max, 1._r8) + om_frac = min(params_inst%om_frac_sf*cellorg(c,j)/organic_max, 1._r8) ! Use first power, not square as in iniTimeConst else om_frac = 1._r8 diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 index d852c35496..5117f10109 100644 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 @@ -7,7 +7,7 @@ module SoilBiogeochemNitrogenFluxType use clm_varpar , only : nlevdecomp_full, nlevdecomp use clm_varcon , only : spval, ispval, dzsoi_decomp use decompMod , only : bounds_type - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, use_crop + use clm_varctl , only : use_nitrif_denitrif, use_crop use CNSharedParamsMod , only : use_fun use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use abortutils , only : endrun @@ -340,7 +340,7 @@ subroutine InitHistory(this, bounds) data1dptr => this%decomp_cascade_sminn_flux_col(:,l) if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then fieldname = 'SMINN_TO_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//& + trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//& trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_donor_pool(l))) longname = 'mineral N flux for decomp. of '& //trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//& @@ -377,7 +377,7 @@ subroutine InitHistory(this, bounds) data2dptr => this%decomp_cascade_sminn_flux_vr_col(:,:,l) if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then fieldname = 'SMINN_TO_'& - //trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//& + //trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//& trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_donor_pool(l)))//trim(vr_suffix) longname = 'mineral N flux for decomp. of '& //trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//& diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 index 93216db170..613d02c608 100644 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 @@ -11,7 +11,8 @@ module SoilBiogeochemNitrogenStateType use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools, nlevcan use clm_varpar , only : nlevdecomp_full, nlevdecomp, nlevsoi use clm_varcon , only : spval, dzsoi_decomp, zisoi - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, use_century_decomp + use clm_varctl , only : use_nitrif_denitrif + use SoilBiogeochemDecompCascadeConType , only : century_decomp, decomp_method use clm_varctl , only : iulog, override_bgc_restart_mismatch_dump, spinup_state use landunit_varcon , only : istcrop, istsoil use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con @@ -429,20 +430,12 @@ subroutine Restart ( this, bounds, ncid, flag, totvegc_col ) !------------------------------------------------------------------------ ! sminn - if (use_vertsoilc) then - ptr2d => this%sminn_vr_col - call restartvar(ncid=ncid, flag=flag, varname="sminn_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gN/m3', fill_value=spval, & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%sminn_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname="sminn", xtype=ncd_double, & - dim1name='column', & - long_name='', units='gN/m3', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if + ptr2d => this%sminn_vr_col + call restartvar(ncid=ncid, flag=flag, varname="sminn_vr", xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gN/m3', fill_value=spval, & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) if (flag=='read' .and. .not. readvar) then call endrun(msg='ERROR::'//trim(varname)//' is required on an initialization dataset'//& errMsg(sourcefile, __LINE__)) @@ -451,57 +444,33 @@ subroutine Restart ( this, bounds, ncid, flag, totvegc_col ) ! decomposing N pools do k = 1, ndecomp_pools varname=trim(decomp_cascade_con%decomp_pool_name_restart(k))//'n' - if (use_vertsoilc) then - ptr2d => this%decomp_npools_vr_col(:,:,k) - call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gN/m3', & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%decomp_npools_vr_col(:,1,k) - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name='column', & - long_name='', units='gN/m3', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if + ptr2d => this%decomp_npools_vr_col(:,:,k) + call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gN/m3', & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) if (flag=='read' .and. .not. readvar) then call endrun(msg='ERROR:: '//trim(varname)//' is required on an initialization dataset'//& errMsg(sourcefile, __LINE__)) end if end do - if (use_vertsoilc) then - ptr2d => this%ntrunc_vr_col - call restartvar(ncid=ncid, flag=flag, varname="col_ntrunc_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gN/m3', fill_value=spval, & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%ntrunc_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname="col_ntrunc", xtype=ncd_double, & - dim1name='column', & - long_name='', units='gN/m3', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if + ptr2d => this%ntrunc_vr_col + call restartvar(ncid=ncid, flag=flag, varname="col_ntrunc_vr", xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gN/m3', fill_value=spval, & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) if (use_nitrif_denitrif) then ! smin_no3_vr - if (use_vertsoilc) then - ptr2d => this%smin_no3_vr_col(:,:) - call restartvar(ncid=ncid, flag=flag, varname='smin_no3_vr', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gN/m3', & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%smin_no3_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='smin_no3', xtype=ncd_double, & - dim1name='column', & - long_name='', units='gN/m3', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - end if + ptr2d => this%smin_no3_vr_col(:,:) + call restartvar(ncid=ncid, flag=flag, varname='smin_no3_vr', xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gN/m3', & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) if (flag=='read' .and. .not. readvar) then call endrun(msg= 'ERROR:: smin_no3_vr'//' is required on an initialization dataset' ) end if @@ -509,20 +478,12 @@ subroutine Restart ( this, bounds, ncid, flag, totvegc_col ) if (use_nitrif_denitrif) then ! smin_nh4 - if (use_vertsoilc) then - ptr2d => this%smin_nh4_vr_col(:,:) - call restartvar(ncid=ncid, flag=flag, varname='smin_nh4_vr', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='gN/m3', & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%smin_nh4_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='smin_nh4', xtype=ncd_double, & - dim1name='column', & - long_name='', units='gN/m3', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - end if + ptr2d => this%smin_nh4_vr_col(:,:) + call restartvar(ncid=ncid, flag=flag, varname='smin_nh4_vr', xtype=ncd_double, & + dim1name='column', dim2name='levgrnd', switchdim=.true., & + long_name='', units='gN/m3', & + scale_by_thickness=.false., & + interpinic_flag='interp', readvar=readvar, data=ptr2d) if (flag=='read' .and. .not. readvar) then call endrun(msg= 'ERROR:: smin_nh4_vr'//' is required on an initialization dataset' ) end if @@ -532,7 +493,7 @@ subroutine Restart ( this, bounds, ncid, flag, totvegc_col ) ! matches what the restart file was generated with. ! add info about the SOM decomposition cascade - if (use_century_decomp) then + if (decomp_method == century_decomp ) then decomp_cascade_state = 1 else decomp_cascade_state = 0 diff --git a/src/soilbiogeochem/SoilBiogeochemStateType.F90 b/src/soilbiogeochem/SoilBiogeochemStateType.F90 index 118c42d3a9..308db43eae 100644 --- a/src/soilbiogeochem/SoilBiogeochemStateType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemStateType.F90 @@ -11,7 +11,7 @@ module SoilBiogeochemStateType use clm_varcon , only : spval, ispval, c14ratio, grlnd use landunit_varcon, only : istsoil, istcrop use clm_varpar , only : nlevsno, nlevgrnd, nlevlak - use clm_varctl , only : use_vertsoilc, use_cn + use clm_varctl , only : use_cn use clm_varctl , only : iulog use LandunitType , only : lun use ColumnType , only : col diff --git a/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 b/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 index fe689d975c..7209bd8278 100644 --- a/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 @@ -43,11 +43,11 @@ subroutine SoilBiogeochemVerticalProfile(bounds, num_soilc,filter_soilc,num_soil ! ! !USES: use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_column, subgrid_level_patch use abortutils , only : endrun use clm_varcon , only : zsoi, dzsoi, zisoi, dzsoi_decomp, zmin_bedrock use clm_varpar , only : nlevdecomp, nlevgrnd, nlevdecomp_full, maxsoil_patches - use clm_varctl , only : use_vertsoilc, iulog, use_bedrock + use clm_varctl , only : iulog, use_bedrock use pftconMod , only : noveg, pftcon use SoilBiogeochemStateType , only : soilbiogeochem_state_type use ActiveLayerMod , only : active_layer_type @@ -102,127 +102,112 @@ subroutine SoilBiogeochemVerticalProfile(bounds, num_soilc,filter_soilc,num_soil stem_prof => soilbiogeochem_state_inst%stem_prof_patch & ! Output : [real(r8) (:,:) ] (1/m) profile of stems ) - if (use_vertsoilc) then - - ! define a single shallow surface profile for surface additions (leaves, stems, and N deposition) - surface_prof(:) = 0._r8 - do j = 1, nlevdecomp - surface_prof(j) = exp(-surfprof_exp * zsoi(j)) / dzsoi_decomp(j) - if (use_bedrock) then - if (zsoi(j) > zmin_bedrock) then - surface_prof(j) = 0._r8 - end if + ! define a single shallow surface profile for surface additions (leaves, stems, and N deposition) + surface_prof(:) = 0._r8 + do j = 1, nlevdecomp + surface_prof(j) = exp(-surfprof_exp * zsoi(j)) / dzsoi_decomp(j) + if (use_bedrock) then + if (zsoi(j) > zmin_bedrock) then + surface_prof(j) = 0._r8 end if - end do - - ! initialize profiles to zero - leaf_prof(begp:endp, :) = 0._r8 - froot_prof(begp:endp, :) = 0._r8 - croot_prof(begp:endp, :) = 0._r8 - stem_prof(begp:endp, :) = 0._r8 - nfixation_prof(begc:endc, :) = 0._r8 - ndep_prof(begc:endc, :) = 0._r8 - - cinput_rootfr(begp:endp, :) = 0._r8 - col_cinput_rootfr(begc:endc, :) = 0._r8 + end if + end do - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - if (patch%itype(p) /= noveg) then - do j = 1, nlevdecomp - cinput_rootfr(p,j) = crootfr(p,j) / dzsoi_decomp(j) - end do + ! initialize profiles to zero + leaf_prof(begp:endp, :) = 0._r8 + froot_prof(begp:endp, :) = 0._r8 + croot_prof(begp:endp, :) = 0._r8 + stem_prof(begp:endp, :) = 0._r8 + nfixation_prof(begc:endc, :) = 0._r8 + ndep_prof(begc:endc, :) = 0._r8 - else - cinput_rootfr(p,1) = 0. - endif - end do + cinput_rootfr(begp:endp, :) = 0._r8 + col_cinput_rootfr(begc:endc, :) = 0._r8 - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - ! integrate rootfr over active layer of soil column - rootfr_tot = 0._r8 - surface_prof_tot = 0._r8 - do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) - rootfr_tot = rootfr_tot + cinput_rootfr(p,j) * dzsoi_decomp(j) - surface_prof_tot = surface_prof_tot + surface_prof(j) * dzsoi_decomp(j) + do fp = 1,num_soilp + p = filter_soilp(fp) + c = patch%column(p) + if (patch%itype(p) /= noveg) then + do j = 1, nlevdecomp + cinput_rootfr(p,j) = crootfr(p,j) / dzsoi_decomp(j) end do - if ( (altmax_lastyear_indx(c) > 0) .and. (rootfr_tot > 0._r8) .and. (surface_prof_tot > 0._r8) ) then - ! where there is not permafrost extending to the surface, integrate the profiles over the active layer - ! this is equivalnet to integrating over all soil layers outside of permafrost regions - do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) - froot_prof(p,j) = cinput_rootfr(p,j) / rootfr_tot - croot_prof(p,j) = cinput_rootfr(p,j) / rootfr_tot - if (j > col%nbedrock(c) .and. cinput_rootfr(p,j) > 0._r8) then - write(iulog,*) 'cinput_rootfr > 0 in bedrock' - end if - ! set all surface processes to shallower profile - leaf_prof(p,j) = surface_prof(j)/ surface_prof_tot - stem_prof(p,j) = surface_prof(j)/ surface_prof_tot - end do - else - ! if fully frozen, or no roots, put everything in the top layer - froot_prof(p,1) = 1./dzsoi_decomp(1) - croot_prof(p,1) = 1./dzsoi_decomp(1) - leaf_prof(p,1) = 1./dzsoi_decomp(1) - stem_prof(p,1) = 1./dzsoi_decomp(1) - endif + else + cinput_rootfr(p,1) = 0. + endif + end do + do fp = 1,num_soilp + p = filter_soilp(fp) + c = patch%column(p) + ! integrate rootfr over active layer of soil column + rootfr_tot = 0._r8 + surface_prof_tot = 0._r8 + do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) + rootfr_tot = rootfr_tot + cinput_rootfr(p,j) * dzsoi_decomp(j) + surface_prof_tot = surface_prof_tot + surface_prof(j) * dzsoi_decomp(j) end do + if ( (altmax_lastyear_indx(c) > 0) .and. (rootfr_tot > 0._r8) .and. (surface_prof_tot > 0._r8) ) then + ! where there is not permafrost extending to the surface, integrate the profiles over the active layer + ! this is equivalnet to integrating over all soil layers outside of permafrost regions + do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) + froot_prof(p,j) = cinput_rootfr(p,j) / rootfr_tot + croot_prof(p,j) = cinput_rootfr(p,j) / rootfr_tot - !! aggregate root profile to column - ! call p2c (decomp, nlevdecomp_full, & - ! cinput_rootfr(bounds%begp:bounds%endp, :), & - ! col_cinput_rootfr(bounds%begc:bounds%endc, :), & - ! 'unity') - do pi = 1,maxsoil_patches - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - do j = 1,nlevdecomp - col_cinput_rootfr(c,j) = col_cinput_rootfr(c,j) + cinput_rootfr(p,j) * patch%wtcol(p) - end do + if (j > col%nbedrock(c) .and. cinput_rootfr(p,j) > 0._r8) then + write(iulog,*) 'cinput_rootfr > 0 in bedrock' end if + ! set all surface processes to shallower profile + leaf_prof(p,j) = surface_prof(j)/ surface_prof_tot + stem_prof(p,j) = surface_prof(j)/ surface_prof_tot end do - end do + else + ! if fully frozen, or no roots, put everything in the top layer + froot_prof(p,1) = 1./dzsoi_decomp(1) + croot_prof(p,1) = 1./dzsoi_decomp(1) + leaf_prof(p,1) = 1./dzsoi_decomp(1) + stem_prof(p,1) = 1./dzsoi_decomp(1) + endif - ! repeat for column-native profiles: Ndep and Nfix + end do + + !! aggregate root profile to column + ! call p2c (decomp, nlevdecomp_full, & + ! cinput_rootfr(bounds%begp:bounds%endp, :), & + ! col_cinput_rootfr(bounds%begc:bounds%endc, :), & + ! 'unity') + do pi = 1,maxsoil_patches do fc = 1,num_soilc c = filter_soilc(fc) - rootfr_tot = 0._r8 - surface_prof_tot = 0._r8 - ! redo column ntegration over active layer for column-native profiles - do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) - rootfr_tot = rootfr_tot + col_cinput_rootfr(c,j) * dzsoi_decomp(j) - surface_prof_tot = surface_prof_tot + surface_prof(j) * dzsoi_decomp(j) - end do - if ( (altmax_lastyear_indx(c) > 0) .and. (rootfr_tot > 0._r8) .and. (surface_prof_tot > 0._r8) ) then - do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) - nfixation_prof(c,j) = col_cinput_rootfr(c,j) / rootfr_tot - ndep_prof(c,j) = surface_prof(j)/ surface_prof_tot + if (pi <= col%npatches(c)) then + p = col%patchi(c) + pi - 1 + do j = 1,nlevdecomp + col_cinput_rootfr(c,j) = col_cinput_rootfr(c,j) + cinput_rootfr(p,j) * patch%wtcol(p) end do - else - nfixation_prof(c,1) = 1./dzsoi_decomp(1) - ndep_prof(c,1) = 1./dzsoi_decomp(1) - endif + end if end do + end do - else - - ! for one layer decomposition model, set profiles to unity - leaf_prof(begp:endp, :) = 1._r8 - froot_prof(begp:endp, :) = 1._r8 - croot_prof(begp:endp, :) = 1._r8 - stem_prof(begp:endp, :) = 1._r8 - nfixation_prof(begc:endc, :) = 1._r8 - ndep_prof(begc:endc, :) = 1._r8 - - end if - + ! repeat for column-native profiles: Ndep and Nfix + do fc = 1,num_soilc + c = filter_soilc(fc) + rootfr_tot = 0._r8 + surface_prof_tot = 0._r8 + ! redo column ntegration over active layer for column-native profiles + do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) + rootfr_tot = rootfr_tot + col_cinput_rootfr(c,j) * dzsoi_decomp(j) + surface_prof_tot = surface_prof_tot + surface_prof(j) * dzsoi_decomp(j) + end do + if ( (altmax_lastyear_indx(c) > 0) .and. (rootfr_tot > 0._r8) .and. (surface_prof_tot > 0._r8) ) then + do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) + nfixation_prof(c,j) = col_cinput_rootfr(c,j) / rootfr_tot + ndep_prof(c,j) = surface_prof(j)/ surface_prof_tot + end do + else + nfixation_prof(c,1) = 1./dzsoi_decomp(1) + ndep_prof(c,1) = 1./dzsoi_decomp(1) + endif + end do ! check to make sure integral of all profiles = 1. do fc = 1,num_soilc @@ -247,7 +232,8 @@ subroutine SoilBiogeochemVerticalProfile(bounds, num_soilc,filter_soilc,num_soil write(iulog, *) 'p, itype(p), wtcol(p): ', p, patch%itype(p), patch%wtcol(p) write(iulog, *) 'cinput_rootfr(p,:): ', cinput_rootfr(p,:) end do - call endrun(msg=" ERROR: _prof_sum-1>delta"//errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=" ERROR: _prof_sum-1>delta"//errMsg(sourcefile, __LINE__)) endif end do @@ -266,7 +252,7 @@ subroutine SoilBiogeochemVerticalProfile(bounds, num_soilc,filter_soilc,num_soil if ( ( abs(froot_prof_sum - 1._r8) > delta ) .or. ( abs(croot_prof_sum - 1._r8) > delta ) .or. & ( abs(stem_prof_sum - 1._r8) > delta ) .or. ( abs(leaf_prof_sum - 1._r8) > delta ) ) then write(iulog, *) 'profile sums: ', froot_prof_sum, croot_prof_sum, leaf_prof_sum, stem_prof_sum - call endrun(msg=' ERROR: sum-1 > delta'//errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=' ERROR: sum-1 > delta'//errMsg(sourcefile, __LINE__)) endif end do diff --git a/src/unit_test_shr/unittestSubgridMod.F90 b/src/unit_test_shr/unittestSubgridMod.F90 index 2a02815614..6a1f4d9daf 100644 --- a/src/unit_test_shr/unittestSubgridMod.F90 +++ b/src/unit_test_shr/unittestSubgridMod.F90 @@ -40,6 +40,7 @@ module unittestSubgridMod use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type, procinfo, get_proc_bounds + use decompMod , only : gindex_grc, gindex_lun, gindex_col, gindex_patch use GridcellType , only : grc use LandunitType , only : lun use ColumnType , only : col @@ -83,12 +84,11 @@ module unittestSubgridMod ! Indices of initial grid cell / landunit / column / patch ! - ! Note that we do NOT start at 1, in order to catch any code that assumes indices start - ! at 1. - integer, parameter, public :: begg = 11 - integer, parameter, public :: begl = 21 - integer, parameter, public :: begc = 31 - integer, parameter, public :: begp = 41 + ! Now we do start at 1. + integer, parameter, public :: begg = 1 + integer, parameter, public :: begl = 1 + integer, parameter, public :: begc = 1 + integer, parameter, public :: begp = 1 ! Indices of final grid cell / landunit / column / patch ! Note that these are the final indices of the allocated arrays, which may be greater @@ -176,10 +176,6 @@ subroutine set_decomp_info ! We need to do this (in addition to just making sure that the bounds derived type ! object is set up correctly) for the sake of callers of get_proc_bounds. ! - ! !USES: - ! - ! !ARGUMENTS: - ! ! !LOCAL VARIABLES: character(len=*), parameter :: subname = 'set_decomp_info' @@ -208,6 +204,18 @@ subroutine set_decomp_info ! Currently leaving cohort info unset because it isn't needed in any unit tests. We ! may have to fix this in the future. + + ! The following are needed in endrun calls, but since they are only used for printing + ! information, we can fill them with garbage. + allocate(gindex_grc(procinfo%begg:procinfo%endg)) + allocate(gindex_lun(procinfo%begl:procinfo%endl)) + allocate(gindex_col(procinfo%begc:procinfo%endc)) + allocate(gindex_patch(procinfo%begp:procinfo%endp)) + gindex_grc(:) = 0 + gindex_lun(:) = 0 + gindex_col(:) = 0 + gindex_patch(:) = 0 + end subroutine set_decomp_info !----------------------------------------------------------------------- diff --git a/src/unit_test_stubs/csm_share/shr_mpi_mod_stub.F90 b/src/unit_test_stubs/csm_share/shr_mpi_mod_stub.F90 index 7a51d56ed9..44d57a96b0 100644 --- a/src/unit_test_stubs/csm_share/shr_mpi_mod_stub.F90 +++ b/src/unit_test_stubs/csm_share/shr_mpi_mod_stub.F90 @@ -20,6 +20,7 @@ Module shr_mpi_mod public :: shr_mpi_chkerr public :: shr_mpi_bcast + public :: shr_mpi_sum public :: shr_mpi_commsize public :: shr_mpi_commrank public :: shr_mpi_initialized @@ -308,6 +309,23 @@ SUBROUTINE shr_mpi_bcastr3(arr,comm,string,pebcast) END SUBROUTINE shr_mpi_bcastr3 !=============================================================================== + +SUBROUTINE shr_mpi_sum(lvec,gvec,comm,string,all) + + IMPLICIT none + + !----- arguments --- + integer(SHR_KIND_IN), intent(in) :: lvec ! in/out local values + integer(SHR_KIND_IN), intent(out):: gvec ! in/out global values + integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator + character(*),optional,intent(in) :: string ! message + logical, optional,intent(in) :: all ! allreduce if true + !----- local ----- + character(*),parameter :: subName = '(shr_mpi_sumi0) ' + +!=============================================================================== +END SUBROUTINE shr_mpi_sum + !=============================================================================== SUBROUTINE shr_mpi_commsize(comm,size,string) diff --git a/src/unit_test_stubs/main/GetGlobalValuesMod_stub.F90 b/src/unit_test_stubs/main/GetGlobalValuesMod_stub.F90 index d5b7258acb..8b42e1bddf 100644 --- a/src/unit_test_stubs/main/GetGlobalValuesMod_stub.F90 +++ b/src/unit_test_stubs/main/GetGlobalValuesMod_stub.F90 @@ -5,33 +5,33 @@ module GetGlobalValuesMod implicit none - public :: GetGlobalWrite - public :: GetGlobalIndex + public :: write_point_context + public :: get_global_index contains - subroutine GetGlobalWrite(decomp_index, clmlevel) - integer, intent(in) :: decomp_index - character(len=*), intent(in) :: clmlevel + subroutine write_point_context(subgrid_index, subgrid_level) + integer, intent(in) :: subgrid_index + character(len=*), intent(in) :: subgrid_level ! do nothing - end subroutine GetGlobalWrite + end subroutine write_point_context !----------------------------------------------------------------------- - integer function GetGlobalIndex(decomp_index, clmlevel) + integer function get_global_index(subgrid_index, subgrid_level) !---------------------------------------------------------------- ! Description - ! Determine global index space value for target point at given clmlevel + ! Determine global index space value for target point at given subgrid_level ! ! Uses: ! ! Arguments - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel + integer , intent(in) :: subgrid_index + character(len=*) , intent(in) :: subgrid_level ! De essentially nothing, just set the index to a negative value to signal it's not real - GetGlobalIndex = -1 - end function GetGlobalIndex + get_global_index = -1 + end function get_global_index end module GetGlobalValuesMod diff --git a/src/unit_test_stubs/main/ncdio_pio_fake.F90.in b/src/unit_test_stubs/main/ncdio_pio_fake.F90.in index 45dcd90ba3..c6bfa436b6 100644 --- a/src/unit_test_stubs/main/ncdio_pio_fake.F90.in +++ b/src/unit_test_stubs/main/ncdio_pio_fake.F90.in @@ -8,9 +8,9 @@ module ncdio_pio use shr_kind_mod, only : r8 => shr_kind_r8, i4=>shr_kind_i4 use shr_assert_mod , only : shr_assert + use shr_sys_mod, only : shr_sys_abort use ncdio_var, only : ncdio_var_type use ncdio_dim, only : ncdio_dim_type - use abortutils,only : endrun ! !PUBLIC TYPES: implicit none @@ -314,7 +314,7 @@ contains !----------------------------------------------------------------------- if (is_dim) then - call endrun(subname//': is_dim=.true. not yet implemented') + call shr_sys_abort(subname//': is_dim=.true. not yet implemented') else call check_var(ncid, name, exists, print_err=.false.) end if @@ -421,7 +421,7 @@ contains integer , intent(in), optional :: nvalid_range(2) ! attribute for int ! Do nothing - call endrun( 'ncd_defvar_bynf should not be actually called for unit tests' ) + call shr_sys_abort( 'ncd_defvar_bynf should not be actually called for unit tests' ) end subroutine ncd_defvar_bynf @@ -458,7 +458,7 @@ contains integer , intent(in), optional :: nvalid_range(2) ! attribute for int ! Do nothing - call endrun( 'ncd_defvar_bygrid should not be actually called for unit tests' ) + call shr_sys_abort( 'ncd_defvar_bygrid should not be actually called for unit tests' ) end subroutine ncd_defvar_bygrid diff --git a/src/utils/AnnualFluxDribbler.F90 b/src/utils/AnnualFluxDribbler.F90 index aa1e3bbcdd..c66e4fdc81 100644 --- a/src/utils/AnnualFluxDribbler.F90 +++ b/src/utils/AnnualFluxDribbler.F90 @@ -62,7 +62,7 @@ module AnnualFluxDribbler use abortutils , only : endrun use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type, get_beg, get_end - use decompMod , only : BOUNDS_SUBGRID_GRIDCELL, BOUNDS_SUBGRID_PATCH + use decompMod , only : subgrid_level_gridcell, subgrid_level_patch use clm_varcon , only : secspday, nameg, namep use clm_time_manager , only : get_days_per_year, get_step_size_real, is_beg_curr_year use clm_time_manager , only : get_curr_yearfrac, get_prev_yearfrac, get_prev_date @@ -93,7 +93,6 @@ module AnnualFluxDribbler ! Which subgrid level this dribbler is operating at, stored in various ways character(len=subgrid_maxlen) :: dim1name - character(len=subgrid_maxlen) :: name_subgrid integer :: bounds_subgrid_level ! Annual amount to dribble in over the year @@ -167,8 +166,7 @@ function annual_flux_dribbler_gridcell(bounds, name, units, allows_non_annual_de !----------------------------------------------------------------------- this%dim1name = 'gridcell' - this%name_subgrid = nameg - this%bounds_subgrid_level = BOUNDS_SUBGRID_GRIDCELL + this%bounds_subgrid_level = subgrid_level_gridcell call this%allocate_and_initialize_data(bounds) call this%set_metadata(name, units, allows_non_annual_delta) @@ -204,8 +202,7 @@ function annual_flux_dribbler_patch(bounds, name, units, allows_non_annual_delta !----------------------------------------------------------------------- this%dim1name = 'pft' - this%name_subgrid = namep - this%bounds_subgrid_level = BOUNDS_SUBGRID_PATCH + this%bounds_subgrid_level = subgrid_level_patch call this%allocate_and_initialize_data(bounds) call this%set_metadata(name, units, allows_non_annual_delta) @@ -274,7 +271,7 @@ subroutine set_curr_delta(this, bounds, delta) write(iulog,*) 'other than the first time step of the year, which this dribbler was told not to expect.' write(iulog,*) 'If this non-zero mid-year delta is expected, then you can suppress this error' write(iulog,*) 'by setting allows_non_annual_delta to .true. when constructing this dribbler.' - call endrun(decomp_index=i, clmlevel=this%name_subgrid, & + call endrun(subgrid_index=i, subgrid_level=this%bounds_subgrid_level, & msg=subname//': found unexpected non-zero delta mid-year: ' // & errMsg(sourcefile, __LINE__)) end if diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 37009266df..a11d1527d5 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1,22 +1,22 @@ module CLMFatesInterfaceMod - + ! ------------------------------------------------------------------------------------- ! This module contains various functions and definitions to aid in the - ! coupling of the FATES library/API with the CLM/ALM/ATS/etc model driver. - ! All connections between the two models should occur in this file alone. - ! - ! This is also the only location where CLM code is allowed to see FATES memory + ! coupling of the FATES library/API with the CLM/ALM/ATS/etc model driver. + ! All connections between the two models should occur in this file alone. + ! + ! This is also the only location where CLM code is allowed to see FATES memory ! structures. ! The routines here, that call FATES library routines, will not pass any types defined ! by the driving land model (HLM). - ! + ! ! either native type arrays (int,real,log, etc) or packed into fates boundary condition ! structures. ! - ! Note that CLM/ALM does use Shared Memory Parallelism (SMP), where processes such as - ! the update of state variables are forked. However, IO is not assumed to be + ! Note that CLM/ALM does use Shared Memory Parallelism (SMP), where processes such as + ! the update of state variables are forked. However, IO is not assumed to be ! threadsafe and therefore memory spaces reserved for IO must be continuous vectors, - ! and moreover they must be pushed/pulled from history IO for each individual + ! and moreover they must be pushed/pulled from history IO for each individual ! bounds_proc memory space as a unit. ! ! Therefore, the state variables in the clm_fates communicator is vectorized by @@ -29,13 +29,13 @@ module CLMFatesInterfaceMod ! ! ------------------------------------------------------------------------------------- - ! use ed_driver_interface, only: - + ! use ed_driver_interface, only: + ! Used CLM Modules #include "shr_assert.h" use PatchType , only : patch use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type + use decompMod , only : bounds_type, subgrid_level_column use WaterStateBulkType , only : waterstatebulk_type use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type use WaterFluxBulkType , only : waterfluxbulk_type @@ -44,10 +44,8 @@ module CLMFatesInterfaceMod use CanopyStateType , only : canopystate_type use TemperatureType , only : temperature_type use EnergyFluxType , only : energyflux_type - - use SoilStateType , only : soilstate_type + use SoilStateType , only : soilstate_type use clm_varctl , only : iulog - use clm_varctl , only : use_vertsoilc use clm_varctl , only : fates_parteh_mode use clm_varctl , only : use_fates use clm_varctl , only : fates_spitfire_mode @@ -58,11 +56,13 @@ module CLMFatesInterfaceMod use clm_varctl , only : use_fates_logging use clm_varctl , only : use_fates_inventory_init use clm_varctl , only : use_fates_fixed_biogeog + use clm_varctl , only : use_fates_nocomp + use clm_varctl , only : use_fates_sp use clm_varctl , only : fates_inventory_ctrl_filename use clm_varctl , only : use_nitrif_denitrif use clm_varctl , only : use_lch4 use clm_varcon , only : tfrz - use clm_varcon , only : spval + use clm_varcon , only : spval use clm_varcon , only : denice use clm_varcon , only : ispval @@ -99,7 +99,7 @@ module CLMFatesInterfaceMod use LandunitType , only : lun use landunit_varcon , only : istsoil use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_log_mod , only : errMsg => shr_log_errMsg use clm_varcon , only : dzsoi_decomp use FuncPedotransferMod, only: get_ipedof ! use SoilWaterPlantSinkMod, only : Compute_EffecRootFrac_And_VertTranSink_Default @@ -153,23 +153,23 @@ module CLMFatesInterfaceMod use FatesConstantsMod , only : hlm_harvest_carbon use perf_mod , only : t_startf, t_stopf implicit none - + type, public :: f2hmap_type ! This is the associated column index of each FATES site - integer, allocatable :: fcolumn (:) + integer, allocatable :: fcolumn (:) ! This is the associated site index of any HLM columns ! This vector may be sparse, and non-sites have index 0 integer, allocatable :: hsites (:) end type f2hmap_type - + type, public :: hlm_fates_interface_type - + ! private - + ! See above for descriptions of the sub-types populated ! by thread. This type is somewhat self-explanatory, in that it simply @@ -191,7 +191,7 @@ module CLMFatesInterfaceMod class(fates_fire_base_type), allocatable :: fates_fire_data_method contains - + procedure, public :: init procedure, public :: check_hlm_active procedure, public :: restart @@ -224,8 +224,8 @@ module CLMFatesInterfaceMod ! developer will at least question its usage (RGK) private :: hlm_bounds_to_fates_bounds - ! The GetAndSetTime function is used to get the current time from the CLM - ! time procedures and then set to the fates global time variables during restart, + ! The GetAndSetTime function is used to get the current time from the CLM + ! time procedures and then set to the fates global time variables during restart, ! init_coldstart, and dynamics_driv function calls private :: GetAndSetTime @@ -249,7 +249,7 @@ subroutine CLMFatesGlobals(dtime) ! Aside from setting global dimension info, which ! is used in the history file, we also transfer ! over the NL variables to FATES global settings. - ! -------------------------------------------------------------------------------- + ! -------------------------------------------------------------------------------- real(r8), intent(in) :: dtime ! main model timestep (s) @@ -257,7 +257,7 @@ subroutine CLMFatesGlobals(dtime) integer :: pass_masterproc integer :: pass_vertsoilc integer :: pass_ch4 - integer :: pass_spitfire + integer :: pass_spitfire integer :: pass_ed_st3 integer :: pass_num_lu_harvest_cats integer :: pass_lu_harvest @@ -267,8 +267,9 @@ subroutine CLMFatesGlobals(dtime) integer :: pass_inventory_init integer :: pass_is_restart integer :: pass_cohort_age_tracking - integer :: pass_biogeog - + integer :: pass_biogeog + integer :: pass_nocomp + integer :: pass_sp call t_startf('fates_globals') @@ -276,21 +277,21 @@ subroutine CLMFatesGlobals(dtime) verbose_output = .false. call FatesInterfaceInit(iulog, verbose_output) - + ! Force FATES parameters that are recieve type, to the unset value call set_fates_ctrlparms('flush_to_unset') - + ! Send parameters individually call set_fates_ctrlparms('num_sw_bbands',ival=numrad) call set_fates_ctrlparms('vis_sw_index',ival=ivis) call set_fates_ctrlparms('nir_sw_index',ival=inir) - + call set_fates_ctrlparms('num_lev_ground',ival=nlevgrnd) call set_fates_ctrlparms('hlm_name',cval='CLM') call set_fates_ctrlparms('hio_ignore_val',rval=spval) call set_fates_ctrlparms('soilwater_ipedof',ival=get_ipedof(0)) call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) - + call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) ! CTSM-FATES is not fully coupled (yet) @@ -314,14 +315,14 @@ subroutine CLMFatesGlobals(dtime) ! Phosphorus is not tracked in CLM call set_fates_ctrlparms('phosphorus_spec',ival=0) - + call set_fates_ctrlparms('spitfire_mode',ival=fates_spitfire_mode) call set_fates_ctrlparms('sf_nofire_def',ival=no_fire) call set_fates_ctrlparms('sf_scalar_lightning_def',ival=scalar_lightning) call set_fates_ctrlparms('sf_successful_ignitions_def',ival=successful_ignitions) call set_fates_ctrlparms('sf_anthro_ignitions_def',ival=anthro_ignitions) call set_fates_ctrlparms('stepsize', rval = dtime) - + if(is_restart()) then pass_is_restart = 1 else @@ -335,14 +336,11 @@ subroutine CLMFatesGlobals(dtime) pass_ch4 = 0 end if call set_fates_ctrlparms('use_ch4',ival=pass_ch4) - - if(use_vertsoilc) then - pass_vertsoilc = 1 - else - pass_vertsoilc = 0 - end if + + ! use_vertsoilc: Carbon soil layer profile is assumed to be on all the time now + pass_vertsoilc = 1 call set_fates_ctrlparms('use_vertsoilc',ival=pass_vertsoilc) - + if(use_fates_fixed_biogeog)then pass_biogeog = 1 else @@ -350,34 +348,49 @@ subroutine CLMFatesGlobals(dtime) end if call set_fates_ctrlparms('use_fixed_biogeog',ival=pass_biogeog) + if(use_fates_nocomp)then + pass_nocomp = 1 + else + pass_nocomp = 0 + end if + call set_fates_ctrlparms('use_nocomp',ival=pass_nocomp) + + if(use_fates_sp)then + pass_sp = 1 + else + pass_sp = 0 + end if + call set_fates_ctrlparms('use_sp',ival=pass_sp) + + if(use_fates_ed_st3) then pass_ed_st3 = 1 else pass_ed_st3 = 0 end if call set_fates_ctrlparms('use_ed_st3',ival=pass_ed_st3) - + if(use_fates_logging) then pass_logging = 1 else pass_logging = 0 end if call set_fates_ctrlparms('use_logging',ival=pass_logging) - + if(use_fates_ed_prescribed_phys) then pass_ed_prescribed_phys = 1 else pass_ed_prescribed_phys = 0 end if call set_fates_ctrlparms('use_ed_prescribed_phys',ival=pass_ed_prescribed_phys) - + if(use_fates_planthydro) then pass_planthydro = 1 else pass_planthydro = 0 end if call set_fates_ctrlparms('use_planthydro',ival=pass_planthydro) - + if(use_fates_cohort_age_tracking) then pass_cohort_age_tracking = 1 else @@ -404,28 +417,28 @@ subroutine CLMFatesGlobals(dtime) call set_fates_ctrlparms('use_lu_harvest',ival=pass_lu_harvest) call set_fates_ctrlparms('num_lu_harvest_cats',ival=pass_num_lu_harvest_cats) call set_fates_ctrlparms('use_logging',ival=pass_logging) - + if(use_fates_inventory_init) then pass_inventory_init = 1 else pass_inventory_init = 0 end if call set_fates_ctrlparms('use_inventory_init',ival=pass_inventory_init) - + call set_fates_ctrlparms('inventory_ctrl_file',cval=fates_inventory_ctrl_filename) - + if(masterproc)then pass_masterproc = 1 else pass_masterproc = 0 end if call set_fates_ctrlparms('masterproc',ival=pass_masterproc) - + ! Check through FATES parameters to see if all have been set call set_fates_ctrlparms('check_allset') - + end if - + ! This determines the total amount of space it requires in its largest ! dimension. We are currently calling that the "cohort" dimension, but ! it is really a utility dimension that captures the models largest @@ -436,35 +449,35 @@ subroutine CLMFatesGlobals(dtime) ! fates_maxElementsPerSite (where a site is roughly equivalent to a column) ! (Note: this needs to be called when use_fates=.false. as well, becuase ! it will return some nominal dimension sizes of 1 - + call SetFatesGlobalElements(use_fates) call t_stopf('fates_globals') - + return end subroutine CLMFatesGlobals - - + + ! ==================================================================================== subroutine init(this, bounds_proc ) - + ! --------------------------------------------------------------------------------- - ! This initializes the hlm_fates_interface_type + ! This initializes the hlm_fates_interface_type ! - ! sites is the root of the fates state hierarchy (instantaneous info on + ! sites is the root of the fates state hierarchy (instantaneous info on ! the state of the ecosystem). As such, it governs the connection points between ! the host (which also dictates its allocation) and its patch structures. ! ! sites may associate with different scales in different models. In ! CLM, it is being designed to relate to column scale. ! - ! This global may become relegated to this module. + ! This global may become relegated to this module. ! ! Note: CLM/ALM currently wants sites to be allocated even if ed ! is not turned on ! --------------------------------------------------------------------------------- - + use FatesInterfaceTypesMod, only : numpft_fates => numpft use FatesParameterDerivedMod, only : param_derived use subgridMod, only : natveg_patch_exists @@ -472,7 +485,7 @@ subroutine init(this, bounds_proc ) use FATESFireFactoryMod , only: create_fates_fire_data_method implicit none - + ! Input Arguments class(hlm_fates_interface_type), intent(inout) :: this type(bounds_type),intent(in) :: bounds_proc @@ -499,7 +512,7 @@ subroutine init(this, bounds_proc ) call t_startf('fates_init') - + ! Parameter Routines call param_derived%Init( numpft_fates ) @@ -512,17 +525,17 @@ subroutine init(this, bounds_proc ) write(iulog,*) 'clm_fates%init(): allocating for ',nclumps,' threads' end if - + nclumps = get_proc_clumps() - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,nmaxcol,s,c,l,g,collist,pi,pf) + !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,nmaxcol,s,c,l,g,collist,pi,pf,ft) do nc = 1,nclumps - + call get_clump_bounds(nc, bounds_clump) nmaxcol = bounds_clump%endc - bounds_clump%begc + 1 allocate(collist(1:nmaxcol)) - + ! Allocate the mapping that points columns to FATES sites, 0 is NA allocate(this%f2hmap(nc)%hsites(bounds_clump%begc:bounds_clump%endc)) @@ -532,7 +545,7 @@ subroutine init(this, bounds_proc ) s = 0 do c = bounds_clump%begc,bounds_clump%endc l = col%landunit(c) - + ! These are the key constraints that determine if this column ! will have a FATES site associated with it @@ -549,7 +562,7 @@ subroutine init(this, bounds_proc ) write(iulog,*) 'LU type:', lun%itype(l) end if endif - + enddo if(debug)then @@ -565,10 +578,10 @@ subroutine init(this, bounds_proc ) ! Assign the h2hmap indexing this%f2hmap(nc)%fcolumn(1:s) = collist(1:s) - + ! Deallocate the temporary arrays deallocate(collist) - + ! Set the number of FATES sites this%fates(nc)%nsites = s @@ -586,26 +599,22 @@ subroutine init(this, bounds_proc ) ! Note that FATES has its parameters defined, so we can also set the values call allocate_bcpconst(this%fates(nc)%bc_pconst,nlevdecomp) - ! This also needs + ! This also needs call set_bcpconst(this%fates(nc)%bc_pconst,nlevdecomp) - + ! Allocate and Initialize the Boundary Condition Arrays ! These are staticaly allocated at maximums, so ! No information about the patch or cohort structure is needed at this step - + do s = 1, this%fates(nc)%nsites - + c = this%f2hmap(nc)%fcolumn(s) this%fates(nc)%sites(s)%h_gid = c - - if (use_vertsoilc) then - ndecomp = col%nbedrock(c) - else - ndecomp = 1 - end if + + ndecomp = col%nbedrock(c) call allocate_bcin(this%fates(nc)%bc_in(s),col%nbedrock(c),ndecomp, num_harvest_inst) call allocate_bcout(this%fates(nc)%bc_out(s),col%nbedrock(c),ndecomp) @@ -618,24 +627,24 @@ subroutine init(this, bounds_proc ) this%fates(nc)%sites(s)%lat = grc%latdeg(g) this%fates(nc)%sites(s)%lon = grc%londeg(g) - - ! initialize static layers for reduced complexity FATES versions from HLM - ! maybe make this into a subroutine of it's own later. - do m = natpft_lb,natpft_ub-1 - ft = m-natpft_lb+1 - if (natveg_patch_exists(g, m)) then - this%fates(nc)%bc_in(s)%pft_areafrac(ft)=wt_nat_patch(g,m) - else - this%fates(nc)%bc_in(s)%pft_areafrac(ft)=0._r8 - end if + this%fates(nc)%bc_in(s)%pft_areafrac(:)=0._r8 + ! initialize static layers for reduced complexity FATES versions from HLM + ! maybe make this into a subroutine of it's own later. + do m = natpft_lb,natpft_ub + ft = m-natpft_lb + this%fates(nc)%bc_in(s)%pft_areafrac(ft)=wt_nat_patch(g,m) end do + if(abs(sum(this%fates(nc)%bc_in(s)%pft_areafrac(natpft_lb:natpft_ub))-1.0_r8).gt.1.0e-9)then + write(iulog,*) 'pft_area error in interfc ',s, sum(this%fates(nc)%bc_in(s)%pft_areafrac(:))-1.0_r8 + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif end do !site - ! Initialize site-level static quantities dictated by the HLM + ! Initialize site-level static quantities dictated by the HLM ! currently ground layering depth call this%init_soil_depths(nc) - + if (use_fates_planthydro) then call InitHydrSites(this%fates(nc)%sites,this%fates(nc)%bc_in) end if @@ -663,7 +672,6 @@ subroutine init(this, bounds_proc ) end do !$OMP END PARALLEL DO - call this%init_history_io(bounds_proc) ! Report Fates Parameters (debug flag in lower level routines) @@ -677,19 +685,19 @@ subroutine init(this, bounds_proc ) end subroutine init ! =================================================================================== - + subroutine check_hlm_active(this, nc, bounds_clump) ! --------------------------------------------------------------------------------- ! This subroutine is not currently used. It is just a utility that may come ! in handy when we have dynamic sites in FATES ! --------------------------------------------------------------------------------- - + implicit none class(hlm_fates_interface_type), intent(inout) :: this integer :: nc type(bounds_type),intent(in) :: bounds_clump - + ! local variables integer :: c @@ -699,16 +707,18 @@ subroutine check_hlm_active(this, nc, bounds_clump) ! FATES ACTIVE BUT HLM IS NOT if(this%f2hmap(nc)%hsites(c)>0 .and. .not.col%active(c)) then - + write(iulog,*) 'INACTIVE COLUMN WITH ACTIVE FATES SITE' write(iulog,*) 'c = ',c - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=errMsg(sourcefile, __LINE__)) elseif (this%f2hmap(nc)%hsites(c)==0 .and. col%active(c)) then - + write(iulog,*) 'ACTIVE COLUMN WITH INACTIVE FATES SITE' write(iulog,*) 'c = ',c - call endrun(msg=errMsg(sourcefile, __LINE__)) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg=errMsg(sourcefile, __LINE__)) end if end do @@ -722,14 +732,15 @@ subroutine dynamics_driv(this, nc, bounds_clump, & atm2lnd_inst, soilstate_inst, temperature_inst, active_layer_inst, & waterstatebulk_inst, waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & canopystate_inst, soilbiogeochem_carbonflux_inst, frictionvel_inst) - + ! This wrapper is called daily from clm_driver ! This wrapper calls ed_driver, which is the daily dynamics component of FATES - ! ed_driver is not a hlm_fates_inst_type procedure because we need an extra step - ! to process array bounding information - + ! ed_driver is not a hlm_fates_inst_type procedure because we need an extra step + ! to process array bounding information + ! !USES use FATESFireFactoryMod, only: scalar_lightning + use subgridMod, only : natveg_patch_exists ! !ARGUMENTS: implicit none @@ -751,10 +762,11 @@ subroutine dynamics_driv(this, nc, bounds_clump, & integer :: s ! site index integer :: g ! grid-cell index (HLM) integer :: c ! column index (HLM) - integer :: ifp ! patch index + integer :: ifp ! patch index ft integer :: p ! HLM patch index integer :: nlevsoil ! number of soil layers at the site integer :: nld_si ! site specific number of decomposition layers + integer :: ft ! plant functional type real(r8), pointer :: lnfm24(:) integer :: ier integer :: begg,endg @@ -785,7 +797,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & harvest_rates=harvest_rates(begg:endg,1:num_harvest_inst), & after_start_of_harvest_ts=after_start_of_harvest_ts) endif - + if (fates_spitfire_mode > scalar_lightning) then allocate(lnfm24(bounds_clump%begg:bounds_clump%endg), stat=ier) if (ier /= 0) then @@ -801,13 +813,11 @@ subroutine dynamics_driv(this, nc, bounds_clump, & g = col%gridcell(c) if (fates_spitfire_mode > scalar_lightning) then - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - p = ifp + col%patchi(c) - - this%fates(nc)%bc_in(s)%lightning24(ifp) = lnfm24(g) * 24._r8 ! #/km2/hr to #/km2/day - this%fates(nc)%bc_in(s)%pop_density(ifp) = this%fates_fire_data_method%forc_hdm(g) - end do - end if + do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno + this%fates(nc)%bc_in(s)%lightning24(ifp) = lnfm24(g) * 24._r8 ! #/km2/hr to #/km2/day + this%fates(nc)%bc_in(s)%pop_density(ifp) = this%fates_fire_data_method%forc_hdm(g) + end do ! ifp + end if nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil @@ -817,13 +827,14 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! Soil water this%fates(nc)%bc_in(s)%h2o_liqvol_sl(1:nlevsoil) = & - waterstatebulk_inst%h2osoi_vol_col(c,1:nlevsoil) + waterstatebulk_inst%h2osoi_vol_col(c,1:nlevsoil) this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = & min(nlevsoil, active_layer_inst%altmax_lastyear_indx_col(c)) - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno + do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno !for vegetated patches + ! Mapping between IFP space (1,2,3) and HLM P space (looping by IFP) p = ifp+col%patchi(c) this%fates(nc)%bc_in(s)%precip24_pa(ifp) = & @@ -836,7 +847,23 @@ subroutine dynamics_driv(this, nc, bounds_clump, & atm2lnd_inst%wind24_patch(p) end do - + + ! Here we use the same logic as the pft_areafrac initialization to get an array with values for each pft + ! in FATES. + ! N.B. Fow now these are fixed values pending HLM updates. + if(use_fates_sp)then + do ft = natpft_lb,natpft_ub !set of pfts in HLM + ! here we are mapping from P space in the HLM to FT space in the sp_input arrays. + p = ft + col%patchi(c) ! for an FT of 1 we want to use + this%fates(nc)%bc_in(s)%hlm_sp_tlai(ft) = canopystate_inst%tlai_patch(p) + this%fates(nc)%bc_in(s)%hlm_sp_tsai(ft) = canopystate_inst%tsai_patch(p) + this%fates(nc)%bc_in(s)%hlm_sp_htop(ft) = canopystate_inst%htop_patch(p) + if(canopystate_inst%htop_patch(p).lt.1.0e-20)then ! zero htop causes inifinite/nans. This is + this%fates(nc)%bc_in(s)%hlm_sp_htop(ft) = 0.01_r8 + endif + end do ! p + end if ! SP + if(use_fates_planthydro)then this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoil) = soilstate_inst%hksat_col(c,1:nlevsoil) this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoil) = soilstate_inst%watsat_col(c,1:nlevsoil) @@ -857,7 +884,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & this%fates(nc)%bc_in(s)%hlm_harvest_rates(1:num_harvest_inst) = 0._r8 end if this%fates(nc)%bc_in(s)%hlm_harvest_catnames(1:num_harvest_inst) = harvest_varnames(1:num_harvest_inst) - + ! also pass the units that the harvest rates are specified in if (trim(harvest_units) .eq. trim(unitless_units)) then this%fates(nc)%bc_in(s)%hlm_harvest_units = hlm_harvest_area_fraction @@ -886,7 +913,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! --------------------------------------------------------------------------------- call fates_hist%flush_hvars(nc,upfreq_in=1) - + ! --------------------------------------------------------------------------------- ! Part II: Call the FATES model now that input boundary conditions have been ! provided. @@ -895,15 +922,15 @@ subroutine dynamics_driv(this, nc, bounds_clump, & do s = 1,this%fates(nc)%nsites call ed_ecosystem_dynamics(this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s), & + this%fates(nc)%bc_in(s), & this%fates(nc)%bc_out(s)) - + call ed_update_site(this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s), & + this%fates(nc)%bc_in(s), & this%fates(nc)%bc_out(s)) enddo - + ! --------------------------------------------------------------------------------- ! Part III: Process FATES output into the dimensions and structures that are part ! of the HLMs API. (column, depth, and litter fractions) @@ -949,14 +976,14 @@ subroutine dynamics_driv(this, nc, bounds_clump, & bounds_clump, & waterdiagnosticbulk_inst, & canopystate_inst, .false.) - + ! --------------------------------------------------------------------------------- - ! Part IV: + ! Part IV: ! Update history IO fields that depend on ecosystem dynamics ! --------------------------------------------------------------------------------- call fates_hist%update_history_dyn( nc, & this%fates(nc)%nsites, & - this%fates(nc)%sites) + this%fates(nc)%sites) if (masterproc) then write(iulog, *) 'clm: leaving fates model', bounds_clump%begg, & @@ -964,10 +991,10 @@ subroutine dynamics_driv(this, nc, bounds_clump, & end if call t_stopf('fates_dynamics_daily_driver') - + return end subroutine dynamics_driv - + ! ------------------------------------------------------------------------------------ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & @@ -991,11 +1018,13 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & logical , intent(in) :: is_initing_from_restart integer :: npatch ! number of patches in each site - integer :: ifp ! index FATES patch + integer :: ifp ! index FATES patch integer :: p ! HLM patch index integer :: s ! site index integer :: c ! column index + integer :: g ! grid cell + real(r8) :: areacheck call t_startf('fates_wrap_update_hlmfates_dyn') associate( & @@ -1004,8 +1033,8 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & tsai => canopystate_inst%tsai_patch , & esai => canopystate_inst%esai_patch , & htop => canopystate_inst%htop_patch , & - hbot => canopystate_inst%hbot_patch , & - z0m => canopystate_inst%z0m_patch , & ! Output: [real(r8) (:) ] momentum roughness length (m) + hbot => canopystate_inst%hbot_patch , & + z0m => canopystate_inst%z0m_patch , & ! Output: [real(r8) (:) ] momentum roughness length (m) displa => canopystate_inst%displa_patch, & dleaf_patch => canopystate_inst%dleaf_patch, & snow_depth => waterdiagnosticbulk_inst%snow_depth_col, & @@ -1020,12 +1049,12 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & this%fates(nc)%bc_in(s)%snow_depth_si = snow_depth(c) this%fates(nc)%bc_in(s)%frac_sno_eff_si = frac_sno_eff(c) end do - + ! Only update the fates internal snow burial if this is not a restart if (.not. is_initing_from_restart) then call UpdateFatesAvgSnowDepth(this%fates(nc)%sites,this%fates(nc)%bc_in) end if - + ! Canopy diagnostics for FATES call canopy_summarization(this%fates(nc)%nsites, & this%fates(nc)%sites, & @@ -1038,8 +1067,8 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & this%fates(nc)%bc_out ) !--------------------------------------------------------------------------------- - ! CHANGING STORED WATER DURING PLANT DYNAMICS IS NOT FULLY IMPLEMENTED - ! LEAVING AS A PLACE-HOLDER FOR NOW. + ! CHANGING STORED WATER DURING PLANT DYNAMICS IS NOT FULLY IMPLEMENTED + ! LEAVING AS A PLACE-HOLDER FOR NOW. ! ! Diagnose water storage in canopy if hydraulics is on ! ! This updates the internal value and the bc_out value. ! ! If hydraulics is off, it returns 0 storage @@ -1051,7 +1080,7 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & end do end if !--------------------------------------------------------------------------------- - + ! Convert FATES dynamics into HLM usable information ! Initialize weighting variables (note FATES is the only HLM module ! that uses "is_veg" and "is_bareground". The entire purpose of these @@ -1063,18 +1092,25 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & patch%wt_ed(bounds_clump%begp:bounds_clump%endp) = 0.0_r8 do s = 1,this%fates(nc)%nsites - + c = this%f2hmap(nc)%fcolumn(s) ! Other modules may have AI's we only flush values ! that are on the naturally vegetated columns elai(col%patchi(c):col%patchf(c)) = 0.0_r8 - tlai(col%patchi(c):col%patchf(c)) = 0.0_r8 esai(col%patchi(c):col%patchf(c)) = 0.0_r8 - tsai(col%patchi(c):col%patchf(c)) = 0.0_r8 - htop(col%patchi(c):col%patchf(c)) = 0.0_r8 hbot(col%patchi(c):col%patchf(c)) = 0.0_r8 + if(use_fates_sp)then + canopystate_inst%tlai_hist_patch(col%patchi(c):col%patchf(c)) = 0.0_r8 + canopystate_inst%tsai_hist_patch(col%patchi(c):col%patchf(c)) = 0.0_r8 + canopystate_inst%htop_hist_patch(col%patchi(c):col%patchf(c)) = 0.0_r8 + else + tlai(col%patchi(c):col%patchf(c)) = 0.0_r8 + tsai(col%patchi(c):col%patchf(c)) = 0.0_r8 + htop(col%patchi(c):col%patchf(c)) = 0.0_r8 + endif + ! FATES does not dictate bare-ground so turbulent ! variables are not over-written. z0m(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 @@ -1094,31 +1130,45 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & ! protext it here with a lower bound of 0.0_r8. patch%wt_ed(col%patchi(c)) = max(0.0_r8, & + 1.0_r8-sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch))) - if(sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch))>1.0_r8)then - write(iulog,*)'Projected Canopy Area of all FATES patches' - write(iulog,*)'cannot exceed 1.0' - !end_run() - end if + patch%sp_pftorder_index(col%patchi(c)) = 0 !bg is the 0th patch in the SP FATES structure + + areacheck = patch%wt_ed(col%patchi(c)) ! this is where we start the areachecking - do ifp = 1, npatch + do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno + ! for the vegetated patches p = ifp+col%patchi(c) ! bc_out(s)%canopy_fraction_pa(ifp) is the area fraction - ! the site's total ground area that is occupied by the - ! area footprint of the current patch's vegetation canopy + ! the site's total ground area that is occupied by the + ! area footprint of the current patch's vegetation canopy patch%is_veg(p) = .true. patch%wt_ed(p) = this%fates(nc)%bc_out(s)%canopy_fraction_pa(ifp) + areacheck = areacheck + patch%wt_ed(p) elai(p) = this%fates(nc)%bc_out(s)%elai_pa(ifp) - tlai(p) = this%fates(nc)%bc_out(s)%tlai_pa(ifp) esai(p) = this%fates(nc)%bc_out(s)%esai_pa(ifp) - tsai(p) = this%fates(nc)%bc_out(s)%tsai_pa(ifp) hbot(p) = this%fates(nc)%bc_out(s)%hbot_pa(ifp) - htop(p) = this%fates(nc)%bc_out(s)%htop_pa(ifp) + + if(use_fates_sp)then + canopystate_inst%tlai_hist_patch(p) = this%fates(nc)%bc_out(s)%tlai_pa(ifp) + canopystate_inst%tsai_hist_patch(p) = this%fates(nc)%bc_out(s)%tsai_pa(ifp) + canopystate_inst%htop_hist_patch(p) = this%fates(nc)%bc_out(s)%htop_pa(ifp) + else + tlai(p) = this%fates(nc)%bc_out(s)%tlai_pa(ifp) + tsai(p) = this%fates(nc)%bc_out(s)%tsai_pa(ifp) + htop(p) = this%fates(nc)%bc_out(s)%htop_pa(ifp) + endif + + if(use_fates_sp.and.abs(canopystate_inst%tlai_hist_patch(p) - & + this%fates(nc)%bc_out(s)%tlai_pa(ifp)).gt.1e-09)then + write(iulog,*) 'fates lai not like hlm lai',tlai(p),this%fates(nc)%bc_out(s)%tlai_pa(ifp),ifp + endif + frac_veg_nosno_alb(p) = this%fates(nc)%bc_out(s)%frac_veg_nosno_alb_pa(ifp) ! Note that while we pass the following values at this point @@ -1128,10 +1178,13 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & z0m(p) = this%fates(nc)%bc_out(s)%z0m_pa(ifp) displa(p) = this%fates(nc)%bc_out(s)%displa_pa(ifp) dleaf_patch(p) = this%fates(nc)%bc_out(s)%dleaf_pa(ifp) - + end do ! veg pach + + if(abs(areacheck - 1.0_r8).gt.1.e-9_r8)then + write(iulog,*) 'area wrong in interface',areacheck - 1.0_r8 + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif - end do - end do end associate @@ -1180,7 +1233,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & type(canopystate_type) , intent(inout) :: canopystate_inst type(soilstate_type) , intent(inout) :: soilstate_inst type(active_layer_type) , intent(in) :: active_layer_inst - + ! Locals type(bounds_type) :: bounds_clump integer :: nc @@ -1190,6 +1243,8 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & integer :: c ! HLM column index integer :: s ! Fates site index integer :: g ! grid-cell index + integer :: p ! HLM patch index + integer :: ft ! plant functional type integer :: dk_index integer :: nlevsoil character(len=fates_long_string_length) :: ioname @@ -1224,60 +1279,60 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & ! --------------------------------------------------------------------------------- ! Set the FATES global time and date variables - call GetAndSetTime + call GetAndSetTime if(.not.initialized) then initialized=.true. - + ! ------------------------------------------------------------------------------ ! PART I: Set FATES DIMENSIONING INFORMATION ! ------------------------------------------------------------------------------ - + call hlm_bounds_to_fates_bounds(bounds_proc, fates_bounds) - + call this%fates_restart%Init(nclumps, fates_bounds) - + ! Define the bounds on the first dimension for each thread !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,fates_clump) do nc = 1,nclumps call get_clump_bounds(nc, bounds_clump) - + ! thread bounds for patch call hlm_bounds_to_fates_bounds(bounds_clump, fates_clump) call this%fates_restart%SetThreadBoundsEach(nc, fates_clump) end do !$OMP END PARALLEL DO - + !$OMP PARALLEL DO PRIVATE (nc,s,c,g,bounds_clump) do nc = 1,nclumps call get_clump_bounds(nc, bounds_clump) allocate(this%fates_restart%restart_map(nc)%site_index(this%fates(nc)%nsites)) - allocate(this%fates_restart%restart_map(nc)%cohort1_index(this%fates(nc)%nsites)) + allocate(this%fates_restart%restart_map(nc)%cohort1_index(this%fates(nc)%nsites)) do s=1,this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) this%fates_restart%restart_map(nc)%site_index(s) = c g = col%gridcell(c) this%fates_restart%restart_map(nc)%cohort1_index(s) = (g-1)*fates_maxElementsPerSite + 1 end do - + end do !$OMP END PARALLEL DO - + ! ------------------------------------------------------------------------------------ ! PART II: USE THE JUST DEFINED DIMENSIONS TO ASSEMBLE THE VALID IO TYPES ! INTERF-TODO: THESE CAN ALL BE EMBEDDED INTO A SUBROUTINE IN HISTORYIOMOD ! ------------------------------------------------------------------------------------ call this%fates_restart%assemble_restart_output_types() - - + + ! ------------------------------------------------------------------------------------ ! PART III: DEFINE THE LIST OF OUTPUT VARIABLE OBJECTS, AND REGISTER THEM WITH THE ! HLM ACCORDING TO THEIR TYPES ! ------------------------------------------------------------------------------------ call this%fates_restart%initialize_restart_vars() - + end if ! --------------------------------------------------------------------------------- @@ -1305,14 +1360,14 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & nvar = this%fates_restart%num_restart_vars() do ivar = 1, nvar - + associate( vname => this%fates_restart%rvars(ivar)%vname, & vunits => this%fates_restart%rvars(ivar)%units, & vlong => this%fates_restart%rvars(ivar)%long ) dk_index = this%fates_restart%rvars(ivar)%dim_kinds_index ioname = trim(this%fates_restart%dim_kinds(dk_index)%name) - + select case(trim(ioname)) case(cohort_r8) @@ -1320,37 +1375,37 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & xtype=ncd_double,dim1name=trim('cohort'),long_name=trim(vlong), & units=trim(vunits),interpinic_flag='interp', & data=this%fates_restart%rvars(ivar)%r81d,readvar=readvar) - + case(site_r8) - + call restartvar(ncid=ncid, flag=flag, varname=trim(vname), & xtype=ncd_double,dim1name=trim('column'),long_name=trim(vlong), & units=trim(vunits),interpinic_flag='interp', & data=this%fates_restart%rvars(ivar)%r81d,readvar=readvar) - + case(cohort_int) - + call restartvar(ncid=ncid, flag=flag, varname=trim(vname), & xtype=ncd_int,dim1name=trim('cohort'),long_name=trim(vlong), & units=trim(vunits),interpinic_flag='interp', & data=this%fates_restart%rvars(ivar)%int1d,readvar=readvar) - + case(site_int) - + call restartvar(ncid=ncid, flag=flag, varname=trim(vname), & xtype=ncd_int,dim1name=trim('column'),long_name=trim(vlong), & units=trim(vunits),interpinic_flag='interp', & data=this%fates_restart%rvars(ivar)%int1d,readvar=readvar) - + case default write(iulog,*) 'A FATES iotype was created that was not registerred' write(iulog,*) 'in CLM.:',trim(ioname) call endrun(msg=errMsg(sourcefile, __LINE__)) end select - + end associate end do - + ! --------------------------------------------------------------------------------- ! If we are in a read mode, then we have just populated the sparse vectors ! in the IO object list. The data in these vectors needs to be transferred @@ -1358,7 +1413,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & ! --------------------------------------------------------------------------------- if(flag=='read')then - + !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,s) do nc = 1, nclumps if (this%fates(nc)%nsites>0) then @@ -1371,33 +1426,48 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & call this%fates_restart%create_patchcohort_structure(nc, & this%fates(nc)%nsites, this%fates(nc)%sites, this%fates(nc)%bc_in, & this%fates(nc)%bc_out) - + call this%fates_restart%get_restart_vectors(nc, this%fates(nc)%nsites, & this%fates(nc)%sites ) ! I think ed_update_site and update_hlmfates_dyn are doing some similar ! update type stuff, should consolidate (rgk 11-2016) do s = 1,this%fates(nc)%nsites - + c = this%f2hmap(nc)%fcolumn(s) this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = & min(this%fates(nc)%bc_in(s)%nlevsoil, active_layer_inst%altmax_lastyear_indx_col(c)) - + call ed_update_site( this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s), & + this%fates(nc)%bc_in(s), & this%fates(nc)%bc_out(s) ) ! This call sends internal fates variables into the ! output boundary condition structures. Note: this is called ! internally in fates dynamics as well. call FluxIntoLitterPools(this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s), & + this%fates(nc)%bc_in(s), & this%fates(nc)%bc_out(s)) - + end do - - + + if(use_fates_sp)then + do s = 1,this%fates(nc)%nsites + c = this%f2hmap(nc)%fcolumn(s) + do ft = natpft_lb,natpft_ub !set of pfts in HLM + ! here we are mapping from P space in the HLM to FT space in the sp_input arrays. + p = ft + col%patchi(c) ! for an FT of 1 we want to use + this%fates(nc)%bc_in(s)%hlm_sp_tlai(ft) = canopystate_inst%tlai_patch(p) + this%fates(nc)%bc_in(s)%hlm_sp_tsai(ft) = canopystate_inst%tsai_patch(p) + this%fates(nc)%bc_in(s)%hlm_sp_htop(ft) = canopystate_inst%htop_patch(p) + if(canopystate_inst%htop_patch(p).lt.1.0e-20)then ! zero htop causes inifinite/nans. This is + this%fates(nc)%bc_in(s)%hlm_sp_htop(ft) = 0.01_r8 + endif + end do ! p + end do ! c + end if ! SP + ! ------------------------------------------------------------------------ ! Re-populate all the hydraulics variables that are dependent ! on the key hydro state variables and plant carbon/geometry @@ -1409,19 +1479,19 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoil) = & soilstate_inst%hksat_col(c,1:nlevsoil) - + this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoil) = & soilstate_inst%watsat_col(c,1:nlevsoil) - + this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoil) = & soilstate_inst%watres_col(c,1:nlevsoil) - + this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoil) = & soilstate_inst%sucsat_col(c,1:nlevsoil) - + this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoil) = & soilstate_inst%bsw_col(c,1:nlevsoil) - + this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoil) = & waterstatebulk_inst%h2osoi_liq_col(c,1:nlevsoil) end do @@ -1445,23 +1515,23 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & call this%fates_restart%update_3dpatch_radiation(this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_out) - + ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ call fates_hist%update_history_dyn( nc, & this%fates(nc)%nsites, & - this%fates(nc)%sites) + this%fates(nc)%sites) + - end if end do !$OMP END PARALLEL DO - + end if call t_stopf('fates_restart') - + return end subroutine restart @@ -1477,7 +1547,7 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & type(waterdiagnosticbulk_type) , intent(inout) :: waterdiagnosticbulk_inst type(canopystate_type) , intent(inout) :: canopystate_inst type(soilstate_type) , intent(inout) :: soilstate_inst - + ! locals integer :: nclumps integer :: nc @@ -1489,17 +1559,20 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & integer :: j integer :: s integer :: c + integer :: p ! HLM patch index + integer :: ft ! plant functional type + call t_startf('fates_initcoldstart') ! Set the FATES global time and date variables - call GetAndSetTime + call GetAndSetTime nclumps = get_proc_clumps() !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,s,c,j,vol_ice,eff_porosity) do nc = 1, nclumps - + if ( this%fates(nc)%nsites>0 ) then call get_clump_bounds(nc, bounds_clump) @@ -1510,11 +1583,31 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & this%fates(nc)%bc_out(s) ) call zero_site(this%fates(nc)%sites(s)) end do - + call set_site_properties(this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_in) + + ! ---------------------------------------------------------------------------- + ! Initialize satellite phenology values if turned on + ! ---------------------------------------------------------------------------- + if(use_fates_sp)then + do s = 1,this%fates(nc)%nsites + c = this%f2hmap(nc)%fcolumn(s) + do ft = natpft_lb,natpft_ub !set of pfts in HLM + ! here we are mapping from P space in the HLM to FT space in the sp_input arrays. + p = ft + col%patchi(c) ! for an FT of 1 we want to use + this%fates(nc)%bc_in(s)%hlm_sp_tlai(ft) = canopystate_inst%tlai_patch(p) + this%fates(nc)%bc_in(s)%hlm_sp_tsai(ft) = canopystate_inst%tsai_patch(p) + this%fates(nc)%bc_in(s)%hlm_sp_htop(ft) = canopystate_inst%htop_patch(p) + if(canopystate_inst%htop_patch(p).lt.1.0e-20)then ! zero htop causes inifinite/nans. This is + this%fates(nc)%bc_in(s)%hlm_sp_htop(ft) = 0.01_r8 + endif + end do ! p + end do ! c + end if ! SP + ! ---------------------------------------------------------------------------- ! Initialize Hydraulics Code if turned on ! Called prior to init_patches(). Site level rhizosphere shells must @@ -1525,21 +1618,21 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & do s = 1,this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) - + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoil) = & soilstate_inst%watsat_col(c,1:nlevsoil) - + this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoil) = & soilstate_inst%sucsat_col(c,1:nlevsoil) - + this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoil) = & soilstate_inst%bsw_col(c,1:nlevsoil) - + this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoil) = & waterstatebulk_inst%h2osoi_liq_col(c,1:nlevsoil) - + this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoil) = & soilstate_inst%hksat_col(c,1:nlevsoil) @@ -1568,18 +1661,18 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & ! time-step loop. Therefore, we just initialize fluxes ! into the litter pool in a trivial way prior to timestepping this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = this%fates(nc)%bc_in(s)%nlevsoil - + call ed_update_site(this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s), & + this%fates(nc)%bc_in(s), & this%fates(nc)%bc_out(s)) ! This call sends internal fates variables into the ! output boundary condition structures. Note: this is called ! internally in fates dynamics as well. call FluxIntoLitterPools(this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s), & + this%fates(nc)%bc_in(s), & this%fates(nc)%bc_out(s)) - + end do ! ------------------------------------------------------------------------ @@ -1593,41 +1686,41 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & ! ------------------------------------------------------------------------ call fates_hist%update_history_dyn( nc, & this%fates(nc)%nsites, & - this%fates(nc)%sites) + this%fates(nc)%sites) + - end if end do !$OMP END PARALLEL DO - + call t_stopf('fates_initcoldstart') end subroutine init_coldstart ! ====================================================================================== - + subroutine wrap_sunfrac(this,nc,atm2lnd_inst,canopystate_inst) - + ! --------------------------------------------------------------------------------- ! This interface function is a wrapper call on ED_SunShadeFracs. The only ! returned variable is a patch vector, fsun_patch, which describes the fraction ! of the canopy that is exposed to sun. ! --------------------------------------------------------------------------------- - + implicit none - + ! Input Arguments class(hlm_fates_interface_type), intent(inout) :: this - + integer, intent(in) :: nc - + ! direct and diffuse downwelling radiation (W/m2) type(atm2lnd_type),intent(in) :: atm2lnd_inst - + ! Input/Output Arguments to CLM type(canopystate_type),intent(inout) :: canopystate_inst - + ! Local Variables integer :: p ! global index of the host patch integer :: g ! global index of the host gridcell @@ -1637,7 +1730,7 @@ subroutine wrap_sunfrac(this,nc,atm2lnd_inst,canopystate_inst) integer :: ifp ! FATEs patch index ! this is the order increment of patch ! on the site - + type(ed_patch_type), pointer :: cpatch ! c"urrent" patch INTERF-TODO: SHOULD ! BE HIDDEN AS A FATES PRIVATE @@ -1646,7 +1739,7 @@ subroutine wrap_sunfrac(this,nc,atm2lnd_inst,canopystate_inst) associate( forc_solad => atm2lnd_inst%forc_solad_grc, & forc_solai => atm2lnd_inst%forc_solai_grc, & fsun => canopystate_inst%fsun_patch, & - laisun => canopystate_inst%laisun_patch, & + laisun => canopystate_inst%laisun_patch, & laisha => canopystate_inst%laisha_patch ) ! ------------------------------------------------------------------------------- @@ -1659,13 +1752,8 @@ subroutine wrap_sunfrac(this,nc,atm2lnd_inst,canopystate_inst) g = col%gridcell(c) do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - !do ifp = 1, this%fates(nc)%bc_in(s)%npatches - - p = ifp+col%patchi(c) - this%fates(nc)%bc_in(s)%solad_parb(ifp,:) = forc_solad(g,:) this%fates(nc)%bc_in(s)%solai_parb(ifp,:) = forc_solai(g,:) - end do end do @@ -1688,7 +1776,9 @@ subroutine wrap_sunfrac(this,nc,atm2lnd_inst,canopystate_inst) do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno + p = ifp+col%patchi(c) + fsun(p) = this%fates(nc)%bc_out(s)%fsun_pa(ifp) laisun(p) = this%fates(nc)%bc_out(s)%laisun_pa(ifp) laisha(p) = this%fates(nc)%bc_out(s)%laisha_pa(ifp) @@ -1700,17 +1790,17 @@ subroutine wrap_sunfrac(this,nc,atm2lnd_inst,canopystate_inst) call t_stopf('fates_wrapsunfrac') end subroutine wrap_sunfrac - + ! =================================================================================== subroutine prep_canopyfluxes(this, nc, fn, filterp, photosyns_inst) ! ---------------------------------------------------------------------- ! the main function for calculating photosynthesis is called within a - ! loop based on convergence. Some intitializations, including + ! loop based on convergence. Some intitializations, including ! canopy resistance must be intitialized before the loop ! ---------------------------------------------------------------------- - + ! Arguments class(hlm_fates_interface_type), intent(inout) :: this integer, intent(in) :: nc @@ -1741,23 +1831,23 @@ subroutine prep_canopyfluxes(this, nc, fn, filterp, photosyns_inst) end subroutine prep_canopyfluxes ! ==================================================================================== - + subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & waterdiagnosticbulk_inst, temperature_inst, energyflux_inst, & soil_water_retention_curve) - + ! --------------------------------------------------------------------------------- ! This subroutine calculates btran for FATES, this will be an input boundary ! condition for FATES photosynthesis/transpiration. ! ! This subroutine also calculates rootr - ! + ! ! --------------------------------------------------------------------------------- use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type implicit none - + ! Arguments class(hlm_fates_interface_type), intent(inout) :: this integer , intent(in) :: nc @@ -1782,15 +1872,15 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & call t_startf('fates_wrapbtran') - associate(& - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) + associate(& + sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - eff_porosity => soilstate_inst%eff_porosity_col , & ! Input: [real(r8) (:,:) ] effective porosity = porosity - vol_ice + bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" + eff_porosity => soilstate_inst%eff_porosity_col , & ! Input: [real(r8) (:,:) ] effective porosity = porosity - vol_ice t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) h2osoi_liqvol => waterdiagnosticbulk_inst%h2osoi_liqvol_col , & ! Input: [real(r8) (:,:) ] liquid volumetric moisture, will be used for BeTR - btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) - rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root resistance by layer (0-1) (nlevgrnd) + btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) + rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root resistance by layer (0-1) (nlevgrnd) rootr => soilstate_inst%rootr_patch & ! Output: [real(r8) (:,:) ] Fraction of water uptake in each layer ) @@ -1811,14 +1901,14 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & ! this on all layers, because values with no moisture or low temps will generate ! unstable values and cause sigtraps. ! ------------------------------------------------------------------------------- - + do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil ! Check to see if this column is in the exposed veg filter if( any(filterc==c) )then - + this%fates(nc)%bc_in(s)%filter_btran = .true. do j = 1,nlevsoil this%fates(nc)%bc_in(s)%tempk_sl(j) = t_soisno(c,j) @@ -1866,10 +1956,10 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & end if end do end do - + ! ------------------------------------------------------------------------------- ! Suction and active uptake layers calculated, lets calculate uptake (btran) - ! This will calculate internals, as well as output boundary conditions: + ! This will calculate internals, as well as output boundary conditions: ! btran, rootr ! ------------------------------------------------------------------------------- @@ -1894,16 +1984,16 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil c = this%f2hmap(nc)%fcolumn(s) do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - + p = ifp+col%patchi(c) - + do j = 1,nlevsoil - + rresis(p,j) = -999.9 ! We do not calculate this correctly ! it should not thought of as valid output until we decide to. rootr(p,j) = this%fates(nc)%bc_out(s)%rootr_pasl(ifp,j) btran(p) = this%fates(nc)%bc_out(s)%btran_pa(ifp) - + end do end do end do @@ -1914,22 +2004,22 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & end subroutine wrap_btran ! ==================================================================================== - + subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & esat_tv, eair, oair, cair, rb, dayl_factor, & atm2lnd_inst, temperature_inst, canopystate_inst, photosyns_inst) - + use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun use decompMod , only : bounds_type - use clm_varcon , only : rgas, tfrz, namep + use clm_varcon , only : rgas, tfrz, namep use clm_varctl , only : iulog use pftconMod , only : pftcon use PatchType , only : patch use quadraticMod , only : quadratic use EDTypesMod , only : dinc_ed use EDtypesMod , only : ed_patch_type, ed_cohort_type, ed_site_type - + ! ! !ARGUMENTS: class(hlm_fates_interface_type), intent(inout) :: this @@ -1951,7 +2041,6 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & integer :: nlevsoil ! number of soil layers in this site integer :: s,c,p,ifp,j,icp real(r8) :: dtime - call t_startf('fates_psn') associate(& @@ -1963,11 +2052,11 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & rssha => photosyns_inst%rssha_patch, & psnsun => photosyns_inst%psnsun_patch, & psnsha => photosyns_inst%psnsha_patch) - + do s = 1, this%fates(nc)%nsites - + c = this%f2hmap(nc)%fcolumn(s) - + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil do j = 1,nlevsoil @@ -1975,13 +2064,12 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & end do this%fates(nc)%bc_in(s)%forc_pbot = forc_pbot(c) ! atmospheric pressure (Pa) - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - + do ifp = 1,this%fates(nc)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) - ! Check to see if this patch is in the filter ! Note that this filter is most likely changing size, and getting smaller ! and smaller as more patch have converged on solution + if( any(filterp==p) )then ! This filter is flushed to 1 before the canopyflux stability iterator @@ -1989,26 +2077,26 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & ! After photosynthesis is called, it is upgraded to 3 if it was called. ! After all iterations we can evaluate which patches have a final flag ! of 3 to check if we missed any. - this%fates(nc)%bc_in(s)%filter_photo_pa(ifp) = 2 + this%fates(nc)%bc_in(s)%dayl_factor_pa(ifp) = dayl_factor(p) ! scalar (0-1) for daylength this%fates(nc)%bc_in(s)%esat_tv_pa(ifp) = esat_tv(p) ! saturation vapor pressure at t_veg (Pa) this%fates(nc)%bc_in(s)%eair_pa(ifp) = eair(p) ! vapor pressure of canopy air (Pa) this%fates(nc)%bc_in(s)%oair_pa(ifp) = oair(p) ! Atmospheric O2 partial pressure (Pa) this%fates(nc)%bc_in(s)%cair_pa(ifp) = cair(p) ! Atmospheric CO2 partial pressure (Pa) this%fates(nc)%bc_in(s)%rb_pa(ifp) = rb(p) ! boundary layer resistance (s/m) - this%fates(nc)%bc_in(s)%t_veg_pa(ifp) = t_veg(p) ! vegetation temperature (Kelvin) + this%fates(nc)%bc_in(s)%t_veg_pa(ifp) = t_veg(p) ! vegetation temperature (Kelvin) this%fates(nc)%bc_in(s)%tgcm_pa(ifp) = tgcm(p) ! air temperature at agcm reference height (kelvin) end if end do end do dtime = get_step_size_real() - + ! Call photosynthesis - + call FatesPlantRespPhotosynthDrive (this%fates(nc)%nsites, & - this%fates(nc)%sites, & + this%fates(nc)%sites, & this%fates(nc)%bc_in, & this%fates(nc)%bc_out, & dtime) @@ -2022,21 +2110,22 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & s = this%f2hmap(nc)%hsites(c) ! do if structure here and only pass natveg columns ifp = p-col%patchi(c) + if(this%fates(nc)%bc_in(s)%filter_photo_pa(ifp) /= 2)then write(iulog,*) 'Not all patches on the natveg column in the photosynthesis' - write(iulog,*) 'filter ran photosynthesis' + write(iulog,*) 'filter ran photosynthesis s p icp ifp ilter',s,p,icp,ifp call endrun(msg=errMsg(sourcefile, __LINE__)) else this%fates(nc)%bc_in(s)%filter_photo_pa(ifp) = 3 rssun(p) = this%fates(nc)%bc_out(s)%rssun_pa(ifp) rssha(p) = this%fates(nc)%bc_out(s)%rssha_pa(ifp) - + ! These fields are marked with a bad-value flag photosyns_inst%psnsun_patch(p) = spval photosyns_inst%psnsha_patch(p) = spval end if end do - + end associate call t_stopf('fates_psn') @@ -2052,7 +2141,7 @@ subroutine wrap_accumulatefluxes(this, nc, fn, filterp) integer , intent(in) :: nc ! clump index integer , intent(in) :: fn ! size of pft filter integer , intent(in) :: filterp(fn) ! pft filter - + integer :: s,c,p,ifp,icp real(r8) :: dtime @@ -2065,6 +2154,8 @@ subroutine wrap_accumulatefluxes(this, nc, fn, filterp) s = this%f2hmap(nc)%hsites(c) ifp = p-col%patchi(c) if(this%fates(nc)%bc_in(s)%filter_photo_pa(ifp) /= 3)then + write(iulog,*) 'Not all patches on the natveg column in the canopys' + write(iulog,*) 'filter ran canopy fluxes s p icp ifp ilter',s,p,icp,ifp call endrun(msg=errMsg(sourcefile, __LINE__)) end if end do @@ -2092,12 +2183,12 @@ subroutine wrap_canopy_radiation(this, bounds_clump, nc, & type(bounds_type), intent(in) :: bounds_clump ! filter for vegetated pfts with coszen>0 integer , intent(in) :: nc ! clump index - integer , intent(in) :: num_vegsol - integer , intent(in) :: filter_vegsol(num_vegsol) + integer , intent(in) :: num_vegsol + integer , intent(in) :: filter_vegsol(num_vegsol) ! cosine solar zenith angle for next time step - real(r8) , intent(in) :: coszen( bounds_clump%begp: ) - type(surfalb_type) , intent(inout) :: surfalb_inst - + real(r8) , intent(in) :: coszen( bounds_clump%begp: ) + type(surfalb_type) , intent(inout) :: surfalb_inst + ! locals integer :: s,c,p,ifp,icp @@ -2117,19 +2208,19 @@ subroutine wrap_canopy_radiation(this, bounds_clump, nc, & do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - - p = ifp+col%patchi(c) - + + do ifp = 1,this%fates(nc)%sites(s)%youngest_patch%patchno + p = ifp+col%patchi(c) + if( any(filter_vegsol==p) )then - + this%fates(nc)%bc_in(s)%filter_vegzen_pa(ifp) = .true. this%fates(nc)%bc_in(s)%coszen_pa(ifp) = coszen(p) this%fates(nc)%bc_in(s)%albgr_dir_rb(:) = albgrd_col(c,:) this%fates(nc)%bc_in(s)%albgr_dif_rb(:) = albgri_col(c,:) else - + this%fates(nc)%bc_in(s)%filter_vegzen_pa(ifp) = .false. end if @@ -2141,7 +2232,7 @@ subroutine wrap_canopy_radiation(this, bounds_clump, nc, & this%fates(nc)%sites, & this%fates(nc)%bc_in, & this%fates(nc)%bc_out) - + ! Pass FATES BC's back to HLM ! ----------------------------------------------------------------------------------- do icp = 1,num_vegsol @@ -2152,8 +2243,9 @@ subroutine wrap_canopy_radiation(this, bounds_clump, nc, & ifp = p-col%patchi(c) if(.not.this%fates(nc)%bc_in(s)%filter_vegzen_pa(ifp) )then - write(iulog,*) 'Not all patches on the natveg column were passed to canrad' - call endrun(msg=errMsg(sourcefile, __LINE__)) + write(iulog,*) 's,p,ifp',s,p,ifp + write(iulog,*) 'Not all patches on the natveg column were passed to canrad',patch%sp_pftorder_index(p) +! call endrun(msg=errMsg(sourcefile, __LINE__)) else albd(p,:) = this%fates(nc)%bc_out(s)%albd_parb(ifp,:) albi(p,:) = this%fates(nc)%bc_out(s)%albi_parb(ifp,:) @@ -2164,7 +2256,7 @@ subroutine wrap_canopy_radiation(this, bounds_clump, nc, & ftii(p,:) = this%fates(nc)%bc_out(s)%ftii_parb(ifp,:) end if end do - + end associate call t_stopf('fates_wrapcanopyradiation') @@ -2187,15 +2279,15 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, & real(r8) :: dtime integer :: s, c, nc - call t_startf('fates_update_hifrq_hist') + call t_startf('fates_wrap_update_hifrq_hist') - associate(& + associate(& hr => soilbiogeochem_carbonflux_inst%hr_col, & ! (gC/m2/s) total heterotrophic respiration totsomc => soilbiogeochem_carbonstate_inst%totsomc_col, & ! (gC/m2) total soil organic matter carbon totlitc => soilbiogeochem_carbonstate_inst%totlitc_col) ! (gC/m2) total litter carbon in BGC pools nc = bounds_clump%clump_index - + ! Summarize Net Fluxes do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) @@ -2205,7 +2297,7 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, & end do dtime = get_step_size_real() - + ! Update history variables that track these variables call fates_hist%update_history_hifrq(nc, & this%fates(nc)%nsites, & @@ -2215,7 +2307,7 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, & end associate - call t_stopf('fates_update_hifrq_hist') + call t_stopf('fates_wrap_update_hifrq_hist') end subroutine wrap_update_hifrq_hist @@ -2250,7 +2342,7 @@ subroutine TransferZ0mDisp(this, bounds_clump, z0m_patch, displa_patch) z0m_patch(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 displa_patch(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 - do ifp = 1, this%fates(ci)%sites(s)%youngest_patch%patchno + do ifp = 1, this%fates(ci)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) z0m_patch(p) = this%fates(ci)%bc_out(s)%z0m_pa(ifp) displa_patch(p) = this%fates(ci)%bc_out(s)%displa_pa(ifp) @@ -2263,7 +2355,7 @@ subroutine TransferZ0mDisp(this, bounds_clump, z0m_patch, displa_patch) end subroutine TransferZ0mDisp !----------------------------------------------------------------------- - + subroutine InterpFileInputs(this, bounds) ! ! !DESCRIPTION: @@ -2433,7 +2525,7 @@ end subroutine WrapUpdateFatesRmean subroutine init_history_io(this,bounds_proc) - use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp + use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp use FatesConstantsMod, only : fates_short_string_length, fates_long_string_length use FatesIOVariableKindMod, only : patch_r8, patch_ground_r8, patch_size_pft_r8 @@ -2451,8 +2543,8 @@ subroutine init_history_io(this,bounds_proc) ! Arguments class(hlm_fates_interface_type), intent(inout) :: this type(bounds_type),intent(in) :: bounds_proc ! Currently "proc" - - + + ! Locals type(bounds_type) :: bounds_clump integer :: nvar ! number of IO variables found @@ -2464,7 +2556,7 @@ subroutine init_history_io(this,bounds_proc) character(len=fates_short_string_length) :: dim2name character(len=fates_long_string_length) :: ioname integer :: d_index, dk_index - + type(fates_bounds_type) :: fates_bounds type(fates_bounds_type) :: fates_clump @@ -2478,7 +2570,7 @@ subroutine init_history_io(this,bounds_proc) ! ------------------------------------------------------------------------------------ ! PART I: Set FATES DIMENSIONING INFORMATION - ! + ! ! ------------------------------------------------------------------------------- ! Those who wish add variables that require new dimensions, please ! see FATES: FatesHistoryInterfaceMod.F90. Dimension types are defined at the top of the @@ -2492,7 +2584,7 @@ subroutine init_history_io(this,bounds_proc) ! limitations by creating combined dimensions, for instance the size+pft dimension ! "scpf" ! ------------------------------------------------------------------------------------ - + call hlm_bounds_to_fates_bounds(bounds_proc, fates_bounds) call fates_hist%Init(nclumps, fates_bounds) @@ -2500,9 +2592,9 @@ subroutine init_history_io(this,bounds_proc) ! Define the bounds on the first dimension for each thread !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,fates_clump) do nc = 1,nclumps - + call get_clump_bounds(nc, bounds_clump) - + ! thread bounds for patch call hlm_bounds_to_fates_bounds(bounds_clump, fates_clump) call fates_hist%SetThreadBoundsEach(nc, fates_clump) @@ -2514,16 +2606,16 @@ subroutine init_history_io(this,bounds_proc) ! INTERF-TODO: THESE CAN ALL BE EMBEDDED INTO A SUBROUTINE IN HISTORYIOMOD ! ------------------------------------------------------------------------------------ call fates_hist%assemble_history_output_types() - + ! ------------------------------------------------------------------------------------ ! PART III: DEFINE THE LIST OF OUTPUT VARIABLE OBJECTS, AND REGISTER THEM WITH THE ! HLM ACCORDING TO THEIR TYPES ! ------------------------------------------------------------------------------------ call fates_hist%initialize_history_vars() nvar = fates_hist%num_history_vars() - + do ivar = 1, nvar - + associate( vname => fates_hist%hvars(ivar)%vname, & vunits => fates_hist%hvars(ivar)%units, & vlong => fates_hist%hvars(ivar)%long, & @@ -2532,7 +2624,7 @@ subroutine init_history_io(this,bounds_proc) dk_index = fates_hist%hvars(ivar)%dim_kinds_index ioname = trim(fates_hist%dim_kinds(dk_index)%name) - + select case(trim(ioname)) case(patch_r8) call hist_addfld1d(fname=trim(vname),units=trim(vunits), & @@ -2540,11 +2632,11 @@ subroutine init_history_io(this,bounds_proc) ptr_patch=fates_hist%hvars(ivar)%r81d, & default=trim(vdefault), & set_lake=0._r8,set_urb=0._r8) - + case(site_r8) call hist_addfld1d(fname=trim(vname),units=trim(vunits), & avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=fates_hist%hvars(ivar)%r81d, & + ptr_col=fates_hist%hvars(ivar)%r81d, & default=trim(vdefault), & set_lake=0._r8,set_urb=0._r8) @@ -2555,14 +2647,14 @@ subroutine init_history_io(this,bounds_proc) call hist_addfld2d(fname=trim(vname),units=trim(vunits), & ! <--- addfld2d type2d=trim(dim2name), & ! <--- type2d avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_patch=fates_hist%hvars(ivar)%r82d, & + ptr_patch=fates_hist%hvars(ivar)%r82d, & default=trim(vdefault)) - - + + case(site_ground_r8, site_size_pft_r8, site_size_r8, site_pft_r8, & site_age_r8, site_height_r8, site_coage_r8,site_coage_pft_r8, & site_fuel_r8, site_cwdsc_r8, & - site_can_r8,site_cnlf_r8, site_cnlfpft_r8, site_scag_r8, & + site_can_r8,site_cnlf_r8, site_cnlfpft_r8, site_scag_r8, & site_scagpft_r8, site_agepft_r8, site_elem_r8, site_elpft_r8, & site_elcwd_r8, site_elage_r8, site_agefuel_r8) @@ -2572,7 +2664,7 @@ subroutine init_history_io(this,bounds_proc) call hist_addfld2d(fname=trim(vname),units=trim(vunits), & type2d=trim(dim2name), & avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=fates_hist%hvars(ivar)%r82d, & + ptr_col=fates_hist%hvars(ivar)%r82d, & default=trim(vdefault)) @@ -2581,7 +2673,7 @@ subroutine init_history_io(this,bounds_proc) write(iulog,*) 'in CLM.:',trim(ioname) call endrun(msg=errMsg(sourcefile, __LINE__)) end select - + end associate end do @@ -2591,9 +2683,9 @@ subroutine init_history_io(this,bounds_proc) end subroutine init_history_io ! ====================================================================================== - + subroutine init_soil_depths(this, nc) - + ! Input Arguments class(hlm_fates_interface_type), intent(inout) :: this integer,intent(in) :: nc ! Clump @@ -2618,25 +2710,19 @@ subroutine init_soil_depths(this, nc) this%fates(nc)%bc_in(s)%dz_decomp_sisl(1:nlevdecomp) = & dzsoi_decomp(1:nlevdecomp) - if (use_vertsoilc) then - do j=1,nlevsoil - this%fates(nc)%bc_in(s)%decomp_id(j) = j - ! Check to make sure that dz = dz_decomp_sisl when vertical soil dynamics - ! are active - if(abs(this%fates(nc)%bc_in(s)%dz_decomp_sisl(j)-this%fates(nc)%bc_in(s)%dz_sisl(j))>1.e-10_r8)then - write(iulog,*) 'when vertical soil decomp dynamics are on' - write(iulog,*) 'fates assumes that the decomposition depths equal the soil depths' - write(iulog,*) 'layer: ',j - write(iulog,*) 'dz_decomp_sisl(j): ',this%fates(nc)%bc_in(s)%dz_decomp_sisl(j) - write(iulog,*) 'dz_sisl(j): ',this%fates(nc)%bc_in(s)%dz_sisl(j) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end do - else - do j=1,nlevsoil - this%fates(nc)%bc_in(s)%decomp_id(j) = 1 - end do - end if + do j=1,nlevsoil + this%fates(nc)%bc_in(s)%decomp_id(j) = j + ! Check to make sure that dz = dz_decomp_sisl when vertical soil dynamics + ! are active + if(abs(this%fates(nc)%bc_in(s)%dz_decomp_sisl(j)-this%fates(nc)%bc_in(s)%dz_sisl(j))>1.e-10_r8)then + write(iulog,*) 'when vertical soil decomp dynamics are on' + write(iulog,*) 'fates assumes that the decomposition depths equal the soil depths' + write(iulog,*) 'layer: ',j + write(iulog,*) 'dz_decomp_sisl(j): ',this%fates(nc)%bc_in(s)%dz_decomp_sisl(j) + write(iulog,*) 'dz_sisl(j): ',this%fates(nc)%bc_in(s)%dz_sisl(j) + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end do end do @@ -2656,10 +2742,10 @@ subroutine ComputeRootSoilFlux(this, bounds_clump, num_filterc, filterc, & integer,intent(in) :: filterc(num_filterc) type(soilstate_type), intent(inout) :: soilstate_inst type(waterfluxbulk_type), intent(inout) :: waterfluxbulk_inst - + ! locals integer :: s - integer :: c + integer :: c integer :: l integer :: nc integer :: num_filter_fates @@ -2667,12 +2753,12 @@ subroutine ComputeRootSoilFlux(this, bounds_clump, num_filterc, filterc, & if( .not. use_fates_planthydro ) return - + call t_startf('fates_rootsoilflux') nc = bounds_clump%clump_index - - ! Perform a check that the number of columns submitted to fates for + + ! Perform a check that the number of columns submitted to fates for ! root water sink is the same that was expected in the hydrology filter num_filter_fates = 0 do s = 1,num_filterc @@ -2681,13 +2767,13 @@ subroutine ComputeRootSoilFlux(this, bounds_clump, num_filterc, filterc, & num_filter_fates = num_filter_fates + 1 end if end do - + if(num_filter_fates .ne. this%fates(nc)%nsites )then write(iulog,*) 'The HLM list of natural veg columns during root water transfer' write(iulog,*) 'is not the same size as the fates site list?' call endrun(msg=errMsg(sourcefile, __LINE__)) end if - + do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil @@ -2699,12 +2785,12 @@ subroutine ComputeRootSoilFlux(this, bounds_clump, num_filterc, filterc, & ! (this is generated potentially from supersaturating soils ! (currently this is unnecessary) ! waterflux_inst%qflx_drain_vr_col(c,1:nlevsoil) = this%fates(nc)%bc_out(s)%qflx_ro_sisl(1:nlevsoil) - + end do call t_stopf('fates_rootsoilflux') - + end subroutine ComputeRootSoilFlux ! ====================================================================================== @@ -2712,7 +2798,7 @@ end subroutine ComputeRootSoilFlux ! THIS WAS MOVED TO WRAP_HYDRAULICS_DRIVE() ! ! subroutine TransferPlantWaterStorage(this, bounds_clump, nc, waterstate_inst) -! +! ! implicit none ! class(hlm_fates_interface_type), intent(inout) :: this ! type(bounds_type),intent(in) :: bounds_clump @@ -2721,10 +2807,10 @@ end subroutine ComputeRootSoilFlux ! ! ! locals ! integer :: s -! integer :: c -! +! integer :: c +! ! if (.not. (use_fates .and. use_fates_planthydro) ) return -! +! ! do s = 1, this%fates(nc)%nsites ! c = this%f2hmap(nc)%fcolumn(s) ! waterstate_inst%total_plant_stored_h2o_col(c) = & @@ -2758,15 +2844,15 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & ! locals integer :: s - integer :: c + integer :: c integer :: j integer :: ifp integer :: p integer :: f - integer :: nlevsoil + integer :: nlevsoil + integer :: icp real(r8) :: dtime - if ( .not.use_fates_planthydro ) return call t_startf('fates_wraphydrodriv') @@ -2785,7 +2871,7 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & this%fates(nc)%bc_in(s)%smpmin_si = & soilstate_inst%smpmin_col(c) this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoil) = & - soilstate_inst%watsat_col(c,1:nlevsoil) + soilstate_inst%watsat_col(c,1:nlevsoil) this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoil) = & soilstate_inst%watres_col(c,1:nlevsoil) this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoil) = & @@ -2797,22 +2883,24 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & this%fates(nc)%bc_in(s)%eff_porosity_sl(1:nlevsoil) = & soilstate_inst%eff_porosity_col(c,1:nlevsoil) - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno + do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) + this%fates(nc)%bc_in(s)%swrad_net_pa(ifp) = solarabs_inst%fsa_patch(p) this%fates(nc)%bc_in(s)%lwrad_net_pa(ifp) = energyflux_inst%eflx_lwrad_net_patch(p) - end do + end do end do ! The exposed vegetation filter "filterp" dictates which patches ! had their transpiration updated during canopy_fluxes(). Patches ! not in the filter had been zero'd during prep_canopyfluxes(). - + do f = 1,fn p = filterp(f) c = patch%column(p) s = this%f2hmap(nc)%hsites(c) ifp = p - col%patchi(c) + this%fates(nc)%bc_in(s)%qflx_transp_pa(ifp) = waterfluxbulk_inst%qflx_tran_veg_patch(p) end do @@ -2841,7 +2929,7 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & call fates_hist%update_history_hydraulics(nc, & this%fates(nc)%nsites, & this%fates(nc)%sites, & - this%fates(nc)%bc_in, & + this%fates(nc)%bc_in, & dtime) call t_stopf('fates_wraphydrodriv') @@ -2871,19 +2959,19 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%cohort_begin = hlm%begcohort fates%cohort_end = hlm%endcohort - + fates%patch_begin = hlm%begp fates%patch_end = hlm%endp - + fates%column_begin = hlm%begc fates%column_end = hlm%endc - + fates%ground_begin = 1 fates%ground_end = nlevgrnd - + fates%sizepft_class_begin = 1 fates%sizepft_class_end = nlevsclass * numpft_fates - + fates%size_class_begin = 1 fates%size_class_end = nlevsclass @@ -2907,22 +2995,22 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%agepft_class_begin = 1 fates%agepft_class_end = nlevage * numpft_fates - + fates%sizeagepft_class_begin = 1 fates%sizeagepft_class_end = nlevsclass * nlevage * numpft_fates fates%fuel_begin = 1 fates%fuel_end = nfsc - + fates%cwdsc_begin = 1 fates%cwdsc_end = ncwd - + fates%can_begin = 1 fates%can_end = nclmax - + fates%cnlf_begin = 1 fates%cnlf_end = nlevleaf * nclmax - + fates%cnlfpft_begin = 1 fates%cnlfpft_end = nlevleaf * nclmax * numpft_fates @@ -2943,7 +3031,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) call t_stopf('fates_hlm2fatesbnds') - + end subroutine hlm_bounds_to_fates_bounds ! ====================================================================================== @@ -2964,7 +3052,7 @@ subroutine GetAndSetTime() integer :: mon ! month (1, ..., 12) integer :: day ! day of month (1, ..., 31) integer :: sec ! seconds of the day - integer :: current_year + integer :: current_year integer :: current_month integer :: current_day integer :: current_tod @@ -2976,7 +3064,7 @@ subroutine GetAndSetTime() real(r8) :: day_of_year call t_startf('fates_getandsettime') - + ! Get the current date and determine the set the start of the current year call get_curr_date(current_year,current_month,current_day,current_tod) current_date = current_year*10000 + current_month*100 + current_day @@ -2986,7 +3074,7 @@ subroutine GetAndSetTime() call get_ref_date(yr, mon, day, sec) reference_date = yr*10000 + mon*100 + day - ! Get the defined number of days per year + ! Get the defined number of days per year days_per_year = get_days_per_year() ! Determine the model day @@ -2994,7 +3082,7 @@ subroutine GetAndSetTime() ! Determine the current DOY call timemgr_datediff(jan01_curr_year,0,current_date,sec,day_of_year) - + ! Set the FATES global time variables call SetFatesTime(current_year, current_month, & current_day, current_tod, & diff --git a/src/utils/domainMod.F90 b/src/utils/domainMod.F90 index a57d565b4d..3e29142bad 100644 --- a/src/utils/domainMod.F90 +++ b/src/utils/domainMod.F90 @@ -25,7 +25,7 @@ module domainMod integer :: ni,nj ! global axis if 2d (nj=1 if unstructured) logical :: isgrid2d ! true => global grid is lat/lon integer :: nbeg,nend ! local beg/end indices - character(len=8) :: clmlevel ! grid type + character(len=8) :: subgrid_level ! grid type integer ,pointer :: mask(:) ! land mask: 1 = land, 0 = ocean real(r8),pointer :: frac(:) ! fractional land real(r8),pointer :: latc(:) ! latitude of grid cell (deg) @@ -62,7 +62,7 @@ module domainMod ! !IROUTINE: domain_init ! ! !INTERFACE: - subroutine domain_init(domain,isgrid2d,ni,nj,nbeg,nend,clmlevel) + subroutine domain_init(domain,isgrid2d,ni,nj,nbeg,nend,subgrid_level) use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) ! ! !DESCRIPTION: @@ -76,7 +76,7 @@ subroutine domain_init(domain,isgrid2d,ni,nj,nbeg,nend,clmlevel) logical, intent(in) :: isgrid2d ! true => global grid is lat/lon integer, intent(in) :: ni,nj ! grid size, 2d integer , intent(in), optional :: nbeg,nend ! beg/end indices - character(len=*), intent(in), optional :: clmlevel ! grid type + character(len=*), intent(in), optional :: subgrid_level ! grid type ! ! !REVISION HISTORY: ! Created by T Craig @@ -108,8 +108,8 @@ subroutine domain_init(domain,isgrid2d,ni,nj,nbeg,nend,clmlevel) call shr_sys_abort('domain_init ERROR: allocate mask, frac, lat, lon, area ') endif - if (present(clmlevel)) then - domain%clmlevel = clmlevel + if (present(subgrid_level)) then + domain%subgrid_level = subgrid_level endif domain%isgrid2d = isgrid2d @@ -174,7 +174,7 @@ subroutine domain_clean(domain) endif endif - domain%clmlevel = unset + domain%subgrid_level = unset domain%ns = huge(1) domain%ni = huge(1) domain%nj = huge(1) diff --git a/src/utils/spmdGathScatMod.F90 b/src/utils/spmdGathScatMod.F90 deleted file mode 100644 index b3314d2da6..0000000000 --- a/src/utils/spmdGathScatMod.F90 +++ /dev/null @@ -1,540 +0,0 @@ -module spmdGathScatMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: spmdGathScatMod -! -! !DESCRIPTION: -! Perform SPMD gather and scatter operations. -! -! !USES: - use clm_varcon, only: spval, ispval - use decompMod, only : get_clmlevel_gsmap - use shr_kind_mod, only: r8 => shr_kind_r8 - use spmdMod , only : masterproc, mpicom - use mct_mod , only : mct_aVect, mct_gsMap - use mct_mod , only : mct_aVect_init, mct_aVect_importIattr, mct_aVect_scatter - use mct_mod , only : mct_aVect_gather, mct_aVect_exportIattr, mct_aVect_clean - use mct_mod , only : mct_aVect_exportRattr, mct_aVect_importRattr - use abortutils, only : endrun - use clm_varctl, only : iulog - use perf_mod , only : t_startf, t_stopf -! -! !PUBLIC TYPES: - implicit none - private -! -! !PUBLIC MEMBER FUNCTIONS: - public scatter_data_from_master, gather_data_to_master - - interface scatter_data_from_master - module procedure scatter_1darray_int - module procedure scatter_1darray_real - end interface - - interface gather_data_to_master - module procedure gather_1darray_int - module procedure gather_1darray_real - end interface -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -!EOP -! - integer,private,parameter :: debug = 0 - -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: scatter_1darray_int -! -! !INTERFACE: - subroutine scatter_1darray_int (alocal, aglobal, clmlevel) -! -! !DESCRIPTION: -! Wrapper routine to scatter int 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer , pointer :: alocal(:) ! local data (output) - integer , pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - integer ,pointer :: adata(:) ! local data array - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'scatter_1darray_int' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(istring) == 0) then - istring = trim(fname) - else - istring = trim(istring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - if (debug > 1) call t_startf(trim(subname)//'_pack') - - if (masterproc) then - lsize = size(aglobal,dim=1) - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - allocate(adata(lsize)) - do n2 = lb2,ub2 - adata(1:lsize) = aglobal(1:lsize) - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importIattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_scat') - - call mct_aVect_scatter(AVi, AVo, gsmap, 0, mpicom) - - if (debug > 1) call t_stopf(trim(subname)//'_scat') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - lsize = size(alocal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportIattr(AVo,trim(fname),adata,lsize) - do n1 = lb1,ub1 - alocal(n1) = adata(n1-lb1+1) - enddo - enddo - deallocate(adata) - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVi) - endif - call mct_aVect_clean(AVo) - - call t_stopf(trim(subname)//'_total') - - end subroutine scatter_1darray_int - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: gather_1darray_int -! -! !INTERFACE: - subroutine gather_1darray_int (alocal, aglobal, clmlevel, missing) -! -! !DESCRIPTION: -! Wrapper routine to gather int 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer , pointer :: alocal(:) ! local data (output) - integer , pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid - integer ,optional,intent(in) :: missing ! missing value -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - integer ,pointer :: adata(:) ! temporary data array - integer ,pointer :: mvect(:) ! local array for mask - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'gather_1darray_int' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lsize = size(alocal,dim=1) - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - if (present(missing)) then - istring = "mask" - endif - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(istring) == 0) then - istring = trim(fname) - else - istring = trim(istring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - - if (debug > 1) call t_startf(trim(subname)//'_pack') - allocate(adata(lsize)) - do n2 = lb2,ub2 - do n1 = lb1,ub1 - adata(n1-lb1+1) = alocal(n1) - enddo - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importIattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - - if (present(missing)) then - allocate(mvect(lsize)) - do n1 = lb1,ub1 - mvect(n1-lb1+1) = 1 - enddo - call mct_aVect_importIattr(AVi,"mask",mvect,lsize) - deallocate(mvect) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_gath') - - if (present(missing)) then -! tcx wait for update in mct, then get rid of "mask" -! call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom, missing = missing) - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - else - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_gath') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - if (masterproc) then - lsize = size(aglobal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportIattr(AVo,trim(fname),adata,lsize) - aglobal(1:lsize) = adata(1:lsize) - enddo - deallocate(adata) - if (present(missing)) then - allocate(mvect(lsize)) - call mct_aVect_exportIattr(AVo,"mask",mvect,lsize) - do n1 = 1,lsize - if (mvect(n1) == 0) then - do n2 = lb2,ub2 - aglobal(n1) = missing - enddo - endif - enddo - deallocate(mvect) - endif - endif - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVo) - endif - - call mct_aVect_clean(AVi) - - call t_stopf(trim(subname)//'_total') - - end subroutine gather_1darray_int - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: scatter_1darray_real -! -! !INTERFACE: - subroutine scatter_1darray_real (alocal, aglobal, clmlevel) -! -! !DESCRIPTION: -! Wrapper routine to scatter real 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - real(r8), pointer :: alocal(:) ! local data (output) - real(r8), pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - real(r8),pointer :: adata(:) ! local data array - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'scatter_1darray_real' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(rstring) == 0) then - rstring = trim(fname) - else - rstring = trim(rstring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - if (debug > 1) call t_startf(trim(subname)//'_pack') - - if (masterproc) then - lsize = size(aglobal,dim=1) - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - allocate(adata(lsize)) - do n2 = lb2,ub2 - adata(1:lsize) = aglobal(1:lsize) - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importRattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_scat') - - call mct_aVect_scatter(AVi, AVo, gsmap, 0, mpicom) - - if (debug > 1) call t_stopf(trim(subname)//'_scat') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - lsize = size(alocal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportRattr(AVo,trim(fname),adata,lsize) - do n1 = lb1,ub1 - alocal(n1) = adata(n1-lb1+1) - enddo - enddo - deallocate(adata) - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVi) - endif - call mct_aVect_clean(AVo) - - call t_stopf(trim(subname)//'_total') - - end subroutine scatter_1darray_real - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: gather_1darray_real -! -! !INTERFACE: - subroutine gather_1darray_real (alocal, aglobal, clmlevel, missing) -! -! !DESCRIPTION: -! Wrapper routine to gather real 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - real(r8), pointer :: alocal(:) ! local data (output) - real(r8), pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid - real(r8),optional,intent(in) :: missing ! missing value -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - real(r8),pointer :: adata(:) ! temporary data array - integer ,pointer :: mvect(:) ! local array for mask - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'gather_1darray_real' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lsize = size(alocal,dim=1) - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - if (present(missing)) then - istring = "mask" - endif - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(rstring) == 0) then - rstring = trim(fname) - else - rstring = trim(rstring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - - if (debug > 1) call t_startf(trim(subname)//'_pack') - allocate(adata(lsize)) - do n2 = lb2,ub2 - do n1 = lb1,ub1 - adata(n1-lb1+1) = alocal(n1) - enddo - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importRattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - - if (present(missing)) then - allocate(mvect(lsize)) - do n1 = lb1,ub1 - mvect(n1-lb1+1) = 1 - enddo - call mct_aVect_importIattr(AVi,"mask",mvect,lsize) - deallocate(mvect) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_gath') - - if (present(missing)) then -! tcx wait for update in mct, then get rid of "mask" -! call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom, missing = missing) - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - else - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_gath') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - if (masterproc) then - lsize = size(aglobal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportRattr(AVo,trim(fname),adata,lsize) - aglobal(1:lsize) = adata(1:lsize) - enddo - deallocate(adata) - if (present(missing)) then - allocate(mvect(lsize)) - call mct_aVect_exportIattr(AVo,"mask",mvect,lsize) - do n1 = 1,lsize - if (mvect(n1) == 0) then - do n2 = lb2,ub2 - aglobal(n1) = missing - enddo - endif - enddo - deallocate(mvect) - endif - endif - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVo) - endif - - call mct_aVect_clean(AVi) - - call t_stopf(trim(subname)//'_total') - - end subroutine gather_1darray_real - -end module spmdGathScatMod diff --git a/test/tools/README b/test/tools/README index 470db6e4b7..186f1dfe5d 100644 --- a/test/tools/README +++ b/test/tools/README @@ -13,7 +13,7 @@ To use... on cheyenne -qcmd -l select=mem=109GB -l walltime=06:00:00 -- ./test_driver.sh -i >& run.out & +qcmd -l walltime=08:00:00 -- ./test_driver.sh -i >& run.out & on izumi @@ -21,7 +21,7 @@ nohup ./test_driver.sh -i >& run.out & release tests -qcmd -l walltime=08:00:00 -- env CLM_INPUT_TESTS=`pwd`/tests_posttag_nompi_regression \ +qcmd -l walltime=10:00:00 -- env CLM_INPUT_TESTS=`pwd`/tests_posttag_nompi_regression \ ./test_driver.sh -i >& run.out & Intended for use on NCAR machines cheyenne, geyser (DAV) and hobart. diff --git a/test/tools/README.testnames b/test/tools/README.testnames index eb6d50f38c..0ea049f662 100644 --- a/test/tools/README.testnames +++ b/test/tools/README.testnames @@ -21,16 +21,16 @@ n is the configuration type: 7 -- unused 8 -- unused 9 -- unused -0 -- unused -a -- unused -b -- unused -c -- mkprocdata_map clm5.0 -d -- mkmapgrids clm5.0 -e -- gen_domain clm5.0 -f -- PTCLM clm5.0 -g -- mksurfdata_map clm5.0 -h -- interpinic clm5.0 -i -- tools scripts clm5.0 +0 -- run_neon +a -- modify_data +b -- subset_data +c -- mkprocdata_map +d -- mkmapgrids +e -- gen_domain +f -- PTCLM +g -- mksurfdata_map +h -- unused +i -- tools scripts m is the resolution @@ -41,6 +41,7 @@ m is the resolution 7 -- 1x1 brazil 8 -- US-UMB 9 -- 4x5 +a -- NEON YELL c -- US-UMB with cycling on forcing and transient use-case g -- US-UMB with global forcing and grid PFT and soil y -- 1.9x2.5 with transient 1850-2100 for rcp=2.6 and glacier-MEC on diff --git a/test/tools/TSMscript_tools.sh b/test/tools/TSMscript_tools.sh index 360ecf86a4..34d00093fd 100755 --- a/test/tools/TSMscript_tools.sh +++ b/test/tools/TSMscript_tools.sh @@ -49,7 +49,7 @@ cp $cfgdir/sample_* $rundir optfile=${3%^*} cfgfile=${3#*^} -if [[ "$1" == "PTCLM" ]]; then +if [[ "$1" == "site_and_regional/PTCLM" ]]; then echo "TSMscript_tools.sh: calling TCBscripttools.sh to prepare executables for $1" ${CLM_SCRIPTDIR}/TCBscripttools.sh $1 $cfgfile rc=$? @@ -73,7 +73,7 @@ elif [ "$optfile" != "$3" ]; then fi tcbtools=${CLM_TESTDIR}/TCBtools.$1.$cfgfile else - tcbtools="." + tcbtools="$rundir" fi scopts=`cat ${CLM_SCRIPTDIR}/nl_files/$optfile | sed -e "s|CSMDATA|$CSMDATA|g" | sed -e "s|EXEDIR|$tcbtools|" | sed -e "s|CFGDIR|$cfgdir|g"` diff --git a/test/tools/input_tests_master b/test/tools/input_tests_master index cb3998557d..5687d41d4a 100644 --- a/test/tools/input_tests_master +++ b/test/tools/input_tests_master @@ -38,6 +38,15 @@ bliT4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_crp_200 smiT2 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100^tools__s bliT2 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100^tools__s +sm0a1 TSMscript_tools.sh site_and_regional run_neon.py run_neon_YELL +bl0a1 TBLscript_tools.sh site_and_regional run_neon.py run_neon_YELL + +smba1 TSMscript_tools.sh site_and_regional subset_data.py subset_data_YELL +blba1 TBLscript_tools.sh site_and_regional subset_data.py subset_data_YELL + +smaa2 TSMscript_tools.sh site_and_regional modify_singlept_site_neon.py modify_data_YELL +blaa2 TBLscript_tools.sh site_and_regional modify_singlept_site_neon.py modify_data_YELL + smi#2 TSMscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_ne30np4 bli#2 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_ne30np4 smi59 TSMscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 @@ -45,18 +54,18 @@ bli59 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 smi79 TSMscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_i1x1_brazil bli79 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_i1x1_brazil -smf84 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools -blf84 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools -smfc4 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools -blfc4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools -smfg4 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools -blfg4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools - -smiS4 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional -bliS4 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional -smiS8 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional_ndep -bliS8 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional_ndep -smiS9 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional_T62 -bliS9 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional_T62 -smiS0 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional_05popd -bliS0 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional_05popd +smf84 TSMscript_tools.sh site_and_regional/PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools +blf84 TBLscript_tools.sh site_and_regional/PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools +smfc4 TSMscript_tools.sh site_and_regional/PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools +blfc4 TBLscript_tools.sh site_and_regional/PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools +smfg4 TSMscript_tools.sh site_and_regional/PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools +blfg4 TBLscript_tools.sh site_and_regional/PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools + +smiS4 TSMscript_tools.sh site_and_regional getregional_datasets.pl getregional +bliS4 TBLscript_tools.sh site_and_regional getregional_datasets.pl getregional +smiS8 TSMscript_tools.sh site_and_regional getregional_datasets.pl getregional_ndep +bliS8 TBLscript_tools.sh site_and_regional getregional_datasets.pl getregional_ndep +smiS9 TSMscript_tools.sh site_and_regional getregional_datasets.pl getregional_T62 +bliS9 TBLscript_tools.sh site_and_regional getregional_datasets.pl getregional_T62 +smiS0 TSMscript_tools.sh site_and_regional getregional_datasets.pl getregional_05popd +bliS0 TBLscript_tools.sh site_and_regional getregional_datasets.pl getregional_05popd diff --git a/test/tools/nl_files/mkmapdata_i1x1_brazil b/test/tools/nl_files/mkmapdata_i1x1_brazil index 879ffa6d47..bb54d468dc 100644 --- a/test/tools/nl_files/mkmapdata_i1x1_brazil +++ b/test/tools/nl_files/mkmapdata_i1x1_brazil @@ -1 +1 @@ --t regional -r 1x1_brazil +-t regional -r 1x1_brazil --fast diff --git a/test/tools/nl_files/mkmapdata_if10 b/test/tools/nl_files/mkmapdata_if10 index c3218edc1c..f726ea34e7 100644 --- a/test/tools/nl_files/mkmapdata_if10 +++ b/test/tools/nl_files/mkmapdata_if10 @@ -1 +1 @@ --r 10x15 +-r 10x15 --fast --batch diff --git a/test/tools/nl_files/mkmapdata_ne30np4 b/test/tools/nl_files/mkmapdata_ne30np4 index 11066c7b41..ae435ac2bc 100644 --- a/test/tools/nl_files/mkmapdata_ne30np4 +++ b/test/tools/nl_files/mkmapdata_ne30np4 @@ -1 +1 @@ --r ne30np4 +-r ne30np4 --fast --batch diff --git a/test/tools/nl_files/modify_data_YELL b/test/tools/nl_files/modify_data_YELL new file mode 100644 index 0000000000..e76322cdeb --- /dev/null +++ b/test/tools/nl_files/modify_data_YELL @@ -0,0 +1 @@ +--neon_site YELL --surf_dir CSMDATA/lnd/clm2/surfdata_map/NEON --out_dir EXEDIR diff --git a/test/tools/nl_files/run_neon_YELL b/test/tools/nl_files/run_neon_YELL new file mode 100644 index 0000000000..1223f1d3c9 --- /dev/null +++ b/test/tools/nl_files/run_neon_YELL @@ -0,0 +1 @@ +--neon_sites YELL --case-root EXEDIR ad diff --git a/test/tools/nl_files/subset_data_YELL b/test/tools/nl_files/subset_data_YELL new file mode 100644 index 0000000000..8e1dcbcbb2 --- /dev/null +++ b/test/tools/nl_files/subset_data_YELL @@ -0,0 +1 @@ +point --lon 249.45804 --lat 44.95597 --site YELL --crop --dompft 1 --outdir EXEDIR/ diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh index 28ecb07072..3fb21abad6 100755 --- a/test/tools/test_driver.sh +++ b/test/tools/test_driver.sh @@ -54,6 +54,8 @@ module load nco module load python module load ncl +ncar_pylib + ##omp threads if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line diff --git a/test/tools/tests_pretag_cheyenne_nompi b/test/tools/tests_pretag_cheyenne_nompi index 3bdeef5deb..f99ab6b691 100644 --- a/test/tools/tests_pretag_cheyenne_nompi +++ b/test/tools/tests_pretag_cheyenne_nompi @@ -3,6 +3,9 @@ smc#4 blc#4 sme14 ble14 sme@4 ble@4 smg54 blg54 +sm0a1 bl0a1 +smaa2 blaa2 +smba1 blba1 smi04 bli04 smi24 bli24 smi53 bli53 diff --git a/tools/README b/tools/README index 780e9f6e91..4a15242651 100644 --- a/tools/README +++ b/tools/README @@ -1,13 +1,12 @@ $CTSMROOT/tools/README Jun/08/2018 -CLM tools for analysis of CLM history files -- or for creation or -modification of CLM input files. +CTSM tools for analysis of CTSM history files -- or for creation or +modification of CTSM input files. I. General directory structure: $CTSMROOT/tools mksurfdata_map --- Create surface datasets. - (NOTE: interpinic now longer included as now an online capability in CLM) mkmapgrids ------- Create regular lat/lon SCRIP grid files needed by mkmapdata mkmapdata -------- Create SCRIP mapping data from SCRIP grid files (uses ESMF) @@ -15,6 +14,11 @@ I. General directory structure: can be plotted easily ncl_scripts ------ NCL post or pre processing scripts. + site_and_regional Scripts for handling input datasets for site and regional cases. + These scripts both help with creation of datasets using the + standard process as well as subsetting existing datasets and overwriting + some aspects for a specific case. + contrib ---------- Miscellaneous tools for pre or post processing of CTSM. Typically these are contributed by anyone who has something they think might be helpful to the community. They may not @@ -67,10 +71,10 @@ II. Notes on building/running for each of the above tools: so that you can use the debugger, and with bounds-checking, and float trapping on. To speed up do the following... - gmake OPT=TRUE (by default already on for interpinic and mksurfdata_map) + gmake OPT=TRUE (by default already on for mksurfdata_map) Also some of the tools allow for OpenMP shared memory parallelism - (such as interpinic and mksurfdata) with + (such as mksurfdata) with gmake SMP=TRUE @@ -78,23 +82,19 @@ II. Notes on building/running for each of the above tools: ./program < namelist - To get help on running a program with command line options (e.g., interpinic): - - ./program - To run a program built with SMP=TRUE: setenv OMP_NUM_THREADS= run normally as above -III. Process sequence to create input datasets needed to run CLM +III. Process sequence to create input datasets needed to run CTSM 1.) Create SCRIP grid files (if needed) a.) For standard resolutions these files will already be created. (done) - b.) To create regular lat-lon regional/single-point grids run mknoocnmap.pl + b.) To create regular lat-lon regional/single-point grids run site_and_regional/mknoocnmap.pl This will create both SCRIP grid files and a mapping file that will be valid if the region includes NO ocean whatsoever (so you can skip step 2). @@ -105,7 +105,7 @@ III. Process sequence to create input datasets needed to run CLM Example, for single-point over Boulder Colorado. - cd mkmapdata + cd site_and_regional ./mknoocnmap.pl -p 40,255 -n 1x1_boulderCO c.) General case @@ -156,10 +156,10 @@ III. Process sequence to create input datasets needed to run CLM ./gen_maps.sh -focn -fatm -nocn -natm - 3.) Add SCRIP grid file(s) created in (1) into XML database in CLM (optional) + 3.) Add SCRIP grid file(s) created in (1) into XML database in CTSM (optional) See the "Adding New Resolutions or New Files to the build-namelist Database" - Chapter in the CLM User's Guide + Chapter in the CTSM User's Guide http://www.cesm.ucar.edu/models/cesm1.0/clm/models/lnd/clm/doc/UsersGuide/book1.html @@ -178,7 +178,7 @@ III. Process sequence to create input datasets needed to run CLM cd mkmapdata ./mkmapdata.sh -r ne30np4 - 5.) Add mapping file(s) created in step (4) into XML database in CLM (optional) + 5.) Add mapping file(s) created in step (4) into XML database in CTSM (optional) See notes on doing this in step (3) above. Edit ../bld/namelist_files/namelist_defaults_clm.xml to incorporate new @@ -187,7 +187,7 @@ III. Process sequence to create input datasets needed to run CLM If you don't do this step, you'll need to specify the grid resolution name and file creation dates to mksurfdata_map in step (5) below. - 6.) Convert map of ocean to atm for use by DATM and CLM with gen_domain + 6.) Convert map of ocean to atm for use by DATM and CTSM with gen_domain (See $CIMEROOT/tools/mapping/README for more help on doing this) - gen_domain uses the map from step (2) (or previously created CESM maps) @@ -203,9 +203,9 @@ III. Process sequence to create input datasets needed to run CLM setenv MAPFILE $CSMDATA/cpl/cpl6/map_${OCNGRIDNAME}_to_${ATMGRIDNAME}_aave_da_${CDATE}.nc ./gen_domain -m $MAPFILE -o $OCNGRIDNAME -l $ATMGRIDNAME - Normally for I compsets running CLM only you will discard the ocean domain + Normally for I compsets running CTSM only you will discard the ocean domain file, and only use the atmosphere domain file for datm and as the fatmlndfrc - file for CLM. Output domain files will be named according to the input OCN/LND + file for CTSM. Output domain files will be named according to the input OCN/LND gridnames. 7.) Create surface datasets with mksurfdata_map @@ -228,10 +228,7 @@ III. Process sequence to create input datasets needed to run CLM contain the lat,lon,edges and area values for the atm grid - ASSUMING that the atm and land grid are the same - 8.) Interpolate initial conditions using interpinic (optional) - (See interpinic/README for more help on doing this) - - 9.) Add new files to XML data or using user_nl_clm (optional) + 8.) Add new files to XML data or using user_nl_clm (optional) See notes on doing this in step (3) above. @@ -239,15 +236,14 @@ IV. Example of creating single-point datasets without entering into XML database Here we apply the process described in III. for a single-point dataset where we don't enter the datasets into the XML database (thus skipping - steps 3, 5 and 9), but use the needed command line options to specify where the + steps 3, 5 and 8), but use the needed command line options to specify where the files are. This also skips step (2) since step 1 creates the needed mapping file. - We also skip step (8) and do NOT create a finidat file. 0.) Set name of grid to use and the creation date to be used later... setenv GRIDNAME 1x1_boulderCO setenv CDATE `date +%y%m%d` 1.) SCRIP grid and atm to ocn mapping file - cd mkmapdata + cd site_and_regional ./mknoocnmap.pl -p 40,255 -n $GRIDNAME # Set pointer to MAPFILE that will be used in step (6) setenv MAPFILE `pwd`/map_${GRIDNAME}_noocean_to_${GRIDNAME}_nomask_aave_da_${CDATE}.nc @@ -260,26 +256,24 @@ IV. Example of creating single-point datasets without entering into XML database ./mkmapdata.sh -r $GRIDNAME -f $GRIDFILE -t regional cd ../.. 5.) skip - 6.) Generate domain file for datm and CLM + 6.) Generate domain file for datm and CTSM cd $CIMEROOT/tools/mapping/gen_domain_files/src gmake cd .. setenv OCNDOM domain.ocn_noocean.nc setenv ATMDOM domain.lnd.{$GRIDNAME}_noocean.nc ./gen_domain -m $MAPFILE -o $OCNDOM -l $ATMDOM - 7.) Create surface dataset for CLM + 7.) Create surface dataset for CTSM cd mksurfdata_map/src gmake cd .. ./mksurfdata.pl -r usrspec -usr_gname $GRIDNAME -usr_gdate $CDATE 8.) skip - 9.) skip -V. Notes on which input datasets are needed for CLM +V. Notes on which input datasets are needed for CTSM global or regional/single-point grids - need fsurdata and fatmlndfrc fsurdata ---- from mksurfdata_map in step (III.7) fatmlndfrc -- use the domain.lnd file from gen_domain in step (III.6) - diff --git a/tools/contrib/modify_singlept_site b/tools/contrib/modify_singlept_site index 4345109ca4..46c1bcda1a 100755 --- a/tools/contrib/modify_singlept_site +++ b/tools/contrib/modify_singlept_site @@ -110,9 +110,6 @@ with open(rawdatafile, 'r') as t1: if x[0].strip() == 'mksrf_fvic': fvic = x[1].strip() fvic = fvic.strip("'") - if x[0].strip() == 'mksrf_fch4': - fch4 = x[1].strip() - fch4 = fch4.strip("'") if x[0].strip() == 'mksrf_furban': furban = x[1].strip() furban = furban.strip("'") @@ -342,23 +339,6 @@ if create_surfdata: f2['Ds'] = np.asarray(r2['Ds']) r1.close() ; r2.close() - #-- Methane - r1 = xr.open_dataset(fch4) - # create 1d variables - lon0=np.asarray(r1['LONGXY'][0,:]) - lon=xr.DataArray(lon0,name='lon',dims='lon',coords={'lon':lon0}) - lat0=np.asarray(r1['LATIXY'][:,0]) - lat=xr.DataArray(lat0,name='lat',dims='lat',coords={'lat':lat0}) - r1['lon'] = lon - r1['lat'] = lat - r1=r1.rename({'lsmlon':'lon','lsmlat':'lat'}) - # extract gridcell closest to plon/plat (this file is [0,360] - r2 = r1.sel(lon=plon,lat=plat,method='nearest') - f2['P3'] = np.asarray(r2['P3']) - f2['ZWT0'] = np.asarray(r2['ZWT0']) - f2['F0'] = np.asarray(r2['F0']) - r1.close() ; r2.close() - #-- Soil Color r1 = xr.open_dataset(fsoicol) r1=r1.rename({'LON':'lon','LAT':'lat'}) diff --git a/tools/contrib/ssp_anomaly_forcing_smooth b/tools/contrib/ssp_anomaly_forcing_smooth index fa2350bcb9..c9d51cf82d 100755 --- a/tools/contrib/ssp_anomaly_forcing_smooth +++ b/tools/contrib/ssp_anomaly_forcing_smooth @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # # ssp_anomaly_forcing_smooth # diff --git a/tools/mkmapdata/README b/tools/mkmapdata/README index 00ec339380..77d89717ad 100644 --- a/tools/mkmapdata/README +++ b/tools/mkmapdata/README @@ -71,9 +71,9 @@ That will enable the --netcdf4 and --64bit_offset options to be used. different resolutions. Option C.) Alternatively, run mknoocnmap.pl to create a single-point/regional - map for an area without ocean. + map for an area without ocean (in the site_and_regional directory parallel to this one. - ./mknoocnmap.pl -help # for help on this script + ../site_and_regional/mknoocnmap.pl -help # for help on this script 3) move (and rename if appropriate) generated map datasets to $DIN_LOC_ROOT/lnd/clm/mappingdata/maps, etc. @@ -86,8 +86,5 @@ Important files: mvNimport.sh --------- Script to copy and import mapping files in for many resolutions mkmapdata.sh --------- Script to create mapping datasets for a given resolution - mknoocnmap.pl -------- Script to create unity mapping dataset for single-point - or regional studies over land-only (no ocean). - mkunitymap.ncl ------- NCL script to create a unity map -- ran by above script rmdups.ncl ----------- NCL script to remove duplicate mapping points diff --git a/tools/mkmapdata/mkmapdata.sh b/tools/mkmapdata/mkmapdata.sh index f1287ab3ef..531ca5a60f 100755 --- a/tools/mkmapdata/mkmapdata.sh +++ b/tools/mkmapdata/mkmapdata.sh @@ -363,7 +363,10 @@ case $hostname in if [ interactive = "YES" ]; then REGRID_PROC=1 fi - esmfvers=8.2.0.b06 + if [ "$verbose" = "YES" ]; then + echo "Number of processors to regrid with = $REGRID_PROC" + fi + esmfvers=8.2.0b13 intelvers=19.1.1 module purge module load intel/$intelvers @@ -372,20 +375,24 @@ case $hostname in module load nco if [[ $REGRID_PROC > 1 ]]; then - mpi=mpi + mpi=mpt module load mpt/2.22 else - mpi=uni + mpi=mpiuni fi # module load esmf-${esmfvers}-ncdfio-${mpi}-O module use /glade/p/cesmdata/cseg/PROGS/modulefiles/esmfpkgs/intel/$intelvers - module load esmf-${esmfvers}-ncdfio-mpt-g + module load esmf-${esmfvers}-ncdfio-${mpi}-g if [ -z "$ESMFBIN_PATH" ]; then ESMFBIN_PATH=`grep ESMF_APPSDIR $ESMFMKFILE | awk -F= '{print $2}'` fi if [ -z "$MPIEXEC" ]; then MPIEXEC="mpiexec_mpt -np $REGRID_PROC" fi + if [ "$verbose" = "YES" ]; then + echo "list of modules" + module list + fi ;; ## DAV diff --git a/tools/mksurfdata_map/Makefile.data b/tools/mksurfdata_map/Makefile.data index 373ff6e63d..d0c000ba63 100644 --- a/tools/mksurfdata_map/Makefile.data +++ b/tools/mksurfdata_map/Makefile.data @@ -230,7 +230,7 @@ crop-global-SSP5-8.5 : FORCE urban : urban-present urban-alpha urban-present : FORCE - $(MKSURFDATA) -y 2000 -no-crop -glc_nec 10 -r 1x1_camdenNJ,1x1_vancouverCAN,1x1_mexicocityMEX $(BACKGROUND) + $(MKSURFDATA) -y 2000 -no-crop -glc_nec 10 -r 1x1_vancouverCAN,1x1_mexicocityMEX $(BACKGROUND) # NOTE(bja, 2015-01) skip abort on invalid data necessary as of 2015-01. See # /glade/p/cesm/cseg/inputdata/lnd/clm2/surfdata_map/README_c141219 diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index f9961c7f9e..b0363704ae 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -696,13 +696,13 @@ sub write_namelist_file { # # Check if all urban single point dataset # - my @all_urb = ( "1x1_camdenNJ","1x1_vancouverCAN", "1x1_mexicocityMEX", "1x1_urbanc_alpha" ); + my @all_urb = ( "1x1_vancouverCAN", "1x1_mexicocityMEX", "1x1_urbanc_alpha" ); my $all_urb = ".false."; my $urb_pt = 0; foreach my $urb_res ( @all_urb ) { if ( $res eq $urb_res ) { $all_urb = ".true."; - if ( $res ne "1x1_camdenNJ" ) { $urb_pt = 1; } + $urb_pt = 1; } } # diff --git a/tools/mksurfdata_map/mksurfdata_map.namelist b/tools/mksurfdata_map/mksurfdata_map.namelist index 2c6180f156..4e00ae1805 100644 --- a/tools/mksurfdata_map/mksurfdata_map.namelist +++ b/tools/mksurfdata_map/mksurfdata_map.namelist @@ -21,7 +21,6 @@ map_fabm = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_nomask_to_10x15_nomask_aave_da_c200206.nc' map_ftopostats = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_1km-merge-10min_HYDRO1K-merge-nomask_to_10x15_nomask_aave_da_c130411.nc' map_fvic = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.9x1.25_nomask_to_10x15_nomask_aave_da_c200206.nc' - map_fch4 = '/glade/p/cesm/cseg/inputdata/lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_nomask_to_10x15_nomask_aave_da_c200206.nc' mksrf_fsoitex = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_soitex.10level.c010119.nc' mksrf_forganic = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_organic_10level_5x5min_ISRIC-WISE-NCSCD_nlev7_c120830.nc' mksrf_flakwat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_LakePnDepth_3x3min_simyr2004_csplk_c151015.nc' @@ -37,7 +36,6 @@ mksrf_fabm = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_abm_0.5x0.5_AVHRR_simyr2000.c130201.nc' mksrf_ftopostats = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_topostats_1km-merge-10min_HYDRO1K-merge-nomask_simyr2000.c130402.nc' mksrf_fvic = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_vic_0.9x1.25_GRDC_simyr2000.c130307.nc' - mksrf_fch4 = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_ch4inversion_0.5x0.5_cruncep_simyr2000.c191112.nc' outnc_double = .true. all_urban = .false. no_inlandwet = .true. diff --git a/tools/mksurfdata_map/src/mkdomainMod.F90 b/tools/mksurfdata_map/src/mkdomainMod.F90 index 84865458b0..89106f3b79 100644 --- a/tools/mksurfdata_map/src/mkdomainMod.F90 +++ b/tools/mksurfdata_map/src/mkdomainMod.F90 @@ -49,6 +49,7 @@ module mkdomainMod public domain_read_map public domain_write public domain_checksame + public is_domain_0to360_longs ! Does this domain have longitude on a 0 to 360 degree range public for_test_create_domain ! For unit testing create a simple domain ! ! @@ -893,6 +894,36 @@ subroutine domain_checksame( srcdomain, dstdomain, tgridmap ) end do end subroutine domain_checksame + +!----------------------------------------------------------------------- +!BOP +! +! !IROUTINE: is_domain_0to360_longs +! +! !INTERFACE: + logical function is_domain_0to360_longs( domain ) +! +! !DESCRIPTION: +! Check if the domain has longitudes on a -180 to 180 grid or a 0 to 360 grid. +! CESM requires the later right now. +! +! USES: + use mkgridmapMod, only : gridmap_type, gridmap_setptrs +! !ARGUMENTS: + implicit none + type(domain_type), intent(in) :: domain ! input domain +! +! !REVISION HISTORY: +! +!EOP +!----------------------------------------------------------------------- + if ( any(domain%lonc < 0.0_r8) )then + is_domain_0to360_longs = .false. + else + is_domain_0to360_longs = .true. + end if + end function is_domain_0to360_longs + !----------------------------------------------------------------------- !BOP ! diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index bc6ef6f028..9051c57707 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -36,11 +36,11 @@ program mksurfdat use mkvarctl use nanMod , only : nan, bigint use mkncdio , only : check_ret, ncd_put_time_slice - use mkdomainMod , only : domain_type, domain_read_map, domain_read, & - domain_write + use mkdomainMod , only : domain_type, domain_read_map, domain_read + use mkdomainMod , only : domain_write, is_domain_0to360_longs use mkgdpMod , only : mkgdp use mkpeatMod , only : mkpeat - use mksoildepthMod , only : mksoildepth + use mksoildepthMod , only : mksoildepth use mkagfirepkmonthMod , only : mkagfirepkmon use mktopostatsMod , only : mktopostats use mkVICparamsMod , only : mkVICparams @@ -173,7 +173,6 @@ program mksurfdat mksrf_fabm, & mksrf_ftopostats, & mksrf_fvic, & - mksrf_fch4, & nglcec, & numpft, & soil_color, & @@ -205,7 +204,6 @@ program mksurfdat map_fabm, & map_ftopostats, & map_fvic, & - map_fch4, & gitdescribe, & outnc_large_files, & outnc_double, & @@ -249,7 +247,6 @@ program mksurfdat ! mksrf_fabm ----- Agricultural fire peak month dataset ! mksrf_ftopostats Topography statistics dataset ! mksrf_fvic ----- VIC parameters dataset - ! mksrf_fch4 ----- inversion-derived CH4 parameters dataset ! ====================================== ! Must specify mapping file for the different datafiles above ! ====================================== @@ -273,7 +270,6 @@ program mksurfdat ! map_fabm -------- Mapping for mksrf_fabm ! map_ftopostats -- Mapping for mksrf_ftopostats ! map_fvic -------- Mapping for mksrf_fvic - ! map_fch4 -------- Mapping for mksrf_fch4 ! ====================================== ! Optionally specify setting for: ! ====================================== @@ -426,6 +422,11 @@ program mksurfdat write(6,*)'output file will be 1d' end if + ! Make sure ldomain is on a 0 to 360 grid as that's a requirement for CESM + if ( .not. is_domain_0to360_longs( ldomain ) )then + write(6,*)' Output domain must be on a 0 to 360 longitude grid rather than a -180 to 180 grid as it is required for CESM' + stop + end if ! ---------------------------------------------------------------------- ! Allocate and initialize dynamic memory ! ---------------------------------------------------------------------- @@ -532,7 +533,6 @@ program mksurfdat write(ndiag,*) 'abm from: ',trim(mksrf_fabm) write(ndiag,*) 'topography statistics from: ',trim(mksrf_ftopostats) write(ndiag,*) 'VIC parameters from: ',trim(mksrf_fvic) - write(ndiag,*) 'CH4 parameters from: ',trim(mksrf_fch4) write(ndiag,*)' mapping for pft ',trim(map_fpft) write(ndiag,*)' mapping for lake water ',trim(map_flakwat) write(ndiag,*)' mapping for wetland ',trim(map_fwetlnd) @@ -553,7 +553,6 @@ program mksurfdat write(ndiag,*)' mapping for ag fire pk month ',trim(map_fabm) write(ndiag,*)' mapping for topography stats ',trim(map_ftopostats) write(ndiag,*)' mapping for VIC parameters ',trim(map_fvic) - write(ndiag,*)' mapping for CH4 parameters ',trim(map_fch4) if (mksrf_fdynuse /= ' ') then write(6,*)'mksrf_fdynuse = ',trim(mksrf_fdynuse) diff --git a/tools/mksurfdata_map/src/mkvarctl.F90 b/tools/mksurfdata_map/src/mkvarctl.F90 index cebfc6a5e3..864291ae07 100644 --- a/tools/mksurfdata_map/src/mkvarctl.F90 +++ b/tools/mksurfdata_map/src/mkvarctl.F90 @@ -50,7 +50,6 @@ module mkvarctl character(len=256), public :: mksrf_fvocef = ' ' ! VOC Emission Factor data file name character(len=256), public :: mksrf_ftopostats = ' ' ! topography statistics data file name character(len=256), public :: mksrf_fvic = ' ' ! VIC parameters data file name - character(len=256), public :: mksrf_fch4 = ' ' ! inversion-derived CH4 parameters data file name integer , public :: numpft = 16 ! number of plant types @@ -74,7 +73,6 @@ module mkvarctl character(len=256), public :: map_fharvest = ' ' ! Mapping file for harvesting character(len=256), public :: map_ftopostats = ' ' ! Mapping file for topography statistics character(len=256), public :: map_fvic = ' ' ! Mapping file for VIC parameters - character(len=256), public :: map_fch4 = ' ' ! Mapping file for inversion-derived CH4 parameters character(len=80) , public :: gitdescribe = ' ' ! Description of model version from git ! ! Variables to override data read in with diff --git a/tools/mksurfdata_map/src/test/CMakeLists.txt b/tools/mksurfdata_map/src/test/CMakeLists.txt index 81e413cb85..78dee7b2b1 100644 --- a/tools/mksurfdata_map/src/test/CMakeLists.txt +++ b/tools/mksurfdata_map/src/test/CMakeLists.txt @@ -4,3 +4,4 @@ add_subdirectory(mkpftmod_test) add_subdirectory(mkgridmap_test) add_subdirectory(mkindexmap_test) add_subdirectory(mksoilUtils_test) +add_subdirectory(mkdomain_test) diff --git a/tools/mksurfdata_map/src/test/mkdomain_test/CMakeLists.txt b/tools/mksurfdata_map/src/test/mkdomain_test/CMakeLists.txt new file mode 100644 index 0000000000..401ce6a6f6 --- /dev/null +++ b/tools/mksurfdata_map/src/test/mkdomain_test/CMakeLists.txt @@ -0,0 +1,7 @@ +set (pfunit_sources + test_mkdomain.pf) + +create_pFUnit_test(mkdomainMod test_mkdomain_exe + "${pfunit_sources}" "") + +target_link_libraries(test_mkdomain_exe mksurfdat) diff --git a/tools/mksurfdata_map/src/test/mkdomain_test/test_mkdomain.pf b/tools/mksurfdata_map/src/test/mkdomain_test/test_mkdomain.pf new file mode 100644 index 0000000000..c54e299356 --- /dev/null +++ b/tools/mksurfdata_map/src/test/mkdomain_test/test_mkdomain.pf @@ -0,0 +1,93 @@ +module test_mkdomain + + ! Tests of mkdomainMod + + use pfunit_mod + + use shr_kind_mod, only : r8 => shr_kind_r8 + use mkgridmapMod, only : gridmap_type, for_test_create_gridmap + use mkdomainMod + + implicit none + save + + @TestCase + type, extends(TestCase) :: TestMkDomain + type(domain_type) :: ldomain + contains + procedure :: setUp + procedure :: tearDown + end type TestMkDomain + + integer, parameter :: ns = 2 + +contains + + subroutine setUp(this) + class(TestMkDomain), intent(inout) :: this + + call for_test_create_domain(this%ldomain) + end subroutine setUp + + subroutine tearDown(this) + class(TestMkDomain), intent(inout) :: this + + call domain_clean(this%ldomain) + + end subroutine tearDown + + @Test + subroutine test_runmkdomain(this) + class(TestMkDomain), intent(inout) :: this + + call domain_check( this%ldomain ) + + end subroutine test_runmkdomain + + @Test + subroutine test_is_neglong_domain_0to360(this) + class(TestMkDomain), intent(inout) :: this + + logical :: result + + result = is_domain_0to360_longs( this%ldomain ) + @assertFalse( result ) + end subroutine test_is_neglong_domain_0to360 + + @Test + subroutine test_is_posto360_domain_0to360(this) + class(TestMkDomain), intent(inout) :: this + + logical :: result + + this%ldomain%lonc(1) = 0.0_r8 + this%ldomain%lonc(2) = 360.0_r8 + result = is_domain_0to360_longs( this%ldomain ) + @assertTrue( result ) + end subroutine test_is_posto360_domain_0to360 + + @Test + subroutine test_is_posto180_domain_0to360(this) + class(TestMkDomain), intent(inout) :: this + + logical :: result + + this%ldomain%lonc(1) = 0.0_r8 + this%ldomain%lonc(2) = 180.0_r8 + result = is_domain_0to360_longs( this%ldomain ) + @assertTrue( result ) + end subroutine test_is_posto180_domain_0to360 + + @Test + subroutine test_is_ge180pos_domain_0to360(this) + class(TestMkDomain), intent(inout) :: this + + logical :: result + + this%ldomain%lonc(1) = 180.0_r8 + this%ldomain%lonc(2) = 200.0_r8 + result = is_domain_0to360_longs( this%ldomain ) + @assertTrue( result ) + end subroutine test_is_ge180pos_domain_0to360 + +end module test_mkdomain diff --git a/tools/ncl_scripts/README b/tools/ncl_scripts/README index 52abcdaf78..72073f5035 100644 --- a/tools/ncl_scripts/README +++ b/tools/ncl_scripts/README @@ -8,16 +8,8 @@ be done. 1.) Respond to CSMDATA and CLM_ROOT as needed. 2.) Print a line with "success" after the work is completed. - -Scripts available: - -Master perl scripts that call the other ncl scripts: - -getregional_datasets.pl ----- Extract out regional datasets from global ones and put files in a location that - can be used by build-namelist. NCL Scripts available: -getregional_datasets.ncl ---- NCL script to extract out regional datasets. getco2_historical.ncl ------- Get historical CO2 to use for input in datm8 streams - + diff --git a/tools/site_and_regional/README b/tools/site_and_regional/README new file mode 100644 index 0000000000..ca7507d7d6 --- /dev/null +++ b/tools/site_and_regional/README @@ -0,0 +1,46 @@ +$CTSMROOT/tools/site_and_regional/README Aug/10/2021 + +The purpose of this directory is to contain all of the scripts that involve creating CTSM input data files +for single site as well as regional cases. + +The python scripts require the following settings before running on cheyenne: + +module load python +ncar_pylib + +Brief description of scripts: + +subset_data.py + create regional domain, surface data, and rtm directional files by + extracting data from global datasets + +modify_singlept_site_neon.py + After running subset_data.py overwrite some fields with site-specific + data for neon sites + + +DEPRECATED SCRIPTS: + +Master perl scripts that call the other ncl scripts: + +mknoocnmap.pl + Script to create unity mapping dataset for single-point + or regional studies over land-only (no ocean). + +getregional_datasets.pl + Extract out regional datasets from global ones and put files in a location that + can be used by build-namelist. + +NCL Scripts available: + +mkunitymap.ncl + NCL script to create a unity map -- ran by above script (mknoocnmap.pl) + +getregional_datasets.ncl + NCL script to extract out regional datasets. + +Input datafiles: + +sample_infile* --- Sample datafiles with list of files for getregional_datasets.pl to operate on +sample_outfile* -- Sample datafiles with list of files for getregional_datasets.pl to create + diff --git a/tools/ncl_scripts/README.getregional b/tools/site_and_regional/README.getregional similarity index 85% rename from tools/ncl_scripts/README.getregional rename to tools/site_and_regional/README.getregional index b39dc6baa9..56c1d0834d 100644 --- a/tools/ncl_scripts/README.getregional +++ b/tools/site_and_regional/README.getregional @@ -1,5 +1,5 @@ -$CTSMROOT/tools/ncl_scripts/README.getregional Erik Kluzek - 06/08/2018 +$CTSMROOT/tools/site_and_regional/README.getregional Erik Kluzek + 06/08/2018 Information on the getregional_datasets script. diff --git a/tools/ncl_scripts/getregional_datasets.ncl b/tools/site_and_regional/getregional_datasets.ncl similarity index 100% rename from tools/ncl_scripts/getregional_datasets.ncl rename to tools/site_and_regional/getregional_datasets.ncl diff --git a/tools/ncl_scripts/getregional_datasets.pl b/tools/site_and_regional/getregional_datasets.pl similarity index 100% rename from tools/ncl_scripts/getregional_datasets.pl rename to tools/site_and_regional/getregional_datasets.pl diff --git a/tools/mkmapdata/mknoocnmap.pl b/tools/site_and_regional/mknoocnmap.pl similarity index 100% rename from tools/mkmapdata/mknoocnmap.pl rename to tools/site_and_regional/mknoocnmap.pl diff --git a/tools/mkmapdata/mkunitymap.ncl b/tools/site_and_regional/mkunitymap.ncl similarity index 100% rename from tools/mkmapdata/mkunitymap.ncl rename to tools/site_and_regional/mkunitymap.ncl diff --git a/tools/site_and_regional/modify_singlept_site_neon.py b/tools/site_and_regional/modify_singlept_site_neon.py new file mode 100755 index 0000000000..7b469641f1 --- /dev/null +++ b/tools/site_and_regional/modify_singlept_site_neon.py @@ -0,0 +1,556 @@ +#! /usr/bin/env python +""" +|------------------------------------------------------------------| +|--------------------- Instructions -----------------------------| +|------------------------------------------------------------------| +This script is for modifying surface dataset at neon sites +using data available from the neon server. + +After creating a single point surface data file from a global +surface data file using subset_data.py, use this script to +overwrite some fields with site-specific data for neon sites. + +This script will do the following: +- Download neon data for the specified site if it does not exist + in the specified directory. +- Modify surface dataset with downloaded data (neon-specific). + +------------------------------------------------------------------- +Instructions for running on Cheyenne/Casper: + +load the following into your local environment + module load python + ncar_pylib + +To remove NPL from your environment on Cheyenne/Casper: + deactivate +------------------------------------------------------------------- +To see the available options: + ./modify_singlept_site_neon.py --help +------------------------------------------------------------------- +""" +# TODO (NS) +#--[] If file not found run subset_data.py +#--[] Clean up imports for both codes... +#--[] Check against a list of valid names. +#--[] List of valid neon sites for all scripts come from one place. +#--[] zbedrock + +# Import libraries +from __future__ import print_function + +import os +import sys +import glob +import argparse +import requests + +import numpy as np +import pandas as pd +import xarray as xr + +from datetime import date +from getpass import getuser + + +myname = getuser() + + +#-- valid neon sites +valid_neon_sites = ['ABBY','BARR','BART','BLAN', + 'BONA','CLBJ','CPER','DCFS', + 'DEJU','DELA','DSNY','GRSM', + 'GUAN','HARV','HEAL','JERC', + 'JORN','KONA','KONZ','LAJA', + 'LENO','MLBS','MOAB','NIWO', + 'NOGP','OAES','ONAQ','ORNL', + 'OSBS','PUUM','RMNP','SCBI', + 'SERC','SJER','SOAP','SRER', + 'STEI','STER','TALL','TEAK', + 'TOOL','TREE','UKFS','UNDE', + 'WOOD','WREF','YELL' + ] + + +def get_parser(): + """ + Get parser object for this script. + """ + parser = argparse.ArgumentParser(description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + + parser.print_usage = parser.print_help + + parser.add_argument('--neon_site', + help='4-letter neon site code.', + action="store", + dest="site_name", + choices=valid_neon_sites, + required=True) + parser.add_argument('--surf_dir', + help=''' + Directory of single point surface dataset. + [default: %(default)s] + ''', + action="store", + dest="surf_dir", + type =str, + required=False, + default="/glade/scratch/"+myname+"/single_point/") + parser.add_argument('--out_dir', + help=''' + Directory to write updated single point surface dataset. + [default: %(default)s] + ''', + action="store", + dest="out_dir", + type =str, + required=False, + default="/glade/scratch/"+myname+"/single_point_neon_updated/") + parser.add_argument('-d','--debug', + help=''' + Debug mode will print more information. + [default: %(default)s] + ''', + action="store_true", + dest="debug", + default=False) + + return parser + + +def get_neon(neon_dir, site_name): + """ + Function for finding neon data file + and download from neon server if the + file does not exits. + + Args: + neon_dir (str): local directory for downloading neon data. + site_name (str): 4 letter neon site name + + Raises: + Error if the download was not successful (exit code:404). + In case the data does not exist in the neon server or if + neon server is down. + + Returns: + neon_file (str) : complete file name of the downloaded data + """ + + #-- create directory if not exists + if not os.path.exists(neon_dir): + os.makedirs(neon_dir) + + neon_file = os.path.join(neon_dir, site_name + "_surfaceData.csv") + + #-- Download the file if it does not exits + if os.path.isfile(neon_file): + print('neon file for', site_name, 'already exists! ') + print('Skipping download from neon for', site_name,'...') + else: + print('------------------------------------------------') + print('Beginning download from neon server for', site_name,'...') + + url = ('https://s3.data.neonscience.org/neon-ncar/NEON/surf_files/v1/' + +site_name+'_surfaceData.csv') + response = requests.get(url) + + with open(neon_file, 'wb') as f: + f.write(response.content) + + #-- Check if download status_code + if response.status_code == 200: + print('Download finished successfully for', site_name) + elif response.status_code == 404: + sys.exit('Data for this site '+site_name+ + ' was not available on the neon server:'+ url) + + print('Download exit status code: ',response.status_code) + print('Downloaded file type : ',response.headers['content-type']) + print('Downloaded file encoding : ',response.encoding) + print('------------------------------------------------') + + response.close() + + return neon_file + +def find_surffile (surf_dir, site_name): + """ + Function for finding and choosing surface file for + a neon site. + In case multiple files exist for the neon site, it + will choose the file created the latest. + + Args: + surf_dir (str): directory of single point surface data + site_name (str): 4 letter neon site name + + Raises: + Error if the surface data for the site is not created + + Returns: + surf_file (str): name of the surface dataset file + """ + + #sf_name = "surfdata_hist_16pfts_Irrig_CMIP6_simyr2000_"+site_name+"*.nc" + sf_name = "surfdata_hist_78pfts_CMIP6_simyr2000_"+site_name+"*.nc" + #surf_file = glob.glob(os.path.join(surf_dir,sf_name)) + surf_file = glob.glob(surf_dir+"/"+sf_name) + + if len(surf_file)>1: + print ("The following files found :", *surf_file, sep='\n- ') + print ("The latest file is chosen :", surf_file[-1]) + surf_file = surf_file[-1] + elif len(surf_file)==1: + print ("File found : ") + print (surf_file) + surf_file = surf_file[0] + else: + sys.exit('Surface data for this site '+site_name+ + 'was not found:'+ surf_file,'.', + '\n','Please run ./subset_data.py for this site.') + return surf_file + +def find_soil_structure (surf_file): + """ + Function for finding surface dataset soil + strucutre using surface data metadata. + + In CLM surface data, soil layer information + is in a file from surface data metadata + under "Soil_texture_raw_data_file_name". + This function finds this file for the surface + dataset, read it, and find soil layers. + + Args: + surf_file (str): single point surface data filename + + Raises: + error if the soil layer strucutre file does not exist + + Returns: + soil_bot : array of soil layers top depths + soil_top : array of soil layers bottom depths + """ + #TODO: What if not cheyenne? Self-contained depth info. + + print ('------------') + print (surf_file) + print (type(surf_file)) + f1 = xr.open_dataset(surf_file) + print ('------------') + #print (f1.attrs["Soil_texture_raw_data_file_name"]) + + clm_input_dir = "/glade/p/cesmdata/cseg/inputdata/lnd/clm2/rawdata/" + surf_soildepth_file = os.path.join(clm_input_dir, + f1.attrs["Soil_texture_raw_data_file_name"]) + + if os.path.exists (surf_soildepth_file): + print ("\n\n Reading", surf_soildepth_file, + "for surface data soil structure information:") + f1_soildepth = xr.open_dataset(surf_soildepth_file) + print (f1_soildepth['DZSOI']) + soil_bot = f1_soildepth['DZSOI'].values + + #-- soil layer top + soil_top = soil_bot[:-1] + soil_top = np.insert(soil_top,0, 0) + + else: + sys.exit('Cannot find soil structure file : '+surf_soildepth_file+ + 'for the surface dataset.') + + return soil_bot, soil_top + +def update_metadata(nc, surf_file, neon_file, zb_flag): + """ + Function for updating modified surface dataset + metadat for neon sites. + + Args: + nc (xr Dataset): netcdf file including updated neon surface data + surf_file (str): single point surface data filename + neon_file (str): filename of neon downloaded surface dataset + + Returns: + nc (xr Dataset): netcdf file including updated neon surface data + """ + today = date.today() + today_string = today.strftime("%Y-%m-%d") + + nc.attrs['Updated_on'] = today_string + nc.attrs['Updated_by'] = myname + nc.attrs['Updated_with'] = os.path.abspath(__file__) + nc.attrs['Updated_from'] = surf_file + nc.attrs['Updated_using'] = neon_file + if zb_flag: + nc.attrs['Updated_fields'] = "PCT_CLAY, PCT_SAND, ORGANIC, zbedrock" + #nc.attrs['Updated_fields'] = ['PCT_CLAY','PCT_SAND','ORGANIC','zbedrock'] + else: + nc.attrs['Updated_fields'] = "PCT_CLAY, PCT_SAND, ORGANIC" + # nc.attrs['Updated_fields'] = ['PCT_CLAY','PCT_SAND','ORGANIC'] + + return nc + +def update_time_tag (fname_in): + """ + Function for updating time tag on surface dataset + files. + Expects file to end with [._]cYYMMDD.nc or [._]YYMMDD.nc + Add the tag to just before that ending part. + + Args: + fname_in (str) : file name with the old time tag + + Raises: + error if the file does not end with with + [._]cYYMMDD.nc or [._]YYMMDD.nc + + Returns: + fname_out (str) : file name with the updated time tag + """ + today = date.today() + today_string = today.strftime("%y%m%d") + + basename = os.path.basename(fname_in) + cend = -10 + if ( basename[cend] == "c" ): + cend = cend - 1 + if ( (basename[cend] != ".") and (basename[cend] != "_") ): + sys.exit( "Trouble figuring out where to add tag to filename:"+fname_in ) + + fname_out = basename[:cend]+"_"+"c"+today_string+".nc" + return(fname_out) + +def sort_print_soil_layers(obs_bot, soil_bot): + """ + Function for pretty printing soil structure of + original surface dataset and neon dataset. + + Args: + obs_bot : array of neon soil layers bottom depths + soil_bot : array of soil layers bottom depths + """ + + obs_bot_df = pd.DataFrame({'depth':obs_bot,'type':"obs"}) + soil_bot_df = pd.DataFrame({'depth':soil_bot,'type':"sfc"}) + depth_df = pd.concat([obs_bot_df,soil_bot_df]) + + depth_df = depth_df.sort_values('depth') + + space = ' ' + print ("================================", + "================================") + + print (" Neon data soil structure: " , + " Surface data soil structure: ") + + print ("================================", + "================================") + + for index, row in depth_df.iterrows(): + if row['type']=="obs": + print ("-------------", + "{0:.3f}".format(row['depth']), + "------------") + else: + print (33*space+ + "-------------", + "{0:.3f}".format(row['depth']), + "-----------") + + print ("--------------------------------"+ + "--------------------------------") + +def check_neon_time(): + """ + A function to download and parse neon listing file. + """ + listing_file = 'listing.csv' + url = 'https://neon-ncar.s3.data.neonscience.org/listing.csv' + + download_file(url, listing_file) + + df = pd.read_csv(listing_file) + df = df[df['object'].str.contains("_surfaceData.csv")] + #df=df.join(df['object'].str.split("/", expand=True)) + dict_out = dict(zip(df['object'],df['last_modified'])) + print (dict_out) + #df_out = df[['object','6','last_modified']] + #print (df['last_modified']) + #print (df_out) + #print (df['last_modified'].to_datetime()) + return dict_out + + +def download_file(url, fname): + """ + Function to download a file. + Args: + url (str): + url of the file for downloading + fname (str) : + file name to save the downloaded file. + """ + response = requests.get(url) + + with open(fname, 'wb') as f: + f.write(response.content) + + #-- Check if download status_code + if response.status_code == 200: + print('Download finished successfully for', fname,'.') + elif response.status_code == 404: + print('File '+fname+'was not available on the neon server:'+ url) + + + +def main(): + + args = get_parser().parse_args() + + #-- debugging option + if args.debug: + logging.basicConfig(level=logging.DEBUG) + + file_time = check_neon_time() + + #-- specify site from which to extract data + site_name=args.site_name + + #-- Look for surface data + surf_dir = args.surf_dir + surf_file = find_surffile (surf_dir, site_name) + + #-- directory structure + current_dir = os.getcwd() + parent_dir = os.path.dirname(current_dir) + clone_dir = os.path.abspath(os.path.join(__file__ ,"../../..")) + neon_dir = os.path.join(clone_dir,"neon_surffiles") + print("Present Directory", current_dir) + + #-- download neon data if needed + neon_file = get_neon(neon_dir, site_name) + + #-- Read neon data + df = pd.read_csv (neon_file) + + # -- Read surface dataset files + print (type(surf_file)) + print ("surf_file:", surf_file) + f1 = xr.open_dataset(surf_file) + + # -- Find surface dataset soil depth information + soil_bot, soil_top = find_soil_structure (surf_file) + + # -- Find surface dataset soil levels + # TODO: how? NS uses metadata on file to find + # soil strucure + # better suggestion by WW to write dzsoi to neon surface dataset + # This todo needs to go to the subset_data + + # TODO Will: if I sum them up , are they 3.5? (m) YES + print ("soil_top:", soil_top) + print ("soil_bot:", soil_bot) + print ("Sum of soil top depths :", sum(soil_top)) + print ("Sum of soil bottom depths :",sum(soil_bot)) + + soil_top = np.cumsum(soil_top) + soil_bot = np.cumsum(soil_bot) + soil_mid = 0.5*(soil_bot - soil_top)+soil_top + #print ("Cumulative sum of soil bottom depths :", sum(soil_bot)) + + obs_top = df['biogeoTopDepth']/100 + obs_bot = df['biogeoBottomDepth']/100 + + # -- Mapping surface dataset and neon soil levels + bins = df['biogeoTopDepth']/100 + bin_index = np.digitize(soil_mid, bins)-1 + + + ''' + print ("================================") + print (" Neon data soil structure: ") + print ("================================") + + print ("------------","ground","------------") + for i in range(len(obs_bot)): + print ("layer",i) + print ("-------------", + "{0:.2f}".format(obs_bot[i]), + "-------------") + + print ("================================") + print ("Surface data soil structure: ") + print ("================================") + + print ("------------","ground","------------") + for b in range(len(bin_index)): + print ("layer",b) + print ("-------------", + "{0:.2f}".format(soil_bot[b]), + "-------------") + ''' + #-- update fields with neon + f2= f1 + soil_levels = f2['PCT_CLAY'].size + for soil_lev in range(soil_levels): + print ("--------------------------") + print ("soil_lev:",soil_lev) + print (df['clayTotal'][bin_index[soil_lev]]) + f2['PCT_CLAY'][soil_lev] = df['clayTotal'][bin_index[soil_lev]] + f2['PCT_SAND'][soil_lev] = df['sandTotal'][bin_index[soil_lev]] + bulk_den = df['bulkDensExclCoarseFrag'][bin_index[soil_lev]] + carbon_tot = df['carbonTot'][bin_index[soil_lev]] + #print ("carbon_tot:", carbon_tot) + layer_depth = df['biogeoBottomDepth'][bin_index[soil_lev]] - df['biogeoTopDepth'][bin_index[soil_lev]] + f2['ORGANIC'][soil_lev] = carbon_tot * bulk_den * 0.1 / layer_depth * 100 / 0.58 + print ("bin_index:", bin_index[soil_lev]) + print ("layer_depth:", layer_depth) + print ("carbon_tot:",carbon_tot) + print ("bulk_den:",bulk_den) + print ("organic=carbon_tot*bulk_den*0.1/layer_depth * 100/0.58 ") + print ("organic:", f2['ORGANIC'][soil_lev].values) + print ("--------------------------") + + #TODO : max depth for neon sites from WW (zbedrock) + # Update zbedrock if neon observation don't make it down to 2m depth + # zbedrock = neon depth if neon does not make to 2m depth + + rock_thresh = 2 + + zb_flag = False + + if (obs_bot.iloc[-1] Date: Wed, 20 Oct 2021 11:53:33 -0400 Subject: [PATCH 09/14] Revert initialize sequence --- src/main/clm_initializeMod.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index a22057e851..28adf88600 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -222,6 +222,8 @@ subroutine initialize2(ni,nj) ! Read surface dataset and set up subgrid weight arrays call surfrd_get_data(begg, endg, ldomain, fsurdat, actual_numcft) + !!! (RGK) TEST RESET TIME + call CLMFatesGlobals(dtime=1800.0_r8) ! Determine decomposition of subgrid scale landunits, columns, patches @@ -321,7 +323,8 @@ subroutine initialize2(ni,nj) ! This also sets up various global constants in FATES ! ------------------------------------------------------------------------ - call CLMFatesGlobals(dtime) + !!! (RGK test relocation) + !!!call CLMFatesGlobals(dtime) ! Initialize Balance checking (after time-manager) From b2e4b31b10be25fcf72b3b3f5995f5e4ac9b4ffe Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 22 Oct 2021 13:01:22 -0400 Subject: [PATCH 10/14] re-arranging initialization of timestep passing to FATES --- src/main/clm_initializeMod.F90 | 38 ++++++++++++++--------------- src/utils/clmfates_interfaceMod.F90 | 23 ++++++++++++----- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 28adf88600..c9541376a2 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -27,6 +27,7 @@ module clm_initializeMod use reweightMod , only : reweight_wrapup use filterMod , only : allocFilters, filter, filter_inactive_and_active use CLMFatesInterfaceMod , only : CLMFatesGlobals + use CLMFatesInterfaceMod , only : CLMFatesTimesteps use dynSubgridControlMod , only : dynSubgridControl_init, get_reset_dynbal_baselines use SelfTestDriver , only : self_test_driver use SoilMoistureStreamMod , only : PrescribedSoilMoistureInit @@ -222,9 +223,20 @@ subroutine initialize2(ni,nj) ! Read surface dataset and set up subgrid weight arrays call surfrd_get_data(begg, endg, ldomain, fsurdat, actual_numcft) - !!! (RGK) TEST RESET TIME - call CLMFatesGlobals(dtime=1800.0_r8) - + ! Ask Fates to evaluate its own dimensioning needs. + ! This determines the total amount of space it requires in its largest + ! dimension. We are currently calling that the "cohort" dimension, but + ! it is really a utility dimension that captures the models largest + ! size need. + ! Sets: + ! fates_maxElementsPerPatch + ! fates_maxElementsPerSite (where a site is roughly equivalent to a column) + ! (Note: fates_maxELementsPerSite is the critical variable used by CLM + ! to allocate space) + ! This also sets up various global constants in FATES + ! ------------------------------------------------------------------------ + + call CLMFatesGlobals() ! Determine decomposition of subgrid scale landunits, columns, patches call decompInit_clumps(ni, nj, glc_behavior) @@ -300,6 +312,9 @@ subroutine initialize2(ni,nj) call timemgr_restart() end if + ! Pass model timestep info to FATES + call CLMFatesTimesteps() + ! Initialize daylength from the previous time step (needed so prev_dayl can be set correctly) call t_startf('init_orbd') calday = get_curr_calday() @@ -310,23 +325,6 @@ subroutine initialize2(ni,nj) call t_stopf('init_orbd') call InitDaylength(bounds_proc, declin=declin, declinm1=declinm1, obliquity=obliqr) - ! Ask Fates to evaluate its own dimensioning needs. - ! This determines the total amount of space it requires in its largest - ! dimension. We are currently calling that the "cohort" dimension, but - ! it is really a utility dimension that captures the models largest - ! size need. - ! Sets: - ! fates_maxElementsPerPatch - ! fates_maxElementsPerSite (where a site is roughly equivalent to a column) - ! (Note: fates_maxELementsPerSite is the critical variable used by CLM - ! to allocate space) - ! This also sets up various global constants in FATES - ! ------------------------------------------------------------------------ - - !!! (RGK test relocation) - !!!call CLMFatesGlobals(dtime) - - ! Initialize Balance checking (after time-manager) call BalanceCheckInit() diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index a11d1527d5..0ed271e1be 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -116,12 +116,14 @@ module CLMFatesInterfaceMod use FatesInterfaceMod , only : SetFatesTime use FatesInterfaceMod , only : set_fates_ctrlparms use FatesInterfaceMod , only : UpdateFatesRMeansTStep + use FatesInterfaceMod , only : InitTimeAveragingGlobals use FatesHistoryInterfaceMod, only : fates_hist use FatesRestartInterfaceMod, only : fates_restart_interface_type use EDTypesMod , only : ed_patch_type use PRTGenericMod , only : num_elements - use FatesInterfaceTypesMod , only : hlm_numlevgrnd + use FatesInterfaceTypesMod, only : hlm_numlevgrnd + use FatesInterfaceTypesMod, only : hlm_stepsize use EDMainMod , only : ed_ecosystem_dynamics use EDMainMod , only : ed_update_site use EDInitMod , only : zero_site @@ -239,7 +241,7 @@ module CLMFatesInterfaceMod contains - subroutine CLMFatesGlobals(dtime) + subroutine CLMFatesGlobals() ! -------------------------------------------------------------------------------- ! This is one of the first calls to fates @@ -251,8 +253,6 @@ subroutine CLMFatesGlobals(dtime) ! over the NL variables to FATES global settings. ! -------------------------------------------------------------------------------- - real(r8), intent(in) :: dtime ! main model timestep (s) - logical :: verbose_output integer :: pass_masterproc integer :: pass_vertsoilc @@ -321,7 +321,6 @@ subroutine CLMFatesGlobals(dtime) call set_fates_ctrlparms('sf_scalar_lightning_def',ival=scalar_lightning) call set_fates_ctrlparms('sf_successful_ignitions_def',ival=successful_ignitions) call set_fates_ctrlparms('sf_anthro_ignitions_def',ival=anthro_ignitions) - call set_fates_ctrlparms('stepsize', rval = dtime) if(is_restart()) then pass_is_restart = 1 @@ -458,7 +457,19 @@ subroutine CLMFatesGlobals(dtime) end subroutine CLMFatesGlobals - ! ==================================================================================== + ! =================================================================================== + + subroutine CLMFatesTimesteps() + + hlm_stepsize = get_step_size_real() + + call InitTimeAveragingGlobals() + + return + end subroutine CLMFatesTimesteps + + + ! ==================================================================================== subroutine init(this, bounds_proc ) From 0700927052961aaa6606aabe7a41c3b1e91b43d1 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 1 Dec 2021 10:58:09 -0500 Subject: [PATCH 11/14] Updating call order on fates running mean --- src/main/clm_driver.F90 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 8b211bb52e..132e58b02f 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -1070,6 +1070,12 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro if ( use_fates) then + ! FATES has its own running mean functions, such as 24hr + ! vegetation temperature and exponential moving averages + ! for leaf photosynthetic acclimation temperature. These + ! moving averages are updated here + call clm_fates%WrapUpdateFatesRmean(nc,temperature_inst) + call EDBGCDyn(bounds_clump, & filter(nc)%num_soilc, filter(nc)%soilc, & filter(nc)%num_soilp, filter(nc)%soilp, & @@ -1092,14 +1098,11 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & clm_fates, nc) - + call clm_fates%wrap_update_hifrq_hist(bounds_clump, & soilbiogeochem_carbonflux_inst, & soilbiogeochem_carbonstate_inst) - - ! This call updates some history diagnostics and must be called - ! after wrap_update_hifrq_hist - call clm_fates%WrapUpdateFatesRmean(nc,temperature_inst) + if( is_beg_curr_day() ) then @@ -1110,7 +1113,6 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro if ( masterproc ) then write(iulog,*) 'clm: calling FATES model ', get_nstep() end if - call clm_fates%dynamics_driv( nc, bounds_clump, & atm2lnd_inst, soilstate_inst, temperature_inst, active_layer_inst, & water_inst%waterstatebulk_inst, water_inst%waterdiagnosticbulk_inst, & @@ -1122,7 +1124,9 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro call setFilters( bounds_clump, glc_behavior ) end if - + + + end if ! use_fates branch ! ============================================================================ From 6c22d8a8a1c7c1cdd9df2ab52bb778a8ff79ec04 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 3 Dec 2021 14:22:24 -0700 Subject: [PATCH 12/14] Update FATES tag --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 965d8e2a91..a5fc21e0bb 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/rgknox/fates -branch = fates_runmean_vars +repo_url = https://github.com/NGEET/fates +tag = sci.1.52.0_api.20.0.0 required = True [externals_description] From 527625d0b0dec98de06978d8d26700c30136098a Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 3 Dec 2021 16:38:30 -0500 Subject: [PATCH 13/14] Updated changelog --- doc/ChangeLog | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 60 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 01fa9b4f87..75e2cea710 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,63 @@ =============================================================== +Tag name: ctsm5.1.dev066 +Originator(s): rgknox (Ryan Knox,,,) +Date: Fri Dec 3 16:24:17 EST 2021 +One-line Summary: API change with FATES to enable running means inside fates, includes passing in of model timestep + +Purpose and description of changes +---------------------------------- + +This set of changes synchronizes CTSM with API 20 of FATES. API 20 of FATES requires a modification to timing boundary conditions so that FATES can maintain its own internal running means. FATES also no-longer asks CTSM for the 24hour vegetation temperature, since this is a patch(pft) level variable, and FATES has more suitable averaging mechanisms. These changes are synchronized with FATES Pull Request: https://github.com/NGEET/fates/pull/724, which subsequently created tag: https://github.com/NGEET/fates/releases/tag/sci.1.52.0_api.20.0.0 + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +[x] clm_fates + +Notes of particular relevance for developers: +--------------------------------------------- + +Developers should be aware that FATES does require information on the model timestep, which was not necessarily available in initialize1. Efforts were made to circumvent needing the model timetep at this phase of initialization, so impact on non-fates code was minimal. + + +Testing summary: +---------------- + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- PASS (fates had expectedly different results compared to base) + izumi ------- PASS (fates had expectedly different results compared to base) + + fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) + cheyenne ---- PASS (fates had expectedly different results compared to base) + izumi ------- + + + Additional tests: + Multi-decadal simulations were also run to evaluate fates side sensitivity to slightly different averaging scheme. The differences were not so subtle, attributed mostly to fixing an initialization bug (the previous 24hour temperature had initialized at 0K) and a 1-hour phase change in the 24-hour start-stop cycle. + + +Answer changes +-------------- + +Changes answers relative to baseline: all FATES active simulations have different results. + + +=============================================================== +=============================================================== Tag name: ctsm5.1.dev065 Originator(s): glemieux (Gregory Lemieux,LBL/NGEET,510-486-5049) Date: Thu Dec 2 00:13:37 MST 2021 diff --git a/doc/ChangeSum b/doc/ChangeSum index f2afb0c60c..9ac4e2897e 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.1.dev066 rgknox 12/03/2021 API change with FATES to enable running means inside fates, includes passing in of model timestep ctsm5.1.dev065 glemieux 12/02/2021 Refactor static fire data input by moving variables into fire_base_type from cnveg_state_type ctsm5.1.dev064 afoster 11/29/2021 Updates to facilitate FATES history variable overhaul ctsm5.1.dev063 glemieux 11/23/2021 Provide access to the fraction of canopy covered by snow variable to fates From 057b9b1f9d5e25aba30e79bf11879e73aadb2d1d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 4 Dec 2021 01:58:53 -0700 Subject: [PATCH 14/14] Update date/time --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 75e2cea710..4a8050bfe1 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.1.dev066 Originator(s): rgknox (Ryan Knox,,,) -Date: Fri Dec 3 16:24:17 EST 2021 +Date: Sat Dec 4 01:58:42 MST 2021 One-line Summary: API change with FATES to enable running means inside fates, includes passing in of model timestep Purpose and description of changes diff --git a/doc/ChangeSum b/doc/ChangeSum index 9ac4e2897e..73281e5a9c 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.1.dev066 rgknox 12/03/2021 API change with FATES to enable running means inside fates, includes passing in of model timestep + ctsm5.1.dev066 rgknox 12/04/2021 API change with FATES to enable running means inside fates, includes passing in of model timestep ctsm5.1.dev065 glemieux 12/02/2021 Refactor static fire data input by moving variables into fire_base_type from cnveg_state_type ctsm5.1.dev064 afoster 11/29/2021 Updates to facilitate FATES history variable overhaul ctsm5.1.dev063 glemieux 11/23/2021 Provide access to the fraction of canopy covered by snow variable to fates