gvec.f90 Source File


This file depends on

sourcefile~~gvec.f90~~EfferentGraph sourcefile~gvec.f90 gvec.f90 sourcefile~cla.f90 cla.f90 sourcefile~gvec.f90->sourcefile~cla.f90 sourcefile~globals.f90 globals.f90 sourcefile~gvec.f90->sourcefile~globals.f90 sourcefile~mod_mpi.f90 mod_mpi.f90 sourcefile~gvec.f90->sourcefile~mod_mpi.f90 sourcefile~rungvec.f90 rungvec.f90 sourcefile~gvec.f90->sourcefile~rungvec.f90 sourcefile~mod_mpi.f90->sourcefile~globals.f90 sourcefile~rungvec.f90->sourcefile~globals.f90 sourcefile~analyze.f90 analyze.f90 sourcefile~rungvec.f90->sourcefile~analyze.f90 sourcefile~functional.f90 functional.f90 sourcefile~rungvec.f90->sourcefile~functional.f90 sourcefile~mhd3d_vars.f90 mhd3d_vars.f90 sourcefile~rungvec.f90->sourcefile~mhd3d_vars.f90 sourcefile~output.f90 output.f90 sourcefile~rungvec.f90->sourcefile~output.f90 sourcefile~readintools.f90 readintools.f90 sourcefile~rungvec.f90->sourcefile~readintools.f90 sourcefile~restart.f90 restart.f90 sourcefile~rungvec.f90->sourcefile~restart.f90 sourcefile~analyze.f90->sourcefile~globals.f90 sourcefile~analyze.f90->sourcefile~mod_mpi.f90 sourcefile~analyze.f90->sourcefile~mhd3d_vars.f90 sourcefile~analyze.f90->sourcefile~readintools.f90 sourcefile~analyze_vars.f90 analyze_vars.f90 sourcefile~analyze.f90->sourcefile~analyze_vars.f90 sourcefile~cubic_spline.f90 cubic_spline.f90 sourcefile~analyze.f90->sourcefile~cubic_spline.f90 sourcefile~output_csv.f90 output_csv.f90 sourcefile~analyze.f90->sourcefile~output_csv.f90 sourcefile~output_vars.f90 output_vars.f90 sourcefile~analyze.f90->sourcefile~output_vars.f90 sourcefile~output_vtk.f90 output_vtk.f90 sourcefile~analyze.f90->sourcefile~output_vtk.f90 sourcefile~vmec.f90 vmec.f90 sourcefile~analyze.f90->sourcefile~vmec.f90 sourcefile~vmec_vars.f90 vmec_vars.f90 sourcefile~analyze.f90->sourcefile~vmec_vars.f90 sourcefile~write_modes.f90 write_modes.f90 sourcefile~analyze.f90->sourcefile~write_modes.f90 sourcefile~functional.f90->sourcefile~globals.f90 sourcefile~c_functional.f90 c_functional.f90 sourcefile~functional.f90->sourcefile~c_functional.f90 sourcefile~mhd3d.f90 mhd3d.f90 sourcefile~functional.f90->sourcefile~mhd3d.f90 sourcefile~mhd3d_vars.f90->sourcefile~globals.f90 sourcefile~base.f90 base.f90 sourcefile~mhd3d_vars.f90->sourcefile~base.f90 sourcefile~c_rprofile.f90 c_rprofile.f90 sourcefile~mhd3d_vars.f90->sourcefile~c_rprofile.f90 sourcefile~hmap.f90 hmap.f90 sourcefile~mhd3d_vars.f90->sourcefile~hmap.f90 sourcefile~sgrid.f90 sgrid.f90 sourcefile~mhd3d_vars.f90->sourcefile~sgrid.f90 sourcefile~sol_var_mhd3d.f90 sol_var_mhd3d.f90 sourcefile~mhd3d_vars.f90->sourcefile~sol_var_mhd3d.f90 sourcefile~output.f90->sourcefile~globals.f90 sourcefile~output.f90->sourcefile~readintools.f90 sourcefile~output.f90->sourcefile~output_vars.f90 sourcefile~readintools.f90->sourcefile~globals.f90 sourcefile~readintools.f90->sourcefile~mod_mpi.f90 sourcefile~restart.f90->sourcefile~globals.f90 sourcefile~restart.f90->sourcefile~mod_mpi.f90 sourcefile~restart.f90->sourcefile~mhd3d_vars.f90 sourcefile~restart.f90->sourcefile~base.f90 sourcefile~mhd3d_evalfunc.f90 mhd3d_evalfunc.f90 sourcefile~restart.f90->sourcefile~mhd3d_evalfunc.f90 sourcefile~restart.f90->sourcefile~output_vars.f90 sourcefile~readstate.f90 readstate.f90 sourcefile~restart.f90->sourcefile~readstate.f90 sourcefile~readstate_vars.f90 readstate_vars.f90 sourcefile~restart.f90->sourcefile~readstate_vars.f90 sourcefile~restart_vars.f90 restart_vars.f90 sourcefile~restart.f90->sourcefile~restart_vars.f90 sourcefile~restart.f90->sourcefile~sgrid.f90 sourcefile~restart.f90->sourcefile~sol_var_mhd3d.f90 sourcefile~analyze_vars.f90->sourcefile~globals.f90 sourcefile~base.f90->sourcefile~globals.f90 sourcefile~base.f90->sourcefile~sgrid.f90 sourcefile~fbase.f90 fbase.f90 sourcefile~base.f90->sourcefile~fbase.f90 sourcefile~sbase.f90 sbase.f90 sourcefile~base.f90->sourcefile~sbase.f90 sourcefile~c_functional.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~hmap.f90->sourcefile~globals.f90 sourcefile~c_hmap.f90 c_hmap.f90 sourcefile~hmap.f90->sourcefile~c_hmap.f90 sourcefile~hmap_axisnb.f90 hmap_axisNB.f90 sourcefile~hmap.f90->sourcefile~hmap_axisnb.f90 sourcefile~hmap_cyl.f90 hmap_cyl.f90 sourcefile~hmap.f90->sourcefile~hmap_cyl.f90 sourcefile~hmap_frenet.f90 hmap_frenet.f90 sourcefile~hmap.f90->sourcefile~hmap_frenet.f90 sourcefile~hmap_knot.f90 hmap_knot.f90 sourcefile~hmap.f90->sourcefile~hmap_knot.f90 sourcefile~hmap_rz.f90 hmap_RZ.f90 sourcefile~hmap.f90->sourcefile~hmap_rz.f90 sourcefile~mhd3d.f90->sourcefile~globals.f90 sourcefile~mhd3d.f90->sourcefile~mod_mpi.f90 sourcefile~mhd3d.f90->sourcefile~analyze.f90 sourcefile~mhd3d.f90->sourcefile~mhd3d_vars.f90 sourcefile~mhd3d.f90->sourcefile~readintools.f90 sourcefile~mhd3d.f90->sourcefile~restart.f90 sourcefile~mhd3d.f90->sourcefile~base.f90 sourcefile~mhd3d.f90->sourcefile~c_functional.f90 sourcefile~mhd3d.f90->sourcefile~c_rprofile.f90 sourcefile~mhd3d.f90->sourcefile~cubic_spline.f90 sourcefile~mhd3d.f90->sourcefile~hmap.f90 sourcefile~mhd3d.f90->sourcefile~mhd3d_evalfunc.f90 sourcefile~mhd3d.f90->sourcefile~output_vars.f90 sourcefile~mhd3d.f90->sourcefile~restart_vars.f90 sourcefile~mhd3d.f90->sourcefile~sgrid.f90 sourcefile~mhd3d.f90->sourcefile~sol_var_mhd3d.f90 sourcefile~mhd3d.f90->sourcefile~vmec.f90 sourcefile~mhd3d.f90->sourcefile~vmec_vars.f90 sourcefile~boundaryfromfile.f90 boundaryFromFile.f90 sourcefile~mhd3d.f90->sourcefile~boundaryfromfile.f90 sourcefile~lambda_solve.f90 lambda_solve.f90 sourcefile~mhd3d.f90->sourcefile~lambda_solve.f90 sourcefile~rprofile_bspline.f90 rprofile_bspline.f90 sourcefile~mhd3d.f90->sourcefile~rprofile_bspline.f90 sourcefile~rprofile_polynomial.f90 rprofile_polynomial.f90 sourcefile~mhd3d.f90->sourcefile~rprofile_polynomial.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~globals.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~mod_mpi.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~mhd3d_vars.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~base.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~sol_var_mhd3d.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~sll_m_spline_matrix.f90 sourcefile~sll_m_spline_matrix_banded.f90 sll_m_spline_matrix_banded.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~sll_m_spline_matrix_banded.f90 sourcefile~output_csv.f90->sourcefile~globals.f90 sourcefile~output_vars.f90->sourcefile~globals.f90 sourcefile~output_vtk.f90->sourcefile~globals.f90 sourcefile~readstate.f90->sourcefile~globals.f90 sourcefile~readstate.f90->sourcefile~base.f90 sourcefile~readstate.f90->sourcefile~hmap.f90 sourcefile~readstate.f90->sourcefile~readstate_vars.f90 sourcefile~readstate.f90->sourcefile~sgrid.f90 sourcefile~readstate.f90->sourcefile~fbase.f90 sourcefile~readstate.f90->sourcefile~sbase.f90 sourcefile~readstate_vars.f90->sourcefile~globals.f90 sourcefile~readstate_vars.f90->sourcefile~base.f90 sourcefile~readstate_vars.f90->sourcefile~hmap.f90 sourcefile~readstate_vars.f90->sourcefile~sgrid.f90 sourcefile~readstate_vars.f90->sourcefile~sbase.f90 sourcefile~restart_vars.f90->sourcefile~globals.f90 sourcefile~sgrid.f90->sourcefile~globals.f90 sourcefile~sol_var_mhd3d.f90->sourcefile~globals.f90 sourcefile~c_sol_var.f90 c_sol_var.f90 sourcefile~sol_var_mhd3d.f90->sourcefile~c_sol_var.f90 sourcefile~vmec.f90->sourcefile~globals.f90 sourcefile~vmec.f90->sourcefile~readintools.f90 sourcefile~vmec.f90->sourcefile~cubic_spline.f90 sourcefile~vmec.f90->sourcefile~vmec_vars.f90 sourcefile~vmec.f90->sourcefile~rprofile_bspline.f90 sourcefile~vmec_vars.f90->sourcefile~globals.f90 sourcefile~vmec_vars.f90->sourcefile~c_rprofile.f90 sourcefile~vmec_vars.f90->sourcefile~cubic_spline.f90 sourcefile~write_modes.f90->sourcefile~globals.f90 sourcefile~write_modes.f90->sourcefile~output_csv.f90 sourcefile~boundaryfromfile.f90->sourcefile~globals.f90 sourcefile~boundaryfromfile.f90->sourcefile~fbase.f90 sourcefile~io_netcdf.f90 io_netcdf.f90 sourcefile~boundaryfromfile.f90->sourcefile~io_netcdf.f90 sourcefile~c_hmap.f90->sourcefile~globals.f90 sourcefile~c_sol_var.f90->sourcefile~globals.f90 sourcefile~fbase.f90->sourcefile~globals.f90 sourcefile~hmap_axisnb.f90->sourcefile~globals.f90 sourcefile~hmap_axisnb.f90->sourcefile~mod_mpi.f90 sourcefile~hmap_axisnb.f90->sourcefile~readintools.f90 sourcefile~hmap_axisnb.f90->sourcefile~analyze_vars.f90 sourcefile~hmap_axisnb.f90->sourcefile~output_csv.f90 sourcefile~hmap_axisnb.f90->sourcefile~output_vtk.f90 sourcefile~hmap_axisnb.f90->sourcefile~c_hmap.f90 sourcefile~hmap_axisnb.f90->sourcefile~fbase.f90 sourcefile~hmap_axisnb.f90->sourcefile~io_netcdf.f90 sourcefile~output_netcdf.f90 output_netcdf.f90 sourcefile~hmap_axisnb.f90->sourcefile~output_netcdf.f90 sourcefile~hmap_cyl.f90->sourcefile~globals.f90 sourcefile~hmap_cyl.f90->sourcefile~readintools.f90 sourcefile~hmap_cyl.f90->sourcefile~c_hmap.f90 sourcefile~hmap_frenet.f90->sourcefile~globals.f90 sourcefile~hmap_frenet.f90->sourcefile~readintools.f90 sourcefile~hmap_frenet.f90->sourcefile~analyze_vars.f90 sourcefile~hmap_frenet.f90->sourcefile~output_csv.f90 sourcefile~hmap_frenet.f90->sourcefile~output_vtk.f90 sourcefile~hmap_frenet.f90->sourcefile~c_hmap.f90 sourcefile~hmap_frenet.f90->sourcefile~output_netcdf.f90 sourcefile~hmap_knot.f90->sourcefile~globals.f90 sourcefile~hmap_knot.f90->sourcefile~readintools.f90 sourcefile~hmap_knot.f90->sourcefile~c_hmap.f90 sourcefile~hmap_rz.f90->sourcefile~globals.f90 sourcefile~hmap_rz.f90->sourcefile~c_hmap.f90 sourcefile~lambda_solve.f90->sourcefile~globals.f90 sourcefile~lambda_solve.f90->sourcefile~base.f90 sourcefile~lambda_solve.f90->sourcefile~hmap.f90 sourcefile~lambda_solve.f90->sourcefile~fbase.f90 sourcefile~linalg.f90 linalg.f90 sourcefile~lambda_solve.f90->sourcefile~linalg.f90 sourcefile~rprofile_bspline.f90->sourcefile~globals.f90 sourcefile~rprofile_bspline.f90->sourcefile~c_rprofile.f90 sourcefile~rprofile_bspline.f90->sourcefile~sll_m_bsplines.f90 sourcefile~rprofile_polynomial.f90->sourcefile~globals.f90 sourcefile~rprofile_polynomial.f90->sourcefile~c_rprofile.f90 sourcefile~sbase.f90->sourcefile~globals.f90 sourcefile~sbase.f90->sourcefile~sgrid.f90 sourcefile~sbase.f90->sourcefile~sll_m_bsplines.f90 sourcefile~sbase.f90->sourcefile~sll_m_spline_matrix.f90 sourcefile~basis1d.f90 basis1d.f90 sourcefile~sbase.f90->sourcefile~basis1d.f90 sourcefile~sbase.f90->sourcefile~linalg.f90 sourcefile~sll_m_boundary_condition_descriptors.f90 sll_m_boundary_condition_descriptors.f90 sourcefile~sbase.f90->sourcefile~sll_m_boundary_condition_descriptors.f90 sourcefile~sll_m_spline_interpolator_1d.f90 sll_m_spline_interpolator_1d.f90 sourcefile~sbase.f90->sourcefile~sll_m_spline_interpolator_1d.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.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_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~basis1d.f90->sourcefile~globals.f90 sourcefile~basis1d.f90->sourcefile~linalg.f90 sourcefile~io_netcdf.f90->sourcefile~globals.f90 sourcefile~linalg.f90->sourcefile~globals.f90 sourcefile~output_netcdf.f90->sourcefile~globals.f90 sourcefile~output_netcdf.f90->sourcefile~io_netcdf.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_interpolator_1d.f90->sourcefile~sll_m_spline_matrix.f90 sourcefile~sll_m_spline_interpolator_1d.f90->sourcefile~sll_m_boundary_condition_descriptors.f90 sourcefile~sll_m_spline_interpolator_1d.f90->sourcefile~sll_m_bsplines_base.f90 sourcefile~sll_m_spline_interpolator_1d.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_spline_1d.f90 sll_m_spline_1d.f90 sourcefile~sll_m_spline_interpolator_1d.f90->sourcefile~sll_m_spline_1d.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 sourcefile~sll_m_spline_1d.f90->sourcefile~sll_m_bsplines_base.f90 sourcefile~sll_m_spline_1d.f90->sourcefile~sll_m_working_precision.f90

