MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
mappedmemorymodule Module Reference

Data Types

type  mappedmemorytype
 

Functions/Subroutines

subroutine sync (this)
 
logical(lgp) function skip_sync (this)
 
subroutine sync_int1d (this)
 Copy 1d integer array with map. More...
 
subroutine apply_sgn_int1d (this)
 
subroutine sync_dbl1d (this)
 Copy 1d double array with map. More...
 
subroutine apply_sgn_dbl1d (this)
 
subroutine sync_dbl2d (this)
 Copy 2d double array with map. More...
 
subroutine apply_sgn_dbl2d (this)
 
class(mappedmemorytype) function, pointer, public castasmappeddata (obj)
 

Function/Subroutine Documentation

◆ apply_sgn_dbl1d()

subroutine mappedmemorymodule::apply_sgn_dbl1d ( class(mappedmemorytype this)
private

Definition at line 142 of file MappedMemory.f90.

143  class(MappedMemoryType) :: this
144  ! local
145  integer(I4B) :: i
146 
147  if (this%copy_all) then
148  do i = 1, this%tgt%isize
149  this%tgt%adbl1d(i) = this%tgt%adbl1d(i) * this%sign(i)
150  end do
151  else
152  do i = 1, size(this%tgt_idx)
153  this%tgt%adbl1d(this%tgt_idx(i)) = this%tgt%adbl1d(this%tgt_idx(i)) * &
154  this%sign(i)
155  end do
156  end if
157 

◆ apply_sgn_dbl2d()

subroutine mappedmemorymodule::apply_sgn_dbl2d ( class(mappedmemorytype this)
private

Definition at line 191 of file MappedMemory.f90.

192  class(MappedMemoryType) :: this
193  ! local
194  integer(I4B) :: i, k
195 
196  if (this%copy_all) then
197  do i = 1, this%tgt%isize
198  do k = 1, size(this%src%adbl2d, dim=1)
199  this%tgt%adbl2d(k, i) = this%tgt%adbl2d(k, i) * this%sign(i)
200  end do
201  end do
202  else
203  do i = 1, size(this%tgt_idx)
204  do k = 1, size(this%src%adbl2d, dim=1)
205  this%tgt%adbl2d(k, this%tgt_idx(i)) = &
206  this%tgt%adbl2d(k, this%tgt_idx(i)) * this%sign(i)
207  end do
208  end do
209  end if
210 

◆ apply_sgn_int1d()

subroutine mappedmemorymodule::apply_sgn_int1d ( class(mappedmemorytype this)
private

Definition at line 100 of file MappedMemory.f90.

101  class(MappedMemoryType) :: this
102  ! local
103  integer(I4B) :: i
104 
105  if (this%copy_all) then
106  do i = 1, this%tgt%isize
107  this%tgt%aint1d(i) = this%tgt%aint1d(i) * this%sign(i)
108  end do
109  else
110  do i = 1, size(this%tgt_idx)
111  this%tgt%aint1d(this%tgt_idx(i)) = this%tgt%aint1d(this%tgt_idx(i)) * &
112  this%sign(i)
113  end do
114  end if
115 

◆ castasmappeddata()

class(mappedmemorytype) function, pointer, public mappedmemorymodule::castasmappeddata ( class(*), intent(inout), pointer  obj)

Definition at line 213 of file MappedMemory.f90.

214  implicit none
215  class(*), pointer, intent(inout) :: obj
216  class(MappedMemoryType), pointer :: res
217 
218  res => null()
219 
220  select type (obj)
221  class is (mappedmemorytype)
222  res => obj
223  end select
224 
Here is the caller graph for this function:

◆ skip_sync()

logical(lgp) function mappedmemorymodule::skip_sync ( class(mappedmemorytype this)
private

Definition at line 69 of file MappedMemory.f90.

70  class(MappedMemoryType) :: this
71  logical(LGP) :: skip
72 
73  skip = (this%src%isize == 0)
74 

◆ sync()

subroutine mappedmemorymodule::sync ( class(mappedmemorytype this)
private

Definition at line 44 of file MappedMemory.f90.

45  class(MappedMemoryType) :: this
46  ! local
47  logical(LGP) :: found
48 
49  if (.not. associated(this%src)) then
50  ! cache
51  call get_from_memorystore(this%src_name, this%src_path, this%src, found)
52  call get_from_memorystore(this%tgt_name, this%tgt_path, this%tgt, found)
53  end if
54 
55  if (this%skip_sync()) return
56 
57  if (associated(this%tgt%aint1d)) call this%sync_int1d()
58  if (associated(this%tgt%adbl1d)) call this%sync_dbl1d()
59  if (associated(this%tgt%adbl2d)) call this%sync_dbl2d()
60 
61  if (associated(this%sign)) then
62  if (associated(this%tgt%aint1d)) call this%apply_sgn_int1d()
63  if (associated(this%tgt%adbl1d)) call this%apply_sgn_dbl1d()
64  if (associated(this%tgt%adbl2d)) call this%apply_sgn_dbl2d()
65  end if
66 
Here is the call graph for this function:

◆ sync_dbl1d()

subroutine mappedmemorymodule::sync_dbl1d ( class(mappedmemorytype this)
private

Definition at line 120 of file MappedMemory.f90.

121  class(MappedMemoryType) :: this
122  ! local
123  integer(I4B) :: i
124 
125  if (this%copy_all) then
126  do i = 1, this%tgt%isize
127  this%tgt%adbl1d(i) = this%src%adbl1d(i)
128  end do
129  else if (associated(this%lut)) then
130  do i = 1, size(this%tgt_idx)
131  this%tgt%adbl1d(this%tgt_idx(i)) = &
132  this%src%adbl1d(this%lut(this%src_idx(i)))
133  end do
134  else
135  do i = 1, size(this%tgt_idx)
136  this%tgt%adbl1d(this%tgt_idx(i)) = this%src%adbl1d(this%src_idx(i))
137  end do
138  end if
139 

◆ sync_dbl2d()

subroutine mappedmemorymodule::sync_dbl2d ( class(mappedmemorytype this)
private

Definition at line 162 of file MappedMemory.f90.

163  class(MappedMemoryType) :: this
164  ! local
165  integer(I4B) :: i, k
166 
167  if (this%copy_all) then
168  do i = 1, this%tgt%isize
169  do k = 1, size(this%src%adbl2d, dim=1)
170  this%tgt%adbl2d(k, i) = this%src%adbl2d(k, i)
171  end do
172  end do
173  else if (associated(this%lut)) then
174  do i = 1, size(this%tgt_idx)
175  do k = 1, size(this%src%adbl2d, dim=1)
176  this%tgt%adbl2d(k, this%tgt_idx(i)) = &
177  this%src%adbl2d(k, this%lut(this%src_idx(i)))
178  end do
179  end do
180  else
181  do i = 1, size(this%tgt_idx)
182  do k = 1, size(this%src%adbl2d, dim=1)
183  this%tgt%adbl2d(k, this%tgt_idx(i)) = &
184  this%src%adbl2d(k, this%src_idx(i))
185  end do
186  end do
187  end if
188 

◆ sync_int1d()

subroutine mappedmemorymodule::sync_int1d ( class(mappedmemorytype this)
private

Definition at line 78 of file MappedMemory.f90.

79  class(MappedMemoryType) :: this
80  ! local
81  integer(I4B) :: i
82 
83  if (this%copy_all) then
84  do i = 1, this%tgt%isize
85  this%tgt%aint1d(i) = this%src%aint1d(i)
86  end do
87  else if (associated(this%lut)) then
88  do i = 1, size(this%tgt_idx)
89  this%tgt%aint1d(this%tgt_idx(i)) = &
90  this%src%aint1d(this%lut(this%src_idx(i)))
91  end do
92  else
93  do i = 1, size(this%tgt_idx)
94  this%tgt%aint1d(this%tgt_idx(i)) = this%src%aint1d(this%src_idx(i))
95  end do
96  end if
97