#!/bin/tcsh

set DATADIR = '../../DATA'
set OUTDIR = 'picked'
set PROG = 'findval_mod.f90'
# ~/util/WGRIB2_from_NOAA/grib2/wgrib2/wgrib2 -no_header ../../../DATA/20080101000000 -bin tmp
set WGRIB2 = '~/util/WGRIB2_from_NOAA/grib2/wgrib2/wgrib2'

mkdir $OUTDIR
cd $OUTDIR
rm *

gfortran ../$PROG -o findval_mod

foreach t (../$DATADIR/2*)
set yyddmm = $t:t
echo $yyddmm

$WGRIB2 -no_header $t -bin tmp
ls -l $t tmp
./findval_mod $yyddmm tmp ../JALPS_Place_tbl.txt
rm tmp
end
