@@ -24,11 +24,11 @@ using CUDA
2424arch =  GPU ()
2525Nx =  360 
2626Ny =  180 
27- Nz =  40 
27+ Nz =  50 
28+ 
29+ depth =  5000 meters
30+ z =  ExponentialCoordinate (Nz, - depth, 0 ; scale =  depth/ 4 )
2831
29- depth =  4000 meters
30- z =  ExponentialCoordinate (Nz, - depth, 0 ; scale =  0.85 * depth)
31- z =  Oceananigans. Grids. MutableVerticalDiscretization (z)
3232underlying_grid =  TripolarGrid (arch; size =  (Nx, Ny, Nz), halo =  (5 , 5 , 4 ), z)
3333
3434#  Next, we build bathymetry on this grid, using interpolation passes to smooth the bathymetry.
@@ -49,29 +49,29 @@ grid = ImmersedBoundaryGrid(underlying_grid, GridFittedBottom(bottom_height);
4949# 
5050#  We include a Gent-McWilliams isopycnal diffusivity as a parameterization for the mesoscale
5151#  eddy fluxes. For vertical mixing at the upper-ocean boundary layer we include the CATKE
52- #  parameterization. We also include some explicit horizontal diffusivity. 
52+ #  parameterization.
5353
54- eddy_closure =  Oceananigans. TurbulenceClosures. IsopycnalSkewSymmetricDiffusivity (κ_skew= 2e3 , κ_symmetric= 2e3 )
55- horizontal_viscosity =  HorizontalScalarDiffusivity (ν= 4000 )
54+ eddy_closure =  Oceananigans. TurbulenceClosures. IsopycnalSkewSymmetricDiffusivity (κ_skew= 10 , κ_symmetric= 10 )
5655vertical_mixing =  ClimaOcean. OceanSimulations. default_ocean_closure ()
57-            
56+ 
5857#  ### Ocean simulation
5958#  Now we bring everything together to construct the ocean simulation.
60- #  We use a split-explicit timestepping with 70 substeps for the barotropic
61- #  mode.
59+ #  We use a split-explicit timestepping with 70 substeps for the barotropic mode.
6260
6361free_surface       =  SplitExplicitFreeSurface (grid; substeps= 70 )
6462momentum_advection =  WENOVectorInvariant (order= 5 )
6563tracer_advection   =  WENO (order= 5 )
6664
6765ocean =  ocean_simulation (grid; momentum_advection, tracer_advection, free_surface,
68-                          closure= (eddy_closure, horizontal_viscosity, vertical_mixing))
66+                          timestepper =  :SplitRungeKutta3 ,
67+                          closure= (eddy_closure, vertical_mixing))
6968
7069@info  " We've built an ocean simulation with model:" 
7170@show  ocean. model
7271
7372#  ### Sea Ice simulation
74- #  We also need to build a sea ice simulation. We use the default configuration:
73+ # 
74+ #  We also build a sea ice simulation. We use the default configuration:
7575#  EVP rheology and a zero-layer thermodynamic model that advances thickness
7676#  and concentration.
7777
@@ -84,8 +84,8 @@ sea_ice = sea_ice_simulation(grid, ocean; advection=tracer_advection)
8484date =  DateTime (1993 , 1 , 1 )
8585dataset =  ECCO4Monthly ()
8686ecco_temperature =  Metadatum (:temperature ; date, dataset)
87- ecco_salinity =  Metadatum (:salinity ; date, dataset)
88- ecco_sea_ice_thickness =  Metadatum (:sea_ice_thickness ; date, dataset)
87+ ecco_salinity               =  Metadatum (:salinity ; date, dataset)
88+ ecco_sea_ice_thickness      =  Metadatum (:sea_ice_thickness ; date, dataset)
8989ecco_sea_ice_concentration =  Metadatum (:sea_ice_concentration ; date, dataset)
9090
9191set! (ocean. model, T= ecco_temperature, S= ecco_salinity)
@@ -103,12 +103,10 @@ atmosphere = JRA55PrescribedAtmosphere(arch; backend=JRA55NetCDFBackend(80),
103103#  Now we are ready to build the coupled ocean--sea ice model and bring everything
104104#  together into a `simulation`.
105105
106- #  We use a relatively short time step initially and only run for a few days to
107- #  avoid numerical instabilities from the initial "shock" of the adjustment of the
108- #  flow fields.
106+ #  With Runge-Kutta 3rd order time-stepping we can safely use a timestep of 20 minutes.
109107
110108coupled_model =  OceanSeaIceModel (ocean, sea_ice; atmosphere, radiation)
111- simulation =  Simulation (coupled_model; Δt= 8 minutes , stop_time= 20 days )
109+ simulation =  Simulation (coupled_model; Δt= 20 minutes , stop_time= 365 days )
112110
113111#  ### A progress messenger
114112# 
@@ -141,7 +139,7 @@ function progress(sim)
141139end 
142140
143141#  And add it as a callback to the simulation.
144- add_callback! (simulation, progress, IterationInterval ( 1000 ))
142+ add_callback! (simulation, progress, TimeInterval ( 5 days ))
145143
146144#  ### Output
147145# 
@@ -157,27 +155,19 @@ sea_ice_outputs = merge((h = sea_ice.model.ice_thickness,
157155                         sea_ice. model. velocities)
158156
159157ocean. output_writers[:surface ] =  JLD2Writer (ocean. model, ocean_outputs;
160-                                             schedule =  TimeInterval (5 days ),
158+                                             schedule =  TimeInterval (1 days ),
161159                                            filename =  " ocean_one_degree_surface_fields"  ,
162160                                            indices =  (:, :, grid. Nz),
163161                                            overwrite_existing =  true )
164162
165163sea_ice. output_writers[:surface ] =  JLD2Writer (ocean. model, sea_ice_outputs;
166-                                               schedule =  TimeInterval (5 days ),
164+                                               schedule =  TimeInterval (1 days ),
167165                                              filename =  " sea_ice_one_degree_surface_fields"  ,
168166                                              overwrite_existing =  true )
169167
170168#  ### Ready to run
171169
172170#  We are ready to press the big red button and run the simulation.
173- 
174- #  After we run for a short time (here we set up the simulation with `stop_time = 20days`),
175- #  we increase the timestep and run for longer.
176- 
177- run! (simulation)
178- 
179- simulation. Δt =  30 minutes
180- simulation. stop_time =  365 days
181171run! (simulation)
182172
183173#  ### A movie
0 commit comments