geoschem / geos-chem

GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
http://geos-chem.org
Other
167 stars 160 forks source link

Adding ProdLoss Rate of O3 to KPP #2337

Open yangning-code opened 3 months ago

yangning-code commented 3 months ago

Your name

Ning Yang

Your affiliation

JNU

Please provide a clear and concise description of your question or discussion topic.

GEOS-Chem version: v13.3.2

I wish to add the Production and loss rates of O3 to ProdLoss collection. However, after following below procedure , I do not see Prod_O3 nor Loss_O3 in my ProdLoss output files.

My implementation: First, I added the following to fullchem.kpp file:

POH : O3;
LOH : O3;

Then I recompiled the KPP using v2.3.3 running lines like:

cd ~/GCClassic13.3.2/src/GEOS-Chem/KPP/
./build_mechanism.sh fullchem

After recompiling the KPP, I saw that PO3 and LO3 appearing on gckpp_Monitor.F90,gckpp_Parameters.F90, gckpp.kpp, gckpp.log, and fullchem.kpp files. This is consistent with our families that are defined in fullchem.kpp.

Then in my run directory, I modified the species_database.yml file so that it includes definition of PO3 and LO3:

PO3:
  FullName: Dummy species to track production rate of O3
  Is_Gas: true
  MW_g: 48.00
LO3:
  FullName: Dummy species to track loss rate of O3
  Is_Gas: true
  MW_g: 48.00

After recompile my build directory, on my HISTORY.rc, I collect the ProdLoss COLLECTION such as Prod_O3 and Loss_O3. When I collect Prod_O3 and Loss_O3 in HISTORY.rc ProdLoss Collection, I get the following error:

LINOZ (LINOZ_READ): Opening /public/gcgrid/ExtData/CHEM_INPUTS/Linoz_200910/Linoz_March2007.dat
11 linoz chem tables - 40d int., w/ rxn175, +CH4,N2O,CFC11,CFC12 LLM climato
l
Linoz Data: O3 climatology : z*=10, 12, ..., 58 2.700E-08 1.083E-05
Linoz Data: Temperature climatology : z*=10, 12, ..., 58 1.859E+02 2.904E+02
Linoz Data: Column O3 above box climalology : z*=10, 12, ..., 58 7.538E-02 3.770E+02
Linoz Data: P-L O3 climatology (mr/s): z*=10, 12, ..., 58 -1.590E-10 2.835E-11
Linoz Data: d(P-L)/dO3 (1/s) : z*=10, 12, ..., 58 -8.386E-04 7.556E-09
Linoz Data: d(P-L)/dT (mr/K) : z*=10, 12, ..., 58 -5.742E-12 4.615E-14
Linoz Data: d(P-L)/d(column O3) (mr/DU) : z*=10, 12, ..., 58 -1.921E-12 5.038E-10
$$ Finished Reading Linoz Data $$

HISTORY (INIT): Opening ./HISTORY.rc
GEOS-Chem ERROR: PROD_PO3 is not found in the registry for the DIAG object!
-> at Registry_Lookup (in Headers/registry_mod.F90)
===============================================================================
GEOS-Chem ERROR: Could not locate Prod_PO3 diagnostics state registry.
-> History_AddItemToCollection (in History/history_mod.F90)
===============================================================================
GEOS-Chem ERROR: Could not add diagnostic "Prod_PO3" to collection: ProdLoss
-> at History_ReadCollectionData (in module History/history_mod.F90)

-> ERROR occurred at (or near) line 429 of the HISTORY.rc file
===============================================================================
GEOS-Chem ERROR: Error encountered in "History_ReadCollectionData"!
-> at History_Init (in module History/history_mod.F90)
===============================================================================
GEOS-CHEM ERROR: Error encountered in "History_Init"!
STOP at -> at GEOS-Chem (in GeosCore/main.F90)

I also tried Prod_CO and Loss_CO in HISTORY.rc ProdLoss Collection, I also get the following error:

