MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
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

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)
 

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 64 of file CharString.f90.

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

◆ assign_to_charstring()

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

Definition at line 45 of file CharString.f90.

46  class(CharacterStringType), intent(out) :: lhs
47  character(len=*), intent(in) :: rhs
48  logical :: allocate_charstring
49  allocate_charstring = .false.
50  if (allocated(lhs%charstring)) then
51  if (len(lhs%charstring) <= len(rhs)) then
52  lhs%charstring(:) = rhs
53  else
54  allocate_charstring = .true.
55  end if
56  else
57  allocate_charstring = .true.
58  end if
59  if (allocate_charstring) then
60  lhs%charstring = rhs
61  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 74 of file CharString.f90.

75  character(len=*), intent(in) :: lhs
76  class(CharacterStringType), intent(in) :: rhs
77  logical :: equals
78  if (allocated(rhs%charstring)) then
79  equals = lhs == rhs%charstring
80  else
81  equals = lhs == ''
82  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 85 of file CharString.f90.

86  class(CharacterStringType), intent(in) :: lhs
87  character(len=*), intent(in) :: rhs
88  logical :: equals
89  if (allocated(lhs%charstring)) then
90  equals = lhs%charstring == rhs
91  else
92  equals = rhs == ''
93  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 96 of file CharString.f90.

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

◆ strlen()

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

Definition at line 119 of file CharString.f90.

120  class(CharacterStringType), intent(in) :: this
121  integer :: length
122 
123  if (allocated(this%charstring)) then
124  length = len(this%charstring)
125  else
126  length = 0
127  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 108 of file CharString.f90.

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