testfield_general

Module

Description

$Id$

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


Quick access

Variables:

ampl_eta_uz, coor_label, eta1d, eta2d, eta3d, etatest_hyper3, geta1d, geta2d, geta3d, inx, inxy, inxyz, inxz, iny, inyz, inz, iresistivity_test, jgprof, lresitest_eta_const, lresitest_eta_proptouz, lresitest_hyper3, lresitest_prof, mnprof, nresitest_max, phasey_aatest

Routines:

calc_2d_diagnostics_testfield(), calc_coefficients(), calc_diffusive_part(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), calc_inverse_matrix(), calc_uxb(), diagnos_interdep(), initialize_testfield_general(), rhs_daatest()

Needed modules

Variables

  • testfield_general/ampl_eta_uz [real,optional/default=0.0]
  • testfield_general/ampl_fcont_aatest [real,optional/default=1.0]
  • testfield_general/amplaatest (ninit) [real,optional/default=0.]

    .

  • testfield_general/b_ext (3) [real,optional/default=(/0.,0.,0./)]
  • testfield_general/bamp [real,optional/default=1.0]
  • testfield_general/bamp1 [real,optional/default=1.0]
  • testfield_general/bamp12 [real,optional/default=1.0]
  • testfield_general/coor_label (7) [character,optional/default=(/'x  ','y  ','z  ','xy ','xz ','yz ','xyz'/)]
  • testfield_general/daainit [real,optional/default=0.0]
  • testfield_general/delta_testfield [real,optional/default=0.0]
  • testfield_general/delta_testfield_next [real,optional/default=0.0]
  • testfield_general/delta_testfield_time [real,optional/default=0.0]
  • testfield_general/eta1d (*) [real,pointer]
  • testfield_general/eta2d (*,*) [real,pointer]
  • testfield_general/eta3d (*,*,*) [real,pointer]
  • testfield_general/etatest [real,optional/default=0.0]
  • testfield_general/etatest1 [real,optional/default=0.0]
  • testfield_general/etatest_hyper3 [real,optional/default=0.0]
  • testfield_general/geta1d (*) [real,pointer]
  • testfield_general/geta2d (*,*,*) [real,pointer]
  • testfield_general/geta3d (*,*,*,*) [real,pointer]
  • testfield_general/i1 [integer,optional/default=1]
  • testfield_general/i2 [integer,optional/default=2]
  • testfield_general/i3 [integer,optional/default=3]
  • testfield_general/i4 [integer,optional/default=4]
  • testfield_general/i5 [integer,optional/default=5]
  • testfield_general/i6 [integer,optional/default=6]
  • testfield_general/i7 [integer,optional/default=7]
  • testfield_general/i8 [integer,optional/default=8]
  • testfield_general/i9 [integer,optional/default=9]
  • testfield_general/initaatest (ninit) [character,optional/default='nothing']

    .

  • testfield_general/inx [integer,parameter=1]
  • testfield_general/inxy [integer,parameter=4]
  • testfield_general/inxyz [integer,parameter=7]
  • testfield_general/inxz [integer,parameter=5]
  • testfield_general/iny [integer,parameter=2]
  • testfield_general/inyz [integer,parameter=6]
  • testfield_general/inz [integer,parameter=3]
  • testfield_general/iresistivity_test (4) [character,optional/default=(/'const','none ','none ','none '/)]
  • testfield_general/itestfield [character,optional/default='linear']
  • testfield_general/jgprof [integer,optional/default=0]
  • testfield_general/kx_aatest (ninit) [real,optional/default=0.]
  • testfield_general/ky_aatest (ninit) [real,optional/default=0.]
  • testfield_general/kz_aatest (ninit) [real,optional/default=0.]

    .

  • testfield_general/lam_testfield [real,optional/default=0.0]
  • testfield_general/leta_rank2 [logical,optional/default=.true.]
  • testfield_general/lforcing_cont_aatest [logical,optional/default=.false.]
  • testfield_general/lignore_uxbtestm [logical,optional/default=.false.]
  • testfield_general/lin_testfield [real,optional/default=0.0]
  • testfield_general/linit_aatest [logical,optional/default=.false.]
  • testfield_general/ljxb_as_aux [logical,optional/default=.false.]

    .

  • testfield_general/lresitest_eta_const [logical,optional/default=.false.]
  • testfield_general/lresitest_eta_proptouz [logical,optional/default=.false.]
  • testfield_general/lresitest_hyper3 [logical,optional/default=.false.]
  • testfield_general/lresitest_prof (7) [logical,optional/default=.false.]
  • testfield_general/lsoca [logical,optional/default=.false.]
  • testfield_general/lsoca_jxb [logical,optional/default=.true.]
  • testfield_general/ltestfield_artifric [logical,optional/default=.false.]
  • testfield_general/ltestfield_taver [logical,optional/default=.false.]
  • testfield_general/luxb_as_aux [logical,optional/default=.false.]

    can be PROTECTED

  • testfield_general/mnprof [integer,pointer]
  • testfield_general/naainit [integer,private]
  • testfield_general/nresitest_max [integer,parameter=4]
  • testfield_general/nuxb (njtest) [integer,optional/default=0]
  • testfield_general/om_testfield [real,optional/default=0.0]
  • testfield_general/phasex_aatest (ninit) [real,optional/default=0.]
  • testfield_general/phasey_aatest (ninit) [real,optional/default=0.]
  • testfield_general/phasez_aatest (ninit) [real,optional/default=0.]

    .

  • testfield_general/reinitialize_aatest [logical,optional/default=.false.]
  • testfield_general/rescale_aatest (njtest) [real,optional/default=0.]
  • testfield_general/taainit [real,optional/default=0.0]
  • testfield_general/tau1_aatest [real,optional/default=0.0]
  • testfield_general/tau_aatest [real,optional/default=0.0]

