"Finally, the WRF's ideal.exe program is called for all ensemble members to create initial condition files, called `wrfinput_d01`, for each member.\n",
"```python\n",
"w.run_ideal()\n",
"```\n",
"Now we can go to step 3 to run the forecast.\n",
"\n",
"\n",
"### 2) Initialize a forecast from a previous forecast\n",
"To run a forecast from initial conditions of a previous forecasts, we import these modules\n",
"```python\n",
"import datetime as dt\n",
"from dartwrf.workflows import WorkFlows\n",
"```\n",
"\n",
"Let's say you want to run a forecast starting at 9 UTC until 12 UTC.\n",
"Initial conditions shall be taken from a previous experiment in `/user/test/data/sim_archive/exp_abc` which was initialized at 6 UTC and there are WRF restart files for 9 UTC.\n",
"2. Update the initial conditions from data assimilation:\n",
"```python\n",
"w.update_IC_from_DA(time)\n",
"```\n",
"\n",
"After this, the wrfrst files are updated with assimilation increments from DART output and copied to the WRF's run directories so you can continue to run the forecast ensemble.\n",
"\n",
"### 3) Run the forecast\n",
"Define how long you want to run the forecast and when you want WRF-restart files. Since they take a lot of space, we want as few as possible.\n",
"\n",
"```python\n",
"timedelta_integrate = dt.timedelta(hours=5)\n",
"\n",
"w.run_ENS(begin=begin, # start integration from here\n",
" end=time + timedelta_integrate, # integrate until here\n",
" output_restart_interval=9999, # do not write WRF restart files\n",
" )\n",
"```\n",
"\n",
"If you want to assimilate in 15 minutes again, use\n",
Finally, the WRF's ideal.exe program is called for all ensemble members to create initial condition files, called `wrfinput_d01`, for each member.
```python
w.run_ideal()
```
Now we can go to step 3 to run the forecast.
### 2) Initialize a forecast from a previous forecast
To run a forecast from initial conditions of a previous forecasts, we import these modules
```python
importdatetimeasdt
fromdartwrf.workflowsimportWorkFlows
```
Let's say you want to run a forecast starting at 9 UTC until 12 UTC.
Initial conditions shall be taken from a previous experiment in `/user/test/data/sim_archive/exp_abc` which was initialized at 6 UTC and there are WRF restart files for 9 UTC.
2. Update the initial conditions from data assimilation:
```python
w.update_IC_from_DA(time)
```
After this, the wrfrst files are updated with assimilation increments from DART output and copied to the WRF's run directories so you can continue to run the forecast ensemble.
### 3) Run the forecast
Define how long you want to run the forecast and when you want WRF-restart files. Since they take a lot of space, we want as few as possible.
```python
timedelta_integrate=dt.timedelta(hours=5)
w.run_ENS(begin=begin,# start integration from here
end=time+timedelta_integrate,# integrate until here
output_restart_interval=9999,# do not write WRF restart files
)
```
If you want to assimilate in 15 minutes again, use
DART-WRF is a python package which automates many things like configuration, program dependencies, archiving code, configuration and output, handling computing resources, etc.
This tutorial can be executed with pre-existing input data accessible for students of the "University of Vienna - Department of Meteorology and Geophysics" on the server `srvx1`/Teachinghub.
The main control scripts are in the main folder of DART-WRF, e.g. ``analysis_only.py``.
A control script defines the jobs (work packages, programs) which need to be completed and in which order they need to be done.
Every control script starts with setting up the experiment.
.. code-block:: python
from dartwrf.workflows import WorkFlows
w = WorkFlows(exp_config='exp_template.py', server_config='srvx1.py')
where `<iens>` is a placeholder, since there is one file for each member, from `raso.fc.001.wrfprof` to `raso.fc.040.wrfprof`.
Then, we set up the workflows as usual and prepare the input profiles.
.. code-block:: python
import datetime as dt
from dartwrf.workflows import WorkFlows
w = WorkFlows(exp_config='cfg.py', server_config='srvx1.py')
begin = dt.datetime(2008, 7, 30, 7)
w.prepare_WRFrundir(begin)
Finally, the WRF's ideal.exe program is called for all ensemble members to create initial condition files, called `wrfinput_d01`, for each member.
.. code-block:: python
w.run_ideal()
Now we can go to step 3 to run the forecast.
2) Initialize a forecast from a previous forecast
*************************************************
To run a forecast from initial conditions of a previous forecasts, we import these modules
.. code-block:: python
import datetime as dt
from dartwrf.workflows import WorkFlows
Let's say you want to run a forecast starting at 9 UTC until 12 UTC.
Initial conditions shall be taken from a previous experiment in `/user/test/data/sim_archive/exp_abc` which was initialized at 6 UTC and there are WRF restart files for 9 UTC.
2. Update the initial conditions from data assimilation:
.. code-block:: python
w.update_IC_from_DA(time)
After this, the wrfrst files are updated with assimilation increments from DART output and copied to the WRF's run directories so you can continue to run the forecast ensemble.
1) Run the Forecast
*******************
Define how long you want to run the forecast and when you want WRF-restart files. Since they take a lot of space, we want as few as possible.
.. code-block:: python
timedelta_integrate = dt.timedelta(hours=5)
w.run_ENS(begin=begin, # start integration from here
end=time + timedelta_integrate, # integrate until here
output_restart_interval=9999, # do not write WRF restart files
)
If you want to assimilate in 15 minutes again, use