oscillation_3D
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 oscillation_3D_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 0
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:
ampl_dpsi,ampl_psi,cutoff_psi,idiag_dpsirms,idiag_psirms,init_psi,initpower2_dpsi,initpower2_psi,initpower_dpsi,initpower_psi,kgaussian_dpsi,kgaussian_psi,kpeak_dpsi,kpeak_psi,lno_noise_psi,lscale_tobox_dpsi,lscale_tobox_psi,lskip_projection_psi,lvectorpotential,modulation_fact,ncutoff_psi,relhel_psi- Routines:
Needed modules
cdata: $Id$general(keep_compiler_quiet()): $Id$messages(svn_id(),fatal_error()): $Id$
Variables
- oscillation_3d/ampl_dpsi [real,private/optional/default=0.0]
- oscillation_3d/ampl_psi [real,private/optional/default=0.0]
- oscillation_3d/cutoff_psi [real,private/optional/default=0.0]
- oscillation_3d/idiag_dpsirms [integer,private/optional/default=0]
- oscillation_3d/idiag_psirms [integer,private/optional/default=0]
- oscillation_3d/initpower2_dpsi [real,private/optional/default=0.0]
- oscillation_3d/initpower2_psi [real,private/optional/default=0.0]
- oscillation_3d/initpower_dpsi [real,private/optional/default=0.0]
- oscillation_3d/initpower_psi [real,private/optional/default=0.0]
- oscillation_3d/input_persistent_special [public]
- oscillation_3d/kgaussian_dpsi [real,private/optional/default=0.0]
- oscillation_3d/kgaussian_psi [real,private/optional/default=0.0]
- oscillation_3d/kpeak_dpsi [real,private/optional/default=0.0]
- oscillation_3d/kpeak_psi [real,private/optional/default=0.0]
- oscillation_3d/lno_noise_psi [logical,private/optional/default=.false.]
- oscillation_3d/lscale_tobox_dpsi [logical,private/optional/default=.true.]
- oscillation_3d/lscale_tobox_psi [logical,private/optional/default=.true.]
- oscillation_3d/lskip_projection_psi [logical,private/optional/default=.false.]
- oscillation_3d/lvectorpotential [logical,private/optional/default=.false.]
- oscillation_3d/modulation_fact [real,private/optional/default=1.0]
- oscillation_3d/ncutoff_psi [real,private/optional/default=1.0]
- oscillation_3d/relhel_psi [real,private/optional/default=0.0]
Subroutines and functions
- subroutine oscillation_3d/register_special()
Set up indices for variables in special modules.
- Use :
- Call to:
svn_id(),power_randomphase_hel(),fatal_error(),output_persistent_special()
- subroutine oscillation_3d/register_particles_special(npvar)
Set up indices for particle variables in special modules.
- Parameters:
npvar [integer]
- Use :
- Called from:
- Call to:
svn_id(),power_randomphase_hel(),fatal_error(),output_persistent_special()
- subroutine oscillation_3d/init_special(f)
initialise special condition; called from start.f90 06-oct-2003/tony: coded
- Parameters:
- Use :
- Call to:
power_randomphase_hel(),fatal_error(),output_persistent_special()
- subroutine oscillation_3d/dspecial_dt(f, df, p)
Solve wave equation in 3-D with wave speed altered by the strain tensor components.
- Parameters:
- Use :
diagnostics,mpicomm,deriv(der2(),derij()),farraymanager(farray_index_by_name()),sub- Call to:
- subroutine oscillation_3d/read_special_init_pars(iomsg)
- Parameters:
iomsg [character,out]
- Use :
- Call to:
- subroutine oscillation_3d/write_special_init_pars(unit)
- Parameters:
unit [integer,in]
- Call to:
- subroutine oscillation_3d/read_special_run_pars(iomsg)
- Parameters:
iomsg [character,out]
- Use :
- Call to:
- subroutine oscillation_3d/write_special_run_pars(unit)
- Parameters:
unit [integer,in]
- Call to:
- subroutine oscillation_3d/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:
- function oscillation_3d/output_persistent_special()
- Return:
output_persistent_special [logical]
- Called from:
initialize_mult_special(),register_particles_special(),special_particles_bfre_bdary(),special_calc_spectra(),special_calc_spectra_byte(),input_persistent(),output_persistent()