VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
open_output_files.f90
Go to the documentation of this file.
1
3
8SUBROUTINE open_output_files (extension, lfirst)
10 USE vparams, ONLY: nthreed, nthreed0
11 IMPLICIT NONE
12
13 CHARACTER(LEN=*) :: extension
14 LOGICAL :: lfirst
15
16 INTEGER :: iread, inthreed=0
17 CHARACTER(LEN=120) :: threed1_file
18
19 ! OPEN FILES FOR READING, WRITING
20 inthreed = 0
21 threed1_file = 'threed1.'//extension
22
23 INQUIRE(file=threed1_file, opened=lfirst)
24 lfirst = .not.lfirst
25 IF (.not.lfirst) RETURN
26
27 WRITE (*, '(33('' -''))')
29 CALL safe_open(nthreed, iread, threed1_file, 'new', 'formatted')
30 IF (iread .ne. 0) THEN
31 print *,' VMEC OUTPUT FILES ALREADY EXIST: OVERWRITING THEM ...'
32 CALL safe_open(nthreed, inthreed, threed1_file, 'replace', 'formatted')
33 ENDIF
34
35END SUBROUTINE open_output_files
fault-tolerant file opening routines
subroutine safe_open(iunit, istat, filename, filestat, fileform, record_in, access_in, delim_in)
integer nthreed
Definition vparams.f90:28
integer, parameter nthreed0
Definition vparams.f90:22
subroutine open_output_files(extension, lfirst)
Open output files.