input_output Module

Subroutines

public subroutine init(Phi, t_final, t_save, t_step, D, k_r, x_total, delta_x, delta_x_min, n_x)

Arguments

Type IntentOptional AttributesName
real(kind=8), intent(out) :: Phi

the flux \(\Phi\)

real(kind=8), intent(out) :: t_final
real(kind=8), intent(out) :: t_save
real(kind=8), intent(out) :: t_step
real(kind=8), intent(out) :: D

the diffusion coefficient \(D\) in \(\mathrm{\frac{x}{x}}\)

real(kind=8), intent(out) :: k_r
real(kind=8), intent(out) :: x_total
real(kind=8), intent(out) :: delta_x
real(kind=8), intent(out) :: delta_x_min
integer(kind=4), intent(out) :: n_x

Description

sets up parameters as defined by the problem statement

public subroutine print_output(n, x, y, t)

Arguments

Type IntentOptional AttributesName
integer(kind=4), intent(in) :: n

the file number

real(kind=8), intent(in), dimension(:):: x

the mesh grid \(\vec{x}\)

real(kind=8), intent(in), dimension(:):: y

the values \(\vec{y}\) on the mesh grid \(\vec{x}\)

real(kind=8), intent(in) :: t

the time at which this mesh was taken

Description

prints out the output of file \(n\) including the mesh points \(\vec{x}\) and their values \(\vec{y}\)

public subroutine workspace_setup()

Arguments

None

Description

This subroutine will setup a workspace for us to generate and save our simulation files in

public subroutine read_srim(filename, x, s)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: filename

the name of the SRIM output file - usually RANGE.txt

real(kind=8), intent(out), allocatable, dimension(:):: x

the right hand x coordinate of the depth bin

real(kind=8), intent(out), allocatable, dimension(:):: s

the amount of ions deposited in the bin

Description

This subroutine opens a SRIM output file and reads the distribution of ions in the sample, outputting those to x and s