Skip to content

Commit

Permalink
Add assert
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldouglas92 committed Feb 24, 2024
1 parent 04ec178 commit fa3687d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ namespace WorldBuilder
subducting_velocities,
ridge_spreading_velocities.first);

const double km2m = 1.0e3; // 1000 m/km
const double cm2m = 100; // 100 cm/m
const double my = 1.0e6; // 1e6 y/my
constexpr double km2m = 1.0e3; // 1000 m/km
constexpr double cm2m = 100; // 100 cm/m
constexpr double my = 1.0e6; // 1e6 y/my

/* information about nearest point on the slab segment */
const double distance_along_plane = distance_from_planes.distance_along_plane;
Expand Down
3 changes: 2 additions & 1 deletion source/world_builder/utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,8 @@ namespace WorldBuilder

// Plate age increases with distance along the slab in the mantle
double effective_plate_age = plate_age_sec + (distance_along_plane / subducting_velocity + effective_age_shift) * seconds_in_year; // m/(m/y) = y(seconds_in_year)

WBAssertThrow(effective_plate_age >= 0, "The age of the subducting plate is less than or equal to 0. "
"Effective plate age: " << effective_plate_age);
std::vector<double> result;
result.push_back(age_at_trench);
result.push_back(effective_plate_age);
Expand Down

0 comments on commit fa3687d

Please sign in to comment.