1 SUBROUTINE datain(extension, iunit_in, iunit, ians)
16 INTEGER :: iunit, ians, iunit_in
17 CHARACTER*(*) :: extension
21 REAL(rprec),
PARAMETER :: one = 1, zero = 0
25 INTEGER :: i, n, m, i1, ntheta_min, nzeta_min,
28 REAL(rprec),
DIMENSION(:),
ALLOCATABLE :: work
29 REAL(rprec) :: status, tempe0, tempi0, pres10, pres0, a, a1
34 CALL read_boozer(extension)
37 READ (iunit_in, *,iostat=idum) jlist
38 IF (idum .gt. 0) stop
' Error reading bootsj input file in DATAIN'
75 CALL read_namelist (iunit, i,
'bootin')
76 IF (i .ne. 0 ) stop
'Error reading bootin NAMELIST'
82 IF(damp_bs .lt. zero)
THEN
83 IF(damp .gt. zero)
THEN
94 IF(nboz_b .lt. nbuse)
THEN
95 IF (lscreen)
WRITE(*,*)
'nbuse > nbos_b, nbuse = nboz_b'
98 IF(mboz_b .lt. mbuse)
THEN
99 IF (lscreen)
WRITE(*,*)
'mbuse > mbos_b, mbuse = mboz_b'
103 nzeta_min = 2*nbuse + 1
104 ntheta_min = 2*mbuse + 1
108 IF(nzetah .gt. nzeta_min)
EXIT
110 IF(nzetah .gt. nzeta_min)
EXIT
115 IF(nthetah .gt. ntheta_min)
EXIT
117 IF(nthetah .gt. ntheta_min)
EXIT
120 IF(lscreen) print *,
'mbuse = ',mbuse,
'nbuse = ',
121 1 nbuse,
'nthetah = ',nthetah,
' nzetah = ',nzetah
135 IF (m .gt. mboz_b) stop
'boozmn indexing conflict, m'
136 IF (abs(n) .gt. nboz_b) stop
'boozmn indexing conflict, n'
141 IF (m.eq.0 .and. n.eq.0 .and. bmnc_b(mn,ir).gt.status)
143 amnfit(ir,m,n) = bmnc_b(mn,ir+1)
147 CALL read_boozer_deallocate
149 zeff1 = max(one,zeff1)
152 psimax = maxval(abs(flux))
155 IF(flux(irup) .lt. zero) psimax = -psimax
163 rhoar(ir) = 0.5_dp*(flux(ir) + flux(ir+1))/psimax
164 d_rho(ir) = (flux(ir+1) - flux(ir))/psimax
173 IF (iotasign .lt. 0)
THEN
174 qsafety(:irup) = iotasign*qsafety(:irup)
179 aiogar(:irup) = aipsi(:irup)/(gpsi(:irup)+1.0e-36_dp)
181 CALL positiv (pres1, irup, 2)
182 CALL positiv (betar, irup, 2)
184 IF (any(ate .ne. zero))
THEN
186 tempe1(ir) = temp(rhoar(ir), ate)
189 IF (any(ati .ne. zero))
THEN
191 tempi1(ir) = temp(rhoar(ir), ati)
205 IF (tempe0.le.zero .or. tempi0.le.zero) tempres = abs(tempres)
206 tempres = min(one,tempres)
208 IF (tempres .ge. zero)
THEN
209 teti = teti + 1.e-36_dp
210 a = one + one/(zeff1*teti)
212 tempe0 = pres10/(a*pres0*dens0)
214 tempe1(:irup) = pres1(:irup)**tempres
216 tempi1(:irup) = tempe1(:irup)
218 a1 = tempi0/tempi1(1)
219 tempe1(:irup) = tempe1(:irup)*a
220 tempi1(:irup) = tempi1(:irup)*a1
223 CALL positiv (tempe1, irup, 2)
224 CALL positiv (tempi1, irup, 2)
226 dense(:irup) = pres1(:irup)/(pres0*(tempe1(:irup)+tempi1(:irup)/
228 ALLOCATE(work(irdim))
229 CALL smooth1 (dense, 1, irup, work, zero)
230 CALL positiv (dense, irup, 2)
232 a = tempe1(irup) + tempi1(irup)/zeff1
233 a1 = tempe1(i1) + tempi1(i1)/zeff1
234 dense(irup) = dense(i1)*a1*betar(irup)/(a*betar(i1)+1.e-36_dp)
237 densi(:irup) = dense(:irup)/zeff1
248 END SUBROUTINE datain