Skip to content

Conversation

@AndrewGraus
Copy link

@AndrewGraus AndrewGraus commented Jan 28, 2026

Contains the EcoSIM PK, and additional changes to CMake and header files. The EcoSIM PK replaces ATS surface balance and plant biogeochemistry with the models from EcoSIM.

An in-depth user guide with how to install ATS with the EcoSIM TPL, and integrate the surface balance into the PK can be found here:

https://docs.google.com/document/d/157D910Ubuyw7tgoaSrVJ66M5D8bBelwTVE9CC7pv1LM/edit?tab=t.0#heading=h.rnmw1ogza2ln

Corresponding Amanzi pull request for the EcoSIM TPL can be found here:

https://github.com/amanzi/amanzi/pull/945

Overview of coupling:

  1. EcoSIM PK - The purpose of this interface is to gather data from ATS state to report to EcoSIM on the state of the subsurface flow and energy. It also uses ATS to manage surface forcings including weather, radiation and phenology and package them for forcing EcoSIM as well.

  2. BGC Engine - modeled after Alquimia's chemistry engine, the idea is this is meant to be flexible to use with other BGC codes similar to Alquimia and geochemical codes.

  3. Contains data structures BGCProperties, BGCState, and BGCSizes which are constructed to be translatable between c++ and fortran90, modeled off the Alquimia data structures. The code related to these is stored in pks/ecosim/data.

  4. EcoSIM uses the subsurface properties and forcings from ATS to run its own submodules for surface and subsurface water and energy balance, and sums the resulting fluxes for water and energy in the surface/subsurface to transfer back to ATS, with these fluxes being passed to ATS flow and energy PKs as sources/sinks

  5. Processes controlled by EcoSIM:

  • snow accumulation and snow melt
  • surface radiation balance
  • root absorption
  • canopy transpiration
  • canopy interception (precipitation and radiation)
  1. In addition to passing aggregated fluxes, EcoSIM passes additional variables that are stored in ATS state. Some of these are stored for recall in between subsequent runs of EcoSIM within ATS or to restart, such as snow depth and canopy heat storage. Additionally, there are variables that are passed into ATS state to make use of ATS visualization and observation capabilities, such as evaporation flux components, transpiration, and snow temperature.

To Do:

  1. EcoSIM needs to be informed of the Hydraulic conductivity. Currently, this is done on the EcoSIM side, but because ATS is running the hydrology model it would be more self-consistent to use ATS. I attempted to write an evaluator, but it is broken.

  2. Vegetation type is not fully implemented and will need some tweaks. Eventually, EcoSIM will allow more than one vegetation type per column. Some decisions need to be made about how that data will be formatted, and then the coupling will be updated to reflect that.

  3. Transport - The EcoSIM PK can access concentrations and pass them to EcoSIM. However, EcoSIM's root nutrient absorption and biochemistry modules are not yet integrated, so transport has been removed from the PK tree for now.

  4. Microbe biochemistry - Integrate the modules related to microbe biochemistry. Once integrated they will provide additional source/sinks to transport and flow for water and nutrient uptake, and any chemistry changes.

  5. Full Plant Phenology - For now the phenology (LAI, vegetation type) needs to be input from data. However, EcoSIM has a full treatment of plant growth and phenology. The final step of the coupling will be to provide ATS access to this.

AndrewGraus and others added 26 commits July 24, 2025 20:53
Added runtime options for turning on Albedo modification and
prescribed phenology. Albedo modification appears to be working
but phenology currently needs more debugging.
This is an update to clean up some of the code and document the ATS side
better. Cleaned up some old templates and code related to Alquimia.
No actual code was modified.
Cleaned up the data structures, and condensed some of the
files as well.
This update adds several datasets to the ATS-EcoSIM datastructures
for carry over and analysis. This includes variables needed to
carry over canopy properties between timesteps, and place EcoSIM
fluxes into ATS's state for plotting purposes. The datesets are:

canopy longwave radiation
boundary latent heat flux
boundary sensible heat flux
canopy surface water
evapotranspiration
evaporation from bare ground
evaporation from litter
evaporation from snow
sublimation from snow

Note this update just makes the variables visible to ATS, but it
has not been linked to ATS state yet. There will be a similar
update on the EcoSIM side.
This adds datasets to ATS that hold the various components of the flux
including evaporation, transpiration, and snow temperature.
The versions should now be compatible. Some minor edits needed to be
made outside of the merge, due to capitalization changes of some
header files, and renaming of the requireAtCurrent/Next functions.

This code compiles, but currently is not running due to some
changes to transport in the input files.
This commit fixes the ATS-EcoSIM coupling to be
compatible with ATS 1.6. The major change post-
merge is concentrations are now accessed via
mole_fraction instead of total_component_concentration.
This commit contains alot of comment cleanup, and a first pass
at adding documentation to the header in the ATS style.
This is a fix for a bug I found in the area. Prior to this
the computation was done by length of the side which only
works for rectangular cells. Changed it to actually use the
area of the ATS column instead.
moved the ecosim_wrapper to the ecosim side, and deleted it from
the ATS side. I also removed some old testing files that are no
longer needed. The CMake files have also been changed to reflect
this.
The water content is in mols because we only currently need the
density to convert water content to m in EcoSIM it makes more
sense to just use the molar densitSwitching density to molar density
In prior versions of the coupler the ATS SEB PK was used. Now that
EcoSIM is doing the SEB we no longer need to use ATSs SEB PK.

However fully removing it requiured changing the initialization
so that the EcoSIM PK owns those variables. Additionally, transport
is access but not used currently. So I commneted out transport sections
until we actually need to test transport
Changed parameters for the EcoSIM PK parameter file to be
more consistent with capitalization.
This update changes the coupling data structures to replace
evapotranspiration with transpiration, and add an individual
key for the canopy evaporation component.

From now on total evapotranspiration should be done in ATS by
explicitly summing transpiration and evaporation components with
a custom evaluator.
The coupling interface has been updated to correctly add in rock density
to the data structures. Additionally all of the custom evaluators have
been modified. Bulk density and matric pressure have been removed as
the bulk density calculation is done in EcoSIM now, and the matric
pressure is substituted for capillary pressure.

For now hydraulic conductivity is still present, but not in use yet as I
try to decide on a final way to get hydraulic conductivity correct.
When building off Lijing's Sondgrass model I found an odd issue.
precipitation_rain was not being initialized correctly. Needed to add
the necesary evaluator calls for precipiation_rain. The question is why
did this work before?
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.

1 participant