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
168 stars 165 forks source link

[BUG/ISSUE] Could not locate KPP prod/loss species: POx! #462

Closed xpye98 closed 4 years ago

xpye98 commented 4 years ago

Ask a question about GEOS-Chem:

Hi,

I'm using 12.9.3 version. I add some new species in KPP/Tropchem and build it successfully. Also, I compiled GEOS-Chem without errors. However, when running GC, there comes an error message: Could not locate KPP prod/loss species: POx! (see pic below) image

I checked Headers/state_chm_mod.F90 and found that at about line 4338, when getting id of prod/loss of POx, it returns -1.

Thanks for your help!

(By the way, when adding new species, I try to follow wiki to add species in folder Custom instead of Tropchem. But after successfully build kpp and move to compile GEOS-Chem, I found there is no way to set the model to follow Custom chemistry mechanism. Wiki says I should add CHEM=Custom when compiling, but it seems of no use.)

xpye98 commented 4 years ago

I found that in file gckpp_Parameters.F90, there is no POx. But in gckpp.kpp, I define it just as default Tropchem.

yantosca commented 4 years ago

Thanks for writing. In the gckpp.kpp file you need to make sure that POx is defined there:

#INTEGRATOR rosenbrock
#LANGUAGE Fortran90
#DRIVER none
#HESSIAN off
#MEX off
#STOICMAT off 

#INCLUDE fullchem.eqn

#FAMILIES
POx : O3 + NO2 + 2NO3 + PAN + PPN + MPAN + HNO4 + 3N2O5 + HNO3 + BrO + HOBr + BrNO2 + 2BrNO3 + MPN + ETHLN + MVKN + MCRHN + MCRHNB + PROPNN + R4N2 + PRN1 + PRPN + R4N1 + HONIT + MONITS + MONITU + OLND + OLNN + IHN1 + IHN2 + IHN3 + IHN4 + INPB + INPD + ICN + 2IDN + ITCN + ITHN + ISOPNOO1 + ISOPNOO2 + INO2B + INO2D + INA + IDHNBOO + IDHNDOO1 + IDHNDOO2 + IHPNBOO + IHPNDOO + ICNOO + 2IDNOO + MACRNO2 + ClO + HOCl + ClNO2 + 2ClNO3 + 2Cl2O2 + 2OClO + O + O1D + IO + HOI + IONO + 2IONO2 + 2OIO + 2I2O2 + 3I2O3 + 4I2O4;
LOx : O3 + NO2 + 2NO3 + PAN + PPN + MPAN + HNO4 + 3N2O5 + HNO3 + BrO + HOBr + BrNO2 + 2BrNO3 + MPN + ETHLN + MVKN + MCRHN + MCRHNB + PROPNN + R4N2 + PRN1 + PRPN + R4N1 + HONIT + MONITS + MONITU + OLND + OLNN + IHN1 + IHN2 + IHN3 + IHN4 + INPB + INPD + ICN + 2IDN + ITCN + ITHN + ISOPNOO1 + ISOPNOO2 + INO2B + INO2D + INA + IDHNBOO + IDHNDOO1 + IDHNDOO2 + IHPNBOO + IHPNDOO + ICNOO + 2IDNOO + MACRNO2 + ClO + HOCl + ClNO2 + 2ClNO3 + 2Cl2O2 + 2OClO + O + O1D + IO + HOI + IONO + 2IONO2 + 2OIO + 2I2O2 + 3I2O3 + 4I2O4;
PCO : CO;
LCO : CO;
PSO4 : SO4;
LCH4 : CH4;
PH2O2 : H2O2;

And also POx (as well as the other prod/loss species) must also be defined in the species_database.yml file in the run directory:

POx:
  FullName: Dummy species to track production rate of Ox
  Is_Gas: true

Otherwise you will get an error.

xpye98 commented 4 years ago

Thanks for writing. In the gckpp.kpp file you need to make sure that POx is defined there:

