@@ -6,12 +6,13 @@ using Oceananigans.Units
66using Oceananigans. OrthogonalSphericalShellGrids
77using ClimaOcean. OceanSimulations
88using ClimaOcean. ECCO
9- using ClimaOcean. ECCO : all_ECCO_dates
9+ using ClimaOcean. DataWrangling
1010using ClimaSeaIce. SeaIceThermodynamics: IceWaterThermalEquilibrium
1111using Printf
1212
1313using CUDA
1414CUDA. device! (1 )
15+ arch = GPU ()
1516
1617r_faces = ClimaOcean. exponential_z_faces (; Nz= 30 , h= 10 , depth= 2000 )
1718z_faces = MutableVerticalDiscretization (r_faces)
@@ -20,13 +21,13 @@ Nx = 180 # longitudinal direction -> 250 points is about 1.5ᵒ resolution
2021Ny = 180 # meridional direction -> same thing, 48 points is about 1.5ᵒ resolution
2122Nz = length (r_faces) - 1
2223
23- grid = RotatedLatitudeLongitudeGrid (GPU () , size = (Nx, Ny, Nz),
24- latitude = (- 45 , 45 ),
25- longitude = (- 45 , 45 ),
26- z = r_faces,
27- north_pole = (180 , 0 ),
28- halo = (5 , 5 , 4 ),
29- topology = (Bounded, Bounded, Bounded))
24+ grid = RotatedLatitudeLongitudeGrid (arch , size = (Nx, Ny, Nz),
25+ latitude = (- 45 , 45 ),
26+ longitude = (- 45 , 45 ),
27+ z = r_faces,
28+ north_pole = (180 , 0 ),
29+ halo = (5 , 5 , 4 ),
30+ topology = (Bounded, Bounded, Bounded))
3031
3132bottom_height = regrid_bathymetry (grid; minimum_depth= 15 , major_basins= 1 )
3233
@@ -49,27 +50,47 @@ ocean = ocean_simulation(grid;
4950 free_surface,
5051 closure)
5152
52- set! (ocean. model, T= ECCOMetadata (:temperature ),
53- S= ECCOMetadata (:salinity ))
53+ dataset = ECCO4Monthly ()
54+
55+ set! (ocean. model, T= Metadata (:temperature ; dataset),
56+ S= Metadata (:salinity ; dataset))
5457
5558# ####
5659# #### A Prognostic Sea-ice model
5760# ####
5861
62+ using ClimaSeaIce. SeaIceMomentumEquations
63+ using ClimaSeaIce. Rheologies
64+
5965# Remember to pass the SSS as a bottom bc to the sea ice!
6066SSS = view (ocean. model. tracers. S, :, :, grid. Nz)
6167bottom_heat_boundary_condition = IceWaterThermalEquilibrium (SSS)
6268
63- sea_ice = sea_ice_simulation (grid; bottom_heat_boundary_condition, dynamics= nothing , advection= nothing )
69+ SSU = view (ocean. model. velocities. u, :, :, grid. Nz)
70+ SSV = view (ocean. model. velocities. u, :, :, grid. Nz)
71+
72+ τo = SemiImplicitStress (uₑ= SSU, vₑ= SSV)
73+ τua = Field {Face, Center, Nothing} (grid)
74+ τva = Field {Center, Face, Nothing} (grid)
75+
76+ dynamics = SeaIceMomentumEquation (grid;
77+ coriolis = ocean. model. coriolis,
78+ top_momentum_stress = (u= τua, v= τva),
79+ bottom_momentum_stress = τo,
80+ ocean_velocities = (u= SSU, v= SSV),
81+ rheology = ElastoViscoPlasticRheology (),
82+ solver = SplitExplicitSolver (120 ))
83+
84+ sea_ice = sea_ice_simulation (grid; bottom_heat_boundary_condition, dynamics, advection= WENO (order= 7 ))
6485
65- set! (sea_ice. model, h= ECCOMetadata (:sea_ice_thickness ),
66- ℵ= ECCOMetadata (:sea_ice_concentration ))
86+ set! (sea_ice. model, h= Metadata (:sea_ice_thickness ; dataset ),
87+ ℵ= Metadata (:sea_ice_concentration ; dataset ))
6788
6889# ####
6990# #### A Prescribed Atmosphere model
7091# ####
7192
72- atmosphere = JRA55PrescribedAtmosphere (GPU () ; backend= JRA55NetCDFBackend (40 ))
93+ atmosphere = JRA55PrescribedAtmosphere (arch ; backend= JRA55NetCDFBackend (40 ))
7394radiation = Radiation ()
7495
7596# ####
@@ -80,10 +101,10 @@ arctic = OceanSeaIceModel(ocean, sea_ice; atmosphere, radiation)
80101arctic = Simulation (arctic, Δt= 5 minutes, stop_time= 365 days)
81102
82103# Sea-ice variables
83- h = sea_ice. model. ice_thickness
84- ℵ = sea_ice. model. ice_concentration
85- Gh = sea_ice. model. timestepper . Gⁿ . h
86- Gℵ = sea_ice. model. timestepper . Gⁿ . ℵ
104+ h = sea_ice. model. ice_thickness
105+ ℵ = sea_ice. model. ice_concentration
106+ u = sea_ice. model. velocities . u
107+ v = sea_ice. model. velocities . v
87108
88109# Fluxes
89110Tu = arctic. model. interfaces. atmosphere_sea_ice_interface. temperature
@@ -93,14 +114,16 @@ Qⁱ = arctic.model.interfaces.sea_ice_ocean_interface.fluxes.interface_heat
93114Qᶠ = arctic. model. interfaces. sea_ice_ocean_interface. fluxes. frazil_heat
94115Qᵗ = arctic. model. interfaces. net_fluxes. sea_ice_top. heat
95116Qᴮ = arctic. model. interfaces. net_fluxes. sea_ice_bottom. heat
117+ τx = arctic. model. interfaces. net_fluxes. sea_ice_top. u
118+ τy = arctic. model. interfaces. net_fluxes. sea_ice_top. v
96119
97120# Output writers
98- arctic. output_writers[:vars ] = JLD2OutputWriter (sea_ice. model, (; h, ℵ, Gh, Gℵ , Tu, Qˡ, Qˢ, Qⁱ, Qᶠ, Qᵗ, Qᴮ),
121+ arctic. output_writers[:vars ] = JLD2OutputWriter (sea_ice. model, (; h, ℵ, u, v , Tu, Qˡ, Qˢ, Qⁱ, Qᶠ, Qᵗ, Qᴮ, τx, τy ),
99122 filename = " sea_ice_quantities.jld2" ,
100123 schedule = IterationInterval (12 ),
101124 overwrite_existing= true )
102125
103- arctic. output_writers[:avrages ] = JLD2OutputWriter (sea_ice. model, (; h, ℵ, Tu, Qˡ, Qˢ, Qⁱ, Qᶠ, Qᵗ, Qᴮ),
126+ arctic. output_writers[:averages ] = JLD2OutputWriter (sea_ice. model, (; h, ℵ, Tu, Qˡ, Qˢ, Qⁱ, Qᶠ, Qᵗ, Qᴮ, u, v, τx, τy ),
104127 filename = " averaged_sea_ice_quantities.jld2" ,
105128 schedule = AveragedTimeInterval (1 days),
106129 overwrite_existing= true )
@@ -142,11 +165,11 @@ run!(arctic)
142165# #### Comparison to ECCO Climatology
143166# ####
144167
145- version = ECCO4Monthly ()
146- dates = all_ECCO_dates (version)[1 : 12 ]
168+ dataset = ECCO4Monthly ()
169+ dates = all_dates (version)[1 : 12 ]
147170
148- h_metadata = ECCOMetadata (:sea_ice_thickness ; version , dates)
149- ℵ_metadata = ECCOMetadata (:sea_ice_concentration ; version , dates)
171+ h_metadata = Metadata (:sea_ice_thickness ; dataset , dates)
172+ ℵ_metadata = Metadata (:sea_ice_concentration ; dataset , dates)
150173
151174# Montly averaged ECCO data
152175hE = ECCOFieldTimeSeries (h_metadata, grid; time_indices_in_memory= 12 )
0 commit comments