Skip to content

Calculating Analysis Increments

Kriti Bhargava edited this page Aug 12, 2019 · 2 revisions

# Using cal_ai.py

The script cal_ai.py helps to calculate analysis increments from the grd files. It first converts the grd files to nc files. Then calculates the analysis increments for the specified dates. If specified, it calculates the average analysis increments too. a new folder in the DATA/$EXP called nc_files is created to store these.

Usage

You can find how to use the utility by running ./util/scripts/cal_ai.py -h. Running this will give you.

cal_ai.py [-h] [--cycle {0,6,12,18}] [--cal_avg] [--store_all] startdate enddate exp {ocn,atm}
Calculate analysis increments for specific dates and if specified calculate
the average too.

positional arguments:
  startdate            START DATE in YYYYMMDDHH format
  enddate              END DATE in YYYYMMDDHH format
  exp                  Experiment name for which analysis increments to be
                       computed.
  {ocn,atm}            Domain for calculating analysis increment ['ocn','atm']

optional arguments:
  -h, --help           show this help message and exit
  --cycle {0,6,12,18}  Cycle for calculating analysis increment. Assumes all
                       cycles if not specified
  --cal_avg            If specified calculates the temporal average analysis
                       increments for the dates specified.
  --store_all          If specified the option saves all the analysis
                       increments file, if not only the average is kept if
                       cal_avg specified.

For example you want to calculate analysis increments for all 12z cycle in the month of June and average them for ocn for an experiment name "exp01". You run the following command

python /util/scripts/cal_ai.py 2006060112 2006063018 exp01 ocn --cycle 12 --cal_avg

This will automatically look for the grid files in $CFS_LETKF_ROOT/DATA/$exp_name/anal/mean and $CFS_LETKF_ROOT/DATA/$exp_name/gues/mean. Convert to netcdf files based on the ctl files available here. Put these file in $CFS_LETKF_ROOT/DATA/$exp_name/nc_file/anal, $CFS_LETKF_ROOT/DATA/$exp_name/nc_file/gues, $CFS_LETKF_ROOT/DATA/$exp_name/nc_file/anlinc. At the end the script by default removes the individual netcdf files for analysis and guess. If you want to save these specify the option --store_all.