HEMCO examples
On this page we shall provide examples of how you can customize your settings for the HEMCO emissions component. Please also see the The HEMCO User's Guide for more information.
Contents
Scale factor examples
Scaling emissions to a particular year
Becky Alexander wrote:
- I'm trying to figure out how to scale annual anthropogenic emissions to a particular year in HEMCO. My goal is to investigate the role of transport versus emissions changes in the Arctic ice core record of aerosols (mainly sulfate). I will be running the off-line aerosol version.
- I want to run for select years from 1979 - 2006 using annual anthropogenic scale factors that match the met field year (i.e., run with 1985 meteorology and with emissions scaled to 1985). this should be pretty standard.
- Then I want to run one particular year of met fields (e.g., 2000) repeatedly but using anthropogenic scale factors for various years (e.g., 1985-2006). In other words, the year of the met fields and scaling won't always match.
Christoph Keller replied: ,
- If I understand you correctly, you want to do two things:
- Run a standard simulation from 1979 to 2006 with emission being scaled to the respective simulation year. This is the default behavior and you don’t need to change anything.
- Run a simulation for year 2000 with emissions being scaled to other years, say 1995. This can be done by fixing the annual scale factors to the year of interest. For example, if you want to have your emissions scaled to 1995, you could change the scale factors as follows:
original: 1 TOTFUEL_THISYR $ROOT/AnnualScalar/v2014-07/AnnualScalar.geos.1x1.nc NOxscalar 1985-2010/1/1/0 C xy 1 1 new: 1 TOTFUEL_THISYR $ROOT/AnnualScalar/v2014-07/AnnualScalar.geos.1x1.nc NOxscalar 1995/1/1/0 C xy 1 1
- This tells HEMCO to use year 1995 for scale factor TOTFUEL_THISYR, no matter of the simulation year. You would need to do this for all annual scale factors.
Update in v1.1.006
As of HEMCO v1.1.006, the emission date can be set in the settings section of the HEMCO configuration file. For example, to fix emissions to year 1995 just add the following line to the settings section:
Emission year : 1995
The simulation month, day and hour can be set in the same manner. Any variable not set in the HEMCO configuration file is taken from the model simulation time.
--Bob Y. (talk) 15:15, 11 June 2015 (UTC)
Scale emissions by country
HEMCO has the ability to define country-specific scale factors. To utilize this feature, you must first specify a mask file in the HEMCO_Config.rc file, in the NON-EMISSIONS DATA section. For example:
#============================================================================== # --- Country mask file --- #============================================================================== * COUNTRY_MASK $ROOT/MASKS/v2014-07/countrymask_0.1x0.1.nc CountryID 2000/1/1/0 C xy count * - 1 1
The mask file specified above was created from a shapefile obtained from the GADM database. The country mask netCDF file identifies countries by their ISO 3166-1 numeric code. Countries and their ISO3166-1-numeric codes are listed in the $ROOT/MASKS/v2014-07/country_codes.csv file.
The country-specific scale factors can be specified in a separate ASCII file ending with with the suffix '.txt.' The container name of the mask file (e.g. COUNTRY_MASK) must be given in the first line of the file. The following lines define the country-specific scale factors. ID 0 is reserved for the default values that are applied to all countries with no specific values listed. An example scalefactor.txt file is provided below:
# Country mask field name COUNTRY_MASK # Country data # Name | ID | Scale factor DEFAULT 0 1.0 CHINA 156 0.95 INDIA 356 1.10
The scale factor(s) listed are interpreted by HEMCO the same way as other scale factors. Multiple values separated by / are interpreted as temporally changing values: 7 values = Sun, Mon, ..., Sat; 12 values = Jan, Feb, ..., Dec; 24 values = 12am, 1am, ..., 11pm (local time!).
The country-specific scale factors would then be defined in the HEMCO_Config.rc file as as:
501 SCALE_COUNTRY [PATH_TO_FILE]/scalefactor.txt - - - xy unitless 1
The scale factors can the be applied to the emission field(s) that you wish to scale. For example:
0 MIX_NO_IND $ROOT/MIX/v2015-03/MIX_Asia_NO.generic.025x025.nc NO_INDUSTRY 2008-2010/1-12/1/0 C xy kg/m2/s NO 1/27/25/1006/501 1/2 45
These steps can also be used to scale emissions for different regions (e.g. provinces, states) by providing HEMCO with a mask file containing the regions to be scaled.
--Melissa Sulprizio (talk) 18:05, 27 June 2016 (UTC)
Scale summertime soil NOx emissions over the US
As of HEMCO v1.1.006, it is possible to pass uniform and/or spatiotemporal scale factors to some of the extensions, including soil NOx extension. For instance, suppose you want to cut summertime soil NOx emissions over the US by a factor of 2. This can be done by assigning a scale field (here, `SOILNOX_SCALE`) to the soilNOx NO emission field in section Extension Switches of your HEMCO configuration file:
104 SoilNOx : on NO --> Use fertilizer NOx: true --> ScaleField_NO : SOILNOX_SCALE
Field SOILNOX_SCALE needs to be defined in section base emissions of the configuration file. It makes most sense to add it to the fields used by the SoilNOx extension:
... 104 SOILNOX_ARID $ROOT/SOILNOX/v2014-07/soilNOx.climate.generic.05x05.nc ARID 2000/1/1/0 C xy unitless NO - 1 1 104 SOILNOX_NONARID $ROOT/SOILNOX/v2014-07/soilNOx.climate.generic.05x05.nc NON_ARID 2000/1/1/0 C xy unitless NO - 1 1 104 SOILNOX_SCALE 1.0 - 2000/1/1/0 C xy unitless * 333 1 1
SOILNOX_SCALE is just a dummy scale factor with a global, uniform value of 1.0. The actual temporal scaling over the US is done via scale factor 333 assigned to this field. This approach ensures that all soil NOx emissions outside of the US remain intact.
The next step is to define scale factor Nr. 333 (named `SOILNOX_SCALE`) in the scale factor section of the configuration file:
# Scale factor to scale US soil NOx emissions by a factor of 0.5 in month June-August. 333 SOILNOX_SCALE 1.0/1.0/1.0/1.0/1.0/0.5/0.5/0.5/1.0/1.0/1.0/1.0 - 2000/1-12/1/0 - xy 1 1 5000
Scale factor SOILNOX_SCALE defines a monthly varying scale factor, with all scale factors being 1.0 except for months June-August, where the scale factor becomes 0.5. The last column of the SOILNOX_SCALE entry assigns mask Nr. 5000 to this scale factor. This ensures that the scale factor will only be applied over the region spanned by mask 5000. This musk mast be defined in section masks of the HEMCO configuration file:
1005 USA_MASK $ROOT/MASKS/v2014-07/usa.mask.nei2005.geos.1x1.nc MASK 2000/1/1/0 C xy unitless 1 -165/10/-40/90 5000 SOILNOX_MASK -106.3/37.0/-93.8/49.0 - - - xy 1 1 -106.3/37.0/-93.8/49.0
In this example, mask 5000 is defined as the region between 106.3 - 93.8 degrees west and 37.0 - 49.0 degrees north. If you want to apply the soil NOx scaling over the entire US, you can also just refer to the existing USA mask, e.g.:
# Scale factor to scale US soil NOx emissions by a factor of 0.5 in month June-August. 333 SOILNOX_SCALE 1.0/1.0/1.0/1.0/1.0/0.5/0.5/0.5/1.0/1.0/1.0/1.0 - 2000/1-12/1/0 - xy 1 1 1005
Using the HEMCO built-in diagnostics framework
The HEMCO diagnostics framework lets user define customized diagnostics. All diagnostic definitions need be provided in an external diagnostics definition file, typically called DiagnFile.rc. The diagnostics file name is defined in the settings section of the HEMCO configuration file, together with the diagnostics file name and the diagnostics output frequency. For instance, the following entry tells HEMCO to read diagnostics definitions from file MyDiagnFile.rc and write hourly diagnostics into files Diagnostics.YYYYMMDDhhmmss.nc (the date will be appended to the diagnostics prefix by HEMCO:
DiagnFile : MyDiagnFile.rc DiagnPrefix : Diagnostics DiagnFreq : Hourly
All emissions to be written into the diagnostics can now be defined in file MyDiagnFile.rc. For example, the following entires would tell HEMCO to write out total vertical integrated NO emissions (into field NO_TOTAL), 3D field of lightning NO emissions (extension Nr 103, into field NO_LIGHTNING), 2D field of soil NO emissions in kg per grid box (extension 104, into NO_SOIL), total anthropogenic NO emissions (emission category 1, into NO_ANTHRO), and anthropogenic NO emissions from NEI11 (category 1, hierarchy 50, into NO_NEI11):
# Name Spec ExtNr Cat Hier Dim OutUnit NO_TOTAL NO -1 -1 -1 2 kg/m2/s NO_LIGHTNING NO 103 -1 -1 3 kg/m2/s NO_SOIL NO 104 -1 -1 2 kg NO_ANTHRO NO 0 1 -1 2 kg/m2/s NO_NEI11 NO 0 1 50 2 kg/m2/s
Provide meteorological data for extensions to HEMCO standalone model
When running the HEMCO standalone model, the meteorological fields needed by some of the HEMCO extensions need be provided through the HEMCO configuration file. For example, to read all met fields needed by the sea salt aerosol emissions extension from the GEOS-FP meteorological fields, the following lines need be added to section base emissions of the HEMCO configuration file:
- Met fields for stand-alone use
* WLI /GEOS_FP/$YYYY/$MM/GEOSFP.$YYYY$MM$DD.A1.2x25.nc LWI 2011-2014/1-12/1-31/0-23 C xy count * - 1 1 * ALBD /GEOS_FP/$YYYY/$MM/GEOSFP.$YYYY$MM$DD.A1.2x25.nc ALBEDO 2011-2014/1-12/1-31/0-23 C xy 1 * - 1 1 * TSKIN /GEOS_FP/$YYYY/$MM/GEOSFP.$YYYY$MM$DD.A1.2x25.nc TS 2011-2014/1-12/1-31/0-23 C xy 1 * - 1 1 * U10M /GEOS_FP/$YYYY/$MM/GEOSFP.$YYYY$MM$DD.A1.2x25.nc U10M 2011-2014/1-12/1-31/0-23 C xy 1 * - 1 1 * V10M /GEOS_FP/$YYYY/$MM/GEOSFP.$YYYY$MM$DD.A1.2x25.nc V10M 2011-2014/1-12/1-31/0-23 C xy 1 * - 1 1
where /GEOS_FP/$YYYY/$MM/GEOSFP.$YYYY$MM$DD.A1.2x25.nc is the path and filename of the GEOS-FP file.
The met field variables listed in the HEMCO configuration file can also be scaled by user-specific scale factors. For example, to test the sensitivity of sea salt aerosol emissions on an increase of horizontal wind speed (U10M) by a factor of 2.0, a corresponding scale factor can be applied to field U10M:
* U10M /GEOS_FP/$YYYY/$MM/GEOSFP.$YYYY$MM$DD.A1.2x25.nc U10M 2011-2014/1-12/1-31/0-23 C xy 1 * 1 1 1 … ############################################################################### BEGIN SECTION SCALE FACTORS ############################################################################### # ScalID Name sourceFile sourceVar sourceTime C/R/E SrcDim SrcUnit Oper 1 U10M_SCALE 2.0 - - - - 1 1
This will then apply a factor of 2.0 to field U10M. It is further possible to add a mask to the scale factor field, so that the given scale factor is only evaluated over the mask region. For example, to apply the scale factor of 2.0 only over a region spanning 170W – 130W and 20N to 50N, a corresponding mask can be applied to scale factor U10M_SCALE:
1 U10M_SCALE 2.0 - - - - 1 1 1002 ############################################################################### BEGIN SECTION MASKS ############################################################################### # # ScalID Name sourceFile sourceVar sourceTime C/R/E SrcDim SrcUnit Oper Lon1/Lat1/Lon2/Lat2 1002 U10M_SCALE_MASK -170/20/-130/50 - - - - 1 1 -170/20/-130/50
This would then tell HEMCO to use scale factor U10M_SCALE only over the given mask region (unscaled values will be used everywhere else).
Passive tracers
The passive tracer module allows you to run a suite of passive tracers alongside any simulation, i.e. it works with all simulation types. To use the passive tracers follow these steps:
1. Include passive tracers in the advected species menu in input.geos. For example, to add two passive tracers (PTR1 and PTR2) to the standard simulation:
%%% ADVECTED SPECIES MENU %%%: Type of simulation : 3 Number of Advected Spec.: 70 Species Entries ———>: Name Species #1 : NO … Species #69 : PTR1 Species #79 : PTR2
2. Create a passive tracers menu in input.geos where you define the basic properties of the passive tracers. For each passive tracer you must define the molecular weight (g/mol), atmospheric lifetime (s), and default initial concentration (v/v). For example, to give species PTR1 (PTR2) a MW of 50 (250.0) g/mol, an atmospheric lifetime of one hour (3.8 days), and a default initial background concentration of 1 ppt (1ppb):
------------------------+------------------------------------------------------ %%% PASSIVE TRACERS %%% : Number of pass. tracers : 2 Passive tracer #1 : PTR1 50.0 3600.0 1.0e-12 Passive tracer #2 : PTR2 250.0 328320.0 1.0e-09
The passive tracers menu can be added anywhere in input.geos. The default initial background concentration is only used if the passive tracers are not included in the restart file.
3. Assign emissions to passive tracers in HEMCO_Config.rc. You can omit this step in which case there will be no sources for your passive tracers. For instance, to define a uniform flux of 1e-3 and 1e-9 kg/m2/s for PTR1 and PTR2, respectively, add the following two lines to the base emissions section (in HEMCO_Config.rc):
0 PTR1_Flux 1.0e-3 - - - xy kg/m2/s PTR1 - 1 1 0 PTR2_Flux 1.0e-9 - - - xy kg/m2/s PTR2 - 1 1
There is no default diagnostics for these emissions but you can easily define a HEMCO diagnostics for each passive tracer by creating a corresponding entry in the HEMCO diagnostics file (HEMCO_diagn.rc):
# Name Spec ExtNr Cat Hier Dim Unit PTR1_TOTAL PTR1 -1 -1 -1 2 kg/m2/s PTR2_TOTAL PTR2 -1 -1 -1 2 kg/m2/s
To activate these diagnostics you need to link to the HEMCO diagnostics file in HEMCO_Config.rc, as well as define the diagnostics output frequency (in the settings section of the HEMCO configuration file). For example to write the diagnostics at 30-minute intervals:
DiagnFile: HEMCO_Diagn.rc DiagnFreq: 00000000 003000
Tagged tracer examples
Using masks to create emissions for geographically tagged tracers
Doug Finch wrote:
- I was planning on making a sort of 'tagged' CH4 run. I know the model already allows for tagging of emissions from different emissions types (wetland etc) but is there a way to do this geographically? I was planning on doing something similar to the tagged CO run but after a quick look at the code it looks like it won't be that simple. Do you have any advice for setting this up?
Bob Yantosca replied:
- For the tagged CH4 run, it should be pretty easy to set up. You can just use masks that are defined in the HEMCO config file. If the masks are square regions you can just define them in the HEMCO file like this, in the MASKS section:
#============================================================================== # Country/region masks #============================================================================== 1001 MASK_1 -30/30/45/70 - 2000/1/1/0 C xy 1 1 -30/30/45/70 1002 MASK_2 -118/17/-95/33 - 2000/1/1/0 C xy 1 1 -118/17/-95/33 . . . etc. for other regions . . .
- If the masks are not square regions, you can create a netCDF file with the various areas.
- And then in the BASE EMISSIONS SECTION, for each line of emissions, you need to add extra lines for the tagged tracers so that the masks will get applied. For example, in the HEMCO_Config.rc for CH4, you would add:
#============================================================================== # --- EDGAR v4.2 emissions, various sectors --- #============================================================================== (((EDGAR ### Gas and oil ### 0 CH4_GAS__1B2a $ROOT/CH4/v2014-09/v42_CH4.0.1x0.1.nc ch4_1B2a 2004-2008/1/1/0 C xy kg/m2/s CH4 - 1 1 0 CH4_GAS__1b2a_1 - - - - - - CH4_1 1001 1 1 0 CH4_GAS__1b2a_2 - - - - - - CH4_2 1002 1 1 ... etc ... ### Coal mines ### CH4_COAL__1B1 $ROOT/CH4/v2014-09/v42_CH4.0.1x0.1.nc ch4_1B1 2004-2008/1/1/0 C xy kg/m2/s CH4 - 2 1 0 CH4_COAL__1B1_1 - - - - - - CH4_1 1001 2 1 0 CH4_COAL__1B1_2 - - - - - - CH4_2 1002 2 1 ... etc ...
- This will put the total emissions into your CH4 tracer (tracer #1). It will then also apply the regional masks to the total emissions and then store them into tagged tracers CH4_1 and CH4_2 (or whatever you have them called). These tagged tracers CH4_1, CH4_2, etc. have to be defined in your input.geos and also in your tracer restart file.
- Long story short: all of the complexity of putting emissions into tagged tracers is now handled in the HEMCO_Config.rc input file instead of having to hardwire it in the code.
Christoph Keller replied:
- Regarding your HEMCO configuration file, we need to be careful about the extensions. Those are much more hardcoded than the "base" emissions and they will only calculate emissions for the species you attach to each extension (in section settings). For instance, your setting for CH4_WETLANDS is:
121 CH4_WETLANDS : on CH4
- This means that the CH4_WETLANDS extension will only calculate emissions for CH4, but not for any of the tagged tracers. If you wanted to calculate emissions for those, you need to list them all as extension species:
121 CH4_WETLANDS : on CH4/CH4_1/CH4_2/... <—> WON’T WORK!!!
- However, as I said the extensions are more hardcoded (because they scale fields by temperature, etc.), so the line above won’t work at the moment because CH4_WETLANDS expect only one species. In the future we may try to extend these extensions to accept tagged tracers