NEDAS.models.nextsim.dg.nextsimdg_model module
- class NEDAS.models.nextsim.dg.nextsimdg_model.NextsimDGModel(**kwargs)[source]
Bases:
Model[RegularGrid]- restart_dt: float
- dg_comp: int
- proj: str
- xstart: float
- xend: float
- ystart: float
- yend: float
- dx: float
- mask_file: str
- files: dict
- perturb: dict
- model_env: str
- model_config_file: str
- parallel_mode: Literal['serial', 'mpi', 'openmp']
- run_separate_jobs: bool
- use_job_array: bool
- grid: RegularGrid
- read_grid(**kwargs)[source]
Read the grid information from the model output.
- Parameters:
**kwargs – Keyword arguments for reading the grid.
- read_var(**kwargs)[source]
Read a variable from the model output.
- Parameters:
**kwargs – Keyword arguments for reading the variable.
- Returns:
The read variable.
- Return type:
np.ndarray
- write_var(var, **kwargs)[source]
Write a variable to the model output.
- Parameters:
var (np.ndarray) – The variable to write.
**kwargs – Keyword arguments for writing the variable.
- 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
- preprocess(task_id: int = 0, **kwargs)[source]
Preprocessing method for nextsim.dg.
- Parameters:
task_id (int) – task id for parallel execution
nproc_per_util (int) – number of processors for each task
kwargs (dict) – Runtime keyword arguments (member, time, time_start, path, forecast_period, restart_dir). Additional class attributes self.files and self.perturb are populated from the model_def nextsim.dg config_file entry by parse_config.
- postprocess(task_id=0, **kwargs)[source]
Postprocessing method for nextsim.dg Parameters: same as preprocess
- run(*args, **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.
- run_batch(task_id=0, **kwargs)[source]
Run nextsim.dg model ensemble forecast, use job array to spawn the member runs