interpolate Program

This program includes the interpolation routine used by ALPS to fill a grid in momentum space. It is based on the polyharmonic spline algorithm as described in the ALPS code paper.


Calls

program~~interpolate~~CallsGraph program~interpolate interpolate normalize normalize program~interpolate->normalize polyharmonic_spline polyharmonic_spline program~interpolate->polyharmonic_spline proc~read_in_params~2 read_in_params program~interpolate->proc~read_in_params~2 proc~get_runname~3 get_runname proc~read_in_params~2->proc~get_runname~3 proc~get_unused_unit~3 get_unused_unit proc~read_in_params~2->proc~get_unused_unit~3

Variables

Type Attributes Name Initial
double precision, allocatable, dimension (:) :: grid_coarse

Coarse input grid for interpolation. (1:n_coarse)

double precision, allocatable, dimension (:) :: pperp_coarse

Coordinates of perpendicular momentum on coarse grid. (1:n_coarse)

double precision, allocatable, dimension (:) :: ppar_coarse

Coordinates of parallel momentum on coarse grid. (1:n_coarse)

double precision, allocatable, dimension (:,:) :: grid_fine

Fine output grid after interpolation. (0:nperp,0:npar)

double precision, allocatable, dimension (:,:) :: pperp

Coordinates of perpendicular momentum on fine output grid. (0:nperp,0:npar)

double precision, allocatable, dimension (:,:) :: ppar

Coordinates of parallel momentum on fine output grid. (0:nperp,0:npar)

double precision :: smoothing

Smoothing parameter for spline interpolation.

double precision :: pperp_min

Minimum perpendicuar momentum.

double precision :: pperp_max

Maximum perpendicular momentum.

double precision :: ppar_min

Minimum parallel momentum.

double precision :: ppar_max

Maximum parallel momentum.

double precision :: threshold

Lower treshold for f0-values (coarse grid) to be included.

double precision :: mult_pperp

Scaling factor for perpendicular momentum.

double precision :: mult_ppar

Scaling factor for parallel momentum.

double precision :: mult_f

Scaling factor for f0.

double precision :: r_pperp

Read-in variable for perpendicular momentum.

double precision :: r_ppar

Read-in variable for parallel momentum.

double precision :: r_f

Read-in variable for f0.

double precision :: pperp_max_set

Forced maximum perpendicular momentum for output.

double precision :: pperp_min_set

Forced minimum perpendicular momentum for output.

double precision :: ppar_max_set

Forced maximum parallel momentum for output.

double precision :: ppar_min_set

Forced minimum perpendicular momentum for output.

integer :: nperp

Number of perpendicular steps on fine output grid.

integer :: npar

Number of parallel steps on fine output grid.

integer :: n_coarse

Number of entries in coarse grid.

integer :: mode

Format of input grid (order pperp/ppar).

integer :: i

Index for loops.

integer :: j

Index for loops.

integer :: io_error

Error flag for i/o.

integer :: status_read

Status flag for i/o.

integer :: i_coarse

Index to loop over the coarse grid entries.

character(len=256) :: filename

File name of input file for interpolation.

character(len=256) :: output_file

File name of output file in ALPS distribution format.

logical :: out_to_file

Check whether output should be written to file.

logical :: do_normalize

Check whether normalisation should be applied.

integer :: unit

Unit variable for opening namelist.

integer, parameter :: stdout_unit = 6

Stdout unit for opening namelist.

integer, save :: input_unit_no

Unit index for opening namelist.

integer, save :: error_unit_no = stdout_unit

Error unit for opening namelist.

character(len=500) :: runname

String for parameter input file.

character(len=500) :: foldername

String for parameter input folder.


Functions

function input_unit_exist(nml, exist)

This function checks whether a unit number exists. It is taken from the AstroGK code.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: nml

Namelist identifier.

logical, intent(out) :: exist

Flags whether input unit exists.

Return Value integer

Unit number.

function input_unit(nml)

This function returns a unit number for a namelist. It is taken from the AstroGK code.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: nml

Namelist identifier.

Return Value integer

Unit number for namelist.


Subroutines

subroutine read_in_params()

This subroutine reads in system parameters input file (namelist) as argument after executable: ./interpolate input.in

Arguments

None

subroutine get_unused_unit(unit)

This subroutine returns an available unit number. It is taken from the AstroGK code.

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: unit

Unit number.

subroutine get_runname(runname, foldername)

Get runname for output files from input argument.

Arguments

Type IntentOptional Attributes Name
character(len=500), intent(out) :: runname

Basename for file I/O.

character(len=500), intent(out) :: foldername

Directory in which input file is stored.