Wiki
Clone wikikrome_bootcamp_2016_ex / output_routines
Output procedures and default file format
The proto
class has some output methods already implemented, namely dumpDensityProfile
and dumpRadiationFlux
.
You can access them by using, e.g., call p%dumpDensityProfile(33)
, where 33 is the "logical unit" number (it can also be an integer variable). Note that you do not want to use the same unit number for different files that are open simultaneously.
dumpDensityProfile
The core of the dumpDensityProfile
subroutine is:
#!fortran !loop on cells do icell=1,ncells write(fileNumber,'(99E17.8e3)') xvariable,this%radius(icell), this%density(icell) end do
This is a loop over all the cells. For each cell, it writes the radius (cm) and the density (g/cm^3) stored in the class attributes.
Note that these are initialized by the function init("namelist.dat")
, called in main.f90
.
This subroutine also has an xvariable
argument that can be used as a generic independent variable. This is useful when you have, e.g., time-dependent quantities.
However, you can also use it for static quantities by simply setting xvariable
to zero when calling dumpDensityProfile
.
We will use this subroutine to output other quantities besides just the density.
dumpRadiationFlux
The dumpRadiationFlux
method dumps the energy-dependent and time-dependent radiation flux (eV/cm2), and the opacity.
It works analogously to dumpDensityProfile
, but produces a more complicated output since it will be time-dependent (s), radius-dependent (cm), and energy-dependent (eV). dumpDensityProfile
is only time- and radius-dependent.
Add another output method/procedure
To add an additional output method/procedure read this page.
Updated