vmec_vars.f90 Source File


This file depends on

sourcefile~~vmec_vars.f90~~EfferentGraph sourcefile~vmec_vars.f90 vmec_vars.f90 sourcefile~c_rprofile.f90 c_rprofile.f90 sourcefile~vmec_vars.f90->sourcefile~c_rprofile.f90 sourcefile~cubic_spline.f90 cubic_spline.f90 sourcefile~vmec_vars.f90->sourcefile~cubic_spline.f90 sourcefile~globals.f90 globals.f90 sourcefile~vmec_vars.f90->sourcefile~globals.f90 sourcefile~c_rprofile.f90->sourcefile~globals.f90 sourcefile~cubic_spline.f90->sourcefile~globals.f90 sourcefile~sll_m_bsplines.f90 sll_m_bsplines.f90 sourcefile~cubic_spline.f90->sourcefile~sll_m_bsplines.f90 sourcefile~sll_m_spline_matrix.f90 sll_m_spline_matrix.f90 sourcefile~cubic_spline.f90->sourcefile~sll_m_spline_matrix.f90 sourcefile~sll_m_bsplines_base.f90 sll_m_bsplines_base.f90 sourcefile~sll_m_bsplines.f90->sourcefile~sll_m_bsplines_base.f90 sourcefile~sll_m_bsplines_non_uniform.f90 sll_m_bsplines_non_uniform.f90 sourcefile~sll_m_bsplines.f90->sourcefile~sll_m_bsplines_non_uniform.f90 sourcefile~sll_m_bsplines_uniform.f90 sll_m_bsplines_uniform.f90 sourcefile~sll_m_bsplines.f90->sourcefile~sll_m_bsplines_uniform.f90 sourcefile~sll_m_working_precision.f90 sll_m_working_precision.f90 sourcefile~sll_m_bsplines.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_spline_matrix_banded.f90 sll_m_spline_matrix_banded.f90 sourcefile~sll_m_spline_matrix.f90->sourcefile~sll_m_spline_matrix_banded.f90 sourcefile~sll_m_spline_matrix_base.f90 sll_m_spline_matrix_base.f90 sourcefile~sll_m_spline_matrix.f90->sourcefile~sll_m_spline_matrix_base.f90 sourcefile~sll_m_spline_matrix_dense.f90 sll_m_spline_matrix_dense.f90 sourcefile~sll_m_spline_matrix.f90->sourcefile~sll_m_spline_matrix_dense.f90 sourcefile~sll_m_spline_matrix.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_bsplines_base.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_bsplines_non_uniform.f90->sourcefile~sll_m_bsplines_base.f90 sourcefile~sll_m_bsplines_non_uniform.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_bsplines_uniform.f90->sourcefile~sll_m_bsplines_base.f90 sourcefile~sll_m_bsplines_uniform.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_spline_matrix_banded.f90->sourcefile~sll_m_spline_matrix_base.f90 sourcefile~sll_m_spline_matrix_banded.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_spline_matrix_base.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_spline_matrix_dense.f90->sourcefile~sll_m_spline_matrix_base.f90 sourcefile~sll_m_spline_matrix_dense.f90->sourcefile~sll_m_working_precision.f90

Files dependent on this one

sourcefile~~vmec_vars.f90~~AfferentGraph sourcefile~vmec_vars.f90 vmec_vars.f90 sourcefile~analyze.f90 analyze.f90 sourcefile~analyze.f90->sourcefile~vmec_vars.f90 sourcefile~vmec.f90 vmec.f90 sourcefile~analyze.f90->sourcefile~vmec.f90 sourcefile~mhd3d.f90 mhd3d.f90 sourcefile~mhd3d.f90->sourcefile~vmec_vars.f90 sourcefile~mhd3d.f90->sourcefile~analyze.f90 sourcefile~mhd3d.f90->sourcefile~vmec.f90 sourcefile~vmec.f90->sourcefile~vmec_vars.f90 sourcefile~functional.f90 functional.f90 sourcefile~functional.f90->sourcefile~mhd3d.f90 sourcefile~gvec_post.f90 gvec_post.f90 sourcefile~gvec_post.f90->sourcefile~analyze.f90 sourcefile~gvec_post.f90->sourcefile~functional.f90 sourcefile~rungvec.f90 rungvec.f90 sourcefile~rungvec.f90->sourcefile~analyze.f90 sourcefile~rungvec.f90->sourcefile~functional.f90 sourcefile~state.f90 state.f90 sourcefile~state.f90->sourcefile~analyze.f90 sourcefile~state.f90->sourcefile~functional.f90 sourcefile~gvec.f90 gvec.f90 sourcefile~gvec.f90->sourcefile~rungvec.f90 sourcefile~run.f90 run.f90 sourcefile~run.f90->sourcefile~rungvec.f90

