#!/bin/csh -bf # This routine checks the date in the fix.stacov file # output by ambigon. If the date does not match the value # that is found if SaveObsDate (for instance the leading # 0 is dropped from the two digit year in the year 2000) # it replaces the date with the correct value found in # SaveObsDate if ($#argv < 1) then echo " " echo "Usage: gp.fix_stacov_2000_year stacov_file" echo " " exit 1 endif set true_date = `grep datejpl SaveObsDate | awk '{print $2}'` set new_date = `grep datejpl SaveObsDate | awk '{print $2}' | tr '[a-z]' '[A-Z]'` set date = `head -1 $1 | awk '{print $4}' | tr '[A-Z]' '[a-z]' | tr '[.]' '[ ]'` set dateuc = `head -1 $1 | awk '{print $4}' | tr '[.]' '[ ]'` echo $true_date echo $new_date echo $date if ($true_date != $date) then echo "WARNING: Date in stacov file output by ambigon is" echo " incorrect. It will be replaced with the correct" echo " value" echo " value in stacov file: "$dateuc echo " correct value: "$new_date replace " $dateuc" "$new_date" $1 endif