MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
memorymanagermodule::mem_allocate Interface Reference
Collaboration diagram for memorymanagermodule::mem_allocate:
Collaboration graph

Private Member Functions

subroutine allocate_logical (sclr, name, mem_path)
 Allocate a logical scalar. More...
 
subroutine allocate_str (sclr, ilen, name, mem_path)
 Allocate a character string. More...
 
subroutine allocate_str1d (astr1d, ilen, nrow, name, mem_path)
 Allocate a 1-dimensional defined length string array. More...
 
subroutine allocate_int (sclr, name, mem_path)
 Allocate a integer scalar. More...
 
subroutine allocate_int1d (aint, nrow, name, mem_path)
 Allocate a 1-dimensional integer array. More...
 
subroutine allocate_int2d (aint, ncol, nrow, name, mem_path)
 Allocate a 2-dimensional integer array. More...
 
subroutine allocate_int3d (aint, ncol, nrow, nlay, name, mem_path)
 Allocate a 3-dimensional integer array. More...
 
subroutine allocate_dbl (sclr, name, mem_path)
 Allocate a real scalar. More...
 
subroutine allocate_dbl1d (adbl, nrow, name, mem_path)
 Allocate a 1-dimensional real array. More...
 
subroutine allocate_dbl2d (adbl, ncol, nrow, name, mem_path)
 Allocate a 2-dimensional real array. More...
 
subroutine allocate_dbl3d (adbl, ncol, nrow, nlay, name, mem_path)
 Allocate a 3-dimensional real array. More...
 
subroutine allocate_charstr1d (acharstr1d, ilen, nrow, name, mem_path)
 Allocate a 1-dimensional array of deferred-length CharacterStringType. More...
 

Detailed Description

Definition at line 53 of file MemoryManager.f90.

Member Function/Subroutine Documentation

◆ allocate_charstr1d()

subroutine memorymanagermodule::mem_allocate::allocate_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]acharstr1dvariable for allocation
[in]ilenstring length
[in]nrownumber of strings in array
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 539 of file MemoryManager.f90.

540  type(CharacterStringType), dimension(:), &
541  pointer, contiguous, intent(inout) :: acharstr1d !< variable for allocation
542  integer(I4B), intent(in) :: ilen !< string length
543  integer(I4B), intent(in) :: nrow !< number of strings in array
544  character(len=*), intent(in) :: name !< variable name
545  character(len=*), intent(in) :: mem_path !< path where the variable is stored
546  ! -- local variables
547  character(len=ilen) :: string
548  type(MemoryType), pointer :: mt
549  integer(I4B) :: n
550  integer(I4B) :: istat
551  integer(I4B) :: isize
552  ! -- code
553  !
554  ! -- initialize string
555  string = ''
556  !
557  ! -- check variable name length
558  call mem_check_length(name, lenvarname, "variable")
559  !
560  ! -- calculate isize
561  isize = nrow
562  !
563  ! -- allocate deferred length string array
564  allocate (acharstr1d(nrow), stat=istat, errmsg=errmsg)
565  !
566  ! -- check for error condition
567  if (istat /= 0) then
568  call allocate_error(name, mem_path, istat, isize)
569  end if
570  !
571  ! -- fill deferred length string with empty string
572  do n = 1, nrow
573  acharstr1d(n) = string
574  end do
575  !
576  ! -- update counter
577  nvalues_astr = nvalues_astr + isize
578  !
579  ! -- allocate memory type
580  allocate (mt)
581  !
582  ! -- set memory type
583  mt%acharstr1d => acharstr1d
584  mt%element_size = ilen
585  mt%isize = isize
586  mt%name = name
587  mt%path = mem_path
588  write (mt%memtype, "(a,' LEN=',i0,' (',i0,')')") 'STRING', ilen, nrow
589  !
590  ! -- add deferred length character array to the memory manager list
591  call memorylist%add(mt)
592  !
593  ! -- return
594  return
Here is the call graph for this function:

◆ allocate_dbl()

subroutine memorymanagermodule::mem_allocate::allocate_dbl ( real(dp), intent(inout), pointer  sclr,
character(len=*), intent(in)  name,
character(len=*), intent(in)  mem_path 
)
private
Parameters
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 781 of file MemoryManager.f90.

782  real(DP), pointer, intent(inout) :: sclr !< variable for allocation
783  character(len=*), intent(in) :: name !< variable name
784  character(len=*), intent(in) :: mem_path !< path where variable is stored
785  ! -- local
786  type(MemoryType), pointer :: mt
787  integer(I4B) :: istat
788  ! -- code
789  !
790  ! -- check variable name length
791  call mem_check_length(name, lenvarname, "variable")
792  !
793  ! -- allocate real scalar
794  allocate (sclr, stat=istat, errmsg=errmsg)
795  if (istat /= 0) then
796  call allocate_error(name, mem_path, istat, 1)
797  end if
798  !
799  ! -- update counter
800  nvalues_aint = nvalues_aint + 1
801  !
802  ! -- allocate memory type
803  allocate (mt)
804  !
805  ! -- set memory type
806  mt%dblsclr => sclr
807  mt%element_size = dp
808  mt%isize = 1
809  mt%name = name
810  mt%path = mem_path
811  write (mt%memtype, "(a)") 'DOUBLE'
812  !
813  ! -- add memory type to the memory list
814  call memorylist%add(mt)
815  !
816  ! -- return
817  return
Here is the call graph for this function:

◆ allocate_dbl1d()

subroutine memorymanagermodule::mem_allocate::allocate_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]adblvariable for allocation
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 822 of file MemoryManager.f90.

823  real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< variable for allocation
824  integer(I4B), intent(in) :: nrow !< number of rows
825  character(len=*), intent(in) :: name !< variable name
826  character(len=*), intent(in) :: mem_path !< path where variable is stored
827  ! -- local
828  type(MemoryType), pointer :: mt
829  integer(I4B) :: istat
830  integer(I4B) :: isize
831  ! -- code
832  !
833  ! -- check the variable name length
834  call mem_check_length(name, lenvarname, "variable")
835  !
836  ! -- set isize
837  isize = nrow
838  !
839  ! -- allocate the real array
840  allocate (adbl(nrow), stat=istat, errmsg=errmsg)
841  if (istat /= 0) then
842  call allocate_error(name, mem_path, istat, isize)
843  end if
844  !
845  ! -- update counter
846  nvalues_adbl = nvalues_adbl + isize
847  !
848  ! -- allocate memory type
849  allocate (mt)
850  !
851  ! -- set memory type
852  mt%adbl1d => adbl
853  mt%element_size = dp
854  mt%isize = isize
855  mt%name = name
856  mt%path = mem_path
857  write (mt%memtype, "(a,' (',i0,')')") 'DOUBLE', isize
858  !
859  ! -- add memory type to the memory list
860  call memorylist%add(mt)
861  !
862  ! -- return
863  return
Here is the call graph for this function:

◆ allocate_dbl2d()

subroutine memorymanagermodule::mem_allocate::allocate_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]adblvariable for allocation
[in]ncolnumber of columns
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 868 of file MemoryManager.f90.

869  real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl !< variable for allocation
870  integer(I4B), intent(in) :: ncol !< number of columns
871  integer(I4B), intent(in) :: nrow !< number of rows
872  character(len=*), intent(in) :: name !< variable name
873  character(len=*), intent(in) :: mem_path !< path where variable is stored
874  ! -- local
875  type(MemoryType), pointer :: mt
876  integer(I4B) :: istat
877  integer(I4B) :: isize
878  ! -- code
879  !
880  ! -- check the variable name length
881  call mem_check_length(name, lenvarname, "variable")
882  !
883  ! -- set isize
884  isize = ncol * nrow
885  !
886  ! -- allocate the real array
887  allocate (adbl(ncol, nrow), stat=istat, errmsg=errmsg)
888  if (istat /= 0) then
889  call allocate_error(name, mem_path, istat, isize)
890  end if
891  !
892  ! -- update counter
893  nvalues_adbl = nvalues_adbl + isize
894  !
895  ! -- allocate memory type
896  allocate (mt)
897  !
898  ! -- set memory type
899  mt%adbl2d => adbl
900  mt%element_size = dp
901  mt%isize = isize
902  mt%name = name
903  mt%path = mem_path
904  write (mt%memtype, "(a,' (',i0,',',i0,')')") 'DOUBLE', ncol, nrow
905  !
906  ! -- add memory type to the memory list
907  call memorylist%add(mt)
908  !
909  ! -- return
910  return
Here is the call graph for this function:

◆ allocate_dbl3d()

subroutine memorymanagermodule::mem_allocate::allocate_dbl3d ( real(dp), dimension(:, :, :), intent(inout), pointer, contiguous  adbl,
integer(i4b), intent(in)  ncol,
integer(i4b), intent(in)  nrow,
integer(i4b), intent(in)  nlay,
character(len=*), intent(in)  name,
character(len=*), intent(in)  mem_path 
)
private
Parameters
[in,out]adblvariable for allocation
[in]ncolnumber of columns
[in]nrownumber of rows
[in]nlaynumber of layers
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 915 of file MemoryManager.f90.

916  real(DP), dimension(:, :, :), pointer, contiguous, intent(inout) :: adbl !< variable for allocation
917  integer(I4B), intent(in) :: ncol !< number of columns
918  integer(I4B), intent(in) :: nrow !< number of rows
919  integer(I4B), intent(in) :: nlay !< number of layers
920  character(len=*), intent(in) :: name !< variable name
921  character(len=*), intent(in) :: mem_path !< path where variable is stored
922  ! -- local
923  type(MemoryType), pointer :: mt
924  integer(I4B) :: istat
925  integer(I4B) :: isize
926  ! -- code
927  !
928  ! -- check the variable name length
929  call mem_check_length(name, lenvarname, "variable")
930  !
931  ! -- set isize
932  isize = ncol * nrow * nlay
933  !
934  ! -- allocate the real array
935  allocate (adbl(ncol, nrow, nlay), stat=istat, errmsg=errmsg)
936  if (istat /= 0) then
937  call allocate_error(name, mem_path, istat, isize)
938  end if
939  !
940  ! -- update the counter
941  nvalues_adbl = nvalues_adbl + isize
942  !
943  ! -- allocate memory type
944  allocate (mt)
945  !
946  ! -- set memory type
947  mt%adbl3d => adbl
948  mt%element_size = dp
949  mt%isize = isize
950  mt%name = name
951  mt%path = mem_path
952  write (mt%memtype, "(a,' (',i0,',',i0,',',i0,')')") 'DOUBLE', ncol, &
953  nrow, nlay
954  !
955  ! -- add memory type to the memory list
956  call memorylist%add(mt)
957  !
958  ! -- return
959  return
Here is the call graph for this function:

◆ allocate_int()

subroutine memorymanagermodule::mem_allocate::allocate_int ( integer(i4b), intent(inout), pointer  sclr,
character(len=*), intent(in)  name,
character(len=*), intent(in)  mem_path 
)
private
Parameters
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 599 of file MemoryManager.f90.

600  integer(I4B), pointer, intent(inout) :: sclr !< variable for allocation
601  character(len=*), intent(in) :: name !< variable name
602  character(len=*), intent(in) :: mem_path !< path where the variable is stored
603  ! -- local
604  type(MemoryType), pointer :: mt
605  integer(I4B) :: istat
606  ! -- code
607  !
608  ! -- check variable name length
609  call mem_check_length(name, lenvarname, "variable")
610  !
611  ! -- allocate integer scalar
612  allocate (sclr, stat=istat, errmsg=errmsg)
613  if (istat /= 0) then
614  call allocate_error(name, mem_path, istat, 1)
615  end if
616  !
617  ! -- update counter
618  nvalues_aint = nvalues_aint + 1
619  !
620  ! -- allocate memory type
621  allocate (mt)
622  !
623  ! -- set memory type
624  mt%intsclr => sclr
625  mt%element_size = i4b
626  mt%isize = 1
627  mt%name = name
628  mt%path = mem_path
629  write (mt%memtype, "(a)") 'INTEGER'
630  !
631  ! -- add memory type to the memory list
632  call memorylist%add(mt)
633  !
634  ! -- return
635  return
Here is the call graph for this function:

◆ allocate_int1d()

subroutine memorymanagermodule::mem_allocate::allocate_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]aintvariable for allocation
[in]nrowinteger array number of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 640 of file MemoryManager.f90.

641  integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< variable for allocation
642  integer(I4B), intent(in) :: nrow !< integer array number of rows
643  character(len=*), intent(in) :: name !< variable name
644  character(len=*), intent(in) :: mem_path !< path where variable is stored
645  ! --local
646  type(MemoryType), pointer :: mt
647  integer(I4B) :: istat
648  integer(I4B) :: isize
649  ! -- code
650  !
651  ! -- check variable name length
652  call mem_check_length(name, lenvarname, "variable")
653  !
654  ! -- set isize
655  isize = nrow
656  !
657  ! -- allocate integer array
658  allocate (aint(nrow), stat=istat, errmsg=errmsg)
659  if (istat /= 0) then
660  call allocate_error(name, mem_path, istat, isize)
661  end if
662  !
663  ! -- update counter
664  nvalues_aint = nvalues_aint + isize
665  !
666  ! -- allocate memory type
667  allocate (mt)
668  !
669  ! -- set memory type
670  mt%aint1d => aint
671  mt%element_size = i4b
672  mt%isize = isize
673  mt%name = name
674  mt%path = mem_path
675  write (mt%memtype, "(a,' (',i0,')')") 'INTEGER', isize
676  !
677  ! -- add memory type to the memory list
678  call memorylist%add(mt)
679  !
680  ! -- return
681  return
Here is the call graph for this function:

◆ allocate_int2d()

subroutine memorymanagermodule::mem_allocate::allocate_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]aintvariable for allocation
[in]ncolnumber of columns
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 686 of file MemoryManager.f90.

687  integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< variable for allocation
688  integer(I4B), intent(in) :: ncol !< number of columns
689  integer(I4B), intent(in) :: nrow !< number of rows
690  character(len=*), intent(in) :: name !< variable name
691  character(len=*), intent(in) :: mem_path !< path where variable is stored
692  ! -- local
693  type(MemoryType), pointer :: mt
694  integer(I4B) :: istat
695  integer(I4B) :: isize
696  ! -- code
697  !
698  ! -- check the variable name length
699  call mem_check_length(name, lenvarname, "variable")
700  !
701  ! -- set isize
702  isize = ncol * nrow
703  !
704  ! -- allocate the integer array
705  allocate (aint(ncol, nrow), stat=istat, errmsg=errmsg)
706  if (istat /= 0) then
707  call allocate_error(name, mem_path, istat, isize)
708  end if
709  !
710  ! -- update the counter
711  nvalues_aint = nvalues_aint + isize
712  !
713  ! -- allocate memory type
714  allocate (mt)
715  !
716  ! -- set memory type
717  mt%aint2d => aint
718  mt%element_size = i4b
719  mt%isize = isize
720  mt%name = name
721  mt%path = mem_path
722  write (mt%memtype, "(a,' (',i0,',',i0,')')") 'INTEGER', ncol, nrow
723  !
724  ! -- add memory type to the memory list
725  call memorylist%add(mt)
726  !
727  ! -- return
Here is the call graph for this function:

◆ allocate_int3d()

subroutine memorymanagermodule::mem_allocate::allocate_int3d ( integer(i4b), dimension(:, :, :), intent(inout), pointer, contiguous  aint,
integer(i4b), intent(in)  ncol,
integer(i4b), intent(in)  nrow,
integer(i4b), intent(in)  nlay,
character(len=*), intent(in)  name,
character(len=*), intent(in)  mem_path 
)
private
Parameters
[in,out]aintvariable for allocation
[in]ncolnumber of columns
[in]nrownumber of rows
[in]nlaynumber of layers
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 732 of file MemoryManager.f90.

