InitSolutionMHD3D Subroutine

private subroutine InitSolutionMHD3D(sf)

Uses

  • proc~~initsolutionmhd3d~~UsesGraph proc~initsolutionmhd3d t_functional_mhd3d%InitSolutionMHD3D module~modgvec_analyze MODgvec_Analyze proc~initsolutionmhd3d->module~modgvec_analyze module~modgvec_mhd3d_evalfunc MODgvec_MHD3D_evalFunc proc~initsolutionmhd3d->module~modgvec_mhd3d_evalfunc module~modgvec_mhd3d_vars MODgvec_MHD3D_Vars proc~initsolutionmhd3d->module~modgvec_mhd3d_vars module~modgvec_mpi MODgvec_MPI proc~initsolutionmhd3d->module~modgvec_mpi module~modgvec_readintools MODgvec_ReadInTools proc~initsolutionmhd3d->module~modgvec_readintools module~modgvec_restart MODgvec_Restart proc~initsolutionmhd3d->module~modgvec_restart module~modgvec_restart_vars MODgvec_Restart_Vars proc~initsolutionmhd3d->module~modgvec_restart_vars module~modgvec_globals MODgvec_Globals module~modgvec_analyze->module~modgvec_globals module~modgvec_mhd3d_evalfunc->module~modgvec_globals module~sll_m_spline_matrix sll_m_spline_matrix module~modgvec_mhd3d_evalfunc->module~sll_m_spline_matrix module~sll_m_spline_matrix_banded sll_m_spline_matrix_banded module~modgvec_mhd3d_evalfunc->module~sll_m_spline_matrix_banded module~modgvec_base MODgvec_base module~modgvec_mhd3d_vars->module~modgvec_base module~modgvec_boundaryfromfile MODgvec_boundaryFromFile module~modgvec_mhd3d_vars->module~modgvec_boundaryfromfile module~modgvec_mhd3d_vars->module~modgvec_globals module~modgvec_hmap MODgvec_hmap module~modgvec_mhd3d_vars->module~modgvec_hmap module~modgvec_rprofile_base MODgvec_rProfile_base module~modgvec_mhd3d_vars->module~modgvec_rprofile_base module~modgvec_sgrid MODgvec_sGrid module~modgvec_mhd3d_vars->module~modgvec_sgrid module~modgvec_sol_var_mhd3d MODgvec_sol_var_MHD3D module~modgvec_mhd3d_vars->module~modgvec_sol_var_mhd3d module~modgvec_readintools->module~modgvec_globals module~modgvec_restart->module~modgvec_globals module~modgvec_restart_vars->module~modgvec_globals module~modgvec_base->module~modgvec_globals module~modgvec_base->module~modgvec_sgrid module~modgvec_fbase MODgvec_fBase module~modgvec_base->module~modgvec_fbase module~modgvec_sbase MODgvec_sBase module~modgvec_base->module~modgvec_sbase module~modgvec_boundaryfromfile->module~modgvec_globals module~modgvec_io_netcdf MODgvec_IO_NETCDF module~modgvec_boundaryfromfile->module~modgvec_io_netcdf iso_fortran_env iso_fortran_env module~modgvec_globals->iso_fortran_env module~modgvec_c_hmap MODgvec_c_hmap module~modgvec_hmap->module~modgvec_c_hmap module~modgvec_hmap_axisnb MODgvec_hmap_axisNB module~modgvec_hmap->module~modgvec_hmap_axisnb module~modgvec_hmap_cyl MODgvec_hmap_cyl module~modgvec_hmap->module~modgvec_hmap_cyl module~modgvec_hmap_frenet MODgvec_hmap_frenet module~modgvec_hmap->module~modgvec_hmap_frenet module~modgvec_hmap_knot MODgvec_hmap_knot module~modgvec_hmap->module~modgvec_hmap_knot module~modgvec_hmap_rz MODgvec_hmap_RZ module~modgvec_hmap->module~modgvec_hmap_rz module~modgvec_rprofile_base->module~modgvec_globals module~modgvec_sgrid->module~modgvec_globals module~modgvec_sol_var_mhd3d->module~modgvec_globals module~modgvec_c_sol_var MODgvec_c_sol_var module~modgvec_sol_var_mhd3d->module~modgvec_c_sol_var module~sll_m_spline_matrix->module~sll_m_spline_matrix_banded module~sll_m_errors sll_m_errors module~sll_m_spline_matrix->module~sll_m_errors module~sll_m_spline_matrix_base sll_m_spline_matrix_base module~sll_m_spline_matrix->module~sll_m_spline_matrix_base module~sll_m_spline_matrix_dense sll_m_spline_matrix_dense module~sll_m_spline_matrix->module~sll_m_spline_matrix_dense module~sll_m_working_precision sll_m_working_precision module~sll_m_spline_matrix->module~sll_m_working_precision module~sll_m_spline_matrix_banded->iso_fortran_env module~sll_m_assert sll_m_assert module~sll_m_spline_matrix_banded->module~sll_m_assert module~sll_m_spline_matrix_banded->module~sll_m_errors module~sll_m_spline_matrix_banded->module~sll_m_spline_matrix_base module~sll_m_spline_matrix_banded->module~sll_m_working_precision module~modgvec_c_hmap->module~modgvec_globals module~modgvec_c_sol_var->module~modgvec_globals module~modgvec_fbase->module~modgvec_globals module~modgvec_hmap_axisnb->module~modgvec_globals module~modgvec_hmap_axisnb->module~modgvec_c_hmap module~modgvec_hmap_axisnb->module~modgvec_fbase module~modgvec_hmap_axisnb->module~modgvec_io_netcdf module~modgvec_hmap_cyl->module~modgvec_globals module~modgvec_hmap_cyl->module~modgvec_c_hmap module~modgvec_hmap_frenet->module~modgvec_globals module~modgvec_hmap_frenet->module~modgvec_c_hmap module~modgvec_hmap_knot->module~modgvec_globals module~modgvec_hmap_knot->module~modgvec_c_hmap module~modgvec_hmap_rz->module~modgvec_globals module~modgvec_hmap_rz->module~modgvec_c_hmap module~modgvec_io_netcdf->module~modgvec_globals module~modgvec_sbase->module~modgvec_globals module~modgvec_sbase->module~modgvec_sgrid module~modgvec_sbase->module~sll_m_spline_matrix module~sll_m_bsplines sll_m_bsplines module~modgvec_sbase->module~sll_m_bsplines module~sll_m_spline_interpolator_1d sll_m_spline_interpolator_1d module~modgvec_sbase->module~sll_m_spline_interpolator_1d module~sll_m_errors->iso_fortran_env module~sll_m_spline_matrix_base->module~sll_m_working_precision module~sll_m_spline_matrix_dense->iso_fortran_env module~sll_m_spline_matrix_dense->module~sll_m_assert module~sll_m_spline_matrix_dense->module~sll_m_errors module~sll_m_spline_matrix_dense->module~sll_m_spline_matrix_base module~sll_m_spline_matrix_dense->module~sll_m_working_precision module~sll_m_bsplines->module~sll_m_assert module~sll_m_bsplines->module~sll_m_errors module~sll_m_bsplines->module~sll_m_working_precision module~sll_m_bsplines_base sll_m_bsplines_base module~sll_m_bsplines->module~sll_m_bsplines_base module~sll_m_bsplines_non_uniform sll_m_bsplines_non_uniform module~sll_m_bsplines->module~sll_m_bsplines_non_uniform module~sll_m_bsplines_uniform sll_m_bsplines_uniform module~sll_m_bsplines->module~sll_m_bsplines_uniform module~sll_m_spline_interpolator_1d->module~sll_m_spline_matrix module~sll_m_spline_interpolator_1d->module~sll_m_assert module~sll_m_spline_interpolator_1d->module~sll_m_errors module~sll_m_spline_interpolator_1d->module~sll_m_working_precision module~sll_m_boundary_condition_descriptors sll_m_boundary_condition_descriptors module~sll_m_spline_interpolator_1d->module~sll_m_boundary_condition_descriptors module~sll_m_spline_interpolator_1d->module~sll_m_bsplines_base module~sll_m_spline_1d sll_m_spline_1d module~sll_m_spline_interpolator_1d->module~sll_m_spline_1d module~sll_m_boundary_condition_descriptors->module~sll_m_working_precision module~sll_m_bsplines_base->module~sll_m_assert module~sll_m_bsplines_base->module~sll_m_working_precision module~sll_m_bsplines_non_uniform->module~sll_m_assert module~sll_m_bsplines_non_uniform->module~sll_m_working_precision module~sll_m_bsplines_non_uniform->module~sll_m_bsplines_base module~sll_m_bsplines_uniform->module~sll_m_assert module~sll_m_bsplines_uniform->module~sll_m_errors module~sll_m_bsplines_uniform->module~sll_m_working_precision module~sll_m_bsplines_uniform->module~sll_m_bsplines_base module~sll_m_spline_1d->module~sll_m_assert module~sll_m_spline_1d->module~sll_m_working_precision module~sll_m_spline_1d->module~sll_m_bsplines_base

