MODULE constants_module !### !***************************************************************************** ! * ! Module Name: constants_module * ! * ! File Name: constants_module.f90 * ! * ! Purpose: Contains constants for the size and types of global variables* ! * ! Author: Robert L. Reese * ! * ! Date: February 04, 2004 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 02/04/04 0 Initial Release * ! R.L. Reese 03/28/06 A Added integration constants * ! sizes for Speces Module * ! Increased size of atoms for E * ! Changed file lengths to 1024 * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE constants_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! constants_module * ! double_kind - Integer variable containing kind value for 15 bit * ! precision * ! double_p - Integer value of number of digits of precision * ! double_module * ! matrix_columns - Integer value of number of matrix columns * ! matrix_rows - Integer value of number of matrix rows * ! eqlbrm_module * ! ak1_size - Integer value of size of ak1 array * ! ak2_size - Integer value of size of ak2 array * ! ak4_size - Integer value of size of ak4 array * ! delg_size - Integer value of size of delg array * ! deln_size - Integer value of size of deln array * ! gas1_len - Integer value of length of first type of gas char * ! gas2_len - Integer value of length of second type of gas char * ! itn - Integer value of intital iteration count * ! last_temp - Integer value index to temperature to check for * ! current temperature range * ! ncond_test - Integer value to use for singularity test * ! nocon2_test - Integer value to use for second singularity test * ! num_int_max - Integer value for maximum of num_int allowed * ! num_logs - Integer value for number of logs to use in * ! calculations from data in Janaf Tables * ! num_moles - Integer value of number of moles to use to * ! to determine if species is to be removed * ! indx_module * ! aa_size - Integer size of the aa array * ! bb_size - Integer size of the bb array * ! coefx_size - Integer value of size of coefx array * ! char_len - Integer value used as len of char to replace default * ! length of 4 characters in one word for FORTRAN 4 and * ! FORTRAN 77 * ! ll_test - Integer value to use for test to determine which * ! reactants to remove of add * ! newmol_test - Integer value to use for test to determine if new * ! search is to be bypassed * ! new_test - Integer value to use for test to determine if one * ! reactant is to be added or removed * ! second_add - Integer value to use for second index of add array * ! switch_index - Integer value to use for index in switching values * ! third_add - Integer value to use for third index of add array * ! third_base - Integer value to use for third index of base array * ! third_top - Integer value to use for third index of top array * ! to_size - Integer value to use for size of to array * ! misc_module * ! file_length - Integer value of number of characters in file name * ! iatom_length - Integer length of iatom characters * ! idata_length - Integer length of the idata array * ! input_unit - Integer value of the input unit number * ! insert_length - Integer length of the specie to be included * ! insert_max - Upper do loop boundary for transfering insert * ! specie name * ! len_blank - Integer value of length of blank character * ! len_char - Integer value used as len of char to replace default * ! length of 4 characters in one word for FORTRAN 4 and * ! FORTRAN 77 * ! max_atoms - Integer containing maximum number of atoms * ! max_reacts - Integer containing maximum number of reactants in a * ! record * ! message_offset - Integer value for offset of message number to use * ! message_numbers - Integer value of number of error messages * ! newmol_reset - Integer value to reset newmol to for next run * ! nnames - Integer value number of built in species * ! noconv_test - Integer value of maximum number of no convergence * ! results * ! npt_maximum - Integer value of maximum number of npt's for output * ! omit_length - Integer length of the specie to be omitted * ! omit_max - Upper do loop boundary for transfering omitted * ! specie name * ! output_unit - Integer value of the output unit number * ! react_message - Integer containing message number for read error * ! react_sets - Integer value of maximum number of reactant records * ! react_values - Integer value of maximum number of reactant values * ! per reactant records(sets) * ! reread_length - Integer value of length of re-read buffer for * ! subroutine read_error * ! scratch_unit - Integer value of logical unit for scratch file * ! search_message - Integer value of message to output for read error * ! species_max - Integer value of maximum number of species allowed * ! stop_or_go_len - Integer value of length of stop_or_go character * ! t_p_nrecs - Integer value of maximum number of records for temp * ! and pressure values * ! t_p_values - Integer value of maximum number of temp or pressure * ! values per input record * ! temp_data_len - Integer value of length of temp_data * ! therm_message - Integer index to message for read_error * ! therm_unit - Integer unit number of logical unit for input * ! of thermodynamic data * ! out1_module * ! fug_size - Integer value of size of fug array * ! ib_length - Integer value of length of ib character * ! io2_length - Integer value of length of io2 character * ! jt_value - Integer value of maximum size of output line values * ! max_react - Integer value of maximum size of output line for * ! reactants * ! qfmrel_size - Integer value of size of qfmrel array * ! tc_size - Integer value of size of tc array * ! v_size - Integer value of size of v array * ! points_module * ! npt_size - Integer value of number of points saved for output * ! pt_size - Integer value of total number of pressures and * ! temperatures * ! search_module * ! b_size - Integer variable used as size of b array * ! date_high_size - Integer variable used as high size of date array * ! date_low_size - Integer variable used as low size of date array * ! gas_len - Integer value of lenth of gas * ! iend_len - Integer value of length of iend * ! insert_flag_len- Integer variable used as length of insert_flag * ! lmt_size - Integer variable used as size of lmt array * ! max_char - Integer variable used as maximum number of * ! characters allowed in a name * ! max_mole - Integer variable used as maximum number of moles * ! max_species - Integer variable used as maximum number of species * ! ms_increment - Integer variable used as do loop increment for * ! finding species in record * ! mt_size - Integer variable used as size of mt array * ! nam_size - Integer variable used as size of nam array * ! ns_increment - Integer variable used as do loop increment for * ! outputting species names used in current problem * ! omit_flag_len - Integer variable used as length of omit_flag * ! phaz_length - Integer variable used as length of phaz character * ! second_date - Integer variable used as index to second date on * ! coefficient record * ! second_temp - Integer variable used as index to second temp on * ! coefficient record * ! tdate_high_size- Integer variable used as high size of tdate array * ! tdate_low_size - Integer variable used as low size of tdate array * ! toobig_high_size- Integer variable used as high size of toobig array * ! toobig_low_size- Integer variable used as low size of toobig array * ! tsub_high_size - Integer variable used as high size of tsub array * ! tsub_low_size - Integer variable used as low size of tsub array * ! speces_module * ! b_values_number- Integer value of number of integration sets per * ! species * ! b_values_sets - Integer value of number of integration sets * ! coeff_number - Integer value of number of coefficient sets per * ! species * ! coeff_sets - Integer value of number of coefficient sets * ! high_coeff - Integer index to set of high coefficients * ! high_coeff_test- Integer value to test for use of high coefficients * ! len_chars - Integer value of length of code characters * ! low_coeff - Integer index to set of low coefficients * ! max_elements - Integer value of maximum elements in a current system * ! maximum_species- Integer value of number of species allowed * ! npt_number - Integer value of number of points output at once * ! num_chars - Integer value of number of char*4 characters * ! phase_range - Integer value to use for plus/minus search of * ! condensed species being used * ! temp_sets - Integer value of number of sets of T range * ! * ! External Software: * ! ----------------- * ! * ! selected_real_kind - Returns kind type for precision required * ! * ! Modules: * ! -------- * ! None * ! * ! Interfaces: * ! ----------- * ! * ! None * ! * !***************************************************************************** !### IMPLICIT none ! Change this value to increase or decrease number of species to be included in ! a problem. Originally defined in subroutine search. Also affects the number ! of species put into temporary storage and number of species that exceed this ! number INTEGER, PARAMETER :: max_species = 100 ! Change this value to increase or decrease number of elements to be included in ! a problem. Originally defined in module speces. This is the total number of elements ! allowed in the reactant input records. INTEGER, PARAMETER :: max_elements = 15 ! Change this value to increase or decrease number of points output per line in thermodynamic ! properties output. Current value fits on screen for font size of 10 INTEGER, PARAMETER :: npt_maximum = 6 ! Change this value to increase or decrease number of precision for double precision numbers ! Current value is for 15 points of precision INTEGER, PARAMETER :: double_p = 15 INTEGER, PARAMETER :: double_kind = selected_real_kind(p = double_p) ! Contants for array sizes in double_module INTEGER, PARAMETER :: matrix_columns = 21 INTEGER, PARAMETER :: double_rows = 20 ! Constants for array sizes in eqlbrm_module INTEGER, PARAMETER :: ak1_size = 8 INTEGER, PARAMETER :: ak2_size = 8 INTEGER, PARAMETER :: ak4_size = 8 INTEGER, PARAMETER :: delg_size = max_species INTEGER, PARAMETER :: deln_size = max_species INTEGER, PARAMETER :: gas1_len = 2 INTEGER, PARAMETER :: gas2_len = 3 ! General constants in eqlbrm routines INTEGER, PARAMETER :: itn = 35 INTEGER, PARAMETER :: last_temp = 2 INTEGER, PARAMETER :: ncond_test = 2 INTEGER, PARAMETER :: nocon2_test = 2 INTEGER, PARAMETER :: num_int_max = 15 INTEGER, PARAMETER :: num_logs = 8 INTEGER, PARAMETER :: num_moles = 10 ! General constants for indx_module INTEGER, PARAMETER :: aa_size = max_elements INTEGER, PARAMETER :: bb_size = max_elements INTEGER, PARAMETER :: coefx_size = 20 INTEGER, PARAMETER :: char_len = 4 INTEGER, PARAMETER :: ll_test = 2 INTEGER, PARAMETER :: new_test = 2 INTEGER, PARAMETER :: newmol_test = 2 INTEGER, PARAMETER :: second_add = 2 INTEGER, PARAMETER :: switch_index = 2 INTEGER, PARAMETER :: third_add = 3 INTEGER, PARAMETER :: third_base = 3 INTEGER, PARAMETER :: third_top = 3 INTEGER, PARAMETER :: to_size = max_elements ! misc_module lengths and sizes INTEGER, PARAMETER :: file_length = 1024 INTEGER, PARAMETER :: iatom_length = 2 INTEGER, PARAMETER :: idata_length = 17 INTEGER, PARAMETER :: len_blank = 1 INTEGER, PARAMETER :: len_char = 4 INTEGER, PARAMETER :: max_atoms = 102 INTEGER, PARAMETER :: message_numbers = 6 INTEGER, PARAMETER :: nnames = 26 INTEGER, PARAMETER :: react_sets = max_elements INTEGER, PARAMETER :: react_values = 5 INTEGER, PARAMETER :: reread_length = 1024 INTEGER, PARAMETER :: species_max = max_species ! General constants INTEGER, PARAMETER :: input_unit = 5 INTEGER, PARAMETER :: insert_length = 8 INTEGER, PARAMETER :: insert_max = 9 INTEGER, PARAMETER :: max_reacts = 5 INTEGER, PARAMETER :: message_offset = 2 INTEGER, PARAMETER :: newmol_reset = 2 INTEGER, PARAMETER :: noconv_test = 2 INTEGER, PARAMETER :: omit_length = 8 INTEGER, PARAMETER :: omit_max = 9 INTEGER, PARAMETER :: output_unit = 6 INTEGER, PARAMETER :: react_message = 2 INTEGER, PARAMETER :: scratch_unit = 3 INTEGER, PARAMETER :: search_message = 3 INTEGER, PARAMETER :: stop_or_go_len = 1024 INTEGER, PARAMETER :: t_p_nrecs = 5 INTEGER, PARAMETER :: t_p_values = 9 INTEGER, PARAMETER :: temp_data_len = 1024 INTEGER, PARAMETER :: therm_message = 1 INTEGER, PARAMETER :: therm_unit = 4 ! out1_module lengths and sizes INTEGER, PARAMETER :: ib_length = 2 INTEGER, PARAMETER :: io2_length = 4 ! out1_module general constants INTEGER, PARAMETER :: fug_size = npt_maximum INTEGER, PARAMETER :: jt_value = npt_maximum INTEGER, PARAMETER :: max_react = 5 INTEGER, PARAMETER :: qfmrel_size = npt_maximum INTEGER, PARAMETER :: tc_size = npt_maximum INTEGER, PARAMETER :: v_size = npt_maximum ! points_module sizes and dimensions INTEGER, PARAMETER :: npt_size = npt_maximum INTEGER, PARAMETER :: pt_size = 45 ! search_module sizes and dimensions INTEGER, PARAMETER :: gas_len = 1 INTEGER, PARAMETER :: iend_len = 4 ! search_module general constants INTEGER, PARAMETER :: b_size = 10 INTEGER, PARAMETER :: date_high_size = max_species INTEGER, PARAMETER :: date_low_size = 2 INTEGER, PARAMETER :: insert_flag_len = max_species INTEGER, PARAMETER :: lmt_size = max_elements INTEGER, PARAMETER :: max_char = 8 INTEGER, PARAMETER :: max_mole = 5 INTEGER, PARAMETER :: ms_increment = 2 INTEGER, PARAMETER :: mt_size = 10 INTEGER, PARAMETER :: nam_size = 8 INTEGER, PARAMETER :: ns_increment = 2 INTEGER, PARAMETER :: omit_flag_len = max_species INTEGER, PARAMETER :: phaz_length = 1 INTEGER, PARAMETER :: second_date = 2 INTEGER, PARAMETER :: second_temp = 2 INTEGER, PARAMETER :: tdate_high_size = max_species INTEGER, PARAMETER :: tdate_low_size = 2 INTEGER, PARAMETER :: toobig_high_size= max_species INTEGER, PARAMETER :: toobig_low_size = 8 INTEGER, PARAMETER :: tsub_high_size = 8 INTEGER, PARAMETER :: tsub_low_size = max_species ! speces_module lengths and sizes INTEGER, PARAMETER :: b_values_number = 2 INTEGER, PARAMETER :: b_values_sets = 2 INTEGER, PARAMETER :: coeff_number = 7 INTEGER, PARAMETER :: coeff_sets = 2 INTEGER, PARAMETER :: len_chars = 4 INTEGER, PARAMETER :: maximum_species = max_species INTEGER, PARAMETER :: npt_number = npt_maximum INTEGER, PARAMETER :: num_chars = 8 INTEGER, PARAMETER :: temp_sets = 2 ! speces_module general constants INTEGER, PARAMETER :: high_coeff = 1 INTEGER, PARAMETER :: high_coeff_test = 2 INTEGER, PARAMETER :: low_coeff = 2 INTEGER, PARAMETER :: phase_range = 10 END MODULE constants_module MODULE check_values_module !### !***************************************************************************** ! * ! Module Name: check_values_module * ! * ! File Name: check_values_module.f90 * ! * ! Purpose: Contains interface for subroutines check_values, * ! count_nonblanks, file_open, check_logicals and * ! temp_press_check * ! * ! Author: Robert L. Reese * ! * ! Date: January 20, 2004 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 01/20/04 0 Initial Release * ! R.L. Reese 03/30/06 A Added Check_logicals * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE check_values_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! None * ! * ! Modules: * ! -------- * ! None * ! * ! Interfaces: * ! ----------- * ! * ! check_logicals - Checks input logigal values for validity * ! check_values - Checks input values for various parameters * ! count_nonblanks - Counts number of nonblanks in input field * ! file_open - Opens the input and output files * ! temp_press_check - Checks temperature and pressure input values * ! * !***************************************************************************** !### IMPLICIT none INTERFACE check_log SUBROUTINE check_logicals( & read_status, & tem_read, & gas_input_read, & new_thermo_read) IMPLICIT none INTEGER,INTENT(inout) :: read_status CHARACTER(len=1),INTENT(inout) :: tem_read CHARACTER(len=1),INTENT(inout) :: gas_input_read CHARACTER(len=1),INTENT(inout) :: new_thermo_read END SUBROUTINE check_logicals END INTERFACE check_log INTERFACE check_sub SUBROUTINE check_values( & read_status) IMPLICIT none INTEGER,INTENT(inout) :: read_status END SUBROUTINE check_values END INTERFACE check_sub INTERFACE count_sub SUBROUTINE count_nonblanks( & temp_value, & read_status) IMPLICIT none INTEGER,intent(inout) :: read_status INTEGER,intent(inout) :: temp_value END SUBROUTINE count_nonblanks END INTERFACE count_sub INTERFACE t_p_sub SUBROUTINE temp_press_check( & read_status, & read_loop, & loop_error) IMPLICIT none INTEGER,INTENT(inout) :: read_status LOGICAL,INTENT(inout) :: loop_error LOGICAL,INTENT(inout) :: read_loop END SUBROUTINE temp_press_check END INTERFACE t_p_sub INTERFACE file_sub SUBROUTINE file_open( & file_error) IMPLICIT none LOGICAL,INTENT(inout) :: file_error END SUBROUTINE file_open END INTERFACE file_sub END MODULE check_values_module MODULE saxena_module !### !***************************************************************************** ! * ! Module Name: saxena_module * ! * ! File Name: saxena_module.f90 * ! * ! Purpose: Contains contants for subroutine saxena * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 2003 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/03 0 Initial Release * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE saxena_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! pcc - Real array containing critical pressures for certain gases * ! pcc_size - Integer value of size of pcc array * ! po - Real value = 4000.0 bars * ! tcc - Real array containing critical temperatures for certain gases * ! tcc_size - Integer value of size of tcc array * ! * ! Modules: * ! -------- * ! None * ! * ! Interfaces: * ! ----------- * ! * ! None * ! * !***************************************************************************** !### IMPLICIT none ! Local variables for sizes and dimensions INTEGER,PARAMETER :: pcc_size = 26 INTEGER,PARAMETER :: tcc_size = 26 REAL,DIMENSION(pcc_size),SAVE :: pcc REAL,DIMENSION(tcc_size),SAVE :: tcc REAL,PARAMETER :: po = 4000.0 ! Critical temperatures and pressures. ! ! AR H2 N2 O2 F2 CL2 NH3 N2H4 DATA tcc/150.8,43.6,126.2,154.58,144.3,417.,405.6,653., & ! HCN C0 C02 N2O NO N2O2 S02 H2S 456.8,132.9,304.2,309.56,180., 431., 430.8,373.2, & ! HF SIF4 HCL CH4 H2O CH3CL CH2CL2 CHCL3 CCL4 COCL2 461.,259.,324.6,190.7,647.14,416.3, 510., 536.4,556.4, 455./ ! AR H2 N2 O2 F2 CL2 NH3 N2H4 DATA pcc/48.1,20.46,33.5,49.77,51.47, 76., 111.3, 145., & ! HCN C0 C02 N2O NO N2O2 S02 H2S HF 53.2, 34.95,73.9, 71.5, 64., 100.,134.3, 78.8, 64., & ! SIF4 HCL CH4 H2O CH3CL CH2CL2 CHCL3 CCL4 COCL2 36.7, 82., 46.4, 218.,65.92, 60.0, 54.0, 45.0, 56.0/ END MODULE saxena_module MODULE search_module !### !***************************************************************************** ! * ! Module Name: search_module * ! * ! File Name: search_module.f90 * ! * ! Purpose: Contains constants and variables for subroutine search * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 2003 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/03 0 Initial Release * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE search_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! gas - Character*2 containing 'G' * ! iend - Character*4 containing 'ENDD' * ! * ! Modules: * ! -------- * ! constants_module - Contains various constants and sizes * ! * ! Interfaces: * ! ----------- * ! * ! None * ! * !***************************************************************************** !### USE constants_module IMPLICIT none CHARACTER(len = gas_len), PARAMETER :: gas = 'G' CHARACTER(len = iend_len), PARAMETER :: iend = 'ENDD' END MODULE search_module MODULE redkw_module !### !***************************************************************************** ! * ! Module Name: redkw_module * ! * ! File Name: redkw_module.f90 * ! * ! Purpose: Contains interface for subroutine redkw and constants for * ! rkcalc * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 2003 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/03 0 Initial Release * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE redkw_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! a - Real array containing REDLICH-KWONG A values (divided by* ! one million * ! b - Real array containing REDLICH-KWONG B values * ! r - Real value of gas constant in CC BAR/DEG Mole * ! redlich_size - Integer value of size of the a and b Redlich-Kwong * ! arrays * ! * ! Modules: * ! -------- * ! None * ! * ! Interfaces: * ! ----------- * ! * ! redkw - Calculate compressibility factor and fugacity * ! * !***************************************************************************** !### IMPLICIT none ! Local size and dimension values INTEGER,PARAMETER :: redlich_size = 26 REAL,DIMENSION(redlich_size) :: a REAL,DIMENSION(redlich_size) :: b ! ! ! THE FOLLOWING ARRAYS GIVE THE REDLICH-KWONG A AND B PARAMETERS ! FROM HOLLOWAY 1987 IN BAR UNITS. ! REDLICH-KWONG A AND B PARAMETERS, FROM HOLLOWAY 1987 ! THE A PARAMETER IS DIVIDED BY ONE MILLION ! ! AR H2 N2 O2 F2 CL2 NH3 N2H4 HCN DATA a/16.9, 1.81, 15.6, 17.5, 58.3, 13.6, 86.8, 100., 244., & ! C0 C02 N2O NO N2O2 S02 H2S HF SIF4 17.2, 83., 68.7, 19.8, 112.6, 133.1, 89.,78., 85.6, & ! HCL CH4 H2O CH3CL CH2CL2 CHCL3 CCL4 COCL2 67.4, 32., 88.,156.0, 248.8,359.1,472.1,229.6/ ! AR H2 N2 O2 F2 CL2 NH3 N2H4 HCN DATA b/22.3,15.34, 26.8, 22.1, 33.7, 39., 25.9, 60., 61., & ! C0 C02 N2O NO N2O2 S02 H2S HF SIF4 27.4,29.7, 30.8, 20., 30.7, 34.7, 20.,12.8,50.1, & ! HCL CH4 H2O CH3CL CH2CL2 CHCL3 CCL4 COCL2 28.12, 29.7, 14.6, 44.8, 60.4, 70.6, 87.8, 57.8/ ! ! GAS CONSTANT IN CC BAR/DEG MOLE ! REAL,PARAMETER :: r = 82.05 INTERFACE redkw_sub SUBROUTINE redkw( & bp, & a2b, & xlnfp) IMPLICIT none REAL,INTENT(inout) :: a2b REAL,INTENT(inout) :: bp REAL,INTENT(inout) :: xlnfp END SUBROUTINE redkw END INTERFACE redkw_sub END MODULE redkw_module MODULE rkcalc_module !### !***************************************************************************** ! * ! Module Name: rkcalc_module * ! * ! File Name: rkcalc_module.f90 * ! * ! Purpose: Contains interface for subroutines rkcalc and saxena * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 2003 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/03 0 Initial Release * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE rkcalc_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! None * ! * ! Modules: * ! -------- * ! None * ! * ! Interfaces: * ! ----------- * ! * ! rkcalc - Calculation of pure gas MRK properties * ! saxena - High pressure corresponding states routines * ! * !***************************************************************************** !### IMPLICIT none INTERFACE rkcalc_sub SUBROUTINE rkcalc( & t, & p, & xlnf, & ij) IMPLICIT none REAL,INTENT(inout) :: p REAL,INTENT(inout) :: t REAL,INTENT(inout) :: xlnf INTEGER,INTENT(inout) :: ij END SUBROUTINE rkcalc END INTERFACE rkcalc_sub INTERFACE SAXENA_SUB SUBROUTINE saxena( & tk, & pbar, & xlnf, & ij) IMPLICIT none REAL,INTENT(inout) :: pbar REAL,INTENT(inout) :: tk REAL,INTENT(inout) :: xlnf INTEGER,INTENT(inout) :: ij END SUBROUTINE saxena END INTERFACE saxena_sub END MODULE rkcalc_module MODULE fpcalc_module !### !***************************************************************************** ! * ! Module Name: fpcalc_module * ! * ! File Name: fpcalc_module.f90 * ! * ! Purpose: Contains interface for subroutine fpcalc * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 2003 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/03 0 Initial Release * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE fpcalc_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! None * ! * ! Modules: * ! -------- * ! None * ! * ! Interfaces: * ! ----------- * ! * ! fpcalc - Calculate natural log of fugacity coefficients * ! * !***************************************************************************** !### IMPLICIT none INTERFACE fpcalc_sub SUBROUTINE fpcalc( & tk, & p, & xlnfp, & ij) IMPLICIT none INTEGER,INTENT(inout) :: ij REAL,INTENT(inout) :: p REAL,INTENT(inout) :: tk REAL,INTENT(inout) :: xlnfp END SUBROUTINE fpcalc END INTERFACE fpcalc_sub END MODULE fpcalc_module MODULE molewt_module !### !***************************************************************************** ! * ! Module Name: molewt_module * ! * ! File Name: molewt_module.f90 * ! * ! Purpose: Contains interface for subroutine molwet * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 2003 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/03 0 Initial Release * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE molewt_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! None * ! * ! Modules: * ! -------- * ! None * ! * ! Interfaces: * ! ----------- * ! * ! molewt - Computes new base values for the reactants * ! * !***************************************************************************** !### IMPLICIT none INTERFACE molewt_sub SUBROUTINE molewt( & status) IMPLICIT none INTEGER,INTENT(inout) :: status END SUBROUTINE molewt END INTERFACE molewt_sub END MODULE molewt_module MODULE react_module !### !***************************************************************************** ! * ! Module Name: react_module * ! * ! File Name: react_module.f90 * ! * ! Purpose: Contains interface for subroutines react, search and thermp * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 2003 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/03 0 Initial Release * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE react_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! None * ! * ! Modules: * ! -------- * ! None * ! * ! Interfaces: * ! ----------- * ! * ! react - Processes the react input records * ! search - Reads the thermo data and selects species to be used * ! thermp - Selects the P-T pair from the Pi and Ti arrays to be * ! considered in the current point * ! * !***************************************************************************** !### IMPLICIT none INTERFACE react_sub SUBROUTINE react( & status) IMPLICIT none INTEGER,INTENT(inout) :: status END SUBROUTINE react END INTERFACE react_sub INTERFACE search_sub SUBROUTINE search( & status) IMPLICIT none INTEGER,INTENT(inout) :: status END SUBROUTINE search END INTERFACE search_sub INTERFACE thermp_sub SUBROUTINE thermp( & status) IMPLICIT none INTEGER,INTENT(inout) :: status END SUBROUTINE thermp END INTERFACE thermp_sub END MODULE react_module MODULE read_error_module !### !***************************************************************************** ! * ! Module Name: read_error_module * ! * ! File Name: read_error_module.f90 * ! * ! Purpose: Contains interface for subroutine read_error * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 2003 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/03 0 Initial Release * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE read_error_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! None * ! * ! Modules: * ! -------- * ! None * ! * ! Interfaces: * ! ----------- * ! * ! read_error - Process the status returned from a read * ! * !***************************************************************************** !### IMPLICIT none INTERFACE error_read SUBROUTINE read_error( & unit, & message, & status) IMPLICIT none INTEGER,INTENT(in) :: message INTEGER,INTENT(inout) :: status INTEGER,INTENT(in) :: unit END SUBROUTINE read_error END INTERFACE error_read END MODULE read_error_module MODULE out1_module !### !***************************************************************************** ! * ! Module Name: out1_module * ! * ! File Name: out1_module.f90 * ! * ! Purpose: Contains constants and variables for subroutine out1 * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 2003 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/03 0 Initial Release * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE out1_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! None * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! ib - Character*2 contining blanks * ! io2 - Character*4 containing 'O2 ' * ! oxfug_value - Real value of maximum size of oxygen fugacity * ! qfi_factor_1 - Real value of first value in calculating qfi * ! qfi_factor_2 - Real value of second value in calculating qfi * ! qfi_factor_3 - Real value of third value in calculating qfi * ! trace_limit - Real value of limit of trace * ! v_limit - Real value of size of v value * ! constants_module * ! double_kind - Integer variable containing kind value for 15 bit * ! precision * ! * ! Modules: * ! -------- * ! constants_module - Contains various constants and sizes * ! * ! Interfaces: * ! ----------- * ! * ! None * ! * !***************************************************************************** !### USE constants_module IMPLICIT none REAL(kind = double_kind), PARAMETER :: trace_limit = 9.d-7 REAL(kind = double_kind), PARAMETER :: v_limit = 1.d-100 REAL,PARAMETER :: oxfug_value = 10000.0 REAL,PARAMETER :: qfi_factor_1 = 7.51 REAL,PARAMETER :: qfi_factor_2 = 29382.0 REAL,PARAMETER :: qfi_factor_3 = 0.050 CHARACTER(len = ib_length),PARAMETER :: ib = ' ' CHARACTER(len = io2_length),PARAMETER :: io2 = 'O2 ' END MODULE out1_module MODULE eqlbrm_module !### !***************************************************************************** ! * ! Module Name: eqlbrm_module * ! * ! File Name: eqlbrm_module.f90 * ! * ! Purpose: Contains constants and variables for subroutine eqlbrm * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 1973 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/73 0 Initial Release * ! R.L. Reese 06/01/03 A Converted to FORTRAN 95 * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE eqlbrm_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! aa - Double precision variable to use in calculation for * ! data in Janaf tables * ! ambda - Real value of first control factor * ! ambda1 - Real value of second control factor * ! begin_iteration - Logical variable used to determine if another * ! iteration is to be done * ! condense_end - Logical variable used to determine if condense * ! specie processing done * ! converge_done - Logical variable used to determine if convergence is* ! done & ! convg - Logical variable used to test if convergence has * ! been obtained * ! delg - Real array of delta G values * ! deln - Real array containing log nj for gases and nj for * ! condensed specie * ! enl - Real value of log of en * ! error_end - Logical variable used to determine if error caused * ! routine to exit * ! exit_loop - Logical variable used to exit various loops * ! fco - Real value of fugacity of CO * ! fco2 - Real value of fugacity of CO2 * ! fh2 - Real value of fugacity of H2 * ! fh2o - Real value of fugacity of H2O * ! first_run - Logical variable used to determine if it is first * ! run * ! get_itnumb - Logical variable used to determine if a new itnumb * ! is required * ! itnumb - Integer value used to count number of iterations * ! jdelg - Integer value used as location of condensed specie * ! being inserted into system * ! k1 - Double precision variable to use in calculation for * ! data in Janaf tables * ! k2 - Double precision variable to use in calculation for * ! data in Janaf tables * ! k4 - Double precision variable to use in calculation for * ! data in Janaf tables * ! miss - Logical variable used to determine if specie with * ! lowest free energy or specie with second lowest * ! free energy should be inserted into the system * ! ncond - Integer value used to count number of condensed * ! species present in current system * ! negative_delta_g - Logical variable used to determine if negative delta* ! G occurred * ! no_converge - Logical variable used to determine if no convergence* ! occurred * ! no_singular - Logical variable used to determine if singular * ! matrix occurred * ! num_int - Integer value used to count number of initialations * ! reset_initial - Logical variable used to determine if needs to reset* ! initial estimates * ! singc - Logical variable used to test if attempt to remove * ! condensed species with same elements as last * ! condensed specie added before singular matrix * ! size_1 - Real value used to control size of output values of * ! gaseous species * ! sizeg - Real value used to store negative free energy value * ! of condensed specie with minimum delta G value * ! sum1 - Real value of absolute value of log nj/n - 9.2103404* ! divided by delta log nj - delta log n * ! sum_all - Double precision value used to store delta log n in * ! obtaining corrections to estimates section and other* ! values * ! test_condense - Logical variable used to test for condensed specie * ! ti - Double precision variable to use in calculation for * ! data in Janaf tables * ! ten - Real value equal to en(j,npt)/totn(npt) in computing* ! free energy * ! tkk - Double precision variable to use in calculation for * ! data in Janaf tables * ! tvol - Real value used as temporary storage in fugacity * ! computation * ! wrong_phase - Logical variable used to determine if wrong phase is* ! in the system * ! xlkc - Real value used to calculate logs of equilibrium * ! constants * ! xlkh - Real value used to calculate logs of equilibrium * ! constants * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! ak1 - Double precision array to use in calculation for * ! data in Janaf tables * ! ak2 - Double precision array to use in calculation for * ! data in Janaf tables * ! ak4 - Double precision array to use in calculation for * ! data in Janaf tables * ! asize_value - Real value used for test of greatest delta G * ! deln_test - Double precision value to use in testing deln * ! e - Real value used as base of natural system of * ! logarithims * ! fco_min - Real value of default for fco and fco2 * ! fco_multiply - Real value multiplier for fco and fco2 fugacity * ! calculation * ! fh2_min - Real value of default for fh2 * ! fh2_multiply - Real value multiplier for fh2 fugacity calculation * ! io2 - Character*2 = 'O2' * ! nco - Character*2 = 'CO' * ! nco2 - Character*3 = 'CO2' * ! nh2 - Character*2 = 'H2' * ! nh2o - Character*3 = 'H2O' * ! oxfug_value - Real value multiplier for O2 fugacity calculation * ! eqlbrm_p - Integer value of number of bits of precision for * ! double precision * ! size_1_value - Real initial value used for control size of output * ! values of gaseous species * ! smalno - Real value used to reassign value of 1 x 10-6 to * ! gaseous specie mole fraction the first time a * ! singular matrix occurs * ! smnol - Real value used to reassign value of -13.815511 to * ! gaseous specie log nj value the first time a singular* ! matrix occurs if the mole fraction is not equal to 0 * ! sum_all_compare - Real value used to compare sum_all variable * ! sum_all_test - Real value used to test sum_all variable * ! sum1_value - Real value default for sum1 * ! ten_compare - Real value used in comparison of temp value for * ! fugacity calculation * ! constants_module * ! ak1_size - Integer value of size of ak1 array * ! ak2_size - Integer value of size of ak2 array * ! ak4_size - Integer value of size of ak4 array * ! delg_size - Integer value of size of delg array * ! deln_size - Integer value of size of deln array * ! gas1_len - Integer value of length of first type of gas char * ! gas2_len - Integer value of length of second type of gas char * ! * ! Modules: * ! -------- * ! constants_module - Contains constants for the size and types of global * ! variables * ! * ! Interfaces: * ! ----------- * ! * ! None * ! * !***************************************************************************** !### USE constants_module IMPLICIT none REAL(kind = double_kind),PARAMETER :: deln_test = 0.9d-99 REAL,PARAMETER :: asize_value = -1.E+36 REAL,PARAMETER :: e = 2.7182818 REAL,PARAMETER :: fco_min = 1.E-20 REAL,PARAMETER :: fco_multiply = 2.0 REAL,PARAMETER :: fh2_min = 1.E-20 REAL,PARAMETER :: fh2_multiply = 2.0 REAL,PARAMETER :: oxfug_value = 0.434294 REAL,PARAMETER :: size_1_value = 18.420681 REAL,PARAMETER :: smalno = 1.E-6 REAL,PARAMETER :: smnol = -13.815511 REAL,PARAMETER :: sum_all_compare = 0.5E-5 REAL,PARAMETER :: sum_all_test = 2.0 REAL,PARAMETER :: sum1_value = -9.212 REAL,PARAMETER :: ten_compare = 5.E-6 CHARACTER(len = gas1_len),PARAMETER :: io2 = 'O2' CHARACTER(len = gas1_len),PARAMETER :: nco = 'CO' CHARACTER(len = gas2_len),PARAMETER :: nco2 = 'CO2' CHARACTER(len = gas1_len),PARAMETER :: nh2 = 'H2' CHARACTER(len = gas2_len),PARAMETER :: nh2o = 'H2O' LOGICAL :: begin_iteration LOGICAL :: condense_end LOGICAL :: converge_done LOGICAL :: convg LOGICAL :: error_end LOGICAL :: exit_loop LOGICAL :: first_run LOGICAL :: get_itnumb LOGICAL :: miss LOGICAL :: negative_delta_g LOGICAL :: no_converge LOGICAL :: no_singular LOGICAL :: singc LOGICAL :: reset_initial LOGICAL :: test_condense LOGICAL :: wrong_phase REAL,SAVE :: ambda REAL,SAVE :: ambda1 REAL,SAVE :: enl REAL,SAVE :: fco REAL,SAVE :: fco2 REAL,SAVE :: fh2 REAL,SAVE :: fh2o REAL,SAVE :: size_1 REAL,SAVE :: sizeg REAL,SAVE :: sum1 REAL,SAVE :: ten REAL,SAVE :: tvol REAL,SAVE :: xlkc REAL,SAVE :: xlkh REAL,DIMENSION(delg_size),SAVE :: delg REAL(kind = double_kind),SAVE :: aa REAL(kind = double_kind),SAVE :: k1 REAL(kind = double_kind),SAVE :: k2 REAL(kind = double_kind),SAVE :: k4 REAL(kind = double_kind),SAVE :: sum_all REAL(kind = double_kind),SAVE :: ti REAL(kind = double_kind),SAVE :: tkk REAL(kind = double_kind),DIMENSION(deln_size),SAVE :: deln INTEGER,SAVE :: itnumb INTEGER,SAVE :: jdelg INTEGER,SAVE :: ncond INTEGER,SAVE :: num_int ! *** ! COEFFICIENTS FOR EQUILIBRIUM CONSTANTS FROM DATA IN JANAF TABLES ! k1: C+O2 = CO2; k2:C+.5O2 = CO;k4: H2+.5O2 = H2O ! EQUATION FORM IS LOG10(K) = A1+A2*T+A3*T**2 ... AND FIT FROM 500-2300K ! *** ! REAL(kind = double_kind),DIMENSION(ak1_size),PARAMETER :: ak1 = & (/.114463D3,-.243442D2,.248074D1,-.114863D0,.584013d-3,& .154925d-3,-.555708d-5,.592449d-7/) REAL(kind = double_kind),DIMENSION(ak2_size),PARAMETER :: ak2 = & (/.36845D2,-.689197D1,.711475D0,-.337899d-1,.223693d-3, & .4365d-4,-.162723d-5,.178614d-7/) REAL(kind = double_kind),DIMENSION(ak4_size),PARAMETER :: ak4 = & (/.687667D2,-.153556D2,.158928D1,-.759149d-1,.535197d-3, & .96958d-4,-.366479d-5,.407351d-7/) END MODULE eqlbrm_module MODULE indx_module !### !***************************************************************************** ! * ! Module Name: indx_module * ! * ! File Name: indx_module.f90 * ! * ! Purpose: Contains index constants and variables * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 1973 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/73 0 Initial Release * ! R.L. Reese 06/01/03 A Converted to FORTRAN 95 * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE indx_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! alter - Logical variable used to indicate reactant mole * ! mole fractions with unequal top and base values * ! are to be altered * ! imat - Integer variable used as number of rows in matrix * ! iq1 - Integer variable used as number of elements plus the * ! number of condensed species included in matrix * ! equations plus one * ! kase - Integer identification number for problem being * ! considered * ! nc - Integer value of number of condensed species being * ! considered in the system * ! newmol - Integer variable used in react, search and molewt. * ! Reset and initialized in this routine * ! nlm - Integer value of number of elements in the system * ! nmin - Integer value of number of elements that are put * ! into temporary storage for systm and plus problems * ! nmix - Integer variable used as increment multiplier for mole * ! fraction computations in plus and systm problems * ! nomit - Integer value of number of species to be omitted * ! np - Integer variable used as number of P values input * ! npt - Integer variable used as index for data saved for output* ! nrat - Integer variable used to determine if the reactants * ! should be added or incremented in systm and plus * ! problems * ! nreac - Integer value containing number of reactant records * ! ns - Integer variable of number of species being considered * ! in the system * ! nsert - Integer value of number of species listed on * ! insert Records * ! nt - Integer variable used as number of T values input * ! plus - Logical variable used to indicate if reactants are to be* ! added to the system or if a ternary system is being * ! considered * ! systm - Logical variable used to denote that a ternary * ! system is being considered * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! add_factor - Integer value to multiply add by for comparison * ! bigno - Real value that stores value of 1 x 1038 to be used * ! for locating the maximum coefficient in each row of * ! the matrix * ! th - Real value = 0.333333D0 * ! zerot_value - Integer value to use for rtest test * ! constants_module * ! double_kind - Integer variable containing kind value for 15 bit * ! precision * ! * ! Modules: * ! -------- * ! constants_module - Contains various constants for sizes and counters * ! * ! Interfaces: * ! ----------- * ! * ! None * ! * !***************************************************************************** !### USE constants_module IMPLICIT none INTEGER,SAVE :: imat INTEGER,SAVE :: iq1 INTEGER,SAVE :: kase INTEGER,SAVE :: nc INTEGER,SAVE :: newmol INTEGER,SAVE :: nlm INTEGER,SAVE :: nmin INTEGER,SAVE :: nmix INTEGER,SAVE :: nomit INTEGER,SAVE :: np INTEGER,SAVE :: npt INTEGER,SAVE :: nrat INTEGER,SAVE :: nreac INTEGER,SAVE :: ns INTEGER,SAVE :: nsert INTEGER,SAVE :: nt REAL(kind = double_kind),PARAMETER :: bigno = 1.E+38 REAL,PARAMETER :: add_factor = 0.5 REAL,PARAMETER :: th = 0.333333D0 REAL,PARAMETER :: zerot_value = 1.0E-4 LOGICAL,SAVE :: alter LOGICAL,SAVE :: base_add LOGICAL,SAVE :: plus LOGICAL,SAVE :: systm END MODULE indx_module MODULE misc_module !### !***************************************************************************** ! * ! Module Name: misc_module * ! * ! File Name: misc_module.f90 * ! * ! Purpose: Contains index constants and variables * ! * ! Author: Robert L. Reese * ! * ! Date: June 01, 1973 * ! * ! Language: Salford FORTRAN 95, Version 0.9.0 * ! * ! Hardware: IBM Cosmpatible PC * ! * ! Operating System: Microsoft Windows 98 * ! * ! Update History: * ! * ! Name Date Revision Changes * ! ---- ---- --------- ------- * ! * ! R.L. Reese 06/01/73 0 Initial Release * ! R.L. Reese 06/01/03 A Converted to FORTRAN 95 * ! R.L. Reese 03/28/06 B Added new_thermo to file * ! Added E to atom tables * ! * !----------------------------------------------------------------------------* ! * ! Usage: * ! * ! USE misc_module * ! * !----------------------------------------------------------------------------* ! * ! Definitions: * ! * ! Local Variables: * ! ---------------- * ! * ! None * ! * ! Global Variables: * ! ----------------- * ! * ! add - Real array containing increment of ith reactant mole * ! fraction * ! anum - Real value of stochiometric coefficients of elements * ! in the reactant records * ! base - Real value of first value of mole fraction of ith * ! reactant * ! bo - Real array used as assigned Kg-atoms of element i per* ! Kg of total reactant * ! enn - Real value of n, moles of miture, KG-moles/KG * ! ennl - Real value of log of enn * ! gamma - Real array of fugacity coeffiecients for gases * ! idata - Character*4 array used to read code record names * ! to determine what input data follows * ! infile - Character*80 variable for input file name * ! llmt - Character*4 array containing alphameric symbols for * ! the elements in the system being studied * ! name - Character*4 containing alphameric symbols for the * ! elements as given in the reactant records * ! new_thermo - Logical flag indicating if old or new thermo data is * ! to be used. * ! = F, old type will be used * ! = T, new type will be used * ! noconv - Integer value that accumulates number of times there * ! is no solution to a T-P point * ! outfile - Character*80 variable for output file name * ! pp - Real value of assigned P for current point * ! pressure_num - Integer number of input pressure values * ! re_read - Character*80 buffer used to read previous record * ! sumn - Real value of moles of mixture sumation * ! temp_number - Integer number of input temperature values * ! thermofile - Character*80 variable for thermo file name * ! tm - Real value of log P divided by n * ! top - Real array containing final value of mole fraction of* ! ith reactant * ! tri - Real variable containing increment value of mole * ! fraction for all reactants of ternary system * ! tt - Real value of assigned T for current point * ! vol - Real value of molar volume of species * ! * ! Local Common Blocks: * ! ------------------- * ! * ! None * ! * ! Constants: * ! --------- * ! * ! constants_module * ! double_kind - Integer variable containing kind value for 15 bit * ! precision * ! atom - Real array containing atomic weight of the elements * ! blank - Character*1 containing blank character * ! ennl_initial - Real value of initial value of ennl * ! enn_initial - Real value of initial value of enn * ! file_length - Integer value of number of characters in file name * ! iatom - Character*2 array containing atomic symbol of * ! elements * ! iatom_length - Integer length of iatom characters * ! idata_length - Integer length of the idata array * ! insert - Character*4 containing code word indicating a * ! record containg species to be included in run * ! has been read * ! istop - Character*4 containing code word indicating end * ! of input records found * ! kelvin - Integer value of Kelvin conversion factor * ! lank - Character*4 containing blanks * ! len_blank - Integer value of length of blank character * ! len_char - Integer value used as len of char to replace default * ! length of 4 characters in one word for FORTRAN 4 and * ! FORTRAN 77 * ! max_atoms - Integer containing maximum number of atoms * ! message - Chracter array containing error messages to output * ! message_numbers - Integer value of number of error messages * ! mit - Character*4 containing code word indicating omit * ! records found in input file * ! name_list - Character*4 containing code word indicating name * ! list values found in input file * ! nnames - Integer value number of built in species * ! po_test - Real value used to initialize po in fpcalc * ! r - Real value of universal gas constant * ! reac - Character*4 containing code to indicate Reactant * ! input records being processed * ! react_sets - Integer value of maximum number of reactant records * ! react_values - Integer value of maximum number of reactant values * ! per reactant records(sets) * ! reread_length - Integer value of length of re-read buffer for * ! subroutine read_error * ! species_max - Integer value of maximum number of species allowed * ! t_p_default - Real value of temperature or pressure default value * ! zero_test_1 - Real value for first test for variance in testing for* ! zero * ! zero_test_2 - Real value for second test for variance in testing * ! for zero * ! zero_test_3 - Real value for third test for variance in testing for* ! zero * ! * ! Modules: * ! -------- * ! constants_module - Contains various contants and sizes * ! * ! Interfaces: * ! ----------- * ! * ! None * ! * !***************************************************************************** !### USE constants_module IMPLICIT none REAL,SAVE :: enn REAL,SAVE :: ennl REAL,SAVE :: pp REAL,SAVE :: sumn REAL,SAVE :: tm REAL,SAVE :: tri REAL,SAVE :: tt REAL,DIMENSION(react_sets),SAVE :: add REAL,DIMENSION(react_sets,react_values),SAVE :: anum REAL,DIMENSION(react_sets),SAVE :: base REAL,DIMENSION(react_sets),SAVE :: bo REAL,DIMENSION(react_sets),SAVE :: top REAL,DIMENSION(species_max),SAVE :: vol REAL(kind = double_kind), DIMENSION(species_max),SAVE :: gamma INTEGER :: temp_number INTEGER :: pressure_num INTEGER,SAVE :: noconv LOGICAL,SAVE :: new_thermo ! Atomic Weights. REAL,DIMENSION(max_atoms),PARAMETER :: atom = (/ & 1.00797, 4.0026, 6.939, 9.0122, 10.811, 12.01115, 14.0067, & 15.9994, 18.9984, 20.183, 22.9898, 24.312, 26.9815, 28.086, & 30.9738, 32.064, 35.453, 39.948, 39.102, 40.0800, 44.956, & 47.90 , 50.942, 51.996, 54.938, 55.847, 58.9332, 58.710, & 63.54 , 65.370, 69.720, 72.590, 74.9216, 78.96 , 79.909, & 83.80 , 85.470, 87.620, 88.905, 91.220, 92.906 , 95.940, & 99.00 , 101.070, 102.905, 106.400, 107.870, 112.400 , 114.820, & 118.69 , 121.750, 127.600,126.9044, 131.300, 132.905 , 137.340, & 138.910 , 140.120, 140.907, 144.240, 145.000, 150.350 , 151.960, & 157.250 , 158.924, 162.500, 164.930, 167.260, 168.934 , 173.040, & 174.997 , 178.490, 180.948, 183.850, 186.200, 190.200 , 192.200, & 195.090 , 196.967, 200.590, 204.370, 207.190, 208.980 , 210.000, & 210.000 , 222.000, 223.000, 226.000, 227.000, 232.038 , 231.000, & 238.030 , 237.000, 242.000, 243.000, 247.000, 249.000 , 251.000, & 254.000 , 253.000, 2.014102,.000548579903/) REAL,PARAMETER :: enn_initial = .1 REAL,PARAMETER :: ennl_initial = -2.3025851 REAL,PARAMETER :: kelvin = 273.15 REAL,PARAMETER :: po_test = 4000.0 REAL,PARAMETER :: r = 8314.3/4184. REAL,PARAMETER :: t_p_default = -32767.0 REAL,PARAMETER :: zero_test_1 = 1.0E-03 REAL,PARAMETER :: zero_test_2 = 1.0E-06 REAL,PARAMETER :: zero_test_3 = 1.0E-10 CHARACTER(len = len_char),DIMENSION(idata_length),SAVE :: idata CHARACTER(len = len_char),DIMENSION(react_sets),SAVE :: llmt CHARACTER(len = len_char),DIMENSION(react_sets,react_values),SAVE :: name CHARACTER(len = len_char),DIMENSION(nnames),SAVE :: names = & (/'AR ','H2 ','N2 ','O2 ','F2 ','CL2 ','NH3 ','N2H4', & 'HCN ','CO ','CO2 ','N2O ','NO ','N2O4','SO2 ','H2S ','HF ', & 'SIF4','HCL ','CH4 ','H2O ','CHCL','CH2C','CH3C','CCL4','COCL'/) ! Atomic Symbols. CHARACTER(len = iatom_length),DIMENSION(max_atoms),PARAMETER :: iatom = (/ & 'H ', 'HE', 'LI', 'BE', 'B ', 'C ', 'N ', 'O ', 'F ', 'NE', 'NA', & 'MG', 'AL', 'SI', 'P ', 'S ', 'CL', 'AR', 'K ', 'CA', 'SC', 'TI', & 'V ', 'CR', 'MN', 'FE', 'CO', 'NI', 'CU', 'ZN', 'GA', 'GE', 'AS', & 'SE', 'BR', 'KR', 'RB', 'SR', 'Y ', 'ZR', 'NB', 'MO', 'TC', 'RU', & 'RH', 'PD', 'AG', 'CD', 'IN', 'SN', 'SB', 'TE', 'I ', 'XE', 'CS', & 'BA', 'LA', 'CE', 'PR', 'ND', 'PM', 'SM', 'EU', 'GD', 'TB', 'DY', & 'HO', 'ER', 'TM', 'YB', 'LU', 'HF', 'TA', 'W ', 'RE', 'OS', 'IR', & 'PT', 'AU', 'HG', 'TL', 'PB', 'BI', 'PO', 'AT', 'RN', 'FR', 'RA', & 'AC', 'TH', 'PA', 'U ', 'NP', 'PU', 'AM', 'CM', 'BK', 'CF', 'ES', & 'FM', 'D ', 'E '/) CHARACTER(len = *),DIMENSION(message_numbers),PARAMETER :: message = & (/' ERROR IN ABO