@@ -49,29 +49,16 @@ function OceananigansSimulation(area_fraction, start_date, stop_date; output_dir
49
49
download_dataset (ecco_temperature)
50
50
download_dataset (ecco_salinity)
51
51
52
- # Set up ocean grid (1 degree)
53
- resolution_points = (360 , 160 , 32 )
54
- Nz = last (resolution_points)
52
+ # Set up tripolar ocean grid (1 degree)
53
+ Nx = 360
54
+ Ny = 180
55
+ Nz = 40
55
56
depth = 4000 # meters
56
57
z = CO. ExponentialCoordinate (Nz, - depth; scale = 0.85 * depth)
57
58
58
- # Regular LatLong because we know how to do interpolation there
59
-
60
- # TODO : When moving to TripolarGrid, note that we need to be careful about
61
- # ensuring the coordinate systems align (ie, rotate vectors on the OC grid)
62
-
63
- underlying_grid = OC. LatitudeLongitudeGrid (
64
- arch;
65
- size = resolution_points,
66
- longitude = (- 180 , 180 ),
67
- latitude = (- 80 , 80 ), # NOTE: Don't goo to high up when using LatLongGrid, or the cells will be too small
68
- z,
69
- halo = (7 , 7 , 7 ),
70
- )
71
-
59
+ underlying_grid = OC. TripolarGrid (arch; size = (Nx, Ny, Nz), halo = (7 , 7 , 3 ), z)
72
60
bottom_height =
73
61
CO. regrid_bathymetry (underlying_grid; minimum_depth = 30 , interpolation_passes = 20 , major_basins = 1 )
74
-
75
62
grid = OC. ImmersedBoundaryGrid (underlying_grid, OC. GridFittedBottom (bottom_height); active_cells_map = true )
76
63
77
64
use_restoring = start_date + Dates. Month (1 ) < stop_date
@@ -95,17 +82,19 @@ function OceananigansSimulation(area_fraction, start_date, stop_date; output_dir
95
82
# Set initial condition to ECCO state estimate at start_date
96
83
OC. set! (ocean. model, T = ecco_temperature[1 ], S = ecco_salinity[1 ])
97
84
85
+ # Construct a remapper from the exchange grid to `Center, Center` fields
98
86
long_cc = OC. λnodes (grid, OC. Center (), OC. Center (), OC. Center ())
99
87
lat_cc = OC. φnodes (grid, OC. Center (), OC. Center (), OC. Center ())
100
88
101
- # TODO : Go from 0 to Nx+1, Ny+1 (for halos) (for LatLongGrid)
102
-
103
89
# Construct a remapper from the exchange grid to `Center, Center` fields
104
90
long_cc = reshape (long_cc, length (long_cc), 1 )
105
91
lat_cc = reshape (lat_cc, 1 , length (lat_cc))
106
92
target_points_cc = @. CC. Geometry. LatLongPoint (lat_cc, long_cc)
107
- # TODO : We can remove the `nothing` after CC > 0.14.33
108
- remapper_cc = CC. Remapping. Remapper (axes (area_fraction), target_points_cc, nothing )
93
+ if pkgversion (CC) >= v " 0.14.34"
94
+ remapper_cc = CC. Remapping. Remapper (axes (area_fraction), target_points_cc)
95
+ else
96
+ remapper_cc = CC. Remapping. Remapper (axes (area_fraction), target_points_cc, nothing )
97
+ end
109
98
110
99
# Construct two 2D Center/Center fields to use as scratch space while remapping
111
100
scratch_cc1 = OC. Field {OC.Center, OC.Center, Nothing} (grid)
0 commit comments