Initialize Module

Type Bound

t_functional_mhd3d

Arguments

Type IntentOptional Attributes Name
class(t_functional_mhd3d), intent(inout) :: sf

Calls

proc~~initsolutionmhd3d~~CallsGraph proc~initsolutionmhd3d t_functional_mhd3d%InitSolutionMHD3D analyze analyze proc~initsolutionmhd3d->analyze interface~enter_subregion enter_subregion proc~initsolutionmhd3d->interface~enter_subregion interface~exit_subregion exit_subregion proc~initsolutionmhd3d->interface~exit_subregion interface~par_bcast par_Bcast proc~initsolutionmhd3d->interface~par_bcast interface~writestate WriteState proc~initsolutionmhd3d->interface~writestate none~set_to t_sol_var_MHD3D%set_to proc~initsolutionmhd3d->none~set_to proc~addboundaryperturbation AddBoundaryPerturbation proc~initsolutionmhd3d->proc~addboundaryperturbation proc~evalenergy EvalEnergy proc~initsolutionmhd3d->proc~evalenergy proc~evalforce EvalForce proc~initsolutionmhd3d->proc~evalforce proc~init_la_from_solution Init_LA_from_Solution proc~initsolutionmhd3d->proc~init_la_from_solution proc~initprofilesgp InitProfilesGP proc~initsolutionmhd3d->proc~initprofilesgp proc~initsolution~2 InitSolution proc~initsolutionmhd3d->proc~initsolution~2 proc~par_barrier par_Barrier proc~initsolutionmhd3d->proc~par_barrier proc~sol_var_mhd3d_norm_2 t_sol_var_MHD3D%sol_var_MHD3D_norm_2 proc~initsolutionmhd3d->proc~sol_var_mhd3d_norm_2 restartfromstate restartfromstate proc~initsolutionmhd3d->restartfromstate interface~enter_subregion->interface~enter_subregion interface~exit_subregion->interface~exit_subregion proc~par_bcast_array1d par_Bcast_array1D interface~par_bcast->proc~par_bcast_array1d proc~par_bcast_array1d_int par_Bcast_array1D_int interface~par_bcast->proc~par_bcast_array1d_int proc~par_bcast_array1d_str par_Bcast_array1D_str interface~par_bcast->proc~par_bcast_array1d_str proc~par_bcast_array2d par_Bcast_array2D interface~par_bcast->proc~par_bcast_array2d proc~par_bcast_scalar par_Bcast_scalar interface~par_bcast->proc~par_bcast_scalar proc~par_bcast_scalar_int par_Bcast_scalar_int interface~par_bcast->proc~par_bcast_scalar_int proc~par_bcast_scalar_str par_Bcast_scalar_str interface~par_bcast->proc~par_bcast_scalar_str proc~writestatetoascii WriteStateToASCII interface~writestate->proc~writestatetoascii proc~sol_var_mhd3d_set_to_scalar t_sol_var_MHD3D%sol_var_MHD3D_set_to_scalar none~set_to->proc~sol_var_mhd3d_set_to_scalar proc~sol_var_mhd3d_set_to_solvar t_sol_var_MHD3D%sol_var_MHD3D_set_to_solvar none~set_to->proc~sol_var_mhd3d_set_to_solvar proc~sbase_applybctodof_lgm t_sBase%sBase_applyBCtoDOF_LGM proc~addboundaryperturbation->proc~sbase_applybctodof_lgm proc~sbase_initdof t_sBase%sBase_initDOF proc~addboundaryperturbation->proc~sbase_initdof interface~par_allreduce par_AllReduce proc~evalenergy->interface~par_allreduce proc~evalaux EvalAux proc~evalenergy->proc~evalaux proc~evalforce->interface~par_bcast interface~par_ibcast par_IBcast proc~evalforce->interface~par_ibcast interface~par_ireduce par_IReduce proc~evalforce->interface~par_ireduce par_wait par_wait proc~evalforce->par_wait proc~applybc_fstrong ApplyBC_Fstrong proc~evalforce->proc~applybc_fstrong proc~applyprecond ApplyPrecond proc~evalforce->proc~applyprecond proc~buildprecond BuildPrecond proc~evalforce->proc~buildprecond proc~evalforce->proc~evalaux proc~fbase_projectiptodof_tens t_fBase%fBase_projectIPtoDOF_tens proc~evalforce->proc~fbase_projectiptodof_tens proc~sbase_applybctorhs t_sBase%sBase_applyBCtoRHS proc~evalforce->proc~sbase_applybctorhs solve_inplace solve_inplace proc~evalforce->solve_inplace proc~init_la_from_solution->interface~enter_subregion proc~init_la_from_solution->interface~exit_subregion proc~init_la_from_solution->interface~par_bcast interface~gettime GetTime proc~init_la_from_solution->interface~gettime interface~par_reduce par_Reduce proc~init_la_from_solution->interface~par_reduce interface~progressbar ProgressBar proc~init_la_from_solution->interface~progressbar proc~hmap_new_auxvar hmap_new_auxvar proc~init_la_from_solution->proc~hmap_new_auxvar proc~lambda_solve Lambda_solve proc~init_la_from_solution->proc~lambda_solve proc~rprofile_eval_at_rho c_rProfile%rProfile_eval_at_rho proc~init_la_from_solution->proc~rprofile_eval_at_rho proc~init_la_from_solution->proc~sbase_applybctodof_lgm proc~init_la_from_solution->proc~sbase_initdof proc~initprofilesgp->interface~par_bcast proc~initprofilesgp->proc~rprofile_eval_at_rho proc~initaverageaxis InitAverageAxis proc~initsolution~2->proc~initaverageaxis proc~initsolution~2->proc~sbase_applybctodof_lgm proc~initsolution~2->proc~sbase_initdof vmec_evalsplmode vmec_evalsplmode proc~initsolution~2->vmec_evalsplmode interface~gettime->interface~gettime proc~par_allreduce_array1d par_AllReduce_array1D interface~par_allreduce->proc~par_allreduce_array1d proc~par_allreduce_array2d par_AllReduce_array2D interface~par_allreduce->proc~par_allreduce_array2d proc~par_allreduce_scalar par_AllReduce_scalar interface~par_allreduce->proc~par_allreduce_scalar proc~par_allreduce_scalar_int par_AllReduce_scalar_int interface~par_allreduce->proc~par_allreduce_scalar_int proc~par_ibcast_array1d par_IBcast_array1D interface~par_ibcast->proc~par_ibcast_array1d proc~par_ibcast_array2d par_IBcast_array2D interface~par_ibcast->proc~par_ibcast_array2d proc~par_ireduce_array1d par_IReduce_array1D interface~par_ireduce->proc~par_ireduce_array1d proc~par_ireduce_array2d par_IReduce_array2D interface~par_ireduce->proc~par_ireduce_array2d proc~par_reduce_array1d par_Reduce_array1D interface~par_reduce->proc~par_reduce_array1d proc~par_reduce_array2d par_Reduce_array2D interface~par_reduce->proc~par_reduce_array2d proc~par_reduce_scalar par_Reduce_scalar interface~par_reduce->proc~par_reduce_scalar proc~par_reduce_scalar_int par_Reduce_scalar_int interface~par_reduce->proc~par_reduce_scalar_int interface~progressbar->interface~progressbar proc~applybc_fstrong->proc~sbase_applybctodof_lgm proc~s_spline_matrix_banded__solve_inplace sll_t_spline_matrix_banded%s_spline_matrix_banded__solve_inplace proc~applyprecond->proc~s_spline_matrix_banded__solve_inplace proc~buildprecond->interface~par_allreduce add_element add_element proc~buildprecond->add_element factorize factorize proc~buildprecond->factorize get_element get_element proc~buildprecond->get_element reset reset proc~buildprecond->reset set_element set_element proc~buildprecond->set_element proc~evalaux->interface~par_allreduce eval_all eval_all proc~evalaux->eval_all proc~base_evaldof t_base%base_evalDOF proc~evalaux->proc~base_evaldof proc~base_evaldof_all t_base%base_evalDOF_all proc~evalaux->proc~base_evaldof_all dgemm dgemm proc~fbase_projectiptodof_tens->dgemm proc~fbase_evaldof_ip_tens t_fBase%fBase_evalDOF_IP_tens proc~initaverageaxis->proc~fbase_evaldof_ip_tens proc~fbase_initdof t_fBase%fBase_initDOF proc~initaverageaxis->proc~fbase_initdof proc~lambda_solve->proc~fbase_evaldof_ip_tens proc~hmap_eval_gij_aux c_hmap%hmap_eval_gij_aux proc~lambda_solve->proc~hmap_eval_gij_aux proc~hmap_eval_jh_aux c_hmap%hmap_eval_Jh_aux proc~lambda_solve->proc~hmap_eval_jh_aux proc~lambda_setup_and_solve Lambda_setup_and_solve proc~lambda_solve->proc~lambda_setup_and_solve proc~sbase_evaldof_s t_sBase%sBase_evalDOF_s proc~lambda_solve->proc~sbase_evaldof_s eval_at_rho2 eval_at_rho2 proc~rprofile_eval_at_rho->eval_at_rho2 proc~rho2_derivative rho2_derivative proc~rprofile_eval_at_rho->proc~rho2_derivative proc~rprofile_drho2 c_rProfile%rProfile_drho2 proc~rprofile_eval_at_rho->proc~rprofile_drho2 proc~rprofile_drho3 c_rProfile%rProfile_drho3 proc~rprofile_eval_at_rho->proc~rprofile_drho3 proc~rprofile_drho4 c_rProfile%rProfile_drho4 proc~rprofile_eval_at_rho->proc~rprofile_drho4 proc~solve SOLVE proc~sbase_applybctodof_lgm->proc~solve compute_interpolant compute_interpolant proc~sbase_initdof->compute_interpolant proc~writestatetoascii->proc~rprofile_eval_at_rho interface~getfreeunit GETFREEUNIT proc~writestatetoascii->interface~getfreeunit proc~evaltotals EvalTotals proc~writestatetoascii->proc~evaltotals interface~getfreeunit->interface~getfreeunit proc~base_evaldof->proc~fbase_evaldof_ip_tens proc~base_evaldof_all->proc~fbase_evaldof_ip_tens proc~evaltotals->interface~par_reduce proc~evaltotals->proc~evalaux proc~fbase_evaldof_ip_tens->dgemm proc~fbase_evaldof_xn t_fBase%fBase_evalDOF_xn proc~fbase_evaldof_ip_tens->proc~fbase_evaldof_xn proc~fbase_initdof->proc~fbase_projectiptodof_tens proc~fbase_projectxntodof t_fBase%fBase_projectxntoDOF proc~fbase_initdof->proc~fbase_projectxntodof eval_gij eval_gij proc~hmap_eval_gij_aux->eval_gij eval_Jh eval_Jh proc~hmap_eval_jh_aux->eval_Jh proc~lambda_setup_and_solve->proc~fbase_projectiptodof_tens proc~lambda_setup_and_solve->proc~solve proc~poly_derivative_prefactor poly_derivative_prefactor proc~rho2_derivative->proc~poly_derivative_prefactor proc~rprofile_drho2->eval_at_rho2 proc~rprofile_drho2->proc~rho2_derivative proc~rprofile_drho3->eval_at_rho2 proc~rprofile_drho3->proc~rho2_derivative proc~rprofile_drho4->eval_at_rho2 proc~rprofile_drho4->proc~rho2_derivative dgbtrs dgbtrs proc~s_spline_matrix_banded__solve_inplace->dgbtrs proc~sll_s_error_handler sll_s_error_handler proc~s_spline_matrix_banded__solve_inplace->proc~sll_s_error_handler proc~sbase_eval t_sBase%sBase_eval proc~sbase_evaldof_s->proc~sbase_eval proc~sbase_evaldof_base t_sBase%sBase_evalDOF_base proc~sbase_evaldof_s->proc~sbase_evaldof_base dgetrf dgetrf proc~solve->dgetrf dgetrs dgetrs proc~solve->dgetrs dgemv dgemv proc~fbase_evaldof_xn->dgemv proc~fbase_eval_xn t_fBase%fBase_eval_xn proc~fbase_evaldof_xn->proc~fbase_eval_xn proc~fbase_projectxntodof->dgemv proc~fbase_projectxntodof->proc~fbase_eval_xn eval_basis eval_basis proc~sbase_eval->eval_basis eval_basis_and_n_derivs eval_basis_and_n_derivs proc~sbase_eval->eval_basis_and_n_derivs lagrangeinterpolationpolys lagrangeinterpolationpolys proc~sbase_eval->lagrangeinterpolationpolys proc~sgrid_find_elem t_sGrid%sGrid_find_elem proc~sbase_eval->proc~sgrid_find_elem interface~c_abort~2 c_abort proc~sll_s_error_handler->interface~c_abort~2 proc~errout errout proc~sll_s_error_handler->proc~errout

