-
Notifications
You must be signed in to change notification settings - Fork 150
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
cam6_3_118: Integrating HEMCO emissions component in CESM #560
cam6_3_118: Integrating HEMCO emissions component in CESM #560
Conversation
…om Haipeng Lin Feat: Implement HEMCO_CESM within CESM-GC (Initial attempt in syncing CAM sources) Feat: HEMCO_CESM code integration (full). Add mo_sim_dat and mo_tracname Fix: Call set_sim_dat from chemistry.F90 to pass solsym to HEMCO_CESM. Fix: Do not assign other variables within mo_sim_dat -- to discuss Fix: Comment out mo_sim_dat except solsym, expand solsym size to nTracersMax *This might not be needed after all as HEMCO_CESM now reads tracer names from chem_mods. But fixing this so it doesn't infinite loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does HEMCO need to be a configure/build option? Can it be a runtime option? Does HEMCO work when CAM is on an unstructured grid?
Hi @fvitt, thanks for the review. I'll update the code based on your comments.
HEMCO can be a runtime option. However, we need to make sure emissions are either handled by Of note is that GEOS-Chem chemistry only works with HEMCO (@lizziel), so there needs to be error-handling to ensure HEMCO is enabled when GEOS-Chem chemistry is used, as well.
Yes, tested with Regarding comments in review:
I will add a new HEMCO module to be included in chemistry for purposes of providing emissions to CAM-chem. The source changes would then be in I will commit updates to reflect this in a few days. Thanks! |
Thanks for your comments. I have updated the code to reflect requested changes. Code that is HEMCO-specific to retrieve emissions from the physics buffer are now in a separate module,
These replace Right now HEMCO-CESM is still implemented as a compile-time option. I can move it to a runtime option in the namelist in future commits if we want to go in this direction. |
- Changed C-preprocessor constants to positively match HEMCO_CESM - Fixed tabs indendation to spaces for consistency - Removed unnecessary HEMCO_CESM check in mo_srf_emissions.F90 - now same file as upstream - Added phase= dummy argument call for HCOI_Chunk_Run.
… allocating and updating pbuf fields for safety.
Thank you @fvitt for the comments and edits. I have updated the pull request with the corresponding updates. |
I've updated the PR with an additional update: The Defaults are provided for Additionally, the Thanks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more questions
Hi @fvitt, @cacraigucar, is there any way I can obtain the absolute path of There are two relevant lines in the HEMCO configuration file that need to be revised:
We can solve this by:
|
@jimmielin , It would be nice if there is a minimal set of HEMCO input files for CAM-Chem that can be easily downloaded to other machines. The data volume under |
Thanks @fvitt, I can work on this now. Just to confirm:
If I set Then it should be easy for me to make HEMCO_CESM provide that to HEMCO instead. I'll add two namelist variables,
We've explored this idea before but didn't go through. I will look at some reasonable defaults for the compsets we added. Probably still need a few years worth of data, hopefully a within a few GBs. |
Correct. For an example see |
Thanks @fvitt, I have added these features into HEMCO-CESM and updated the external version to
I think these old files can also be deleted now:
So we just keep
Thanks! |
Sorry for the late question but I've been wondering if all this work has to be done at run time. |
Hi @gold2718, thanks for the comment - that is a great idea and something we want to move towards. However it's probably not feasible at the moment. The current infrastructure for HEMCO to identify necessary files for the run is a "dry-run" option which will go through all the time steps and simulate the read of files (only checking if they exist) and printing out a list of present/not present. But this currently relies on the GEOS-Chem model to drive this and there's no lightweight version of this program. We could also parse the configuration file directly, but it would take time to develop, and we have plans to move to YAML or other open formats in the future, so we don't want to develop this for the current config file format which will be superseded soon. So definitely in the future we want to integrate into |
@jimmielin I am getting the follow error from check_input_data in my latest CAM-CHEM-HEMCO tests:
Any ideas? |
@fvitt, I think this error is due to including the attribute |
Hi @brian-eaton, would |
Hi @fvitt, may I ask if this definition look correct for specifying this as a relative path to inputdata? It looks like
|
@jimmielin and @brian-eaton |
@fvitt, you're right. I forgot how the variables that specify a root filepath work. |
@jimmielin @lkemmons @cacraigucar |
I have no objections.
…On Mon, Jul 10, 2023 at 8:24 AM Francis Vitt ***@***.***> wrote:
@jimmielin <https://github.com/jimmielin> @lkemmons
<https://github.com/lkemmons> @cacraigucar
<https://github.com/cacraigucar>
If there are no objections I would like to move forward with merging this
into cam_development with the understanding that HEMCO will not supported
until the restart/reproducibility issues are resolved.
—
Reply to this email directly, view it on GitHub
<#560 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH5BH7NXT5ECW67VPEY2D43XPQGBRANCNFSM5STEFIPA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks @fvitt! I have no objections as well. I am working on the restart/reproducibility issues (waiting for some patches from upstream GEOS-Chem/HEMCO) and will soon create a minimal set of input data that can be distributed and works with the provided compsets out of the box. |
Merge pull request ESCOMP#560 from CESM-GC/HEMCO-CESM_rebased_on_cam6_3_045 cam6_3_118: Integrating HEMCO emissions component in CESM ESCOMP commit: 69c5b1c
Merge pull request ESCOMP#560 from CESM-GC/HEMCO-CESM_rebased_on_cam6_3_045 cam6_3_118: Integrating HEMCO emissions component in CESM ESCOMP commit: 69c5b1c
Merge pull request ESCOMP#560 from CESM-GC/HEMCO-CESM_rebased_on_cam6_3_045 cam6_3_118: Integrating HEMCO emissions component in CESM ESCOMP commit: 69c5b1c
Merge pull request ESCOMP#560 from CESM-GC/HEMCO-CESM_rebased_on_cam6_3_045 cam6_3_118: Integrating HEMCO emissions component in CESM ESCOMP commit: 69c5b1c
Please refer to companion issue: #504 for previous discussion.
An updated copy of the code description plus compile and run instructions is written below:
Intro
HEMCO is a versatile emissions and data component with the primary purpose of processing emissions data online with inventory selection, masking, and scaling functionality performed as described by a configuration file (see Lin et al., 2021 Figure 2). Emissions data is ingested from individual netCDF files of different inventories and combined into a collection of 3-D emissions containers for each chemical species. HEMCO also is capable of processing generic data containers that are used to provide data (e.g., UV albedo) for GEOS-Chem chemistry within CESM (working PR: #484).
Motivation to implement HEMCO as an online emissions data source is to remove the need for re-processing offline emission datasets for simulations, instead allowing users to select on-the-fly emission inventories to use, their hierarchy/precedence and effective geographical region, and apply scale factors on-line. The original netCDF input data does not need to be modified, sub-setting and regridding are performed by HEMCO automatically to the target simulation domain.
In its current implementation, HEMCO within CESM can provide emissions and data to GEOS-Chem chemistry (#484) and CAM-chem chemistry.
High level code description
The HEMCO-to-CESM interface (
HEMCO_CESM
) has been implemented as a module within CAM residing undersrc/hemco
. The most recent version of the code is available at: https://github.com/jimmielin/HEMCO_CESM but will eventually be hosted underESCOMP/HEMCO_CESM
. It includes:hemco_interface
) designed to be called fromcontrol/cam_comp.F90
, andhco_cam_exports
) designed to export data from the HEMCO interface.HEMCO in CESM runs on its own separate grid and MPI decomposition (as initialized by
hco_esmf_grid
), currently limited to a rectilinear latitude-longitude grid (see limitations), and regrids its computed data to the CAM grid as described bycam_physics_mesh
in recent versions of CAM.3-D emissions can be computed. ESMF regridding is layer-by-layer, and vertical regridding is only performed when files are read into
HEMCO_CESM
.Emissions and data computed are written into the CAM physics buffer (prefixed by
HCO_
) and retrieved by whatever component within CAM that requires this data.The version of code submitted as pull request here does not have any GEOS-Chem dependencies and can be considered independently of the #484 PR for GEOS-Chem chemistry.
Requirements
Apart from the main HEMCO source code, the following things are required:
USE_ESMF_LIB=true
is required for compile andenv_mach_specific.xml
needs to point to an ESMF version supporting netCDF I/O (ncdfio
and notdefio
). This may be the default already in recent versions of CAM.Limitations and points of discussion
Build instructions
Building instructions for a test case with CAM-chem support:
master
Externals.cfg
to source from testing branch, based offcam_development
(as of now,cam6_3_095
)./manage_externals/checkout_externals
cd cime/scripts
./create_newcase --case ~/hemco_dev_202201 --compset FCSD_HCO --res f09_f09_mg17 --run-unsupported --mach cheyenne --project project_number_here
(change--case
and--project
as appropriate). HEMCO compsets ending in_HCO
for common chemistry compsets have been implemented. These add%HEMCO
to the compset long name../case.setup
and./case.build
ext_frc_specifier
,srf_emis_specifier
in the atm namelist; they will be ignored ifHEMCO_CESM
is enabled, but emptying it will allow the pre-run phase to skip detection of these files../case.submit
)Notes
_HCO
and long name equivalent%HEMCO
.USE_ESMF_LIB=true
)use_hemco = .true.
in the physics control namelist.End notes and implementation roadmap
Target branch has been rebased over
cam6_3_095
, the latestcam_development
as of March 7 2023. Changes include:use_hemco
in phys control namelist to control HEMCO routine at runtime._HCO
compsets for common chemistry compsets, adding%HEMCO
to compset long name. This long name triggers the-hemco
configure option used to set up namelist entries for HEMCO, but these namelist entries can also be added in the future.hemco
external (insrc/hemco
) and of course theHEMCO
external (insrc/hemco/HEMCO
) containing shared HEMCO code by all models.We suggest implementing HEMCO within CESM in phases, first bringing HEMCO into CESM so GEOS-Chem can be operational, then implementing a transitional period for CAM-chem users to possibly use HEMCO, finally moving all CAM-chem compsets to full HEMCO usage.
Thank you for your help and please do not hesitate to provide any feedback.