Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGEE Arctic IM1 - Polygonal tundra #10

Open
wants to merge 40 commits into
base: thorntonpe/lnd/IM1
Choose a base branch
from

Conversation

rfiorella
Copy link

@rfiorella rfiorella commented Sep 9, 2024

Description of changes:
Adds a representation of polygonal tundra that has been parameterized from simulations using the Advanced Terrestrial Simulator. Key changes include:

  1. Two namelist options - use_polygonal_tundra, which turns on and off the polygonal tundra feature; and use_arctic_init, which provides a new cold and saturated start option to prevent Arctic soils from being too dry at depth due to rapid freezing in shallower soil layers.
  2. Several changes to subgrid weighting are made to allow for addition of three different polygon type land units. These polygon land unit types otherwise need to have type istsoil, and so they are added to both the landunit and a new wt_polygon weighting array. When use_polygonal_tundra = .false., wt_polygon is 0 and wt_lunit(:,:,istsoil) is unchanged). When use_polygonal_tundra = .true., wt_polygon is read from the surface file as PCT_LCP, PCT_HCP, and PCT_FCP, and then wt_lunit is set as follows: wt_lunit(:,:,isthighcenpoly) = wt_polygon(:,:,ihighcenpoly)*wt_lunit(:,:,istsoil), wt_lunit(:,:,istflatcenpoly) = wt_polygon(:,:,iflatcenpoly)*wt_lunit(:,:,istsoil), wt_lunit(:,:,istlowcenpoly) = wt_polygon(:,:,ilowcenpoly)*wt_lunit(:,:,istsoil). wt_lunit(:,:,istsoil) is then updated as: wt_lunit(:,:,istsoil) - sum(wt_polygon(:,:,:)).
  3. Adds several new variables to track ice wedge polygon microtopography.
  4. (still need to update here)

Test results: bit-for-bit with respect to 5559a57.

Expected performance impact: minimal when feature is off. When feature is on, adds up to 3 landunits to tundra grid cells, which may increase cost in these grid cells by up to ~4x if the only landunit previously had been istsoil.

cc'ing @chuckaustin @katrinaebennett for awareness

@rfiorella rfiorella marked this pull request as ready for review September 15, 2024 15:17
@rfiorella
Copy link
Author

rfiorella commented Sep 15, 2024

@thorntonpe not ready for merge as we're still working on the forcing data issue, but I suspect this is close enough to final now that it might be worth starting to review.

Known issues I plan to resolve:

  • determine if subsidence is working as expected in 21st century runs
  • update the use_arctic_init initialization to change temperature conditions to be latitudinally varying with a simple zonal-mean temperature assumption
  • ERS test added only tests the use_polygonal_tundra = .true. flag and should also test the use_arctic_init = .true. flag

Items to discuss:

  1. I'm not sure if we've hit the right balance on the subgrid initialization and will need to check output carefully. The concern is that the wt_lunit(:,:,isthighcenpoly:istlowcenpoly) land units would not be picked up as istsoil somewhere in the code. If the checks are against lun_pp%ltype throughout the code, I suspect this will work as coded. But checks where the index wt_lunit(:,:,i) where i = istsoil would probably fail.
  2. There's potential duplication of some microtopographic parameters that were added here that conflict with existing micro topographic parameters (e.g., GRADZ compared to other slope/gradient parameters).
  3. Two additional features of this capability are currently hard-coded into the design but that should probably be more flexible: a) the assumption that subsidence should begin in 1989, which was a large heat wave year on the AK north slope; b) excess ice content should be initialized in the whole column as 0.36.

rfiorella and others added 27 commits September 26, 2024 13:59
Adds another variable of maxalt_ever and its index
following existing logic for calculating the
maximum active layer thickness (really thaw depth
as calculated) to date in the simulation.

correct initialization of altmax_ever

Changes needed to get altmax_ever values to initialize correctly.
Fixes an issue where altmax_ever would be >30 meters regardless of
location/climate due to carrying forward the initial conditions.
Now includes a spinup_state flag so that it is set as 0 during spinup,
and then increases based on thaw depths over non-spinup cases.
Adds excess ground ice to the col_ws / column
water state data structure as a varaible needed for
NGEE-Arctic Phase 3 IM1 (improved inundation fraction).
Not yet connected to any of the new polygonal ground
subtypes of the vegetated columns.
Excess ground ice had been templated in these changes
as mass/area - changing to a volume/volume basis
(and therefore, now unitless).
Changes dimension on excess_ice parameter in water state types
from being one value per column to having dimensions
(columns, depth in soil)
…ndra, but still needs work defining values for microtopographic parameters before it can be tested
ispolygon is part of lun_pp data structure and not landunit_varcon
so does not need to be imported to FracH2OSfc subroutine

Fix rank problem with ice wedge polygon microtopographic variables
wip - subsidence calculations in polygonal tundra

Adds infrastructure for calculating subsidence
and related microtopographic parameters based
on changes in MAXALT over time.

Add iwp_subsidence to column type.

Adds ground subsidence variable to col_pp in
column type to track subsidence associated with
excess ice melting in polygonal tundra.

Typo fix in associate call in ActiveLayerMod

