Wiki
Clone wikiKROME / quick2
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
call krome_init()
call krome(n(:), Tgas, dt)
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)
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.
Updated