Earth Sciences

Earth Sciences Wiki

User Tools

Site Tools


tools:postprocessing

Oce monthly and daily

Objective

The bash script ocean_pp.bash performs diagnostics on monthly or daily ocean model outputs. It relies on a set of functions included in common_ocean_post.bash that can also be used within the Ec-Earth and NEMO post templates when using autosubmit. Many of the functions included in common_ocean_post.bash have been built based on Hui Du's post-processing scripts.

First release : May 2012

1. A README file describes the various diagnostics which are available as options through the listpost argument.

The outputs of ocean_pp.bash are of 3 types :

  • 52 different indexes (sea ice volume, MOC intensity, integrated heat content …) which can all be uploaded in R through CFU_load (see diagnostics section)
  • 12 different vertical sections (meridional overturning streamfunction, temperature sections at a given latitude/longitude) which can not be loaded through CFU_load, but the manual loading can be done directly from the files output by ocean_pp.bash
  • 12 different 2-dimensional (maps of SSS, SST, ocean and salt heat content over different layers) which are outputs on the original ORCA grid. Then, those outputs need to be interpolated (see interpolation section) before a manual loading in R.

2. The list of arguments of ocean_pp.bash are the followings :

  • listpost= ( 'siasiesiv' 'ohc' 'moc' 'max_moc' 'area_moc' 'ice' 'sstsssmld' 'heat_sal_mxl' 'psi' 'usalc' 'lmsalc' 'uohc' 'mohc' 'lohc' 'xohc' 'ohc_specified_layer' 'stc' '3dtemp' 'vert_Tsections' 'TSec_ave190-220E' 'NAtlohc' 'xNAtlohc' 'uNAtlohc' 'mNAtlohc' 'lNAtlohc' 'NPacohc' 'xNPacohc' 'uNPacohc' 'mNPacohc' 'lNPacohc' 'TAtlohc' 'xTAtlohc' 'uTAtlohc' 'mTAtlohc' 'lTAtlohc' 'TPacohc' 'xTPacohc' 'uTPacohc' 'mTPacohc' 'lTPacohc' 'TIndohc' 'xTIndohc' 'uTIndohc' 'mTIndohc' 'lTIndohc' 'Antaohc' 'xAntaohc' 'uAntaohc' 'mAntaohc' 'lAntaohc' 'Arctohc' 'xArctohc' 'uArctohc' 'mArctohc' 'lArctohc' ) # described in the README file. For any question, ohc_specified_layer was developed by Isabel, the other ones by Virginie.
  • expid=i00k # 4 digit expid of your experiments or nemovar_s4 / nemovar_combine reanalyses released by ECMWF (most diagnostics for nemovar_s4/nemovar_combine are already available on the nas, check before running any diagnostic you might need on those reanalyses)
  • mod='ecearth' # nemo for NEMO only runs / ecearth for EC-Earth coupled runs
  • typeoutput='MMO' # diags / MMO (diags comes out of NEMO templates if some functions from common_ocean_post have been applied during the run /MMO otherwise)
  • listmemb=( 0 1 2 3 4 ) # list of members
  • syeari=1960 # first start date
  • syearf=2005 # last start date
  • moni=11 # first month of the hindcast
  • intsdate=1 # interval between start dates
  • chunklen=4 # length of the chunks (in months)

Fill up either ltime0/ltimef or year0/yearf below

  • ltime0=1 # first leadtime to post-process
  • ltimef=4 # last leadtime to postprocess
  • year0= # first year to post-process in the first start date
  • yearf= # last year to post-process in the first start date

If you fill up the year argument, complete years will be processed, year by year from moni

  • NEMOVERSION=Ec2.3_O1L42 # NEMO version

Valid options :

Ec2.3_O1L42      for Ec-Earth 2.3 ORCA1    L42
               Ec3.0_O1L46      for Ec-Earth 3.0 ORCA1    L46
               Ec3.0_O25L46     for Ec-Earth 3.0 ORCA0.25 L46
               N3.2_O1L42       for Nemo     3.2 ORCA1    L42
               N3.3_O1L46       for Nemo     3.3 ORCA1    L42
               nemovar_O1L42    for Nemo     COMBINE and ORAS4 ORCA1L42

Beware that with a given horizontal and vertical resolution, let's say ORCA1L46 (O1L46), the 3d land/sea mask is dependent even on the subversion of NEMO. For example, although NEMO3.3 (N3.3_O1L46) is included in Ec-Earth3.0 (Ec3.0_O1L46), N3.3_O1L46 and Ec3.0_O1L46 will not give the exact same result because the masks are different

  • PATHCOMMONOCEANDIAG='/home/'${USER}'/autosubmit/postp/ocean'
  • CON_FILES='/cfu/autosubmit/con_files'
  • rootout='/cfunas/exp/'${mod}'/'${expid}'/monthly_mean'

If you post-process daily or monthly means the output directory is daily_mean or monthly_mean. daily means is only tested for nemo currently