LINOZ (LINOZ_READ): Opening /public/gcgrid/ExtData/CHEM_INPUTS/Linoz_200910/Linoz_March2007.dat
11 linoz chem tables - 40d int., w/ rxn175, +CH4,N2O,CFC11,CFC12 LLM climato
l
Linoz Data: O3 climatology : z*=10, 12, ..., 58 2.700E-08 1.083E-05
Linoz Data: Temperature climatology : z*=10, 12, ..., 58 1.859E+02 2.904E+02
Linoz Data: Column O3 above box climalology : z*=10, 12, ..., 58 7.538E-02 3.770E+02
Linoz Data: P-L O3 climatology (mr/s): z*=10, 12, ..., 58 -1.590E-10 2.835E-11
Linoz Data: d(P-L)/dO3 (1/s) : z*=10, 12, ..., 58 -8.386E-04 7.556E-09
Linoz Data: d(P-L)/dT (mr/K) : z*=10, 12, ..., 58 -5.742E-12 4.615E-14
Linoz Data: d(P-L)/d(column O3) (mr/DU) : z*=10, 12, ..., 58 -1.921E-12 5.038E-10
$$ Finished Reading Linoz Data $$

HISTORY (INIT): Opening ./HISTORY.rc
GEOS-Chem ERROR: PROD_CO is not found in the registry for the DIAG object!
-> at Registry_Lookup (in Headers/registry_mod.F90)
===============================================================================
GEOS-Chem ERROR: Could not locate Prod_CO diagnostics state registry.
-> History_AddItemToCollection (in History/history_mod.F90)
===============================================================================
GEOS-Chem ERROR: Could not add diagnostic "Prod_CO" to collection: ProdLoss
-> at History_ReadCollectionData (in module History/history_mod.F90)

-> ERROR occurred at (or near) line 429 of the HISTORY.rc file
===============================================================================
GEOS-Chem ERROR: Error encountered in "History_ReadCollectionData"!
-> at History_Init (in module History/history_mod.F90)
===============================================================================
GEOS-CHEM ERROR: Error encountered in "History_Init"!
STOP at -> at GEOS-Chem (in GeosCore/main.F90)

However,I also tried Prod_CO and LossCO Prod?PRD? and Loss_?LOS? in HISTORY.rc ProdLoss Collection, The mode can run normally and can output PO3, LO3, PCO, LCO.

yantosca commented 3 months ago

Thanks for writing @yangning-code and thanks for your patience. Many of us were at the IGC11 meeting earlier and June.

A few people have reported similar issues with the prod/loss diagnostic. We will be looking into this soon. Stay tuned.

yantosca commented 3 months ago

@yangning-code: From this error message:

GEOS-Chem ERROR: Could not locate Prod_PO3 diagnostics state registry.

it looks like the model is looking for a Prod_PO3 variable instead of Prod_O3. Can you doublecheck your HISTORY.rc file to make sure you added Prod_O3 and not Prod_PO3? If you used a wild card like Prod_?PRD?, then there may be a bug in the model, and this can help us track it down.

yantosca commented 3 months ago

I noted that you used KPP v2.3.3. There have been many updates since then. Please try again with KPP 3.1.1 (the current version) and let me know if you still get the same error.

yangning-code commented 3 months ago

Thank you, I try with KPP 3.1.1 (the current version)

yantosca commented 2 months ago

@yangning-code: Were you able to resolve this issue?

yantosca commented 2 months ago

@yangning-code: I also noted that you had listed family names;

POH : O3;
LOH : O3;

did you mean these to be PO3 and LO3? Just want to confirm. Will try to replicate this issue.

yantosca commented 2 months ago

@yangning-code: I was able to add the PO3 and LO3 species to KPP 14.4.1 and I rebuilt the mechanism with KPP 3.1.1. I was not able to replicate your issue. Like I said, it may be due to having used an older version of the code and/or KPP. Can you try with the latest version of GEOS-Chem just to see if that works?

yangning-code commented 2 months ago

@yangning-code: I also noted that you had listed family names;

POH : O3;
LOH : O3;

did you mean these to be PO3 and LO3? Just want to confirm. Will try to replicate this issue.

I'm soory. I wrote it wrong. When I defined it, I wrote PO3: O3 and LO3: O3

yangning-code commented 2 months ago

Thank you again. I can't solve it now, but it doesn't affect my research. Because GCClassic13 has some incompatibility issues with KPPv5+, an error is reported when compiling with KPP.3.3.1, and the error is the same as #1372.