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

Merge current e3sm-coupled code with e3sm-rebase-gcam6 #383

Open
wants to merge 73 commits into
base: e3sm-rebase-gcam6
Choose a base branch
from

Conversation

aldivi
Copy link
Collaborator

@aldivi aldivi commented Jan 31, 2024

This updates our current e3sm-gcam "main" branch (e3sm-rebase-gcam6) to the fully functioning code. The goal is to rename this "main" branch to "e3sm-integration" (after tagging and removing that one) and remove the extraneous branches.

aldivi and others added 30 commits April 7, 2023 11:39
This includes gcam spinup functionality to generate baseline and restart gcam files
(which have been generated and stored in the inputdata directory).
The gcam namelist has been updated and new defaults set that point
to the inputdata directory.
PFT to gcam land type has been updated.
land scalar calculation has been updated to deal with some bad input
data (this may need to be re-updated later when the inputs are updated).
Emissions downscaling has been updated to read in baseline data.
Some additional arguments were added to get namelist values.
GCAM runs annually with annual land scalar updates.
New xml inputs are used for GCAM6, but they have been updated to exclude
fuel wood harvest.
Reading and writing of scalars and baselines have been updated for CSV files
(this includes the baseline elm files for scalar creation).
The eigen library header has been included here and is pointed to by the e3sm
build scripts.
Also set a compiler option in E3SM to not run GCAM in paralled because the
libraries are not present.
Some additional diagnostics are output.
This isn't currently necessary and will likely be removed soon
Used the aData.set function because it is a value, but this
doesn't seem to work either. Strating to output other info to logs.
The runGCAM function now takes an E3SM restart state argument and
controls setDensity (which is no longer called separately). The call
order is changed such that if the run is a restart run (or branch)
GCAM needs to run to set up its current state, then the scalars
are updated, then the current period is run. If it is not a restart
run the scalars are just updated before GCAM is run.
This part of the code was modified to further constrain the scalar
values to avoid outliers. The outlier limit was decreased for the
gridded input data. Negative below ground scalars were set to zero.
This part of the code is mainly about updating the carbon scaling.
Constrained the scalars between 0.125 and 2. Relaxed the outlier
limit to the original 5.2 because this is sufficient and retains
5% more data points.
These untracked files need to be ignored so that they don't cause
issues with changing branches and such.
* FE_DIVBYZERO
* FE_OVERFLOW
* FE_INVALID

In addition some fixes to be able to compile GCAM standalone and turn on float exception by defining `E3SM_FLOAT_DEBUG`
The scaling values are now applied to carbon density in
addition to ag yields. Some names have changed to more
accurately reflect this. A new namelist item allows selection
of ag yield scaling separately from carbon density scaling.
Bug fix for GCAM region names with a space for setting values - the grid mapping
file for GCAM needs spaces, but the one for GLM cannot have spaces.
A new carbon density mapping was needed in order to select crop
technologies more specifically because IRR and RFD crops have different
carbon densities.
Dalei Hao and others added 24 commits October 2, 2023 10:02
…m-core into aldivi/gcam_gcam6_merge_co2

This was a selective merge that brought the CO2 downscaling code into the working code.
This was done by using: git merge --no-ff --no-commit <branch>
Files unaffected by the co2 code were retained as-is, merge conflicts were resolved in
other files, and a few files were brought in directly by auto-merge.
CO2 linearly downscaled grid values have been verified up to the point just prior
to being copied to the monthly arrays passed back to the fortran ehc. Restarts
also work properly. All base co2 data are now read in upon init, and the 2014
base grids are sclaed to 2015 base gcam global data. Annual scaling uses this
2015 grid as the reference (gcam scalars are also referenced to 2015). Aircraft,
international shipping, and other surface are downscaled separately. Base gridded data
have been updated accordingly, and a shell script has been added to gcam/tools
that generates the corresponding csv files (and their netcdf precurserors).The
convergence downscaling code has not been tested. GCAM still throws nan
floating point exceptions that the fortran code does not like. The boost
library has been added to the repo for portability.
Successfully runs for 1+ years with e3sm v2.1. Requires associated
giac and e3sm branches. This branch commit has been set in the parent
repos (i think).
…ore into aldivi/gcam_gcam6_merge_co2

This merges Dalei's quick bug fix with a cleaner version of this code.
This included removing the repo files and removing a boost submodule.
Boost is now available in a personal directory, but eventually
will be available on the machines. Eigen has been added as a submodule.
aldivi and others added 4 commits May 10, 2024 16:18
The land unit weights need to be summed within a region. A new mapping
file contains values that sum to 1 within a cell.
Was trying to access beyond end of array for copying ELM area.
Shut off SeetDataHelper_log and scaler_diagnostics.csv
Commented out some co2 diagnostics from coupleLog.
@aldivi
Copy link
Collaborator Author

aldivi commented Sep 12, 2024

@pralitp we have tested the current code in my branch on compy and chrysalis and are confident that gcam now works with debug=true. thank you.
So we are ready for this to be merged down into our "main" branch. From the original request above it looks like we planned to merge my current branch with e3sm-rebase-gcam6, and then delete the old e3sm-integration branch and rename the newly merged branch. I am happy to discuss this with you.

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.

3 participants