3. Some more specifications:

  • The dependency between the diagnostics is handled, i.e. even if you ask for a diagnostic that depends on another diagnostic, you don't have to worry about the order in which you ask the diagnostics in ocean_pp.sh or even to worry about asking the required pre-diagnostics. ocean_pp.sh will handle that automatically. Ex: If you ask for ('max_moc' 'moc'), ocean_pp.sh will process ('moc' 'max_moc'). If you ask for ('area_moc' 'ohc'), ocean_pp.sh will process ('moc' 'area_moc' 'ohc')
  • If you extend the number of members of an experiment or its forecast length, the output will be gathered on cfunas. Ex : You have already postprocessed for exp t001: 1) members 0-2 between leadtimes 1 and 36, 2) members 0 between leadtimes 37 and 60 If you process member 1-2 between leadtimes 37 and 60, you'll find on the nas a single output with members 0-2 between leadtimes 1 and 60

BUT : You have already postprocessed for exp t001: 1) members 0-2 between leadtimes 1 and 36, 2) members 0 between leadtimes 37 and 60 If you process member 2 between leadtimes 25 and 60, you'll find the two above files plus a new one with members 2 between leadtimes 25 and 60 on the nas

Update January 2013

1. ocean_pp.bash handles now any range of leadtimes instead of complete years only. However, the max_moc diagnostic can not be computed if you do not have complete years since it is a diagnostic computed from annual means.

2. ocean_pp.bash now post-processes daily means also, instead of only monthly means before. You only need to specify as output directory daily_mean instead of monthly_mean because the number of time steps and dates are read from the output. It has been tested with NEMO only simulations but this required some changes in the NEMO templates so that some changes in the EcEarth templates might be needed also before using this option for EcEarth simulations.

Update February 2013

An update was produced in February 2013 by Pierre-Antoine. The main point was to extend the list of variables that could be post-processed. Ocean_pp_new.bash includes the following changes:

  • Now works with a configuration file (to be passed as an argument when running the script: ./ocean_pp.new.bash /home/$user/cfu_git/autosubmit/pp/ocean/config_file &> log ) where all options can be specified, so that the user does not have to modify the script any longer. An example can be found here: /home/pabretonniere/cfu_git/autosubmit/postp/ocean/config_file.sh.
  • In this configuration file (section raw_vars_ocean and raw_vars_ice), you can now specify which 2D variables you want to extract:

If “default” option is specified, it will treat the same variables as before (sosstsst, sosaline and somxl010 for ocean, isnowthi, iicethic, ileadfra, iicetemp, ice_pres for sea ice). If nothing is specified, it will extract all the 2D variables present in the input files. Else, it will treat exclusively the variables listed.

  • Add salinity to the 3D variables to be treated. 3 “new” functions have been implemented: 3dsal -equivalent of already existing 3dtemp for salinity (3-dimensional temperature interpolated horizontally onto the atmospheric grid), SSec_ave190-220E, equivalent of TSec_ave190-220E (meridional temperature section averaged between 190E and 220E) and vert_Ssections (⇒ vert_Tsections, zonal temperature sections along 45S, 0N, 45N, and meridional temperature sections along 30W, 80E, 180E)
  • Automatically checks if the post-processing required has already been performed to avoid doing twice the same things.
  • Memory use optimizations.
Instructions for developers

If you want to include a new diagnostic. Look for the @ signs in the common_ocean_post.bash then ocean_pp.bash and you'll find the locations where you have to include lines of code and some additional instructions so that everything works fine. Feel free to ask if something is not clear.

Some plans for volunteers:

If you want to make available the post-processing tools for new grids, you need to choose a flag for this new grid (such as Ec2.3_O1L42), and then prepare all the configuration files such as done here : /cfu/autosubmit/con_files/ for example for any other flags. Namely you need to prepare the files :

  • depth.flag.txt # list of depths of the model, can be obtained by printing the values from the meshmask
  • mesh_mask_nemo.flag.nc # meshmask available with the model release
  • new_maskglo.flag.nc # mask of various basins, it has to be prepared manually from the tmask in the meshmask
  • weights/flag/rmp_flag_to_*_lev[1 to max level].nc # SCRIP weights to interpolate each ocean model level toward a regular grid (usually the corresponding atmospheric model grid but you can choose whichever you want)
Contact

virginie.guemas@ic3.cat, pierre-antoine.bretonniere@ic3.cat, isabel.andreu-burillo@ic3.cat

Atm monthly

Objective

The purpose is to standardize CFU EC-Earth outputs, to make it follow the common netcdf file conventions of the ENSEMBLE project. Most importantly, it makes CFU people who works on different date sets in a common framework. That means common diagnostic scripts can be used on different dataset. With this in mind, we save all members of one variable of one starting date in one file.

Processed variables

Surface variables| Short Name| Long name| Unit |