Small bug-fix to add missing continuation character
for new variables in associate in ActiveLayerMod

import polygonal tundra types from landunit_varcon

Adds import of ilowcenpoly, iflatcenpoly, and ihighcenpoly
landunit types to ActiveLayerMod.

Fix indexing of ispolygon landunit logical.

Logical test of lun_pp%ispolygon needed to have
column specified in a place where the whole
vector had previously been specified.
Imports the iwp_subsidence variable from col_pp
into the SoilHydrologyMod.
Adds linear scaling of various microtopographic
parameters in polygonal tundra (depression depth,
excluded volume, relief)
Adds tracking for maxalt (really thaw depth) in 1989
for comparision with ATS. Necessary for model development
and validation, but should be replaced with something
that is more physically based for use outside of the
AK north slope.

Updates initialization routines to allow for polygonal landunits
to be created from namelist option and from polygon type
percentages specified on input file. In particular,
it allows for four landunits to be created with istsoil ltype
on each topounit so that the ice wedge polygons can have their
own soil columns as well as be vegetated. The fourth landunit
is for non-polygonal natural vegetated ground on the same topounit.
Adds use_polygonal_tundra flag to CanopyStateType
as new variables were causing issues when comparing
against baseline tests.
Not all polygon types were being imported from
landunit_varcon, commit adds the missing polygon types.
wt_polygon had never been allocated in
elm_initializeMod, so needs to be added here in order
to get polygon weights in surfrdMod.F90
Removes melted excess ice from the profile and also
set the initiation for subsidence calculations in
1989 (though this threshold should be replaced for
expanding beyond the N Slope of Alaska). Should check
melt profiles carefully as the layer structure may
be inverted.
Adds logic to read gradz from surfdata file when NGEE Arctic
polygonal tundra is turned on. There are already topo_slope variables
so should make sure that this additional variable is actually needed.
Calculation of wt_polygon fails when
use_polygonal_tundra = .false., adds more checks
to prevent out of bounds errors and sets wt_polygon
to zero when use_polygonal_tundra = .false.

wip - trying to fix wt_nat_patch > 1 from polygons
Some developer tests were reporting DIFF due to additional
variables being added to history files (and restart files).
This commit adds a flag for these variables using elm_varctl
Previous logic hadn't been adding patches/columns/
and landunits for polygonal tundra. This adds them;
code compiles but does not yet run due to something
missing in the accounting of landunits (an extra one
is included somewhere).
Adds major changes to initialization routines to
get landunits for use_polygonal_tundra option to
register and be correctly counted. Required some
changes to the elm_ptr_* logic as well as changing
max_landunit. Now runs, but seems to introduce an
issue with the CH4 modules.
Adds an Arctic initialization option that starts
with a fully saturated column and a temperature below zero.
May need ot also fill with ice.
Moves a bunch of the microtopograhic parameters
from col_pp to col_ws, and adds them to the history
and restart files (subsidence, excluded volume,
mictropographic depression depth and relief). Not
water states per se but used in calculating water
state vars for polygonal tundra, and there are alot
more IO capabilities within col_ws/ColumnDataType.
Fixes a number of bugs that were discovered during
an IM1 code review:
1. subsidence was never initialized to 0, therefore,
was set to 0.4 when using min(subsidence,spval)
2. runoff calculation needed a conversion factor
from mm/day to mm/s.
3. A few of the IWP history file variables were
not writing out the correct pointer variable.
Fixes issues in the initialization of wt_lunit and wt_polygon
arrays if use_polygonal_tundra is false. Briefly, new indices
of wt_lunit and wt_polygon had been initialized, which caused
multiple issues including: introduction of nans, floating-point
exceptions, and causing issues where sum(array) > 1. Fixes
multiple test failures and diffs.
A few problems found in the initialization routines
that was causing the new test to fail. Finalizes
new ERS test, and moves assignment of wt_lunit weights
for polygon cases from initGridCellsMod to surfrdMod
In order to pass the developer tests, landunit_names array
needs to have length max_non_poly_unit when no polygonal tundra,
but max_lunit with polygonal tundra. Fixes some dims arising
due to a change in dimension length on tests that run cprnc
against elm files rather than cpl files.
Cleans up various accumulated print statements that are no longer
needed and fixes a few type errors remaining in code.
@rfiorella
Copy link
Author

@thorntonpe hi Peter - a few pieces of good news here. I've fixed a few bugs and I think all of the capability is now working here as expected.

We're putting this code through a few final tests, and I've done a rebase locally that isn't reflected here yet to remove all the white-space only changes (as I had noticed had been requested by the E3SM team for the IM3 updates).

I'm hoping any last changes on our end should be done in the next day or so, so that you can begin reviewing.

@rfiorella rfiorella changed the title [WIP] NGEE Arctic IM1 - Polygonal tundra NGEE Arctic IM1 - Polygonal tundra Oct 1, 2024
@rfiorella
Copy link
Author

There are a few small performance tweaks that could be made here - the most notable one is moving some of the variable assignments for depression depth, microtopographic relief, and excluded volume that are invariant from biogeophys/ActiveLayerMod.F90 to data_types/ColumnDataType.F90.

Otherwise last round of tests was BFB relative to 5559a578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants