Module_Utilities_With_Pnter¶
Copyright 2018 IRD
This file is part of statpack.
statpack is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
statpack is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You can find a copy of the GNU Lesser General Public License in the statpack/doc directory.
MODULE EXPORTING UTILITIES TO MANIPULATE FORTRAN90 POINTERS.
THESE ROUTINES ARE ADAPTED AND EXTENDED FROM PUBLIC DOMAIN ROUTINES FROM Numerical Recipes.
LATEST REVISION : 21/03/2018
function reallocate ( p, n )
¶
Purpose¶
Reallocates a pointer P to an integer one dimensional array with a new size N, while preserving its contents. The pointer P is deallocated on return.
Arguments¶
- P integer(i4b), dimension(:), pointer
On entry, an allocated pointer to an integer vector.
On exit, the pointer is deallocated.
- N (INPUT) integer(i4b)
- The size N of the new pointer.
function reallocate ( p, n )
¶
Purpose¶
Reallocates a pointer P to a real one dimensional array with a new size N, while preserving its contents. The pointer P is deallocated on return.
Arguments¶
- P real(stnd), dimension(:), pointer
On entry, an allocated pointer to a real vector.
On exit, the pointer is deallocated.
- N (INPUT) integer(i4b)
- The size N of the new pointer.
function reallocate ( p, n )
¶
Purpose¶
Reallocates a pointer P to a complex one dimensional array with a new size N, while preserving its contents. The pointer P is deallocated on return.
Arguments¶
- P complex(stnd), dimension(:), pointer
On entry, an allocated pointer to a complex vector.
On exit, the pointer is deallocated.
- N (INPUT) integer(i4b)
- The size N of the new pointer.
function reallocate ( p, n )
¶
Purpose¶
Reallocates a pointer P to a character one dimensional array with a new size N, while preserving its contents. The pointer P is deallocated on return.
Arguments¶
- P character(1), dimension(:), pointer
On entry, an allocated pointer to a character vector.
On exit, the pointer is deallocated.
- N (INPUT) integer(i4b)
- The size N of the new pointer.
function reallocate ( p, n, m )
¶
Purpose¶
Reallocates a pointer P to an integer two dimensional array with a new shape (N,M) while preserving its contents. The pointer P is deallocated on return.
Arguments¶
- P integer(i4b), dimension(:,:), pointer
On entry, an allocated pointer to an integer matrix.
On exit, the pointer is deallocated.
- N, M (INPUT) integer(i4b)
- The shape (N,M) of the new pointer.
function reallocate ( p, n, m )
¶
Purpose¶
Reallocates a pointer P to a real two dimensional array with a new shape (N,M) while preserving its contents. The pointer P is deallocated on return.
Arguments¶
- P real(stnd), dimension(:,:), pointer
On entry, an allocated pointer to a real matrix.
On exit, the pointer is deallocated.
- N, M (INPUT) integer(i4b)
- The shape (N,M) of the new pointer.
function reallocate ( p, n, m )
¶
Purpose¶
Reallocates a pointer P to a complex two dimensional array with a new shape (N,M) while preserving its contents. The pointer P is deallocated on return.
Arguments¶
- P complex(stnd), dimension(:,:), pointer
On entry, an allocated pointer to a complex matrix.
On exit, the pointer is deallocated.
- N, M (INPUT) integer(i4b)
- The shape (N,M) of the new pointer.
subroutine realloc ( p, n, ialloc )
¶
Purpose¶
Reallocates a pointer P to an integer one dimensional array with a new size N, while preserving its contents.
Arguments¶
- P integer(i4b), dimension(:), pointer
On entry, an allocated pointer to an integer vector.
On exit, the allocated pointer with a new size of N.
- N (INPUT) integer(i4b)
- The new size N of the pointer.
- IALLOC (OUTPUT) integer
- On exit, IALLOC = 0 indicates successful exit. Any other values indicate an allocation problem.
subroutine realloc ( p, n, ialloc )
¶
Purpose¶
Reallocates a pointer P to a real one dimensional array with a new size N, while preserving its contents.
Arguments¶
- P real(stnd), dimension(:), pointer
On entry, an allocated pointer to a real vector.
On exit, the allocated pointer with a new size of N.
- N (INPUT) integer(i4b)
- The new size N of the pointer.
- IALLOC (OUTPUT) integer
- On exit, IALLOC = 0 indicates successful exit. Any other values indicate an allocation problem.
subroutine realloc ( p, n, ialloc )
¶
Purpose¶
Reallocates a pointer P to a complex one dimensional array with a new size N, while preserving its contents.
Arguments¶
- P complex(stnd), dimension(:), pointer
On entry, an allocated pointer to a complex vector.
On exit, the allocated pointer with a new size of N.
- N (INPUT) integer(i4b)
- The new size N of the pointer.
- IALLOC (OUTPUT) integer
- On exit, IALLOC = 0 indicates successful exit. Any other values indicate an allocation problem.
subroutine realloc ( p, n, ialloc )
¶
Purpose¶
Reallocates a pointer P to a character one dimensional array with a new size N, while preserving its contents.
Arguments¶
- P character(1), dimension(:), pointer
On entry, an allocated pointer to a character vector.
On exit, the allocated pointer with a new size of N.
- N (INPUT) integer(i4b)
- The new size N of the pointer.
- IALLOC (OUTPUT) integer
- On exit, IALLOC = 0 indicates successful exit. Any other values indicate an allocation problem.
subroutine realloc ( p, n, m, ialloc )
¶
Purpose¶
Reallocates a pointer P to an integer two dimensional array with a new shape (N,M) while preserving its contents.
Arguments¶
- P integer(i4b), dimension(:,:), pointer
On entry, an allocated pointer to an integer matrix.
On exit, the allocated pointer with a new shape (N,M).
- N, M (INPUT) integer(i4b)
- The new shape (N,M) of the pointer.
- IALLOC (OUTPUT) integer
- On exit, IALLOC = 0 indicates successful exit. Any other values indicate an allocation problem.
subroutine realloc ( p, n, m, ialloc )
¶
Purpose¶
Reallocates a pointer P to a real two dimensional array with a new shape (N,M) while preserving its contents.
Arguments¶
- P real(stnd), dimension(:,:), pointer
On entry, an allocated pointer to a real matrix.
On exit, the allocated pointer with a new shape (N,M).
- N, M (INPUT) integer(i4b)
- The new shape (N,M) of the pointer.
- IALLOC (OUTPUT) integer
- On exit, IALLOC = 0 indicates successful exit. Any other values indicate an allocation problem.
subroutine realloc ( p, n, m, ialloc )
¶
Purpose¶
Reallocates a pointer P to a complex two dimensional array with a new shape (N,M) while preserving its contents.
Arguments¶
- P complex(stnd), dimension(:,:), pointer
On entry, an allocated pointer to a complex matrix.
On exit, the allocated pointer with a new shape (N,M).
- N, M (INPUT) integer(i4b)
- The new shape (N,M) of the pointer.
- IALLOC (OUTPUT) integer
- On exit, IALLOC = 0 indicates successful exit. Any other values indicate an allocation problem.