Fortran modules
Currently, the Pencil Code contains 547 Fortran files.
Main source files (src)
The src directory contains 321 Fortran files.
File |
Description |
Scientific References |
|---|---|---|
This module is used to solve the equation of supersaturation for either the Smoluchowski approach or the swarm model. |
||
This module directly evolves the magnetic field instead of the vector potential; special care needs to be taken to guarantee the divergence of the field remains zero. |
||
Module for boundary conditions. Extracted from (no)mpicomm, since all non-periodic (external) boundary conditions require the same code for serial and parallel runs. |
||
Module for boundary conditions. Extracted from (no)mpicomm, since all non-periodic (external) boundary conditions require the same code for serial and parallel runs. |
||
Global variables are defined in this module. |
||
This modules adds chemical species and reactions. The units used in the chem.in files are cm3,mole,sec,kcal and K |
||
! This modules addes chemical species and reactions. The units used in the chem.in files are cm3,mole,sec,kcal and K This was found out by comparing the mechanism found in samples/0D/chemistry_H2_ignition_delay with Flow Reactor Studies and Kinetic Modeling of the ReactionH/O22 of A. MUELLER, T. J. KIM, R. A. YETTER, F. L. DRYER |
||
This modules solves two reactive scalar advection equations This is used for modeling the spatial evolution of left and right handed aminoacids. |
||
Not a module |
||
This modules solves the cosmic ray energy density equation. It follows the description of Hanasz & Lesch (2002,2003) as used in their ZEUS 3D implementation. |
||
This modules solves the cosmic ray energy density equation. It follows the description of Hanasz & Lesch (2002,2003) as used in their ZEUS 3D implementation. |
||
Module for calculating Cosmic Ray Flux. |
||
Module containing global parameters (constants). |
||
Distributed debug-IO (i.e. each process writes its own file data/procX) |
||
HDF5 debug-IO module |
||
Parallel debug-IO via MPI2 (i.e. write to a single file in data/allprocs) |
||
This module takes care of the continuity equation. |
||
11-mar-15/MR: Created to avoid circular dependencies with EquationOfState. |
||
Dummy module for density_stratified, with which all density queries should be done in EquationOfState. |
||
This module is a copy of the ‘deriv_2nd’ module, but implements all derivatives, including up to 6th order, with 2nd order accuracy. In ‘deriv_2nd’ the 3rd or higher derivatives are otherwise unavailable. To provide higher derivatives in this module, nghost must be 3. |
||
This module is a copy of the ‘deriv_4th’ module, but implements all derivatives, including up to 6th order, with 4th order accuracy. In ‘deriv_4th’ the 5th or higher derivatives are otherwise unavailable. To provide higher derivatives in this module, nghost must be 4. |
||
This module searches for gravitationally collapsing sites and detonates them. |
||
This module takes care of everything related to dust density. |
||
This module takes care of everything related to dust velocity |
||
Module emulating not universally available intrinsics |
||
This module takes care of evolving the entropy. |
||
This module is for systems with spatially fixed entropy distribution. This implies Ds/Dt=u.grads only, which is used in Ds/Dt=(1/gamma)*Dlnp/Dt-Dlnrho/Dt, for example. This procedure has been used in the context of accretion discs (see von Rekowski et al., 2003, A&A 398, 825). The shock jump relations are modified (see Sect 9.3.6 of Brandenburg 2003, in “Computational aspects…”, ed. Ferriz-Mas & Nunez, Taylor & Francis, or astro-ph/0109497. |
||
This module takes care of entropy (initial condition and time advance) for a fluid consisting of gas and perfectly coupled pressureless dust. |
||
Equation of state for an ideal gas without ionization. |
||
Equation of state for an ideal gas without ionization. |
||
Thermodynamics with Fixed ionization fraction |
||
Equation of state for an ideal gas without ionization. |
||
This modules contains the routines for simulation with simple hydrogen ionization. |
||
Routine for ideal gas with variable degree of ionization and hence variable mean molecular weight. Here, the ionization fraction, yH, is allocated as an additional auxiliary array in f. |
||
subroutines in the chosen set of physics modules. |
||
This module allocates and manages indices in the f-array in a controlled way. This includes handling different types of variable that may be stored in the f-array like PDE variables, auxiliaries, communicated auxiliaries and global variables. |
||
Dynamical allocation of f and df. |
||
Not a module |
||
Not a module |
||
This module holds only common standard code for all File-IO modules. It is NOT meant to be used as a replacement for the other File-IO modules! |
||
This module goes straight and implements distributed file Input/Output. We use here only F95 features and are explicitly not HPC-friendly. |
||
This module goes straight and implements distributed file Input/Output. We use here only F2003 features (HPC-friendly). |
||
This module takes care of massive parallel file Input/Output. We use here only F95 features for HPC-friendly behaviour. |
||
Filters for smoothing, removing trends (like spurious build-up of horizontal momentum) and similar. |
||
Find the fixed points of a field line mapping. Field line mappings are maps of F(x,y) through field lines which trace point at z = z0 to z = z1. Fixed points are such that F(x,y) = (x,y) |
||
This module contains routines both for delta-correlated and continuous forcing. The fcont pencil is only provided for continuous forcing. |
||
This module contains FFT wrapper subroutines. |
||
This module contains FFT wrapper subroutines. |
||
Module with general utility subroutines. |
||
Collection of geometrical object types. (Presently only rectangular toroid) |
||
This module tests the ghost zones consistency. For more documentation about the ghost zones, please refer to Mpicomm.f90. |
||
This module folds ghost zones for a multiple processor run. |
||
This module folds ghost zones for a single processor run. |
||
This module contains GPU related types and functions to be used with the ASTAROTH nucleus. |
||
Radial gravity |
||
This module takes care of simple types of gravity, i.e. where gx=gx(x) or gy=gy(y) or gz=gz(z) Here the gravity master pencils gravx_xpencil, gravy_ypencil and gravz_zpencil only need to be calculated once, and then these can simply be added to the equations of motion again and again. |
||
This module takes care of massive parallel HDF5 file Input/Output. We use here only F95 and MPI features for HPC-friendly behaviour. |
||
This module takes care of massive parallel HDF5 file Input/Output. We use here only F95 and MPI features for HPC-friendly behaviour. |
||
This module computes the time depentend heat flux equation. The non-Fourier form is written tau * dq/dt + q = F(T,rho …) The analytical solution for constant F is that q converges exponential to F with a time scale of tau. |
||
This module takes care of most of the things related to velocity. Pressure, for example, is added in the energy (entropy) module. |
||
This module supplies a kinematic velocity field. Most of the content of this module was moved with revision r12019 by Dhrubaditya Mitra on 5-nov-09 away from nohydro.f90 To inspect the revision history of the file before that time, check out nohydro.f90 prior to or at revision r12018. |
||
This module takes care of most of the things related to velocity. Pressure, for example, is added in the energy (entropy) module. |
||
This module applies a sixth order hyperresistivity to the induction equation (following Brandenburg & Sarson 2002). This hyperresistivity ensures that the energy dissipation rate is positive define everywhere. |
||
This module applies a sixth order hyperviscosity to the equation of motion (following Haugen & Brandenburg 2004). This hyperviscosity ensures that the energy dissipation rate is positive define everywhere. |
||
This module applies a sixth order hyperviscosity to the equation of motion (following Haugen & Brandenburg 2004). This hyperviscosity ensures that the energy dissipation rate is positive define everywhere. |
||
This module provides general facilities to implicitly solve a diffusion equation. |
||
This module solves the radiative diffusion implicitly thanks to an Alternate Direction Implicit Scheme (ADI) in a D’Yakonov form lambda_x T(n+1/2) = lambda_x + lambda_z lambda_z T(n+1) = T(n+1/2) |
||
This module contains code used by the corresponding physics modules to set up various initial conditions (stratitication, perturbations, and other structures). This module is not used during run time (although it is used by the physics modules that are used both during run time and for the initial condition). |
||
This modules contains the routines for SNe-driven ISM simulations. Replaces old module relabelled as interstellar_old Jul 15 FAG. |
||
This modules contains the old routines for SNe-driven ISM simulations. It may be necessary to select this for using old simulation data |
||
I/O via MPI root rank by collecting data from all processors. (storing data into one file, e.g. data/allprocs/var.dat) |
||
I/O via MPI by collecting data from all processors in the xy-plane. (storing data into files, e.g. data/proc(0,7,15,…)/var.dat) |
||
I/O via MPI by collecting data from all processors in the xy-plane. (storing data into files, e.g. data/proc(0,7,15,…)/var.dat) |
||
Distributed IO (i.e. each process writes its own file data/procX) |
||
Distributed IO (i.e. each process writes its own file data/procX) |
||
I/O via the HDF5 hyperslab-by-chunk IO routines. (storing data into one file, e.g. data/allprocs/VAR#.h5) |
||
I/O via the MPI v2 standard IO routines. (storing data into one file, e.g. data/allprocs/var.dat) |
||
Lorenz gauge, dphi/dt = -cphi2*divA, with possibility to add diffusion and advection terms. The difficulty is that first derivatives are applied twice during one loop in the calculation of gauge waves. This leads to wiggles that are difficult to damp. |
||
Specific module only used by timestep_LSODE if chemistry is solved with the implicit solver LSODE for stiff ODEs. |
||
This modules deals with all aspects of magnetic fields; if no magnetic fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the magnetically relevant subroutines listed in here. |
||
This module takes care of code messages. |
||
This module takes care of MPI communication. |
||
This module is used both for the initial condition and during run time. It contains dlnrhon_dt and init_lnrhon, among other auxiliary routines. |
||
This module takes care of everything related to velocity |
||
This modules solves the passive scalar advection equation. |
||
Module for boundary conditions. Extracted from (no)mpicomm, since all non-periodic (external) boundary conditions require the same code for serial and parallel runs. |
||
This modules solves two reactive scalar advection equations This is used for modeling the spatial evolution of left and right handed aminoacids. |
||
This modules solves the passive scalar advection equation |
||
Not a module |
||
11-mar-15/MR: Created to avoid circular dependencies with EquationOfState. |
||
This module is dummy. |
||
This module takes care of everything related to dust density. |
||
This module takes care of everything related to dust velocity. |
||
Dummy module for energy equation. |
||
Calculates pressure gradient term for polytropic equation of state $p=text{const}rho^{Gamma}$. |
||
This module takes care of everything related to equation of state. |
||
This module contains routines both for delta-correlated and continuous forcing. The fcont pencil is only provided for continuous forcing. |
||
This module contains FFT wrapper subroutines. |
||
This module contains GPU related dummy types and functions. |
||
This module is a dummy module for non-HDF5 IO. 28-Oct-2016/PABoudin: coded |
||
no variable $uv$: useful for kinematic dynamo runs. |
||
This module applies a sixth order hyperresistivity to the induction equation (following Brandenburg & Sarson 2002). This hyperresistivity ensures that the energy dissipation rate is positive define everywhere. |
||
This module applies a sixth order hyperviscosity to the equation of motion (following Haugen & Brandenburg 2004). |
||
Dummy |
||
This module provide a way for users to specify custom initial conditions. |
||
Dummy module. |
||
Lorenz gauge, dphi/dt = -cphi2*divA |
||
This module calculates the chemistry contribution to df in the case where chemistry is solved separately using the LSODE solver |
||
Dummy module for MPI communication. This allows the code to run on a single CPU. |
||
This module is used both for the initial condition and during run time. It contains dlnrhon_dt and init_lnrhon, among other auxiliary routines. |
||
This module takes care of everything related to neutral velocity |
||
Module for NSCBC boundary conditions. To be included from boundcond.f90. |
||
This module is the dummy for the opacity module(s). |
||
This module takes care of everything related to dust particles. |
||
This modules takes care of adapting the number of particles in a grid cell to a desired value. This module is based on an original idea by Jacob Trier Frederiksen. |
||
This module takes care of everything related to particle surface fractions. |
||
Dummy module for particle breakup. |
||
This module writes information about the local state of the gas at the positions of a selected number of particles. |
||
This module takes care of everything related to particle chemistry |
||
This modules takes care of instantaneous coagulation, shattering, erosion, and bouncing of superparticles. |
||
This modules takes care of instantaneous collisions between superparticles. |
||
This modules takes care of condensation / evaporation or deposition / sublimation of superparticles |
||
This module takes care of everything related to the density represented by each (super)particle. |
||
This modules takes care of instantaneous collisions between superparticles. |
||
This modules takes care of instantaneous collisions between superparticles. |
||
This module takes care of drag forces between particles and gas. |
||
This module tries to solve for gradient matrix of particle velocities |
||
Dummy version of k-means vector quantization algorithm using the Forgy initialisation of the codebook. |
||
This module writes information about the local state of the gas at the positions of a selected number of particles. |
||
This module contains all the main structure needed for particles. |
||
This module contains subroutines for mapping particles on the mesh. |
||
This module takes care of everything related to the mass of the particles. |
||
This module deals with communication of particles between processors. |
||
This module takes care of everything related to particle number. |
||
This module calculates the probability distribution function the particles that have moved a certain distance away from their initial position. |
||
The no module for particles potential |
||
This module takes care of everything related to particle radius. |
||
This module takes care of everything related to particle self-gravity. |
||
This module takes care of everything related to sink particles. |
||
This module takes care of everything related to particle spin. |
||
This module writes information about the local state of the gas at the positions of a selected number of particles. |
||
This module takes care of stirring of particles. |
||
This module contains subroutines useful for the Particle module. |
||
This module takes care of everything related to particle surface fractions. |
||
This module takes care of everything related to particle temperature. |
||
This module takes care of direct N-body gravity between point masses. |
||
This module solves the Poisson equation. |
||
This modules deals with all aspects of polymers. |
||
reads in full snapshot and calculates power spetrum of u |
||
This modules solves the passive scalar advection equation. |
||
This module takes care of self gravity. |
||
This module is the dummy for the SGS_hydro module in which e.g the SGS viscous force or viscous heat is computed. |
||
This modules deals with all aspects of shear; if no shear is invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the shear relevant subroutines listed in here. |
||
This module calculates a divergence of u based shock finding profile used by shock viscosities and diffusion terms. eg. the total voscosity is taken as: nu_total = nu + nu_shock*dx*smooth(max5(-(div u)))) where dx*smooth(max5(-(div u)))) is the profile calculated here in. |
||
This module produces slices for animation purposes. |
||
This module add solid (as in no-fluid) cells in the domain. This can be used e.g. in order to simulate a cylinder in a cross flow. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
||
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
||
test perturbation method |
||
This modules deals with all aspects of testscalar fields; if no testscalar fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testscalar relevant subroutines listed in here. |
||
This module is the dummy for the viscosity module in which e.g the viscous force or viscous heat is computed. |
||
This module take care of WENO (weighted essentially non oscillatory) transport. |
||
This module contains Yin-Yang related dummy types and functions. |
||
This module contains Yin-Yang related dummy types and functions. |
||
Module for NSCBC (Navier-Stokes Characteristic Boundary Conditions). NSCBC is an alternative way of imposing (time-dependent) boundary conditions through solving differential equations on the boundaries. |
||
IO of init and run parameters. Subroutines here are ‘at the end of the food chain’, i.e. depend on all physics modules plus possibly others. Using this module is also a compact way of referring to all physics modules at once. |
||
This modules takes care of adapting the number of particles in a grid cell to a desired value. This module is based on an original idea by Jacob Trier Frederiksen and was developed by Anders Johansen and Chao-Chin Yang. |
||
This module takes care of the evolution of adsorbed species on the particle surface for reactive particles |
||
Secondary breakup of Lagrangian liquid parcels. |
||
This modules solves for the gradient matrix of flow velocities. The gradient matrix Sigma obeys the equation: (d/dt) Sigma = (1/(taup))*(S - Sigma) - Sigma^2 where A is the flow gradient matrix at the position of the particle; and taup is the Stokes time. |
||
Global particle variables |
||
This module takes care of everything related to inertial particles. |
||
This module implements reactive particles. |
||
This modules takes care of instantaneous coagulation, shattering, erosion, and bouncing of superparticles. |
||
This modules takes care of instantaneous collisions between superparticles. |
||
This module takes care of everything related to the density represented by each (super)particle. |
||
This module bins particle pairs in separation and relative velocity at regular intervals. |
||
This module tracks the evolution of particles in terms of user defined “states”. Currently the only implemented state is in terms of the local gas velocity. |
||
This module integrates drag forces between particles and gas. |
||
This module takes care of everything related to inertial particles. |
||
This module takes care of everything related to dust particles. |
||
Eikonal solver, “particles” refer here to points on the trajectory. |
||
This module tries to solve for gradient matrix of particle velocities |
||
This module takes care of everything related to inertial particles. |
||
This module writes information about the local state of the gas at the positions of a selected number of particles. |
||
This module contains all the main structure needed for particles. |
||
This module contains subroutines for mapping particles on the mesh. Different domain decompositions have different versions of this module. |
||
This module contains subroutines useful for mapping particles on the mesh. |
||
This module contains subroutines for particle-mesh related operations. |
||
This module takes care of everything related to the mass of the particles. |
||
This module handles the mass of super-particles. |
||
This module deals with communication of particles between processors. |
||
This module deals with communication of particles between processors. |
||
This module takes care of everything related to internal particle number. |
||
This module calculates the probability distribution function the particles that have moved a certain distance away from their initial position. |
||
This module takes care of everything related to pairwise interaction of particles. It is experimental now (April 2016) |
||
This module takes care of everything related to particle radius. |
||
This module takes care of everything related to particle self-gravity by inverting the Poisson equation of the particle density mapped on the grid. |
||
This module takes care of everything related to sink particles. |
||
This module takes care of everything related to particle spin including lifting forces. The module maintains a full f-array vorticity field, to be able to interpolate on the flow vorticity. |
||
This module writes information about the local state of the gas at the positions of a selected number of particles. |
||
This module takes care of stirring of particles. |
||
This module contains useful subroutines for the particle modules. Subroutines that depend on domain decomposition should be put in the Particles_map module. |
||
This module takes care the gas phase species in the immediate vicinity of reactive particles. |
||
This module takes care of everything related to inertial particles. |
||
Follow a particle. For this particle solve for three other particles that that are in the neighbourhood of the particle we were following. These four particles together forms a tetrad. |
||
This module takes care of everything related to tracer particles. |
||
Not a module |
||
Module to handle variables whose state should persist between executions of run.x, e.g. the random number seeds and some other forcing state information. |
||
This module takes care of direct N-body gravity between point masses. |
||
This module solves the Poisson equation (d^2/dx^2 + d^2/dy^2 + d^2/dz^2 - h) f = RHS(x,y,z) [which for h/=0 could also be called inhomogenous nonuniform Helmholtz equation] for the function f(x,y,z). |
||
This module contains (more or less) a replica of poisson.f90, implementing the version of poisson equation solving that I have been building (the method outlined in Clement Baruteau’s thesis). |
||
This module solves the Poisson equation (d^2/dx^2 + d^2/dy^2 + d^2/dz^2 - h) f = RHS(x,y,z) [which for h/=0 could also be called inhomogenous nonuniform Helmholtz equation] for the function f(x,y,z), starting from the second-order accurate 7-point discretization of that equation. |
||
This modules deals with all aspects of polymers. |
||
PURPOSE - Solve for the roots of a polynomial equation with real coefficients, up to quartic order. Returns a code indicating the nature of the roots found. |
||
reads in full snapshot and calculates power spetrum of u |
||
This modules solves the passive scalar advection equation. |
||
This modules solves (multiple) passive scalar advection equation(s) Solves for c, not ln(c). |
||
Radiation (solves transfer equation along rays). |
||
Not a module |
||
Not a module |
||
Not a module |
||
A module for setting up the f-array and related variables (‘register’ the velocity, energy, magnetic, etc modules). |
||
This module takes care of self gravity by solving the Poisson equation (d^2/dx^2 + d^2/dy^2 + d^2/dz^2)phi = 4*pi*G*rho for the potential phi. |
||
This module takes care of self gravity by solving the Poisson equation (d^2/dx^2 + d^2/dy^2 + d^2/dz^2)phi = 4*pi*G*rho for the potential phi. |
||
This module is the dummy for the SGS_hydro module in which e.g the SGS force or heat is computed. |
||
This module is an interface to allow modules to register pointers to their internal variables so that other modules may then request them by name. |
||
This modules deals with all aspects of shear; if no shear is invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the shear relevant subroutines listed in here. |
||
This modules implements viscous heating and diffusion terms here for shock viscosity nu_total = nu + nu_shock*dx^2*smooth(max5(-(div u)))) |
||
This modules implements viscous heating and diffusion terms here for shock viscosity nu_total = nu + nu_shock*dx^2*smooth(max5(-(div u)))) |
||
This module produces slices for animation purposes. |
||
This module provides routines for obtaining slice data. |
||
Write snapshot files (variables and power spectra). |
||
This module add solid (as in no-fluid) cells in the domain. This can be used e.g. in order to simulate a cylinder in a cross flow. |
||
This module add solid (as in no-fluid) cells in the domain. This can be used e.g. in order to simulate a cylinder in a cross flow. |
||
This modules addes chemical species and reactions. The units used in the chem.in files are cm3,mole,sec,kcal and K This was found out by comparing the mechanism found in samples/0D/chemistry_H2_ignition_delay with Flow Reactor Studies and Kinetic Modeling of the ReactionH/O22 of A. MUELLER, T. J. KIM, R. A. YETTER, F. L. DRYER |
||
Not a module |
||
Calculates 2-point structure functions and/or PDFs and saves them during the run. |
||
This module contains useful subroutines. |
||
This module takes care of system calls and provides ANSI-C functionality. |
||
This module can replace the energy module by using lnT or T (with ltemperature_nolog=.true.) as dependent variable. For a perfect gas with constant coefficients (no ionization) we have: (1-1/gamma) * cp*T = cs20 * exp( (gamma-1)*ln(rho/rho0)-gamma*s/cp ) |
||
This module can replace the energy module by using lnT or T (with ltemperature_nolog=.true.) as dependent variable. |
||
Test-field module for axisymmetric turbulence. No special settings in cparam.local are needed. |
||
Test-field module for axisymmetric turbulence. No special settings in cparam.local are needed. |
||
This modules deals with all aspects of testflow fields; if no testflow fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testflow relevant subroutines listed in here. |
||
This module can replace the energy module by using the thermal energy eth as dependent variable. For a perfect gas we have |
||
Runge-Kutta time advance, accurate to order itorder. At the moment, itorder can be 1, 2, or 3. |
||
Timestepping routine corresponding to the use of LSODE to solve chemistry. The transport equations are solved as usual using RK methods but the chemistry ODEs are separated and solved implicitly using LSODE either following a sequential (1 chemistry step) or symmetric (2 chemistry steps) splitting scheme. |
||
Runge-Kutta-Fehlberg Low-Storage method Christopher A. Kennedy, Mark H. Carpenter, R.Michael Lewis, Low-storage, explicit Runge-Kutta schemes for the compressible Navier-Stokes equations, Applied Numerical Mathematics, Volume 35, Issue 3, 2000, Pages 177-219, ISSN 0168-9274, https://doi.org/10.1016/S0168-9274(99)00141-5. |
||
adapted from timestep_rkf, and from numerical recipe stiff algorithm |
||
Runge-Kutta time advance, accurate to order itorder. At the moment, itorder can be 1, 2, or 3. Split one dt into two dt/2 steps with RK method. Please add documentation on why this is beneficial… |
||
This modules implements viscous heating and diffusion terms here for cases 1) nu constant, 2) mu = rho.nu 3) constant and |
||
This module take care of WENO (weighted essentially non oscillatory) transport. |
||
Not a module |
||
This module contains Yin-Yang related types and functions which are incompatible with FORTRAN 95. |
||
This module contains Yin-Yang related types and functions which are incompatible with FORTRAN 95. |
experimental source files (src/experimental)
The src/experimental directory contains 41 Fortran files.
File |
Description |
Scientific References |
|---|---|---|
use EMD, only: analyzer_emd |
||
This module solves the Poisson equation for pressure for the linearized density |
||
This module implements gas/dust self-gravity using a Barnes-Hut octree algorithm. The main function, do_barneshut, takes the variable ‘phi’ as input, which is the gas/dust density grid from the selfgravity module, and modifies ‘phi’ in place, becoming the gravitational potential. |
||
23-mar-2012/dintrans: coded |
||
This module takes care of heat conductivity for the energy equation. |
||
Module for calculating Cosmic Ray Flux. |
||
This modules solves the cosmic ray energy density equation. It follows the description of Hanasz & Lesch (2002,2003) as used in their ZEUS 3D implementation. |
||
This module takes care of energy (initial condition and time advance) |
||
Equation of state for an ideal gas with variable water vapour. |
||
This module takes care of massive parallel file Input/Output. We use here F2003 features for HPC-friendly behaviour. |
||
This module contains routines both for delta-correlated and continuous forcing. The fcont pencil is only provided for continuous forcing. |
||
Radial gravity |
||
This module solve the momentum equation for relativistic force-free MHD dS/dt = curlB x B + curlE x E + divE E where E = (BxS)/B^2 |
||
Relativistic treatment of force-free magnetic fields. Still quite experimental. This modules deals with all aspects of magnetic fields; if no magnetic fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the magnetically relevant subroutines listed in here. |
||
This modules deals with all aspects of magnetic fields; if no magnetic fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the magnetically relevant subroutines listed in here. |
||
This module takes care of MPI communication. |
||
This module takes care of everything related to velocity |
||
Dummy module for conductivity. |
||
Dummy module for MPI communication. This allows the code to run on a single CPU. |
||
This module takes care of everything related to inertial particles. |
||
This module takes care of everything related to inertial particles. |
||
This module deals with communication of particles between processors. |
||
This module takes care of direct N-body gravity between particles. |
||
This module takes care of everything related to pairwise interaction of particles. It is experimental now (April 2016) |
||
This module takes care of everything related to particle radius. |
||
This module takes care of everything related to particle radius. |
||
Not a module |
||
This module solves the Poisson equation in cylindrical coordinates (d^2/dr^2 +1/r*d/dr + 1/r^2*d^2/dy^2 + d^2/dz^2) f = RHS(x,y,z) |
||
This module solves the Poisson equation (d^2/dx^2 + d^2/dy^2 + d^2/dz^2 - h) f = RHS(x,y,z) [which for h/=0 could also be called inhomogenous nonuniform Helmholtz equation] for the function f(x,y,z). The difference between this and poisson.f90 is that here we solve it in a non-periodic Cartesian grid, expanding the grid to curb the periodicity of the Fourier transforms. |
||
This modules implements viscous heating and diffusion terms here for shock viscosity nu_total = nu + nu_shock*dx^2*smooth(max5(-(div u)))) |
||
This module add solid (as in no-fluid) cells in the domain. This can be used e.g. in order to simulate a cylinder in a cross flow. Now, apart from the circle geometry, a 2D geometry file similar to STL can be used to represent the solid cells.Details can be found in the paper “A ghost-cell immersed boundary method for the simulations of heat transfer in compressible flows under different boundary conditions Part-II: Complex geometries” |
||
This module add solid (as in no-fluid) cells in the domain. This can be used e.g. in order to simulate a cylinder in a cross flow. |
||
This modules contains the routines for SNe-driven ISM simulations. Still in development. |
||
This modules adds chemical species and reactions. The units used in the chem.in files are cm3,mole,sec,kcal and K |
||
Equation of state for an ideal gas without ionization. |
||
Not a module |
||
test perturbation method |
||
DuFort-Frankel time stepping routine. As is well known, this proceedure has disadvantages, but it is well suited to deal with the time step constrain near the center in spherical polar coordinates. |
inactive source files (src/inactive)
The src/inactive directory contains 4 Fortran files.
File |
Description |
Scientific References |
|---|---|---|
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
||
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
initial_condition source files (src/initial_condition)
The src/initial_condition directory contains 67 Fortran files.
File |
Description |
Scientific References |
|---|---|---|
21-feb-23/hongzhe: adapted from initial_condition/centrifugal_balance.f90 |
||
This module provide a way for users to specify custom initial conditions. |
||
This module sets up an Alfven wave of amplitude init_amp0 with wave vector init_k0 and an optional phase init_phase0. |
||
This module provide a way for users to specify custom initial conditions. |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of a braided magnetic field with magnetic domes with nulls. |
||
Initial condition for a Bonnor-Ebert sphere |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of magnetic tubes. |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of a braided magnetic field. |
||
Initial condition for bubbles in a stratified medium. Set bubble size, bubble density, surrounding medium density, temperatures, stratification and magnetic field. |
||
This module provide a way for users to specify custom initial conditions. |
||
This module provide a way for users to specify custom initial conditions. |
||
Set the initial conditions for the CIG Community Accuracy & Performance Benchmark: http://geodynamics.org/cig/community/workinggroups/geodyn/benchmark/ following Christensen et al. Physics of the Earth and Planetary Interiors, 128, 25-34 (2001). |
||
This module provide a way for users to specify custom initial conditions. |
||
Initial condition (density, magnetic field, velocity) for magnetohydrostatical equilibrium in a global accretion disk in a cylindrically symmetric profile in spherical coordinates. with a polytropic equation of state including entropy equation |
||
This module provide a way for users to specify custom initial conditions. |
||
This module provide a way for users to specify custom initial conditions. |
||
This module provide a way for users to specify custom initial conditions. |
||
Initial condition (density, magnetic field, velocity) for magnetohydrostatical equilibrium in a global accretion disk with an imposed (cylindrically symmetric) sound speed profile in spherical coordinates. |
||
Magnetic flux rings. Constructed from a canonical ring which is the rotated and translated; see Pencil Code manual, Section C.3. |
||
Initial condition (density, magnetic field, velocity) for magnetohydrostatical equilibrium in a global accretion disk with an imposed (cylindrically symmetric) sound speed profile in spherical coordinates. |
||
Horizontal flux layer in B_y, with tanh profiles switching on (off) at z0 (z1) Density and entropy also set appropriately. To reproduce initial condition in Catteneo & Hughes, JFM, v. 196, p. 323, 1988 |
||
This module provide a way for users to specify custom initial conditions. |
||
This module provide a way for users to specify custom initial conditions. |
||
Initial condition (density, magnetic field, velocity) for a field created externally in pencil code format. The file must be in an appropriate format with the right order of indices and match with start.in. USE WITH CAUTION! |
||
Initial condition (density, magnetic field, velocity) for a field from the code GLEMuR. |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of a magnetic tube. |
||
This module provide a way for users to specify custom initial conditions. |
||
Kelvin-Helmholtz initial condition from Lecoanet et al. (2016, MNRAS 455, 4274) |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of magnetic tubes. |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of magnetic carpets. |
||
Initial condition (density, magnetic field, velocity) for magnetohydrostatical equilibrium in a global accretion disk with an imposed (cylindrically symmetric) sound speed profile in spherical coordinates. |
||
Initial condition (density, magnetic field, velocity) for magnetohydrostatical equilibrium in a global accretion disk with an imposed (cylindrically symmetric) sound speed profile in spherical coordinates. |
||
Initial condition (magnetic field, velocity) for the MRI cycle described in |
||
This module provide a way for users to specify custom initial conditions. |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of magnetic tubes. |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of a magnetic tube. |
||
Initial condition for run without vertical shear using the (unphysical) modified gravity profile of Klahr et al. (2023) |
||
Initial condition (density, magnetic field, velocity) for magnetohydrostatical equilibrium in a global accretion disk with an imposed (cylindrically symmetric) sound speed profile in spherical coordinates. |
||
Initial condition for the parker wind in spherical coordinates. |
||
This module provide a way for users to specify custom initial conditions. |
||
Shock-Cloud Initial Condition sets up a 2D version similar to The Magnetohydrodynamics of Shock-Cloud Interaction in Three Dimensions Min-Su Shin, James M Stone, and Gregory F Snyder http://adsabs.harvard.edu/cgi-bin/nph-data_query?bibcode=2008ApJ…680..336S&link_type=ABSTRACT |
||
This module provide a way for users to specify custom initial conditions. |
||
Initial condition for a stably tratified solar atmosphere from the convection zone to the corona, with a Omega shaped magnetic field loop. |
||
Isentropic initial condition (density, entropy) for convection in spherical coordinates. Produces an isentropic stratification with given surface gravity and surface temperature, and a heat conduction profile proportional to r^-15. The setup was originally introduced in Astron. Nachr., 332, 883. |
||
31-oct-2011/dintrans: coded (moved here my two subroutines from the entropy module after discussions during the 2011 PC meeting in Toulouse). This module initializes the star-in-a-box setup with a central heating. |
||
Piecewise polytopic initial condition for star-in-a-box models |
|
|
This module sets up nonlinear streaming instability with multiple particle species. |
||
This module loads an existing snapshot and interpolates it to the current grid as the initial condition. The snapshot should be saved as a global snapshot in a single file (default name: tabulated.dat) under the run directory. The user should specify its dimensions using nxtab, nytab, and nztab. The number of variables in the snapshot must be consistent with the current mfarray. |
||
This module provides a 1D profile of density and temperature for the initial conditions to be applied for supernova driven turbulence simulations in the interstellar medium. After the 1D profile converges to an equilibrium state save the profiles of rho and tt to init_ism.dat, which will be imported by initial_condition/ths_equilibrium_ism.f90 for 3D simulations |
||
Initial conditions for 3D equilibrium supernova driven turbulence simulations. First run 1D simulation using identical z grid with initial_condition/ths1D_equilibrium_ism.f90. This module will load the converged 1D profiles derived and saved to init_ism.dat (now init_ism.in). |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of magnetic flux rings. |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of a twsited magnetic field tube(s). |
||
17-jul-12/piyali: adapted from fluxrings.f90 but for spherical geometry. Also some major changes, hence a new initial condition |
||
Initial condition for spherical viscous ring, according to the test of Frederic Masset, |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of a braided vortex field. |
||
Initial condition for sin(kz) or cos(kz) magnetic field. |
||
Initial condition (density, magnetic field, velocity) for a particular configuration of magnetic tubes. |
magnetic source files (src/magnetic)
The src/magnetic directory contains 5 Fortran files.
File |
Description |
Scientific References |
|---|---|---|
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This modules solves mean-field contributions to both the induction and the momentum equations. |
||
This modules solves mean-field contributions to both the induction and the momentum equations. |
||
This modules solves mean-field contributions to both the induction and the momentum equations. |
||
Dummy module for mean-field contributions |
obsolete source files (src/obsolete)
The src/obsolete directory contains 16 Fortran files.
File |
Description |
Scientific References |
|---|---|---|
This module takes care of the continuity equation. |
||
A module container and access functions (‘methods’) for additional variables which are globally needed — here this is the gravity field gg, and an external magnetic field (such that B=curl(A)+B_ext_pot) |
||
This module fetchs the position of the massive n-body particles and applies extra shock dissipation around them. This allows for less shock dissipation to be used elsewhere in the quiescent regions of the simulation box. |
||
This modules deals with all aspects of magnetic fields; if no magnetic fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the magnetically relevant subroutines listed in here. |
||
This modules deals with all aspects of magnetic fields; if no magnetic fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the magnetically relevant subroutines listed in here. |
||
This module takes care of system calls and provides ANSI-C functionality. |
||
This module takes care of direct N-body gravity between particles. |
||
Radiation in the fluxlimited-diffusion approximation. Doesn’t work convincingly (and maybe never will). Look at the (still experimental) module radiation_ray.f90 for a more sophisticated approach. |
||
Radiation (solves transfer equation along rays) The direction of the ray is given by the vector (lrad,mrad,nrad), and the parameters radx0,rady0,radz0 gives the maximum number of steps of the direction vector in the corresponding direction. |
||
This module replaces the entropy module by using lnT as dependent variable. For a perfect gas with constant coefficients (no ionization) we have (1-1/gamma) * cp*T = cs02 * exp( (gamma-1)*ln(rho/rho0)-gamma*s/cp ) At a later point we may want to rename the module Entropy into Energy |
||
This module can replace the entropy module by using _T_ as dependent variable. For a perfect gas with constant coefficients (no ionization) we have (1-1/gamma) * cp*T = cs02 * exp( (gamma-1)*ln(rho/rho0)-gamma*s/cp ) |
||
This modules implements viscous heating and diffusion terms here for third order hyper viscosity |
||
This modules implements viscous heating and diffusion terms here smagorinsky viscosity |
||
This modules implements viscous heating and diffusion terms here for cases 1) nu constant, 2) mu = rho.nu 3) constant and |
pre_and_post_processing source files (src/pre_and_post_processing)
The src/pre_and_post_processing directory contains 11 Fortran files.
File |
Description |
Scientific References |
|---|---|---|
Not a module |
||
Not a module |
||
Not a module |
||
Not a module |
||
Not a module |
||
Not a module |
||
Not a module |
||
Not a module |
||
Not a module |
||
Not a module |
||
Not a module |
special source files (src/special)
The src/special directory contains 71 Fortran files.
File |
Description |
Scientific References |
|---|---|---|
Advecto-resistive gauge, dLamRA/dt = -u.gradLamRA - U.A_resistive + eta*del2A_resistive A_advecto-resistive=A_resistive+grad(LamRA) |
||
This module solves for a viscously diffusive disk according to the alpha-formalism, also adding photoevaporation. It is a one-dimensional evolutionary model, that evolves the disk over its multimillion year lifetime. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
|
|
This module incorporates all the modules used for Natalia’s aerosol simulations |
||
Solve the lucky droplet model for many realizations. The different realizations correspond to “meshpoints”. To add the contributions for each step, we use the usual time step in the Pencil Code, so t is just the step, and the accumulated collision times (after 125 steps or so) for all realizations at the same time are the values in the f-array. |
||
Solve axion-U(1) inflation model for many wavenumber values. The different wavenumber correspond to 1D “meshpoints”. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module sets the open boundary conditions for density in the vertical direction, scaled by stratificaiton. |
||
Add Coriolis force in the beta plane approximation to the hydro equation. The x-axis is in the direction of increasing colatitude, while the z-axis is the radial direction. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module incorporates all the modules used for Natalia’s neutron star – disk coupling simulations (referred to as nstar) |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
Special module that damps the velocity field outside a user-specified cuboid. Useful in cases where you do not want waves reflected from the boundary to interfere with the interior of the domain. |
||
Electric field, dE/dt = curlB-mu0*J, originally only for the special case of no fluid induction, but now fluid motions are also included. |
||
Dynamical equations for electroweak SU(2) non-Abelian gauge fields |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
Lorenz gauge, dphi/dt = -cphi2*divA |
||
Solve the lucky droplet model for many realizations. The different realizations correspond to “meshpoints”. To add the contributions for each step, we use the usual time step in the Pencil Code, so t is just the step, and the accumulated collision times (after 125 steps or so) for all realizations at the same time are the values in the f-array. |
||
This module serves as a sample for a special_XXX module that introduces additional primitive variables. Use this as a basis for your own special_ module if you need one. |
||
This module serves as a sample for a special_XXX module that introduces additional primitive variables. Use this as a basis for your own special_ module if you need one. |
||
This module serves as a sample for a special_XXX module that introduces additional primitive variables. Use this as a basis for your own special_ module if you need one. |
||
Mean field dynamo equation |
||
This special module will contribute a mean electromotive force to the vector potential differential equation. |
||
This module handles diagnostics that are related with dust-gas velocities in drag equilibrium, computed by initial_condition/streaming_instability.f90. |
||
This module incorporates all the modules used for Natalia’s neutron star – disk coupling simulations (referred to as nstar) |
||
Solve for a set of two ODEs, used to test time step |
||
Solve for a set of two ODEs, used to test time step |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
Parametric instability with a time-dependent forcing |
||
This module includes physics related to planet atmospheres. |
||
Thie module addes pressure bumps to your simulations. They are needed e.g. when simulating the effects of a pressure bump on particle drift, particle trapping and planetesimal formation via gravitational fragmentation. |
||
Calculate the radial distribution function based on a pre-generated input file. This input file is generated by first reading the stored data into IDL by the routine: f90/pencil-christer/isoth_expwave/idl/pvar.pro then the input file is generated with an adapted version of the following routine: f90/pencil-christer/isoth_expwave/idl/rnp256.pro Finally you can then run start.csh with something like the following start.in file: |
||
Solve for a set of two ODEs, used to test time step |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module calculates a number of outputs and removes a mean (phi-averaged) emf from the simulations with net vertical fields on global accretion disks |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
Runs a shell model (only GOY implemented) for turbulence Copied from Dhruba’s code Uses a slaved, Adams-Bashforth scheme run in parallel with the PC time stepping |
||
This module is currently fairly much obsolete. This module incorporates all the modules used for Natalia’s neutron star – disk coupling simulations (referred to as nstar) |
||
This module solves for a streamfunction for the 2D velocity field. |
||
This module solves for a streamfunction for the 2D velocity field. |
||
This module solves for a streamfunction for the 2D velocity field. |
||
This module solves for a streamfunction for the 2D velocity field. |
||
This module solves for a streamfunction for the 2D velocity field. |
||
Solve for a set of two ODEs, used to test time step |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc. |
||
Solve the Van der Pol oscillator equations |
test_methods source files (src/test_methods)
The src/test_methods directory contains 11 Fortran files.
File |
Description |
Scientific References |
|---|---|---|
Test-field module for axisymmetric turbulence. No special settings in cparam.local are needed. |
||
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
||
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
||
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
||
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
|
|
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
||
This modules deals with all aspects of testfield fields; if no testfield fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testfield relevant subroutines listed in here. |
||
This modules deals with all aspects of testscalar fields; if no testscalar fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testscalar relevant subroutines listed in here. |
||
This modules deals with testscalar fields for axisymmetric turbulence testscalar fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testscalar relevant subroutines listed in here. |
||
This modules deals with all aspects of testscalar fields; if no testscalar fields are invoked, a corresponding replacement dummy routine is used instead which absorbs all the calls to the testscalar relevant subroutines listed in here. |