e3sm/init

add_tasks.add_e3sm_init_tasks(component)

Add all tasks to the e3sm/init component

Tasks

topo resolution constants

STANDARD_CUBED_SPHERE_RESOLUTION

int([x]) -> integer int(x, base=10) -> integer

LOW_RES_CUBED_SPHERE_RESOLUTION

int([x]) -> integer int(x, base=10) -> integer

LOW_RES_BASE_MESH_CELL_WIDTH

Convert a string or number to a floating-point number, if possible.

LAT_LON_RESOLUTION_DECIMALS

int([x]) -> integer int(x, base=10) -> integer

topo shared utilities

CUBED_SPHERE_RESOLUTIONS

Built-in immutable sequence.

LAT_LON_RESOLUTIONS

Built-in immutable sequence.

format_lat_lon_resolution_name(resolution)

Format a latitude-longitude resolution for use in task subdirectories.

get_cubed_sphere_resolution(low_res)

Get the cubed-sphere source-topography resolution for a mode.

uses_low_res_cubed_sphere(cell_width)

Determine whether a base mesh should use lower-resolution topography.

staging E3SM input files

assemble.AssembleStep(component, name, ...)

A base step for materializing a staged tree of E3SM input files.

assemble.AssembleStep.run()

Rebuild the staged tree from empty and stage the README.

assemble.AssembleStep.stage(source, staged_path)

Link one product into the assembled tree at its E3SM-facing path.

assemble.AssembleStep.stage_partitions(step, ...)

Link every partition the given step produced.

assemble.AssembleStep.step_dir(step)

The work directory of another step, found from this one's.

assemble.SYNC_SCRIPT

A script symlinked into the step's work directory for copying the staged tree into an inputdata directory.

graph_partition.GraphPartitionStep(...[, ...])

A step for partitioning an MPAS graph into the core counts E3SM runs use.

graph_partition.GraphPartitionStep.setup()

Take the number of partitions to build at once from the config.

graph_partition.GraphPartitionStep.constrain_resources(...)

Take the number of partitions to build at once from the config.

graph_partition.GraphPartitionStep.run()

Partition graph.info into each core count.

graph_partition.GraphPartitionStep.get_core_counts(ncells)

The core counts to partition a mesh into, from the config's bounds.

inputdata.ASSEMBLED_FILES

The directory an assembly step materializes, relative to its work directory.

inputdata.get_nonempty_option(config, ...)

The stripped value of a config option, or None if it is unset or blank.

inputdata.get_creation_date(config, section)

The creation date the staged files are stamped with, as YYYYMMDD.

inputdata.set_creation_date(config, section)

Set the creation date to today if it is not already set, and return it.

inputdata.ocean_dir(grid)

The MPAS-Ocean directory for a grid.

inputdata.seaice_dir(grid)

The MPAS-Seaice directory for a grid.

inputdata.ocean_initial_condition_path(grid, ...)

Where the MPAS-Ocean initial condition for a grid is staged.

inputdata.ocean_graph_path(grid, creation_date)

Where the unpartitioned MPAS-Ocean graph is staged, beside its partitions.

inputdata.ocean_partition_path(grid, ...)

Where one MPAS-Ocean graph partition is staged.

inputdata.seaice_initial_condition_path(...)

Where the MPAS-Seaice initial condition for a grid is staged.

inputdata.seaice_partition_path(grid, ...)

Where one MPAS-Seaice graph partition is staged.

partitions.get_core_list(ncells[, ...])

A fairly exhaustive list of core counts to partition a mesh into.

partitions.partitions_to_build(cores, ...)

The core counts from cores that still need a partition file.

partitions.read_graph_cell_count(graph_filename)

The number of cells a METIS graph file describes.

partitions.build_partitions(regions, cores, ...)

Write the partition file for each core count, several at a time.

partitions.RegionGraph(filename[, cells])

A graph file to partition, and which of a mesh's cells it covers.

partitions.get_region_graph(cells_on_cell, ...)

The graph of a region's cells, keeping only the edges between them.

partitions.write_graph(filename, xadj, adjncy)

Write a graph in the format gpmetis reads.

topo

combine

PrepareCombineStep(component, subdir, name)

A step for getting the global and Antarctic topography datasets ready to be remapped to the target grid of combined topography.

PrepareCombineStep.setup()

Set up the step in the work directory, including downloading the datasets

PrepareCombineStep.run()

Run this step

CombineWeightsStep(component, subdir, name, ...)

A step for making the weights that remap each tile of the global dataset and the Antarctic dataset to the target grid of combined topography.

CombineWeightsStep.setup()

Set up the step in the work directory, including linking the tiles and SCRIP files and making the commands

CombineWeightsStep.constrain_resources(...)

Constrain cpus_per_task and ntasks based on the number of cores available to this step

CombineStep(component, subdir, target_grid, ...)

A step for combining global and antarctic topography datasets.

CombineStep.get_subdir()

Get the base subdirectory for the step based on the datasets.

CombineStep.get_name(target_grid, ...)

Get the step name based on the current datasets and target grid.

CombineStep.setup()

Set up the step in the work directory, including linking the files from the steps that prepare the datasets and make the weights

CombineStep.run()

Run this step

get_cubed_sphere_topo_steps(component, ...)

Get shared combined-topography steps for a cubed-sphere target grid.

get_lat_lon_topo_steps(component, resolution)

Get shared combined-topography steps for a latitude-longitude target grid.

get_combine_topo_symlinks(combine_step, key)

Get a combine topo step and the steps that prepare for it and make its weights, keyed by symlinks for a task that names the combine step key.

CubedSphereCombineTask(component, resolution)

A task for creating combined topography on a cubed-sphere target grid.

LatLonCombineTask(component, resolution)

A task for creating combined topography on a latitude-longitude grid.

VizCombinedStep(component, combine_step, subdir)

A step for visualizing the combined topography dataset

VizCombinedStep.setup()

Set up the step in the work directory, including linking input files

VizCombinedStep.run()

Run this step

remap

MaskTopoStep(component, combine_topo_step, ...)

A step to mask the global topograph dataset for ocean and land regions

MaskTopoStep.setup()

Set up the step in the work directory and set input files.

MaskTopoStep.constrain_resources(...)

Constrain cpus_per_task and ntasks based on the number of cores available to this step

MaskTopoStep.define_masks(ds)

Override in subclasses to return an ocean and a land mask array with the same shape as ds.base_elevation and other topogrpahy fields.

MaskTopoStep.run()

Run the step.

PrepareRemapTopoStep(component, ...[, ...])

A step for deciding how to smooth topography remapped to a global MPAS base mesh and making the SCRIP file for the mesh, expanded to smooth.

PrepareRemapTopoStep.setup()

Set up the step in the work directory, including linking input files

PrepareRemapTopoStep.define_smoothing(...)

Define smoothing expand_distance and expand_factor fields.

PrepareRemapTopoStep.run()

Run this step of the test case

RemapTopoWeightsStep(component, ...)

A step for making the weights that remap topography from a cubed-sphere grid to a global MPAS base mesh.

RemapTopoWeightsStep.setup()

Set up the step in the work directory, including linking input files and making the command

RemapTopoWeightsStep.constrain_resources(...)

Constrain cpus_per_task and ntasks based on the number of cores available to this step

RemapTopoWeightsStep.runtime_setup()

Launch nothing if the prepare step found no remapping to do

RemapTopoStep(component, base_mesh_step, ...)

A step for remapping topography data such as base elevation and ice sheet properties from a cubed-sphere grid to a global MPAS base mesh, using the weights from {py:class}`polaris.tasks.e3sm.init.topo.remap.RemapTopoWeightsStep`.

RemapTopoStep.setup()

Set up the step in the work directory, including linking input files

RemapTopoStep.run()

Run this step of the test case

RemapTopoTask(component, mesh_name[, ...])

A task for remapping a topography dataset to a global MPAS mesh first without smoothing and then optionally with smoothing

VizRemappedTopoStep(component, name, subdir, ...)

A step for plotting fields from a remapped topography dataset

VizRemappedTopoStep.run()

Run this step of the test case

get_remap_topo_steps(mesh_name[, smoothing, ...])

Get shared steps for computing a mapping file and then remapping bathymetry and ice-shelf topography from a cubed-sphere grid to a global MPAS base mesh.

add_remap_topo_tasks(component)

Add a task to remap topography for each supported base mesh

cull

CullMaskStep(component, base_mesh_step, ...)

