|
subroutine | reallocate_int1d (aint, nrow, name, mem_path) |
| Reallocate a 1-dimensional integer array. More...
|
|
subroutine | reallocate_int2d (aint, ncol, nrow, name, mem_path) |
| Reallocate a 2-dimensional integer array. More...
|
|
subroutine | reallocate_dbl1d (adbl, nrow, name, mem_path) |
| Reallocate a 1-dimensional real array. More...
|
|
subroutine | reallocate_dbl2d (adbl, ncol, nrow, name, mem_path) |
| Reallocate a 2-dimensional real array. More...
|
|
subroutine | reallocate_str1d (astr, ilen, nrow, name, mem_path) |
| Reallocate a 1-dimensional defined length string array. More...
|
|
subroutine | reallocate_charstr1d (acharstr1d, ilen, nrow, name, mem_path) |
| Reallocate a 1-dimensional deferred length string array. More...
|
|
Definition at line 79 of file MemoryManager.f90.
◆ reallocate_charstr1d()
subroutine memorymanagermodule::mem_reallocate::reallocate_charstr1d |
( |
type(characterstringtype), dimension(:), intent(inout), pointer, contiguous |
acharstr1d, |
|
|
integer(i4b), intent(in) |
ilen, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | acharstr1d | the reallocated charstring array |
[in] | ilen | string length |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1181 of file MemoryManager.f90.
1182 type(CharacterStringType),
dimension(:),
pointer,
contiguous, &
1183 intent(inout) :: acharstr1d
1184 integer(I4B),
intent(in) :: ilen
1185 integer(I4B),
intent(in) :: nrow
1186 character(len=*),
intent(in) :: name
1187 character(len=*),
intent(in) :: mem_path
1189 type(MemoryType),
pointer :: mt
1190 logical(LGP) :: found
1191 type(CharacterStringType),
dimension(:),
allocatable :: astrtemp
1192 character(len=ilen) :: string
1193 integer(I4B) :: istat
1194 integer(I4B) :: isize
1195 integer(I4B) :: isize_old
1196 integer(I4B) :: nrow_old
1203 call get_from_memorystore(name, mem_path, mt, found)
1207 isize_old = mt%isize
1208 if (isize_old > 0)
then
1209 nrow_old =
size(acharstr1d)
1218 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1219 if (istat /= 0)
then
1220 call allocate_error(name, mem_path, istat, isize)
1225 astrtemp(n) = acharstr1d(n)
1229 do n = nrow_old + 1, nrow
1230 astrtemp(n) = string
1234 deallocate (acharstr1d)
1237 allocate (acharstr1d(nrow), stat=istat, errmsg=errmsg)
1238 if (istat /= 0)
then
1239 call allocate_error(name, mem_path, istat, isize)
1244 acharstr1d(n) = astrtemp(n)
1248 deallocate (astrtemp)
1251 mt%acharstr1d => acharstr1d
1252 mt%element_size = ilen
1254 mt%nrealloc = mt%nrealloc + 1
1256 nvalues_astr = nvalues_astr + isize - isize_old
1257 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1259 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1260 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1261 "mem_allocate instead."
1262 call store_error(errmsg, terminate=.true.)
◆ reallocate_dbl1d()
subroutine memorymanagermodule::mem_reallocate::reallocate_dbl1d |
( |
real(dp), dimension(:), intent(inout), pointer, contiguous |
adbl, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | adbl | the reallocated 1d real array |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1357 of file MemoryManager.f90.
1358 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1359 integer(I4B),
intent(in) :: nrow
1360 character(len=*),
intent(in) :: name
1361 character(len=*),
intent(in) :: mem_path
1363 type(MemoryType),
pointer :: mt
1364 integer(I4B) :: istat
1365 integer(I4B) :: isize
1367 integer(I4B) :: isizeold
1368 integer(I4B) :: ifill
1369 logical(LGP) :: found
1373 call get_from_memorystore(name, mem_path, mt, found)
1377 isizeold =
size(mt%adbl1d)
1378 ifill = min(isizeold, isize)
1379 allocate (adbl(nrow), stat=istat, errmsg=errmsg)
1380 if (istat /= 0)
then
1381 call allocate_error(name, mem_path, istat, isize)
1384 adbl(i) = mt%adbl1d(i)
1388 deallocate (mt%adbl1d)
1390 mt%element_size = dp
1392 mt%nrealloc = mt%nrealloc + 1
1394 nvalues_adbl = nvalues_adbl + isize - isizeold
1395 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', isize
◆ reallocate_dbl2d()
subroutine memorymanagermodule::mem_reallocate::reallocate_dbl2d |
( |
real(dp), dimension(:, :), intent(inout), pointer, contiguous |
adbl, |
|
|
integer(i4b), intent(in) |
ncol, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | adbl | the reallocated 2d real array |
[in] | ncol | number of columns |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1400 of file MemoryManager.f90.
1401 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1402 integer(I4B),
intent(in) :: ncol
1403 integer(I4B),
intent(in) :: nrow
1404 character(len=*),
intent(in) :: name
1405 character(len=*),
intent(in) :: mem_path
1407 type(MemoryType),
pointer :: mt
1408 logical(LGP) :: found
1409 integer(I4B) :: istat
1410 integer(I4B),
dimension(2) :: ishape
1413 integer(I4B) :: isize
1414 integer(I4B) :: isizeold
1418 call get_from_memorystore(name, mem_path, mt, found)
1421 ishape = shape(mt%adbl2d)
1423 isizeold = ishape(1) * ishape(2)
1424 allocate (adbl(ncol, nrow), stat=istat, errmsg=errmsg)
1425 if (istat /= 0)
then
1426 call allocate_error(name, mem_path, istat, isize)
1430 adbl(j, i) = mt%adbl2d(j, i)
1435 deallocate (mt%adbl2d)
1437 mt%element_size = dp
1439 mt%nrealloc = mt%nrealloc + 1
1441 nvalues_adbl = nvalues_adbl + isize - isizeold
1442 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
◆ reallocate_int1d()
subroutine memorymanagermodule::mem_reallocate::reallocate_int1d |
( |
integer(i4b), dimension(:), intent(inout), pointer, contiguous |
aint, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | aint | the reallocated integer array |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1268 of file MemoryManager.f90.
1269 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1270 integer(I4B),
intent(in) :: nrow
1271 character(len=*),
intent(in) :: name
1272 character(len=*),
intent(in) :: mem_path
1274 type(MemoryType),
pointer :: mt
1275 logical(LGP) :: found
1276 integer(I4B) :: istat
1277 integer(I4B) :: isize
1279 integer(I4B) :: isizeold
1280 integer(I4B) :: ifill
1284 call get_from_memorystore(name, mem_path, mt, found)
1288 isizeold =
size(mt%aint1d)
1289 ifill = min(isizeold, isize)
1290 allocate (aint(nrow), stat=istat, errmsg=errmsg)
1291 if (istat /= 0)
then
1292 call allocate_error(name, mem_path, istat, isize)
1295 aint(i) = mt%aint1d(i)
1299 deallocate (mt%aint1d)
1301 mt%element_size = i4b
1303 mt%nrealloc = mt%nrealloc + 1
1305 nvalues_aint = nvalues_aint + isize - isizeold
◆ reallocate_int2d()
subroutine memorymanagermodule::mem_reallocate::reallocate_int2d |
( |
integer(i4b), dimension(:, :), intent(inout), pointer, contiguous |
aint, |
|
|
integer(i4b), intent(in) |
ncol, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | aint | the reallocated 2d integer array |
[in] | ncol | number of columns |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1310 of file MemoryManager.f90.
1311 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1312 integer(I4B),
intent(in) :: ncol
1313 integer(I4B),
intent(in) :: nrow
1314 character(len=*),
intent(in) :: name
1315 character(len=*),
intent(in) :: mem_path
1317 type(MemoryType),
pointer :: mt
1318 logical(LGP) :: found
1319 integer(I4B) :: istat
1320 integer(I4B),
dimension(2) :: ishape
1323 integer(I4B) :: isize
1324 integer(I4B) :: isizeold
1328 call get_from_memorystore(name, mem_path, mt, found)
1331 ishape = shape(mt%aint2d)
1333 isizeold = ishape(1) * ishape(2)
1334 allocate (aint(ncol, nrow), stat=istat, errmsg=errmsg)
1335 if (istat /= 0)
then
1336 call allocate_error(name, mem_path, istat, isize)
1340 aint(j, i) = mt%aint2d(j, i)
1345 deallocate (mt%aint2d)
1347 mt%element_size = i4b
1349 mt%nrealloc = mt%nrealloc + 1
1351 nvalues_aint = nvalues_aint + isize - isizeold
1352 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
◆ reallocate_str1d()
subroutine memorymanagermodule::mem_reallocate::reallocate_str1d |
( |
character(len=ilen), dimension(:), intent(inout), pointer, contiguous |
astr, |
|
|
integer(i4b), intent(in) |
ilen, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in] | ilen | string length |
[in] | nrow | number of rows |
[in,out] | astr | the reallocated string array |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1100 of file MemoryManager.f90.
1101 integer(I4B),
intent(in) :: ilen
1102 integer(I4B),
intent(in) :: nrow
1103 character(len=ilen),
dimension(:),
pointer,
contiguous,
intent(inout) :: astr
1104 character(len=*),
intent(in) :: name
1105 character(len=*),
intent(in) :: mem_path
1107 type(MemoryType),
pointer :: mt
1108 logical(LGP) :: found
1109 character(len=ilen),
dimension(:),
allocatable :: astrtemp
1110 integer(I4B) :: istat
1111 integer(I4B) :: isize
1112 integer(I4B) :: isize_old
1113 integer(I4B) :: nrow_old
1117 call get_from_memorystore(name, mem_path, mt, found)
1121 isize_old = mt%isize
1122 if (isize_old > 0)
then
1123 nrow_old =
size(astr)
1132 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1133 if (istat /= 0)
then
1134 call allocate_error(name, mem_path, istat, isize)
1139 astrtemp(n) = astr(n)
1143 do n = nrow_old + 1, nrow
1151 allocate (astr(nrow), stat=istat, errmsg=errmsg)
1152 if (istat /= 0)
then
1153 call allocate_error(name, mem_path, istat, isize)
1158 astr(n) = astrtemp(n)
1162 deallocate (astrtemp)
1165 mt%element_size = ilen
1167 mt%nrealloc = mt%nrealloc + 1
1169 nvalues_astr = nvalues_astr + isize - isize_old
1170 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1172 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1173 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1174 "mem_allocate instead."
1175 call store_error(errmsg, terminate=.true.)
The documentation for this interface was generated from the following file: