NEDAS.models.topaz.v4.topaz4model module
- class NEDAS.models.topaz.v4.topaz4model.Topaz4Model(**kwargs)[source]
Bases:
Model[RegularGrid]- io_mode: Literal['online', 'offline'] = 'offline'
- basedir: str
- R: str
- T: str
- E: str
- V: str
- X: str
- onem: float
- z_units: str
- restart_dt: int
- forcing_frc: str
- era5_path: str
- priver: int
- jerlv0: int
- relax: int
- nproc: int
- 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) ndarray[source]
Calculate vertical coordinates given the 3D model state. :returns: The corresponding z field. :rtype: np.ndarray
- preprocess(task_id=0, **kwargs)[source]
Preprocess the model data.
- Parameters:
**kwargs – Keyword arguments for preprocessing.
- 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.