ReadVMEC Subroutine

public subroutine ReadVMEC(fileName, file_Format)

Uses

  • proc~~readvmec~~UsesGraph proc~readvmec ReadVMEC module~modgvec_globals MODgvec_Globals proc~readvmec->module~modgvec_globals iso_fortran_env iso_fortran_env module~modgvec_globals->iso_fortran_env

READ VMEC "wout" datafile, needs netcdf library!

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: fileName
integer, intent(in) :: file_Format

Calls

proc~~readvmec~~CallsGraph proc~readvmec ReadVMEC proc~readnemec ReadNEMEC proc~readvmec->proc~readnemec interface~getfreeunit GETFREEUNIT proc~readnemec->interface~getfreeunit proc~alloc_all alloc_all proc~readnemec->proc~alloc_all proc~halftofull HalfToFull proc~readnemec->proc~halftofull interface~getfreeunit->interface~getfreeunit proc~cubspl_eval t_cubspl%cubspl_eval proc~halftofull->proc~cubspl_eval eval_basis eval_basis proc~cubspl_eval->eval_basis eval_basis_and_n_derivs eval_basis_and_n_derivs proc~cubspl_eval->eval_basis_and_n_derivs

Called by

proc~~readvmec~~CalledByGraph proc~readvmec ReadVMEC proc~initvmec InitVMEC proc~initvmec->proc~readvmec

Source Code

SUBROUTINE ReadVMEC(fileName,file_Format)
  USE MODgvec_Globals,ONLY:MPIroot
  IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
! INPUT/OUTPUT VARIABLES
  CHARACTER(LEN = *), INTENT(IN) :: fileName
  INTEGER           , INTENT(IN) :: file_Format
!-----------------------------------------------------------------------------------------------------------------------------------
! OUTPUT VARIABLES
!-----------------------------------------------------------------------------------------------------------------------------------
! LOCAL VARIABLES
  INTEGER :: ok
!===================================================================================================================================
  IF(.NOT. MPIroot)RETURN
  SELECT CASE(file_Format)
  CASE(0)
#if NETCDF
    ! read VMEC 2000 output (netcdf)
    WRITE(UNIT_stdOut,'(4X,A)')'VMEC READ WOUT FILE "'//TRIM(fileName)//'" in NETCDF format ...'
    CALL ReadVmec_NETCDF(fileName)
#else
    CALL abort(__STAMP__,&
        "cannot read VMEC file, since code is compiled with BUILD_NETCDF=OFF")
#endif
  CASE(1)
    WRITE(UNIT_stdOut,'(4X,A)')'VMEC READ WOUT FILE "'//TRIM(fileName)//'" in NEMEC ASCII format ...'
    CALL ReadNEMEC(fileName,1,ok)
    IF(ok.NE.0) CALL abort(__STAMP__,&
        "Problems with VMEC readin from NEMEC format (VMECwoutfile_format=1), maybe file is binary")
  CASE(2)
    WRITE(UNIT_stdOut,'(4X,A)')'VMEC READ WOUT FILE "'//TRIM(fileName)//'" in NEMEC BINARY format ...'
    CALL ReadNEMEC(fileName,0,ok)
    IF(ok.NE.0) CALL abort(__STAMP__,&
        "Problems with VMEC readin from NEMEC format (VMECwoutfile_format=2), maybe file is ascii")
  END SELECT !file_format
END SUBROUTINE ReadVMEC