#!/bin/bash ## g.e. # lmdz_point.bash 99 32 32 if test $1 = '-h'; then echo "*********************************" echo "*** Shell to know to which 2D ***" echo "*** coordinates corresponds a ***" echo "*** LMDZ grid point ***" echo "*********************************" echo "lmdz_point.bash [LMDZpoint] [dimx] [dimy]" else rootsh=`pwd` LMDZpoint=$1 dimx=$2 dimy=$3 y=`expr ${LMDZpoint} / ${dimx}` x=`expr ${LMDZpoint} - ${y} '*' ${dimx} - 1` echo "2D point (C/python-like): "${x}","${y} fi