#!/bin/bash

WSN=2
EXPNAME=bench04a
ITR=30
MAP_AXIS=0,45,0

gpview --wsn $WSN --itr $ITR --map_axis $MAP_AXIS $EXPNAME"$n"_T42_LF_rst001.nc@h_n ; mv dcl.ps $EXPNAME"$n"_T42_LF_Hsfc_0.ps
gpview --wsn $WSN --itr $ITR --map_axis $MAP_AXIS $EXPNAME"$n"_T42_LF_rst001.nc@u_n ; mv dcl.ps $EXPNAME"$n"_T42_LF_VelLon_0.ps
gpview --wsn $WSN --itr $ITR --map_axis $MAP_AXIS $EXPNAME"$n"_T42_LF_rst001.nc@v_n ; mv dcl.ps $EXPNAME"$n"_T42_LF_VelLat_0.ps
#

for TIME in 432000
do gpview --wsn $WSN --itr $ITR --map_axis $MAP_AXIS $EXPNAME"$n"_T42_LF_2d_001.nc@h,t=$TIME ; mv dcl.ps $EXPNAME"$n"_T42_LF_Hsfc_"$TIME".ps
gpview --wsn $WSN --itr $ITR --map_axis $MAP_AXIS $EXPNAME"$n"_T42_LF_2d_001.nc@u,t=$TIME ; mv dcl.ps $EXPNAME"$n"_T42_LF_VelLon_"$TIME".ps
gpview --wsn $WSN --itr $ITR --map_axis $MAP_AXIS $EXPNAME"$n"_T42_LF_2d_001.nc@v,t=$TIME ; mv dcl.ps $EXPNAME"$n"_T42_LF_VelLat_"$TIME".ps
gpview --wsn $WSN --itr $ITR --map_axis $MAP_AXIS $EXPNAME"$n"_T42_LF_2d_001.nc@h_error,t=$TIME ; mv dcl.ps $EXPNAME"$n"_T42_LF_HsfcError_"$TIME".ps
gpview --wsn $WSN --itr $ITR --map_axis $MAP_AXIS $EXPNAME"$n"_T42_LF_2d_001.nc@u_error,t=$TIME ; mv dcl.ps $EXPNAME"$n"_T42_LF_VelLonError_"$TIME".ps
gpview --wsn $WSN --itr $ITR --map_axis $MAP_AXIS $EXPNAME"$n"_T42_LF_2d_001.nc@v_error,t=$TIME ; mv dcl.ps $EXPNAME"$n"_T42_LF_VelLatError_"$TIME".ps
done

#
gpview --wsn $WSN $EXPNAME"$n"_T42_LF_1d_001.nc@l1normHsfc ; mv dcl.ps $EXPNAME"$n"_T42_LF_l1normHsfc.ps
gpview --wsn $WSN $EXPNAME"$n"_T42_LF_1d_001.nc@l2normHsfc ; mv dcl.ps $EXPNAME"$n"_T42_LF_l2normHsfc.ps
gpview --wsn $WSN $EXPNAME"$n"_T42_LF_1d_001.nc@linfnormHsfc ; mv dcl.ps $EXPNAME"$n"_T42_LF_linfnormHsfc.ps
#
gpview --wsn $WSN $EXPNAME"$n"_T42_LF_1d_001.nc@l1normVel ; mv dcl.ps $EXPNAME"$n"_T42_LF_l1normVel.ps
gpview --wsn $WSN $EXPNAME"$n"_T42_LF_1d_001.nc@l2normVel ; mv dcl.ps $EXPNAME"$n"_T42_LF_l2normVel.ps
gpview --wsn $WSN $EXPNAME"$n"_T42_LF_1d_001.nc@linfnormVel ; mv dcl.ps $EXPNAME"$n"_T42_LF_linfnormVel.ps
#

for file in *.ps
do new=`basename $file .ps`
pstopnm $file
next=$new"001".ppm
echo $next
convert -rotate 90 $next $new.png
done



exit 0
