Allocate or resize (shrink or expand) and refill an input allocatable
scalar string or array of rank 1..3
to an arbitrary size while preserving the original contents or a subset of it.
The new array
size is set to twice its current size or, to the requested input size(..)
.
The array contents or a requested subset of it are kept in the original indices in the output resized array or shifted to a new starting location lbc
in the output array
.
The rest of the elements (including the newly-added elements) are filled with the user-specified fill
.
The following figure illustrates example resizing and refilling of a 1D array and transferal of its contents.
- Parameters
-
[in,out] | array | : The input/output allocatable scalar of
-
type
character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU)
or array of rank 1..3 of either
-
type
character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU)
-
type
integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64)
-
type
logical of kind any supported by the processor (e.g., LK)
-
type
complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128)
-
type
real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128)
On output, the array will be (re)allocated to the requested new size with the same lower bound as before (or 1 if unallocated). |
[in] | fill | : The input scalar of the same type and kind as the input array containing the value to fill the new elements (if any) of array . If array is of type character , then
-
The equality
len(fill) == 1 must also hold if array is of zero rank (i.e., a scalar string).
-
The equality
len(fill) <= len(array) must also hold if array is of non-zero rank.
|
[in] | size | : The input non-negative scalar or array of type integer of default kind IK representing the new size of the output array.
-
If
array is a scalar or array of rank 1 , then size must be a scalar.
-
If
array is an array of rank > 1 , then size must be a vector of the same length as rank(array) .
(optional, default = 2 * len/shape(array) where the condition 0 < len/shape(array) must hold, otherwise infinite loops within the program can occur.) |
[in] | lbc | : The input scalar or array of type integer of default kind IK, representing the Lower Bound(s) of the Contents in the newly resized output array .
-
If
array is a scalar or array of rank 1 , then lbc must be a scalar.
-
If
array is an array of rank > 1 , then lbc must be a vector of the same length as rank(array) .
(optional, default = lbcold . It can be present only if the size argument is also present.) |
[in] | lbcold | : The input scalar or array of type integer of default kind IK, representing the Lower Bound(s) of the Contents in the original (old) input array that is to be copied to the newly allocated output array starting at the new lower bound(s) lbc .
(optional, default = ubound(array) . If array is a scalar string, then default = 1 . It can be present only if the size , lbc , and ubcold input arguments are also present.) |
[in] | ubcold | : The input scalar or array of type integer of default kind IK, representing the Upper Bound(s) of the Contents in the original (old) input array that is to be copied to the newly allocated output array starting at the new lower bound(s) lbc .
(optional, default = ubound(array) . If array is a scalar string, then default = len(array) It can be present only if the size and lbc and lbcold input arguments are also present.) |
[out] | failed | : The output scalar logical of default kind LK that is .false. if and only if the requested array resizing is successful, otherwise it is set to .true. to signal the occurrence of an allocation error.
The value of failed is .true. only if the stat argument returned by the Fortran intrinsic allocate() statement is non-zero.
(optional, if missing and an allocation error occurs, the processor dictates the program behavior (normally execution stops).) |
[out] | errmsg | : The output scalar character of default kind SK of arbitrary length type parameter.
If the optional output argument failed is present and an error occurs, errmsg will be set to a message describing the nature of the error.
This behavior conforms with the standard Fortran behavior for the intrinsic allocate() statement.
A length type parameter of 127 or more for errmsg should be sufficient for capturing most if not all error messages in entirety.
(optional. Its presence is relevant if and only if the optional output argument failed is also present.) |
Possible calling interfaces ⛓
call setRefilled(array, fill, failed
= failed,
errmsg = errmsg)
call setRefilled(array, fill, size, failed
= failed,
errmsg = errmsg)
call setRefilled(array, fill, size, lbc, failed
= failed,
errmsg = errmsg)
call setRefilled(array, fill, size, lbc, lbcold, ubcold, failed
= failed,
errmsg = errmsg)
!
Allocate or resize (shrink or expand) and refill an input allocatable scalar string or array of rank ...
This module contains procedures and generic interfaces for resizing allocatable arrays of various typ...
- Warning
- The condition
allocated(array)
must hold (the input array
must be preallocated) when any or all of the optional input arguments lbc, lbcold, ubcold
are present or when the size
argument is missing.
The condition all(0_IK <= size)
must hold for the corresponding input argument.
The condition all(lbound(array) <= lbcold .and. lbcold <= ubound(array))
must hold for the corresponding input arguments.
The condition all(lbound(array) <= ubcold .and. ubcold <= ubound(array))
must hold for the corresponding input arguments.
The condition all(lbound(array) <= lbc)
must hold for the corresponding input arguments.
The condition all(lbc + ubcold - lbcold <= lbound(array) + size - 1)
must hold for the corresponding input arguments (i.e., the upper bound(s) of contents cannot overflow the upper bound(s) of the new array).
The equality len(fill) == 1
must also hold if array
is of zero rank (i.e., a scalar string).
The equality len(fill) <= len(array)
must also hold if array
is of non-zero rank.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1
.
-
The
pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.
By default, these procedures are pure
in release
build and impure
in debug
and testing
builds.
- Note
- If the input
array
is unallocated, it will be allocated to the requested shape and filled entirely with fill
, equivalent to allocate(array(@size), source = fill)
.
-
If the initialization of the new elements with
fill
is not necessary, use setResized to resize arrays without initialization.
-
While shrinking an array using this generic interface is pointless dues to the lack of the use of
fill
argument for any purpose, shrinking (without actually doing any refills) is allowed.
This behavior is quite useful for graceful handling of situations where the task (shrinking or expanding) is only determined at runtime or can change from one call to another.
Otherwise, use setResized to shrink arrays or resize arrays without initialization.
-
The sole purpose of this generic interface is to provide a convenient but fast method of resizing allocatable arrays without losing the contents of the array and refilling the new elements with requested
fill
.
- Developer Remark:
- An optional dummy argument
stat
(instead of failed
) for the procedures of this generic interface are impossible as it creates ambiguous interfaces.
- See also
- setResized
setRebound
setRefilled
setRebilled
getCoreHalo
setCoreHalo
getCentered
setCentered
getPadded
setPadded
Example usage ⛓
6 call disp
%show(
'array'); \
7 call disp
%show( array , deliml
= SK_
"""" ); \
8 call disp
%show(
'lbound(array)'); \
9 call disp
%show(
lbound(array) ); \
10 call disp
%show(
'ubound(array)'); \
11 call disp
%show(
ubound(array) ); \
12 call disp
%show(
'fill'); \
13 call disp
%show( FILL , deliml
= SK_
"""" ); \
14 call disp
%show(
'size'); \
15 call disp
%show( SIZE ); \
16 call disp
%show(
'call setRefilled(array, fill, size)'); \
18 call disp
%show(
'array'); \
19 call disp
%show( array , deliml
= SK_
"""" ); \
20 call disp
%show(
'lbound(array)'); \
21 call disp
%show(
lbound(array) ); \
22 call disp
%show(
'ubound(array)'); \
23 call disp
%show(
ubound(array) ); \
27#define REFILL_SHIFT_ARRAY \
31 call disp
%show(
'array'); \
32 call disp
%show( array , deliml
= SK_
"""" ); \
33 call disp
%show(
'lbound(array)'); \
34 call disp
%show(
lbound(array) ); \
35 call disp
%show(
'ubound(array)'); \
36 call disp
%show(
ubound(array) ); \
37 call disp
%show(
'fill'); \
38 call disp
%show( FILL , deliml
= SK_
"""" ); \
39 call disp
%show(
'size'); \
40 call disp
%show( SIZE ); \
41 call disp
%show(
'lbc'); \
42 call disp
%show( LBC ); \
43 call disp
%show(
'call setRefilled(array, fill, size, lbc)'); \
45 call disp
%show(
'array'); \
46 call disp
%show( array , deliml
= SK_
"""" ); \
47 call disp
%show(
'lbound(array)'); \
48 call disp
%show(
lbound(array) ); \
49 call disp
%show(
'ubound(array)'); \
50 call disp
%show(
ubound(array) ); \
54#define REFILL_SHIFT_SUBSET_ARRAY \
58 call disp
%show(
'array'); \
59 call disp
%show( array , deliml
= SK_
"""" ); \
60 call disp
%show(
'lbound(array)'); \
61 call disp
%show(
lbound(array) ); \
62 call disp
%show(
'ubound(array)'); \
63 call disp
%show(
ubound(array) ); \
64 call disp
%show(
'fill'); \
65 call disp
%show( FILL , deliml
= SK_
"""" ); \
66 call disp
%show(
'size'); \
67 call disp
%show( SIZE ); \
68 call disp
%show(
'lbc'); \
69 call disp
%show( LBC ); \
70 call disp
%show(
'lbcold'); \
71 call disp
%show( LBCOLD ); \
72 call disp
%show(
'ubcold'); \
73 call disp
%show( UBCOLD ); \
74 call disp
%show(
'call setRefilled(array, fill, size, lbc, lbcold, ubcold)'); \
75 call setRefilled(array, FILL, SIZE, LBC, LBCOLD, UBCOLD) ; \
76 call disp
%show(
'array'); \
77 call disp
%show( array , deliml
= SK_
"""" ); \
78 call disp
%show(
'lbound(array)'); \
79 call disp
%show(
lbound(array) ); \
80 call disp
%show(
'ubound(array)'); \
81 call disp
%show(
ubound(array) ); \
97 type(display_type) :: disp
101 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
102 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
103 call disp%show(
"! Expand an array with specific size.")
104 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
105 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
109 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%")
110 call disp%show(
"! Expand `character` vector.")
111 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%")
116#define DECLARE character(2,SKG), allocatable :: array(:)
117#define CONSTRUCT allocate(array(3:8)); array(:) = ["AA", "BB", "CC", "DD", "EE", "FF"]
121 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
122 call disp%show(
"! Expand `integer` vector.")
123 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
128#define DECLARE integer(IKG), allocatable :: array(:)
129#define CONSTRUCT allocate(array(3:8)); array(:) = [1, 2, 3, 4, 5, 6]
133 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
134 call disp%show(
"! Expand `logical` vector.")
135 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
139#define FILL .false._LKG
140#define DECLARE logical(LKG), allocatable :: array(:)
141#define CONSTRUCT allocate(array(3:8)); array(:) = [.true., .true., .true., .true., .true., .true.]
145 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
146 call disp%show(
"! Expand `complex` vector.")
147 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
151#define FILL cmplx(-9.,-9.,CKG)
152#define DECLARE complex(CKG), allocatable :: array(:)
153#define CONSTRUCT allocate(array(3:8)); array(:) = [(1., -1.), (2., -2.), (3., -3.), (4., -4.), (5., -5.), (6., -6.)]
157 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%")
158 call disp%show(
"! Expand `real` vector.")
159 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%")
164#define DECLARE real(RKG), allocatable :: array(:)
165#define CONSTRUCT allocate(array(3:8)); array(:) = [1., 2., 3., 4., 5., 6.]
169 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%")
170 call disp%show(
"! Expand `character` matrix.")
171 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%")
174#define SIZE [9_IK, 9_IK]
176#define DECLARE character(2,SKG), allocatable :: array(:,:)
177#define CONSTRUCT allocate(array(2:3,3:5)); array(:,:) = reshape(["AA", "BB", "CC", "DD", "EE", "FF"], shape = shape(array), order = [2, 1])
181 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
182 call disp%show(
"! Expand `character` cube.")
183 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
186#define SIZE [9_IK, 9_IK, 3_IK]
188#define DECLARE character(2,SKG), allocatable :: array(:,:,:)
189#define CONSTRUCT allocate(array(2:3,3:5,2:2)); array(:,:,:) = reshape(["AA", "BB", "CC", "DD", "EE", "FF"], shape = shape(array), order = [3, 2, 1])
193 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
194 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
195 call disp%show(
"! Expand an array and shift its contents.")
196 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
197 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
201 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
202 call disp%show(
"! Expand and shift `character` vector.")
203 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
209#define DECLARE character(2,SKG), allocatable :: array(:)
210#define CONSTRUCT allocate(array(3:8)); array(:) = ["AA", "BB", "CC", "DD", "EE", "FF"]
214 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
215 call disp%show(
"! Expand and shift `character` matrix.")
216 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
219#define SIZE [6_IK, 6_IK]
220#define LBC [4_IK, 4_IK]
222#define DECLARE character(2,SKG), allocatable :: array(:,:)
223#define CONSTRUCT allocate(array(2:3,3:5)); array(:,:) = reshape(["AA", "BB", "CC", "DD", "EE", "FF"], shape = shape(array), order = [2, 1])
227 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
228 call disp%show(
"! Expand and shift `character` cube.")
229 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
232#define SIZE [6_IK, 6_IK, 3_IK]
233#define LBC [3_IK, 4_IK, 2_IK]
235#define DECLARE character(2,SKG), allocatable :: array(:,:,:)
236#define CONSTRUCT allocate(array(1:2,1:3,1:1)); array(:,:,:) = reshape(["AA", "BB", "CC", "DD", "EE", "FF"], shape = shape(array), order = [3, 2, 1])
240 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
241 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
242 call disp%show(
"! Expand an array and shift a subset of its contents.")
243 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
244 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
248 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
249 call disp%show(
"! Expand and shift `character` vector.")
250 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
258#define DECLARE character(2,SKG), allocatable :: array(:)
259#define CONSTRUCT allocate(array(3:8)); array(:) = ["AA", "BB", "CC", "DD", "EE", "FF"]
260REFILL_SHIFT_SUBSET_ARRAY
263 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
264 call disp%show(
"! Expand and shift `character` matrix.")
265 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
268#define SIZE [2_IK, 3_IK]
269#define LBC [2_IK, 4_IK]
270#define LBCOLD [2_IK, 4_IK]
271#define UBCOLD [3_IK, 5_IK]
273#define DECLARE character(2,SKG), allocatable :: array(:,:)
274#define CONSTRUCT allocate(array(2:3,3:5)); array(:,:) = reshape(["AA", "BB", "CC", "DD", "EE", "FF"], shape = shape(array), order = [2, 1])
275REFILL_SHIFT_SUBSET_ARRAY
278 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
279 call disp%show(
"! Expand and shift `character` cube.")
280 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
283#define SIZE [2_IK, 2_IK, 4_IK]
284#define LBC [1_IK, 1_IK, 3_IK]
285#define LBCOLD [1_IK, 2_IK, 2_IK]
286#define UBCOLD [2_IK, 3_IK, 2_IK]
288#define DECLARE character(2,SKG), allocatable :: array(:,:,:)
289#define CONSTRUCT allocate(array(1:2,1:3,1:2)); array(:,:,:) = reshape(["AA", "BB", "CC", "DD", "EE", "FF", "GG", "HH", "II", "JJ", "KK", "LL"], shape = shape(array), order = [3, 2, 1])
290REFILL_SHIFT_SUBSET_ARRAY
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter CK
The default complex kind in the ParaMonte library: real64 in Fortran, c_double_complex in C-Fortran I...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
14"AA",
"BB",
"CC",
"DD",
"EE",
"FF"
25"AA",
"BB",
"CC",
"DD",
"EE",
"FF",
"--",
"--",
"--"
36"+1",
"+2",
"+3",
"+4",
"+5",
"+6"
47"+1",
"+2",
"+3",
"+4",
"+5",
"+6",
"-3",
"-3",
"-3"
58"T",
"T",
"T",
"T",
"T",
"T"
69"T",
"T",
"T",
"T",
"T",
"T",
"F",
"F",
"F"
80"+1.0000000000000000, -1.0000000000000000",
"+2.0000000000000000, -2.0000000000000000",
"+3.0000000000000000, -3.0000000000000000",
"+4.0000000000000000, -4.0000000000000000",
"+5.0000000000000000, -5.0000000000000000",
"+6.0000000000000000, -6.0000000000000000"
86"-9.0000000000000000, -9.0000000000000000"
91"+1.0000000000000000, -1.0000000000000000",
"+2.0000000000000000, -2.0000000000000000",
"+3.0000000000000000, -3.0000000000000000",
"+4.0000000000000000, -4.0000000000000000",
"+5.0000000000000000, -5.0000000000000000",
"+6.0000000000000000, -6.0000000000000000",
"-9.0000000000000000, -9.0000000000000000",
"-9.0000000000000000, -9.0000000000000000",
"-9.0000000000000000, -9.0000000000000000"
102"+1.0000000000000000",
"+2.0000000000000000",
"+3.0000000000000000",
"+4.0000000000000000",
"+5.0000000000000000",
"+6.0000000000000000"
113"+1.0000000000000000",
"+2.0000000000000000",
"+3.0000000000000000",
"+4.0000000000000000",
"+5.0000000000000000",
"+6.0000000000000000",
"-1.0000000000000000",
"-1.0000000000000000",
"-1.0000000000000000"
136"AA",
"BB",
"CC",
"--",
"--",
"--",
"--",
"--",
"--"
137"DD",
"EE",
"FF",
"--",
"--",
"--",
"--",
"--",
"--"
138"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
139"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
140"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
141"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
142"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
143"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
144"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
169"AA",
"BB",
"CC",
"--",
"--",
"--",
"--",
"--",
"--"
170"DD",
"EE",
"FF",
"--",
"--",
"--",
"--",
"--",
"--"
171"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
172"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
173"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
174"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
175"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
176"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
177"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
179"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
180"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
181"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
182"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
183"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
184"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
185"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
186"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
187"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
189"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
190"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
191"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
192"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
193"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
194"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
195"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
196"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
197"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
215"AA",
"BB",
"CC",
"DD",
"EE",
"FF"
228"--",
"--",
"AA",
"BB",
"CC",
"DD",
"EE",
"FF",
"--",
"--",
"--",
"--",
"--"
253"--",
"--",
"--",
"--",
"--",
"--"
254"--",
"--",
"--",
"--",
"--",
"--"
255"--",
"AA",
"BB",
"CC",
"--",
"--"
256"--",
"DD",
"EE",
"FF",
"--",
"--"
257"--",
"--",
"--",
"--",
"--",
"--"
258"--",
"--",
"--",
"--",
"--",
"--"
285"--",
"--",
"--",
"--",
"--",
"--"
286"--",
"--",
"--",
"--",
"--",
"--"
287"--",
"--",
"--",
"--",
"--",
"--"
288"--",
"--",
"--",
"--",
"--",
"--"
289"--",
"--",
"--",
"--",
"--",
"--"
290"--",
"--",
"--",
"--",
"--",
"--"
292"--",
"--",
"--",
"--",
"--",
"--"
293"--",
"--",
"--",
"--",
"--",
"--"
294"--",
"--",
"--",
"AA",
"BB",
"CC"
295"--",
"--",
"--",
"DD",
"EE",
"FF"
296"--",
"--",
"--",
"--",
"--",
"--"
297"--",
"--",
"--",
"--",
"--",
"--"
299"--",
"--",
"--",
"--",
"--",
"--"
300"--",
"--",
"--",
"--",
"--",
"--"
301"--",
"--",
"--",
"--",
"--",
"--"
302"--",
"--",
"--",
"--",
"--",
"--"
303"--",
"--",
"--",
"--",
"--",
"--"
304"--",
"--",
"--",
"--",
"--",
"--"
322"AA",
"BB",
"CC",
"DD",
"EE",
"FF"
337call setRefilled(array, fill, size, lbc, lbcold, ubcold)
339"--",
"--",
"CC",
"DD",
"EE",
"--",
"--",
"--",
"--",
"--",
"--",
"--",
"--"
366call setRefilled(array, fill, size, lbc, lbcold, ubcold)
400call setRefilled(array, fill, size, lbc, lbcold, ubcold)
- Test:
- test_pm_arrayRefill
- Bug:
Status: Unresolved
Source: GNU Fortran Compiler gfortran
version 10-12
Description: There is an annoying gfortran bug concerning allocation of allocatable arrays of strings with assumed length type parameter.
The typical compiler error message is around line 230: Error allocating 283223642230368 bytes: Cannot allocate memory
.
This requires the allocation statement be explicit for character
arrays of non-zero rank.
This makes the already complex code superbly more complex and messy.
Remedy (as of ParaMonte Library version 2.0.0): For now, the allocatable
arrays of type character
are allocated with explicit shape in the allocation statement.
This explicit allocation for character
types must be removed and replaced with the generic allocation once the bug is resolved.
- Todo:
- Very Low Priority: This generic interface can be extended to arrays of higher ranks than currently supported.
- Todo:
- Normal Priority: This generic interface should be extended to arrays of container type as done in pm_arrayResize.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
- Copyright
- Computational Data Science Lab
- Author:
- Amir Shahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin
Definition at line 245 of file pm_arrayRefill.F90.