setup_development.bash 1.98 KB
Newer Older
#!/bin/bash
# 
# This script intends to support the development of new functions in 
# common_ocean_post.txt of new options to existing funtions. It allows to 
# test quickly these developments
#
# History : Virginie Guemas - Initial version                    -  2012 
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set -evx
# This does not need to be changed :
pabretonniere's avatar
pabretonniere committed
CON_FILES='/esnas/autosubmit/con_files'
# This option is compatible with the testing on i00k but if you want to test
# your developments on another experiment you would need to change this :
NEMOVERSION=Ec2.3_O1L42
# This lines needs to be replaced by the path were you stored your modifed
# version of common_ocean_post.txt :
source /home/Earth/rcruzgar/ocean_diagnostics/common_ocean_post.txt
# Here we only fetch one random chunk of outputs from i00k :
pabretonniere's avatar
pabretonniere committed
cp /esnas/exp/ecearth/i00k/19601101/fc0/outputs/MMO_i00k_19601101_fc0_19601101-19610228.tar .
# Here we untar and gunzip these files :
tar -xvf MMO_i00k_19601101_fc0_19601101-19610228.tar
gunzip *.gz
# The lines below might need to be changed depending on which function you need
# to test. In the case below, the grid_T files are needed because they contain
# the 3d temperature = input to ohc function. If you test siasiesiv for exemple,
# you would need to replace grid_T by icemod. 
filein=`ls *grid_T*`
cdo cat *grid_T* tmp.nc
# The lines below are essential because the files have a time dimension named
# time in all the functions from common_ocean_post.txt (this is handled in 
# ocean_pp.bash and in the templates)
timevar=`ncdump -h tmp.nc | grep UNLIMITED | awk '{print $1}'`
if [[ $timevar == 'time_counter' ]] ; then ncrename -v time_counter,time -d time_counter,time tmp.nc ; fi
# Some cleaning
rm -f *grid* *icemod*
# This is the final testing line. You need to replace that line by the function
# you want to test (here it is ohc) followed by all its arguments (here we have
# only the input file tmp.nc and the output file tmpout.nc)
ohc tmp.nc tmppout.nc 'Glob'