V3FIT
Functions/Subroutines
functions Module Reference

This module containes functions used by the profiles. More...

Functions/Subroutines

real(rprec) pure function, public two_power (x, b)
 A two power profile. More...
 
real(rprec) pure function, public two_power_gs (x, b)
 A two power profile with added guassian peaks. More...
 
real(rprec) pure function guassian (x, b)
 A profile with a single guassian peak. More...
 
real(rprec) pure function guassian_int (x, b)
 A profile with a integrated single guassian peak. More...
 
logical function, public function_test ()
 Profile unit test function. More...
 
logical function, private check (expected, received, testNum, name)
 Check a value. More...
 

Detailed Description

This module containes functions used by the profiles.

Function/Subroutine Documentation

◆ check()

logical function, private functions::check ( real(rprec), intent(in)  expected,
real(rprec), intent(in)  received,
integer, intent(in)  testNum,
character (len=*), intent(in)  name 
)
private

Check a value.

Checks that the expected value matches the recieved. Otherwise report an error.

Parameters
[in]expectedThe known value.
[in]receivedThe known test value.
[in]testNumThe number of the test.
[in]nameThe name of the test.
Returns
True if the check passes and false otherwise.

Definition at line 231 of file functions.f.

◆ function_test()

logical function, public functions::function_test

Profile unit test function.

This runs the associated unit tests and returns the result.

Returns
True if the tests pass and false otherwise.

Definition at line 166 of file functions.f.

◆ guassian()

real(rprec) pure function functions::guassian ( real(rprec), intent(in)  x,
real(rprec), dimension(0:20), intent(in)  b 
)

A profile with a single guassian peak.

This defines a profile with a single guassian peak.

b(0)*Exp(-(x - b(1))/b(2)) ** 2 (1)

b(0) controls the amplitude. b(1) controls the mean. b(2) controls the width.

Parameters
[in]xPoint to evaluate function from.
[in]bArray of profile parameters.
Returns
The function evaluated at x.

Definition at line 106 of file functions.f.

◆ guassian_int()

real(rprec) pure function functions::guassian_int ( real(rprec), intent(in)  x,
real(rprec), dimension(0:20), intent(in)  b 
)

A profile with a integrated single guassian peak.

This defines a profile with a with an integarted single guassian peak.

Sqrt(2Pi)/2*b(0)*b(1)*(Erf(b(1)/b(2)) - Erf((b(1) - x)/b(2))) (1)

b(0) controls the amplitude. b(1) controls the mean. b(2) controls the width.

Note
Fortran 90 does not have a built in Error function must use the C function instead.
Parameters
[in]xPoint to evaluate function from.
[in]bArray of profile parameters.
Returns
The function evaluated at x.

Definition at line 137 of file functions.f.

◆ two_power()

real(rprec) pure function, public functions::two_power ( real(rprec), intent(in)  x,
real(rprec), dimension(0:20), intent(in)  b 
)

A two power profile.

A two power profiles is defined using 3 parameters.

b(0) * (1.0 - x ** b(1)) ** b(2) (1)

b(0) controls the profile amplitude. b(1) controls the profile width. b(2) controls the profile tail.

Parameters
[in]xPoint to evaluate function from.
[in]bArray of profile parameters.
Returns
The function evaluated at x.

Definition at line 40 of file functions.f.

◆ two_power_gs()

real(rprec) pure function, public functions::two_power_gs ( real(rprec), intent(in)  x,
real(rprec), dimension(0:20), intent(in)  b 
)

A two power profile with added guassian peaks.

The power profile is defined as functions::two_power. Then up to 9 additional guassians peaks can be added.

two_power(x)*(1 + Sum[b(i)*Exp(-(x - b(i+1))/b(i+2)) ** 2]) (1)

Parameters beyond the first three control the additional guassians. b(i) controls the amplitude. b(i+1) controls the mean. b(i+2) controls the width.

Parameters
[in]xPoint to evaluate function from.
[in]bArray of profile parameters.
Returns
The function evaluated at x.

Definition at line 70 of file functions.f.