Set values and pointers for mover object. pckMemPaths is an array of strings which are the memory paths for those packages. They are composed of model names and package names. The mover entries must be in pckMemPaths, or this routine will terminate with an error.
95
97
98 class(MvrType) :: this
99 integer(I4B), intent(in) :: inunit
100 character(len=LENMEMPATH), &
101 dimension(:), pointer, contiguous :: pckMemPaths
102 type(PackageMoverType), dimension(:), pointer, contiguous :: pakmovers
103
104 real(DP), dimension(:), pointer, contiguous :: temp_ptr => null()
105 logical :: found
106 integer(I4B) :: i
107 integer(I4B) :: ipakloc1, ipakloc2
108
109
110 if (this%mem_path_src == this%mem_path_tgt .and. &
111 this%iRchNrSrc == this%iRchNrTgt) then
112 call store_error(
'Provider and receiver are the same: '// &
113 trim(this%mem_path_src)//' : '//trim(this%mem_path_tgt))
115 end if
116
117
118
119 found = .false.
120 ipakloc1 = 0
121 do i = 1, size(pckmempaths)
122 if (this%mem_path_src == pckmempaths(i)) then
123 found = .true.
124 ipakloc1 = i
125 exit
126 end if
127 end do
128 if (.not. found) then
129 call store_error(
'Mover capability not activated in '//this%mem_path_src)
130 call store_error(
'Add "MOVER" keyword to package options block.')
131 end if
132 found = .false.
133 ipakloc2 = 0
134 do i = 1, size(pckmempaths)
135 if (this%mem_path_tgt == pckmempaths(i)) then
136 found = .true.
137 ipakloc2 = i
138 exit
139 end if
140 end do
141 if (.not. found) then
142 call store_error(
'Mover capability not activated in '//this%mem_path_tgt)
143 call store_error(
'Add "MOVER" keyword to package options block.')
144 end if
147 end if
148
149 if (this%is_provider_active) then
150
151
152 temp_ptr => pakmovers(ipakloc1)%qtomvr
153 if (this%iRchNrSrc < 1 .or. this%iRchNrSrc > size(temp_ptr)) then
154 call store_error(
'Provider ID < 1 or greater than package size ')
155 write (errmsg, '(a,i0,a,i0)') 'Provider ID = ', this%iRchNrSrc, &
156 '; Package size = ', size(temp_ptr)
159 end if
160 this%qtomvr_ptr => temp_ptr(this%iRchNrSrc)
161
162
163 temp_ptr => pakmovers(ipakloc1)%qformvr
164 this%qformvr_ptr => temp_ptr(this%iRchNrSrc)
165
166
167 temp_ptr => pakmovers(ipakloc1)%qtformvr
168 this%qtformvr_ptr => temp_ptr(this%iRchNrSrc)
169 end if
170
171 if (this%is_receiver_active) then
172
173
174 temp_ptr => pakmovers(ipakloc2)%qfrommvr
175 if (this%iRchNrTgt < 1 .or. this%iRchNrTgt > size(temp_ptr)) then
176 call store_error(
'Receiver ID < 1 or greater than package size ')
177 write (errmsg, '(a,i0,a,i0)') 'Receiver ID = ', this%iRchNrTgt, &
178 '; package size = ', size(temp_ptr)
181 end if
182 this%qfrommvr_ptr => temp_ptr(this%iRchNrTgt)
183 end if
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.