1 SUBROUTINE read_namelist(iunit, io_stat, lc_name)
2 USE vmec_input,
ONLY: read_indata_namelist, &
4 USE vmec_seq,
ONLY: vseq
5 USE bootsj_input,
ONLY: read_boot_namelist
6 USE optim_params,
ONLY: read_optimum_namelist, lprof_opt, &
7 lcurprof_opt, numjstar, nsd
8 USE coilsnamin,
ONLY: read_coils_namelist
9 USE gade_mod,
ONLY: read_gade_namelist
14 INTEGER :: iunit, io_stat
15 CHARACTER(LEN=*) :: lc_name
20 CHARACTER(LEN=1),
PARAMETER :: lead =
'&'
21 CHARACTER(LEN=LEN_TRIM(lc_name)+1) :: namelc
26 namelc = lead // trim(adjustl(lc_name))
28 ifind = min(len_trim(namelc), 132)
29 IF (namelc(1:ifind) .eq.
'&indata')
THEN
30 CALL read_indata_namelist (iunit, io_stat)
32 ELSE IF (namelc(1:ifind) .eq.
'&optimum')
THEN
33 CALL read_optimum_namelist (iunit, io_stat)
34 IF (io_stat .gt. 0)
RETURN
38 IF (lcurprof_opt) lprof_opt = .true.
39 ELSE IF (namelc(1:ifind) .eq.
'&bootin')
THEN
40 CALL read_boot_namelist (iunit, io_stat)
41 ELSE IF (namelc(1:ifind) .eq.
'&mseprofile')
THEN
42 CALL read_mse_namelist (iunit, io_stat)
43 ELSE IF (namelc(1:ifind) .eq.
'&vseq')
THEN
44 READ (iunit, nml=vseq, iostat=io_stat)
45 ELSE IF (namelc(1:ifind) .eq.
'&coilsin')
THEN
46 CALL read_coils_namelist (iunit, io_stat)
47 ELSE IF (namelc(1:ifind) .eq.
'&ga_de')
THEN
48 CALL read_gade_namelist (iunit, io_stat)
52 IF (io_stat .eq. -1) io_stat = 0
54 END SUBROUTINE read_namelist