#!/bin/sh
set -e
# multiply input file by rhoic (sea ice density, 900 kg/m3 for LIM2) -- DY, 2019-01-14.

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
access  inp ${pfx}_${inp}.nc

cdo mulc,900 inp ${pfx}_${out}

release inp
