This module is used to handle the memory, the variable kinds, the dynamic allocation and the optional soft memory limit of the openMMPol library.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=ip), | private, | parameter | :: | iof_memory | = | 6 |
Unit file for memory errors, warning and debug |
real(kind=rp), | private | :: | maxmem |
Max memory that can be allocated in GB |
|||
real(kind=rp), | private | :: | usedmem |
Memory that is currently used by the code in GB |
|||
real(kind=rp), | private | :: | max_used |
Maximum memory used since last reset through mem_stat |
|||
integer(kind=ip), | private | :: | size_of_int |
Number of bytes for an integer |
|||
integer(kind=ip), | private | :: | size_of_real |
Number of bytes for a real |
|||
integer(kind=ip), | private | :: | size_of_logical |
Number of bytes for a logical (?) |
|||
logical(kind=lp), | private | :: | is_init | = | .false. | ||
logical, | private | :: | do_chk_limit |
Decide if the soft memory limit is on |
Interface to perform memory allocation within the openMMPol library, it can be called for 1,2 and 3-dimensional arrays of either integer or real
Allocate a 1-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimension of the vector |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:) |
Vector to allocate |
Allocate a 2-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:,:) |
Vector to allocate |
Allocate a 3-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len3 |
Dimensions of the vector |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:,:,:) |
Vector to allocate |
Allocate a 1-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimension of the vector |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:) |
Vector to allocate |
Allocate a 2-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:,:) |
Vector to allocate |
Allocate a 3-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len3 |
Dimensions of the vector |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:,:,:) |
Vector to allocate |
Allocate a 1-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimension of the vector |
||
logical(kind=lp), | intent(inout), | allocatable | :: | v(:) |
Vector to allocate |
Allocate a 2-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
logical(kind=lp), | intent(inout), | allocatable | :: | v(:,:) |
Vector to allocate |
Interface to perform memory deallocation within the openMMPol library, it can be called for 1,2 and 3-dimensional arrays of either integer or real
Free a 1-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:) |
Array to free |
Free a 2-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:,:) |
Array to free |
Free a 3-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:,:,:) |
Array to free |
Free a 1-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:) |
Array to free |
Free a 2-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:,:) |
Array to free |
Free a 3-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:,:,:) |
Array to free |
Free a 1-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
logical(kind=lp), | intent(inout), | allocatable | :: | v(:) |
Array to free |
Free a 2-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
logical(kind=lp), | intent(inout), | allocatable | :: | v(:,:) |
Array to free |
This function is used to know if the library is compiled using integer 8 or 4 bytes long.
Return the current value of maximum used memory, if an argument is present set max_used to that value, otherwise max_used is reset to -1
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rp), | intent(in), | optional | :: | pv |
Routine used to initialize the memory module. It should be called during the module initialization.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical | :: | do_chk |
Switch for memory soft limit |
|||
real(kind=rp), | intent(in) | :: | max_Gbytes |
Amount of memory available in bytes |
Allocate a 1-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimension of the vector |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:) |
Vector to allocate |
Allocate a 2-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:,:) |
Vector to allocate |
Allocate a 3-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len3 |
Dimensions of the vector |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:,:,:) |
Vector to allocate |
Allocate a 1-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimension of the vector |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:) |
Vector to allocate |
Allocate a 2-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:,:) |
Vector to allocate |
Allocate a 3-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len3 |
Dimensions of the vector |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:,:,:) |
Vector to allocate |
Allocate a 1-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimension of the vector |
||
logical(kind=lp), | intent(inout), | allocatable | :: | v(:) |
Vector to allocate |
Allocate a 2-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | len1 |
Dimensions of the vector |
||
integer(kind=ip), | intent(in) | :: | len2 |
Dimensions of the vector |
||
logical(kind=lp), | intent(inout), | allocatable | :: | v(:,:) |
Vector to allocate |
Handles the memory errors (including soft limit) during memory allocation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the allocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | lall |
Amount of allocated memory in bytes |
||
integer(kind=ip), | intent(in) | :: | istat |
Status flag from allocate() |
Free a 1-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:) |
Array to free |
Free a 2-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:,:) |
Array to free |
Free a 3-dimensional array of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
real(kind=rp), | intent(inout), | allocatable | :: | v(:,:,:) |
Array to free |
Free a 1-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:) |
Array to free |
Free a 2-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:,:) |
Array to free |
Free a 3-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
integer(kind=ip), | intent(inout), | allocatable | :: | v(:,:,:) |
Array to free |
Free a 1-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
logical(kind=lp), | intent(inout), | allocatable | :: | v(:) |
Array to free |
Free a 2-dimensional array of integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
logical(kind=lp), | intent(inout), | allocatable | :: | v(:,:) |
Array to free |
Handles the memory errors (including soft limits) during the deallocation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Human-readable description string of the deallocation operation, just for output purpose. |
||
integer(kind=ip), | intent(in) | :: | lfree |
amount of memory (in bytes) to free |
||
integer(kind=ip), | intent(in) | :: | istat |
return flag of deallocate |