|
V3FIT
|
Go to the documentation of this file.
104 INTEGER,
PARAMETER,
PUBLIC ::
ilb_b = 0
106 INTEGER,
PARAMETER,
PUBLIC ::
iub_b = 21
143 REAL (rprec),
DIMENSION(ilb_b:iub_b) :: b = 0.0
145 REAL (rprec),
DIMENSION(:),
POINTER :: as => null()
147 REAL (rprec),
DIMENSION(:),
POINTER :: af => null()
149 INTEGER :: maxsplineindex = 1
152 REAL (rprec),
DIMENSION(:),
POINTER :: cache => null()
154 REAL (rprec),
DIMENSION(:),
POINTER :: cache_hyper => null()
162 TYPE (pprofile_class),
POINTER :: p => null()
200 CHARACTER (len=*),
INTENT(in) :: p_type
201 REAL(rprec),
DIMENSION(:),
INTENT(in) :: b
202 REAL(rprec),
DIMENSION(:),
INTENT(in) :: as
203 REAL(rprec),
DIMENSION(:),
INTENT(in) :: af
206 CHARACTER (len=p_type_len) :: p_type_lc
207 REAL (rprec) :: start_time
227 CALL tolower(p_type_lc)
228 SELECT CASE(trim(p_type_lc))
233 CASE (
'two_power_gs')
239 CASE (
'power_series')
242 CASE (
'cubic_spline')
244 WRITE(*,*)
'pprofile:cubic spline: too few as values'
245 WRITE(*,*)
'maxSplineIndex, as = ',
252 CASE (
'akima_spline')
254 WRITE(*,*)
'pprofile:akima spline: too few as values'
255 WRITE(*,*)
'maxSplineIndex, as = ',
262 CASE (
'line_segment')
271 CASE (
'sq_exp_1d_ln')
282 WRITE(*,*)
'Unrecognized p_type:', p_type_lc
283 WRITE(*,*)
' *** CHECK YOUR INPUT ***'
306 TYPE (pprofile_class),
POINTER :: this
309 IF (
ASSOCIATED(this%as))
THEN
314 IF (
ASSOCIATED(this%af))
THEN
319 IF (
ASSOCIATED(this%cache))
THEN
320 DEALLOCATE(this%cache)
324 IF (
ASSOCIATED(this%cache_hyper))
THEN
325 DEALLOCATE(this%cache_hyper)
326 this%cache_hyper => null()
358 REAL (rprec),
INTENT(in) :: s_arg
361 REAL (rprec) :: s_use
366 REAL (rprec) :: start_time
372 s_01 = max(zero, min(one,s_arg))
373 l_01 = (s_arg .ge. zero) .and. (s_arg .le. one)
375 SELECT CASE(this%p_type)
386 & + two_power(s_arg, this%b(1:
iub_b))
397 & + two_power(s_use, this%b(1:
iub_b))
407 & + two_power_gs(s_arg,
419 s_use = min(this%as(this%maxSplineIndex),
420 & max(s_arg, this%as(1)))
423 & this%maxSplineIndex, iflag)
424 IF (iflag .ge. 0)
THEN
430 ELSE IF (iflag .eq. -1)
THEN
431 WRITE (*,*)
'ERROR: pprofile: outside value from ' //
433 ELSE IF(iflag .eq. -2)
THEN
434 WRITE (*,*)
'ERROR: pprofile: decreasing s values ' //
437 WRITE (*,*)
'ERROR: pprofile: unknown error from ' //
444 s_use = min(this%as(this%maxSplineIndex),
445 & max(s_arg,this%as(1)))
448 & this%maxSplineIndex, iflag)
450 WRITE (*,*)
'ERROR: pprofile: bad value from ' //
451 &
'spline_akima requested'
459 & this%maxSplineIndex)
482 REAL (rprec) :: start_time
487 SELECT CASE (this%p_type)
544 INTEGER,
INTENT(in) :: i
545 INTEGER,
INTENT(in) :: j
548 REAL (rprec) :: start_time
553 SELECT CASE(this%p_type)
592 REAL (rprec),
INTENT(in) :: p
593 INTEGER,
INTENT(in) :: i
596 REAL (rprec) :: start_time
601 SELECT CASE(this%p_type)
638 REAL (rprec),
INTENT(in) :: p1
639 REAL (rprec),
INTENT(in) :: p2
642 REAL (rprec) :: start_time
647 SELECT CASE(this%p_type)
682 REAL (rprec) :: start_time
687 SELECT CASE(this%p_type)
718 TYPE (pprofile_class),
INTENT(in) :: this
719 CHARACTER (len=*),
INTENT(in) :: id
720 INTEGER,
INTENT(in) :: iou
724 REAL (rprec) :: start_time
733 SELECT CASE(this%p_type)
738 WRITE(iou,1300) this%b(0:3)
749 WRITE(iou,1231) (i, this%as(i), this%af(i),
750 & i = 1, this%maxSplineIndex)
754 WRITE(iou,1300) this%b(0:1)
755 WRITE(iou,1231) (i, this%as(i), this%af(i),
756 & i = 1, this%maxSplineIndex)
762 1100
FORMAT(/
' Parameterized Profile Write: id = ',a)
763 1200
FORMAT(
' pp_type = ',a)
764 1210
FORMAT(
' b_0 + Th(s)Th(1-s)(b_1 (1 - s ** b_2) ** b_3).',
766 1220
FORMAT(
' Th(s)Th(1-s)[Sum_0_n b_i s** i]. b(0:n) = ')
767 1230
FORMAT(
' i as(i) af(i)')
768 1231
FORMAT(1x,i3,2x,es15.8,2x,es15.8)
769 1300
FORMAT(4(2x,es15.8))
785 TYPE (pprofile_class),
INTENT(inout) :: this
788 REAL (rprec) :: start_time
793 SELECT CASE (this%p_type)
798 this%cache_hyper = this%b(0:1)
818 TYPE (pprofile_class),
INTENT(inout) :: this
821 REAL (rprec) :: start_time
826 SELECT CASE (this%p_type)
831 this%b(0:1) = this%cache_hyper
856 REAL(rprec),
DIMENSION(:),
INTENT(in) :: s_array
859 REAL (rprec) :: start_time
891 REAL (rprec),
INTENT(in) :: p1
892 REAL (rprec),
INTENT(in) :: p2
896 & this%b(0)**2*exp(-(p1 - p2)**2/(2.0*this%b(1)**2))
923 REAL (rprec),
INTENT(in) :: p1
924 REAL (rprec),
INTENT(in) :: p2
928 & exp(2.0*this%b(0) - (p1 - p2)**2/(2.0*this%b(1)**2))
integer, parameter, public p_type_len
Maximum size for parameter profile name lengths.
Base class representing a parameterized profile.
integer, parameter, public iub_b
Upper array bound for function profiles.
integer function pprofile_get_gp_num_hyper_param(this)
Get the number of hyper parameters for guassian process kernel.
Defines functions for measuring an tabulating performance of function and subroutine calls....
character(len=p_type_len) function pprofile_get_p_type_name(this)
Gets the name of the profile type.
integer, parameter, public ilb_b
Lower array bound for function profiles.
Pointer to a pprofile object. Used for creating arrays of pprofile pointers. This is needed because f...
real(rprec) function pprofile_get_value(this, s_arg)
Gets the value of a profile at a radial position.
integer, parameter, private pprofile_two_power_gs_type
Two Power with guassian profile type.
integer, parameter, public iub_asf
Array size for spline profiles.
Umbrella module avoid multiple inlcudes of the mpif.h header.
integer, parameter, private pprofile_power_series_type
Power Series profile type.
integer, parameter, private pprofile_cubic_spline_type
Cubic Spline profile type.
integer function, private findmaxindex(s_array)
Finds the index of the maximum radial position.
integer, parameter, private pprofile_gp_1d_ln_sexp_type
Guassian process profile 1D square exponetal with the ln of sigma x type.
real(rprec) function profiler_get_start_time()
Gets the start time of profiled function.
pure real(rprec) function pprofile_gp_1d_sqexp_k(this, p1, p2)
Evaluate the one dimensional squared exponential kernel.
subroutine pprofile_save_state(this)
Save the internal state of the profile.
Interface for the guassian process kernel values.
subroutine pprofile_write(this, id, iou)
Write out the profile to an output file.
pure real(rprec) function pprofile_gp_1d_sqexp_ln_k(this, p1, p2)
Evaluate the one dimensional squared exponential kernel.
integer, parameter, private pprofile_two_power_r_type
Reverse Two Power profile type.
integer, parameter, private pprofile_akima_spline_type
Akima Spline profile type.
type(pprofile_class) function, pointer pprofile_construct(p_type, b, as, af)
Construct a pprofile_class.
Module is part of the LIBSTELL. This module contains code to create a profile constructed of line sig...
integer, parameter, private pprofile_none_type
No profile type.
subroutine pprofile_reset_state(this)
Reset the internal state of the profile.
real(rprec) function pprofile_get_gp_pi(this, p, i)
Get the guassian process kernel value for the point and index.
subroutine pprofile_destruct(this)
Deconstruct a pprofile_class object.
real(rprec) function pprofile_get_gp_pp(this, p1, p2)
Get the guassian process kernel value for two points.
This module containes functions used by the profiles.
subroutine profiler_set_stop_time(symbol_name, start_time)
Gets the end time of profiled function.
subroutine, public line_seg(x, y, xx, yy, n)
Interpolate a point on a line.
Defines the base class of the type pprofile_class. This module contains all the code necessary to def...
integer, parameter, private pprofile_two_power_type
Two Power profile type.
integer, parameter, private pprofile_line_segment_type
Line Segment profile type.
integer, parameter, private pprofile_gp_1d_sexp_type
Guassian process profile 1D square exponetal type.
real(rprec) function pprofile_get_gp_ij(this, i, j)
Get the guassian process kernel value for the two as indicies.