Called by

proc~~initsolutionmhd3d~~CalledByGraph proc~initsolutionmhd3d t_functional_mhd3d%InitSolutionMHD3D proc~initsolution InitSolution proc~initsolution->proc~initsolutionmhd3d proc~rungvec rungvec proc~rungvec->proc~initsolutionmhd3d proc~start_rungvec start_rungvec proc~start_rungvec->proc~rungvec program~gvec GVEC program~gvec->proc~rungvec

Source Code

SUBROUTINE InitSolutionMHD3D(sf)
! MODULES
  USE MODgvec_MHD3D_Vars     , ONLY: which_init,init_LA,boundary_perturb,boundary_perturb_depth,boundary_perturb_type
  USE MODgvec_Restart_vars   , ONLY: doRestart,RestartFile
  USE MODgvec_Restart        , ONLY: RestartFromState
  USE MODgvec_Restart        , ONLY: WriteState
  USE MODgvec_MHD3D_EvalFunc , ONLY: InitProfilesGP,EvalEnergy,EvalForce
  USE MODgvec_Analyze        , ONLY: Analyze
  USE MODgvec_ReadInTools    , ONLY: GETLOGICAL
  USE MODgvec_MPI            , ONLY: par_Bcast,par_barrier
  IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
! INPUT VARIABLES
  CLASS(t_functional_mhd3d), INTENT(INOUT) :: sf