733  integer(I4B), dimension(:, :, :), pointer, contiguous, intent(inout) :: aint !< variable for allocation
734  integer(I4B), intent(in) :: ncol !< number of columns
735  integer(I4B), intent(in) :: nrow !< number of rows
736  integer(I4B), intent(in) :: nlay !< number of layers
737  character(len=*), intent(in) :: name !< variable name
738  character(len=*), intent(in) :: mem_path !< path where variable is stored
739  ! -- local
740  type(MemoryType), pointer :: mt
741  integer(I4B) :: istat
742  integer(I4B) :: isize
743  ! -- code
744  !
745  ! -- check variable name length
746  call mem_check_length(name, lenvarname, "variable")
747  !
748  ! -- set isize
749  isize = ncol * nrow * nlay
750  !
751  ! -- allocate integer array
752  allocate (aint(ncol, nrow, nlay), stat=istat, errmsg=errmsg)
753  if (istat /= 0) then
754  call allocate_error(name, mem_path, istat, isize)
755  end if
756  !
757  ! -- update counter
758  nvalues_aint = nvalues_aint + isize
759  !
760  ! -- allocate memory type
761  allocate (mt)
762  !
763  ! -- set memory type
764  mt%aint3d => aint
765  mt%element_size = i4b
766  mt%isize = isize
767  mt%name = name
768  mt%path = mem_path
769  write (mt%memtype, "(a,' (',i0,',',i0,',',i0,')')") 'INTEGER', ncol, &
770  nrow, nlay
771  !
772  ! -- add memory type to the memory list
773  call memorylist%add(mt)
774  !
775  ! -- return
776  return
Here is the call graph for this function:

◆ allocate_logical()

subroutine memorymanagermodule::mem_allocate::allocate_logical ( logical(lgp), intent(inout), pointer  sclr,
character(len=*), intent(in)  name,
character(len=*), intent(in)  mem_path 
)
private
Parameters
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 377 of file MemoryManager.f90.

378  logical(LGP), pointer, intent(inout) :: sclr !< variable for allocation
379  character(len=*), intent(in) :: name !< variable name
380  character(len=*), intent(in) :: mem_path !< path where the variable is stored
381  ! -- local
382  integer(I4B) :: istat
383  type(MemoryType), pointer :: mt
384  ! -- code
385  !
386  ! -- check variable name length
387  call mem_check_length(name, lenvarname, "variable")
388  !
389  ! -- allocate the logical scalar
390  allocate (sclr, stat=istat, errmsg=errmsg)
391  if (istat /= 0) then
392  call allocate_error(name, mem_path, istat, 1)
393  end if
394  !
395  ! -- update counter
396  nvalues_alogical = nvalues_alogical + 1
397  !
398  ! -- allocate memory type
399  allocate (mt)
400  !
401  ! -- set memory type
402  mt%logicalsclr => sclr
403  mt%element_size = lgp
404  mt%isize = 1
405  mt%name = name
406  mt%path = mem_path
407  write (mt%memtype, "(a)") 'LOGICAL'
408  !
409  ! -- add memory type to the memory list
410  call memorylist%add(mt)
411  !
412  ! -- return
413  return
Here is the call graph for this function:

◆ allocate_str()

subroutine memorymanagermodule::mem_allocate::allocate_str ( character(len=ilen), intent(inout), pointer  sclr,
integer(i4b), intent(in)  ilen,
character(len=*), intent(in)  name,
character(len=*), intent(in)  mem_path 
)
private
Parameters
[in]ilenstring length
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 418 of file MemoryManager.f90.

419  integer(I4B), intent(in) :: ilen !< string length
420  character(len=ilen), pointer, intent(inout) :: sclr !< variable for allocation
421  character(len=*), intent(in) :: name !< variable name
422  character(len=*), intent(in) :: mem_path !< path where the variable is stored
423  ! -- local
424  integer(I4B) :: istat
425  type(MemoryType), pointer :: mt
426  ! -- format
427  ! -- code
428  !
429  ! -- make sure ilen is greater than 0
430  if (ilen < 1) then
431  errmsg = 'Programming error in allocate_str. ILEN must be greater than 0.'
432  call store_error(errmsg, terminate=.true.)
433  end if
434  !
435  ! -- check variable name length
436  call mem_check_length(name, lenvarname, "variable")
437  !
438  ! -- allocate string
439  allocate (character(len=ilen) :: sclr, stat=istat, errmsg=errmsg)
440  if (istat /= 0) then
441  call allocate_error(name, mem_path, istat, 1)
442  end if
443  !
444  ! -- set sclr to a empty string
445  sclr = ' '
446  !
447  ! -- update counter
448  nvalues_astr = nvalues_astr + ilen
449  !
450  ! -- allocate memory type
451  allocate (mt)
452  !
453  ! -- set memory type
454  mt%strsclr => sclr
455  mt%element_size = ilen
456  mt%isize = 1
457  mt%name = name
458  mt%path = mem_path
459  write (mt%memtype, "(a,' LEN=',i0)") 'STRING', ilen
460  !
461  ! -- add defined length string to the memory manager list
462  call memorylist%add(mt)
463  !
464  ! -- return
465  return
Here is the call graph for this function:

◆ allocate_str1d()

subroutine memorymanagermodule::mem_allocate::allocate_str1d ( character(len=ilen), dimension(:), intent(inout), pointer, contiguous  astr1d,
integer(i4b), intent(in)  ilen,
integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  name,
character(len=*), intent(in)  mem_path 
)
private
Parameters
[in]ilenstring length
[in,out]astr1dvariable for allocation
[in]nrownumber of strings in array
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 470 of file MemoryManager.f90.

471  integer(I4B), intent(in) :: ilen !< string length
472  character(len=ilen), dimension(:), &
473  pointer, contiguous, intent(inout) :: astr1d !< variable for allocation
474  integer(I4B), intent(in) :: nrow !< number of strings in array
475  character(len=*), intent(in) :: name !< variable name
476  character(len=*), intent(in) :: mem_path !< path where the variable is stored
477  ! -- local variables
478  type(MemoryType), pointer :: mt
479  character(len=ilen) :: string
480  integer(I4B) :: n
481  integer(I4B) :: istat
482  integer(I4B) :: isize
483  ! -- code
484  !
485  ! -- initialize string
486  string = ''
487  !
488  ! -- make sure ilen is greater than 0
489  if (ilen < 1) then
490  errmsg = 'Programming error in allocate_str1d. '// &
491  'ILEN must be greater than 0.'
492  call store_error(errmsg, terminate=.true.)
493  end if
494  !
495  ! -- check variable name length
496  call mem_check_length(name, lenvarname, "variable")
497  !
498  ! -- calculate isize
499  isize = nrow
500  !
501  ! -- allocate defined length string array
502  allocate (character(len=ilen) :: astr1d(nrow), stat=istat, errmsg=errmsg)
503  !
504  ! -- check for error condition
505  if (istat /= 0) then
506  call allocate_error(name, mem_path, istat, isize)
507  end if
508  !
509  ! -- fill deferred length string with empty string
510  do n = 1, nrow
511  astr1d(n) = string
512  end do
513  !
514  ! -- update counter
515  nvalues_astr = nvalues_astr + isize
516  !
517  ! -- allocate memory type
518  allocate (mt)
519  !
520  ! -- set memory type
521  ! this does not work with gfortran 11.3 and 12.1
522  ! so we have to disable the pointing to astr1d
523  ! mt%astr1d => astr1d
524  mt%element_size = ilen
525  mt%isize = isize
526  mt%name = name
527  mt%path = mem_path
528  write (mt%memtype, "(a,' LEN=',i0,' (',i0,')')") 'STRING', ilen, nrow
529  !
530  ! -- add deferred length character array to the memory manager list
531  call memorylist%add(mt)
532  !
533  ! -- return
534  return
Here is the call graph for this function:

The documentation for this interface was generated from the following file: