KROME

Disclaimer: this guide is an overview. For additional details please refer to the more complete https://bitbucket.org/tgrassi/krome/wiki/Home

 


What is KROME?

KROME is a package for (astro)chemistry and microphysics, including thermal process, dust, and RT-compatible photochemistry. It consists in a Python pre-processor that creates all the necessary F90 modules according to specific user's options. The modules are compiled and then called at runtime by the driver code as a library. You can obtain the code here kromepackage.org, but we strongly suggest to clone the repository on  your local machine from https://bitbucket.org/tgrassi/krome/

 

 


Clone KROME from bitbucket

This is the standard cloning procedure using git.

Make sure to have git installed and type this in a shell opened on your favourite folder

  git clone https://tgrassi@bitbucket.org/tgrassi/krome.git

This will create a folder named krome/

KROME is weekly/daily updated, so be sure to have the latest version,

  cd krome
  git pull origin

 


What can I do with KROME?

KROME has several features that are explained in the wiki docs at https://bitbucket.org/tgrassi/krome/wiki/Home, however you are welcome to contact us to ask for more details and to discuss about the different modules. Another reference (a bit outdated now) is the companion paper http://adsabs.harvard.edu/abs/2014MNRAS.439.2386G where the basic physics is described. Please be careful, since the paper contains aspects that are no longer available in KROME. Do not hesitate to contact me for help and tips at  tgrassi@nbi.dk

 


Getting started

KROME acts as a library that needs a driver code, from a simple one wrapped around the call to KROME, to complex hydro codes as RAMSES.

We suggest to run for the first time the "hello KROME!" test. In your local krome/ folder

  ./krome -test=hello

This command builds all the necessary files in the build/ directory. Open this directory and take a look at the test.f90 file, which represents an extremely simplified version of a driver code (in principle you should replace test.f90 with your code, no matter how complex is).

The important parts of test.f90 are

  call krome_init() !init krome (mandatory)

and

  call krome(x(:), Tgas, dt) !call KROME

where x(:) is the input/output array of the number densities (cm-3), Tgas the input/output gas temperature (K), and dt the full time-step (s), e.g. your hyrdro time-step. In this example you want to see what happen to the x(:) abundances of the species and Tgas after dt seconds. This is the basic call, but if you want to add dust and/or photochemistry please refer to the wiki https://bitbucket.org/tgrassi/krome/wiki/Home. In the "hello KROME!" test the cooling/heating is not active, so Tgas will be unaltered. Note also that if you want to modify a species in the array you don't need to know where the species is located, but you can just indicate it as a variable (contained in the krome_user module). For example to set CO to 1d-4 just use

x(krome_idx_CO) = 1d-4


Patch for RAMSES (Copenhagen version)

KROME supports the patch for different hydro codes (RAMSES, FLASH, and Enzo), but we have a special patch compatible with our version here in Copenhagen.

Let's assume that you want to add primordial chemistry with metals (i.e. H-C-O-He-based heavily reduced chemistry contained in the file networks/react_primordialZ), with cooling from H2, endothermic reactions (CHEM), and metals fine-structure lines (CI,CII,OI), and heating from exothermic reactions (CHEM). You also want to compute the adiabatic index (gamma) with something better than a constant (reduced option). In this case you should call KROME with the following line

./krome -compact -ramsesTH -cooling H2,CHEM,CI,CII,OI -n networks/react_primordialZ -gamma reduced -heating CHEM

where the options are explained above, but in this case you also need -compact, which compacts all the modules into a single file krome_all.f90, and -ramsesTH, that creates the patch file for RAMSES (Copenhagen version). All the files that should be replaced in RAMSES are contained in the folder

build/krome_ramsesTH_patch/

while

build/abundances.nml

contains the initial conditions that can be modified by the user depending on his/her needs.