lorenz_gauge

Module

Description

$Id$

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.

25-feb-07/axel: adapted from nolorenz_gauge.f90

** AUTOMATIC CPARAM.INC GENERATION ************************ Declare (for generation of cparam.inc) the number of f array variables and auxiliary variables added by this module

CPARAM logical, parameter :: llorenz_gauge = .true.

MVAR CONTRIBUTION 1 MAUX CONTRIBUTION 0


Quick access

Variables:

ladvect_phi

Routines:

calc_diagnostics_lorenz_gauge(), calc_pencils_lorenz_gauge(), dlorenz_gauge_dt(), get_slices_lorenz_gauge(), init_lorenz_gauge(), initialize_lorenz_gauge(), pencil_criteria_lorenz_gauge(), pencil_interdep_lorenz_gauge(), read_lorenz_gauge_init_pars(), read_lorenz_gauge_run_pars(), register_lorenz_gauge(), rprint_lorenz_gauge(), write_lorenz_gauge_init_pars(), write_lorenz_gauge_run_pars()

Needed modules

Variables

  • lorenz_gauge/ampl [real,private/optional/default=0.001]
  • lorenz_gauge/cphi [real,private/optional/default=1.0]
  • lorenz_gauge/cphi2 [real,private]
  • lorenz_gauge/etaphi [real,private/optional/default=0.0]
  • lorenz_gauge/idiag_phibzm [integer,private/optional/default=0]
  • lorenz_gauge/idiag_phibzmz [integer,private/optional/default=0]
  • lorenz_gauge/idiag_phim [integer,private/optional/default=0]
  • lorenz_gauge/idiag_phip2 [integer,private/optional/default=0]
  • lorenz_gauge/idiag_phipt [integer,private/optional/default=0]
  • lorenz_gauge/init [character,private/optional/default='zero']
  • lorenz_gauge/iphi [integer,private/optional/default=0]
  • lorenz_gauge/kx [real,private/optional/default=1.0]
  • lorenz_gauge/ky [real,private/optional/default=0.0]
  • lorenz_gauge/kz [real,private/optional/default=0.0]
  • lorenz_gauge/ladvect_phi [logical,private/optional/default=.false.]

Subroutines and functions

subroutine  lorenz_gauge/register_lorenz_gauge()

Configure pre-initialised (i.e. before parameter read) variables which should be know to be able to evaluate

6-oct-03/tony: coded

Use :

farraymanager

Call to:

svn_id(), sinwave(), stop_it(), calc_diagnostics_lorenz_gauge(), save_name(), xysum_mn_name_z()

subroutine  lorenz_gauge/initialize_lorenz_gauge(f)

called by run.f90 after reading parameters, but before the time loop

06-oct-03/tony: coded

Parameters:

f (mx,my,mz,mfarray) [real]

Call to:

sinwave(), stop_it(), calc_diagnostics_lorenz_gauge(), save_name(), xysum_mn_name_z()

subroutine  lorenz_gauge/init_lorenz_gauge(f)

initialise lorenz_gauge condition; called from start.f90 06-oct-2003/tony: coded

Parameters:

f (mx,my,mz,mfarray) [real,inout]

Use :

initcond, mpicomm, sub

Call to:

sinwave(), stop_it(), calc_diagnostics_lorenz_gauge(), save_name(), xysum_mn_name_z()

subroutine  lorenz_gauge/pencil_criteria_lorenz_gauge()

All pencils that this lorenz_gauge module depends on are specified here.

25-feb-07/axel: adapted

Call to:

calc_diagnostics_lorenz_gauge(), save_name(), xysum_mn_name_z()

subroutine  lorenz_gauge/pencil_interdep_lorenz_gauge(lpencil_in)

Interdependency among pencils provided by this module are specified here.

18-07-06/tony: coded

Parameters:

lpencil_in (npencils) [logical]

Call to:

calc_diagnostics_lorenz_gauge(), save_name(), xysum_mn_name_z()

subroutine  lorenz_gauge/calc_pencils_lorenz_gauge(f, p)

Calculates pencils of the lorenz gauge

Parameters:
Call to:

calc_diagnostics_lorenz_gauge(), save_name(), xysum_mn_name_z()

subroutine  lorenz_gauge/dlorenz_gauge_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 if for efficiency.

06-oct-03/tony: coded

Parameters:
Use :

sub

Call to:

calc_diagnostics_lorenz_gauge(), save_name(), xysum_mn_name_z()

subroutine  lorenz_gauge/calc_diagnostics_lorenz_gauge(f, p)
Parameters:
Use :

diagnostics

Call to:

save_name(), xysum_mn_name_z()

subroutine  lorenz_gauge/read_lorenz_gauge_init_pars(iomsg)
Parameters:

iomsg [character,out]

Use :

file_io (parallel_unit())

subroutine  lorenz_gauge/write_lorenz_gauge_init_pars(unit)
Parameters:

unit [integer,in]

subroutine  lorenz_gauge/read_lorenz_gauge_run_pars(iomsg)
Parameters:

iomsg [character,out]

Use :

file_io (parallel_unit())

subroutine  lorenz_gauge/write_lorenz_gauge_run_pars(unit)
Parameters:

unit [integer,in]

subroutine  lorenz_gauge/rprint_lorenz_gauge(lreset[, lwrite])

reads and registers print parameters relevant to lorenz_gauge

06-oct-03/tony: coded

Parameters:
  • lreset [logical]

  • lwrite [logical]

Use :

diagnostics, farraymanager (farray_index_append()), sub

subroutine  lorenz_gauge/get_slices_lorenz_gauge(f, slices)

Write slices for animation of electric potential

26-feb-07/axel: adapted from gross_pitaevskii

Parameters:
Use :

slices_methods (assign_slices_scal())