Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
|
Some common numerical utilities.
Derived types and interfaces | |
interface | sll_o_display |
Functions to display on screen matrix or vector. More... | |
interface | sll_o_factorial |
Return factorial. More... | |
Functions/Subroutines | |
logical function, public | sll_f_is_power_of_two (n) |
Check if an integer is equal to. More... | |
logical function, public | sll_f_is_even (n) |
Check if an integer is even. More... | |
integer(kind=i64) function | factorial_int32 (n) |
It would have been nice to declare the next functions as 'pure' functions, but it is safer to be able to indicate when their arguments have fallen out of range as this number is so limited anyway. More... | |
integer(kind=i64) function | factorial_int64 (n) |
It would have been nice to declare the next functions as 'pure' functions, but it is safer to be able to indicate when their arguments have fallen out of range as this number is so limited anyway. More... | |
subroutine, public | sll_s_int2string (istep, cstep) |
Convert an integer < 9999 to a 4 characters string. More... | |
subroutine, public | sll_s_new_file_id (file_id, error) |
Get a file unit number free before creating a file. More... | |
subroutine | display_vector_real (array, real_format) |
Display a vector to screen. More... | |
subroutine | display_vector_integer (array, integer_format) |
Display a vector to screen. More... | |
subroutine | display_matrix_2d_real (array, real_format) |
Display matrix to screen. More... | |
subroutine, public | sll_s_display_matrix_2d_integer (array, integer_format) |
Display matrix to screen. More... | |
subroutine | initialize_file (data_file_id, thf_file_id) |
Subroutine to open data file for slv2d and create the thf.dat file to write results. More... | |
subroutine | time_history (file_id, desc, fformat, array) |
Routine from slv2d to write diagnostics. More... | |
subroutine, public | sll_s_mpe_decomp1d (n, numprocs, myid, s, e) |
From the MPE library. More... | |
subroutine, public | sll_s_pfenvelope (S, t, tflat, tL, tR, twL, twR, t0, turn_drive_off) |
S: the wave form at a given point in time. This wave form is not scaled (its maximum value is 1). t: the time at which the envelope is being evaluated tflat, tL, tR, twL, twR, tstart, t0: the parameters defining the envelope, defined in the main portion of this program. turn_drive_off: 1 if the drive should be turned off after a time tflat, and 0 otherwise. More... | |
subroutine, public | sll_s_compute_bloc (bloc_coord, bloc_index, N) |
subroutine, public | sll_s_compute_mesh_from_bloc (bloc_coord, bloc_index, node_positions) |
logical function, public | sll_f_query_environment (env_variable, default_value) |
Query an environment variable for the values on,off,1,0,true,false and return the result as a logical. More... | |
pure subroutine, public | sll_s_new_array_linspace (array, vmin, vmax, endpoint, step) |
Equivalent to numpy.linspace @contact Yaman Güçlü, IPP Garching. More... | |
Variables | |
integer, parameter, public | sll_p_byte_size = selected_int_kind(0) |
kind of integers More... | |
logical | flag = .true. |
|
private |
Display matrix to screen.
Definition at line 253 of file sll_m_utilities.F90.
|
private |
Display a vector to screen.
Definition at line 235 of file sll_m_utilities.F90.
|
private |
Display a vector to screen.
Definition at line 217 of file sll_m_utilities.F90.
|
private |
It would have been nice to declare the next functions as 'pure' functions, but it is safer to be able to indicate when their arguments have fallen out of range as this number is so limited anyway.
Definition at line 121 of file sll_m_utilities.F90.
|
private |
It would have been nice to declare the next functions as 'pure' functions, but it is safer to be able to indicate when their arguments have fallen out of range as this number is so limited anyway.
Definition at line 146 of file sll_m_utilities.F90.
|
private |
Subroutine to open data file for slv2d and create the thf.dat file to write results.
[out] | data_file_id | namelist file for slv2d |
[out] | thf_file_id | thf file for energy plot |
Definition at line 296 of file sll_m_utilities.F90.
logical function, public sll_m_utilities::sll_f_is_even | ( | integer(kind=i32), intent(in) | n | ) |
Check if an integer is even.
Definition at line 105 of file sll_m_utilities.F90.
logical function, public sll_m_utilities::sll_f_is_power_of_two | ( | integer(kind=i64), intent(in) | n | ) |
Check if an integer is equal to.
\[2^n\]
Definition at line 91 of file sll_m_utilities.F90.
logical function, public sll_m_utilities::sll_f_query_environment | ( | character(len=*), intent(in) | env_variable, |
logical, intent(in) | default_value | ||
) |
Query an environment variable for the values on,off,1,0,true,false and return the result as a logical.
[in] | env_variable | environment variable to be checked |
[in] | default_value | default value to be checked agains |
Definition at line 537 of file sll_m_utilities.F90.
subroutine, public sll_m_utilities::sll_s_compute_bloc | ( | real(kind=f64), dimension(2), intent(inout) | bloc_coord, |
integer(kind=i32), dimension(3), intent(inout) | bloc_index, | ||
integer(kind=i32), intent(in) | N | ||
) |
Output:
Definition at line 435 of file sll_m_utilities.F90.
subroutine, public sll_m_utilities::sll_s_compute_mesh_from_bloc | ( | real(kind=f64), dimension(2), intent(in) | bloc_coord, |
integer(kind=i32), dimension(3), intent(in) | bloc_index, | ||
real(kind=f64), dimension(:), intent(out) | node_positions | ||
) |
Input:
Output:
Definition at line 496 of file sll_m_utilities.F90.
subroutine, public sll_m_utilities::sll_s_display_matrix_2d_integer | ( | integer(kind=i32), dimension(:, :), intent(in) | array, |
character(len=*), intent(in) | integer_format | ||
) |
Display matrix to screen.
Definition at line 274 of file sll_m_utilities.F90.
subroutine, public sll_m_utilities::sll_s_int2string | ( | integer, intent(in) | istep, |
character(len=*), intent(out) | cstep | ||
) |
Convert an integer < 9999 to a 4 characters string.
[in] | istep | input integer |
[out] | cstep | output string |
Definition at line 169 of file sll_m_utilities.F90.
subroutine, public sll_m_utilities::sll_s_mpe_decomp1d | ( | integer(kind=i32), intent(in) | n, |
integer(kind=i32), intent(in) | numprocs, | ||
integer(kind=i32), intent(in) | myid, | ||
integer(kind=i32), intent(out) | s, | ||
integer(kind=i32), intent(out) | e | ||
) |
From the MPE library.
This file contains a routine for producing a decomposition of a 1-d array when given a number of processors. It may be used in "direct" product decomposition. The values returned assume a "global" domain in [1:n]
Definition at line 350 of file sll_m_utilities.F90.
pure subroutine, public sll_m_utilities::sll_s_new_array_linspace | ( | real(wp), dimension(:), intent(out) | array, |
real(wp), intent(in) | vmin, | ||
real(wp), intent(in) | vmax, | ||
logical, intent(in), optional | endpoint, | ||
real(wp), intent(out), optional | step | ||
) |
Equivalent to numpy.linspace @contact Yaman Güçlü, IPP Garching.
[in] | vmin | Min value of interval |
[in] | vmax | Max value of interval |
[in] | endpoint | Flag: include endpoint in array? (default=true) |
[out] | array | Array to be created, with linearly increasing values |
[out] | step | Step size ( |
Definition at line 568 of file sll_m_utilities.F90.
subroutine, public sll_m_utilities::sll_s_new_file_id | ( | integer(kind=i32), intent(out) | file_id, |
integer(kind=i32), intent(out) | error | ||
) |
Get a file unit number free before creating a file.
[out] | file_id | file unit number |
[out] | error | error code |
Definition at line 190 of file sll_m_utilities.F90.
subroutine, public sll_m_utilities::sll_s_pfenvelope | ( | real(kind=f64), intent(out) | S, |
real(kind=f64), intent(in) | t, | ||
real(kind=f64), intent(in) | tflat, | ||
real(kind=f64), intent(in) | tL, | ||
real(kind=f64), intent(in) | tR, | ||
real(kind=f64), intent(in) | twL, | ||
real(kind=f64), intent(in) | twR, | ||
real(kind=f64), intent(in) | t0, | ||
logical, intent(in) | turn_drive_off | ||
) |
S: the wave form at a given point in time. This wave form is not scaled (its maximum value is 1). t: the time at which the envelope is being evaluated tflat, tL, tR, twL, twR, tstart, t0: the parameters defining the envelope, defined in the main portion of this program. turn_drive_off: 1 if the drive should be turned off after a time tflat, and 0 otherwise.
Definition at line 379 of file sll_m_utilities.F90.
|
private |
Routine from slv2d to write diagnostics.
[in] | file_id | file unit number |
[in] | desc | name of the diagnostics |
[in] | fformat | fortran output format |
[in] | array | data array |
Definition at line 321 of file sll_m_utilities.F90.
|
private |
logical | variable used to print time history |
Definition at line 81 of file sll_m_utilities.F90.
integer, parameter, public sll_p_byte_size = selected_int_kind(0) |
kind of integers
Definition at line 70 of file sll_m_utilities.F90.