testflow_z

Module

Description

$Id$

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.

Note: this routine requires that MVAR and MAUX contributions together with njtestflow are set correctly in the cparam.local file. njtestflow must be set at the end of the file such that 4*(njtestflow+1)=MVAR.

Example: ! MVAR CONTRIBUTION 28 ! MAUX CONTRIBUTION 28 integer, parameter :: njtestflow=8

** 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 :: ltestflow = .true.

MVAR CONTRIBUTION 0 MAUX CONTRIBUTION 0


Quick access

Variables:

ampluutest, ca, cl, correct_0inds, correct_1inds, correct_2inds, correct_inds, cq, cqa, cqq, cs2test, cs2test1, cz, del_elem, duuinit, gen_1ind, gen_2ind, gen_ind, guumz, idiag_aklam, idiag_aklamij, idiag_aklamq, idiag_aklamqi, idiag_fipq, idiag_gal, idiag_galij, idiag_gamma, idiag_gammai, idiag_gammaq, idiag_hpqrms, idiag_map, idiag_nu, idiag_nuij, idiag_nuq, idiag_nuqi, idiag_qpq, idiag_upqrms, idiag_ux0mz, idiag_uy0mz, idiag_uz0mz, idiag_xi, idiag_xii, idiag_xiq, idiag_zeta, idiag_zetai, idiag_zetaq, inituutest, insert, insert_array, insert_array_mult, isortp, itestflow, izrange, k1cz, k1sz, ktestflow, ktestflow1, kx_uutest, lburgers_testflow, lkinem_testflow, lprescribed_velocity, lremove_mean_enthalpy_z, lremove_mean_momenta_testflow, lshear_as_param, lsoca_testflow, ltestflow_upw_lnrho, ltestflow_upw_uu, lugu_as_aux, mark_del_elems, mark_del_elems1, mark_del_elems2, njtestflow_loc, nname_old, nutest, nutest1, nuuinit, reinitialize_uutest, remove_mean_enthalpy_z, set_u0test_onlyconstant, set_u0test_onlylinear, set_u0test_quadratic, set_u0test_quasiperiodic, set_u0test_w11_w22, set_uutest, set_uutest_u11_u21, sz, tuuinit, update_diag, update_diag1, update_diag2, uu11_xy, uu11_xy2, uu11_xz, uu11_yz, valid_zrange, wamp, zextent, zq2, zrange

Routines:

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

Needed modules

Variables

  • testflow/ampluutest (ninit * njtestflow) [real,private/optional/default=0.]

    amplitude(s) of initial condition for testflow solution (up to five different)

  • testflow/ca (2) [real,private]
  • testflow/cl (2) [real,private]
  • testflow/correct_0inds [private]
  • testflow/correct_1inds [private]
  • testflow/correct_2inds [private]
  • testflow/correct_inds [private]

    Overload the ‘correct_inds’ function

  • testflow/cq (2) [real,private]
  • testflow/cqa (2) [real,private]
  • testflow/cqq (2) [real,private]
  • testflow/cs2test [real,private/optional/default=1.0]
  • testflow/cs2test1 [real,private/optional/default=1.0]
  • testflow/cz (mz) [real,private]
  • testflow/del_elem [private]
  • testflow/duuinit [real,private/optional/default=0.0]
  • testflow/gen_1ind [private]
  • testflow/gen_2ind [private]
  • testflow/gen_ind [private]

    Overload the ‘gen_ind’ function

  • testflow/guumz (nz,3) [real,private]
  • testflow/idiag_aklam [integer,private/optional/default=0]

    DIAG_DOC: AKA-$lambda$-tensor, couples $overline F$ and $overline W = nablatimes{overline U}$

  • testflow/idiag_aklamij (3,2) [integer,private/optional/default=0]

    DIAG_DOC: $alpha_{K,ij}$

  • testflow/idiag_aklamq [integer,private/optional/default=0]

    DIAG_DOC: $aklam^Q$-vector, couples $overline Q$ and $overline W$

  • testflow/idiag_aklamqi (2) [integer,private/optional/default=0]

    DIAG_DOC: $aklam^Q_i$

  • testflow/idiag_fipq (3,njtestflow) [integer,private/optional/default=0]

    DIAG_DOC: ${cal F}_i^{pq}$

  • testflow/idiag_gal [integer,private/optional/default=0]

    DIAG_DOC: GAL-coefficients, couple $overline F$ and $overline U$

  • testflow/idiag_galij (3,3) [integer,private/optional/default=0]

    DIAG_DOC:

  • testflow/idiag_gamma [integer,private/optional/default=0]

    DIAG_DOC: $gamma$-vector, couples $overline F$ and $nablacdot{overline U}$

  • testflow/idiag_gammai (3) [integer,private/optional/default=0]

    DIAG_DOC: $gamma_i$

  • testflow/idiag_gammaq [integer,private/optional/default=0]

    DIAG_DOC: $gamma^Q$-scalar, couples $overline Q$ and $nablacdot{overline U}=dU_z/dz$

  • testflow/idiag_hpqrms (1 + njtestflow) [integer,private/optional/default=0]

    DIAG_DOC: $left<{h^{pq}}^2right>$

  • testflow/idiag_map (100) [integer,private]
  • testflow/idiag_nu [integer,private/optional/default=0]

    DIAG_DOC: $nu$-tensor, couples $overline F$ and $partial^2 {overline U}/partial z^2$

  • testflow/idiag_nuij (3,3) [integer,private/optional/default=0]

    DIAG_DOC: $nu_{ij}$

  • testflow/idiag_nuq [integer,private/optional/default=0]

    DIAG_DOC: $nu^Q$-vector, couples $overline Q$ and $partial^2 overline U/partial z^2$

  • testflow/idiag_nuqi (3) [integer,private/optional/default=0]

    DIAG_DOC: $nu^Q_i$

  • testflow/idiag_qpq (njtestflow) [integer,private/optional/default=0]

    DIAG_DOC: ${cal Q}^{pq}$

  • testflow/idiag_upqrms (1 + njtestflow) [integer,private/optional/default=0]

    DIAG_DOC: $left<{u^{pq}}^2right>$

  • testflow/idiag_ux0mz [integer,private/optional/default=0]

    DIAG_DOC: $left<u_{x}right>_{xy}$

  • testflow/idiag_uy0mz [integer,private/optional/default=0]

    DIAG_DOC: $left<u_{y}right>_{xy}$

  • testflow/idiag_uz0mz [integer,private/optional/default=0]

    DIAG_DOC: $left<u_{z}right>_{xy}$

  • testflow/idiag_xi [integer,private/optional/default=0]

    DIAG_DOC: $xi$-vector, couples $overline F$ and $partial^2 {overline H}/partial z^2$

  • testflow/idiag_xii (3) [integer,private/optional/default=0]

    DIAG_DOC: $xi_i$

  • testflow/idiag_xiq [integer,private/optional/default=0]

    DIAG_DOC: $xi^Q$-scalar, couples $overline Q$ and $partial^2 {overline H}/partial z^2$

  • testflow/idiag_zeta [integer,private/optional/default=0]

    DIAG_DOC: $zeta$-vector, couples $overline F$ and ${overline G}_z = nabla_z {overline H}$

  • testflow/idiag_zetai (3) [integer,private/optional/default=0]

    DIAG_DOC: $zeta_i$

  • testflow/idiag_zetaq [integer,private/optional/default=0]

    DIAG_DOC: $zeta^Q$-scalar, couples $overline Q$ and ${overline G}_z$

  • testflow/inituutest (ninit * njtestflow) [character,private/optional/default='nothing']

    name(s) of initialization kind (up to five different to be overlayed),

  • testflow/insert [private]

    Overload the ‘insert’ function

  • testflow/insert_array [private]
  • testflow/insert_array_mult [private]
  • testflow/isortp [private]
  • testflow/itestflow [character,private/optional/default='w11-w22']

    name of used testflow set, legal values

  • testflow/izrange (2) [integer,private]
  • testflow/k1cz (mz) [real,private]
  • testflow/k1sz (mz) [real,private]
  • testflow/ktestflow [real,private/optional/default=1.0]

    wavenumber for testflow (if sinusoidal)

  • testflow/ktestflow1 [real,private/optional/default=1.0]
  • testflow/kx_uutest [real,private/optional/default=1.0]

    wavenumber of the initial condition (if sinusoidal)

  • testflow/lburgers_testflow [logical,private/optional/default=.false.]

    flag for disconnecting enthalpy(pressure) from velocity

  • testflow/lkinem_testflow [logical,private/optional/default=.false.]

    flag for kinematic calculation

  • testflow/lprescribed_velocity [logical,private/optional/default=.false.]

    flag for prescribed velocity, prescription via p%fcont, only effective if lkinem_testflow=.true.

  • testflow/lremove_mean_enthalpy_z [logical,private/optional/default=.false.]

    flag for removing xy-mean of enthalpy in 0-solution

  • testflow/lremove_mean_momenta_testflow [logical,private/optional/default=.false.]

    flag for removing mean momenta in 0-solution

  • testflow/lshear_as_param [logical,private/optional/default=.false.]

    flag for treating of shear as a problem parameter, instead of a mean flow

  • testflow/lsoca_testflow [logical,private/optional/default=.true.]

    flag for SOCA

  • testflow/ltestflow_upw_lnrho [logical,private/optional/default=.false.]
  • testflow/ltestflow_upw_uu [logical,private/optional/default=.false.]
  • testflow/lugu_as_aux [logical,private/optional/default=.false.]

    ??

  • testflow/mark_del_elems [private]

    Overload the ‘mark_del_elems’ function

  • testflow/mark_del_elems1 [private]
  • testflow/mark_del_elems2 [private]
  • testflow/njtestflow_loc [integer,private]
  • testflow/nname_old [integer,private]
  • testflow/nutest [real,private/optional/default=0.0]

    viscosity in testflow equations

  • testflow/nutest1 [real,private/optional/default=0.0]

    reciprocal viscosity

  • testflow/nuuinit [integer,private]
  • testflow/reinitialize_uutest [logical,private/optional/default=.false.]

    flag for reinitialization of testflow solution

  • testflow/remove_mean_enthalpy_z [private]
  • testflow/set_u0test_onlyconstant [private]
  • testflow/set_u0test_onlylinear [private]
  • testflow/set_u0test_quadratic [private]
  • testflow/set_u0test_quasiperiodic [private]
  • testflow/set_u0test_w11_w22 [private]
  • testflow/set_uutest [private]
  • testflow/set_uutest_u11_u21 [private]
  • testflow/sz (mz) [real,private]
  • testflow/tuuinit [real,private/optional/default=0.0]
  • testflow/update_diag [private]

    Overload the ‘update_diag’ function

  • testflow/update_diag1 [private]
  • testflow/update_diag2 [private]
  • testflow/uu11_xy (nx,ny,3) [real,private/target]
  • testflow/uu11_xy2 (nx,ny,3) [real,private/target]
  • testflow/uu11_xz (nx,nz,3) [real,private/target]
  • testflow/uu11_yz (ny,nz,3) [real,private/target]
  • testflow/valid_zrange [real,private/optional/default=1.0]

    relative size of z-range from which coefficients are calculated

  • testflow/wamp [real,private/optional/default=1.0]

    amplitude of the testflows

  • testflow/zextent [logical,private/optional/default=.true.]

    ??

  • testflow/zq2 (mz) [real,private]
  • testflow/zrange (2) [real,private]

