#!/bin/sh
set -e
# inp * 16./106. -- DY, Jan/2019.

if [ $# -ne 3 ] ; then
  echo "Error in $0: invalid number of arguments $#"
  exit 1
fi

pfx=$1
inp=$2
out=$3

# Get CDO / TEMPORARY!
export PATH=/fs/ssm/hpco/exp/mib002/anaconda/anaconda-4.4.0/anaconda_4.4.0_ubuntu-14.04-amd64-64/envs/cdo-1.9.0/bin:$PATH

release inp
rm -f tmp1

access inp ${pfx}_${inp}.nc

# inp * 16./106.
cdo mulc,16. inp tmp1
cdo divc,106. tmp1 ${pfx}_${out}

release inp
rm -f tmp1
