#!/bin/sh

#             $HOME/.lcmodel/marconi/bin2raw (8 December 2000)
#
#                  Specific Instructions for this File
#                  ===================================

#     If you want to modify this file, use this file as a template only; copy 
# it to my-bin2raw (in the same directory as bin2raw), and then edit 
# my-bin2raw.
#     LCMgui always first attempts to execute my-bin2raw.  If LCMgui cannot 
# find my-bin2raw, then it executes bin2raw.
#     bin2raw will be overwritten by LCMgui updates, but your my-bin2raw will 
# not be overwritten.
#----------------------------------------------------------------------------

#     This script does very little but call the Fortran program bin2asc.
#     $HOME/.lcmodel/philips/bin2raw provides a more complete example.

#     Normally you do not have to read anything further in this script.

#=============================================================================
#=============================================================================
#=============================================================================

# Define paths of files & directories
# Note that $LCM_DIR has a "/" at the end and the others do not.
#
MET_DIR=$2met

CP_START=$MET_DIR/cpStart
EXTRA_INFO=$MET_DIR/extraInfo
ERROR=$MET_DIR/error
MET_RAW=$MET_DIR/RAW
H2O_RAW=$2h2o/RAW
#-----------------------------------------------------------------------------

# Delete possible old files, e.g., those remaining after "Reload" Button. 
#
rm  -f  $CP_START
rm  -f  $EXTRA_INFO
rm  -f  $ERROR
rm  -f  $MET_RAW
rm  -f  $H2O_RAW
#-----------------------------------------------------------------------------

# DEGPPM_PRESS = DEGPPM that will be used for PRESS data
# DEGPPM_STEAM = DEGPPM that will be used for STEAM data
DEGPPM_PRESS=28.0
DEGPPM_STEAM=2.5
#-----------------------------------------------------------------------------

# Execute bin2asc.  The 8 items preceding bin2asc are read by bin2asc.
echo "'$1'
      '$2' 
      '$CP_START'
      '$EXTRA_INFO'
      '$ERROR'
      '$MET_RAW'  
      '$H2O_RAW'
      $DEGPPM_PRESS
      $DEGPPM_STEAM" | $HOME/.lcmodel/marconi/bin2asc

exit 0