Subroutines and functions

subroutine  testfield_general/initialize_testfield_general(f)

Perform any post-parameter-read initialization

2-jun-05/axel: adapted from magnetic 6-sep-13/MR: insourced from testfield_z;

generalized handling of eta profiles to all possible cases

20-oct-13/MR: corrected: connection between mnprof and m or n needs to be permanent

-> pointer introduced

Parameters:

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

Use :

cdata (lroot(), iaxtest(), iaatest(), iaztest(), lrescaling_testfield(), m(), n()), magnetic (lresi_dep()), sharedvariables (fetch_profile())

Call to:

fatal_error(), sinwave(), beltrami(), stop_it(), initial_condition_aatest(), read_snaptime(), update_snaptime(), svn_id(), gij(), curl_mn(), cross_mn(), del2v(), div_other(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), curl()

subroutine  testfield_general/init_aatest(f)

initialise testfield; called from start.f90

2-jun-05/axel: adapted from magnetic

Parameters:

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

Use :

cdata, mpicomm (stop_it()), initcond, initialcondition (initial_condition_aatest())

Call to:

sinwave(), beltrami(), stop_it(), initial_condition_aatest(), read_snaptime(), update_snaptime(), svn_id(), gij(), curl_mn(), cross_mn(), del2v(), div_other(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), curl()

subroutine  testfield_general/rescaling_testfield(f)

Rescale testfield by factor rescale_aatest(jtest), which could be different for different testfields

18-may-08/axel: rewrite from rescaling as used in magnetic 27-jun-13/MR : moved from testfield_xz

Parameters:

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

Use :

cdata, sub

Call to:

read_snaptime(), update_snaptime(), svn_id(), gij(), curl_mn(), cross_mn(), del2v(), div_other(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), curl()

subroutine  testfield_general/register_testfield()

Initialise variables which should know that we solve for the vector potential: iaatest, etc; increase nvar accordingly

3-jun-05/axel: adapted from register_magnetic

27-jun-13/MR : moved from testfield_xz

Use :

farraymanager, cdata, mpicomm (stop_it()), sub

Call to:

svn_id(), gij(), curl_mn(), cross_mn(), del2v(), div_other(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), curl()

subroutine  testfield_general/pencil_criteria_testfield()

All pencils that the Testfield module depends on are specified here.

26-jun-05/anders: adapted from magnetic 27-jun-13/MR : moved from testfield_xz

Use :

cdata (lpenc_requested(), i_uu())

Call to:

gij(), curl_mn(), cross_mn(), del2v(), div_other(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), curl()

subroutine  testfield_general/pencil_interdep_testfield(lpencil_in)

Interdependency among pencils from the Testfield module is specified here.

26-jun-05/anders: adapted from magnetic 27-jun-13/MR : moved from testfield_xz

Parameters:

lpencil_in (npencils) [logical]

Use :

cdata (npencils())

Call to:

gij(), curl_mn(), cross_mn(), del2v(), div_other(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), curl()

subroutine  testfield_general/read_testfield_init_pars(iomsg)
Parameters:

iomsg [character,out]

Use :

file_io (parallel_unit())

Call to:

gij(), curl_mn(), cross_mn(), del2v(), div_other(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), curl()