A step for creating the masks that will be used to cull land and ocean/sea-ice meshes based on critical land and ocean/sea-ice transects, handling land-locked cells, and flood-filling to make sure that Antarctic land ice and ocean are both contiguous.

CullMaskStep.setup()

Set up the step in the work directory, including downloading any dependencies.

CullMaskStep.constrain_resources(...)

Constrain the cores this step uses to the cores available to it

CullMaskStep.define_critical_land_transects(gf)

Define transects along which land must be present (e.g. to block ocean flow).

CullMaskStep.define_critical_ocean_transects(gf)

Define transects along which ocean must be present (e.g. to allow ocean flow).

CullMaskStep.refine_ocean_cull_mask(...)

Refine the mask for culling land and (optionally) grounded ice from the ocean.

CullMaskStep.refine_land_cull_mask(...)

Refine the mask for culling ocean from the land.

CullMaskStep.run()

Run this step of the test case

CullMeshStep(component, base_mesh_step, ...)

A step for culling out land cells from the ocean/sea-ice mesh and ocean/sea-ice cells from the land mesh.

CullMeshStep.setup()

Set up the step in the work directory, including downloading any dependencies.

CullMeshStep.constrain_resources(...)

Constrain the cores this step uses to the cores available to it

CullMeshStep.run()

Run this step of the test case

CullTopoTask(component, mesh_name[, include_viz])

A task for culling a topography dataset to land and ocea regions (the latter both with and without ice-shelf cavities)

get_cull_topo_steps(mesh_name[, include_viz])

Get shared steps for masking and culling topography for one base mesh.

add_cull_topo_tasks(component)

Add a task to remap topography for each supported base mesh

consistency.check_cull_mask_consistency(...)

Check that the cull masks describe a consistent set of domains.

consistency.check_land_locked_criteria(...)

Check that no land-locked cells survive in either ocean domain.

consistency.check_critical_passages(...[, ...])

Check that no cell on a critical ocean passage was culled from the ocean.

consistency.check_sea_ice_removed_regions(...)

Check that removing the cells in which sea ice would be trapped did not remove a whole sea from the ocean.

dc_edge_diagnostics.check_ocean_dc_edge(...)

Check that dcEdge in the ocean/sea-ice domain stays within bounds relative to the local ocean background cell width.

dc_edge_diagnostics.check_ocean_dv_edge(...)

Check that the shortest dvEdge in the sea-ice domain, the ocean without ice-shelf cavities, is not too short for the sea-ice time step.

land_locked.find_dead_end_cells(ds_mesh, ...)

Find the dead ends of a candidate ocean domain: the cells that the C-grid criterion removes, either because they have fewer than two active edges or because removing their neighbors leaves them so.

land_locked.remove_land_locked_cells(...[, ...])

Refine the ocean and ocean-without-cavities domains together, removing the cells in which the ocean cannot circulate and those in which sea ice would be trapped.

land_locked.remove_ocean_land_locked_cells(...)

Refine the ocean domain alone, removing the cells through which a C-grid cannot circulate and those that are not connected to the open ocean.

component_inputs

BaseMeshStep(component, subdir, ...[, name])

A step for staging the base mesh with maps to the meshes culled from it.

BaseMeshStep.output_filename

The file this step writes.

BaseMeshStep.setup()

Link the base mesh, whose filename is a config option of the step that built it.

BaseMeshStep.run()

Add the base-to-culled index maps to the base mesh and write it out.

ScripStep(component, subdir, cull_mesh_step)

A step for staging the SCRIP descriptions of the culled meshes.

ScripStep.scrip_filename(region)

The file this step writes for one culled-mesh region.

ScripStep.setup()

Resolve the E3SM short name, so that a mesh with none assigned fails here rather than after the workflow has run.

ScripStep.run()

Restamp each SCRIP file with the E3SM mesh name.

ComponentInputsAssembleStep(component, ...)

A step for materializing the staged tree of component input files.

ComponentInputsAssembleStep.run()

Build the staged tree, from empty.

ComponentInputsTask(component, mesh_name, target)

A task for staging the E3SM component input files for one mesh.

ComponentInputsTask.configure()

Fill in the creation date so it lands in the work directory's config.

get_component_inputs_steps(mesh_name[, target])

Get shared steps for staging E3SM component input files for one mesh.

