101 class(VirtualTspExchangeType) :: this
102 integer(I4B) :: stage
103
104 integer(I4B) :: nexg, nmax
105
106
107 call this%VirtualExchangeType%prepare_stage(stage)
108
109 if (stage == stg_aft_exg_df) then
110
111
112 call this%map(this%inmvt%base(), (/stg_aft_exg_df/))
113
114 else if (stage == stg_aft_con_cr) then
115
116
117 if (this%inmvt%get() > 0) then
118 this%has_mvt = .true.
119 end if
120
121 else if (stage == stg_bfr_con_ar) then
122
123 nexg = this%nexg%get()
124 call this%map(this%gwfsimvals%base(), nexg, (/stg_bfr_exg_ad/))
125
126
127 if (this%has_mvt .and. this%is_local) then
128 call this%map(this%mvt_maxmvt%base(), (/stg_bfr_con_ar/))
129 end if
130
131 else if (stage == stg_bfr_exg_ad) then
132
133
134 nmax = 0
135 if (this%has_mvt .and. this%is_local) nmax = this%mvt_maxmvt%get()
136
137
138 if (.not. this%quantities_mapped) then
139 if (nmax > 0) then
140 call this%map(this%mvt_quantity_m1%base(), nmax, (/stg_bfr_exg_fc/))
141 call this%map(this%mvt_quantity_m2%base(), nmax, (/stg_bfr_exg_fc/))
142 else
143 call this%map(this%mvt_quantity_m1%base(), 0, (/stg_never/))
144 call this%map(this%mvt_quantity_m2%base(), 0, (/stg_never/))
145 end if
146 this%quantities_mapped = .true.
147 end if
148 end if
149