rel_1d
Module
Description
$Id$
This module provide a way for users to specify custom (i.e. not in the standard Pencil Code) physics, diagnostics etc.
The module provides a set of standard hooks into the Pencil-Code and currently allows the following customizations:
- Special variable registration | register_special
(pre parameter read) |
- Special variable initialization | initialize_special
(post parameter read) |
- Special variable finalization | finalize_special
- (deallocation, etc.) |
- Special initial condition | init_special
this is called last so may be used to modify | the mvar variables declared by this module | or optionally modify any of the other f array | variables. The latter, however, should be | avoided where ever possible. |
Special term in the mass (density) equation | special_calc_density Special term in the momentum (hydro) equation | special_calc_hydro Special term in the energy equation | special_calc_energy Special term in the induction (magnetic) | special_calc_magnetic
- equation |
- Special equation | dspecial_dt
NOT IMPLEMENTED FULLY YET - HOOKS NOT PLACED INTO THE PENCIL-CODE
** AUTOMATIC CPARAM.INC GENERATION ************************ Declare (for generation of rel_1d_dummies.inc) the number of f array variables and auxiliary variables added by this module
CPARAM logical, parameter :: lspecial = .true.
MVAR CONTRIBUTION 2 MAUX CONTRIBUTION 2
PENCILS PROVIDED bet
HOW TO USE THIS FILE
- Change the line above to
lspecial = .true.
to enable use of special hooks.
The rest of this file may be used as a template for your own special module. Lines which are double commented are intended as examples of code. Simply fill out the prototypes for the features you want to use.
Save the file with a meaningful name, eg. geo_kws.f90 and place it in the $PENCIL_HOME/src/special directory. This path has been created to allow users ot optionally check their contributions in to the Pencil-Code SVN repository. This may be useful if you are working on/using the additional physics with somebodyelse or may require some assistance from one of the main Pencil-Code team.
To use your additional physics code edit the Makefile.local in the src directory under the run directory in which you wish to use your additional physics. Add a line with all the module selections to say something like:
SPECIAL=special/geo_kws
Where geo_kws it replaced by the filename of your new module upto and not including the .f90
Quick access
- Variables:
alp,amplspecial,bet0,ibet,ibss,idiag_betm,idiag_betmax,ieee,initspecial,ippp,isss,lbet_as_aux,ralp
Needed modules
cdata: $Id$general(keep_compiler_quiet()): $Id$messages(svn_id(),fatal_error()): $Id$
Variables
- rel_1d/alp [real,private/optional/default=0.0]
- rel_1d/amplspecial [real,private/optional/default=0.1]
- rel_1d/bet0 [real,private/optional/default=0.001]
- rel_1d/ibet [integer,private/optional/default=0]
- rel_1d/ibss [integer,private/optional/default=0]
- rel_1d/idiag_betm [integer,private/optional/default=0]
DIAG_DOC: $left<betaright>$
- rel_1d/idiag_betmax [integer,private/optional/default=0]
DIAG_DOC: $beta_{max}$
- rel_1d/ieee [integer,private/optional/default=0]
- rel_1d/input_persistent_special [public]
- rel_1d/ippp [integer,private/optional/default=0]
- rel_1d/isss [integer,private/optional/default=0]
- rel_1d/lbet_as_aux [logical,private/optional/default=.false.]
- rel_1d/nu [real,private/optional/default=0.0]
- rel_1d/r0 [real,private/optional/default=3.0]
- rel_1d/width [real,private/optional/default=0.1]
Subroutines and functions
- subroutine rel_1d/register_special()
Set up indices for variables in special modules.
6-oct-03/tony: coded
- Use :
- Call to:
- subroutine rel_1d/initialize_special(f)
Called after reading parameters, but before the time loop.
06-oct-03/tony: coded
- Parameters:
- Call to:
- subroutine rel_1d/init_special(f)
initialise special condition; called from start.f90 06-oct-2003/tony: coded
- Parameters:
- Use :
initcond(gaunoise(),sinwave_phase(),hat(),power_randomphase_hel(),power_randomphase())- Call to:
- subroutine rel_1d/pencil_criteria_special()
All pencils that this special module depends on are specified here.
18-jul-06/tony: coded
- Call to:
- subroutine rel_1d/calc_pencils_special(f, p)
Calculate Special pencils. Most basic pencils should come first, as others may depend on them.
24-nov-04/tony: coded
- Parameters:
- Call to:
- subroutine rel_1d/dspecial_dt(f, df, p)
calculate right hand side of ONE OR MORE extra coupled PDEs along the ‘current’ Pencil, i.e. f(l1:l2,m,n) where m,n are global variables looped over in equ.f90
Due to the multi-step Runge Kutta timestepping used one MUST always add to the present contents of the df array. NEVER reset it to zero.
Several precalculated Pencils of information are passed for efficiency.
- 06-oct-03/tony: coded
2-nov-21/axel: first set of equations coded
- Parameters:
- Use :
diagnostics(sum_mn_name(),max_mn_name()),deriv(der()),sub(del2())- Call to:
- subroutine rel_1d/read_special_init_pars(iomsg)
- Parameters:
iomsg [character,out]
- Use :
- Call to:
- subroutine rel_1d/write_special_init_pars(unit)
- Parameters:
unit [integer,in]
- Call to:
- subroutine rel_1d/read_special_run_pars(iomsg)
- Parameters:
iomsg [character,out]
- Use :
- Call to:
- subroutine rel_1d/write_special_run_pars(unit)
- Parameters:
unit [integer,in]
- Call to:
- subroutine rel_1d/rprint_special(lreset, lwrite)
Reads and registers print parameters relevant to special.
06-oct-03/tony: coded
- Parameters:
lreset [logical]
lwrite [logical]
- Use :
- Call to:
- subroutine rel_1d/get_slices_special(f, slices)
Write slices for animation of Special variables.
26-jun-06/tony: dummy
- Parameters:
slices [slice_data]
- Use :
- Call to: