#!/bin/csh
#convert from ncar mudras format to netcdf format for display in zeb
# Usage: mudtocdf mudfile cdfdir mudfld cdffld...
# first argument is data file, 
# example dm2zebconvsf convsf.dm

# unsetenv the origin so it read it from the mudras file
#unsetenv ORIGIN_LAT 
#unsetenv ORIGIN_LON 
# set the origin to be  MLB
setenv ORIGIN_LAT 28.1131
setenv ORIGIN_LON -80.6544
# save this directory
set dir = `pwd`
# first move to the zeb data directory
pushd /zd/aiw/bogus
echo "input file:"$dir/$1
#echo "field file:"$dir/$2
echo "ORIGIN_LAT is" $ORIGIN_LAT
echo "ORIGIN_LON is" $ORIGIN_LON
# now translate the file into its new format
set fields = `cat /home/disk/anvil/toga/yuter/mlb/aiw.fields`
echo the fields are: $fields
# -o so can use files in dm format
/zeb/bin/convmud -o $dir/$1 bogus. $fields
popd