This code runs an Ensemble Data Assimilation system with the software packages DART and WRF. All workflow steps are submitted to the cluster manager SLURM, which takes care of the dependencies (the order in which tasks are done).
This package runs an Ensemble Data Assimilation system with the software packages DART and WRF.
- Why should I use it?
- It's pythonic: see what it does at first glance, modular, flexible
- It handles dependencies using SLURM without '`sleep` loops in the bash script'.
Functions return a SLURM ID which can be used to trigger the start of another function (interface by [brentp/slurmpy](https://github.com/brentp/slurmpy)).
[Please find the DART-WRF documentation and tutorials here.](https://dart-wrf.readthedocs.io/en/latest/)
- How does it work?
- There are two kinds of code/scripts: One that is run immediately and one that is run later on.
- The first one instructs the cluster (SLURM) to do the things you tell it - in the right order - using the right input.
- The latter kind of code actually does the things. Its code is not executed right away, but when there are resources assigned to you by SLURM.
- Can I use it for real weather?
- Yes, but you need to [convert your observations into DART format.](https://docs.dart.ucar.edu)
## Workflow
#### Configure your experiment
Define simulation specific variables in [`config/cfg.py`](https://github.com/lkugler/DART-WRF/blob/master/config/cfg.py).
Define paths for python, ncks, etc. in [`config/clusters.py`](https://github.com/lkugler/DART-WRF/blob/master/config/clusters.py).
Dependencies are `numpy, pandas, scipy, xarray, netCDF4`. Install non-standard packages with `pip install docopt slurmpy --user`.
Workflow is defined using meta-routines (functions) like `run_ENS` which are defined in `scheduler.py`.
3) Create 3D initial conditions from input_sounding etc.:
`id = run_ideal(depends_on=id)`
### Run free forecast
Let's say you want to run a free forecast starting at 6z, which you want to use as prior for an assimilation at 9z. Then you need can use the above defined 3 steps to create initial conditions.
Then you can run an ensemble forecast using:
```
id = run_ENS(begin=begin, # start integration from here
2. To update the model state with assimilation increments, you need to update the WRF restart files by running
`id = update_IC_from_DA(time, depends_on=id)`
After this, the wrfrst files are updated with assimilation increments (filter_restart) and copied to the WRF's run directories so you can continue to run the ENS after assimilation using
```
id = run_ENS(begin=time, # start integration from here
end=time + timedelta_integrate, # integrate until here
`scheduler.py` submits jobs into the SLURM queue with dependencies, so that SLURM starts the jobs itself as soon as resources are available. Most jobs need only one node, but model integration is done in a SLURM job array across e.g. 10 nodes:
```
$ squeue -u `whoami` --sort=i
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)