#!/bin/csh

  set modelruns = (dms_ndg1_sen2 dms_ndg2_sen2 dms_ndg3_sen2 dms_ndg4_sen2 dms_ndg5_sen2 \
                   dms_ndg1_sen1 dms_ndg2_sen1 dms_ndg3_sen1 dms_ndg4_sen1 dms_ndg5_sen1) 

  set indir     = `pwd` 
 foreach n ( `seq ${#modelruns}` )
      if($n >= 6) then
       set trange = "2049m01_2051m12"
       else
        set trange = "1999m01_2001m12"
      endif
  set runid = $modelruns[$n]
  set str   = `echo $runid | awk '{print substr($0,1,8)}'`  
  echo $str
  echo .................................................
  echo                working on runid   =  $runid
  echo                run number         =  $n
  echo .................................................  
  set expname = "nodms"  
  echo $expname

    mv ${indir}/pa_${runid}_tirf_${trange}_m09_gp.nc   ${indir}/pa_${str}_${expname}_tirf_${trange}_m09_gp.nc
    mv ${indir}/pa_${runid}_tirf_${trange}_ann_gp.nc   ${indir}/pa_${str}_${expname}_tirf_${trange}_ann_gp.nc
    mv ${indir}/pa_${runid}_tirf_${trange}_djf_gp.nc   ${indir}/pa_${str}_${expname}_tirf_${trange}_djf_gp.nc 
    mv ${indir}/pa_${runid}_tirf_${trange}_mam_gp.nc   ${indir}/pa_${str}_${expname}_tirf_${trange}_mam_gp.nc
    mv ${indir}/pa_${runid}_tirf_${trange}_jja_gp.nc   ${indir}/pa_${str}_${expname}_tirf_${trange}_jja_gp.nc
    mv ${indir}/pa_${runid}_tirf_${trange}_son_gp.nc   ${indir}/pa_${str}_${expname}_tirf_${trange}_son_gp.nc

end
