diff --git a/WindStressPRM/WindStressPRM.cs b/WindStressPRM/WindStressPRM.cs index a9947ee4054b4cd5d8cc4df051868ab976f797aa..8538d20a1c61b4f5a2231d70f0a090cee6445582 100644 --- a/WindStressPRM/WindStressPRM.cs +++ b/WindStressPRM/WindStressPRM.cs @@ -284,13 +284,15 @@ namespace WindStressPRM Coordinate firstCoordinate = Input.ClimateCells.Origin; Index lastIndex = new Index( Input.ClimateCells.RowsCount() - 1, Input.ClimateCells.ColumnCount() - 1); Coordinate lastCoordinate = Input.ClimateCells.CellToProjection(lastIndex); - for (double x = firstCoordinate.X; x <= lastCoordinate.X; - x += Math.Sign(lastCoordinate.X - firstCoordinate.X)*Input.Distance35kVCheck) + double x = firstCoordinate.X; + double y = firstCoordinate.Y; + while (Math.Sign(lastCoordinate.X - firstCoordinate.X) * (lastCoordinate.X - x) >= 0) { - for (double y = firstCoordinate.Y; y <= lastCoordinate.Y; - y += Math.Sign(lastCoordinate.Y - firstCoordinate.Y) * Input.Distance35kVCheck) + while (Math.Sign(lastCoordinate.Y - firstCoordinate.Y) * (lastCoordinate.Y - y) >= 0) { Coordinate current = new Coordinate(x, y); + y += Math.Sign(lastCoordinate.Y - firstCoordinate.Y) * Input.Distance35kVCheck; + double wind = interpol<ClimateCell>(current, Input.ClimateCells, delegate(ClimateCell cell) { return cell.Wind10; }); double u = interpol<PrognosticCell>(current, Input.PrognosticCells, delegate(PrognosticCell cell) { return cell.VelocityX; }); double v = interpol<PrognosticCell>(current, Input.PrognosticCells, delegate(PrognosticCell cell) { return cell.VelocityY; }); @@ -306,6 +308,7 @@ namespace WindStressPRM list.Add(current); } } + x += Math.Sign(lastCoordinate.X - firstCoordinate.X) * Input.Distance35kVCheck; } return list; }