tas near surface temperature K
tos sea surface temperature K
prlr total precipitation m s-1
psl mean sea level pressure Pa
rss surface net download shortwave flux W s-2
rls surface net download longwave flux W s-2
hfssd surface downward sensible heat flux W s-2
hflsd surface downward latent heat flux W s-2

Pressure level variables| Short Name| Long name| Unit |

ta air temperature K
ua zonal wind positive to the east m s-1
va meridional wind positive to the north m s-1
g geopotential m2 s-2
Use
  • The post-processing script is located at /cfu/pub/scripts/postp_ecearth/postp_ecearth.sh
  • Run the script by specifying the experiment ID and starting date, like the following:

/cfu/pub/scripts/postp_ecearth/postp_ecearth.sh b014 19601101 # “b014” is the experiment ID and “19601101” is the starting date. In case you only want to post-process subset of the variables, you only need to specify it on the header of the script

  • The output will be saved at /cfunas/exp/ecearth/$expid/monthly_mean # In the above case, $expid is b014
Update february 2013

In February 2013, an update was added to this script to automate the the treatment of the options and to extend the variable list that could be treated. are the main changes:

  • As several new options have been added, in order to simplify the use of the script, users do not need to modify the script anymore to change the options (start date, list of members, variables…). All these options are specified in a configuration file (example: /home/pabretonniere/cfu_git/autosubmit/pp/atmos/config_file. You can copy it in your own repository and modify it your way. This also allows to perform several post-processing at the same time with the same script, you only need to use 2 different configuration files.
  • The complete path of this file is now the only argument to be passed when running the script ( ./nccf_atm_monthly.new.sh ~/cfu_git/autosubmit/pp/atmos/config_file)
  • Users can specify in the config_file the list of variables (separating 2D and 3D) they want to process like before, but if the variable list is left empty, the script will look directly in the files the variables that they contain and will process them all.
  • Add of option to post-process a range of leadtimes only and an ability to concatenate with previous already post-processed leadtimes.
  • When users extend the number of members of an experiment, the script concatenates those members with the previous already post-process members, checking that there is no twice the same members in the output files, or that no member was left out (output file names now include the members that they contains, like in ocean_pp.bash).
  • For tos variable, continental values changed from 0 to NaN.
Contact

pierre-antoine.bretonniere@ic3.cat, muhammad.asif@ic3.cat, huidu@ic3.cat

Atm daily

Objective

The purpose is to select daily outputs (every 6 hours for variables with one level and every 12 hours for pressure level variables) from the GRIB files IFS produces, to make it follow the common NetCDF file conventions of the ENSEMBLES project in the same way as it is done for the EC-Earth monthly outputs. 24 basic variables are saved for the purpose of performing diagnostics if intraseasonal variability.

Processed variables

Surface variables| Short Name| Long name| Unit |

tas near surface temperature K
tos sea surface temperature K
prlr total precipitation m s-1
psl mean sea level pressure Pa
rss surface net downward shortwave flux W s-2
rls surface net downward longwave flux W s-2
rsds solar radiation incident at the surface W s-2
rlds longwave radiation incident at the surface W s-2
hfssd surface downward sensible heat flux W s-2
hflsd surface downward latent heat flux W s-2
tdps near-surface dewpoint temperature K
uas near-surface zonal wind positive to the east m s-1
vas near-surface meridional wind positive to the north m s-1
rst difference of solar radiation from above and from below at the top of the atmosphere W s-2
rlut difference of longwave radiation from above and from below at the top of the atmosphere W s-2
snld snow depth in metres of water equivalent m
evlwr moisture flux into the surface from the atmosphere m s-1
ts surface temperature K
clt cloud area fraction for the whole atmosphere column none

Pressure-level variables| Short Name| Long name| Unit |

ta air temperature K
ua zonal wind positive to the east m s-1
va meridional wind positive to the north m s-1
g geopotential m2 s-2
hus mass fraction of water vapor in moist air kg kg-1
Use
  • The post-processing script is located at /cfu/pub/scripts/postp_ecearth/postp_daily.sh
  • Run the script by specifying the experiment id and start date as follows:

/cfu/pub/scripts/postp_ecearth/postp_daily.sh $expid 19601101 # where $expid is the experiment id and “19601101” is the starting date; the script will postprocess all the GRIB files for this start date

  • The output will be saved at /cfunas/exp/ecearth/$expid/daily # where $expid is the experiment id
  • There is a script /cfu/pub/scripts/postp_ecearth/postp_daily.asgard.sh very similar to postp_daily.sh. The grib files are currently on asgard. To avoid to copying files to cfunas and also avoid to run the script on asgard which is used to transfer data, the original postp_daily.sh has been modified a bit in order to scp grib files from asgard to local machine. If you can access data from your machine directly (and, hence, there is no need to transfer files from another machine), the script post_daily.sh is OK to use.
Contact

muhammad.asif@ic3.cat, huidu@ic3.cat

tools/postprocessing.txt · Last modified: 2015/05/26 13:18 (external edit)