Subroutines and functions

subroutine  testflow/register_testflow()

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

3-jun-05/axel: adapted from register_magnetic

Use :

cdata, mpicomm (stop_it()), sub

Called from:

register_modules()

Call to:

svn_id(), stop_it(), getnu(), zlocation(), sinwave(), initial_condition_uutest(), identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/initialize_testflow(f)

Perform any post-parameter-read initialization

2-jun-05/axel: adapted from magnetic

Parameters:

f (,,*,*) [real,contiguous] :: ufluct = u0

Use :

cdata, farraymanager, density (lcalc_glnrhomean(), lupw_lnrho()), hydro (lcalc_uumean(), lupw_uu()), forcing (ltestflow_forcing(), lhydro_forcing()), viscosity (getnu()), mpicomm (stop_it()), sub (zlocation()), equationofstate (cs0())

Called from:

register_modules(), initialize_modules()

Call to:

getnu(), zlocation(), sinwave(), initial_condition_uutest(), stop_it(), identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/init_uutest(f)

initialise testflow-solutions; called from start.f90

2-jun-05/axel: adapted from magnetic

Parameters:

f (,,*,*) [real,contiguous] :: ufluct = u0

Use :

cdata, mpicomm (stop_it()), initcond, sub, initialcondition (initial_condition_uutest())

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(), start

