Skip to content

Instantly share code, notes, and snippets.

@dpo
Created November 8, 2010 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpo/668191 to your computer and use it in GitHub Desktop.
Save dpo/668191 to your computer and use it in GitHub Desktop.
Comment out declaration of ETIME as EXTERNAL in Fortran files.
#!/bin/bash
# etime intrinsic cannot be declared as EXTERNAL with gfortran on OSX.
files_with_etime=`find . -name "*.[fF]" | xargs grep -l -i 'etime'`
for fname in $files_with_etime
do
mv $fname ${fname}.backup
sed -e 's/^ \(EXTERNAL[ ]*ETIME.*\)/C \1/' ${fname}.backup > $fname
rm ${fname}.backup
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment