MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
memorymanagermodule::mem_allocate Interface Reference
Collaboration diagram for memorymanagermodule::mem_allocate:
Collaboration graph

Public Member Functions

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

Detailed Description

Definition at line 55 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 )
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 556 of file MemoryManager.f90.

557 type(CharacterStringType), dimension(:), &
558 pointer, contiguous, intent(inout) :: acharstr1d !< variable for allocation
559 integer(I4B), intent(in) :: ilen !< string length
560 integer(I4B), intent(in) :: nrow !< number of strings in array
561 character(len=*), intent(in) :: name !< variable name
562 character(len=*), intent(in) :: mem_path !< path where the variable is stored
563 ! -- local variables
564 character(len=ilen) :: string
565 type(MemoryType), pointer :: mt
566 integer(I4B) :: n
567 integer(I4B) :: istat
568 integer(I4B) :: isize
569 ! -- code
570 !
571 ! -- initialize string
572 string = ''
573 !
574 ! -- check variable name length
575 call mem_check_length(name, lenvarname, "variable")
576 !
577 ! -- calculate isize
578 isize = nrow
579 !
580 ! -- allocate deferred length string array
581 allocate (acharstr1d(nrow), stat=istat, errmsg=errmsg)
582 !
583 ! -- check for error condition
584 if (istat /= 0) then
585 call allocate_error(name, mem_path, istat, isize)
586 end if
587 !
588 ! -- fill deferred length string with empty string
589 do n = 1, nrow
590 acharstr1d(n) = string
591 end do
592 !
593 ! -- update counter
594 nvalues_astr = nvalues_astr + isize
595 !
596 ! -- allocate memory type
597 allocate (mt)
598 !
599 ! -- set memory type
600 mt%acharstr1d => acharstr1d
601 mt%element_size = ilen
602 mt%isize = isize
603 mt%name = name
604 mt%path = mem_path
605 write (mt%memtype, "(a,' LEN=',i0,' (',i0,')')") 'STRING', ilen, nrow
606 !
607 ! -- add deferred length character array to the memory manager list
608 call memorystore%add(mt)
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 )
Parameters
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 784 of file MemoryManager.f90.

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

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

910 real(DP), dimension(:, :, :), pointer, contiguous, intent(inout) :: adbl !< variable for allocation
911 integer(I4B), intent(in) :: ncol !< number of columns
912 integer(I4B), intent(in) :: nrow !< number of rows
913 integer(I4B), intent(in) :: nlay !< number of layers
914 character(len=*), intent(in) :: name !< variable name
915 character(len=*), intent(in) :: mem_path !< path where variable is stored
916 ! -- local
917 type(MemoryType), pointer :: mt
918 integer(I4B) :: istat
919 integer(I4B) :: isize
920 ! -- code
921 !
922 ! -- check the variable name length
923 call mem_check_length(name, lenvarname, "variable")
924 !
925 ! -- set isize
926 isize = ncol * nrow * nlay
927 !
928 ! -- allocate the real array
929 allocate (adbl(ncol, nrow, nlay), stat=istat, errmsg=errmsg)
930 if (istat /= 0) then
931 call allocate_error(name, mem_path, istat, isize)
932 end if
933 !
934 ! -- update the counter
935 nvalues_adbl = nvalues_adbl + isize
936 !
937 ! -- allocate memory type
938 allocate (mt)
939 !
940 ! -- set memory type
941 mt%adbl3d => adbl
942 mt%element_size = dp
943 mt%isize = isize
944 mt%name = name
945 mt%path = mem_path
946 write (mt%memtype, "(a,' (',i0,',',i0,',',i0,')')") 'DOUBLE', ncol, &
947 nrow, nlay
948 !
949 ! -- add memory type to the memory list
950 call memorystore%add(mt)
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 )
Parameters
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 613 of file MemoryManager.f90.

614 integer(I4B), pointer, intent(inout) :: sclr !< variable for allocation
615 character(len=*), intent(in) :: name !< variable name
616 character(len=*), intent(in) :: mem_path !< path where the variable is stored
617 ! -- local
618 type(MemoryType), pointer :: mt
619 integer(I4B) :: istat
620 ! -- code
621 !
622 ! -- check variable name length
623 call mem_check_length(name, lenvarname, "variable")
624 !
625 ! -- allocate integer scalar
626 allocate (sclr, stat=istat, errmsg=errmsg)
627 if (istat /= 0) then
628 call allocate_error(name, mem_path, istat, 1)
629 end if
630 !
631 ! -- update counter
632 nvalues_aint = nvalues_aint + 1
633 !
634 ! -- allocate memory type
635 allocate (mt)
636 !
637 ! -- set memory type
638 mt%intsclr => sclr
639 mt%element_size = i4b
640 mt%isize = 1
641 mt%name = name
642 mt%path = mem_path
643 write (mt%memtype, "(a)") 'INTEGER'
644 !
645 ! -- add memory type to the memory list
646 call memorystore%add(mt)
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 )
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 651 of file MemoryManager.f90.

