@@ -126,7 +126,6 @@ def route_all_sand_parcels(self) -> None:
126126
127127 _msg = "Supplying model state to SandRouter for iteration"
128128 self .log_info (_msg , verbosity = 2 )
129-
130129 self ._sr .run (
131130 start_indices ,
132131 self .eta ,
@@ -691,13 +690,14 @@ def run(
691690 self .qx = qx
692691 self .qy = qy
693692 self .qs = qs
693+ _shape = self .eta .shape
694694
695695 num_starts = start_indices .shape [0 ]
696696 for np_sed in range (num_starts ):
697697 self .Vp_res = self .Vp_sed
698698
699- px = 0
700- py = start_indices [np_sed ]
699+ # get initial location based on flat index
700+ px , py = shared_tools . custom_unravel ( start_indices [np_sed ], _shape )
701701
702702 self .qs [px , py ] = self .qs [px , py ] + self .Vp_res / 2.0 / self ._dt / self ._dx
703703 self ._route_one_parcel (px , py )
@@ -912,13 +912,14 @@ def run(
912912 self .qw = qw
913913 self .qx = qx
914914 self .qy = qy
915+ _shape = self .eta .shape
915916
916917 num_starts = start_indices .shape [0 ]
917918 for np_sed in range (num_starts ):
918919 self .Vp_res = self .Vp_sed
919920
920- px = 0
921- py = start_indices [np_sed ]
921+ # get initial location based on flat index
922+ px , py = shared_tools . custom_unravel ( start_indices [np_sed ], _shape )
922923
923924 self ._route_one_parcel (px , py )
924925
0 commit comments