NEDAS.models.nextsim.v1 package

class NEDAS.models.nextsim.v1.NextsimModel(**kwargs)[source]

Bases: Model

Class for configuring and running the nextsim v1 model (lagrangian version)

nextsim_dir: str
model_env: str
nextsim_mesh_dir: str
msh_filename: str
nextsim_data_dir: str
ocean_forcing_path: str
restart_input_path: str
restart_dt: float
atmos_forcing_path: str
forcing_dt: float
filename(**kwargs)[source]

Get the filename with specified variable name, time, member, etc.

read_grid_from_mshfile(mshfile)[source]

Read mshfile and update the self.grid object

read_grid(**kwargs)[source]

Update self.grid object based on input kwargs

write_grid(**kwargs)[source]

write updated mesh back to mesh file

Note: now we assume that number of mesh elements and their indices doesn’t change! only updating the mesh node position x,y

get_boundary_nodes()[source]
get_neighbor_nodes(nodes)[source]
taper_boundary(fld, depth=5)[source]
displace(u, v, **kwargs)[source]

Nextsim has a Lagrangian mesh, so it’s possible to displace the mesh coordinates directly Inputs: - u, v: displacement vectors defined on self.grid.x,y

read_mask(**kwargs)[source]
prepare_mask(dst_grid)[source]
read_var(**kwargs)[source]

read variable from a model restart file

write_var(var, **kwargs)[source]

write variable back to a model restart file

z_coords(**kwargs)[source]

Get the vertical coordinates of the model.

Parameters:

**kwargs – Keyword arguments for getting the vertical coordinates.

Returns:

The vertical coordinates.

Return type:

np.ndarray

get_seaice_drift(**kwargs)[source]
get_diag_var(**kwargs)[source]
read_param(**kwargs)[source]
write_param(param, **kwargs)[source]
preprocess(task_id=0, **kwargs)[source]

Preprocess the dir, collect input files for model run

postprocess(task_id=0, **kwargs)[source]

Postprocess the model data.

Parameters:

**kwargs – Keyword arguments for postprocessing.

run(task_id=0, **kwargs)[source]

Run the model forward in time.

Parameters:
  • *args – Arguments

  • **kwargs – Keyword arguments

Keyword Arguments:
  • time (datetime) – current time when forecast starts

  • restart_dir (str) – directory where restart files are located

  • forecast_period (int) – forecast period in hours

If self.ens_run_strategy == ‘batch’, the method will run all ensemble members in one go, expect additional kwargs[‘nens’] to be the ensemble size. If self.ens_run_strategy == ‘scheduler’, the method runs a single member indexed by kwargs[‘member’], and kwargs[‘worker_id’] is the pid assigned by the scheduler to run this method.

Submodules