READ VMEC "wout" datafile, needs netcdf library!
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | fileName | |||
| integer, | intent(in) | :: | file_Format |
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