#!/bin/bash


replay_comment="replay automatic include"
if [ $# = 0 ] ; then
   \rm -f dump_replay*.h dump_param.h dump_ini.h call_param_repla* get_ini_modul* input tmp tmp2 tmp3 tmp2_cpp
   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