add_component_inputs_tasks(component)

Add a task per unified mesh for staging E3SM component input files.

ocean products

ocean_mesh.OceanMeshStep(component, subdir, ...)

A step for staging the MPAS-Ocean mesh file.

ocean_mesh.OceanMeshStep.setup()

Refuse a model whose packaging is not supported, before anything runs.

ocean_mesh.OceanMeshStep.run()

Combine the horizontal mesh and the vertical coordinate.

ocean_mesh.VERT_COORD_VARS

The vertical-coordinate fields the staged mesh carries, all of which the initial-state step already writes.

ocean_initial_condition.OceanInitialConditionStep(...)

A step for staging the MPAS-Ocean initial condition.

ocean_initial_condition.OceanInitialConditionStep.setup()

Refuse a model whose packaging is not supported, before anything runs.

ocean_initial_condition.OceanInitialConditionStep.run()

Stage the adjusted restart as the initial condition.

ocean_graph_partition.OceanGraphPartitionStep(...)

A step for partitioning the ocean graph into the core counts E3SM runs use.

ocean_graph_partition.OceanGraphPartitionStep.setup()

Refuse a model whose packaging is not supported, before anything runs.

ocean_graph_partition.OceanGraphPartitionStep.run()

Partition graph.info into each core count.

moc_masks.MocMasksStep(component, subdir, ...)

A step for the MOC basin masks and southern-boundary transects that MPAS-Ocean reads at run time.

moc_masks.MocMasksStep.setup()

Set up the step, failing early for a model that cannot be packaged.

moc_masks.MocMasksStep.run()

Run the feature-mask step.

moc_masks.MESH_FILENAME

the full ocean domain, matching what the ocean initial condition is built from.

sea-ice products

seaice_mesh.SeaiceMeshStep(component, ...[, ...])

A step for staging the MPAS-Seaice mesh file.

seaice_mesh.SeaiceMeshStep.setup()

Set up the task in the work directory, including downloading any dependencies.

seaice_mesh.SeaiceMeshStep.run()

Stage the culled mesh as the sea-ice mesh.

seaice_initial_condition.SeaiceInitialConditionStep(...)

A step for staging the MPAS-Seaice initial condition.

seaice_initial_condition.SeaiceInitialConditionStep.setup()

Set up the task in the work directory, including downloading any dependencies.

seaice_initial_condition.SeaiceInitialConditionStep.run()

Add the Coriolis parameter to the culled mesh.

seaice_partition_map.SeaicePartitionMapStep(...)

A step for building the bilinear mapping file from the QU60km sea-ice climatology to the sea-ice mesh.

seaice_partition_map.SeaicePartitionMapStep.setup()

Resolve what the mapping file is named after, before anything runs.

seaice_partition_map.SeaicePartitionMapStep.runtime_setup()

Set up the source and destination grids, then the command that builds the QU60km-to-mesh mapping file.

seaice_graph_partition.SeaiceGraphPartitionStep(...)

A step for partitioning the sea-ice mesh.

seaice_graph_partition.SeaiceGraphPartitionStep.setup()

Take the number of partitions to build at once from the config.

seaice_graph_partition.SeaiceGraphPartitionStep.run()

Weight the mesh by the sea-ice climatology, then partition it.

leaf modules

names.get_mesh_short_name(config)

The E3SM short name of the mesh the files are staged for.

names.ocean_grid_name(short_name)

E3SM's name for the ocean and sea-ice grid of a mesh.

names.base_mesh_path(short_name, creation_date)

Where the base mesh, carrying the base-to-culled index maps, is staged.

names.scrip_path(short_name, creation_date, ...)

Where the SCRIP description of one culled mesh is staged.

names.ocean_scrip_path(short_name, ...)

Where a SCRIP description is staged beside the ocean products.

names.culled_mesh_path(short_name, ...)

Where one culled mesh is staged.

names.ocean_moc_masks_path(short_name, ...)

Where the MOC basin masks and southern-boundary transects are staged.

maps.map_base_to_culled(...)

Invert one culled mesh's forward map into base-to-culled index fields.

maps.base_to_culled_maps(...)

All nine base-to-culled index maps, one per culled mesh and element type.

models.check_ocean_model()

The ocean model the dynamic adjustment runs, if its files can be staged.