mld2p4-2:
...
created a header file with symbolic constants and using them instead of the fortran constants.
cat mld_base_prec_type.F90 | while read ; do
if [[ "$REPLY" =~ 'parameter ::' ]]; then
UC=`echo "$REPLY" | sed "s/.*\(mld[a-z_0-9]*_\>\) *=.*$/\1/g" | perl -e "while(<>){print(uc($_));};"`
echo "$REPLY" | sed "s/\(.*\)\(mld[a-z_0-9]*_\> *=\).*$/\1\2 $UC/g"
else echo "$REPLY" ; fi ; done > tmpfile ; mv tmpfile mld_base_prec_type.F90
hn=mld_const.h
echo '' > $hn
echo '#ifdef __cplusplus' >> $hn
echo 'extern "C" { ' >> $hn
echo '#endif' >> $hn
cat mld_base_prec_type.F90 | grep '\(^ *!\)\|parameter' | grep '_\>' | sed 's/^\s*//g;s/^.*:://g;s/\s*=\s*/ /g' | sed 's/,
/\n/g;s/^ //g' | perl -e "while(<>){print(uc($_));};" | grep ^MLD | sed 's/^/#define /g' >> $hn
#cat mld_base_prec_type.F90 | sed 's/\( parameter *:: *\)\(\<[a-z0-9_]*\>\) *=.*$/\1\2 = \2 UPPP/g'
echo '#ifdef __cplusplus' >> $hn
echo '}' >> $hn
echo '#endif' >> $hn