Call to:

sinwave(), initial_condition_uutest(), stop_it(), identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/pencil_criteria_testflow()

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

26-jun-05/anders: adapted from magnetic

Use :

cdata

Called from:

register_modules(), initialize_modules(), finalize_modules(), choose_pencils()

Call to:

identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/pencil_interdep_testflow(lpencil_in)

Interdependency among pencils from the Testflow module is specified here.

26-jun-05/anders: adapted from magnetic

Parameters:

lpencil_in (npencils) [logical]

Use :

cdata

Called from:

register_modules(), initialize_modules(), finalize_modules(), choose_pencils()

Call to:

identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/read_testflow_init_pars(iomsg)
Parameters:

iomsg [character,out]

Use :

file_io (parallel_unit())

Call to:

identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/write_testflow_init_pars(unit)
Parameters:

unit [integer,in]

Called from:

get_datadir(), get_snapdir(), read_all_init_pars(), read_all_run_pars(), get_downpars()

Call to:

identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/read_testflow_run_pars(iomsg)
Parameters:

iomsg [character,out]

Use :

file_io (parallel_unit())

Call to:

identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/write_testflow_run_pars(unit)
Parameters:

unit [integer,in]

Called from:

get_datadir(), get_snapdir(), read_all_init_pars(), read_all_run_pars(), get_downpars()

Call to:

identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/duutest_dt(f, df, p)

testflow evolution:

calculate du^(pq)/dt = -( u^(0) .grad u^(pq) + u^(pq).grad u ) + < u^(0) .grad u^(pq) + u^(pq).grad u >
[alternatively: -( u^(pq).grad u^(0) + u.grad u^(pq) ) + < u^(pq).grad u^(0) + u.grad u^(pq) >]
  • grad h^(pq)

-U^(pq).grad u - u.grad U^(pq) + viscous terms

and dh^(pq)/dt = -( u^(0).grad h^(pq) + u^(pq).grad h ) + < u^(0).grad h^(pq) + u^(pq).grad h > [alternatively: -( u^(pq).grad h^(0) + u.grad h^(pq) ) + < u^(pq).grad h^(0) + u.grad h^(pq) > ]

  • cs2*div u^(pq)

-U.grad h -u.grad H

12-mar-08/axel: coded 24-jun-08/MR: modified 15-feb-13/MR: handling of test cases with mean enthalpy added

Parameters:
  • f (,,*,*) [real,in,contiguous] :: ufluct = u0

  • df (,,*,*) [real,inout,contiguous] :: nonlinear parts stored in df

  • p [pencil_case,in] :: uijfluct now contains sij !!!

Use :

cdata, sub, mpicomm (stop_it()), density (glnrhomz()), hydro (uumz(), coriolis_cartesian(), ampl_fcont_uu()), forcing (forcing_cont()), shear (shear_variables()), deriv (der5_single())

Called from:

