This project is about setting up a CICE configuration and any nuances we might want to consider.
Download this project by either:
Running the CrocoDash CLI command:
crocodash template --output cice_case.ipynb --machine glade --notebook crocodash.projects.cice, then filling in the paths it leaves as placeholdersCopying the file from your CrocoDash checkout:
gallery/crocodash/projects/cice.ipynb
Grid Generation¶
The first thing we are going to do is think about how to get a CICE domain going - either pretty northerly or southerly.
Given how lat/lon changes a lot towards the poles, we’ll use a projected grid. The only nuance is in the forcing, so we’ll rip through the first few steps first.
from pathlib import Path
from CrocoDash.grid import Grid
from CrocoDash.vgrid import VGrid
from CrocoDash.topo import Topo
from CrocoDash.case import Case
grid = Grid.from_projection(
crs="EPSG:3995",
x_min=-1_000_000, # meters from pole
x_max= 1_000_000,
y_min=-1_000_000,
y_max= 1_000_000,
resolution_m=50_000, # 50 km
name="arctic_50km",
)
topo = Topo(
grid = grid,
min_depth = 9.5, # in meters
)
topo.set_from_dataset(
bathymetry_path = "<GEBCO_LOWRES>",
longitude_coordinate_name="lon",
latitude_coordinate_name="lat",
vertical_coordinate_name="elevation"
)
topo.depth.plot()
vgrid = VGrid.hyperbolic(
nk = 75, # number of vertical levels
depth = topo.max_depth,
ratio=20.0 # target ratio of top to bottom layer thicknesses
)
# CESM case (experiment) name
casename = "arctic_50km"
# CESM source root (Update this path accordingly!!!)
cesmroot ="<CESM>"
# Place where all your input files go
inputdir = Path("<inputdir>") / casename
# CESM case directory
caseroot = Path("<casedir>") / casename
case = Case(
cesmroot = cesmroot,
caseroot = caseroot,
inputdir = inputdir,
ocn_grid = grid,
ocn_vgrid = vgrid,
ocn_topo = topo,
project = '<PROJECT>',
job_queue = "<JOB_QUEUE>", # PBS queue the run is submitted to
job_wallclock_time = "<WALLCLOCK_1H>", # hh:mm:ss walltime requested for the run
override = True,
machine = "derecho",
compset = "GR_JRA" )
How do CICE OBCs work?¶
CICE OBCs “restore” from a grid that is exactly one additional cell in each direction. CrocoDash generates that halo grid (one T-cell on every side) and fills it from a CICE-shaped source, which CICE then restores toward. The source is a real global CICE restart (cice_restart), or reference_ice, a synthetic stand-in that needs no files and is handy for checking the wiring.
Restoring is opt-in, and takes all three of restore_ice=True, cice_product_name and cice_function_name. Leave all three out and CICE runs with zero-gradient boundaries and no restoring. In the following cell, we point the cice_restart product at exactly one restart.
case.configure_forcings(
date_range=["2020-01-01 00:00:00", "2020-01-09 00:00:00"],
function_name="get_glorys_data_from_rda",
restore_ice=True, # turn on CICE boundary restoring
cice_product_name="cice_restart",
cice_function_name="get_cice_restart_subset",
cice_function_args={
"restart_path": "<CICE_RESTART>",
"grid_path": "<TX2_3V3_GRID>", # the restart's companion grid file
},
)
case.process_forcings()
This restoring we are setting up here is only for boundary conditions. If you want to start from an initial condition, check out the docs here: https://
I’d then mess with the NTASKS/ROOTPE layout to make sure everything looks reasonable, then build & submit.
Feel free to iterate with process forcings! You can run it on the command line with crocodash process --caseroot YOURCASEROOT --all (or name just the pieces you changed, e.g. --bc, --cice; see crocodash process -h)!