geoschem / HEMCO

The Harmonized Emissions Component (HEMCO), developed by the GEOS-Chem Support Team.
https://hemco.readthedocs.io
Other
17 stars 32 forks source link

HEMCO MEGANv2.1 Mono Diagnostics Equal to Zero #139

Closed drnimbusrain closed 2 years ago

drnimbusrain commented 2 years ago

@yantosca @msulprizio

I have also been having some recent issues using the latest develop branch of the standalone HEMCO MEGANv2.1 extension (https://github.com/geoschem/HEMCO/blob/dev/src/Extensions/hcox_megan_mod.F90) and seemingly the diagnostic outputs for monoterpenes, e.g., MTPA, MTPO, LIMO, and SESQ.

In a test run using MERRA2 driving meteorology, all other MEGAN diagnostic variables (e.g., ISOP, ACET, etc.) seem to have good output data for my test run, but the four lumped monoterpene variables are always set to zero for all hours, with the following warnings in the my attached HEMCO log file:

HEMCO WARNING: Diagnostics counter is zero - return empty array: SESQ_MEGAN
--> LOCATION: DiagnCont_PrepareOutput (hco_diagn_mod.F90)
--- Added diagnostics: SESQ_MEGAN
HEMCO WARNING: Diagnostics counter is zero - return empty array: LIMO_MEGAN
--> LOCATION: DiagnCont_PrepareOutput (hco_diagn_mod.F90)
--- Added diagnostics: LIMO_MEGAN
HEMCO WARNING: Diagnostics counter is zero - return empty array: MTPO_MEGAN
--> LOCATION: DiagnCont_PrepareOutput (hco_diagn_mod.F90)
--- Added diagnostics: MTPO_MEGAN
HEMCO WARNING: Diagnostics counter is zero - return empty array: MTPA_MEGAN
--> LOCATION: DiagnCont_PrepareOutput (hco_diagn_mod.F90)

I also attach my HEMCO_sa MEGANv2.1 configuration files for this run.

HEMCO.log HEMCO_Config.txt HEMCO_sa_Diagn.txt HEMCO_sa_Grid.txt HEMCO_sa_Spec.txt HEMCO_sa_Time.txt

Originally posted by @drnimbusrain in https://github.com/geoschem/HEMCO/issues/91#issuecomment-1082308991

yantosca commented 2 years ago

Thanks for writing @drnimbusrain. We recently fixed some issues for the manual diagnostics in HEMCO. Can you tell us what commit or tag you are on? Thanks.

msulprizio commented 2 years ago

We recently fixed some issues for the manual diagnostics in HEMCO.

See https://github.com/geoschem/HEMCO/pull/121. That fix went into HEMCO 3.2.2 and GEOS-Chem 13.3.3.

drnimbusrain commented 2 years ago

@yantosca @msulprizio

Thank you for your reply. I was simply using the dev branch at: https://github.com/geoschem/HEMCO/tree/dev I thought the changes would be in there.

Should I be using the latest release (HEMCOv3.2.2) or recent tag, say https://github.com/geoschem/HEMCO/releases/tag/3.4.0-rc.2 ?

Also, I noticed there is now a new branch ("megan extension") updated a few days ago: https://github.com/geoschem/HEMCO/tree/bugfix/megan_extension

Any clarification on the best HEMCO branch, tag, or release going forward is much appreciated.

Thank you!

drnimbusrain commented 2 years ago

@msulprizio @yantosca

Also, I just pulled down tags for HEMCOv3.2.2 and 3.4.0-rc.2 and using the same configurations as posted above, I still get all zeros for MTPA, MTPO, LIMO, and SESQ with the same zero array warning as previous with the HEMCO dev branch.

I also tested out the bugfix/megan_extension branch and get the same result, zero for MTPA, MTPO, LIMO, and SESQ.

Maybe I am making a mistake in my configuration for the monoterpenes. Am I missing something here?

yantosca commented 2 years ago

Hi @drnimbusrain, have you tried adding these lines into your HEMCO_Diagn.rc file? This will give the biogenic emissions of each MEGAN species.

I noticed that in the

#=============================
# MEGAN Extension
#=============================
InvMEGAN_ALD2        ALD2   108   -1 -1  2   kg/m2/s  ALD2_biogenic_emission_flux_from_MEGAN_extension
# C2H4 is not an active species in GEOS-Chem; disable for now
#InvMEGAN_C2H4        C2H4   108   -1 -1  2   kg/m2/s  C2H4_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_EOH         EOH    108   -1 -1  2   kg/m2/s  EOH_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_ISOP        ISOP   108   -1 -1  2   kg/m2/s  ISOP_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_LIMO        LIMO   108   -1 -1  2   kg/m2/s  LIMO_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_MTPA        MTPA   108   -1 -1  2   kg/m2/s  MTPA_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_MTPO        MTPO   108   -1 -1  2   kg/m2/s  MTPO_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_PRPE        PRPE   108   -1 -1  2   kg/m2/s  PRPE_biogenic_emission_flux_from_MEGAN_extension
# SESQ is not an active species in GEOS-Chem; disable for now
#InvMEGAN_SESQ        SESQ   108   -1 -1  2   kg/m2/s  SESQ_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_SOAP        SOAP   108   -1 -1  2   kg/m2/s  SOAP_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_SOAS        SOAS   108   -1 -1  2   kg/m2/s  SOAS_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_ACET        ACET   108   -1 -1  2   kg/m2/s  ACET_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_ACET_MONO   -1     108   -1 -1  2   kg/m2/s  Acetone_from_monoterpenes_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_ACET_MBOX   -1     108   -1 -1  2   kg/m2/s  Acetone_from_methyl_butenol_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_ACET_DIRECT -1     108   -1 -1  2   kg/m2/s  Direct_acetone_biogenic_emission_flux_from_MEGAN_extension
InvMEGAN_MOH          MOH    108  -1  -1  2   kg/m2/s  Methanol_emission_flux_from_MEGAN_extension
InvMEGAN_APIN         -1     108  -1  -1  2   kg/m2/s  Alpha_pinene_emission_flux_from_MEGAN_extension
InvMEGAN_BPIN         -1     108  -1  -1  2   kg/m2/s  Beta_pinene_acid_emission_flux_from_MEGAN_extension
InvMEGAN_SABI         -1     108  -1  -1  2   kg/m2/s  Sabinene_emission_flux_from_MEGAN_extension
InvMEGAN_MYRC         -1     108  -1  -1  2   kg/m2/s  Mycrene_emission_flux_from_MEGAN_extension
InvMEGAN_CARE         -1     108  -1  -1  2   kg/m2/s  3_Carene_emission_flux_from_MEGAN_extension
InvMEGAN_OCIM         -1     108  -1  -1  2   kg/m2/s  Ocimene_emission_flux_from_MEGAN_extension
InvMEGAN_OMON         -1     108  -1  -1  2   kg/m2/s  Other_monoterpene_emission_flux_from_MEGAN_extension
InvMEGAN_MONX         -1     108  -1  -1  2   kg/m2/s  Total_monoterpene_emission_flux_from_MEGAN_extension
InvMEGAN_FARN         -1     108  -1  -1  2   kg/m2/s  alpha_Farnesene_emission_flux_from_MEGAN_extension
InvMEGAN_BCAR         -1     108  -1  -1  2   kg/m2/s  beta_caryophyllene_emission_flux_from_MEGAN_extension
InvMEGAN_OSQT         -1     108  -1  -1  2   kg/m2/s  Other_sesquiterpenes_emission_flux_from_MEGAN_extension
InvMEGAN_MBOX         -1     108  -1  -1  2   kg/m2/s  Methyl_butenol_emission_flux_from_MEGAN_extension
InvMEGAN_FAXX         -1     108  -1  -1  2   kg/m2/s  Formic_acid_emission_flux_from_MEGAN_extension
InvMEGAN_AAXX         -1     108  -1  -1  2   kg/m2/s  Acetic_acid_emission_flux_from_MEGAN_extension

The EmisXXXX_Biogenic entries should also work as long as the extension number of 108 is used.

yantosca commented 2 years ago

Ah, I think I see the issue. Your species that are zero are using the wrong extension number:

###############################################################################
#####  Biogenic VOCs mono emissions                                       ##### 
###############################################################################
MTPA_MEGAN               MTPA   109    -1  -1   2   kgC/m2/s MTPA_emission_flux_from_biogenic_sources
MTPO_MEGAN               MTPO   109    -1  -1   2   kgC/m2/s MTPO_emission_flux_from_biogenic_sources
LIMO_MEGAN               LIMO   109    -1  -1   2   kgC/m2/s LIMO_emission_flux_from_biogenic_sources
SESQ_MEGAN               SESQ   109    -1  -1   2   kgC/m2/s SESQ_emission_flux_from_biogenic_sources

Although MEGAN uses an extension number 109 for biogenic VOC's, I believe that is more like an internal switch to turn that option on/off. The actual diagnostics are attached to extension 108 which is the main MEGAN extension. So changing all these to 108 should work.

drnimbusrain commented 2 years ago

@yantosca

Thank you for your suggestion.

Using either HEMCOv3.2.2 or HEMCOv3.4.0, as you suggest I change my diagnostics file to be 108 for those monoterpene species as you suggest, but it doesn't change the erroneous result for those species.

It still outputs zero for MTPA, MTPO, LIMO, and SESQ, and the same warning in the log files as before:

Diagnostic File: ###############################################################################

Biogenic VOCs mono emissions

############################################################################### MTPA_MEGAN MTPA 108 -1 -1 2 kg/m2/s MTPA_emission_flux_from_biogenic_sources MTPO_MEGAN MTPO 108 -1 -1 2 kg/m2/s MTPO_emission_flux_from_biogenic_sources LIMO_MEGAN LIMO 108 -1 -1 2 kg/m2/s LIMO_emission_flux_from_biogenic_sources SESQ_MEGAN SESQ 108 -1 -1 2 kg/m2/s SESQ_emission_flux_from_biogenic_sources

Log file: ... Calculate emissions at 2019-08-01 19:00:00 HEMCO: Entering HCO_RUN (hco_driver_mod.F90) ( 1) Write diagnostics into file output/HEMCO_sa.diagnostics.megan.YuanLAI.merra2_05x0625.201908011800.nc --> write level dimension: T HEMCO WARNING: Diagnostics counter is zero - return empty array: SESQ_MEGAN --> LOCATION: DiagnCont_PrepareOutput (hco_diagn_mod.F90) HEMCO WARNING: Diagnostics counter is zero - return empty array: LIMO_MEGAN --> LOCATION: DiagnCont_PrepareOutput (hco_diagn_mod.F90) HEMCO WARNING: Diagnostics counter is zero - return empty array: MTPO_MEGAN --> LOCATION: DiagnCont_PrepareOutput (hco_diagn_mod.F90) HEMCO WARNING: Diagnostics counter is zero - return empty array: MTPA_MEGAN --> LOCATION: DiagnCont_PrepareOutput (hco_diagn_mod.F90) ...

Any further help is much appreciated. Thank you.

msulprizio commented 2 years ago

Hi @drnimbusrain. Sorry for the delay. I am trying to reproduce this now and will follow up here.

msulprizio commented 2 years ago

I think I see the issue. You are using an old version of HEMCO_Config.rc that still includes both the MEGAN and MEGAN_MONO extensions. In GEOS-Chem 12.7.0 and HEMCO 3.0.0, we removed extension 109 MEGAN_MONO and just use extension 108 MEGAN -- see commit https://github.com/geoschem/HEMCO/commit/3897f4c158d63ec04d3e526ec27a0e6c70e12337. Because of this, SESQ, LIMO, MTPO, and MTPA are not recognized as species in hcox_megan_mod.F90. From your log file:

Use MEGAN biogenic emissions (extension module)
 - Use offline biogenic VOCs?  F
 - Use the following species:
    Isoprene   = ISOP          11
    Acetone    = ACET          10
    PRPE       = PRPE           9
    C2H4       = C2H4           8
    ALD2       = ALD2           7
    EOH        = EOH           6
    MOH        = MOH           5
  --> Isoprene scale factor is    1.0000000000000000
  --> Use CO2 inhibition on isoprene option  T
  --> Global atmospheric CO2 concentration :    411.00000000000000       ppmv
  --> Normalize LAI by PFT:  T
  --> Isoprene to SOA-Precursor   1.4999999999999999E-002
  --> Isoprene direct to SOA (Simple)   1.4999999999999999E-002
  --> Monoterpene to SOA-Precursor   0.0000000000000000
  --> Monoterpene direct to SOA (Simple)   0.0000000000000000
  --> Othrterpene to SOA-Precursor   0.0000000000000000
  --> Othrterpene direct to SOA (Simple)   0.0000000000000000

You should be able to resolve this issue by changing the following lines in your HEMCO_Config.rc:

108     MEGAN                  : on    ISOP/ACET/PRPE/C2H4/ALD2/EOH/MOH
    --> Isoprene scaling       :       1.0 
    --> CO2 inhibition         :       true
    --> CO2 conc (ppmv)        :       411.0
    --> Isoprene to SOAP       :       0.015
    --> Isoprene to SOAS       :       0.015
#3% mass yield from isoprene to SOA
109     MEGAN_Mono             : on    MTPA/MTPO/LIMO/SESQ
    --> Monoterp to SOAP       :       0.050
    --> Monoterp to SOAS       :       0.050
#10% mass yield from monoterpenes to SOA
    --> Othrterp to SOAP       :       0.050
    --> Othrterp to SOAS       :       0.050

to:

108     MEGAN                  : on    ISOP/ACET/PRPE/C2H4/ALD2/MOH/EOH/MTPA/MTPO/LIMO/SESQ/SOAP/SOAS
    --> Isoprene scaling       :       1.0
    --> CO2 inhibition         :       true
    --> CO2 conc (ppmv)        :       390.0
    --> Isoprene to SOAP       :       0.015
    --> Isoprene to SOAS       :       0.015
    --> Monoterp to SOAP       :       0.050
    --> Monoterp to SOAS       :       0.050
    --> Othrterp to SOAP       :       0.050
    --> Othrterp to SOAS       :       0.050

You'll also need to change the relevant lines in HEMCO_Config.rc and HEMCO_Diagn.rc to remove use of extension number 109 and use 108 instead. For example:

#==============================================================================
# --- MEGAN biogenic emissions (Extension 108)
#
# We don't need to read EF maps for acetone, a-pinene or myrcene. We now
# compute those values in the MEGAN extension.
#==============================================================================
#(((HEMCO_RESTART
#108  T_DAVG                       ./HEMCO_restart.$YYYY$MM$DD$HH00.nc                T_DAVG                  $YYYY/$MM/$DD/$HH EY xy K        * - 1 1
#108  T_PREVDAY                    ./HEMCO_restart.$YYYY$MM$DD$HH00.nc                T_PREVDAY               $YYYY/$MM/$DD/$HH EY xy K        * - 1 1
#108  LAI_PREVDAY                  ./HEMCO_restart.$YYYY$MM$DD$HH00.nc                LAI_PREVDAY             $YYYY/$MM/$DD/$HH EY xy 1        * - 1 1
#108  PARDR_DAVG                   ./HEMCO_restart.$YYYY$MM$DD$HH00.nc                PARDR_DAVG              $YYYY/$MM/$DD/$HH EY xy W/m2     * - 1 1
#108  PARDF_DAVG                   ./HEMCO_restart.$YYYY$MM$DD$HH00.nc                PARDF_DAVG              $YYYY/$MM/$DD/$HH EY xy W/m2     * - 1 1
#)))HEMCO_RESTART
108  MEGAN_AEF_ISOP               $ROOT/HEMCO/MEGAN/v2020-02/MEGAN2.1_EF.geos.025x03125.nc      AEF_ISOPRENE            1985/1/1/0        C xy kgC/m2/s * - 1 1
108  MEGAN_AEF_MBOX               $ROOT/HEMCO/MEGAN/v2020-02/MEGAN2.1_EF.geos.025x03125.nc      AEF_MBO                 1985/1/1/0        C xy kgC/m2/s * - 1 1
#108 MEGAN_AEF_APIN               $ROOT/HEMCO/MEGAN/v2020-02/MEGAN2.1_EF.geos.025x03125.nc      AEF_ALPHA_PINENE        1985/1/1/0        C xy kgC/m2/s * - 1 1
108  MEGAN_AEF_BPIN               $ROOT/HEMCO/MEGAN/v2020-02/MEGAN2.1_EF.geos.025x03125.nc      AEF_BETA_PINENE         1985/1/1/0        C xy kgC/m2/s * - 1 1
108  MEGAN_AEF_CARE               $ROOT/HEMCO/MEGAN/v2020-02/MEGAN2.1_EF.geos.025x03125.nc      AEF_CARENE              1985/1/1/0        C xy kgC/m2/s * - 1 1
108  MEGAN_AEF_LIMO               $ROOT/HEMCO/MEGAN/v2020-02/MEGAN2.1_EF.geos.025x03125.nc      AEF_LIMONENE            1985/1/1/0        C xy kgC/m2/s * - 1 1
#108 MEGAN_AEF_MYRC               $ROOT/HEMCO/MEGAN/v2020-02/MEGAN2.1_EF.geos.025x03125.nc      AEF_MYRCENE             1985/1/1/0        C xy kgC/m2/s * - 1 1
108  MEGAN_AEF_OCIM               $ROOT/HEMCO/MEGAN/v2020-02/MEGAN2.1_EF.geos.025x03125.nc      AEF_OCIMENE             1985/1/1/0        C xy kgC/m2/s * - 1 1
108  MEGAN_AEF_SABI               $ROOT/HEMCO/MEGAN/v2020-02/MEGAN2.1_EF.geos.025x03125.nc      AEF_SABINENE            1985/1/1/0        C xy kgC/m2/s * - 1 1
etc.

and

###############################################################################
#####  Biogenic VOCs mono emissions                                       ##### 
###############################################################################
MTPA_MEGAN               MTPA   108    -1  -1   2   kgC/m2/s MTPA_emission_flux_from_biogenic_sources
MTPO_MEGAN               MTPO   108    -1  -1   2   kgC/m2/s MTPO_emission_flux_from_biogenic_sources
LIMO_MEGAN               LIMO   108    -1  -1   2   kgC/m2/s LIMO_emission_flux_from_biogenic_sources
SESQ_MEGAN               SESQ   108    -1  -1   2   kgC/m2/s SESQ_emission_flux_from_biogenic_sources

When I do that I now get the following in HEMCO.log:

Use MEGAN biogenic emissions (extension module)
 - Use offline biogenic VOCs?  F
 - Use the following species:
    Isoprene   = ISOP          11
    Acetone    = ACET          10
    PRPE       = PRPE           9
    C2H4       = C2H4           8
    ALD2       = ALD2           7
    MOH        = MOH           6
    EOH        = EOH           5
    MTPA       = MTPA           4
    MTPO       = MTPO           3
    LIMO       = LIMO           2
    SESQ       = SESQ           1
    SOAP       = SOAP          -1
    SOAS       = SOAS          -1
  --> Isoprene scale factor is    1.0000000000000000

I can confirm that I also get non-zero diagnostic output for MTPA, MTPO, LIMO, and SESQ. My runs used the current main branch of the HEMCO standalone. Here are the files I modified and my HEMCO log file:

yantosca commented 2 years ago

Thanks @msulprizio, I didn't realize that MEGAN_MONO had been retired. Thanks for confirming!

drnimbusrain commented 2 years ago

@msulprizio

Thank you so much for finding this issue, and letting me know. I also had no idea that MEGAN_MONO was retired, but I should have done more digging.

I have made the necessary adjustments and tested, and it now works with nonzero values for the monoterpene species. Thank you again @msulprizio and @yantosca for the great help!

yantosca commented 2 years ago

Thanks so much @drnimbusrain. We can close out this issue now.