pde(), write_diagnostics(), calc_all_module_diagnostic_auxiliaries(), perform_diagnostics(), finalize_diagnostics()

Call to:

identify_bcs(), div(), fatal_error(), der5_single(), gij(), div_mn(), traceless_strain(), multsv_mn_add(), del2v_etc(), coriolis_cartesian(), shear_variables(), xysum_mn_name_z(), read_snaptime(), init_uutest(), update_snaptime(), remove_mean_momenta(), distr_der(), forcing_cont(), calc_coefficients(), get_from_fname(), surf_mn_name(), fparse_name()

subroutine  testflow/get_slices_testflow(f, slices)

Write slices for animation of velocity variables.

12-sep-09/axel: adapted from the corresponding magnetic routine

Parameters:
  • f (,,*,*) [real,contiguous] :: ufluct = u0

  • slices [slice_data]

Called from:

wvid_prepare(), wvid()

Call to:

remove_mean_momenta(), distr_der(), forcing_cont(), gij(), div_mn(), traceless_strain(), calc_coefficients(), get_from_fname(), surf_mn_name(), fatal_error(), fparse_name()

subroutine  testflow/testflow_before_boundary(f)

Actions to take before boundary conditions are set.

15-dec-10/MR: adapted from density

Parameters:

f (,,*,*) [real,inout,contiguous] :: ufluct = u0

Use :

hydro (remove_mean_momenta()), cdata, mpicomm

Called from:

pde(), write_diagnostics(), calc_all_module_diagnostic_auxiliaries(), perform_diagnostics(), finalize_diagnostics()

Call to:

remove_mean_momenta(), distr_der(), forcing_cont(), gij(), div_mn(), traceless_strain(), calc_coefficients(), get_from_fname(), surf_mn_name(), fatal_error(), fparse_name()

subroutine  testflow/calc_ltestflow_nonlin_terms(f, df)
calculates < -u0.grad(u0) + (2nu/cs^2)*grad(h0).Sij(u0) >, < u0.gradh0 >,

< -u0.grad(utest) - utest.grad(u) + (2nu/cs^2)*( grad(h0).Sij(utest) + grad(htest).Sij(u) ) >, < u0.grad(htest) + utest.grad(h) >

which is needed when lsoca_testflow=.false., resp. this is done prior to the pencil loop (calc_fluct=false)

calculates ( -u0.grad(u0) + (2nu/cs^2)*grad(h0).Sij(u0) )’, ( u0.gradh0 )’,

( -u0.grad(utest) - utest.grad(u) ) + (2nu/cs^2)*( grad(h0).Sij(utest) + grad(htest).Sij(u) )’, ( u0.grad(htest) + utest.grad(h) )’

which is needed when lsoca_unl=.false., resp. this is done inside the pencil loop

15-mar-08/axel: coded 24-jun-08/MR: modified 01-sep-09/MR: further processed

Parameters:
  • f (,,*,*) [real,inout,contiguous] :: ufluct = u0

  • df (,,*,*) [real,inout,contiguous] :: nonlinear parts stored in df

Use :

cdata, sub, density (glnrhomz()), hydro (uumz()), mpicomm (mpiallreduce_sum()), forcing (forcing_cont())

Called from:

pde(), write_diagnostics(), calc_all_module_diagnostic_auxiliaries(), perform_diagnostics(), finalize_diagnostics()

Call to:

distr_der(), forcing_cont(), gij(), div_mn(), traceless_strain(), calc_coefficients(), get_from_fname(), surf_mn_name(), fatal_error(), fparse_name()

subroutine  testflow/rprint_testflow(lreset[, lwrite])

reads and registers print parameters relevant for testflow fields

3-jun-05/axel: adapted from rprint_magnetic

Parameters:
  • lreset [logical]

  • lwrite [logical]

Use :

cdata, farraymanager (farray_index_append()), general (loptest())

Called from:

register_modules(), initialize_modules(), finalize_modules(), choose_pencils(), rprint_list()

Call to:

fparse_name()