Source Code

!===================================================================================================================================
! Copyright (c) 2025 GVEC Contributors, Max Planck Institute for Plasma Physics
! License: MIT
!===================================================================================================================================


!===================================================================================================================================
!>
!!# Module **VMEC Variables**
!!
!!
!===================================================================================================================================
MODULE MODgvec_VMEC_Vars
! MODULES
USE MODgvec_Globals, ONLY: wp
USE MODgvec_rProfile_base, ONLY: c_rProfile
USE MODgvec_cubic_spline, ONLY: t_cubspl
IMPLICIT NONE
PUBLIC
!-----------------------------------------------------------------------------------------------------------------------------------


! GLOBAL VARIABLES
LOGICAL                 :: useVMEC                   !! main switch
LOGICAL                 :: switchZeta                !! switch vmec_phi = -zeta
LOGICAL                 :: switchTheta               !! switch vmec_theta = -theta
CHARACTER(LEN = 256)    :: VMECdataFile
INTEGER                 :: VMECFile_Format           !! 0: netcdf format (default), 1: nemec ascii, 2: nemec binary
INTEGER,ALLOCATABLE     :: xmAbs(:)                  !! |xm(iMode)|, 1 for m=0, 2 for even, 3 for odd
REAL(wp),ALLOCATABLE    :: Phi_prof(:)               !! TOROIDAL flux profile (called phi in VMEC)
REAL(wp),ALLOCATABLE    :: normFlux_prof(:)          !! normalized flux profile, can be either toroidal of poloidal flux)
REAL(wp),ALLOCATABLE    :: chi_prof(:)               !! POLOIDAL flux profile (called chi in VMEC)

REAL(wp),ALLOCATABLE    :: rho(:)                    !! := sqrt(phinorm) at all flux surface

TYPE(t_cubspl),ALLOCATABLE    :: Rmnc_Spl(:)           !! cubic spline fit of R cosine, array over modes
TYPE(t_cubspl),ALLOCATABLE    :: Rmns_Spl(:)           !! cubic spline fit of R sine, array over modes
TYPE(t_cubspl),ALLOCATABLE    :: lmnc_Spl(:)           !! cubic spline fit of lambda  cosine , array over modes
TYPE(t_cubspl),ALLOCATABLE    :: lmns_Spl(:)           !! cubic spline fit of lambda sine, array over modes
TYPE(t_cubspl),ALLOCATABLE    :: Zmnc_Spl(:)           !! cubic spline fit of Z cosine,array over modes
TYPE(t_cubspl),ALLOCATABLE    :: Zmns_Spl(:)           !! cubic spline fit of Z sine,array over modes
CLASS(c_rProfile), ALLOCATABLE :: vmec_Phi_profile        !! B-spline profiles in (rho^2) for Phi
CLASS(c_rProfile), ALLOCATABLE :: vmec_Chi_profile        !! B-spline profile in (rho^2) for chi
CLASS(c_rProfile), ALLOCATABLE :: vmec_iota_profile        !! B-spline profiles in (rho^2) for iota
CLASS(c_rProfile), ALLOCATABLE :: vmec_pres_profile        !! B-spline profile in (rho^2) for pressure

!===================================================================================================================================
END MODULE MODgvec_VMEC_Vars