!-----------------------------------------------------------------------------------------------------------------------------------
! OUTPUT VARIABLES
!-----------------------------------------------------------------------------------------------------------------------------------
! LOCAL VARIABLES
  INTEGER              :: JacCheck
!===================================================================================================================================
  CALL par_barrier(beforeScreenOut="    INITIALIZE SOLUTION...",afterScreenOut="                           ...")
  CALL enter_subregion("init-solution")
  ASSOCIATE(vars=>sf%minimizer%vars)
    IF(MPIroot) THEN
      IF(doRestart)THEN
        WRITE(UNIT_stdOut,'(4X,A)')'... restarting from file ... '
        CALL RestartFromState(RestartFile,vars%dofs(0))
        CALL InitSolution(vars%dofs(0),-1) ! (re-)apply BC and init LA (if init_LA is true)
      ELSE
        CALL InitSolution(vars%dofs(0),which_init)
      END IF
      IF(boundary_perturb)THEN
        CALL AddBoundaryPerturbation(vars%dofs(0),boundary_perturb_depth,boundary_perturb_type)
      END IF !boundary_perturb
    END IF !MPIroot
    CALL par_Bcast(vars%dofs(0)%X1,0)
    CALL par_Bcast(vars%dofs(0)%X2,0)
    CALL exit_subregion("init-solution")

    IF(init_LA) THEN
      CALL Init_LA_From_Solution(vars%dofs(0))  !BCast inside
    ELSE
      CALL par_Bcast(vars%dofs(0)%LA,0)
    END IF

    CALL vars%dofs(-1)%set_to(vars%dofs(0))

    JacCheck=2
    CALL InitProfilesGP() !evaluate profiles once at Gauss Points (on MPIroot + BCast)

    CALL enter_subregion("check-solution")
    vars%dofs(0)%W_MHD3D=EvalEnergy(vars%dofs(0),.TRUE.,JacCheck)
    IF(JacCheck.EQ.-1)THEN
      CALL Analyze(0, vars%dofs(0), vars%force(0))
      CALL abort(__STAMP__,&
          "NEGATIVE JACOBIAN FOUND AFTER INITIALIZATION!",TypeInfo="InitializationError")
    END IF
    CALL WriteState(vars%dofs(0),0)
    CALL EvalForce(vars%dofs(0),.FALSE.,JacCheck, vars%force(0))
    SWRITE(UNIT_stdOut,'(8x,A,3E11.4)')'|Force|= ',SQRT(vars%force(0)%norm_2())
    CALL Analyze(0, vars%dofs(0), vars%force(0))
  END ASSOCIATE !vars
  CALL exit_subregion("check-solution")
  CALL par_barrier(afterScreenOut="    ...DONE")
  SWRITE(UNIT_stdOut,fmt_sep)
END SUBROUTINE InitSolutionMHD3D