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

[BUG/ISSUE] Can't rebuild mechanism with KPP #527

Closed emmapetersen closed 3 years ago

emmapetersen commented 3 years ago

Report a GEOS-Chem bug or technical issue

Describe the bug:

Hi I am quite new to the GEOS-Chem model, and I have been trying to implement a new mechanism following the guide on the wiki: http://wiki.seas.harvard.edu/geos-chem/index.php/FlexChem#Adding_chemical_mechanisms_in_FlexChem I can't seem to rebuild the mechanism with KPP.

Steps to reproduce: the bug:

I used GEOS-Chem on a server by AWS using the AMI with ID ami-04751feef8546fdfe. I set up the run directory. (I installed flex and bison.) And then I downloaded the KPP directory into my home directory, and build the system. I added the mechanism to the Custom.eqn and the FJX_j2j.dat file (it's a photolysis reaction), went to the KPP directory (inside the run directory) and executed the ./build_mechanism.sh file. I then got an error (see below).

Error messages

mv: cannot stat 'gckpp_HetRates.F90': No such file or directory
mv: cannot stat 'gckpp_Integrator.F90': No such file or directory
mv: cannot stat 'gckpp_Precision.F90': No such file or directory
rm: cannot remove '*F90': No such file or directory
rm: cannot remove '*o': No such file or directory
./build_mechanism.sh: line 23: kpp: command not found
KPP failure! Aborting.

Required information:

Your GEOS-Chem version and runtime environment:

All suggestions for what I could try are welcome! Thanks. Best, Emma

yantosca commented 3 years ago

Thanks for writing @emmapetersen. Just to be sure, did you check out the GC_updates branch of the KPP repository? If you are on the master branch then you won't have the GEOS-Chem specific files.

emmapetersen commented 3 years ago

Yes, I checked that I was in the GC_updates branch, when I was in the KPP directory that I downloaded from the wiki-guide.

yantosca commented 3 years ago

Hi @emmapetersen. It looks like the KPP executable wasn't being picked up.

./build_mechanism.sh: line 23: kpp: command not found

Try adding the path to your kpp executable to your Unix PATH variable, e.g.

export PATH=$PATH:/path_to_kpp/KPP/kpp-2.2.3/bin/

where path_to_kpp is the long pathname of the folder in which KPP is found.

emmapetersen commented 3 years ago

Thanks for your answer. I have added the following to my .bashrc file: export PATH=$PATH:/home/ubuntu/KPP/kpp-2.2.3_01/bin/ export KPP_HOME=/home/ubuntu/KPP/kpp-2.2.3_01

I found the pathname to my KPP folder by typing "pwd" in the KPP folder. I don't know if this is what you mean by "long pathname"?

yantosca commented 3 years ago

Hi @emmapetersen. By long pathname I mean absolute path (pwd -P).

emmapetersen commented 3 years ago

Okay, thanks. I just tried that, and it gives the same path as above.

yantosca commented 3 years ago

Is it working now @emmapetersen?

emmapetersen commented 3 years ago

No, unfortunately not.

yantosca commented 3 years ago

@emmapetersen, what is your error now?

Also in the kpp_2.2.3._01/doc folder there is a PDF file kpp_UserManual.pdf. That might have some more suggestions.

emmapetersen commented 3 years ago

My error is the same as before. Thank you, I will have a look.

emmapetersen commented 3 years ago

@yantosca, I found my problem. After adding the path to my .bashrc file, I had to close my terminal window and start a new one. Thank you for your help!

yantosca commented 3 years ago

Thanks @emmapetersen, glad to know it worked! I'll close out this issue now.