How to bacy
This is a small guide on how to use bacy to run assimilation cycles in practice.
Prerequisites
Before running you need:
* a path to a directory containing a bacy with initial conditions for your experiment
* a icon gridfile, a radiation gridfile and extpar-Data. You can create these using the icongridgen
or via the web interface at DWD (user icon-web, pw: icon@dwd).
* a working bacy, cloned eihter from git@gitlab.dkrz.de:dace/dace_bacy.git
or from another bacy using bacy/bacy_clone
Running bacy
To run cycles you need to go to to the cycle
module: bacy/modules/cycle/
. There you can find the scripts prep_cycle
and cycle
.
Running prep_cycle
To initialize bacy run prep_cycle
in the cycle
directory. The script describes itself like this:
Text Only | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Text Only | |
---|---|
1 |
|
/hpc/path/to/initial/conditons/bacy/
starting at the 28.11.2023 - 12 UTC.
Running cycle
After prearation you can run the cycle by calling cycle
with similar arguments. The script describes itself like this:
Text Only | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
Text Only | |
---|---|
1 |
|
Using nohup
For longer experiments you wankt to be able to leave the command shell and let the cycles take care of its own. To do so, you can start the process using nohup
:
Text Only | |
---|---|
1 |
|
cycle.log
.
Pro Tip: You can read the output using less
. While in less
press SHIFT + F
to read it like a feed. To exit this mode press CTRL + C
and then q
to exit less
.
Interrupting and Restarting the cycle
To interrupt a cycle you can create a file named STOP_CYCLE
(eg. touch STOP_CYCLE
) in the cycle
directory. After completion of the current step, the cycle will break.
To restart a interrupted cycle at any of the past times, delete STOP_CYCLE
and use the flags --cycle
and --task
of the cycle
script. For example
Text Only | |
---|---|
1 |
|
core
module (assimilation). This of course also works with nohup
.
You can also change the enddate
when resarting a cycle. Just make sure you also change the name of a logfile bacy/data/cycle_icon-lam_ass.log_20230928120000_20231129120000
so the last number matches your new endtime
.
Adapting bacy
Bacy is modular and quite flexible. The challenge is to know where to find the settings you want to change. A few hints:
* "global" settings can be changed in modules/common/bacy_conf.sh
This includes parameters like the ensemble size (BA_ENSIZE_ASS
), on-off switches for snow, surface and sst analysis (BA_RUN_SNW
, BA_RUN_SMA
, BA_RUN_SST
) and several settings regarding the icon grid (serach for GRID
)
* each module has
- namelists, which can be found in the modules/module-name/const/
folder. Only the namelists without the .default
ending affect the run. Inside there probably all paramters of the said module can be set.
- the file module_name_conf.sh
containing high-level configurations of the module
- the scripts prep_module-name
, module-name
, save_module-name
which make use of prep_module-name_fcns.sh
, module-name_fcns.sh
, save_module-name_fcns.sh
. Inside said functions the real work of the module (file logistics, putting the namelists together and filling them with values, starting and monitoring the jobs and saving the output) is done. You can insert ksh
prompts inside the functions to get your code executed at the desired time. Be aware that many functions differentiate between cycle and model modes, so make sure your code is actually executed where you put it.
- also see here
Created: December 7, 2023