#!/bin/bash


replay_comment="replay automatic include"
if [ $# = 0 ] ; then
   \rm -f dump_replay*.h mcall_param_replay.F90 dump_ini_module.F90 get_ini_module.F90 input tmp tmp2
   for file in `grep "$replay_comment" *F90 | cut -d: -f1` ; do
      sed -i"" -e "/$replay_comment/d" $file
   done
else
   for file in $* ; do
       list_include=`grep $replay_comment $file | grep include | cut -d\" -f2`
       echo removing $list_include
       \rm -f $list_include
       \rm -f dump_replay_`basename $file .F90`_*h
       sed -i'' -e "/$replay_comment/d" $file
   done
fi
