63 INTEGER :: i, ioff, iflag
64 REAL(
rprec) :: xx,
pcurr, x, xp, temp_num, temp_denom
65 CHARACTER(len=20) :: pcurr_type_lc
68 INTEGER,
PARAMETER :: gln = 10
70 REAL(
rprec),
DIMENSION(gln),
PARAMETER :: glx = (/
71 & 0.01304673574141414_rprec,
72 & 0.06746831665550774_rprec,
73 & 0.1602952158504878_rprec,
74 & 0.2833023029353764_rprec,
75 & 0.4255628305091844_rprec,
76 & 0.5744371694908156_rprec,
77 & 0.7166976970646236_rprec,
78 & 0.8397047841495122_rprec,
79 & 0.9325316833444923_rprec,
80 & 0.9869532642585859_rprec /)
81 REAL(
rprec),
DIMENSION(gln),
PARAMETER :: glw = (/
82 & 0.03333567215434407_rprec,
83 & 0.0747256745752903_rprec,
84 & 0.1095431812579910_rprec,
85 & 0.1346333596549982_rprec,
86 & 0.1477621123573764_rprec,
87 & 0.1477621123573764_rprec,
88 & 0.1346333596549982_rprec,
89 & 0.1095431812579910_rprec,
90 & 0.0747256745752903_rprec,
91 & 0.03333567215434407_rprec /)
93 REAL(
rprec) :: g1,g2,g3,g4,a8,a12
111 SELECT CASE(trim(pcurr_type_lc))
120 & (exp(-(xp /
ac(1)) ** 2.0_dp)
121 & - exp(-( 1.0_dp /
ac(1)) ** 2.0_dp))
138 & ((1.0_dp-xp**
ac(1))**
ac(2))
164 & (
ac(1) * atan(
ac(2)*x**
ac(3)/(1-x)**
ac(4)) +
165 &
ac(5) * atan(
ac(6)*x**
ac(7)/(1-x)**
ac(8)) +
166 &
ac(9) * atan(
ac(10)*x**
ac(11)/(1-x)**
ac(12)) +
167 &
ac(13) * atan(
ac(14)*x**
ac(15)/(1-x)**
ac(16)) +
168 &
ac(17) * atan(
ac(18)*x**
ac(19)/(1-x)**
ac(20)))
171 CASE(
'power_series_I',
'power_series_i')
177 DO i = ubound(
ac,1), ioff, -1
181 CASE(
'Akima_spline_I',
'akima_spline_i')
186 IF (i < 4) stop
'pcurr: check s-grid for curr-grid values!'
190 & stop
'pcurr: outside value from spline_akima requested'
192 CASE(
'Akima_spline_Ip',
'akima_spline_ip')
197 IF(i < 4)stop
'pcurr: check s-grid for curr.dens.-grid values!'
202 stop
'pcurr: outside value from spline_akima_int requested'
206 IF (abs(
ac_aux_s(1)) .gt. 0.0001_dp)
THEN
207 WRITE(*,*)
' Error in profile_functions, Akima_spline_Ip'
208 WRITE(*,*) .gt.
' ABS(ac_aux_s(1)) 0.0001'
209 WRITE(*,*)
' Fix This. Stopping'
213 CASE(
'cubic_spline_I',
'cubic_spline_i')
218 IF(i < 4) stop
'pcurr: check s-grid for curr-grid values!'
223 stop
'pcurr: outside value from spline_cubic requested'
224 ELSEIF(iflag == -2)
THEN
225 stop
'pcurr: identical scugrid-values in spline_cubic'
227 stop
'pcurr: unknown error from spline_cubic'
231 CASE(
'cubic_spline_Ip',
'cubic_spline_ip')
236 IF(i < 4) stop
'pcurr: check s-grid for curr.dens.-grid values!'
240 IF (iflag == -1)
THEN
241 stop
'pcurr: outside value from spline_cubic_int requested'
242 ELSEIF (iflag == -2)
THEN
243 stop
'pcurr: identical scdgrid-values in spline_cubic_int'
245 stop
'pcurr: unknown error from spline_cubic_int'
250 IF (abs(
ac_aux_s(1)) .gt. 0.0001_dp)
THEN
251 WRITE(*,*)
' Error in profile_functions, cubic_spline_Ip'
252 WRITE(*,*) .gt.
' ABS(ac_aux_s(1)) 0.0001'
253 WRITE(*,*)
' Fix This. Stopping'
266 IF (
ac(i+3) .le. 0._dp )
THEN
271 1 (tanh(2.0_dp*
ac(i+2)/
ac(i+3))-
272 2 tanh(2.0_dp*(
ac(i+2)-1)/
ac(i+3)))
275 a8 =max(
ac(i+8),0.01_dp)
276 a12=max(
ac(i+12),0.01_dp)
283 1 ( tanh( 2.0_dp*
ac(i+2)/
ac(i+3) )
284 2 -tanh( 2.0_dp*(
ac(i+2)-sqrt(x))/
ac(i+3) ) )
285 3 +
ac(i+5)*( tanh(g1) - tanh(g3) )
286 4 +
ac(i+9)*( tanh(g2) - tanh(g4) )
297 temp_num = x * temp_num +
ac(i)
299 DO i = ubound(
ac,1), 10, -1
300 temp_denom = x * temp_denom +
ac(i)
302 IF (temp_denom .ne.
zero)
THEN
303 pcurr = temp_num / temp_denom
308 CASE(
'line_segment_Ip',
'line_segment_ip')
314 CASE(
'line_segment_I',
'line_segment_i')
324 DO i = ubound(
ac,1), ioff, -1
327 IF (trim(pcurr_type_lc) .ne.
'power_series')
THEN
328 WRITE(*,*)
'Unrecognized pcurr_type:',
pcurr_type
329 WRITE(*,*)
' *** CHECK YOUR INPUT ***'
330 WRITE(*,*)
'Changing pcurr_type from ''',
371 INTEGER :: i, iflag, ioff
373 CHARACTER(len=20) :: piota_type_lc
381 SELECT CASE(trim(piota_type_lc))
395 & (
ai(1) * atan(
ai(2)*x**
ai(3)/(1-x)**
ai(4)) +
396 &
ai(5) * atan(
ai(6)*x**
ai(7)/(1-x)**
ai(8)) +
397 &
ai(9) * atan(
ai(10)*x**
ai(11)/(1-x)**
ai(12)) +
398 &
ai(13) * atan(
ai(14)*x**
ai(15)/(1-x)**
ai(16)) +
399 &
ai(17) * atan(
ai(18)*x**
ai(19)/(1-x)**
ai(20)))
402 CASE(
'Akima_spline',
'akima_spline')
406 if(i < 4) stop
'piota: check s-grid for iota-grid values!'
410 & stop
'piota: outside value from spline_akima requested'
416 if(i < 4) stop
'piota: check s-grid for iota-grid values!'
421 stop
'piota: outside value from spline_cubic requested'
422 elseif(iflag == -2)
then
423 stop
'piota: identical siogrid-values in spline_cubic'
425 stop
'piota: unknown error from spline_cubic'
436 temp_num = x * temp_num +
ai(i)
438 DO i = ubound(
ai,1), 10, -1
439 temp_denom = x * temp_denom +
ai(i)
441 IF (temp_denom .ne.
zero)
THEN
442 piota = temp_num / temp_denom
447 CASE(
'nice_quadratic')
464 DO i = ubound(
ai,1), lbound(
ai,1), -1
467 IF (trim(piota_type_lc) .ne.
'power_series')
THEN
468 WRITE(*,*)
'Unrecognized piota_type:',
piota_type
469 WRITE(*,*)
' *** CHECK YOUR INPUT ***'
470 WRITE(*,*)
'Changing piota_type from ''',
518 INTEGER :: i, iflag, ioff
519 REAL(
rprec) :: xx,
pmass, x, temp_num, temp_denom
520 CHARACTER(len=20) :: pmass_type_lc
523 x = min(abs(xx *
bloat), 1._dp)
531 SELECT CASE(trim(pmass_type_lc))
541 & (exp(-(x /
am(1)) ** 2.0_dp) -exp(-(
one /
am(1)) ** 2.0_dp))
554 CASE (
'two_Lorentz',
'two_lorentz')
562 CASE (
'Akima_spline',
'akima_spline')
565 IF(i < 4) stop
'pmass: check s-grid for mass-grid values!'
569 & stop
'pmass: outside value from spline_akima requested'
571 CASE (
'cubic_spline')
574 IF(i < 4) stop
'pmass: check s-grid for mass-grid values!'
578 IF (iflag == -1)
THEN
579 stop
'pmass: outside value from spline_cubic requested'
580 ELSEIF (iflag == -2)
THEN
582 stop
'pmass: identical am_aux_s-values in spline_cubic'
584 stop
'pmass: unknown error from spline_cubic'
591 DO i = 15, lbound(
am,1), -1
596 IF (
am(i+3) .le. 0._dp )
THEN
601 1 (tanh(2.0_dp*
am(i+2)/
am(i+3))-
602 2 tanh(2.0_dp*(
am(i+2)-1)/
am(i+3)))
606 1 ( tanh( 2.0_dp*(
am(i+2)-sqrt(x))/
am(i+3) )
607 2 -tanh( 2.0_dp*(
am(i+2)-1._dp) /
am(i+3) ) )
616 temp_num = x * temp_num +
am(i)
618 DO i = ubound(
am,1), 10, -1
619 temp_denom = x * temp_denom +
am(i)
621 IF (temp_denom .ne.
zero)
THEN
622 pmass = temp_num / temp_denom
633 DO i = ubound(
am,1), lbound(
am,1), -1
636 IF (trim(pmass_type_lc) .ne.
'power_series')
THEN
637 WRITE(*,*)
'Unrecognized pmass_type:',
pmass_type
638 WRITE(*,*)
' *** CHECK YOUR INPUT ***'
639 WRITE(*,*)
'Changing pmass_type from ''',
subroutine spline_akima(x, y, xx, yy, npts, iflag)
This module containes code to create a profile constructed of line segments. These line segments are ...
subroutine, public line_seg_int(x, y, xx, yy, n)
subroutine, public line_seg(x, y, xx, yy, n)
real(rprec) function piota(x)
real(rprec) function pcurr(xx)
real(rprec) function pmass(xx)
subroutine spline_akima_int(x, y, xx, yy, npts, iflag)
subroutine spline_cubic(x, y, xx, yy, n, iflag)
subroutine spline_cubic_int(x, y, xx, yy, n, iflag)
subroutine tolower(string)
Convert a string to lower case.