Globals Library 1.0
Loading...
Searching...
No Matches
scratch Module Reference

Auxiliary module to store an integer and real array used (typically as optional argument) as scratch in different code. More...

Data Types

type  scrt

Functions/Subroutines

subroutine range (size, ibegin, iend)
 Procedure to define portion of member scrt::iaux or scrt::raux.
subroutine init_scrt (this, lun_err, niaux, nraux)
 Static constructor for scratch::scrt.
subroutine kill_scrt (this, lun)
 Destructor for scratch::scrt.
subroutine info_scrt (this, lun)
 Info procedure for scratch::scrt.
logical function check_scrt (this, niaux, nraux)
 Check is scratch arrays are big enoguh.

Detailed Description

Auxiliary module to store an integer and real array used (typically as optional argument) as scratch in different code.


Function/Subroutine Documentation

◆ range()

subroutine scratch::range ( integer, intent(in) size,
integer, intent(out) ibegin,
integer, intent(inout) iend )

Procedure to define portion of member scrt::iaux or scrt::raux.


Example: partioning raux in two portion of length n1 and n2, assign it to two two real pointer v1 and v2.

iend = 0
call aux%range(n1, ibegin, iend)
v1 => aux%raux(ibegin:iend)
call aux%range(n2, ibegin, iend)
v2 => aux%raux(ibegin:iend)
Parameters
[in]sizeinteger. Size of array required
[out]ibegininteger. Start position of array portion
[in,out]iendinteger. End position of array portion. It cointains the end position of previous array or it must begin initialize to zero.

Definition at line 65 of file modScratch.f90.

◆ init_scrt()

subroutine scratch::init_scrt ( class(scrt), intent(inout) this,
integer, intent(in) lun_err,
integer, intent(in) niaux,
integer, intent(in) nraux )
private

Static constructor for scratch::scrt.


Set scrt::niaux and scrt::nraux and allocate arrays scrt::iaux and scrt::raux.

Parameters
[in]lun_errinteger, unit for error message output
[in]niauxinteger, length integer array
[in]nrauxinteger, length real array

Definition at line 85 of file modScratch.f90.

◆ kill_scrt()

subroutine scratch::kill_scrt ( class(scrt), intent(inout) this,
integer, intent(in) lun )
private

Destructor for scratch::scrt.


Deallocate variables scrt::iaux and scrt::raux.

Parameters
[in]luninteger, unit number for error message

Definition at line 110 of file modScratch.f90.

◆ info_scrt()

subroutine scratch::info_scrt ( class(scrt), intent(in) this,
integer, intent(in) lun )
private

Info procedure for scratch::scrt.


Prints content of a variable of type scratch::scrt

Parameters
[in]luninteger, unit number for output message

Definition at line 136 of file modScratch.f90.

◆ check_scrt()

logical function scratch::check_scrt ( class(scrt), intent(in) this,
integer, intent(in) niaux,
integer, intent(in) nraux )
private

Check is scratch arrays are big enoguh.


Return false if a variable of type scratch::scrt is not initialized, or it contains integer or real array that are too small.

Parameters
[in]niauxinteger. Number of integer required
[in]nrauxinteger. Number of real required
Returns
(logical) True: type initialized and big enough, False type not initialized or not big enough.

Definition at line 160 of file modScratch.f90.