-
Notifications
You must be signed in to change notification settings - Fork 202
GCAFS prep emissions update - fire emissions #3713
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
base: develop
Are you sure you want to change the base?
GCAFS prep emissions update - fire emissions #3713
Conversation
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.
Pull Request Overview
This pull request updates aerosol configuration and emissions handling for the UFS-Aerosols system by consolidating file management and enhancing modularity. Key changes include:
- Removing legacy logic for generating the AERO_ExtData.rc file and consolidating emission configuration files.
- Adding a link to chemical input files in forecast_predet.sh and updating configuration templates in both aerosol and chemical configuration files.
- Refactoring configuration files to improve clarity and maintainability.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
ush/parsing_namelists_GOCART.sh | Removed legacy dynamic generation of AERO_ExtData.rc. |
ush/forecast_predet.sh | Added linking for CHEM_INPUT to ensure chemical input file availability. |
parm/ufs/gocart/ExtData.* | Removed obsolete emission configuration files, consolidating them into AERO_ExtData.rc. |
parm/ufs/gocart/AERO_ExtData.rc | Updated emission entries to use chemical input paths and adjusted emission factors. |
parm/chem/chem_emission.yaml.j2 | Updated templating loops for QFED variables and file copying operations. |
dev/parm/config/gfs/config.com | Added new chemical template paths. |
dev/parm/config/gcafs/config.aero.j2 | Reorganized aerosol sections and introduced new aerosol emission settings. |
2e06fb3
to
b534a8b
Compare
@aerorahul @DavidHuber-NOAA can we please get this reviewed. It's important for the GCAFS implementation |
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.
I have tested an earlier incarnation of this in NRT for several weeks, I think this is good to go for final review and testing
export AERO_EMIS_FIRE_HIST=1 # Use historical fire emissions | 1 = true 0 = false | ||
|
||
# Flag to enable historical (climatological) fire emissions instead of NRT for testing/spin-up. | ||
# When true, uses fixed-year data; false uses real-time from FIRE_EMIS_NRT_DIR. | ||
# Path to near-real-time (NRT) fire emissions data, updated daily (e.g., from satellites like MODIS). | ||
# On WCOSS2, points to DCOM (Data Communication) root for operational runs; empty for testing. | ||
# Processed by scripts like exglobal_prep_emissions.py to generate input files for GOCART. |
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.
Similarly prefer documentation above the actual variable. Many thanks for the highly detailed documentation, by the way!
Co-authored-by: David Huber <[email protected]>
Co-authored-by: David Huber <[email protected]>
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.
Some additional suggestions.
${NLN} "${COMIN_CHEM_INPUT}" "${DATA}/ChemInput" | ||
# Create the ChemInput directory in the local run directory | ||
|
||
# if [[ ! -d "${DATA}/ChemInput" ]]; then mkdir -p "${DATA}/ChemInput"; fi |
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.
@bbakernoaa we should use cpreq
here. Linking from COMIN is not allowed (at least not yet) by EE2 standards and we shouldn't be linking whole directories. I'm OK with adding a TODO here if you will create a follow-up issue to tackle this.
if not isinstance(dates, list): | ||
dates = [dates] |
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.
Note to self: I think this should be made a helper function in wxflow
:
def make_list(variable):
if isinstance(variable, list):
return variable
else:
return [variable]
|
||
except Exception as e: | ||
logger.error(f"Error combining QFED files: {e}") | ||
import traceback |
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.
Please move this to the top of the file.
emis_file_dir = aero_emis_fire_dir | ||
if not os.path.exists(emis_file_dir): | ||
logger.warning(f"Directory does not exist: {emis_file_dir}") | ||
continue |
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.
Since aero_emis_fire_dir
is an input to this function, this will just continuously produce warnings for each month. This should probably be moved above the for
loop and cause a return of an empty list.
files_found = [] | ||
# Find all possible files | ||
for mon in months: | ||
try: |
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.
Similarly, this try
should be removed.
from collections import defaultdict | ||
from datetime import timedelta |
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.
Please move these to the top of the file and/or consolidate them with what is already at the top.
Co-authored-by: David Huber <[email protected]>
Co-authored-by: David Huber <[email protected]>
Co-authored-by: David Huber <[email protected]>
Co-authored-by: David Huber <[email protected]>
Description
This pull request introduces significant updates to the aerosol configuration and emission handling in the UFS-Aerosols system, streamlining file management, improving modularity, and consolidating configuration files. Key changes include restructuring aerosol configuration files, enhancing biomass burning emissions handling, and updating the chemical input file linking process.
Aerosol Configuration Updates:
config.aero.j2
to organize settings into distinct sections for aerosol and emission configurations, including the addition of new variables likeAERO_EMIS_FIRE_VERSION
andAERO_EMIS_FIRE_HIST
. [1] [2]Emission Data Management:
ExtData.gbbepx
,ExtData.qfed
, andExtData.none
) into a single file,AERO_ExtData.rc
, for better modularity and maintainability. Removed redundant and unused emission entries. [1] [2] [3] [4]Chemical Input File Handling:
CHEM_INPUT
) inforecast_predet.sh
to ensure proper file availability during runtime.Removal of Legacy Code:
AERO_ExtData.rc
inparsing_namelists_GOCART.sh
, as the new consolidated configuration file eliminates the need for dynamic generation.Additional Updates:
config.com
to include new template paths for chemical restart and input files, improving file organization.Type of change
Change characteristics
How has this been tested?
Checklist