-
Notifications
You must be signed in to change notification settings - Fork 168
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
Add fire blending to GOCART #2883
base: develop
Are you sure you want to change the base?
Changes from 12 commits
c8e6344
4d81cb8
5f86abd
62dbf31
ae3f599
16e21bd
b22d7bc
9965857
5b57604
1f95b2b
eb8bc78
9a9a874
3b87649
21d7bad
58e7280
f74f471
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,38 @@ | |
|
||
########## config.prep_emissions ########## | ||
# aerosol emissions preprocessing specific | ||
# TODO: this is duplicated in the config.aero file. Should use a common function | ||
case ${machine} in | ||
"HERA") | ||
AERO_INPUTS_DIR="/scratch1/NCEPDEV/global/glopara/data/gocart_emissions" | ||
;; | ||
"ORION" | "HERCULES") | ||
AERO_INPUTS_DIR="/work2/noaa/global/wkolczyn/noscrub/global-workflow/gocart_emissions" | ||
;; | ||
"S4") | ||
AERO_INPUTS_DIR="/data/prod/glopara/gocart_emissions" | ||
;; | ||
"WCOSS2") | ||
AERO_INPUTS_DIR="/lfs/h2/emc/global/noscrub/emc.global/data/gocart_emissions" | ||
;; | ||
"GAEA") | ||
AERO_INPUTS_DIR="/gpfs/f5/epic/proj-shared/global/glopara/data/gocart_emissions" | ||
;; | ||
"JET") | ||
AERO_INPUTS_DIR="/lfs4/HFIP/hfv3gfs/glopara/data/gocart_emissions" | ||
;; | ||
*) | ||
echo "FATAL ERROR: Machine ${machine} unsupported for aerosols" | ||
exit 2 | ||
;; | ||
esac | ||
export AERO_INPUTS_DIR | ||
|
||
echo "BEGIN: config.prep_emissions" | ||
|
||
# Get task specific resources | ||
export STARTHOUR=${STARTHOUR:-00} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not put |
||
export PREP_EMISSION_CONFIG="${PARMgfs}/prep/aero_emissions.yaml" | ||
source "${EXPDIR}/config.resources" prep_emissions | ||
|
||
echo "END: config.prep_emissions" |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||
aero_emissions: | ||||||
config: | ||||||
debug: False | ||||||
ratio: 0.95 # weighting ratio | ||||||
emistype: 'QFED' # EMission Type, Valid answers: 'QFED, GBBEPx, HFED' | ||||||
climfile_str: 'GBBEPx-all01GRID_v4r0_climMean' # climate file base string used for glob later | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this |
||||||
GBBEPx_version: 'v4r0' # gbbepx version | ||||||
qfed_version: '006' # qfed version | ||||||
species: [ 'so2','oc','bc' ] # species to be used | ||||||
historical: False # set to true to just use true data for the given day | ||||||
data: | ||||||
bbakernoaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
mkdir: | ||||||
- "{{ DATA }}" | ||||||
- "{{ COMOUT_CHEM_HISTORY}}" | ||||||
copy: | ||||||
- ["{{ AERO_INPUTS_DIR }}/nexus/QFED/{{ current_cycle | strftime('%Y/%m') }}/qfed2.emis_oc.006.{{ current_cycle | strftime('%Y%m%d') }}.nc4", "{{ DATA }}/"] | ||||||
bbakernoaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- ["{{ AERO_INPUTS_DIR }}/nexus/QFED/{{ current_cycle | strftime('%Y/%m') }}/qfed2.emis_so2.006.{{ current_cycle | strftime('%Y%m%d') }}.nc4", "{{ DATA }}/"] | ||||||
bbakernoaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- ["{{ AERO_INPUTS_DIR }}/nexus/QFED/{{ current_cycle | strftime('%Y/%m') }}/qfed2.emis_bc.006.{{ current_cycle | strftime('%Y%m%d') }}.nc4", "{{ DATA }}/"] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
{% for fdate in forecast_dates %} | ||||||
- ["{{ AERO_INPUTS_DIR }}/nexus/GBBEPx/v4/climMean/GBBEPx-all01GRID_v4r0_climMean_{{ fdate | strftime('%m%d') }}.nc", "{{ DATA }}/"] # copy climo files | ||||||
{% endfor %} | ||||||
data_out: | ||||||
copy: | ||||||
- ["{{ DATA }}/gefs_blended_emissions.{{ current_cycle | strftime('%Y%m%d') }}.nc", "{{ COMOUT_CHEM_HISTORY }}/{{ RUN }}.{{ current_cycle | strftime('%Y%m%d') }}.gefs_blended_emissions.nc"] | ||||||
bbakernoaa marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#====== BIOMASS BURNING EMISSIONS ======================================= | ||
|
||
# HFED | ||
#-------------------------------------------------------------------------------------------------------------------------------- | ||
SU_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 0.7778 biomass ExtData/nexus/HFED/Y1994/M%m2/hfed.emis_so2.x576_y361.%y4%m2.nc4 | ||
OC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 0.7778 biomass ExtData/nexus/HFED/Y1994/M%m2/hfed.emis_oc.x576_y361.%y4%m2.nc4 | ||
BC_BIOMASS NA N Y %y4-%m2-%d2t12:00:00 none 0.7778 biomass ExtData/nexus/HFED/Y1994/M%m2/hfed.emis_bc.x576_y361.%y4%m2.nc4 | ||
# EMI_NH3_BB NA N Y %y4-%m2-%d2t12:00:00 none 0.7778 biomass ExtData/nexus/HFED/Y1994/M%m2/hfed.emis_nh3.x576_y361.%y4%m2.nc4 | ||
Comment on lines
+1
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should be linked from UFS and not added in the global-workflow. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
# exglobal_prep_emissions.py | ||
# This script creates a emissions object | ||
# which perform the pre-processing for aerosol emissions | ||
""" | ||
This script initializes a logger, reads configuration from the environment, and performs emissions pre-processing tasks using the AerosolEmissions class. | ||
|
||
The script does the following: | ||
1. Initializes a root logger with the specified logging level and colored log output. | ||
2. Reads configuration from the environment and converts it into a Python dictionary. | ||
3. Instantiates an AerosolEmissions object with the configuration. | ||
4. Retrieves specific keys from the emissions task configuration and stores them in a dictionary. | ||
5. Sets the 'emistype' attribute in the configuration dictionary based on the 'emistype' value in the emissions configuration. | ||
6. Initializes, configures, runs, and finalizes the emissions task using the provided parameters. | ||
|
||
Note: Make sure to have the necessary dependencies (wxflow, pygfs) installed to run this script successfully. | ||
""" | ||
import os | ||
|
||
from wxflow import Logger, cast_strdict_as_dtypedict | ||
from wxflow import Logger, AttrDict, cast_strdict_as_dtypedict | ||
from pygfs import AerosolEmissions | ||
|
||
|
||
|
@@ -19,7 +29,17 @@ | |
|
||
# Instantiate the emissions pre-processing task | ||
emissions = AerosolEmissions(config) | ||
emissions.initialize() | ||
emissions.configure() | ||
emissions.execute(emissions.task_config.DATA, emissions.task_config.APRUN) | ||
emissions.finalize() | ||
|
||
# get local keys for configuration | ||
keys = ['DATA', 'forecast_dates', 'cdate', 'aero_emission_yaml'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have removed instances of |
||
edict = AttrDict() | ||
for key in keys: | ||
edict[key] = emissions.task_config[key] | ||
edict['CONFIG'] = edict.aero_emission_yaml.aero_emissions['config'] | ||
edict.aero_emission_yaml['emistype'] = edict['CONFIG'].emistype | ||
|
||
# print(aero_emission_yaml.aero_emissions['fix_data']) | ||
emissions.initialize(edict.aero_emission_yaml) | ||
emissions.configure(edict.aero_emission_yaml) | ||
emissions.run(workdir=edict.DATA, current_date=edict.cdate, forecast_dates=edict.forecast_dates, Config_dict=edict.CONFIG) | ||
emissions.finalize(edict['CONFIG']) |
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 think we can/shouldplace
AERO_INPUTS_DIR
inworkflow/hosts/<machine>.yaml
and then here, replace this section with:Repeat the same in
config.aero
.What do you think @WalterKolczynski-NOAA ?
ps. this can be done in a follow-up PR.