uclchem / UCLCHEM

UCLCHEM - A gas-grain chemical code for Astrochemistry.
MIT License
29 stars 14 forks source link

fail to recompile with toggle "three_phase" off #39

Open JosephSalaris opened 1 year ago

JosephSalaris commented 1 year ago

Hi,

After installing, UCLCHEM with everything default works fine.

I want to exclude bulk ice chemistry for starters. Setting the three_phase toggle to False in usersettings.yaml and executing MakeRates.py spits some warnings, but works. Then trying to recompile I get an error. Compiling from src/fortran_src as recommended in the docs, the error looks like this:


(uclcenv) CN09:/vol/thchem/jsalaris/UCLCHEM/src/fortran_src $ make python gfortran -O3 -fPIC -ffree-line-length-0 -c chemistry.f90 chemistry.f90:176:49:

176 | abund(nBulk,dstep)=sum(abund(bulkList,dstep)) | 1 Error: Symbol ‘bulklist’ at (1) has no IMPLICIT type make: *** [Makefile:40: chemistry.o] Error 1

Any idea why I get this error and how I can fix it?

I am using:

uclchem-3.2.0 python-3.9.16 pip 22.2.2 numpy 1.22.3

GijsVermarien commented 1 year ago

Hi Joseph! Thank you for your message, I have encountered this issue too at some point but hadn't made an issue out of it yet. In the refactoring of UCLCHEM from two to three phases we might have introduced some two phase cases that stopped working. Possibly you can work with the three-phase model for now?

I will mark it as a bug for now, and we will try to pick it up as soon as possible.

GijsVermarien commented 1 year ago

The problem seems to be that we never check for the scenario where bulklist is not defined in chemistry.f90 when recomputing the bulk and surface: https://github.com/uclchem/UCLCHEM/blob/9cae8549d9c412e7ab323534a7c58f8636c2383e/src/fortran_src/chemistry.f90#L176

JosephSalaris commented 1 year ago

Hi Gijs,

Just realized that we came in contact before! And thanks for the quick response!

Ok, good to know that it is not just me. Three phase model would not be ideal for me, as I would like to model the grain chemistry with another program. In fact, I would like to use UCLCHEM solely for gas phase chemistry with only freeze out on the grains.

GijsVermarien commented 1 year ago

Hi Joseph, I think you could still use UCLCHEM for this! If you were to remove all the grain reactions (see this file for the defaults: https://github.com/uclchem/UCLCHEM/blob/main/Makerates/inputFiles/default_grain_network.csv), you would just obtain the freezeout onto the grains. There are a few reactions you need to make sure UCLCHEM works, like the h2form reactions. But Makerates will tell you when essential reactions are missing. At the end you can just sum up the surface and bulk to get the total fractional abundances on the grain.

If you have more in depth questions about your scenario and what can be done with UCLCHEM, we can set up a Zoom call to talk about it. You know how to reach me :)