Source Code

!===================================================================================================================================
! Copyright (c) 2025 GVEC Contributors, Max Planck Institute for Plasma Physics
! License: MIT
!===================================================================================================================================
#include "defines.h"


!===================================================================================================================================
!>
!!# **GVEC** Driver program
!!
!===================================================================================================================================
PROGRAM GVEC
  USE_MPI
  USE MODgvec_Globals, ONLY : UNIT_stdOut,abort,MPIroot
  USE MODgvec_MPI    ,ONLY  : par_Init,par_finalize
  USE MODgvec_rungvec, ONLY : rungvec
  USE MODgvec_cla
  IMPLICIT NONE
  !-----------------------------------------------------------------------------------------------------------------------------------
  !local variables
  CHARACTER(LEN=STRLEN)   :: Parameterfile=""
  CHARACTER(LEN=STRLEN)   :: RestartFile=""
  CHARACTER(LEN=STRLEN)   :: f_str
  CHARACTER(LEN=24)       :: execname="gvec"
  LOGICAL                 :: commandFailed
  LOGICAL                 :: doRestart
  !===================================================================================================================================
  CALL par_Init() !USE MPI_COMM_WORLD

  IF(MPIroot)THEN
    !USING CLAF90 module to get command line arguments!
    CALL cla_init()

    CALL cla_posarg_register('parameterfile', &
         ' path/filename of GVEC input parameter file [MANDATORY]',  cla_char,'') !
    CALL cla_posarg_register('statefile', &
         'path/filename of a GVEC State. if provided, a restart from this State is done  [OPTIONAL, DEFAULT: None provided]',  cla_char,'')
    CALL cla_validate('gvec')
    CALL cla_get('parameterfile',f_str)
    parameterfile=TRIM(f_str)
    CALL cla_get('statefile',f_str)
    RestartFile=TRIM(f_str)
    commandFailed=.FALSE.
    IF((LEN(TRIM(parameterfile)).EQ.0))THEN
      IF(.NOT.commandFailed) CALL cla_help(execname)
      commandFailed=.TRUE.
      SWRITE(UNIT_StdOut,*) " ==> input parameter filename is MANDATORY must be specified as first positional argument!!!"
    END IF
    dorestart=(LEN(TRIM(restartFile)).GT.0)

    IF(commandFailed) STOP " ...check your command line arguments!"
  END IF !MPIroot
  IF(dorestart)THEN
    CALL rungvec(parameterfile,restartfile_in=restartfile)
  ELSE
    CALL rungvec(parameterfile)
  END IF

  CALL par_finalize()
END PROGRAM GVEC