subroutine  testfield_general/write_testfield_init_pars(unit)
Parameters:

unit [integer,in]

Call to:

gij(), curl_mn(), cross_mn(), del2v(), div_other(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), curl()

subroutine  testfield_general/calc_uxb(f, p, iaxt, uxb, bbtest)
6-jun-13/MR: outsourced from daatest_dt of testfield_z

along with uxb also bbtest is returned

Parameters:
  • f (mx,my,mz,mfarray) [real,in]

  • p [pencil_case,in]

  • iaxt [integer,in]

  • uxb (nx,3) [real,out]

  • bbtest (nx,3) [real,out]

Use :

cdata, sub (gij(), curl_mn(), cross_mn())

Call to:

gij(), curl_mn(), cross_mn(), del2v(), div_other(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), curl()

subroutine  testfield_general/calc_diffusive_part(f, p, iaxt, daatest)

6-jun-13/MR: outsourced from daatest_dt 6-sep-13/MR: extended to spherical coordinates,

generalized handling of eta profiles to all possible cases.

Parameters:
  • f (mx,my,mz,mfarray) [real,in]

  • p [pencil_case,in]

  • iaxt [integer,in]

  • daatest (nx,3) [real,inout]

Use :

cdata, sub (del2v(), gij(), gij_etc(), div_other(), div_mn(), del6v())

Called from:

initialize_testfield_general(), calc_uxb(), calc_diffusive_part(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), calc_inverse_matrix(), calc_coefficients(), diagnos_interdep(), rhs_daatest()

Call to:

del2v(), div_other(), gij(), div_mn(), gij_etc(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), del6v(), fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), cross_mn(), curl()

subroutine  testfield_general/calc_diffusive_part_prof_0d(del2atest, divatest, eta, geta, jg, daatest)
Parameters:
  • del2atest (nx,3) [real,in]

  • divatest (nx) [real,in]

  • eta [real,in]

  • geta (size(jg) [real,in]

  • jg (*) [integer,in,required]

  • daatest (nx,3) [real,out]

Called from:

initialize_testfield_general(), calc_uxb(), calc_diffusive_part()

Call to:

fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), cross_mn(), curl()

subroutine  testfield_general/calc_diffusive_part_prof_1d(del2atest, divatest, eta, geta, jg, daatest)

calculates full diffusive part daatest from del2Atest, divatest with x dependent eta (m,n fixed) and grad(eta) with variable number of components

Parameters:
  • jg (*) [integer,in] ::

    contains indices (out of {1,2,3}) for which geta has nonvanishing components

    6-sep-13/MR: coded

  • del2atest (nx,3) [real,in]

  • divatest (nx) [real,in]

  • eta (nx) [real,in]

  • geta (nx,*) [real,in]

  • daatest (nx,3) [real,out]

Called from:

initialize_testfield_general(), calc_uxb(), calc_diffusive_part()

Call to:

fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), cross_mn(), curl()

subroutine  testfield_general/calc_inverse_matrix(x, z, ktestfield_x, ktestfield_z, xx0, zz0, minv, cx, sx, cz, sz)

27-aug-13/MR: outsourced from testfield_xz:initialize_testfield for broader use 20-oct-13/MR: Minv for itestfield=’1-alt’ and ‘linear’ added 30-oct-13/MR: added Minv for another alternative testfield

Parameters:
  • x (*) [real,in]

  • z (*) [real,in]

  • ktestfield_x [real,in]

  • ktestfield_z [real,in]

  • xx0 [real,in]

  • zz0 [real,in]

  • minv (,,*,*) [real,out]

  • cx (*) [real,out]

  • sx (*) [real,out]

  • cz (*) [real,out]

  • sz (*) [real,out]

Call to:

fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), cross_mn(), curl()

subroutine  testfield_general/calc_coefficients(idiags, idiags_z, idiags_xz, idiags_eij, idiags_eij_z, idiags_eij_xz, idiag_alp11h, idiag_eta123h, uxbtestm, minv, ysum_xz, xysum_z, twod_need_1d, twod_need_2d, needed2d, ny)

calculation of the turbulent coefficients for an average over one coordinate. Note: symbols were chosen such as it were to be used in testfield_xz, that is as the 2D average were over all y and the 1D average over all x and y. takes subroutine ysum_xz for 1D and xysum_z for 2D averages as parameters.

26-feb-13/MR: determination of y-averaged components of alpha completed
6-mar-13/MR: internal order of etas changed; calls to save_name, *sum_mn_name

simplified

7-mar-13/MR: further shortened by introduction of do-loops in calculating

