@@ -645,9 +645,11 @@ void core::config_forcing(pt::ptree &value)
645
645
}
646
646
647
647
648
- auto f = output_folder_path / std::format (" stations_{}.vtp" , _comm_world.rank ());
649
- _metdata->write_stations_to_ptv (f.string ());
650
- _metdata->write_stations_to_shp ((output_folder_path / std::format (" stations_{}.shp" ,_comm_world.rank ())).string ());
648
+ boost::filesystem::create_directories (output_folder_path / " forcing" );
649
+
650
+ auto f = output_folder_path / " forcing" / std::format (" stations_{}." , _comm_world.rank ());
651
+ _metdata->write_stations_to_ptv (f.string () + " vtp" );
652
+ _metdata->write_stations_to_shp (f.string () + " shp" );
651
653
652
654
SPDLOG_DEBUG (" Finished reading stations. Took {} s" , c.toc <s>());
653
655
@@ -1507,9 +1509,6 @@ void core::init(int argc, char **argv)
1507
1509
1508
1510
// Now the forcing and mesh are loaded, assign each face the station lists
1509
1511
populate_face_station_lists ();
1510
- // TODO: double check this but we now prune the station list on load to the mesh extent which is MPI aware
1511
- // so we should be fine to fully remove this
1512
- // populate_distributed_station_lists();
1513
1512
1514
1513
// load the parameters now that the station list has been pruned and we have a partitioned mesh
1515
1514
if ( ispart)
@@ -2180,6 +2179,14 @@ void core::run()
2180
2179
// We can do this _once_ without incrementing the internal iterators
2181
2180
_metdata->next ();
2182
2181
2182
+ // even though we have already done this once in core::init, if the calling next() above resulted in a load
2183
+ // of a new nc on the first time step, e.g., we had to load 2 netcdf to get to the first timestep
2184
+ // we need to re build the face-station mapping as loading a new netcdf will invalidate all our stations
2185
+ // TODO: this should probably be moved into metdata, and modules need to know about this to rebuild their
2186
+ // interp structs
2187
+ if (_metdata->is_multipart_nc () && _metdata->nc_just_loaded ())
2188
+ populate_face_station_lists ();
2189
+
2183
2190
SPDLOG_DEBUG (" Starting model run" );
2184
2191
2185
2192
c.tic ();
0 commit comments