#INTEGRATOR rosenbrock
#LANGUAGE Fortran90
#DRIVER none
#HESSIAN off
#MEX off
#STOICMAT off 

#INCLUDE fullchem.eqn

#FAMILIES
POx : O3 + NO2 + 2NO3 + PAN + PPN + MPAN + HNO4 + 3N2O5 + HNO3 + BrO + HOBr + BrNO2 + 2BrNO3 + MPN + ETHLN + MVKN + MCRHN + MCRHNB + PROPNN + R4N2 + PRN1 + PRPN + R4N1 + HONIT + MONITS + MONITU + OLND + OLNN + IHN1 + IHN2 + IHN3 + IHN4 + INPB + INPD + ICN + 2IDN + ITCN + ITHN + ISOPNOO1 + ISOPNOO2 + INO2B + INO2D + INA + IDHNBOO + IDHNDOO1 + IDHNDOO2 + IHPNBOO + IHPNDOO + ICNOO + 2IDNOO + MACRNO2 + ClO + HOCl + ClNO2 + 2ClNO3 + 2Cl2O2 + 2OClO + O + O1D + IO + HOI + IONO + 2IONO2 + 2OIO + 2I2O2 + 3I2O3 + 4I2O4;
LOx : O3 + NO2 + 2NO3 + PAN + PPN + MPAN + HNO4 + 3N2O5 + HNO3 + BrO + HOBr + BrNO2 + 2BrNO3 + MPN + ETHLN + MVKN + MCRHN + MCRHNB + PROPNN + R4N2 + PRN1 + PRPN + R4N1 + HONIT + MONITS + MONITU + OLND + OLNN + IHN1 + IHN2 + IHN3 + IHN4 + INPB + INPD + ICN + 2IDN + ITCN + ITHN + ISOPNOO1 + ISOPNOO2 + INO2B + INO2D + INA + IDHNBOO + IDHNDOO1 + IDHNDOO2 + IHPNBOO + IHPNDOO + ICNOO + 2IDNOO + MACRNO2 + ClO + HOCl + ClNO2 + 2ClNO3 + 2Cl2O2 + 2OClO + O + O1D + IO + HOI + IONO + 2IONO2 + 2OIO + 2I2O2 + 3I2O3 + 4I2O4;
PCO : CO;
LCO : CO;
PSO4 : SO4;
LCH4 : CH4;
PH2O2 : H2O2;

And also POx (as well as the other prod/loss species) must also be defined in the species_database.yml file in the run directory:

POx:
  FullName: Dummy species to track production rate of Ox
  Is_Gas: true

Otherwise you will get an error.

Thanks for replying! I checked both files, they both contain codes about prod/loss. The situation is, when I did build_mechanism.sh Tropchem_custom, gckpp_Parameters.F90 doesn't contain POx like default Tropchem folder.

xpye98 commented 4 years ago

I tried things below to test, and found something very confusing: I copy default Tropchem to another test folder cp -r Tropchem/ ./Tropchem_test Then, I build the new Tropchem_test ./build_mechanism.sh Tropchem_test/ And I find that new *F90 files created in Tropchem_test is very different from the default Tropchem (for example, gckpp_Parameters.F90 in new folder doesn't contain POx), how does that happen?

msulprizio commented 4 years ago

Can you make sure you have the branch GC_updates checked out in your KPP directory? If it isn't, try checking it out and rebuilding KPP. See this wiki page for more information.

If you're still having issues, could you please attach your gckpp.kpp and Custom.eqn files here so we can try to reproduce the error?

xpye98 commented 4 years ago

Can you make sure you have the branch GC_updates checked out in your KPP directory? If it isn't, try checking it out and rebuilding KPP. See this wiki page for more information.

If you're still having issues, could you please attach your gckpp.kpp and Custom.eqn files here so we can try to reproduce the error?

Thanks a lot! I downloaded the wrong branch of KPP instead of GC_updates. Sorry for disturbing you.