Commit Graph

3 Commits (6259514cd1a961848edb6cb5b2996ec63d3020c1)

Author SHA1 Message Date
Salvatore Filippone e2b2a202c0 Fixed C include file and its generation. 14 years ago
Michele Martone e922dce38b mld2p4-2:
MLD's constants are back authoritative in the .F90 file.
the .h file is a slave one: built from the .F90.
in a script for the (by hand, no Makefile rule for now) conversion.
14 years ago
Michele Martone 69a7fc4208 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
14 years ago