Clone wiki

KROME / quick2

back to index

2.3 Including KROME into your code

The test.f90 files you find in the folders contained in the tests/ directory, mimic the behaviour of a program that call KROME, like RAMSES, FLASH, or any other codes that requires chemistry and/or microphysics.

In all the tests the scheme is more or less the following: - Include the KROME module typing

use krome
  • Initialize KROME
call krome_init()
  • Call the main routine
call krome(n(:), Tgas, dt)

This interface changes when mass fractions are necessary (see 2.3.1 below). However, to use KROME in the simplest way you only need these three parts. The call to KROME requires the mass fractions (or the number densities, see 2.3.1) n(:), the temperature in K Tgas, and the time-step in seconds dt. After calling this subroutine n(:) will contain the evolved number density (or mass fractions), while Tgas the new temperature (if cooling and/or heating are enabled).

2.3.1 Using mass fractions

KROME allows to use both mass fractions as well as number densities. The KROME default is number densities, so if the user wants to employ mass fractions for the chemical species they need to enable the option -useX:

   ./krome -n network_file -useX

you will obtain a new KROME interface, namely:

 call krome(x(:), rhogas, Tgas, dt)

where x(:) is the input/output argument for the mass fractions , rhogas is the total mass density in g/cm3, and Tgas is the input/output argument for the gas temperature (K), and finally, dt is the time interval (s). The variable x(:) and Tgas are also outputs as indicated in the previous section.

2.3.2 Additional modules

KROME allows other utilities that are mainly stored in the krome_user module. A detailed description of this module can be found in Section 3.5.