MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
characterstringmodule Module Reference

Data Types

type  characterstringtype
 This class is used to store a single deferred-length character string. It was designed to work in an array implementation so that a jagged character array could be used in MODFLOW and stored in the memory manager. More...
 

Functions/Subroutines

recursive subroutine assign_to_charstring (lhs, rhs)
 
subroutine assign_from_charstring (lhs, rhs)
 
elemental logical function character_eq_charstring (lhs, rhs)
 
elemental logical function charstring_eq_character (lhs, rhs)
 
elemental logical function charstring_eq_charstring (this, rhs)
 
subroutine write_unformatted (this, unit, iostat, iomsg)
 
integer function strlen (this)
 
subroutine destroy (this)
 

Function/Subroutine Documentation

◆ assign_from_charstring()

subroutine characterstringmodule::assign_from_charstring ( character(len=*), intent(out)  lhs,
class(characterstringtype), intent(in)  rhs 
)
private

Definition at line 65 of file CharString.f90.

66  character(len=*), intent(out) :: lhs
67  class(CharacterStringType), intent(in) :: rhs
68  if (allocated(rhs%charstring)) then
69  lhs = rhs%charstring
70  else
71  lhs = ''
72  end if
Here is the caller graph for this function:

◆ assign_to_charstring()

recursive subroutine characterstringmodule::assign_to_charstring ( class(characterstringtype), intent(out)  lhs,
character(len=*), intent(in)  rhs 
)
private

Definition at line 46 of file CharString.f90.

47  class(CharacterStringType), intent(out) :: lhs
48  character(len=*), intent(in) :: rhs
49  logical :: allocate_charstring
50  allocate_charstring = .false.
51  if (allocated(lhs%charstring)) then
52  if (len(lhs%charstring) <= len(rhs)) then
53  lhs%charstring(:) = rhs
54  else
55  allocate_charstring = .true.
56  end if
57  else
58  allocate_charstring = .true.
59  end if
60  if (allocate_charstring) then
61  lhs%charstring = rhs
62  end if
Here is the caller graph for this function:

◆ character_eq_charstring()

elemental logical function characterstringmodule::character_eq_charstring ( character(len=*), intent(in)  lhs,
class(characterstringtype), intent(in)  rhs 
)
private

Definition at line 75 of file CharString.f90.

76  character(len=*), intent(in) :: lhs
77  class(CharacterStringType), intent(in) :: rhs
78  logical :: equals
79  if (allocated(rhs%charstring)) then
80  equals = lhs == rhs%charstring
81  else
82  equals = lhs == ''
83  end if
Here is the caller graph for this function:

◆ charstring_eq_character()

elemental logical function characterstringmodule::charstring_eq_character ( class(characterstringtype), intent(in)  lhs,
character(len=*), intent(in)  rhs 
)
private

Definition at line 86 of file CharString.f90.

87  class(CharacterStringType), intent(in) :: lhs
88  character(len=*), intent(in) :: rhs
89  logical :: equals
90  if (allocated(lhs%charstring)) then
91  equals = lhs%charstring == rhs
92  else
93  equals = rhs == ''
94  end if
Here is the caller graph for this function:

◆ charstring_eq_charstring()

elemental logical function characterstringmodule::charstring_eq_charstring ( class(characterstringtype), intent(in)  this,
class(characterstringtype), intent(in)  rhs 
)
private

Definition at line 97 of file CharString.f90.

98  class(CharacterStringType), intent(in) :: this
99  class(CharacterStringType), intent(in) :: rhs
100  logical :: equals
101 
102  equals = .false.
103  if (allocated(this%charstring)) then
104  equals = (rhs == this%charstring)
105  end if
106 
Here is the caller graph for this function:

◆ destroy()

subroutine characterstringmodule::destroy ( class(characterstringtype), intent(inout)  this)
private

Definition at line 131 of file CharString.f90.

132  class(CharacterStringType), intent(inout) :: this
133  if (allocated(this%charstring)) deallocate (this%charstring)

◆ strlen()

integer function characterstringmodule::strlen ( class(characterstringtype), intent(in)  this)
private

Definition at line 120 of file CharString.f90.

121  class(CharacterStringType), intent(in) :: this
122  integer :: length
123 
124  if (allocated(this%charstring)) then
125  length = len(this%charstring)
126  else
127  length = 0
128  end if

◆ write_unformatted()

subroutine characterstringmodule::write_unformatted ( class(characterstringtype), intent(in)  this,
integer, intent(in)  unit,
integer, intent(out)  iostat,
character(len=*), intent(inout)  iomsg 
)
private

Definition at line 109 of file CharString.f90.

110  class(CharacterStringType), intent(in) :: this
111  integer, intent(in) :: unit
112  integer, intent(out) :: iostat
113  character(len=*), intent(inout) :: iomsg
114  iostat = 0
115  if (allocated(this%charstring)) then
116  write (unit, iostat=iostat) this%charstring
117  end if