@@ -35,22 +35,19 @@ a surface area fraction field.
35
35
This type is used to indicate that this simulation is an ocean simulation for
36
36
dispatch in coupling.
37
37
38
- Specific details about the complexity of the model
39
- can be found in the Oceananigans.jl documentation.
38
+ Specific details about the default model configuration
39
+ can be found in the documentation for `ClimaOcean.ocean_simulation` .
40
40
"""
41
41
function OceananigansSimulation (area_fraction, start_date, stop_date; output_dir, comms_ctx = ClimaComms. context ())
42
42
arch = comms_ctx. device isa ClimaComms. CUDADevice ? OC. GPU () : OC. CPU ()
43
43
44
- use_ecco = start_date + Dates. Month (1 ) < stop_date
45
- if use_ecco
46
- # Retrieve ECCO data (monthly)
47
- # (It requires username and password)
48
- dates = range (start_date, step = Dates. Month (1 ), stop = stop_date)
49
- ecco_temperature = CO. Metadata (:temperature ; dates, dataset = CO. ECCO. ECCO4Monthly ())
50
- ecco_salinity = CO. Metadata (:salinity ; dates, dataset = CO. ECCO. ECCO4Monthly ())
51
- download_dataset (ecco_temperature)
52
- download_dataset (ecco_salinity)
53
- end
44
+ # Retrieve ECCO data (monthly)
45
+ # (It requires username and password)
46
+ dates = range (start_date, step = Dates. Month (1 ), stop = stop_date)
47
+ ecco_temperature = CO. Metadata (:temperature ; dates, dataset = CO. ECCO. ECCO4Monthly ())
48
+ ecco_salinity = CO. Metadata (:salinity ; dates, dataset = CO. ECCO. ECCO4Monthly ())
49
+ download_dataset (ecco_temperature)
50
+ download_dataset (ecco_salinity)
54
51
55
52
# Set up ocean grid (1 degree)
56
53
resolution_points = (360 , 160 , 32 )
@@ -76,7 +73,9 @@ function OceananigansSimulation(area_fraction, start_date, stop_date; output_dir
76
73
77
74
grid = OC. ImmersedBoundaryGrid (underlying_grid, OC. GridFittedBottom (bottom_height); active_cells_map = true )
78
75
79
- if use_ecco
76
+ use_restoring = start_date + Dates. Month (1 ) < stop_date
77
+
78
+ if use_restoring
80
79
# When we use ecco data, the forcing takes care of everything, including
81
80
# the initial conditions
82
81
restoring_rate = 1 / (3 * 86400 )
@@ -92,16 +91,12 @@ function OceananigansSimulation(area_fraction, start_date, stop_date; output_dir
92
91
# Create ocean simulation
93
92
ocean = CO. ocean_simulation (grid; forcing)
94
93
95
- if ! use_ecco
96
- T_init (λ, φ, z) = 30 * (1 - tanh ((abs (φ) - 30 ) / 5 )) / 2 + rand ()
97
- S_init (λ, φ, z) = 30 - 5e-3 * z + rand ()
98
- OC. set! (ocean. model, T = T_init, S = S_init)
99
- end
94
+ # Set initial condition to ECCO state estimate at start_date
95
+ OC. set! (ocean. model, T = ecco_temperature[1 ], S = ecco_salinity[1 ])
100
96
101
97
long_cc = OC. λnodes (grid, OC. Center (), OC. Center (), OC. Center ())
102
98
lat_cc = OC. φnodes (grid, OC. Center (), OC. Center (), OC. Center ())
103
99
104
-
105
100
# TODO : Go from 0 to Nx+1, Ny+1 (for halos) (for LatLongGrid)
106
101
107
102
# Construct a remapper from the exchange grid to `Center, Center` fields
0 commit comments