#!/bin/csh -f

#pgf90 /owen2/hkanamaru/RSM_c2r/runs/tools/r_a2d18L.f
pgf90 -r8 -O2 -Mrecursive -Mdalign -DLINUX -byteswapio /owen2/hkanamaru/RSM_c2r/runs/tools/r_a2d18L.f

foreach fil( s_r_sigG*[0-9].asc )

  rm -f fort.*

  set cfil = `echo $fil | cut -c1-14`
  set cfil4 = `echo $fil | cut -c11-14`
  set cfil3 = `echo $fil | cut -c12-14`
  set cfil2 = `echo $fil | cut -c13-14`

  ln   -sf   $cfil\.asc   fort.30

if ( $cfil4 < 100 ) then
#  ln   -sf   $cfil\.dbl   fort.60
  ln   -sf   r_sig.ft$cfil2   fort.60
else if ( $cfil4 < 1000 ) then
  ln   -sf   r_sig.ft$cfil3   fort.60
else 
  ln   -sf   r_sig.ft$cfil4   fort.60
endif

 ./a.out

 ls -al ${fil}*
# exit

end



exit
