NEDAS.models.qg.fortran package
- class NEDAS.models.qg.fortran.QGFortranModel(**kwargs)[source]
Bases:
ModelClass for configuring and running the qg model
- kmax: int
- nz: int
- restart_dt: float
- psi_init_type: str
- model_code_dir: str
- model_env: str
- spinup_hours: 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)[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(*args, **kwargs)[source]
Preprocess the model data.
- Parameters:
**kwargs – Keyword arguments for preprocessing.
- postprocess(*args, **kwargs)[source]
Postprocess the model data.
- Parameters:
**kwargs – Keyword arguments for postprocessing.
- 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.
Subpackages
Submodules
- NEDAS.models.qg.fortran.bin2nc module
- NEDAS.models.qg.fortran.namelist module
- NEDAS.models.qg.fortran.qg_fortran_model module
QGFortranModelQGFortranModel.kmaxQGFortranModel.nzQGFortranModel.restart_dtQGFortranModel.psi_init_typeQGFortranModel.model_code_dirQGFortranModel.model_envQGFortranModel.spinup_hoursQGFortranModel.filename()QGFortranModel.read_grid()QGFortranModel.read_mask()QGFortranModel.read_var()QGFortranModel.write_var()QGFortranModel.z_coords()QGFortranModel.preprocess()QGFortranModel.postprocess()QGFortranModel.run()QGFortranModel.generate_truth()QGFortranModel.generate_init_ensemble()
- NEDAS.models.qg.fortran.run module
- NEDAS.models.qg.fortran.util module