temp_array

27-jun-13/MR: avoided calculation of pencil-case, introduced calculation of mean EMF 28-aug-13/MR: parametrized such that it is usable for all cases with average over one direction

3-sep-13/MR: outsourced from testfield_xz

20-oct-13/MR: setting of lfirstpoint corrected; ny*temp_array –> nygrid*temp_array

allowed for other cases of itestfield; calculation of Eij for diagnostic output corrected

30-oct-13/MR: added parameter nygrid to allow correct application in testfield_xy

7-nov-13/MR: nygrid -> ny (a more speaking name)

Parameters:
  • idiags (*) [integer,in]

  • idiags_z (*) [integer,in]

  • idiags_xz (*) [integer,in]

  • idiags_eij (*) [integer,in]

  • idiags_eij_z (*) [integer,in]

  • idiags_eij_xz (*) [integer,in]

  • idiag_alp11h (*) [integer,in]

  • idiag_eta123h (*) [integer,in]

  • uxbtestm (,,*,*) [real,in]

  • minv (,,*,*) [real,in]

  • ysum_xz [external]

  • xysum_z [external]

  • twod_need_1d (*) [logical,in]

  • twod_need_2d (*) [logical,in]

  • needed2d (2) [logical,in]

  • ny [integer,in] :: ny multiplied because we are in the following only in an n loop

Use :

diagnostics (sum_mn_name(), save_name()), cdata (nghost(), l1davgfirst(), l2davgfirst(), lfirstpoint(), ldiagnos(), lroot()), sub (fourier_single_mode()), calc_coefficients__user__routines

Called from:

register_testflow(), initialize_testflow(), init_uutest(), pencil_criteria_testflow(), pencil_interdep_testflow(), read_testflow_init_pars(), write_testflow_init_pars(), read_testflow_run_pars(), write_testflow_run_pars(), duutest_dt(), get_slices_testflow(), testflow_before_boundary(), calc_ltestflow_nonlin_terms()

Call to:

fatal_error(), fourier_single_mode(), save_name(), diagnos_interdep(), identify_bcs(), calc_diffusive_part(), cross_mn(), curl()

function  testfield_general/diagnos_interdep(idiags, idiags_z, idiags_xz, twod_need_1d, twod_need_2d)

detects which of the 2D and 1D averages are needed

3-sep-13/MR: outsourced from testfield_xz

Parameters:
  • idiags (*) [integer,in]

  • idiags_z (*) [integer,in]

  • idiags_xz (*) [integer,in]

  • twod_need_1d (*) [logical,out]

  • twod_need_2d (*) [logical,out]

Return:

diagnos_interdep (2) [logical]

Called from:

initialize_testfield_general(), calc_uxb(), calc_diffusive_part(), calc_diffusive_part_prof_0d(), calc_diffusive_part_prof_1d(), calc_inverse_matrix(), calc_coefficients(), diagnos_interdep()

Call to:

diagnos_interdep(), identify_bcs(), calc_diffusive_part(), cross_mn(), curl()

subroutine  testfield_general/rhs_daatest(f, df, p, uum, uxbtestm, set_bbtest)

calculates rhs of all testproblems; to be used within nm-loop, takes specific routine for calculation of testfield as parameter symbols chosen as the average were over all y

3-sep-13/MR: outsourced from testfield_xz 6-sep-13/MR: introduced use of calc_diffusive_part

20-oct-13/MR: corrected: use full velocity in Uxbtest

Parameters:
  • f (mx,my,mz,mfarray) [real,in]

  • df (mx,my,mz,mvar) [real,inout]

  • p [pencil_case,in]

  • uum (nx,3) [real,in]

  • uxbtestm (nx,3,njtest) [real,in]

  • set_bbtest [external]

Use :

cdata, sub (curl(), cross_mn(), del2v(), gij(), gij_etc(), identify_bcs()), rhs_daatest__user__routines

Call to:

identify_bcs(), calc_diffusive_part(), cross_mn(), curl()

subroutine  testfield_general/calc_2d_diagnostics_testfield(f, nmind, idiags_bij, ysum_xz)

Calculates 2D diagnostics from f-array (hence in mn-loop).

Parameters:
  • nmind [integer] ::

    must be n(m) for use in testfield_xz(testfield_xy).

    11-sep-23/MR: coded

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

  • idiags_bij (*) [integer]

  • ysum_xz [external]

Use :

cdata (m(), n(), lroot(), l2davgfirst(), iaxtest(), iaztest(), iaatest()), calc_2d_diagnostics_testfield__user__routines