V3FIT
driver.f
1  PROGRAM driver
2  USE stel_kinds
3  USE parambs, ONLY : lscreen
4  USE safe_open_mod
5  IMPLICIT NONE
6 C-----------------------------------------------
7 C L o c a l V a r i a b l e s
8 C-----------------------------------------------
9  INTEGER :: istat, numargs, iunit_in = 10
10  CHARACTER*120 :: extension
11  CHARACTER*50 :: arg1, arg2
12  REAL(rprec) :: curtor
13 C-----------------------------------------------
14 !
15 ! driver: reads from command line file the wout file extension and surfaces
16 ! (half-radial) at which the bootstrap current is required
17 ! writes the bootstrap current, jdotb to a file, jbbs.extension
18 !
19 ! call this as follows: xbootjs input.boots (t or f)
20 !
21 ! where input.boz contains the wout file extension and the jrad values (as a
22 ! blank-delimited list, not necessarily on a single line):
23 !
24 ! FILE_EXTENSION
25 ! 2 3 5 10 12
26 !
27 ! The surface numbers are relative to half-mesh vmec quantities.
28 ! thus, 2 is the first half mesh point.
29 !
30 ! The optional (T) or (F) argument allows (default) or suppresses output to screen.
31 !
32  lscreen = .true.
33 
34  CALL getcarg(1, arg1, numargs)
35  IF (numargs .gt. 1) CALL getcarg(2, arg2, numargs)
36 
37  IF (numargs .lt. 1 .or.
38  1 (arg1 .eq. '-h' .or. arg1 .eq. '/h')) THEN
39  print *,
40  1 ' ENTER INPUT FILE NAME ON COMMAND LINE'
41  print *,' For example: xbootsj in_bootsj.tftr'
42  print *
43  print *,
44  1 ' Optional command line argument to suppress screen output:'
45  print *,' xbootsj input_file <(T or F)>'
46  print *
47  print *,' WHERE F will suppress screen output'
48  stop
49  ELSE IF (numargs .gt. 1) THEN
50  IF (arg2(1:1).eq.'f' .or. arg2(1:1).eq.'F') lscreen = .false.
51  ENDIF
52 
53 
54 ! INPUT FILE
55 ! 1st line: extension WOUT file
56 ! 2nd line: surfaces to be computed
57 
58 
59  CALL safe_open(iunit_in, istat, trim(arg1), 'old', 'formatted')
60  IF (istat .ne. 0) stop 'error opening input file in bootsj'
61 
62  READ (iunit_in, *,iostat=istat) extension
63 
64  CALL bootsj(curtor, trim(extension), iunit_in)
65 
66  END PROGRAM driver