652 integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< variable for allocation
653 integer(I4B), intent(in) :: nrow !< integer array number of rows
654 character(len=*), intent(in) :: name !< variable name
655 character(len=*), intent(in) :: mem_path !< path where variable is stored
656 ! --local
657 type(MemoryType), pointer :: mt
658 integer(I4B) :: istat
659 integer(I4B) :: isize
660 ! -- code
661 !
662 ! -- check variable name length
663 call mem_check_length(name, lenvarname, "variable")
664 !
665 ! -- set isize
666 isize = nrow
667 !
668 ! -- allocate integer array
669 allocate (aint(nrow), stat=istat, errmsg=errmsg)
670 if (istat /= 0) then
671 call allocate_error(name, mem_path, istat, isize)
672 end if
673 !
674 ! -- update counter
675 nvalues_aint = nvalues_aint + isize
676 !
677 ! -- allocate memory type
678 allocate (mt)
679 !
680 ! -- set memory type
681 mt%aint1d => aint
682 mt%element_size = i4b
683 mt%isize = isize
684 mt%name = name
685 mt%path = mem_path
686 write (mt%memtype, "(a,' (',i0,')')") 'INTEGER', isize
687 !
688 ! -- add memory type to the memory list
689 call memorystore%add(mt)
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 )
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 694 of file MemoryManager.f90.

695 integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< variable for allocation
696 integer(I4B), intent(in) :: ncol !< number of columns
697 integer(I4B), intent(in) :: nrow !< number of rows
698 character(len=*), intent(in) :: name !< variable name
699 character(len=*), intent(in) :: mem_path !< path where variable is stored
700 ! -- local
701 type(MemoryType), pointer :: mt
702 integer(I4B) :: istat
703 integer(I4B) :: isize
704 ! -- code
705 !
706 ! -- check the variable name length
707 call mem_check_length(name, lenvarname, "variable")
708 !
709 ! -- set isize
710 isize = ncol * nrow
711 !
712 ! -- allocate the integer array
713 allocate (aint(ncol, nrow), stat=istat, errmsg=errmsg)
714 if (istat /= 0) then
715 call allocate_error(name, mem_path, istat, isize)
716 end if
717 !
718 ! -- update the counter
719 nvalues_aint = nvalues_aint + isize
720 !
721 ! -- allocate memory type
722 allocate (mt)
723 !
724 ! -- set memory type
725 mt%aint2d => aint
726 mt%element_size = i4b
727 mt%isize = isize
728 mt%name = name
729 mt%path = mem_path
730 write (mt%memtype, "(a,' (',i0,',',i0,')')") 'INTEGER', ncol, nrow
731 !
732 ! -- add memory type to the memory list
733 call memorystore%add(mt)
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 )
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 738 of file MemoryManager.f90.

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

Definition at line 362 of file MemoryManager.f90.

363 logical(LGP), pointer, intent(inout) :: sclr !< variable for allocation
364 character(len=*), intent(in) :: name !< variable name
365 character(len=*), intent(in) :: mem_path !< path where the variable is stored
366 ! -- local
367 integer(I4B) :: istat
368 type(MemoryType), pointer :: mt
369 ! -- code
370 !
371 ! -- check variable name length
372 call mem_check_length(name, lenvarname, "variable")
373 !
374 ! -- allocate the logical scalar
375 allocate (sclr, stat=istat, errmsg=errmsg)
376 if (istat /= 0) then
377 call allocate_error(name, mem_path, istat, 1)
378 end if
379 !
380 ! -- update counter
381 nvalues_alogical = nvalues_alogical + 1
382 !
383 ! -- allocate memory type
384 allocate (mt)
385 !
386 ! -- set memory type
387 mt%logicalsclr => sclr
388 mt%element_size = lgp
389 mt%isize = 1
390 mt%name = name
391 mt%path = mem_path
392 write (mt%memtype, "(a)") 'LOGICAL'
393 !
394 ! -- add memory type to the memory list
395 call memorystore%add(mt)
Here is the call graph for this function:

◆ allocate_logical1d()

