MODULE Utilities_With_Pnter

Module Utilities_With_Pnter exports subroutines and functions for manipulating Fortran 90 pointers.

These routines are adapted from public domain routines in Numerical Recipes.

In order to use one of these routines, you must include an appropriate use Utilities_With_Pnter or use Statpack statement in your Fortran program, like:

use Utilities_With_Pnter, only: realloc

or :

use Statpack, only: realloc

Here is the list of the public routines exported by module Utilities_With_Pnter:

reallocate()

purpose:

reallocate() reallocates a pointer P to an integer, real or complex, one- or two-dimensional array with a new size N, while preserving its contents. The pointer P is deallocated on return of reallocate().

Synopsis:

p(:n)    = reallocate( p(:)   , n     )  ! p is an allocated pointer to an integer vector of kind i4b
p(:n)    = reallocate( p(:)   , n     )  ! p is an allocated pointer to a real vector of kind stnd
p(:n)    = reallocate( p(:)   , n     )  ! p is an allocated pointer to a complex vector of kind stnd
p(:n)    = reallocate( p(:)   , n     )  ! p is an allocated pointer to a character vector
p(:n,:m) = reallocate( p(:,:) , n , m )  ! p is an allocated pointer to an integer matrix of kind i4b
p(:n,:m) = reallocate( p(:,:) , n , m )  ! p is an allocated pointer to a real matrix of kind stnd
p(:n,:m) = reallocate( p(:,:) , n , m )  ! p is an allocated pointer to a complex matrix of kind stnd
realloc()

purpose:

realloc() reallocates a pointer P to an integer, real or complex, one- or two-dimensional array with a new size N, while preserving its contents.

Synopsis:

call realloc( p(:)   , n     , ialloc )  ! p is an allocated pointer to an integer vector of kind i4b
call realloc( p(:)   , n     , ialloc )  ! p is an allocated pointer to a real vector of kind stnd
call realloc( p(:)   , n     , ialloc )  ! p is an allocated pointer to a complex vector of kind stnd
call realloc( p(:)   , n     , ialloc )  ! p is an allocated pointer to a character vector
call realloc( p(:,:) , n , m , ialloc )  ! p is an allocated pointer to an integer matrix of kind i4b
call realloc( p(:,:) , n , m , ialloc )  ! p is an allocated pointer to a real matrix of kind stnd
call realloc( p(:,:) , n , m , ialloc )  ! p is an allocated pointer to a complex matrix of kind stnd
Flag Counter