#-------------------------------------------------------------------- # Configure file for ChemicalRates. Its job is to # a) determine the nspecies and nreactions from a chem.inp file, # if specified. If not, use nspecies=64, nreactions=421 # b) Turn -DALL_SPECIES flag on or off. By default, it it turned off. # -DALL_SPECIES indicates to the libraries in lib/ that all species # values are being supplied. Else it calculates the slack species # via Y_slack_species = 1 - \sum Y_i # c) Turn -DNON_DIMENSIONAL flag on or off. By default, it it turned off. # -DNON_DIMENSIONAL indicates that all input and output is in # non dimensional form. #-------------------------------------------------------------------- ## make sure we are in the correct dir AC_INIT(MakeIncl.ChemSys.in) ## ----------------------------------------------------------------------------- # Default values default_nspecies="64" default_nreactions="421" default_species_flag="" ## Things I have to look for AC_ARG_WITH(mechanism, [ Location of a chem.inp file with the desired chemical mechanism in CHEMKIN format : --with-mechanism=Full_file_name, Full path and file name where the desired chemical mechasnim is; --with-mechanism='/home/bill/gri1.2/chem.inp'], [with_mechanism="$withval"], [with_mechanism=yes]) case "$with_mechanism" in no) # The user specified he doesn't want to specify a mechanism. # Crap out - can't have chemistry without a chemical mechanism. AC_MSG_ERROR([ Option --without-mechanism will not work; the package needs it]) ;; yes) # The user did not give a specific chem.inp file. Use default. AC_MSG_CHECKING( [for chemical system size] ) with_mechanism=_found nspecies="$default_nspecies" nreactions="$default_nreactions" AC_MSG_RESULT( [ using nspecies = "$nspecies", nreactions = "$nreactions" ] ) ;; *) # The user gave me a real chem.inp. Check for the file anyway. AC_MSG_CHECKING( [for chem.inp] ) if test -r "$with_mechanism"; then AC_MSG_RESULT( [ Found "$with_mechanism; processing it ] ) ## delete ol chemical system size file. /bin/rm -f ./sizes.sh mech_filename="$with_mechanism" ## get the new sizes, dumped in sizes.sh in format : ## NSPECIES=XX ## NREACTIONS=YY perl -w config/get_sizes.pl $mech_filename ## Get these values if test -s sizes.sh ; then nspecies=`cat ./sizes.sh | grep NSPECIES | awk -F = '{print $2}'` nreactions=`cat ./sizes.sh | grep NREACTIONS | awk -F = '{print $2}'` AC_MSG_RESULT( [ found nspecies = $nspecies, nreactions = $nreactions ] ) else AC_MSG_ERROR( [ config/get_sizes.pl could not process the mechanism file ] ) fi ## delete the sizes.sh file /bin/rm -f size.sh with_mechanism=_found else AC_MSG_ERROR( [ Could not find "$with_mechanism" ] ) fi ;; esac ############################################### AC_ARG_WITH(allspecies, [ Whether the component will be configured to accept all species : --with-allspecies=[yes/no], whether all species will be supplied, or all species minus slack; --with-allspecies='yes'], [with_allspecies="$withval"], [with_allspecies=no]) case "$with_allspecies" in no) # The user specified he will supply all species minus slack species. # Crap out - can't work without it. AC_MSG_CHECKING( [for all species or not] ) species_flag="$default_species_flag" AC_MSG_RESULT([ configuring assuming that slack species will not be supplied] ) ;; yes) # The user did not give the location so search for this AC_MSG_CHECKING( [for all species or not] ) species_flag="-DALL_SPECIES" AC_MSG_RESULT([ configuring assuming that slack species will be supplied] ) ;; *) # The user gave me something other than yes or no. Doesn't mean anything. Crap out. AC_MSG_ERROR( [ --with-allspecies can only be yes or no. ] ) ;; esac ################################################ AC_ARG_WITH(nondim, [ Whether the component receives and returns non-dimensional data : --with-nondim=[yes/no], whether input and output data are non-dimensional or dimensional; --with-nondim='yes'], [with_nondim="$withval"], [with_nondim=no]) case "$with_nondim" in no) # The user specified he/she will supply and expect back dimensional data. # So do not put -DNON_DIM when compiling AC_MSG_CHECKING( [ whether we work with dimensional or non-dimensional quantities.. ] ) nondim_flag="" AC_MSG_RESULT([ configuring assuming that all input and output data will be dimensional] ) ;; yes) # The user did not give the location so search for this AC_MSG_CHECKING( [ whether we work with dimensional or non-dimensional quantities.. ] ) nondim_flag="-DNON_DIM" AC_MSG_RESULT([ configuring assuming that all input and output data will be non-dimensional] ) ;; *) # The user gave me something other than yes or no. Doesn't mean anything. Crap out. AC_MSG_ERROR( [ --with-nondim can only be yes or no. ] ) ;; esac ## ----------------------------------------------------------------- # Final step. Substitute these definitions and form a # MakeIncl.ChemSys file Also, put these in the various parameter.par.in files # AC_SUBST(nspecies) AC_SUBST(nreactions) AC_SUBST(species_flag) AC_SUBST(nondim_flag) AC_OUTPUT(MakeIncl.ChemSys lib/chem/parameter.par lib/therm/parameter.par prep_tables/der_tables/parameter.par prep_tables/tables/parameter.par, [] [])