subroutine memorymanagermodule::mem_allocate::allocate_logical1d ( logical(lgp), dimension(:), intent(inout), pointer, contiguous alog,
integer(i4b), intent(in) nrow,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
Parameters
[in,out]alogvariable for allocation
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 400 of file MemoryManager.f90.

401 logical(LGP), dimension(:), pointer, contiguous, intent(inout) :: alog !< variable for allocation
402 integer(I4B), intent(in) :: nrow !< number of rows
403 character(len=*), intent(in) :: name !< variable name
404 character(len=*), intent(in) :: mem_path !< path where variable is stored
405 ! --local
406 type(MemoryType), pointer :: mt
407 integer(I4B) :: istat
408 integer(I4B) :: isize
409 ! -- code
410 !
411 ! -- check variable name length
412 call mem_check_length(name, lenvarname, "variable")
413 !
414 ! -- set isize
415 isize = nrow
416 !
417 ! -- allocate logical array
418 allocate (alog(nrow), stat=istat, errmsg=errmsg)
419 if (istat /= 0) then
420 call allocate_error(name, mem_path, istat, isize)
421 end if
422 !
423 ! -- update counter
424 nvalues_alogical = nvalues_alogical + isize
425 !
426 ! -- allocate memory type
427 allocate (mt)
428 !
429 ! -- set memory type
430 mt%alogical1d => alog
431 mt%element_size = lgp
432 mt%isize = isize
433 mt%name = name
434 mt%path = mem_path
435 write (mt%memtype, "(a,' (',i0,')')") 'LOGICAL', isize
436 !
437 ! -- add memory type to the memory list
438 call memorystore%add(mt)
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 )
Parameters
[in]ilenstring length
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 443 of file MemoryManager.f90.

444 integer(I4B), intent(in) :: ilen !< string length
445 character(len=ilen), pointer, intent(inout) :: sclr !< variable for allocation
446 character(len=*), intent(in) :: name !< variable name
447 character(len=*), intent(in) :: mem_path !< path where the variable is stored
448 ! -- local
449 integer(I4B) :: istat
450 type(MemoryType), pointer :: mt
451 ! -- format
452 ! -- code
453 !
454 ! -- make sure ilen is greater than 0
455 if (ilen < 1) then
456 errmsg = 'Programming error in allocate_str. ILEN must be greater than 0.'
457 call store_error(errmsg, terminate=.true.)
458 end if
459 !
460 ! -- check variable name length
461 call mem_check_length(name, lenvarname, "variable")
462 !
463 ! -- allocate string
464 allocate (character(len=ilen) :: sclr, stat=istat, errmsg=errmsg)
465 if (istat /= 0) then
466 call allocate_error(name, mem_path, istat, 1)
467 end if
468 !
469 ! -- set sclr to a empty string
470 sclr = ' '
471 !
472 ! -- update counter
473 nvalues_astr = nvalues_astr + ilen
474 !
475 ! -- allocate memory type
476 allocate (mt)
477 !
478 ! -- set memory type
479 mt%strsclr => sclr
480 mt%element_size = ilen
481 mt%isize = 1
482 mt%name = name
483 mt%path = mem_path
484 write (mt%memtype, "(a,' LEN=',i0)") 'STRING', ilen
485 !
486 ! -- add defined length string to the memory manager list
487 call memorystore%add(mt)
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 )
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 492 of file MemoryManager.f90.

493 integer(I4B), intent(in) :: ilen !< string length
494 character(len=ilen), dimension(:), &
495 pointer, contiguous, intent(inout) :: astr1d !< variable for allocation
496 integer(I4B), intent(in) :: nrow !< number of strings in array
497 character(len=*), intent(in) :: name !< variable name
498 character(len=*), intent(in) :: mem_path !< path where the variable is stored
499 ! -- local variables
500 type(MemoryType), pointer :: mt
501 character(len=ilen) :: string
502 integer(I4B) :: n
503 integer(I4B) :: istat
504 integer(I4B) :: isize
505 ! -- code
506 !
507 ! -- initialize string
508 string = ''
509 !
510 ! -- make sure ilen is greater than 0
511 if (ilen < 1) then
512 errmsg = 'Programming error in allocate_str1d. '// &
513 'ILEN must be greater than 0.'
514 call store_error(errmsg, terminate=.true.)
515 end if
516 !
517 ! -- check variable name length
518 call mem_check_length(name, lenvarname, "variable")
519 !
520 ! -- calculate isize
521 isize = nrow
522 !
523 ! -- allocate defined length string array
524 allocate (character(len=ilen) :: astr1d(nrow), stat=istat, errmsg=errmsg)
525 !
526 ! -- check for error condition
527 if (istat /= 0) then
528 call allocate_error(name, mem_path, istat, isize)
529 end if
530 !
531 ! -- fill deferred length string with empty string
532 do n = 1, nrow
533 astr1d(n) = string
534 end do
535 !
536 ! -- update counter
537 nvalues_astr = nvalues_astr + isize
538 !
539 ! -- allocate memory type
540 allocate (mt)
541 !
542 ! -- set memory type
543 mt%astr1d => astr1d
544 mt%element_size = ilen
545 mt%isize = isize
546 mt%name = name
547 mt%path = mem_path
548 write (mt%memtype, "(a,' LEN=',i0,' (',i0,')')") 'STRING', ilen, nrow
549 !
550 ! -- add deferred length character array to the memory manager list
551 call memorystore%add(mt)
Here is the call graph for this function:

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