Academia.eduAcademia.edu

Uncertainty Analysis of RELAP5-3D

2012

As worldwide energy consumption continues to increase, so does the demand for the use of alternative energy sources, such as Nuclear Energy. Nuclear Power Plants currently supply over 370 gigawatts of electricity, and more than 60 new nuclear reactors have been commissioned by 15 different countries. The primary concern for Nuclear Power Plant operation and lisencing has been safety. The safety of the operation of Nuclear Power Plants is no simple matter-it involves the training of operators, design of the reactor, as well as equipment and design upgrades throughout the lifetime of the reactor, etc. To safely design, operate, and understand nuclear power plants, industry and government alike have relied upon the use of best-estimate simulation codes, which allow for an accurate model of any given plant to be created with welldefined margins of safety. The most widely used of these best-estimate simulation codes in the Nuclear Power industry is RELAP5-3D. Our project focused on improving the modeling capabilities of RELAP5-3D by developing uncertainty estimates for its calculations. This work involved analyzing high, medium, and low ranked phenomena from an INL PIRT on a small break Loss-Of-Coolant Accident as well as an analysis of a large break Loss-Of-Coolant Accident. Statistical analyses were performed using correlation coefficients. To perform the studies, computer programs were written that modify a template RELAP5-3D input deck to produce one deck for each combination of key input parameters. Python scripting enabled the running of the generated input files with RELAP5-3D on INL's massively parallel cluster system. Data from the studies was collected and analyzed with SAS. Summaries of the results of our studies are presented.

Boise State University ScholarWorks Mathematics Graduate Projects and Theses Department of Mathematics 1-1-2012 Uncertainty Analysis of RELAP5-3D© Alexandra E. Gertman Boise State University George L. Mesina Idaho National Laboratory Uncertainty Analysis of RELAP5-3D�c Alexandra E. Gertman∗ Dr. George L. Mesina† July 2012 c �2012 Alexandra E. Gertman and Dr. George L. Mesina ALL RIGHTS RESERVED ∗ † Mathematics Department, Boise State University Idaho National Laboratory 1 Abstract As world-wide energy consumption continues to increase, so does the demand for the use of alternative energy sources, such as Nuclear Energy. Nuclear Power Plants currently supply over 370 gigawatts of electricity, and more than 60 new nuclear reactors have been commissioned by 15 different countries. The primary concern for Nuclear Power Plant operation and lisencing has been safety. The safety of the operation of Nuclear Power Plants is no simple matter- it involves the training of operators, design of the reactor, as well as equipment and design upgrades throughout the lifetime of the reactor, etc. To safely design, operate, and understand nuclear power plants, industry and government alike have relied upon the use of best-estimate simulation codes, which allow for an accurate model of any given plant to be created with welldefined margins of safety. The most widely used of these best-estimate simulation codes in the Nuclear Power industry is RELAP5-3D. Our project focused on improving the modeling capabilities of RELAP5-3D by developing uncertainty estimates for its calculations. This work involved analyzing high, medium, and low ranked phenomena from an INL PIRT on a small break Loss-Of-Coolant Accident as well as an analysis of a large break Loss-Of-Coolant Accident. Statistical analyses were performed using correlation coefficients. To perform the studies, computer programs were written that modify a template RELAP5-3D input deck to produce one deck for each combination of key input parameters. Python scripting enabled the running of the generated input files with RELAP5-3D on INL’s massively parallel cluster system. Data from the studies was collected and analyzed with SAS. Summaries of the results of our studies are presented. 2 Table of Contents 1 Nomenclature 5 2 Motiviation 6 3 Standard Formulas 8 3.1 General Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2 Project Specific Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4 Coefficients of Correlation 11 4.1 General Properties of Correlation Coefficients . . . . . . . . . . . . . . . . . 11 4.2 Pearson’s Product Moment Correlation Coefficient . . . . . . . . . . . . . . 14 4.3 Spearman’s Rho . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.3.1 4.4 Generic Example of Computing Spearman’s Rho and the Corresponding P-value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Kendall’s Tau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.4.1 4.5 Generic Example of Computing Kendall’s Tau and the Corresponding P-value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Discussion of Pearson, Spearman, and Kendall . . . . . . . . . . . . . . . . 19 5 Experimental Information 5.1 5.2 5.3 5.4 20 RELAP5-3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.1.1 Terminology and Basic Deck Requirements[7, p. A1-1] . . . . . . . . 20 5.1.2 Safety Analysis of NPPs & BE Codes . . . . . . . . . . . . . . . . . 21 5.1.3 About . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.1.4 Running RELAP5-3D . . . . . . . . . . . . . . . . . . . . . . . . . . 21 AP600 Deck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.2.1 Background on the AP600 Nuclear Power Plant . . . . . . . . . . . . 22 5.2.2 Variable Names, Representation, & Corresponding PIRT[1] Phenomena 23 5.2.3 Studies with the AP600 Deck . . . . . . . . . . . . . . . . . . . . . . 23 LOFT Deck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.3.1 Background Information on the LOFT Nuclear Power Plant . . . . . 27 5.3.2 Variable Names and Corresponding Phenomena [15] . . . . . . . . . 28 5.3.3 LOFT Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Input Modification Program . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3 5.4.1 Marked Input File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.4.2 Specification Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.4.3 Main Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.5 Running on the Cluster & Python Scripting . . . . . . . . . . . . . . . . . . 33 5.6 c Using SAS� . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 6 Results 6.1 6.2 35 AP600 Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 6.1.1 AP600 Correlation Coefficient Classification . . . . . . . . . . . . . . 35 6.1.2 Discussion of the Rankings of the Phenomena . . . . . . . . . . . . . 35 LOFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 6.2.1 LOFT Correlation Classification . . . . . . . . . . . . . . . . . . . . 36 6.2.2 Ranking the Phenomena Following the Correlation Computation . . 36 7 Final Conclusions and Potential Future Work 37 A Input Modification Program 40 B Template Spec File 51 C Example of a Generator Spec File 52 D Example of a NodeSpec File 52 E Python Script for Running Studies on INL’s Supercomputer, Quark 53 F SAS Reports 58 F.1 AP600 2 inch Break, Top 4 Variables . . . . . . . . . . . . . . . . . . . . . . 58 F.2 AP600: 4 inch Break, Top 5 Variables . . . . . . . . . . . . . . . . . . . . . 59 F.3 AP600: 6 inch Break, Top 5 Variables . . . . . . . . . . . . . . . . . . . . . 60 F.4 AP600: 8 inch Break, Top 4 Variables . . . . . . . . . . . . . . . . . . . . . 61 F.5 LOFT: 3 Values per Variable . . . . . . . . . . . . . . . . . . . . . . . . . . 62 F.6 LOFT: 6 Values per Variable . . . . . . . . . . . . . . . . . . . . . . . . . . 63 4 1 Nomenclature[1] Accronym ADS Automatic Depressurization System ALWR Advanced Light-Water Reactor AP600 Advanced Passive 600 MWe Reactor CMT Core Makeup Tank ECCS Emergency Core Coolant System INL IRWST LBLOCA Idaho National Laboratory In-containment Refueling Water Storage Tank Large Break Loss-of-Coolant Accident LOCA Loss-of-Coolant Accident MSLB Main Steam Line Break NPP Nuclear Power Plant NRC United States Nuclear Regulatory Commission PIRT Phenomena Identification and Ranking Table PPMCC Passive Residual Heat Removal PWR Pressurized Water Reactor SG 1 Pearson Product Moment Correlation Coefficient PRHR SBLOCA 1 Definition Small Break Loss-of-Coolant Accident Steam Generator ρ̂ The estimated value of PPMCC rˆs The estimated value of Spearman’s rho τ̂ The estimated value of Kendall’s tau Also referred to as USNRC 5 2 Motiviation As scientists, we wish to confidently provide the answer to any question quantitatively. However, every measured value has uncertainty attached to it and thus any answer we provide must include uncertainty. Uncertainty in measurement is not the only uncertainty we must concern ourselves with. For any system we construct, outside factors will play some role within our calculations and findings, and therefore additional uncertainties must be accounted for in any solutions we provide. In practice it is not reasonable to assume that we could quantify all uncertainties for a particular solution. Even if it were possible to quantify all possible solutions, combining all the uncertainties together could cause our data to lose significance, i.e. to become “washed out” in terms of significance. Therefore we must utilize practices that limit the number of uncertainties we consider for any particular problem. This is where the studies of Statistical Uncertainty Analysis and Sensitivity Analysis have resulted from.[8] Uncertainty (and Sensitivity) Analysis continue to be vitally important to Nuclear Power Plants (NPPs), as well as many other fields. For NPPs in particular, the fields of uncertainty and sensitivity analysis are vitally important, as margins of safety for plant operation are a critical aspect of licensing and plant operation. In 1988, the USNRC (United States Nuclear Regulatory Commission) issued a revision to the emergency core coolant system (ECCS) which allows for the use of best estimate plus uncertainty methods in safety analysis of LWRs (Light Water Reactors). In support of this licensing revision, the code scaling, applicability and uncertainty (CSAU) methodology was developed. As a part of that methodology, the Phenomena Identification and Ranking Table (PIRT) was developed.[14] The PIRT process is a structured and facilitated elicitation process in which experts are 6 asked to rank various phenomena pertaining to a particular scenario. The phenomena are typically classified as “high”, “medium”, or “low”.[6] The PIRT process of today also typically includes the utilization of best-estimate codes to assist in the ranking process of phenomena. We wish to find a way to mathematically evaluate the accuracy of PIRTs, and to provide insight to validate and/or to make suggested changes to a given PIRT. To do this, we utilized a RELAP5-3D input deck and a corresponding PIRT to determine variables of interest. Using those, we were able to create a variable specification file (spec file), as well as a template input file. We designed a program which was able to take the template input file and a specification file for the study and generate more specification files which would allow the study to be broken into sets. Then each set was run individually on the INL’s supercomputer cluster (using a Python script), where up to 1,737 input files were created using our program, and run with a RELAP5-3D executable. The data was collected using the python script, and then a statistical analysis was conducted. A depiction of this process can be seen in Figure 1. Figure 1: Algorithmic Design 7 We will begin by listing general statistical definitions in Section 3.1 on Page 8, defining project specific definitions in Section 3.2 on Page 10, and then discussing Coefficients of Correlation in Section 4 on Page 11. We will discuss general properties of correlation coefficients in Section 4.1 on Page 11, and discuss three types of correlation coefficients in Sections 4.2, 4.3, and 4.4 on Pages 14, 15, and 16. The relationship between the three is discussed in Section 4.5 on Page 19. We then discuss our experiments in Section 5 on Page 20. We will conclude by discussing our results in Section 6 on Page 35, summarizing our findings and discussing future work following from this project in Section 7 on Page 37. 3 3.1 Standard Formulas General Definitions For a general closed non-degenerate interval, [c, d], with n points equally spaced within the d−c interval (i.e. uniformly distributed), the increment size of the interval, ξ, is ξ = . n−1 The probability that a sample point x will occur is the proportion of ocurrences of the sample point in a long series of experiments, and is denoted by P (x). P (x) ∈ [0, 1]. The probability density function (PDF) of a continuous random variable X, denoted by �∞ f (x), is defined such that −∞ f (x)dx = 1. The probability that an observation lies between �x x1 and x2 is defined as: P(x1 < X < x2 ) = x12 f (x)dx. The mean (µx ) or expected value �∞ E[X] of the continuous random variable X, is E[X] = −∞ xf (x)dx. Other expectations are mathematically useful and important. We may define expecation more generally for g(X), a function of the continuous random variable X, by: E[g(X)] = �∞ −∞ g(x)f (x)dx. 8 The variance of the continuous random variable X, where µx = E[X] is constant, is defined as: variance(X) = σx = E[(X − µx )2 ] = �∞ −∞ (x − µx )2 f (x)dx = E[X 2 ] − {µx }2 . The covariance of two random variables, X and Y with PDF f (x, y), is defined as: �∞ �∞ Cov(X, Y ) = E[(X − µx )(Y − µy )] = −∞ −∞ (X − µx )(Y − µy )f (x, y)dydx = �∞ �∞ −∞ −∞ xyf (x, y)dxdy − µx E[X] − µy E[Y ] + µx µy = E[XY ] − µX µY Let X be a random variable with n data points. Let each point be denoted by xi for i = 1, 2, ..., n. (i.e. the data points are x1 , x2 , ..., xn .) The sample mean of X, µˆx , is defined as2 : n 1� µˆx = xi .[2, p 39,81-82,87,106-113] n i=1 The sample variance of X, σ̂ 2 , where s̃2 is an unbiased estimate of σ̂ 2 , is defined as: σˆx2 = E[s̃2 ] = n � � xi − µx i=1 n−1 �2 = � n �2 n � �2 � 1 � xi xi − n i=1 i=1 n−1 .[11, p. 11] The sample covariance of two random variables, X, and Y , each with n data points, where each point of X is denoted by xi and each point of Y is denoted by yi for i = 1, 2, ..., n, is 2 µˆx is also denoted x̄ � Cov(X, Y)= � � 1 � n (xi − µˆx )(yi − µˆy ) . n−1 i=1 9 3.2 Project Specific Definitions In our input modification program, we are given a base file name, the number of variables, the number of sets the study will be divided into, the number of groups of variables,3 as well as a list of variables and some basic variable information. The variable information includes the minimum and maximum values of the interval over which the variable ranges, the number of points within the interval that the variable will have (i.e. sample size), the standard deviation of the variable, the type of probability distribution the points will have within the interval (currently only the uniform is available in our program), and the group number of the variable. For a specific variable, v, with n points, a minimum of a, and a maximum of b (where a < b), for which the points are distributed uniformly throughout the interval, the following formulas follow from the general definitions. b−a n−1 b−a µˆv = 2 ξv = � � � � �2 �2 n � n � � � 1 � 1� 1� 1 b−a b−a � σˆv = a+ (i − 1) − a + ξv (i − 1) − µˆv = n n−1 n n−1 n−1 2 i=1 i=1 � � �2 n � � 1 � 1 � = 3an − a − bn − b − 2ai + 2bi 2n(n − 1) n − 1 i=1 (1) 3 In some cases, groups of variables may need to be changed simultaneously in input file generation, and in those cases, groups are needed. In the case where a set of variables needs to be simultaneously changed all of those variables will be in one group, and in the case where only one variable needs to be changed it will be placed in its own group. For instance, in the LOFT study discussed later in the paper, variables 1-24 represent peaking factor and are in group one, variable 25 represents fuel clad gap width and is in group 2, variables 26-43 represent fuel thermal conductivityand belong to group 3, etc. 10 4 Coefficients of Correlation Let X and Y be two random variables with a bivariate probability distribution. The covariance of X and Y , denoted by Cov(X, Y ), is a measure of the amount of association (or, equivalently, correspondence) and the direction of association between X and Y . The most important measure of the degree of correlation between two variables is the correlation coefficient. It standardizes the covariance in such a way as to eliminate the dependency that covariance has on the scale of measurement for the data set. [2, 187] 4.1 General Properties of Correlation Coefficients A correlation coefficient is said to measure the strength of the relationship between variables. It is not an inferential statistical test. Rather, it is a descriptive statistical measure that depicts the strength of the relationship between two or more variables. Let ζ denote a correlation coefficient of X and Y . ζ should satisfy four key criteria.[3] 1. ζ ∈ [−1, 1] 2. If the larger (smaller) values of X tend to be paired with the larger (smaller) values of Y ⇒ ζ > 0, ζ → +1 if the correlation is strong. ⇒ ∃ a positive correlation between X and Y . 3. If the larger (smaller) values of X tend to be paired with the smaller (larger) values of Y , ⇒ ζ < 0 and ζ → −1 if the correlation is strong. ⇒ ∃ a negative correlation between X and Y . 11 4. If the values of X tend to be randomly paired with the values of Y ⇒ ζ → 0. 4 When ζ ≈ 0, ⇒ X and Y are uncorrelated (or, equivalently have no correlation, or zero correlation.) Correlational information does not provide any conclusions regarding cause and effect, rather it indicates the degree of statistical relationship between two variables. [11, p 72] The absolute value of ζ, |ζ|, indicates the strength of the relationship between X and Y . As |ζ| → 1, the stronger the relationship between X and Y , and the more accurately a researcher can predict the value of yi given xi . As |ζ| → 0, the weaker the relationship between X and Y , and the less accurately a researcher can predict a particular yi given xi . When ζ = 0, the relationship between X and Y cannot be predicted as ζ is no more accurate than a prediction based purely upon chance.[11, p 945-946] The sign of ζ indicates the direction of the relationship between X and Y . ζ > 0 indicates a direct relationship and ζ < 0 indicates an inverse relationship. Some general guidelines for the interpretation of ζ are: • ζ ∈ [0.7, 1] ⇒ strong direct relationship • ζ ∈ [0.3, 0.69] ⇒ moderate direct relationship • ζ ∈ [0.01, 0.29] ⇒ weak direct relationship • ζ ≈ 0 ⇒ no consistent pattern which allows for prediction of one variable’s values based upon knowledge of the other variable’s values • ζ ∈ [−0.29, −0.01] ⇒ weak indirect relationship • ζ ∈ [−0.69, −0.3] ⇒ moderate indirect relationship 4 ζ ≈ 0 when X and Y are independent.ζ = 0 �⇒ X and Y are independent 12 • ζ ∈ [−1, −0.7] ⇒ strong indirect relationship. [11, p 72] This allows us to make a fairly intuitive comparison of the strength of a correlation coefficient to a PIRT ranking: |ζ| ∈ [0.7, 1] ⇒ ‘high’, |ζ| ∈ [0.3, 0.7) ⇒ “medium’, and |ζ| ∈ [0, 0.3) ‘low’. We use this in our AP600 and LOFT studies, the results of which are discussed in Section 6 on Page 35 As with any statistical computation, it is important to determine the significance of the calculation, or in other words, it is crucial that we determine whether the correlation coefficient that we’ve computed is statistically significant. To determine whether the correlation coefficient is significant, it is common practice to perform inferential statistical tests to evaluate one or more hypothesis concerning the correlation coefficient. [11, p 946] In our studies, we utilized the p-value, sometimes referred to as a prob value or the associated probability or the significance probability[4, p. 18-19], as the inferential statistical test to evaluate the statistical significance of the correlation coefficient. We considered a p-value ≤ 0.05 to indicate statistical significance of the correlation coefficient. The null hypothesis, Ho , is: Ho : ζ = 0, p-value ≤ 0.05 ⇒ significant evidence that there is correlation between our two variables. On the other hand, for the same Ho if the p-value > 0.05 ⇒ we fail to reject the null hypothesis, i.e. we do not have sufficient evidence that the two variables are correlated. In our studies, if the p-value was too large, we were unable to make any conclusions about that phenomena based on its correlation coefficient. There are many different methods of calculating correlation coefficients. The three we explore (Pearson, Spearman, and Kendall) are the most frequently used. 13 4.2 Pearson’s Product Moment Correlation Coefficient The Pearson Product Moment Correlation, denoted by ρ, is a measure of the linear reCov(X, Y ) lationship between X and Y . It is defined as: ρ(X, Y ) = . It is a correlation σX σY coefficient (and thus meets all four criteria specified in the section above.) In the bivariate normal case, ρ(X, Y ) = 0 ⇒ independence of X and Y . The Pearson Product Moment Correlation Coefficient is the most commonly used measure of correlation.[11, p 71] ρ is invariant under positive linear transformations of the random variables but it is not invariant under all order-preserving transformations, and requires that the two variables have a bivariate normal distribution.[11, p. 947] If X and Y are not approximately normally distributed, then another correlation coefficient should be used. The most commonly evaluated hypothesis for the PPMCC is: in the population represented by the sample, the two variables have no correlation.[11, p 945] The statistic computed for the PPMCC will be denoted by ρ̂. The coefficient of determination is ρ̂2 , and it represents the proportion of variance on one variable which can be accounted for by variance on the other variable.[11, p 953] For X and Y of sample size n, using the notation from section 3.1: n n n � 1� � xi yi x i yi − n i=1 i=1 i=1 ρ̂ = ��� � n � n �2 �� . [11, p 950]. �2 � � n � n � � � � 1 � 1 � xi yi yi − x2i − n i=1 n i=1 i=1 i=1 We compute � the p-values for the Pearson Product Moment Correlation Coefficient by treating t = ρ̂2 (n − 2) as coming from a t-distribution with n − 2 degrees of freedom.[10, p 1 − ρ̂2 14 18-19] 4.3 Spearman’s Rho Spearman was developed in 1904 and is a bivariate measure of correlation which is used with rank-order data.[11, p 1061] Spearman’s is the application of PPMCC to ranked data. Spearman’s determines the degree to which a monotonic relationship exists between two variables.[11, p 1062] The underlying null hypothesis for Spearman’s Rank-order Correlation Coefficient is: in the population represented by the sample, the correlation between the ranks of the two is 0. [11, p 1063] The sample statistic computed to estimate the value of Spearman’s rho (or Spearman’s r) will be dentoed by rˆs . For X and Y of sample size n, using the notation from section 3.1 and letting Rxi denote the rank of variable xi , and Ryi denote the rank of variable yi : �2 n � � 6 Rxi − Ryi i=1 � � rˆs = 1 − . n n2 − 1 SAS computes rˆs by ranking the data and using the ranks in the Pearson formula. When ties � occur, the averaged ranks are used. The p-value for Spearman is computed by treating rˆs 2 (n − 2) as coming from a t-distribution with n − 2 degrees of freedom.[10, p 19] t= 1 − rˆs 2 This is the same way the p-value was computed for Pearson, except that rˆs is used in place of ρ̂. 15 4.3.1 Generic Example of Computing Spearman’s Rho and the Corresponding P-value Suppose we have n = 4, and the following points, (xi , yi ), within our data: (0.3, 1.5), (0.5, 2.5), (0.6, 2.3), and (0.9, 4.6). Ranking these points, (Rxi , Ryi ): (1, 1), (2, 3), (3, 2), and (4, 4). � 6 (1 − 1)2 + (2 − 3)2 + (3 − 2)2 + (0 − 0)2 � � ⇒ rˆs = 1 − 2 4 4 −1 � � � � � � 2 � 0.8 4 − 2 � = 0.8, and t = ≈ 1 − 0.82 1.88562, and using a table of selected values ⇒ p-value ≈ 0.9. 4.4 Kendall’s Tau Kendall’s tau was developed in 1938 and is a bivariate measure of correlation used with rank-order data. The population parameter estimate is denoted by τ . The sample statistic computed to estimate the value of τ will be represented by τ̂ . Kendall’s tau measures the degree of agreement between two sets of ranks with respect to the relative ordering of all possible pairs of subjects/objects.[11, p 1079] For X and Y of sample size n, using the notation from section 3.1 and letting Rxi denote the rank of variable xi and Ryi denote the rank of variable yi . A pair, (Rxi , Ryi ) and (Rxj , Ryj ) is said to be concordant if (Rxi − Rxj )(Ryi − Ryj ) > 0, or discordant if (Rxi − Rxj )(Ryi − Ryj ) < 0. Let nc denote the number of concordant pairs of ranks and let nd denote the number of discordant pairs in the ranks. Then τ̂ is defined nc − nd �. as: τ̂ = � n(n − 1) 2 16 Let tk denote the number of tied x values in the kth group of tied x values, ul denote the number of tied y values in the lth group of tied y values, n denote the sample size, and define sgn(z) as:   1, sgn(z) = 0,   −1, if z > 0 if z = 0 . if z < 0 �1 �1 1 Let T0 = n(n − 1), T1 = tk (tk − 1), and T2 = ul (ul − 1). 2 2 2 k Then we can define τ̂ as: τ̂ = Let s = �� i<j l �� i<j sgn(xi − xj )sgn(yi − yj ) � (T0 − T1 )(T0 − T2 ) � . � sgn(xi − xj )sgn(yi − yj ) . v1 v2 v0 − vt − vu + + , Define the variance of s, V (s), as: V (s) = 18 2n(n − 1) 9n(n − 1)(n − 2) � � where v0 = n(n − 1)(2n + 5), vt = tk (tk − 1)(2tk + 5), vu = ul (ul − 1)(2ul + 5), k� l � � �� �� � �� �� u (u − 1)(u − 2) t (t − 1)(t − 2) u (u − 1) t (t − 1) l l l k k k l l k k . , and v2 = v1 = k k l l s We compute the p-values by treating � as coming from a standard normal distribution.[10, V (s) p. 20-21] 4.4.1 Generic Example of Computing Kendall’s Tau and the Corresponding P-value To illustrate the computation of Kendall’s tau, as well as the corresponding p-value, we will utilize the same example as was used in the generic example of computing Spearman’s rho and its corresponding p-value in Section 4.3.1 on Page 16. 17 Suppose we have n = 4, and the following points, (xi , yi ), within our data: (0.3, 1.5), (0.5, 2.5), (0.6, 2.3), and (0.9, 4.6). Ranking these points, (Rxi , Ryi ): (1, 1), (2, 3), (3, 2), and (4, 4). The concordant pairs are: (1, 1), (2, 2) & (1, 1), (3, 2) & (1, 1), (4, 4) & (2, 3), (4, 4) and (3, 2), (4, 4). The discordant pair is: (2, 3), (3, 2). ⇒ nc = 5 and nd = 1. ⇒ τ̂ = � 5−1 2 �= 3 4(4 − 1) 2 If we use the second formula for τ̂ , we get the same result. s = 5 − 1 = 4, tk = 0, and ul = 0. T0 = 1 × 4 × (4 − 1) = 6, T1 = 0, and T2 = 0. 2 2 5−1 = . ⇒ τ̂ = � 3 (6 − 0)(6 − 0) We can now compute V (s). vo = 4 × (4 − 1) × (2 × 4 + 5) = 156, v1 = 0, and v2 = 0. ⇒ V (s) = 26 156 − 0 − 0 = 18 3 18 s 4 ⇒� = �� � ≈ 1.35873 26 V (s) 3 Using a table of values for the standard normal distribution, ⇒ p-value ≈ 1 − 0.3708 = 0.6292. 4.5 Discussion of Pearson, Spearman, and Kendall It is recommended that for interval or ratio data in the bivariate case that the Pearson product-moment correlation coefficient be used, for ordinal or rank order data of bivariate case that Spearman’s rank-order correlation coefficient or Kendall’s tau be used.[11, p 117] Pearson is a stronger correlation coefficient5 than Spearman or Kendall, but has additional restrictions, such as the requirement of parametric data.6 Spearman’s rho is more commonly used than Kendall’s tau for two primary reasons. The computations for tau tend to be more tedious than those completed when calculating rho.7 [11, p. 1080] The second reason is that when the sample is derived from a bivariate normal distribution, Spearman’s rho tends to provide a reasonably good approximation of Pearson, while Kendall’s tau will not. An advantage of Kendall’s tau is that it has a sampling distribution that approaches normality very quickly. Spearman’s rho, on the other hand, needs a fairly large sample size to employ the normal distribution to approximate the sampling distribution of rho.[11, p. 1080] As a τ̂ general rule, |τ̃c | < |r˜s | for a set of data, and → (0.67)2 .[11, p. 1080]8 rˆs 2 In Sections 4.3.1 and 4.4.1 we had τ̂ = and rˆs = 0.8, ⇒ |τ̂ | < |rˆs |, which follows the 3 τ̂ ≈ 0.83333 �= (0.67)2 , yet, it does not disprove the general rule as general rule. However, rˆs we just used a generic example which had a very small sample space. 5 ‘Stronger’ in this case is referring to a higher degree of statistical significance. Recall, it specifically requires a bivariate distribution which is approximately normal. 7 With the advances in computing, and the introduction of statistical software packages, this has become less of an issue. 8 This is not the case when the value of Spearman’s rho is 1 or −1. In that case, Kendall’s tau will also be 1 or −1 respectively. This is the same for the case when Kendall’s tau is known to be 1 or −1. 6 19 5 Experimental Information 5.1 RELAP5-3D 5.1.1 Terminology and Basic Deck Requirements[7, p. A1-1] Term/Accronym BE Card Card # Comment Card Continuation Card Data Card Input Deck Terminator Card Title Card Word Definition/Description Best-Estimate an 80-character record in the input deck the first field on the data card. It is an unsigned integer, and is used to specify the component number the card supplies information about. identified by a ‘∗’ or a ‘$’ as the first nonblank character. Blank cards are treated as comment cards. With the exception of printing out their contents, there is no processing of comment cards. identified by a ‘+’ as the first nonblank character on the card, may follow a data card or another continuation card. Fields on each card must be completed on that particular card (i.e. a field may not continue from one card onto the next.) contains varying numbers of fields that may be integer real, or alphanumeric. If a matching card number is found, the data card that appears last in the deck is the card that is used. term used to describe the input files identified by a ‘/’ or a ‘.’ as the first nonblank chearcter. Comments may follow ‘/’ or ‘.’ on a particular card identified by an ‘=’ sign as the first nonblank characters and contains no more than 80 characters including the ‘=’. fields on the data card following the card number, a word is terminated by comma(s) or space(s). Numeric words must begin with a digit (0-9) or a sign (+ or -), or a decimal point. A RELAP5-3D input deck typically consists of at least one title card, optional comment cards, data cards and a terminator card. 20 5.1.2 Safety Analysis of NPPs & BE Codes To ensure safety in the reactor design, operator training, and upgrades to the Nuclear Power Plant (NPP), Best Estimate (BE) codes are frequently used to model NPPs and to analyze their safety. A Best Estimate code is a system code that is capable of predicting/ modeling physical phenomenon, free of any conservatism regarding selected acceptance criteria, and able to provide a sufficiently detailed model to describe the relevant processes.[9, p. 193] RELAP53D is the BE code used in this study. 5.1.3 About RELAP5-3D is a fully integrated, multi-dimensional thermal-hydraulic and kinetic modeling program. It is a BE code developed at the INL, which serves as a modeling and simulation tool to support engineering design and safety analysis of nuclear reactors. It is also used for non-nuclear fields such as fossil power plants, oil and gas pipelines, municipal steam supply systems. 5.1.4 Running RELAP5-3D Upon performing the calculations of the input model, RELAP5-3D produces three output files: a ‘.p’ file, a ‘.plt’ file, and a ‘.r’ file. The ‘.p’ file is a printed output file, the ‘.plt’ file is a plot file, and the ‘.r’ file is the restart file. In our studies, we were primarily concerned with examining the printed output file. We wrote a Python script, which is described in Section 5.5 on Page 33. This script locates our desired ouput parameter value from the ‘.p’ file, and then places that value into a parameter value file which is created with the input modification program described in Section 5.4 on Page 29. 21 5.2 AP600 Deck [13] 5.2.1 [5] Background on the AP600 Nuclear Power Plant The AP600 Nuclear Power Plant (NPP) was designed by Westinghouse as a part of the cooperative U.S. Department of Energy (DOE) and the Electric Power Research Institute (EPRI) Advance Light Water Reactor Program (ALWR). [12] For safety, the AP600 relies on operation of passive systems. The Phenomena Identification and Ranking Table (PIRT) compiled by Burtt, et al (used in this paper, see the references section, number [1]) addresses AP600 behavior expected during small break loss-of-coolant, main steam line break, and steam generator tube rupture accidents. [1] 22 5.2.2 Variable Names, Representation, & Corresponding PIRT[1] Phenomena Variable Representing Corresponding to (in PIRT) PIRT Ranking VAR1 Core Power High VAR2 VAR3 FissionProduct Yield (i.e. decay-heat) Roughness Form Loss High High VAR4 Form Loss VAR5 VAR6 High High Injection Line - CMT Level in CMT High High VAR9 VAR10 VAR11 Area (ADS-4) Area (Break Valve) Area (Orifices) Initial Level of Pressure Roughness Roughness Fouling Factor Flow Resistance in the IRWST Flow in Accumulator (pressurized volume) Flow in Accumulator (pressurized volume) ADS Energy Release Mass Flow in Break9 Medium Medium Medium VAR12 Fouling Factor ADS Flow Resistance ADS Flow Resistance PRHR (Heat Transfer between PRHR & IRWST) Steam Generators (Primary to Secondary Heat Transfer) PRHR-Flow Resistance # 1 PRHR-Flow Resistance #2 Minimum Value of the Core Collapsed Liquid Level 10 VAR7 VAR8 VAR13 VAR14 COREMIN 5.2.3 Roughness Roughness Control Variable 116 High Medium Low Low N/A Studies with the AP600 Deck Using the AP600 deck, we conducted four studies. These studies were based upon the size of break in the cold leg. Each of the 13 variables11 had three values which were evenly distributed throughout the interval (i.e. a minimum, a mean, and a max). Variable 6 denoted the size of the break and was used to create the four different studies. To have 9 This was used to create the four different studies: 2 inch Break, 4 inch Break, 6 inch Break, and 8 inch Break. 10 COREMIN is the key output parameter used in the AP600 studies 11 i.e. VAR1-5, VAR7-14. VAR 6 was used to vary the break size. 23 every possible combination of variable values, this would mean creating 313 = 1, 594, 323 input files. Performing even a single study with 313 runs of 400 seconds would require 7,381 days on a single processor. Even utilizing the INL cluster, described in Section 5.5 on Page 33, which has 32 cores per node and 12 nodes, it would require 19 days to run the study. There are many ways to reduce the number of runs in a study. We decided to investigate the use of grouping our studies into smaller sets to reduce the number of required runs for each study. We first separated each study into two or three sets. The variables that had correlation coefficients that were ranked high or medium among the sets would then be grouped together and run again. Through experimentation, we found that separating the studies into smaller sets did not significantly affect the calculations of the relative correlation coefficients and substantially reduced the amount of time needed to run our studies. The size of the break dictates how long the transient runs. In order to further decrease the run-time of our studies, we plotted each of the four transients (2 inch, 4 inch, 6 inch, 8 inch) to determine what the duration of the transient should be for each respective study. The duration of the transient that was selected for each study encompassed the time when the collapsed core level reached its lowest height. These plots can be seen in Figures 2, 3, 4, and 5, respectively.12 We determined that it was effective to run the 2 inch break transient for 400 seconds, the 4 inch break transient for 200 seconds, the 6 inch break transient for 200 seconds, and the 8 inch break transient for 75 seconds. The results from the ‘top study’ of each of the cold-leg break studies are presented in Section 6.1.1 on Page 35. 12 coremin represents the key output parameter, which is a control variable we created that takes the minimum of control variable 114 (collapsed core liquid level). Control Output() is the (Percentage of) Collapsed Core Liquid Level. 24 AP600 2 inch Break AP600 4 inch Break ap2ins2_00000034 ap4int5_00000138 Core Collapsed Liquid Level (cntrlvar114) Coremin (cntrlvar116) 120 Control Output () Control Output () Core Collapsed Liquid Level (cntrlvar114) Coremin (cntrlvar116) 110 100 90 100 80 60 80 0 100 200 300 400 0 Time (s) 50 100 150 200 Time (s) Figure 2: 2 inch Break Transient Plot Figure 3: 4 inch Break Transient Plot Our first study that we conducted was on a four inch break. To decrease run-time, we broke the study into two sets: the first set had only variables 1-5 and 7-8 (i.e. the PIRT-ranked ’high’ variables, note that as stated previously, variable 6 is the break size and thus will not be adjusted within the 4 inch study) varying, while the other 6 variables were held at the nominal (or mean) value. The first set was 37 = 2, 187 input files. The second set had only variables 9-14 (i.e. the PIRT-ranked mediums and lows) varying, while the other 7 variables were held at their respective nominal values. The second set consisted of 36 = 729 input files. After both sets were complete, and analyzed using SAS, we created a new study, which was based on the top 5 most correlated variables from both 4 inch studies: VAR1, VAR8, VAR11, VAR12, and VAR13. Just as before, all five variables varied between the three values while the other 8 variables were held at their respective nominal values. This created 35 = 243 input files. Our second study was on a 2 inch cold leg break. We put this study into three sections (the other variables are held at their respective nominal values): variables 1-5 varying (25 = 243 input files), variables 7-10 varying (24 = 81 input files), and variables 11-14 varying (24 = 81 input files). After all three sets were analyzed using SAS, we created a new study, based on 25 AP600 6 inch Break AP600 8inch Break ap6int5_00000029 apins1_000000216 1000 100 Core Collapsed Liquid Level (cntrlvar114) Core Collapsed Liquid Level (cntrlvar114) Coremin (cntrlvar116) Control Output () Control Output () Coremin (cntrlvar116) 800 90 80 70 60 600 400 200 50 40 50 100 150 200 Time (s) 0 0 50 100 150 Time (s) Figure 4: 6 inch Break Transient Plot Figure 5: 8 inch Break Transient Plot the top 4 most correlated variables from the three sets: VAR1, VAR8, VAR12, and VAR13. As with the four inch study, we varied these variables between the three variables, while the other 9 variables were held at their respective nominal values. This created 34 = 81 input files. Our third study was on a 6 inch cold leg break. We split the study into 3 sections, which were identical to the sections for the 2 inch break study. After the three sets were analyzed with SAS, a new study was created based on the top 5 most correlated variables from the three sets: VAR1, VAR7, VAR8, VAR12, and VAR13. These were varied as with the 2 inch and 4 inch break studies: the 5 variables were varied by 3 values, and the other 8 were held constant at their respective nominal values. This created 35 = 243 input files. Our final study of the AP600 deck was on an 8 inch cold leg break. As with the 2 inch and 6 inch break studies, we split the 8 inch study into the same sets. After the three sets were analyzed using SAS, a new study was created based on the top 4 most correlated variables from the three sets: VAR1, VAR8, VAR12, and VAR13, creating 34 = 81 input files for this section of the study. 26 200 In all of the studies, there were variables which had their respective p-value > 0.05. This does not indicate that these variables were statistically insignificant, or that they were unimportant to the minimum core level. Rather, it indicates that we cannot make a conclusion regarding their correlation to the minimum core level, and that further investigation is needed for these variables. 5.3 5.3.1 LOFT Deck Background Information on the LOFT Nuclear Power Plant Following the 1988 revised emergency core cooling system rule for LWRs which allows the use of best estimate plus uncertainty methods in safety analysis, a study was conducted at the Idaho National Laboratory (INL) based on a cold leg large break loss of coolant accident test in the Loss of Fluid Test (LOFT) experimental facility. The LOFT facility was a 50 MW PWR that was designed to model a large break loss of coolant (LBLOCA) in a commercial pressurized water reactor (PWR). The facility was operational from the late 1970’s to the mid 1980’s.[15] The input deck used in this study was the same input deck used by G.E. Wilson and C.B. Davis in their “Best Estimate Versus Conservative Model Calculations of Peak Clad Temperature: An Example Based on the LOFT Facility” paper (see reference [15].) 27 5.3.2 Variable Names and Corresponding Phenomena [15] Group Number 1 2 3 4 5 6 n/a 5.3.3 Variable(s) Representing VAR1-VAR24 VAR 25 VAR26-VAR43 VAR 44 Peaking Factor (i.e. core power fractions) Fuel Clad Gap Width Fuel Thermal Conductivity Clad to Coolant Heat Transfer (i.e. fouling factor) Break Discharge Coefficient Pump Degradation Peak Clad Temperature 13 VAR45-VAR46 VAR47-VAR51 Control Variable 234 LOFT Studies We conducted two studies using the LOFT deck. Both studies values were selected based upon G.E. Wilson and C.B. Davis’ paper. For both studies, the key output parameter in the study was Peak Clad Temperature (PCT). In the first study, each of the six groups of variables had 3 points uniformly distributed (i.e., minimum, mean, and maximum). All groups used minimum, mean, and maximum for their three values. However, the variables within each group often had differing maxima, minima, and means. For example, in group one there were 24 different sets of minimum, mean, and maximum, yet all variables in the group needed to vary in the same way. For instance, each of the 24 variables in group one all needed to experience their respective minimum simultaneously. Likewise, each of the 24 variables in group one had to achieve their mean simultaneously. Similarly, the 24 variables all experienced their respective maxima simultaneously. There were 36 = 729 input files in the first study. In the second study, each of the six groups had 5 different values (i.e., minimum, lowmean, mean, high-mean, and maximum.) The groups of variables functioned the same way for the second study as the first study, just with additional values. In other words, for 13 Peak Clad Temperature is the key output parameter used in the LOFT study. 28 group one, the 24 variables were varied simultaneously, with each variable within the group experiencing it’s particular low-mean simultaneously. Likewise, each of the 24 variables experienced its respective high-mean simultaneously. There were 56 = 15, 625 input files in the second study. The results from both studies with the LOFT deck are presented in Section 6.2 on Page 36. 5.4 Input Modification Program c In order to run the AP600 study and the LOFT study, a Fortran 90� program was created. This program uses a marked input deck and study specification file(s) to create input files with input values varying as specified in the specification file(s). 5.4.1 Marked Input File After an input deck14 and the variables of interest (sometimes referred to as input parameters) as well as the key output parameter have been selected, the user must determine how these selected input parameters should vary. Once that is determined, the user should create a ‘spec file’ (or Specification File). Specification Files are discussed in Section 5.4.2. The base input deck should then be ‘marked’ by the user- this consists of locating the variables of interest (i.e. card number and word) within the deck, and then placing a ‘$ XXXX’15 in place of the current value on the card in the deck.16 This process should be undertaken simultaneously with the creation of the ‘spec file’ so as to avoid mistakes. 17 After the base deck is completely marked, we refer to it as the “marked input deck.” 14 To avoid confusion, we will refer to this input deck as the base input deck. XXXX denotes the variable name of that particular input parameter 16 In our studies, we selected ‘VARX’ , where X = 1, 2, 3, ... to denote the various variables. 17 There are very specific parameters for the length of character name, so care should be taken. Details of this can be found within the main program- see Appendix A for further details. Additional care should be taken when replacing values as a card may only contain 80 characters, so the user may wish to consider adjusting spaces within a given card or splitting the card (i.e. making a continuation card.) See reference [7]. 15 29 5.4.2 Specification Files The specification file(s) or ‘spec file(s)’, contains all of the necessary information for a given study. The first line of a spec file indicates the type of spec file it is. There are two types of spec files: (1) a Generator Specification File and (2) a Node Specification File. These are discussed in the Subsections 5.4.2(a) and 5.4.2(b) respectively. Both types of spec files contain: the base name of the files that are generated (this is also the name (without the extension) of the marked input file), the number of variables in the study, the number of nodes in the study 18 , which node (or set) of this spec file corresponds to, the number of groups in the study19 , as well as variable name20 , the minimum value of the variable, maximum of the variable, standard deviation of the variable, number of variations of the variable (i.e. number of points for the variable), the distribution type of the variable, and the group number the variable belongs to21 . A template of a spec file can be seen in Appendix B on Page 51. 4.5.2(a) Generator Specification File A “Generator Specification File” or “generator spec file” is a spec file with generate on the first line of the spec file. When combined with the executable produced by the input modification program, described in Section 5.4.3, it produces a specified number of node spec files, each of which has a different node number22 . The node number corresponds to the INL cluster node, where each node has multiple cores. The INL cluster is discussed more in Section 5.5 on Page 33. To see an example of a 18 The ‘number of nodes’ refers to the number of studies within the study. i.e. We break each study into multiple sets (or studies) so that it is easier to run the study on the cluster. This is discussed in greater detail in Section 5.5. 19 The ‘number of groups’ refers to the number of variables that vary INDEPENDENTLY within the study- i.e., in our LOFT studies, we had variables which had to vary simultaneously (dependently). For instance, variables 1-24 all varied simultaneously, variable 25 varied independently, variables 26-43 varied simultaneously, variable 44 varied independently, variables 45-46 varied simultaneously, and variables 4751 varied simultaneously, so we had 6 groups. In the case of the AP600 studies, all 14 variables varied independently and so the number of groups was equivalent to the number of variables, 14. 20 Note that the ‘$’ is not written into the spec file- though it is marked that way in the marked input file. The ‘$’ is appended within the main program, see Appendix A for more information. 21 i.e. VAR1-24 in LOFT study are in group 1, and so a 1 is written in that variable’s line. 22 Using the notation from the template spec file in Appendix B, the specified number of spec files is #nodesInStudy, and the node number corresponds to ‘currentNode’. 30 generator spec file, see Appendix C on Page 52. The motivation for generating separate node spec files was cluster supercomputer limitations. Generating thousands of input files on a single processor, then moving them to the nodes where they would run ties up communication resources need for other data flow and can seriously impair performance. It is far more efficient to generate the RELAP5-3D input files on the nodes where they will run, thereby eliminating all such input file movement. 4.5.2(b) Node Specification File A “Node Specification File” or “node spec file” is a spec file with run on the first line of the spec file. When combined with the executable produced by the input modification program, described in Section 5.4.3, it produces the input files corresponding the particular node number of the node spec file. To see an example of a node spec file, see Appendix D. 5.4.3 Main Program The main program, input mod gen.f90, is included as Appendix A on Page 40. Its purpose is to create an entire statistical study by generating input relating to a PIRT analysis. It has three purposes: 1. Interpret the “generator specification file” and create a number of “node specification files.” 2. Produce all RELAP5-3D input files for a given node of the cluster supercomputer from the “node specification file” and a single RELAP5-3D input template file. 3. Handle the situation where a group of input parameters vary together (are 100% correlated). The main program is run first to create a node specification file for each cluster node; a node may have up to 32 cores that can each run RELAP5-3D independently and simultaneously. 31 The creation of the node spec files from a generator spec file is done through the command line prompt: input mod gen.exe -i generator spec file of my study This creates the corresponding node spec files and these node spec files are exported to each node along with a copy of the template input file. The main program is run on each node to produce the specific input files of the statistical study, and is run on the cluster via a Python script which is described in Section 5.5 on Page 33. The complete set of possible combinations of input values can be ordered as a set of n-tuples. The set of ntubles is generated by a recursive algorithm and therefore works for any number of input parameters. The ordinal number of the n-tuple that is used to generate an input file is assigned as the input file’s sequence number and becomes part of its name. Concatenating its sequence number to the base name of the statistical study forms its name. All input files have a unique name, regardless of the node on which it runs. The input files are created by copying the template input file then substituting the variable values corresponding to its n-tuple into the input file for that variable’s marker. Markers had the form $VAR1, $VAR2, ... $VARK. When some variables are 100% correlated, K is larger than n (the size of the n-tuples). The values of the correlated variables are varied together. For example, if group one has 20 variables and a uniform distribution with 3 “levels” in use, namely minimum, mean, and maximum value, the group counts as one variable in the first position of the n-tuple previously discussed. The group has three levels: minimum, mean, and maximum. However, when an input file is generated, the particular “maximum value” of each variable is substituted for its marker ($VAR1 through $VAR20). Input files are created on node 3 with the following command: 32 input mod gen.exe -i node3 spec file of my study . The number of input files generated is a function of the number of groups and the number of value levels within the group. For example, if group 1 has 6 variables and 3 levels, group 2 has only one variable with 8 levels, and group 3 has 9 levels, there would be 3 ∗ 8∗ = 216 combinations in the entire statistical study. The program determines the number of input files that are created by each node spec file based upon the #nodesInStudy (combSet in � � # of Input Files in Study program) by taking the celing function of . The second LOFT #nodesInStudy study had 6 groups of variables, each with 5 values for a total of 15,625 runs. Splitting these runs among 9 node spec files placed 1736 runs each on nodes 1-8 and 1737 runs on node 9. 5.5 Running on the Cluster & Python Scripting Studies were run on one of the INL’s supercomputers, Quark, which has 12 nodes. Users submit jobs, such as our statistical studies, via a batch queuing system. Due to limited resources particularly on moving large amounts of data from the head node to computational nodes, it is much more efficient to generate the input files on the node as explained in Section 5.4.3 on Page 31. The Python scripts are included in Appendix E on Page 53. It runs the main program on the head node of the cluster, moves the node specification file onto the cluster’s computation nodes, runs RELAP5-3D in parallel on the input files, collects the output from the RELAP53D output files, and plaes it in a “study output file” on the line corresponding the input’s n-tuple. These files are ported back to the head node and are then combined into a single “study output file.” Thereafter, SAS can be used to perform the statistical analysis. 33 5.6 c Using SAS� Once all of the res files have been created, as described in Section 5.5, we copy them into the local desktop, relabeling the files’ extensions as ‘.csv’ (as opposed to ‘.res’), and adding an additional line to the beginning of the file which typically looks like ‘runNumber,VAR1,VAR2,VAR3,....,KEYOUTPUT’. We then import each file into SAS, a statistical software package. We used the SAS package, SAS EnterpriseGuide 4.3, which offers a graphical user interface of SAS 9.2. We then combined the res files from all of the nodes into one data set, through utilization of the ‘append table’ feature, “tasks \ data\ append table”. We then calculated the correlation coefficients using the correlation coefficient function, “tasks \ Multivariate \ Correlation Coefficient”. We selected the variables as analysis variables, and correlated them with the key output parameter. The options we selected were Pearson, Hoeffding, Kendall, and Spearman, and we included the Pearson correlation options of covariances, sums of squares and crossproducts. These produced SAS reports, which are found in Appendix F. We were then able to rank the variables accordingly. 34 6 Results 6.1 6.1.1 AP600 Studies AP600 Correlation Coefficient Classification Break 2 inch 4 inch 6 inch 8 inch23 6.1.2 High ζ Core Power (PIRT High) Core Power (PIRT High) Medium ζ Low ζ PRHR-Flow Resistance # 1 (PIRT Low) Core Power (PIRT High) Level in CMT (PIRT High) PRHR-Flow Resistance #1 (PIRT Low) Core Power (PIRT High) Level in CMT (PIRT High) SG-Heat Transfer (PIRT Medium) SG-Heat Transfer (PIRT Medium) Discussion of the Rankings of the Phenomena All variables which were not listed in Section 6.1.1 had their respective p-value > 0.05. In the 2 inch and 4 inch studies, the findings were as we expected based upon the PIRT recommendations. In the 6 inch and 8 inch studies, there were some surprising results. In the 6 inch study, two PIRT-ranked ‘highs’ had a correlation coefficient classifications of ‘medium’, and a PIRT-ranked ‘medium’ had a low correlation coefficient classification, of particular interest was that one PIRT-ranked ‘low’ had a medium correlation coefficient classification. In the 8 inch study, we saw a similar ranking pattern to that of the 6 inch study, with the exception being that all rankings in the 8 inch study were less than those of the PIRT, specifically, none of the rankings of the correlation coefficient classification 23 In the 8 inch break, the average of the correlation coefficients for the various phenomena were used. In the other studies, the three correlation coeffients were in agreement. The exact correlation coefficient values c Reports in Appendix F on Page 58. can be found in the SAS� 35 were greater than that of the PIRT. The rankings we saw in the 6 inch study (and in the 8 inch study) which were less than or equal to the PIRT rankings do not cause too much concern as the PIRT was conservative, i.e. if the panel was unsure as to whether something should be ranked as ‘high’ or ‘medium’, they ranked it as ‘high’. The result that surprised us was the phenomena in the 6 inch study which was ranked higher than the PIRT ranking in terms of correlation coefficients. 6.2 6.2.1 LOFT LOFT Correlation Classification Classification Group Name(s) High ζ Medium ζ Low ζ p-value > 0.05 Fuel Clad Gap Width Clad to Coolant Heat Transfer & Peaking Factor Break Discharge Coefficient & Fuel Thermal Conductivity Pump Degradation 6.2.2 Ranking the Phenomena Following the Correlation Computation After completing the correlation analyses for the LOFT study, we were able to numerically rank the phenomena from 1-5, with 1 representing the variable which was most strongly correlated with PCT and 5 being the variable which was least correlated with PCT. From an engineering perspective, we would rank the phenomena by absolute value of the change in PCT from the minimum value to the maximum value of the phenomena. To approximate that computation, we held the other phenomena at their respective nominal values. ≈ ∆t corresponds to the approximate change in temperature when we compare the PCT of the minimum value of the variable to the PCT of the maximum value of the variable, where all other variables are held constant at their respective nominal values. The following table presents the rankings: 36 Rank 1 2 3 4 5 Phenomena ≈ ∆t (Rank by ≈ ∆t) Fuel Clad Gap Width (G2) Clad to Coolant Heat Transfer (G4) Peaking Factor (G1) Break Discharge Coefficient (G5) Fuel Thermal Conductivity (G3) 200 (1) 80 (3) 50 (4) 90 (2) 45 (5) The ranking by correlation coefficients almost matches the ranking we get by considering ∆t- with the exception being that group 5 should be ranked number 2, and then the others would adjust accordingly. This seems to demonstrate that ranking using the correlation coefficients is fairly reasonable. Additionally, it may be worth noting that by the Apendix K ruling of the NRC, all of these correlation coefficients change in temperature would require that these phenomena be ranked ‘high.’ 7 Final Conclusions and Potential Future Work Overall, in the AP600 studies, we found that Core Power was the dominating input parameter which most strongly affected our key output, but found that the significance of the variables after that were largely dictated by the break size. For the most part, we found that our statistical rankings were generally the same or less than the PIRT ranking, with the exception of VAR13 in one transient (the 6 inch break.) This makes sense as the PIRT was conservative, i.e. if the experts doing the ranking were unsure as to whether or not a particular phenomenon was medium or high, they tended to rank it high. With regards to the one odd case of the variable 13 ranking medium in the 6 inch break, this indicates that we should further examine this variable and phenomenon. It may be that changing this variable actually relates to another phenomena not covered in the PIRT, or that this particular variable is more complex than we originally thought. One of the limitations of our study is that we cannot be sure how accurately our variables represent the phenomena. We 37 were limited by what quantities it made sense to adjust, as well as the fact that there were cases where we were unable to easily select variables to vary to correspond to phenomenon. In any case, the study does demonstrate great potential for further studies, in particular in applications to other PIRT analyses. In the LOFT studies, we found that fuel clad gap width was most strongly correlated with the PCT, and interestingly enough, found that the pump degradation seemed to have no relation to Peak Clad Temperature. Through utilization of PIRTs and statistical methods, we believe that a more accurate uncertainty analysis can be performed. Further studies may demonstrate that the utilization of statistical methods may improve upon the accuracy of PIRTs produced by a panel of experts. Other future work may utilize the concepts of sampling reduction techniques to vary a greater number of parameters which maintaining a relatively small run-time for studies. Additional improvements to the input file generator may include the addition of the ability for the user to specify a larger number of distributions for the values of various variables. Aknowledgements This work is indebted to many. The authors wish to thank and acknowledge the following individuals and organizations for their contributions to this project: Dr. Jodi Mead, of the Boise State University Department of Mathematics, for her support of this project, and her willingness to serve as the University’s advisor of this project. The International RELAP5 Users Group (IRUG), for funding this work. The INL’s RELAP5-3D team, for their continued support and advice. Many thanks are owed specifically to the RELAP5-3D team’s Paul Bayless and Cliff Davis for their assistance 38 and guidance regarding phenomena. The Idaho National Laboratory and Boise State University’s Department of Mathematics, for their support of this work. References [1] J.D. Burtt, C.D. Fletcher, G.E. Wilson, C.B. Davis, and T.J. Boucher. ”Phenomena Identification and Ranking Tables for Westinghouse AP600 Small Break Lossof-Coolant Accident, Main Steam Line Break, and Steam Generator Tube Rupture Scenarios.” INEL-94/0061. November 1996, Revision 2. 3, 5, 22, 23 [2] Christopher Chatfield, “Statistics for Technology.” 3rd Edition. Chapman and Hall: New york, 1985. 9, 11 [3] W.J. Conover, “Practical Non-Parametric Statistics.” 3rd Edition. John Wiley & Sons, Inc: New York, 1999. Pages 312-313. 11 [4] J.D. Gibbons and S. Chakraborti, “Nonparametric Statistical Inference.” 3rd Edition Revised and Expanded. Marcel Dekker, Inc: New York, 1992. 13 [5] http://notrickszone.com/wp-content/uploads/2011/03/nuclear-power-plant.jpg 22 [6] T. J. Olivier and S. P. Nowlen, “A Phenomena Identification and Ranking Table (PIRT) Exercise for Nuclear Power Plant Fire Modeling Applications.” NUREG/CR-6978, 1998. Pages: iii, 1. 7 [7] RELAP5-3D Manual (Volume 2, Appendix A: RELAP5-3D Input Data Requirements, Ver 3.0.0 Beta) 3, 20, 29 [8] Yigal Ronen, “Uncertainty Analysis.” CRC Press: Boca Raton, 1988. 6 39 [9] F. D’ Auria, H. Glaeser, S. Lee, J. Mis̆ák, M. Modro, and R. Schultz. “Best Estimate Safety Analysis of Nuclear Power Plants: Uncertainty Evolution.” Safety Report Series No 52, 2008. 21 c [10] SAS Institute Inc 2010. “Base SAS�9.2 Procedures Guide: Statistical Procedures, Third Edition.” Cary, NC: SAS Institute Inc. 15, 17 [11] David J. Sheskin, “Handbook of Parametric and Nonparametric Statistical Procedures.” 3rd Edition. CRC Press: Boca Raton, 2000. 9, 12, 13, 14, 15, 16, 19 [12] http://ap1000.westinghousenuclear.com/ap1000 background.html 22 [13] http://upload.wikimedia.org/wikipedia/en/e/ef/AP600PassiveContainment.jpg 22 [14] G. E. Wilson and B. E. Boyack,“The role of the PIRT process in experiments, code development and code applications associated with reactor safety analysis.” Nuclear Engineering and Design 186 (1998) 23-37. 6 [15] G.E. Wilson and C.B. Davis, “Best Estimate Versus Conservative Model Calculations of Peak Clad Temperature: An Example Based on the LOFT Facility.” Ninth International Topical Meeting on Nuclear Reactor Thermal Hydraulics (NURETH-9). San Francisco, California: October 3-8, 1999. 3, 27, 28 Appendices A 1 2 3 4 5 6 7 8 9 10 11 12 13 Input Modification Program program i n p u t m o d ! ! COGNIZANT : A l e x a n d r a E . Gertman !CREATED: 2/22/2012 !UPDATED: 5/02/2012 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− !PROGRAM DESCRIPTION : ! T h i s program was c r e a t e d t o g e n e r a t e many i n p u t f i l e s w i t h v a r y i n g ! p a r a m e t e r s ( i . e . phenomena o r v a r i a b l e s ) . ! ! The program g e n e r a t e s an e x e c u t a b l e ( a . o u t ) upon c o m p i l a t i o n . ! ! The e x e c u t a b l e ( a . o u t ) i s combined w i t h a marked i n p u t f i l e a s 40 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ! w e l l as a study s p e c i f i c a t i o n f i l e ( spec f i l e ) to c r e a t e the ! new i n p u t f i l e s . ! ! A spec f i l e includes : ! − i f t h e s p e c f i l e s h o u l d g e n e r a t e new s p e c f i l e s OR ! i f i t should generate input f i l e s ! −t h e b a s e name o f e a c h g e n e r a t e d i n p u t f i l e ! ( b a s e name a l s o s e r v e s t o i n d i c a t e t h e name o f ! t h e marked i n p u t f i l e ) ! −t h e number o f v a r i a b l e s ! −t h e number o f j o b s t h e c o m b i n a t i o n s w i l l be s p l i t ! into ! −which s e t o f c o m b i n a t i o n s t h i s p a r t i c u l a r s p e c f i l e ! w i l l generate ! −t h e number o f g r o u p s o f v a r i a b l e s ! ( t h e r e a r e some c a s e s when v a r i a b l e s MUST be ch an ged ! simultaneously− in those cases , those v a r i a b le s ! w i l l a l l be g r o u p e d t o g e t h e r ) ! −t h e name o f e a c h v a r i a b l e ! − v a r i a b l e i n f o r m a t i o n s u c h a s d i s t r i b u t i o n which ! a l l o w t h e program t o make n e c e s s a r y c a l c u l a t i o n s ! to c a l c u l a t e the v a l u e s each v a r i a b l e i n the ! s p e c f i l e s h ou ld e x p e r i e n c e , as w e l l as the group ! number e a c h v a r i a b l e b e l o n g s t o . ! ! The e x e c u t a b l e w i l l p r o d u c e a f i l e c o n t a i n i n g t h e run i n f o r m a t i o n ! ( r u n l a y o u t ) which s p e c i f i e s t h e number o f i n p u t f i l e s t h a t w i l l ! be b u i l t i n e a c h o f t h e ’ i n p u t f i l e g e n e r a t o r ’ s p e c f i l e s . ! ! I f t h e s p e c f i l e i s a ’ s p e c f i l e g e n e r a t o r ’ s p e c f i l e , when ! compiled with the executable , i t w i l l c r e a t e ’ input f i l e ! g e n e r a t o r ’ s p e c f i l e s ( t h e number o f which i s s p e c i f i e d i n t h e ! ’ spec f i l e generator ’ spec f i l e . ! ! I f t h e s p e c f i l e i s an ’ i n p u t f i l e g e n e r a t o r ’ s p e c f i l e , when ! c o m p i l e d w i t h t h e e x e c u t a b l e , i t w i l l c r e a t e new i n p u t f i l e s ! b a s e d upon t h e marked i n p u t f i l e and t h e s p e c i f i c a t i o n s i n ! t h e s p e c f i l e i t s e l f . Once c o m p i l e d u s i n g t h e e x e c u t a b l e , i t ! w i l l c r e a t e a comb f i l e ( which i t w r i t e s t o a s i t c r e a t e s e a c h ! o f t h e i n p u t f i l e s ) t h a t c o n t a i n s a l l o f t h e ’ run i n f o r m a t i o n ’ ! f o r each o f the input f i l e s being gen erated . ! ! !PROGRAM OUTLINE : ! ! 1 . I n i t i a l i z e v a r i a b l e s , o b t a i n and b y p a s s t h e name o f t h e e x e c u t a b l e f i l e , ! and r e a d t h e command l i n e o p t i o n . ! ! 2 . Open t h e f i l e s . ! 2 . 1 Open s p e c f i l e − a f i l e t h a t h a s i n f o a b o u t t h e s t u d y . ! 2 . 1 . 1 Read s p e c f i l e and t h e f o l l o w i n g i n f o r m a t i o n : ! 2 . 1 . 1 . a . Whether t h e s p e c f i l e i s an ’ i n p u t f i l e g e n e r a t o r ’ OR ! a ’ spec f i l e generator . ’ ! 2 . 1 . 1 . b . BASE Name f o r t h e i n p u t f i l e s ! 2 . 1 . 1 . c . Number o f v a r i a b l e s , number o f ’ i n p u t f i l e g e n e r a t o r ’ ! s p e c f i l e s t h a t w i l l be u s e d i n t h e s t u d y ( i . e . n j o b s ) , which ! p a r t i c u l a r ’ input f i l e generator ’ the spec f i l e i s ( i . e . ! combSet ) , and t h e number o f g r o u p s o f v a r i a b l e s i n t h e s t u d y . ! 2 . 1 . 1 . d . Name o f e a c h v a r i a b l e ( a s i t i s marked i n t h e f i l e − e x c e p t ! f o r t h e ’ $ ’− t h a t i s added i m m e d i a t e l y a f t e r t h e d a t a i s ! r e a d−i n . i . e . ’VAR1’ becomes ’$VAR1 ’ . ) ! 2 . 1 . 1 . e . Minimum and Maximum v a l u e s o f e a c h v a r i a b l e ! 2 . 1 . 1 . f . Standard D e v i at i o n o f each v a r i a b l e ! 2 . 1 . 1 . g . Number o f d a t a p o i n t s w i t h i n t h e r a n g e ! 2 . 1 . 1 . h . P r o b a b i l i t y f u n c t i o n name ( u n i f o r m , nromal , l o g n o r m a l , . . . . ) . ! NOTE: C u r r e n t l y o n l y u n i f o r m i s a v a i l a b l e . ! 2 . 1 . 1 . i . Group number e a c h v a r i a b l e b e l o n g s t o . ! 2 . 1 . 2 C a l c u l a t e t h e number o f p o s s i b l e c o m b i n a t i o n s , and c r e a t e an a r r a y b a s e d on n j o b s ! and nposscombs which s p e c i f i e s which r u n s w i l l t a k e p l a c e on e a c h combSet . ! 2 . 1 . 3 C r e a t e t h e f i l e r u n l a y o u t . Write nposscombs on l i n e 1 , and t h e n w r i t e t h e ! number o f c o m b i n a t i o n s i n e a c h combSet o n t o l i n e 2 . The f i l e i s t h e n c l o s e d . ! 2 . 1 . 4 Based on t h e f i r s t l i n e o f t h e s p e c f i l e , one o f 3 t h i n g s w i l l o c c u r : ! ( 1 ) I f the s p e c f i l e ’ s f i r s t l i n e say s ” g e n e r a t e ” send to the s u b r o u t i n e ! s p e c g e n . s p e c g e n w i l l g e n e r a t e n j o b s o f s p e c f i l e s which have ” run ” ! i n s t e a d o f ” g e n e r a t e ” and have d i f f e r e n t combSet numbers . i . e . o n l y ! t h e f i r s t two l i n e s o f t h e newly g e n e r a t e d s p e c f i l e s w i l l d i f f e r ! from t h e o r i g i n a l s p e c f i l e . Once g e n e r a t i o n i s done , program w i l l ! terminate . ! ( 2 ) I f f i r s t l i n e doesn ’ t s a y ’ run ’ o r ’ g e n e r a t e ’ , program w i l l t e r m i n a t e . ! ( 3 ) I f t h e f i r s t l i n e i s ” run ” , t h e program w i l l e x e c u t e n o r m a l l y . i . e . , ! Follow the remainder o f the o u t l i n e . ! 2 . 2 Name o f m a r k e d i n p u t f i l e i s c r e a t e d . ! 2 . 3 Open m a r k e d i n p u t f i l e ! ! 3 . Generate input f i l e s ! 3 . 1 C a l c u l a t e the v a r i a b l e v a l u e s f o r each i n t e r v a l with ’ uniform ’ d i s t r i b u t i o n . ! 3 . 1 . 1 C a l c u l a t e t h e i n t e r v a l l e n g t h and i n c r e m e n t s i z e 41 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 ! 3 . 1 . 2 Use t h e p r o b a b i l i t y f u n c t i o n , minimum , i n t e r v a l l e n g t h , ! and i n c r e m e n t s i z e t o c a l c u l a t e a l l t h e v a l u e s t h e v a r i a b l e ! w i l l have and s a v e t h e s e i n an a r r a y . ! 3 . 2 I n p u t f i l e g e n e r a t i o n t h r o u g h l o o p s and s u b r o u t i n e s . ! 3 . 2 . 1 Make columns an a r r a y o f o n e s ( o f s i z e n g r o u p s . ) ! 3 . 2 . 2 Open v a r v a l c o m b ( i . e . comb f i l e ) ! 3 . 3 I n p u t f i l e name g e n e r a t i o n and i n p u t f i l e c r e a t i o n t h r o u g h s u b r o u t i n e s . ! 3 . 3 . 1 G e n e r a t e a f i l e names b a s e d on c o m b i n a t i o n number o r v a r v a l u e . ! For example : ’ e d h t r k 9 9 ’ v s ’ e d h t r k 1 1 3 3 ’ . ! 3 . 3 . 2 Call the subroutine index gen to generate a l l the f i l e s . ! −As e a c h f i l e i s g e n e r a t e d , t h e run number ( i . e . comb number ) and ! t h e v a l u e s f o r e a c h v a r i a b l e i n t h a t p a r t i c u l a r run / i n p u t f i l e w i l l ! be w r i t t e n t o t h e comb f i l e . ! 4 . C l o s e a l l f i l e s ( w i t h t h e e x c e p t i o n o f f i l e 8 , f i l e N a m e , which i s c l o s e d i n t h e ! subroutine c o p y f i l e or the subroutine spec gen ) . !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! ! Data D i c t i o n a r y ! ! baseFileName = a c h a r a c t e r ( o f s i z e 1 0 ) i n d i c a t i n g t h e name o f RELAP5−3D ! input f i l e , w i l l s erve as beginning l e t t e r s of a l l generated ! input f i l e s . Additionally , i t w i l l s e r v e as the beginning of ! t h e name o f t h e f i l e v a r v a l c o m b . ! charCombNum = a c h a r a c t e r ( o f s i z e 8 ) which i s a c h a r a c t e r c o n v e r s i o n o f ! t h e c o m b i n a t i o n number o f t h e run s o t h a t e a c h l i n e i n t h e ! c o m b i n a t i o n f i l e s t a r t s w i t h t h e run number f o r t h e ! s p e c i f i c combination of v a r i a b l e s . I t i s a l o c a l v a r i a b l e ! i n t h e r e c u r s i v e s u b r o u t i n e i n d e x g e n . I t i s padded w i t h 0 ’ s ! t o e n s u r e t h a t e a c h run i s EXACTLY 8 d i g i t s . ! charCombSet = a c h a r a c t e r o f s i z e 3 which i s t h e c h a r a c t e r c o n v e r s i o n o f ! combSet . I t i s u s e d s o t h a t t h e s p e c f i l e can be appended w i t h ! t h e number c o r r e s p o n d i n g t o t h e s e t o f c o m b i n a t i o n s t h e s p e c ! f i l e needs to g e n e r a t e . It ’ s a l o c a l v a r i a b l e used i n the ! s u b r o u t i n e s p e c g e n . I t ’ s a l s o u s e d i n t h e main program t o ! make t h e comb f i l e s p e c i f i c t o t h e combSet . ! char i = a c h a r a c t e r ( o f s i z e 8 ) which i s a c h a r a c t e r c o n v e r s i o n o f ! columns ( 1 : n v a r ) o r ( a c h a r a c t e r c o n v e r s i o n o f t h e c o m b i n a t i o n ! number o f t h e run ) s o t h a t n e w F i l e can be appended w i t h e a c h ! p a r t i c u l a r variable ’ s corresponding index f o r that ! combination . I t i s a l o c a l v a r i a b l e used i n the s u b r o u t i n e ! name gen , and i s padded w i t h 0 ’ s t o e n s u r e i t e a c h name i s ! baseFileName XXXXXXXX , where XXXXXXXX i s EXACTLY 8 d i g i t s . ! charlen = a l o c a l i n t e g e r i n s u b r o u t i n e v a r f i n d e r which i s u s e d t o s t o r e ! the c h a r a c t e r c o n v e r s i o n o f the l en gt h o f a p a r t i c u l a r var ( i ) . ! I t i s u s e d t o r e −w r i t e l i n e w i t h t h e v a r i a b l e v a l u e s u b s t i t u t e d ! i n p l a c e o f ’$VARX ’ . ! charvalu = a l o c a l v a r i a b l e ( o f s i z e 1 2 ) i n s u b r o u t i n e v a r f i n d e r which i s ! t h e c h a r a c t e r c o n v e r s i o n o f v a l u . I t a l l o w s v a l u t o be appended ! t o t h e f i l e name . ! columns = an a r r a y o f i n t e g e r s ( o f s i z e nvar− o r i g i n a l l y s e t t o 5 5 ) which ! s t o r e s t h e i n d i c e s o f v a r i a b l e s i n any g i v e n c o m b i n a t i o n . ! columns ( j ) c o r r e s p o n d s t o j t h v a l u e o f v a r i a b l e j . ! comb number = an i n t e g e r i n d i c a t i n g t h e c o m b i n a t i o n number a p a r t i c u l a r ! generated input f i l e corresponds to . ! combSet = an i n t e g e r o f s i z e 3 i n d i c a t i n g which p a r t i c u l a r s e t o f ! c o m b i n a t i o n s t h e g i v e n s p e c f i l e w i l l need t o g e n e r a t e . ! ex = l o g i c a l f l a g i n d i c a t i n g e x i s t a n c e o f s p e c f i l e and ! marked input file . ! exfile = a c h a r a c t e r o f s i z e 10 i n d i c a t i n g t h e name o f t h e e x e c u t a b l e ! f i l e ( u s u a l l y a . o u t u n l e s s o t h e r w i s e s p e c i f i e d a t run t i m e f o r ! i n p u t m o d . f 9 0 . NOTE: i f t h e e x e c u t a b l e i s changed , t h e u s e r i s ! a d v i s e d t o make c o r r e s p o n d i n g c h a n g e s t o t h e python s c r i p t ! ( r u n x x x x . py ) i f t e s t s w i l l be made on t h e INL c l u s t e r . ! flag = a c h a r a c t e r o f s i z e 2 . I t i s e n t e r e d by u s e r a f t e r e x e c u t a b l e f i l e . ! I f f l a g i s n o t ’− i ’ program w i l l s e n d e r r o r m e s s a g e t o u s e r and q u i t . ! found = a l o g i c a l v a r i a b l e , used i n the s u b r o u t i n e c o p y f i l e to t e s t whether ! o r n o t ’$VAR’ o c c u r e d i n t h e l i n e ( c a r d ) b e i n g c o p i e d i n c o p y f i l e . ! genRun = c h a r a c t e r o f s i z e ’ 1 0 ’ which s h o u l d be e i t h e r ’ run ’ o r ’ g e n e r a t e ’ . ! I t i s f o u n d on t h e f i r s t l i n e o f t h e s p e c f i l e and i f genRun i s ! ’ g e n e r a t e ’ t h e program w i l l c a l l t h e s u b r o u t i n e s p e c g e n . I f i t ’ s ! ’ run ’ t h e n t h e program w i l l run n o r m a l l y . ! groupNumb = i n t e g e r a r r a y o f s i z e 55 which s t o r e s t h e g r o u p number o f e a c h v a r . ! i = i n t e g e r u s e d i n v a r i o u s a r g u m e n t s ( i . e . g e t a r g , do l o o p s , e t c ) . ! ierr = i n t e g e r u s e d t o d e t e c t an i n p u t e r r o r i n r e a d i n g t h e s p e c f i l e , ! m a r k e d i n p u t f i l e , f i l e N a m e ( s u b r o u t i n e c o p y f i l e and s u b r o u t i n e ! s p e c g e n ) , and v a r v a l c o m b f i l e s . ! i n c r e m e n t s i z e v a r = a r r a y o f r e a l numbers i n d i c a t i n g t h e s i z e o f i n c r e m e n t e a c h ! p a r t i c u l a r v a r i a b l e v a l u e w i l l i n c r e a s e by . ! colindex = i n t e g e r i n d i c a t i n g t h e i n d e x o f a p a r t i c u l a r column . I t i s u s e d i n ! i f statements in the subroutine indexgen ! int length var = array ( of s i z e 55) o f r e a l numbers i n d i c a t i n g t h e s i z e o f t h e ! range o f the v a l u e s f o r each p a r t i c u l a r v a r i a b l e . ! is = i n t e g e r u s e d t o d e n o t e t h e number o f command l i n e a r g u m e n t s when ! t h e e x e c u t a b l e f i l e i s run ( u s u a l l y a . o u t i s t h e e x e c u t a b l e ) ! j = i n t e g e r u s e d i n v a r i o u s a r g u m e n t s ( i . e . do l o o p s , e t c . ) ! job inc = r e a l number which i s u s e d t o d e t e r m i n e t h e number o f j o b s t h a t ! s h o u l d be i n e a c h combSet . ( i . e . j o b i n c = nposscombs / n j o b s ) . 42 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! line marked input file maxpts mn mx nameGenType newFile ngroups nposscombs npts nruns nvar originalFile prob run layout runLayout sp spec file stdev val valu var var val comb = a c h a r a c t e r ( o f s i z e 1 3 2 ) which i s u s e d i n t h e s u b r o u t i n e c o p y f i l e t o s t o r e e a c h s t r i n g o f t e x t from t h e m a r k e d i n p u t f i l e and t h e n i s u s e d t o w r i t e t h e same s t r i n g i n t o f i l e N a m e . I t i s t h e n p a s s e d t o t h e s u b r o u t i n e v a r f i n d e r which s e a r c h e s l i n e f o r t h e v a r i a b l e m a r k e r s ( ex : $VAR1 ) . I f i t d o e s c o n t a i n t h e s p e c i f i c v a r i a b l e marker , v a r f i n d e r w i l l make t h e v a r i a b l e / v a l u e s u b s t i t u t i o n , and p a s s l i n e back t o t h e s u b r o u t i n e c o p y f i l e . I t i s a l s o u s e d i n t h e s u b r o u t i n e s p e c g e n t o r e a d i n some o f t h e s p e c f i l e l i n e s . = c h a r a c t e r o f s i z e 25 which c o r r e s p o n d s t o t h e name o f t h e i n p u t f i l e which h a s been ” marked ” o r c o n t a i n s f l a g s i n d i c a t i n g where t h e v a r i a b l e s a r e t h a t w i l l be r e p l a c e d w i t h t h e v a l u e s g e n e r a t e d by t h i s program . I t i s u s e d a s a t e m p l a t e f o r g e n e r a t i n g new i n p u t files . = a r r a y ( o f s i z e 5 5 ) o f i n t e g e r s which i n d i c a t e t h e maximum number o f p o i n t s i n any v a r i a b l e ’ s r a n g e . = array ( of s i z e 55) o f r e a l numbers i n d i c a t i n g t h e minimum v a l u e f o r each p a r t i c u l a r v a r i a b l e . = a r r a y ( o f s i z e 5 5 ) o f r e a l numbers i n d i c a t i n g t h e maximum v a l u e f o r each p a r t i c u l a r v a r i a b l e . Also used l o c a l l y i n s u b r o u t i n e spec gen = a c h a r a c t e r ( o f s i z e 4 ) i n d i c a t i n g w h e t h e r t h e u s e r would p r e f e r t o g e n e r a t e names b a s e d on t h e t o t a l number o f c o m b i n a t i o n s ( ’ comb ’ ) o r t h e number o f v a l u e s f o r e a c h v a r i a b l e ( ’ var ’ ) . Ex : ’ e d 3 h t r k 9 9 ’ v s ’ e d 3 h t r k 1 1 3 3 ’ = a c h a r a c t e r ( o f s i z e 8 0 ) which c o r r e s p o n d s t o t h e name o f t h e new f i l e which i s g e n e r a t e d by t h e s u b r o u t i n e name gen = an i n t e g e r i n d i c a t i n g t h e number o f g r o u p s o f v a r i a b l e s w i t h i n a g i v e n f i l e . To be more e x p l i c i t , t h e r e a r e c a s e s i n which e n t i r e g r o u p s o f v a r i a b l e s must be ch an ged SIMULTANEOUSLY, and t h o s e v a r i a b l e s w i l l be ’ grouped ’ t o g e t h e r . e . g . i f v a r s 1−4 must c h a n g e s i m u l t a n e o u s l y , v a r 5 c h a n g e s i n d e p e n d e n t l y , v a r s 6−12 c h a n g e s i m u l t a n e o u s l y and v a r 13 c h a n g e s i n d e p e n d e n t l y t h e n t h e r e a r e 4 groups . = i n t e g e r i n d i c a t i n g t h e t o t a l number o f c o m b i n a t i o n s t h a t e x i s t f o r w r i t i n g one v a l u e f o r e a c h v a r i a b l e ( i . e . t h i s w i l l i n d i c a t e t h e number o f i n p u t f i l e s which w i l l need t o be g e n e r a t e d . ) = a r r a y ( o f s i z e 5 5 ) o f i n t e g e r s i n d i c a t i n g t h e number o f v a l u e s e a c h v a r i a b l e w i l l have . = a r r a y ( o f s i z e 5 5 ) o f i n t e g e r s which i n d i c a t e t h e number o f r u n s which a r e i n e a c h combSet . ( i . e . n r u n s ( 2 ) = t h e number o f r u n s i n t h e 2 nd combSet . The number o f g e n e r a t e d f i l e s w i l l be n r u n s ( combSet ) − n r u n s ( combSet − 1 ) . ) = i n t e g e r i n d i c a t i n g t h e number o f v a r i a b l e s which w i l l be r e p l a c e d i n the m a r k e d i n p u t f i l e . Also used i n s u b r o u t i n e s p e c g e n . = a c h a r a c t e r ( o f s i z e 1 0 ) which i s u s e d by t h e s u b r o u t i n e name gen t o d e n o t e t h e f i l e which w i l l be c o p i e d . = a r r a y ( o f s i z e 5 5 ) o f c h a r a c t e r s ( o f s i z e 8 ) which i n d i c a t e t h e t y p e o f p r o b a b i l i t y d i s t r i b u t i o n t h a t w i l l be u s e d t o d e t e r m i n e where t h e p o i n t s i n t h e i n t e r v a l f o r e a c h v a r i a b l e w i l l be . = t h e name o f t h e f i l e c o n t a i n i n g t h e run i n f o r m a t i o n ( i . e t h e number o f c o m b i n a t i o n s and t h e number o f f i l e s c r e a t e d f o r e a c h o f t h e combSets . I t i s a c h a r a c t e r o f s i z e 1 0 . = an a r r a y o f s i z e 5 5 , which h o l d s i n f o r m a t i o n a b o u t t h e number o f r u n s t h a t a r e i n e a c h combSet . I t i s w r i t t e n t o t h e f i l e r u n l a y o u t and t h e n u t i l i z e d by t h e python s c r i p t . = a c h a r a c t e r o f s i z e 1 (” ”) used l o c a l l y i n the s u b r o u t i n e v a r f i n d e r t o add an e x t r a s p a c e i n t h e l i n e ( c a r d ) a f t e r t h e v a l u e o f t h e v a r i a b l e i s i n s e r t e d AND t o add an e x t r a s p a c e t o t h e v a r i a b l e name . T h i s p r e v e n t s t h e program from r e p l a c i n g ’ $VAR11 ’ s v a l u e s w i t h ’$VAR1 ’ s v a l u e s , a s w e l l as preventing e r r o r s in value replacement− previously , e r r o r s occurred a s ’$VARX’ would r e p l a c e c o r r e c t l y , but ’$VARXY’ would add a ’Y’ t o t h e beginning of the value replacement . = c h a r a c t e r o f s i z e 20 which c o r r e s p o n d s t o t h e name o f t h e f i l e which c o n t a i n s i n f o r m a t i o n a b o u t e a c h o f t h e v a r i a b l e s which a r e g o i n g t o be r e p l a c e d i n t h e m a r k e d i n p u t f i l e . T h i s i n f o r m a t i o n i n c l u d e s bas eFil eName , combSet , genRun , mn, mx , n p t s , nruns , nvar , s t d e v , and v a r . I f genRun = ’ g e n e r a t e ’ s p e c f i l e i s u s e d a s a t e m p l a t e f o r t h e g e n e r a t e d s p e c f i l e s and s e r v e s a s a b a s e f o r t h e naming scheme o f t h e newly g e n e r a t e d s p e c f i l e s . = a r r a y ( o f s i z e 5 5 ) o f r e a l numbers i n d i c a t i n g t h e s t a n d a r d d e v i a t i o n o f each v a r i a b l e . = a r r a y o f r e a l numbers ( o f s i z e ( 2 0 , 5 5 ) ) which c o r r e s p o n d s t o v a l ( i , j ) = v a l u e i o f v a r i a b l e j from s p e c f i l e f o r m u l a . = an a r r a y o f s i z e n v a r which h o l d s t h e s p e c i f i c a r r a y o f v a l u e s f o r a g e n e r a t e d c o m b i n a t i o n o f v a r i a b l e s and v a l u e s ( i . e . v a l u ( j ) = v a l ( columns ( j ) , j ) ) . I t i s c r e a t e d i n t h e s u b r o u t i n e i n d e x g e n and t h e n p a s s e d t o t h e s u b r o u t i n e c o p y f i l e , and t h e n t o the subroutine v a r f i n d e r so that these values are plugged in f o r the s p e c i f i c v a r i a b l e in a p a r t i c u l a r copyFile . = array ( o f s i z e 55) o f c h a r a c t e r s ( o f s i z e 8) denoting each v a r i a b l e name = c h a r a c t e r o f s i z e 20 i n d i c a t i n g t h e name o f t h e f i l e c r e a t e d t h a t c o n t a i n s a l l t h e nposscombs o f v a l u e s o f t h e d i f f e r e n t v a r i a b l e s . I n t h e f i l e , column 1 c o r r e s p o n d s t o t h e v a l u e s o f v a r i a b l e 1 , column 2 c o r r e s p o n d s t o t h e v a l u e s o f v a r i a b l e 2 , e t c . Each row r e p r e s e n t s a d i f f e r e n t c o m b i n a t i o n ( i . e . nposscombs rows and n v a r columns ) 43 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 ! where = an i n t e g e r c o r r e s p o n d i n g t o a l o c a l v a r i a b l e i n s u b r o u t i n e ! v a r f i n d e r which h o l d s t h e v a l u e r e t u r n e d by t h e i n d e x f u n c t i o n ! ( e i t h e r a ’ 0 ’ o r a ’ 1 ’ ) which i n d i c a t e s i f t h e v a r i a b l e f l a g ! ( ex : $VAR1) i s w i t h i n a p a r t i c u l a r l i n e . !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! ! files ! ! f i l e u n i t number = f i l e name ! ! 1 = s p e c f i l e ( opened and c l o s e d i n input mod , u t i l i z e d i n t h e ! s u b r o u t i n e s p e c g e n i f genRun = ’ g e n e r a t i o n ’ . ) ! 2 = m a r k e d i n p u t f i l e ( opened and c l o s e d i n input mod , r e a d i n ! the subroutine c o p y f i l e . ) ! 3 = v a r v a l c o m b f i l e ( opened and c l o s e d i n input mod , w r i t t e n ! in the r e c u r s i v e subroutine index gen . ) ! 8 = f i l e N a m e . T h i s i s t h e f i l e which i s a copy a l l o f information ! from t h e m a r k e d i n p u t f i l e o r t h e i n f o r m a t i o n f o r s p e c f i l e i f ! genRun = ’ g e n e r a t e ’ . ( I t i s opened , w r i t t e n , and c l o s e d ! in the subroutine c o p y f i l e , or in the subroutine spec gen . ) ! 9 = r u n l a y o u t . T h i s i s t h e f i l e which c o n t a i n s t h e i n f o r m a t i o n a b o u t ! t h e r u n s i t a l l o w s t h e u s e r t o d o u b l e c h e c k t h a t t h e comb f i l e s ! g e n e r a t e d c o n t a i n t h e c o r r e c t number o f r u n s . The f i r s t l i n e i s ! nposscombs . The s e c o n d l i n e i s t h e a r r a y runLayout , w i t h e a c h ! i n t e g e r i n t h e a r r a y b e i n g s i z e 4 . I t was o r i g i n a l l y c r e a t e d t o ! be u s e d i n t h e python s c r i p t , but we ended up n o t u s i n g i t i n ! that capacity . !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! ! program / s u b r o u t i n e names and d e s c r i p t i o n s ! ! name = description ! ! copy file = s u b r o u t i n e which i s c a l l e d by i n d e x g e n . I t i s p a s s e d ( and ! r e t u r n s ) f i l e N a m e , var , nvar , and v a l u . I t i s u s e d t o g e n e r a t e ! a copy o f a marked i n p u t d e c k . I n o r d e r t o s u b s t i t u t e i n c o r r e c t ! v a r i a b l e values , i t c a l l s the subroutine v a r f i n d e r . ! index gen = r e c u r s i v e s u b r o u t i n e c a l l e d by i n p u t m o d . I t i s p a s s e d ( and ! r e t u r n s ) b aseFileName , i n d e x , columns , maxcolumn , nvar , ! nposscombs , v a l , var , comb number , and nameGenType . I t ! r e c u r s i v e l y ge n erat es a l l of the p o s s i b l e combinations of ! v a r i a b l e s and v a l u e s . I t c a l l s t h e s u b r o u t i n e s c o p y f i l e ( which ! c a l l s v a r f i n d e r ) and name gen t o g e n e r a t e a l l o f t h e ! input decks f o r a p a r t i c u l a r ” input generator ” spec f i l e . ! input mod = main program . I t o p e n s ( and s a v e s i n f o r m a t i o n from ) s p e c f i l e . ! I t g e n e r a t e s t h e p o i n t s f o r a u n i f o r m d i s t r i b u t i o n , and i t ! c a l l s the r e c u r s i v e subroutine index gen to generate the ! f i l e s corresponding to the v a r i a b l e / value combinations u n l e s s ! t h e f i r s t l i n e o f t h e s p e c f i l e i s ’ g e n e r a t e ’ i n which c a s e , ! t h e program w i l l c a l l s p e c g e n t o g e n e r a t e a l l o f t h e ’ i n p u t ! generator ’ spec f i l e s . ! name gen = s u b r o u t i n e c a l l e d by i n d e x g e n . I t i s p a s s e d ( and r e t u r n s ) ! o r i g i n a l F i l e , columns , nvar , n e w F i l e , comb number , and ! nameGenType . I t i s u s e d t o g e n e r a t e a n e w F i l e name which ! i n d i c a t e s the p a r t i c u l a r v a r i a b l e value combination of the ! f i l e b e i n g c r e a t e d / c o p i e d i f nameGenType = ’ var ’ , o t h e r w i s e ! nameGenType = ’ comb ’ and t h e g e n e r a t e d name w i l l correspond to ! which c o m b i n a t i o n number t h e f i l e c o r r e s p o n d s t o . ! spec gen = s u b r o u t i n e which i s p a s s e d ( and r e t u r n s ) s p e c f i l e , genRun , ! bas eFileName , nvar , and combSet . I t i s c a l l e d by t h e main program ! i f genRun = ” g e n e r a t e ” . I t w i l l c r e a t e n j o b s s p e c f i l e s which have ! t h e f i r s t l i n e ch anged t o ’ run ’ a s o p p o s e d t o ’ g e n e r a t e ’ , s o t h a t ! when t h e s e new s p e c f i l e s a r e run , t h e y w i l l c a l l i n d e x g e n and ! a r e a b l e t o g e n e r a t e t h e new i n p u t f i l e s . A d d i t i o n a l l y , i t w i l l ! g e n e r a t e n j o b s o f them , e a c h o f which w i l l have a d i f f e r e n t ! combSet v a l u e . ( e . g . i f n j o b s = 9 , t h e n one f i l e w i l l have combSet =1 , ! one f i l e w i l l have combSet =2 , . . . , one f i l e w i l l have combSet = 9 . ) ! var finder = s u b r o u t i n e which i s p a s s e d ( and r e t u r n s ) l i n e , var , n v a r and v a l u . ! I t i s c a l l e d by c o p y f i l e , and u s e s t h e above i n f o r m a t i o n t o f i n d ! t h e VARIABLE MARKERS i n t h e f i l e and s u b s t i t u t e s t h e d e s i r e d v a l u e s ! i n t o t h e l i n e and t h e n p a s s e s t h e e d i t e d l i n e back t o c o p y f i l e . !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! ! INFORMATION FOR THE USER : ! 1 . THE MARKED INPUT FILE AND SPEC FILE (VARIABLE NAMING ) : ! Add a ’ $ ’ t o t h e b e g i n n i n g o f EVERY v a r i a b l e name i n y o u r marked i n p u t f i l e ! ( i . e . t e m p l a t e i n p u t f i l e ) . I n t h e SPEC FILE , p l a c e t h e v a r i a b l e WITHOUT t h e ! ’ $ ’ ( i . e . i n MARKED INPUT ’$VAR1 ’ i n SPEC FILE ’VAR1’ ) a s a ’ $ ’ i s added i n ! i n t h e main program i m m e d i a t e l y f o l l o w i n g t h e r e a d s t a t e m e n t ( s e e s e c 2 . 2 . 1 ) . ! 2 . VARIABLE NAMES: ! I n t h e program , v a r i a b l e names a r e s e t t o be o f s i z e 8 . HOWEVER, due t o t h e ! a d d i t i o n o f ’ $ ’ t o t h e b e g i n n i n g o f t h e v a r i a b l e name ( s e e #1 d i r e c t l y above ) ! and due t o t h e SPACE added t o t h e end o f t h e v a r i a b l e name ( s e e t h e s u b r o u t i n e ! v a r f i n d e r f o r a more d e t a i l e d e x p l a n a t i o n ) v a r i a b l e names MUST be no more ! than 6 CHARACTERS LONG. ! 3 . NUMBER OF VARIABLES OCCURING WITHIN A CARD: ! C u r r e n t l y ONLY 7 i n s t a n c e s o f v a r i a b l e s may a p p e a r i n a g i v e n l i n e ( r e g a r d l e s s 44 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 ! o f which v a r i a b l e s − i t c o u l d be t h e same v a r i a b l e m u l t i p l e t i m e s p l u s a f e w ! o t h e r s , o r a l l one v a r i a b l e , o r a l l d i f f e r e n t v a r i a b l e s a s i n g l e l i n e , i . e . ! c a r d , may o n l y have 7 s u b s t i t u t i o n s ) . For more d e t a i l s , s e e t h e s u b r o u t i n e ! var finder . ! 4 . CASE OF A VARIABLE WITH A SINGLE POINT ( i . e . s t a y s c o n s t a n t ) : ! I n t h e SPEC FILE , s i m p l y w r i t e t h e v a l u e t h e u s e r d e s i r e s t o r e m a i n c o n s t a n t ! f o r t h a t v a r i a b l e i n t h e p l a c e where t h e MIN ( i . e . mn) s h o u l d go . ! 5 . MAX NUMBER OF RUNS : ! C u r r e n t l y ONLY r u n s o f up t o 8 d i g i t s l o n g a r e p e r m i t t e d . To c h a n g e t h i s , and ! f o r a d d i t i o n a l i n f o r m a t i o n s e e NOTE i n r e c u r s i v e s u b r o u t i n e i n d e x g e n . ! 6 . MAXIMUM NUMBER OF VARIABLES SPECIFIED i n SPEC FILE : ! C u r r e n t l y a s p e c f i l e can ONLY c o n t a i n i n f o r m a t i o n f o r 55 v a r i a b l e s . To ! c h a n g e t h i s , t h e u s e r w i l l need t o c h a n g e t h e s i z e o f s e v e r a l a r r a y s : ! prob (XX) , v a r (XX) , columns (XX) , groupNumb (XX) , n p t s (XX) , nptsGroup (XX) , ! n r u n s (XX) , runLayout (XX) , i n c r e m e n t s i z e v a r (XX) , i n t l e n g t h v a r (XX) , ! mn(XX) , mx(XX) , s t d e v (XX) , v a l ( 2 0 ,XX) , a s w e l l a s i n a w r i t e s t a t e m e n t ! [ w r i t e ( 9 , ’ ( XXi4 ) ’ ) ] . A d d i t i o n a l l y , c h a n g e s s h o u l d be made i n t h e ! r e c u r s i v e s u b r o u t i n e i n d e x gen : v a l ( 2 0 ,XX) , and 62 f o r m a t ( a8 , XXes12 . 4 ) ! ALSO s h o u l d more than 99 v a r i a b l e s be i n a g i v e n f i l e , a d d i t i o n a l c h a n g e s w i l l ! need t o be made i n v a r f i n d e r . See the s u b r o u t i n e f o r f u r t h e r d e t a i l s . !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! ! Declarations ! i m p l i c i t none character ∗10 b as eFi l e Name , e x f i l e , genRun , r u n l a y o u t character ∗3 charCombSet character ∗2 f l a g character ∗25 m a r k e d i n p u t f i l e character ∗4 nameGenType character ∗8 prob ( 5 5 ) , v a r ( 5 5 ) character ∗20 s p e c f i l e , v a r v a l c o m b i n t e g e r combSet , comb number , i , i e r r , i s , j , k , maxpts , nposscombs , n g r o u p s , njobs , nvar i n t e g e r columns ( 5 5 ) , groupNumb ( 5 5 ) , n p t s ( 5 5 ) , nptsGroup ( 5 5 ) , n r u n s ( 5 5 ) , ru n Layou t ( 5 5 ) l o g i c a l ex r e a l i n c r e m e n t s i z e v a r ( 5 5 ) , i n t l e n g t h v a r ( 5 5 ) , mn( 5 5 ) , mx ( 5 5 ) , s t d e v ( 5 5 ) , v a l ( 2 0 , 5 5 ) real j o b i n c !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! ! Executable code ! ! 1.0 I n i t i a l i z e comb number = 0 genRun = ’ h e l l o ’ i = 0 j = 0 maxpts = 1 nameGenType = ’ t y p e ’ nposscombs = 1 var val comb = ’ s ’ ! ! 1 . 1 Obtain and b y p a s s t h e name o f t h e e x e c u t a b l e f i l e call getarg ( i , e x f i l e ) is = iargc () ! ! 1 . 2 Read t h e command o p t i o n i = 1 call getarg ( i , flag ) i f ( f l a g ( 1 : 2 ) == ”− i ” ) then i = 2 call getarg ( i , s p e c f i l e ) else write ( ∗ , ∗ ) ” E r r o r : no − i was s p e c i f i e d ” stop ”−1” endif ! ! 2 . 0 Open t h e f i l e s ! ! 2 . 1 Open s p e c f i l e i n q u i r e ( f i l e = s p e c f i l e , e x i s t = ex ) i f ( . n o t . ex ) then write ( ∗ , ∗ ) ” E r r o r : f i l e n o t found , ” , s p e c f i l e go to 100 endif open ( unit = 1 , f i l e = s p e c f i l e , a c t i o n = ” r e a d ” , s t a t u s = ” o l d ” , i o s t a t = i e r r ) ! ! 2 . 1 . 1 Read t h e s p e c f i l e and s a v e t h e r e l e v a n t v a r i a b l e i n f o r m a t i o n . Then rename ! e a c h v a r i a b l e t o i n c l u d e marker ( i . e . ’ $ ’ ) . read ( 1 , ” ( a10 ) ” ) genRun read ( 1 , ” ( a10 , i 3 , i 3 , i 3 , i 3 ) ” ) ba seFil eName , nvar , n j o b s , combSet , n g r o u p s do i = 1 , n v a r read ( 1 , ” ( a8 , 3 e 1 2 . 4 , i 3 , a8 , i 3 ) ” , end = 1 0 ) v a r ( i ) , mn( i ) , mx( i ) , s t d e v ( i ) , n p t s ( i ) ,& prob ( i ) , groupNumb ( i ) v a r ( i ) = ” $ ” // t r i m ( v a r ( i ) ) end do 10 continue rewind 1 45 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 ! ! ! ! ! ! ! ! ! ! ! ! ! 2.1.2 C a l c u l a t e t h e number o f p o s s i b l e c o m b i n a t i o n s , and c r e a t e an a r r a y b a s e d on n j o b s and nposscombs which s p e c i f i e s which r u n s w i l l t a k e p l a c e on e a c h combSet . For example : i f t h e r e a r e 27 p o s s i b l e c o m b i n a t i o n s , and n j o b s = 3 , t h e n nruns ( ) = [ 3 6 9 ] , s o we know c o m b i n a t i o n s 1−3 w i l l t a k e p l a c e i f combSet = 1 , c o m b i n a t i o n s 4−6 w i l l t a k e p l a c e i f combset = 2 , and c o m b i n a t i o n s 7−9 o c c u r when combSet = 3 . S i n c e t h e c e i l i n g f u n c t i o n i s used , any number o f n j o b s may be u s e d w i t h o u t c o n c e r n f o r t h e c a s e where n j o b s d o e s n o t e v e n l y d i v i d e nposscombs . I n that case , we w i l l j u s t have a d i f f e r e n t number , i . e . +/− 1 , o f r u n s g e n e r a t e d i n one o f t h e ’ i n p u t d e c k g e n e r a t o r ’ s p e c f i l e s . ) k = 1 nptsGroup ( 1 ) = n p t s ( 1 ) do i = 1 , n v a r i f ( groupNumb ( i ) /= groupNumb ( k ) ) then k = k + 1 nptsGroup ( k ) = n p t s ( i ) endif end do uncomment t h e l i n e b e l o w t o w r i t e o u t t h e g r o u p number o f w r i t e ( ∗ , ” ( 2 0 i 4 ) ” ) groupNumb each variable nposscombs = 1 do i =1 , n g r o u p s nposscombs = nptsGroup ( i ) ∗ nposscombs end do ! j o b i n c = ( nposscombs ) / ( n j o b s ) ! do i = 1 , n j o b s −1 nruns ( i ) = i ∗ c e i l i n g ( j o b i n c ) end do n r u n s ( n j o b s ) = nposscombs ! ! ! ! ! ! ! ! 2 . 1 . 3 Open t h e f i l e ” r u n l a y o u t ” . I t w i l l be u s e d by t h e python s c r i p t . For t h e f i l e , we ’ l l p r i n t o u t t h e number o f p o s s i b l e c o m b i n a t i o n s ( i . e . t h e t o t a l number o f t e s t s ) . Then we ’ l l c a l c u l a t e e x a c t l y how many r u n s a r e e x p e c t e d f o r e a c h o f t h e n o d e s ( i . e . f o r e a c h combSet ) , and t h e n w r i t e t h a t o n t o t h e s e c o n d l i n e . ( e a c h w i l l be o f s i z e 4 ) . Note : npossCombs w i l l be o f s i z e 1 2 . The f i l e w i l l t h e n be c l o s e d . run layout = ” run layout ” open ( unit = 9 , f i l e = r u n l a y o u t , a c t i o n = ” w r i t e ” , s t a t u s = ” r e p l a c e ” , write ( 9 , ” ( i 1 2 ) ” ) nposscombs ru n L ayou t ( 1 ) = n r u n s ( 1 ) do i = 2 , n j o b s ru n L ayou t ( i ) = n r u n s ( i ) − n r u n s ( i −1) end do write ( 9 , ’ ( 5 5 i 4 ) ’ ) runLayout ( 1 : n j o b s ) c l o s e ( unit = 9 ) ! ! ! ! ! ! ! 2.1.4 iostat = i e r r ) Based on genRun , program w i l l f o l l o w one o f t h r e e o p t i o n s . ( 1 ) I f s p e c f i l e i s a s p e c f i l e w i t h a genRun= ” g e n e r a t i o n ” , s e n d t h e s p e c f i l e t o t h e s u b r o u t i n e s p e c g e n which w i l l g e n e r a t e n j o b s o f s p e c f i l e s . ( f i r s t i f ) ( 2 ) I f s p e c f i l e ’ s genRun i s n o t e q u a l t o ” run ” program w i l l t e r m i n a t e ( 3 ) Otherwise , execute normally , u t i l i z i n g the s u b r o u t i n e i nd ex gen . ( t r i m ( genRun ) == ’ g e n e r a t e ’ ) then c a l l s p e c g e n ( s p e c f i l e , genRun , b a s eFil eName , go to 100 e l s e i f ( t r i m ( genRun ) /= ’ run ’ ) then go to 100 endif if ! ! ! 2 . 2 Use t h e b a s e F i l e n a m e a s t h e ! ! ! ! ! ! ! 2 . 3 Open t h e inquire ( f i l e i f ( . n o t . ex ) write ( ∗ , ∗ ) go to 100 endif open ( unit =2 , 3. 3.1 Calculate ngroups ) ’.i ’ marked input file = m a r k e d i n p u t f i l e , e x i s t = ex ) then ” E r r o r : f i l e n o t found , ” , m a r k e d i n p u t f i l e f i l e = marked input file , Generate input 3.1.1 n j o b s , combSet , marked input file m a r k e d i n p u t f i l e = t r i m ( b a s e F i l e N a m e ) // ! ! nvar , the Calculate action = ” read ” , status = ” o l d ” , files . variable the values interval for each interval l e n g t h and i n c r e m e n t with size do i = 1 , n v a r i n t l e n g t h v a r ( i ) = mx( i ) − mn( i ) i f ( n p t s ( i ) <= 1 ) then increment size var ( i ) = 0.0 else i n c r e m e n t s i z e v a r ( i ) = i n t l e n g t h v a r ( i ) / ( n p t s ( i ) −1) 46 ’ uniform ’ dist iostat = i e r r ) 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 endif end do ! ! ! 3 . 1 . 2 C a l c u l a t e each value within the i n t e r v a l f o r each s p e c i f i c v a r i a b l e . Note : v a l ( rownumber = p o i n t i n i n t e r v a l , column = v a r i a b l e ) . do i = 1 , n v a r do j = 1 , n p t s ( i ) v a l ( j , i ) = mn( i ) + ( j −1)∗( i n c r e m e n t s i z e v a r ( i ) ) end do ! uncomment t h e l i n e b e l o w t o w r i t e o u t a l l t h e v a l u e s f o r e a c h v a r i a b l e ! w r i t e ( ∗ , ∗ ) ” Values f o r v a r i a b l e ” , trim ( var ( i ) ) , ” : ” , val ( 1 : npts ( i ) , i ) end do ! maxpts = 1 maxpts = maxval ( nptsGroup ) ! ! 3 . 2 I n p u t f i l e g e n e r a t i o n t h r o u g h l o o p s and s u b r o u t i n e s . ! ! 3 . 2 . 1 Make columns an a r r a y o f s i z e n g r o u p s w i t h a l l 1 ’ s ( o n e s ) i n s i d e columns ( 1 : n g r o u p s ) = 1 ! ! 3 . 2 . 2 Open v a r v a l c o m b , and make t h e name s p e c i f i c t o t h e combSet by ! w r i t i n g a c h a r a c t e r v e r s i o n o f combSet and t h e n a p p e n d i n g t h a t ! t o t h e trimmed v e r s i o n o f b a s e F i l e N a m e and t h e s t r i n g ” comb ” . write ( charCombSet , ’ ( i 3 ) ’ ) combSet charCombSet = t r i m ( charCombSet ) v a r v a l c o m b = t r i m ( b a s e F i l e N a m e ) // ” comb ” // a d j u s t l ( charCombSet ) open ( unit = 3 , f i l e = v a r v a l c o m b , a c t i o n = ” w r i t e ” , s t a t u s = ” r e p l a c e ” , i o s t a t = i e r r ) ! ! 3 . 3 I n p u t f i l e name g e n e r a t i o n and f i l e c r e a t i o n t h r o u g h s u b r o u t i n e s . ! ! 3 . 3 . 1 G e n e r a t e f i l e names b a s e d upon t h e number o f c o m b i n a t i o n s o f ! v a r i a b l e s and v a l u e s o r b a s e d on t h e p o s s i b l e v a l u e s o f e a c h ! v a r i a b l e . nameGenType h a s two v a l u e s ’ comb ’ and ’ var ’ . ! Ex : ’ e d h t r k 9 9 ’ f o r ’ comb ’ v s ’ e d h t r k 1 1 3 3 ’ f o r ’ var ’ . nameGenType = ’ comb ’ ! ! 3 . 3 . 2 We c a l l t h e s u b r o u t i n e i n d e x g e n . I t , i n t u r n , w i l l c a l l t h e s u b r o u t i n e s ! name gen and c o p y f i l e ( c o p y f i l e w i l l t h e n c a l l t h e s u b r o u t i n e v a r f i n d e r ) . ! index gen w i l l generate a l l of the p o s s i b l e combinations of input v a r i a b l e s ! and w i l l c r e a t e a l l o f t h e i n p u t f i l e s f o r t h e s p e c i f i c ’ i n p u t f i l e g e n e r a t o r ’ ! s p e c f i l e by u s i n g name gen and c o p y f i l e / v a r f i n d e r . ! c a l l i n d e x g e n ( b as eFi l eName , n g r o u p s , columns , nptsGroup , nvar , nposscombs , v a l , var ,& comb number , nameGenType , nruns , combSet , groupNumb ) ! ! 4 . C l o s e t h e s p e c f i l e , m a r k e d i n p u t f i l e , and v a r v a l c o m b f i l e c l o s e ( unit = 1 , s t a t u s = ” k e e p ” ) c l o s e ( unit = 2 , s t a t u s = ” k e e p ” ) c l o s e ( unit = 3 , s t a t u s = ” k e e p ” ) 100 stop contains r e c u r s i v e subroutine i n d e x g e n ( b as eFi l eNam e , c o l i n d e x , columns , maxcolumn , nvar , var , comb number , nameGenType , nruns , combSet , groupNumb ) ! ! AUTHORS: Dr . George L . Mesina and A l e x a n d r a E . Gertman ! CREATED: Mar 0 2 , 2012 ! UPDATED: Apr 1 8 , 2012 ! ! RECURSIVE SUBROUTINE DESCRIPTION : ! R e c u r s i v e l y g e n e r a t e an c o l i n d e x ( columns ) which c o r r e s p o n d s t o t h e ! m a t r i x o f v a r i a b l e v a l u e s . ( i . e . v a l ( columns ( j ) , j ) c o r r e s p o n d s t o ! t h e column ( j ) v a l u e o f v a r i a b l e j . ) Then c a l l t h e s u b r o u t i n e s ! name gen and c o p y f i l e ( c o p y f i l e w i l l a l s o c a l l v a r f i n d e r ) t o ! g e n e r a t e t h e c o r r e s p o n d i n g i n p u t f i l e names and f i l e s . ! ! CAUTION : ! Note t h a t combSet == 1 i s h a n d l e d d i f f e r e n t l y than combSet > 1 ! ! i f c h a n g e s must be made t o t h e l i n e s w r i t t e n t o t h e c o m b f i l e , ! u s e r s h o u l d e n s u r e t h a t c h a n g e s a r e made t o t h e c a s e when ! combSet == 1 AND combnumber > n r u n s ( combSet − 1 ) . ! ! NOTE: ! comb number ( s p e c i f i c a l l y t h e c h a r a c t e r v e r s i o n o f comb number , ! charCombNum ) i s n o t c u r r e n t l y a b l e t o h a n d l e comb number > 8 d i g i t s . ! i f u s e r w i s h e s t o c h a n g e t h i s , c h a n g e s need t o be made t o s e v e r a l ! places : ! (i) index gen ! 1 . s i z e o f c h a r a c t e r charCombNum i n d e c l a r a t i o n s ! o f l o c a l v a r s from ’ ∗ 8 ’ t o ’ ∗X’ ! 2 . i n w r i t e s t a t e m e n t where comb number i s w r i t t e n t o ! t h e charCombNum ’ ( i 8 . 8 ) ’ t o ’ ( iX . X) ’ f o r BOTH e l s e i f ! cases . ! 3 . i n f o r m a t 62 and 87 c h a n g e ’ a8 ’ t o ’ aX ’ ! ( i i ) name gen 47 nposscombs , v a l ,& 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 1. 2. s i z e o f c h a r i i n d e c l a r a t i o n s t o ’ ∗X’ i n t h e w r i t e s t a t e m e n t where comb number i s w r i t t e n t o c h a r i , t h e f o r m a t s h o u l d be ch anged from ’ ( i 8 . 8 ) ’ t o ’ ( iX . X ) ’ . Declarations Arguments i m p l i c i t none character ∗10 b a s e F i l e N a m e character ∗4 nameGenType character ∗80 n e w F i l e character ∗8 v a r ( ∗ ) i n t e g e r columns ( ∗ ) , groupNumb ( n v a r ) , maxcolumn ( ∗ ) , n r u n s ( ∗ ) i n t e g e r combSet , comb number , c o l i n d e x , nvar , nposscombs real val (20 , 55) Local Variables integer i , j real valu ( nvar ) character ∗8 charCombNum Initialize newFile = baseFileName E x e c u t a b l e Code ( c o l i n d e x == 1 ) then do i = 1 , maxcolumn ( 1 ) columns ( 1 ) = i do j = 1 , n g r o u p s where ( groupNumb == j ) v a l u = v a l ( columns ( j ) , : ) end do comb number = comb number + 1 ! i f ( comb number > 6 ) s t o p ! Remove l i n e above t o g e n e r a t e more than 2 i n p u t f i l e s . i f ( comb number > n r u n s ( combSet ) ) then stop e l s e i f ( combSet == 1 ) then c a l l name gen ( b as eFi l eNa me , columns ( 1 : n v a r ) , nvar , n e w F i l e , comb number , nameGenType ) c a l l c o p y f i l e ( n e w F i l e , var , nvar , v a l u ) write ( charCombNum , ’ ( i 8 . 8 ) ’ ) comb number write ( 3 , 6 2 ) charCombNum , v a l u ( 1 : n v a r ) 62 format ( a8 , 55 e s 1 2 . 4 ) ! w r i t e ( 3 , 6 2 1 ) charCombNum , ( columns ( j ) , j =1 , n g r o u p s ) ! uncomment l i n e above ( and b e l o w ) t o w r i t e t h e i n d e x o f e a c h g r o u p f o r e a c h run ! 621 f o r m a t ( a8 , 55 i 3 ) e l s e i f ( comb number > n r u n s ( combSet −1)) then c a l l name gen ( b as eFi l eNa me , columns ( 1 : n v a r ) , nvar , n e w F i l e , comb number , nameGenType ) c a l l c o p y f i l e ( n e w F i l e , var , nvar , v a l u ) write ( charCombNum , ’ ( i 8 . 8 ) ’ ) comb number write ( 3 , 6 2 ) charCombNum , v a l u ( 1 : n v a r ) ! w r i t e ( 3 , 6 2 1 ) charCombNum , ( columns ( j ) , j =1 , n g r o u p s ) ! uncomment l i n e above ( a s w e l l a s t h e f o r m a t l i n e ) t o w r i t e t h e i n d e x o f e a c h g r o u p ! f o r e a c h run endif end do else do i = 1 , maxcolumn ( c o l i n d e x ) c a l l i n d e x g e n ( b as eFi l eNa me , c o l i n d e x −1 , columns , maxcolumn , nvar , nposscombs , v a l ,& var , comb number , nameGenType , nruns , combSet , groupNumb ) columns ( c o l i n d e x ) = col umns ( c o l i n d e x ) + 1 end do i f ( columns ( c o l i n d e x ) > maxcolumn ( c o l i n d e x ) ) then columns ( c o l i n d e x ) = 1 endif endif i f ( comb number > nposscombs ) then stop end i f return ! end subroutine i n d e x g e n !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! subroutine c o p y f i l e ( f i l e N a m e , var , nvar , v a l u ) ! ! CREATED: Mar 6 , 2012 ! UPDATED: Apr 1 1 , 2012 ! ! SUBROUTINE DESCRIPTION : ! Make ( i . e . open and w r i t e t o ) a copy o f t h e marked−up i n p u t f i l e ! w i t h t h e g e n e r a t e d name . Then c a l l v a r f i n d e r t o m o d i f y f i l e N a m e ! s o i t ’ s v a r i a b l e v a l u e s c o r r e s p o n d t o t h e f i l e name . A l s o appends ! t h e f i l e name t o i n c l u d e ’ . i ’ ! ! Declarations if 48 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 ! ! ! ! ! ! ! ! Arguments Arguments i m p l i c i t none character ∗80 f i l e N a m e character ∗8 v a r ( ∗ ) integer nvar real valu (∗) Local Variables character ∗132 l i n e integer i e r r l o g i c a l found E x e c u t a b l e Code open ( unit = 8 , f i l e = f i l e N a m e , a c t i o n = ” r e a d w r i t e ” , p o s i t i o n = ” r e w i n d ” ,& status = ” r e p l a c e ” , i o s t a t = i e r r ) do read ( 2 , ” ( a132 ) ” , end = 9 9 9 ) l i n e f o u n d = i n d e x ( l i n e , ”$VAR” ) > 0 c a l l v a r f i n d e r ( l i n e , var , nvar , v a l u ) write ( 8 , ” ( a ) ” ) t r i m ( l i n e ) ! ! UNCOMMENT t h e t e x t b e l o w t o p r i n t o u t t h e l i n e t h a t was a l t e r e d by ! t h e s u b r o u t i n e v a r f i n d e r and w r i t t e n i n t o t h e NEW i n p u t f i l e . ! ! i f ( found ) then ! w r i t e ( ∗ , ∗ ) ”Copy F i l e : l i n e = ” , l i n e ! end i f ! end do 999 continue c l o s e ( unit = 8 ) rewind 2 return end subroutine c o p y f i l e !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! subroutine name gen ( o r i g i n a l F i l e , columns , nvar , n e w F i l e , comb number , nameGenType ) ! ! CREATED: Mar 7 , 2012 ! UPDATED: Mar 1 9 , 2012 ! ! SUBROUTINE DESCRIPTION : ! C r e a t e s name f o r i n p u t f i l e s b a s e d on b a s e name AND v a r i a b l e s i f ! nameGenType = ’ var ’ , o t h e r w i s e nameGenType = ’ comb ’ and t h e name g e n e r a t e d w i l l ! be b a s e d on t h e b a s e name and c o m b i n a t i o n number t h e v a r / v a l c o r r e s p o n d s t o . ! ! Declarations ! ! Arguments i m p l i c i t none character ∗4 nameGenType character ∗80 n e w F i l e character ∗10 o r i g i n a l F i l e i n t e g e r columns ( 1 : n v a r ) i n t e g e r comb number , n v a r ! ! Local Variables character ∗8 c h a r i integer j ! ! E x e c u t a b l e Code ! newFile = o r i g i n a l F i l e ( nameGenType == ’ comb ’ ) then write ( c h a r i , ’ ( i 8 . 8 ) ’ ) comb number n e w F i l e = t r i m ( n e w F i l e ) // ” ” // t r i m ( a d j u s t l ( c h a r i ) ) else do j = 1 , n v a r write ( c h a r i , ’ ( i 2 ) ’ ) columns ( j ) n e w F i l e = t r i m ( n e w F i l e ) // ” ” // t r i m ( a d j u s t l ( c h a r i ) ) end do endif if n e w F i l e = t r i m ( n e w F i l e ) // ’.i ’ return end subroutine name gen 49 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! subroutine v a r f i n d e r ( l i n e , var , nvar , v a l u ) ! ! CREATED: March 0 7 , 2012 ! UPDATED: A p r i l 1 2 , 2012 ! ! SUBROUTINE DESCRIPTION : ! Find t h e l i n e s i n t h e i n p u t f i l e which c o n t a i n a v a r i a b l e MARKER ! ( i . e . ’$VAR1 ’ ) and t h e n r e p l a c e t h e MARKER w i t h t h e d e s i r e d v a l u e . ! ! NOTE: ! The v a r i a b l e name can have a d o u b l e d i g i t number , s o s p e c i a l c a r e ! must be t a k e n when f o r m i n g t h e new l i n e t o p r e v e n t p a r t o f t h e ! name from a p p e a r i n g i n t h e new l i n e . To h a n d l e t h i s c a s e , an ! a d d i t i o n a l SPACE h a s been added t o t h e END o f t h e v a l u e r e p l a c i n g ! t h e marked v a r i a b l e i n t h e l i n e . THIS c o u l d p o t e n t i a l l y c a u s e e r r o r s ! i n i n p u t p r o c e s s i n g a s i t may c a u s e t h e r e t o be t o o many c h a r a c t e r s ! on a c a r d i n t h e new i n p u t f i l e . ! ! LET THE USER BEWARE: ! C u r r e n t l y , t h i s s u b r o u t i n e i s s e t t o a c c o u n t f o r up t o 7 o c c u r e n c e s ! o f a v a r i a b l e w i t h i n a s i n g l e card ( l i n e ) i n the i npu t deck . ! IF more o c c u r e n c e s e x i s t i n t h e u s e r ’ s m o d i f i e d deck , CHANGE t h e ! o u t e r m o s t do−l o o p from 1 t o 7 TO 1 t o X ( g r e a t e s t number o f ! i n s t a n c e s o f v a r i a b l e s o c c u r i n g on a s i n g l e c a r d ( l i n e ) i n t h e marked ! in put deck . ! ! ADDITIONAL WARNING: ! ALL VARIABLES ($XXXXXX, where XXXXX i s i n p u t by t h e u s e r ) a r e PADDED ! w i t h a SPACE ( i . e . from ’$XXXXX’ t o ’$XXXXX ’ w i t h i n t h i s s u b r o u t i n e ) ! s o a s t o ENSURE t h a t t h e program w i l l n o t r e a d i n v a r i a b l e s s u c h a s ! ’$VAR1 ’ and ’ $VAR11 ’ ( a s s u m i n g t h e u s e r p u t s them i n s e q u e n t i a l l y i n ! t h e s p e c f i l e ) and t h e n r e p l a c e a l l ’ $VAR11 ’ s v a l u e s w i t h ’$VAR1 ’ s ! v a l u e s . The u s e r s h o u l d a l s o be aware t h a t we i n s e r t an e x t r a s p a c e ! in the l i n e immediately f o l l o w i n g the value i n s e r t i o n . I f the user ! s h o u l d have more than 99 v a r i a b l e s , i t i s recommended t h a t an e x t r a ! s p a c e be i n s e r t e d f o r e a c h a d d i t i o n a l d i g i t o f n v a r ( e . g . f o r 2 0 0 0 , ! add two e x t r a s p a c e s , f o r 999 add one e x t r a s p a c e . ) ! ! Declarations ! ! Arguments i m p l i c i t none character ∗132 l i n e character ∗8 v a r ( ∗ ) integer nvar real valu (∗) ! ! Local Variables integer charlen , i , j , l o c character ∗12 c h a r v a l u character ∗1 s p ! ! E x e c u t a b l e Code ! sp = ” ” do j = 1 , 7 do i = 1 , n v a r l o c = i n d e x ( l i n e , t r i m ( v a r ( i ) ) // s p ) i f ( l o c . ne . 0 ) then c h a r l e n = l e n t r i m ( var ( i ) ) write ( c h a r v a l u , ” ( e s 1 2 . 4 ) ” ) v a l u ( i ) ! UNCOMMENT t h e t e x t b e l o w t o c h e c k which v a r i a b l e and v a l u e i s b e i n g ! s u b s t i t u t e d i n t o a p a r t i c u l a r l i n e . NOTE t h a t i t w i l l p r i n t o u t EACH ! occurence of the v a r i a b l e being replaced . ! w r i t e ( ∗ , ∗ ) ” Var F i n d e r : v a r ( i ) = ” , v a r ( i ) , i ! w r i t e ( ∗ , ∗ ) ” Var F i n d e r : l i n e b e f o r e = ” , l i n e ! l i n e = l i n e ( 1 : l o c −1) // c h a r v a l u // s p // l i n e ( c h a r l e n+l o c + 1 : ) ! ! w r i t e ( ∗ , ∗ ) ” Var F i n d e r : l i n e a f t e r = ” , l i n e ! endif end do end do return end subroutine v a r f i n d e r !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! subroutine s p e c g e n ( s p e c f i l e , genRun , b a s eFil eName , ! ! CREATED: Mar 1 5 , 2012 ! UPDATED: Apr 1 8 , 2012 ! 50 nvar , n j o b s , combSet , ngroups ) 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 ! ! ! ! ! ! ! ! ! ! SUBROUTINE DESCRIPTION : C r e a t e n j o b s s p e c f i l e s which have t h e f i r s t l i n e ch an ged t o ’ run ’ a s o p p o s e d t o ’ g e n e r a t e ’ , s o t h a t when t h e s e new s p e c f i l e s a r e run , t h e y w i l l c a l l i n d e x g e n and a c t u a l l y g e n e r a t e t h e new i n p u t f i l e s . Declarations Arguments i m p l i c i t none character ∗10 b as eFi l e Name , genRun character ∗20 s p e c f i l e i n t e g e r combSet , n g r o u p s , n j o b s , n v a r Local Variables character ∗3 charCombSet character ∗20 f i l e N a m e character ∗132 l i n e integer i , i e r r , j ! ! ! E x e c u t a b l e Code do i = 1 , n j o b s combSet = i write ( charCombSet , ’ ( i 3 ) ’ ) combSet f i l e N a m e = t r i m ( s p e c f i l e ) // ’ ’ // a d j u s t l ( charCombSet ) fileName = trim ( fileName ) open ( unit = 8 , f i l e = f i l e N a m e , a c t i o n = ” r e a d w r i t e ” , p o s i t i o n = ” r e w i n d ” ,& status = ” r e p l a c e ” , i o s t a t = i e r r ) ! ! r e a d i n t h e f i r s t two l i n e s o f s p e c f i l e . At t h i s p o i n t , we won ’ t be ! d o i n g a n y t h i n g w i t h them , but a f t e r we r e a d them i n , we ’ l l be a l l s e t ! t o r e a d i n t h e r e s t o f t h e l i n e s ( and p r i n t them o u t ) i n a l o o p . ! read ( 1 , ” ( a132 ) ” , end = 9 9 9 ) l i n e read ( 1 , ” ( a132 ) ” , end = 9 9 9 ) l i n e ! ! w r i t e t h e f i r s t two l i n e s o f t h e new s p e c f i l e − r e p l a c i n g ” g e n e r a t e ” w i t h ! ” run ” and c h a n g i n g t h e combSet number a p p r o p r i a t e l y . ! write ( 8 , ” ( a3 ) ” ) ” run ” write ( 8 , 2 3 ) base FileN ame , nvar , n j o b s , combSet , n g r o u p s 23 format ( a10 , i 3 , i 3 , i 3 , i 3 , i 3 ) 999 continue ! ! now we r e a d i n t h e r e s t o f t h e l i n e s from f i l e 1 and w r i t e w i t h no ! m o d i f i c a t i o n s o n t o t h e s p e c f i l e we ’ r e g e n e r a t i n g . ! do j = 1 , n v a r read ( 1 , ” ( a132 ) ” , end = 9 9 ) l i n e write ( 8 , ” ( a ) ” ) t r i m ( l i n e ) end do 99 continue rewind 8 c l o s e ( unit = 8 ) rewind 1 end do return end subroutine s p e c g e n !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ! end program i n p u t m o d B Template Spec File 1 typeOfSpecFile 2 baseFileName #v a r s #nodesInStudy c u r r en t N o d e #g r o u p s 3 varX 4 . . 5 . . min max stdDev 51 #p t s d i s t r i b u t i o n group# 6 . . 7 . . 8 varY C min max stdDev #p t s d i s t r i b u t i o n group# Example of a Generator Spec File 1 generate 2 apsbs 3 VAR1 0.9 1.1 0.1 3 u n i fo r m 1 4 VAR2 0.000135 0.000165 0.000015 3 u n i fo rm 2 5 VAR3 10.63287 12.99573 1.18143 3 u n i fo rm 3 6 VAR4 0.036252 0.044308 0.004028 3 u n i fo rm 4 7 VAR5 0.14688 0.17952 0.01632 3 u n i fo r m 5 8 VAR6 0.078534 0.095986 0.008726 3 u n i fo rm 6 9 VAR7 0.000135 0.000165 0.000015 3 u n i fo rm 7 10 VAR8 .504811 0.616991 0.05609 3 u n i fo rm 8 D 8 9 6 8 Example of a NodeSpec File 1 run 2 apsbs 3 VAR1 0.9 1.1 0.0471404520 3 uniform 1 4 VAR2 0.00135 0.00165 0.0000707106 3 u n i f o rm 2 5 VAR3 8.95959 10.95061 0.4692879144 3 u n i f o rm 3 6 VAR4 0.043749 0.053471 0.0022914973 3 uniform 4 7 VAR5 0.193752 0.236808 0.0101483965 3 uniform 5 8 VAR6 0.04419 0.05401 0.0023145962 3 u n i f o rm 6 9 VAR7 0.000135 0.000165 0.0000070710 3 uniform 7 10 VAR8 .19493874 0.23825846 0.0102105559 3 u n i fo r m 8 8 9 9 8 52 E 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 Python Script for Running Studies on INL’s Supercomputer, Quark #! / apps / l o c a l / python / a c t i v e s t a t e / 2 . 7 . 1 . 4 / b i n / python # # P u r p o s e : Run many i n p u t d e c k s from many d i r e c t o r i e s w i t h RELAP5−3D # Note : Pure Python s c r i p t , no u s e o f Linux s c r i p t s o r commands . # To a d j u s t t h i s r u n f i l e f o r y o u r p a r t i c u l a r t e s t , go t o # main program , s e c t i o n 1 . 0 and a d j u s t t h e f i l e names ( and # k e y O u t p u t S t r i n g ) a c c o r d i n g l y . The u s e r i s a l s o e n c o u r a g e d # to adjust the walltime request to b e t t e r f i t the user ’ s # study . # A u t h o r s : Dr . George L Mesina , A l e x a n d r a E . Gertman # J . Shelley # C r e a t e d : Mar 1 6 , 2012 # Updated : May 0 2 , 2012 # # Pro Batch S c h e d u l e r (PBS) commands #PBS −N r e l a p 5 #PBS − l s e l e c t =1: n c p u s =12: m p i p r o c s =12:mem=23gb #PBS − l p l a c e=e x c l #PBS − l w a l l t i m e = 1 0 : 0 0 : 0 0 #PBS −V #PBS −j o e #PBS −q g e n e r a l # ############################## # # 1 . 0 Imports import g l o b , o s from t e m p f i l e import mkdtemp import s h u t i l , s u b p r o c e s s , s y s from s t r i n g import j o i n import t i m e try : import forkmap a s fm FORKMAPavail = ” y e s ” except E x c e p t i o n , e : FORKMAPavail = ” no ” ############################## ############################## def C r e a t e D i r s ( curPath , outPath , f i l e P r e , tmpPath ) : # Make t h e d i r e c t o r i e s where e a c h node ’ s ( o r combSet ’ s ) # c a s e s w i l l be run # t m p d i r = mkdtemp ( p r e f i x=f i l e P r e , d i r=tmpPath ) return t m p d i r ############################## ############################## def G e t I n p u t F i l e s ( i n p u t P r e ) : # # Grab a l l o f f i l e s ( e a c h o f which i s named i n p u t P r e ) from o u r c u r r e n t path . # Then r e t u r n a l l o f t h o s e f i l e s . # Note : i n p u t P r e = s p e c F i l e P r e + ’ ∗ ’ f o r s p e c F i l e s AND # i n p u t P r e = i n p u t F i l e P r e %”∗” for inputFiles # inputs = glob . glob ( inputPre ) return i n p u t s ############################## ############################## def PrepRunGetClean ( i n d e x , c u r r e n t P a t h , r e l a p e x e , tmpPath ) : # # Runs e a c h i n p u t f i l e p a s s e d t o i t ( u s i n g r e l a p e x e c u t a b l e rund ) . # C u r r e n t l y , o n l y 12 i n p u t f i l e s a r e run a t a t i m e ( s i n c e we ’ r e r u n n i n g # o u r t e s t s on q u a r k . ) I f a d i f f e r e n t number s h o u l d be run t h r o u g h e a c h # time , a p p r o p r i a t e c h a n g e s s h o u l d be made i n t h e p a r a l l e l s e c t i o n , a s # a s i n t h e b e g i n n i n g l i n e s o f t h i s program ( t h e PBS − l select line ). # cmd = ”%s %s ”%( r e l a p e x e , i n d e x ) o u t p u t = s u b p r o c e s s . Popen ( cmd , s h e l l =True , s t d o u t=s u b p r o c e s s . PIPE ) . communicate ( ) [ 0 ] p r i n t >> s y s . s t d e r r , ’ cmd : ’ , cmd return ############################## ############################## if name == ’ m a i n ’: # DESCRIPTION : C r e a t e w o r k i n g d i r e c t o r y i n temporary−s p a c e w i t h s u b d i r s # one p e r c l u s t e r node . Run i n p u t m o d g e n . f 9 0 t o c r e a t e 1 # s p e c − f i l e f o r e a c h s u b d i r e c t o r y by d i v i d i n g t h e t o t a l no . # o f c o m b i n a t i o n s e q u a l l y among t h e c l u s t e r −n o d e s . Copy t h e 53 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # l i c e n s e and t e m p l a t e i n p u t f i l e s , RELAP5−3D, and t p f h 2 o t o e a c h s u b d i r e c t o r y . Use i n p u t m o d g e n . f 9 0 t o g e n e r a t e a l l i n p u t f i l e s f o r t h e node from t e m p l a t e i n p u t f i l e . Find and s t o r e key o u t p u t p a r a m e t e r v a l u e from e a c h RELAP5−3D o u t p u t f i l e a l o n g w i t h t h e s e q u e n c e number o f the f i l e . When a l l r u n s a r e f i n i s h e d , SAS w i l l be u s e d t o analyze the s t a t i s t i c s . COGNIZANT : A l e x a n d r a E . Gertman , Dr George Mesina , Jon S h e l l e y CREATED: Mar 1 6 , 2012 UPDATED: Mar 2 7 , 2012 PROGRAM OUTLINE : 1.0 I n i t i a l i z e and s e t −up d i r e c t o r i e s 1.1 Construct & Populate s u b d i r e c t o r i e s C o n s t r u c t s u b d i r e c t o r y s t r u c t u r e e x p l a i n e d above 1 . 1 . 1 Change t h e c u r r e n t w o r k i n g d i r e c t o r y t o c u r r e n t P a t h 1 . 1 . 2 C o l l e c t a l l o f t h e s p e c f i l e s we ’ l l u s e i n t h i s s t u d y . 1 . 1 . 3 I f t h e d i r e c t o r y ( tmpPath ) d o e s n o t y e t e x i s t , c r e a t e i t . Then c r e a t e t h e d i r e c t o r y which w i l l h o l d a l l o f t h e r u n s f o r e a c h combSet ( i . e . f o r e a c h node ) . 1 . 2 Obtain l i s t o f computer n o d e s 1 . 3 Input f i l e g e n e r a t i o n 1 . 3 . 1 Switch the c u r r e n t working d i r e c t o r y to tmp run dir ( i . e . the temporary d i r e c t o r y ) 1 . 3 . 2 In each temporary d i r e c t o r y , c r e a t e a l i n k to the needed f i l e s : t h e RELAP5−3D e x e c u t a b l e ( rund ) , r e l a p 5 . x , i t s l i c e n s e and p r o p e r t y f i l e s , and t h e a p p r o p r i a t e s p e c f i l e . 1 . 3 . 4 C o l l e c t a l l of the input f i l e s . 2 . 0 Output f i l e g e n e r a t i o n t h r o u g h p a r a l l e l i z a t i o n 2 . 1 Run P a r a l l e l : A l l o f t h e i n p u t f i l e s t h a t were g e n e r a t e d w i l l be run w i t h t h e r e l a p e x e c u t a b l e . 2 . 1 . 1 Grab 12 o f t h e i n p u t f i l e s a t a time , p a s s i n g them t o t h e f u n c t i o n PrepRunGetClean where t h e o u t p u t f o r t h o s e 12 i n p u t f i l e s w i l l be c r e a t e d . 3.0 Results 3 . 1 C o l l e c t t h e newly g e n e r a t e d o u t p u t f i l e s 3 . 1 . 1 C r e a t e a r e s u l t s d i c t i o n a r y where we ’ l l s t o r e t h e run number and t h e c o r r e s p o n d i n g d e s i r e d output parameter . 3 . 1 . 2 Loop t h r o u g h o u t p u t f i l e s t o f i n d t h e key o u t p u t p a r a m e t e r , and t h e n put t h a t v a l u e i n t o t h e r e s u l t s d i c t i o n a r y a l o n g w i t h t h e c o r r e s p o n d i n g run number 3 . 2 Find t h e f i l e w i t h t h e v a r i a b l e i n f o r m a t i o n f o r e a c h run , copy t h a t i n f o r m a t i o n and put i n t o a new f i l e , a p p e n d i n g t h e run i n f o r m a t i o n w i t h t h e d e s i r e d o u t p u t from t h e r e s u l t s d i c t i o n a r y . Then s a v e t h e r e s u l t s f i l e to the current d i r e c t o r y . 3 . 2 . 1 Open and r e a d t h e comb f i l e f o r t h i s p a r t i c u l a r combSet / node 3 . 2 . 2 Create the l i s t o u t l i n e . 3 . 2 . 2 . 1 Loop t h r o u g h e a c h l i n e o f combLine 3 . 2 . 2 . 1 . 1 S p l i t each l i n e i n each o f the combFiles 3 . 2 . 2 . 1 . 2 Append e a c h l i n e w i t h i t ’ s c o r r e s p o n d i n g r e s u l t 3 . 2 . 2 . 1 . 3 Place modified c l i n e i n t o the l i s t o u t l i n e 3 . 2 . 3 Save a l l o f o u t l i n e t o r e s t e x t . 3 . 2 . 4 Open c o m b F i l e . r e s , w r i t e a l l o f r e s t e x t t o i t , t h e n c l o s e t h e f i l e . 3 . 2 . 5 Copy t h e f i l e t o t h e f o l d e r ’ r e s u l t s ’ i n t h e home d i r e c t o r y 4 . 0 Remove t e m p o r a r y d i r e c t o r y and e x i t program DATA DICTIONARY : array idx = a r r a y o f c l u s t e r n o d e s . S h o u l d c o r r e s p o n d t o t h e number o f j o b s s p e c i f i e d i n s p e c f i l e . ( 3 r d word on l i n e 2 o f t h e spec f i l e . ) cline = v a r i a b l e d e n o t i n g e a c h s p e c i f i c l i n e i n combLine . I t i s s t r i p p e d and s p l i t , appended , and t h e n put back t o g e t h e r . cmd = v a r i a b l e which d e n o t e s a r g u m e n t s we ’ l l be p a s s i n g t o t h e command l i n e . combFile = name o f t h e comb f i l e f o r t h e p a r t i c u l a r combSet / node . I t i s combFilePre with a r r y i d x . combFilePre = b a s e name f o r e a c h comb f i l e . For ex : ’ a p s b s 2 c o m b ’ . No a d d i t i o n a l s t r i n g w/ i n a s t r i n g is specified . combLine = where e a c h l i n e o f t h e c o m b F i l e i s s t o r e d ( e a c h l i n e i s a string .) combn = t h e run number o f c l i n e currentPath = PBS w o r k i n g d i r e c t o r y . data = where t h e i n f o r m a t i o n f o r an o u t p u t f i l e i s s t o r e d . inputFilePre = b a s e name u s e d i n a l l o f t h e i n p u t f i l e s . For example : ’ a p s b s %s . i ’ , where t h e %s i n d i c a t e s t h a t we w i l l s p e c i f y a what s t r i n g w i l l g e t p l a c e d i n between t h e u n d e r s c o r e and t h e ” . i ” index = v a r i a b l e u s e d t o d e n o t e 12 d i f f e r e n t s t r i n g s ( e a c h o f which c o r r e s p o n d s to a s p e c i f i c input f i l e . ) I t i s used i n the p a r a l l e l s e c t i o n , and p a s s e d t o PrepRunGetClean s o t h a t e a c h o f t h e 12 i n p u t f i l e s w i l l be run w i t h rund . inputFiles = a l l o f t h e g e n e r a t e d i n p u t f i l e s ( i . e . s p e c f i l e s which c o n t a i n 54 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 # ’ run ’ a s t h e i r f i r s t word on l i n e 1 ) we ’ l l be u s i n g i n t h i s # s t u d y . To g e t a l l o f t h e s e f i l e s , we c a l l t h e f u n c t i o n # G e t I n p u t F i l e s , and p a s s i t t h e s t r i n g s p e c F i l e P r e + ’ ∗ ’ . # fixd = l i n e i n d a t a which c o n t a i n s k e y O u t p u t S t r i n g # keyOutputParam = t h e number i n f i x d which c o r r e s p o n d s t o t h e key o u t p u t p a r a m e t e r # we a r e g r a b b i n g from t h e o u t p u t f i l e s . # k e y O u t p u t S t r i n g = s t r i n g which o c c u r s r i g h t b e f o r e t h e key o u t p u t p a r a m e t e r # value in the ’ . p ’ r e l a p f i l e . # m a r k e d I n p u t F i l e = name o f t h e marked i n p u t f i l e i n p u t m o d g e n . f 9 0 u s e s a s a # template f o r generating a l l of the input f i l e s . # output = t h e r e s u l t s g e n e r a t e d from r u n n i n g e a c h o f t h e i n p u t f i l e s w i t h # t h e r e l a p e x e c u t a b l e ( rund ) . # ouputFilePre = b a s e name u s e d i n a l l o f t h e o u t p u t f i l e s . I t f u n c t i o n s i n # t h e same way a s t h e i n p u t F i l e P r e , e x c e p t i t ’ s a ’ . p ’ f i l e . # outFile = e a c h i n d i v i d u a l o u t p u t f i l e ( from o u t p u t F i l e s ) # outputFiles = t h e g e n e r a t e d o u t p u t f i l e s a r e a l l s t o r e d h e r e . They a r e # outputFilePre % ’∗ ’. # outline = l i s t which s t o r e s e a c h l i n e o f combLine ( and appends e a c h o f # t h e l i n e s w i t h t h e c o r r e s p o n d i n g r e s u l t from r e s d i c t . ) # outputPath = l o c a t i o n o f output f i l e s # relap exe = name o f t h e r e l a p e x e c u t a b l e ( i . e . how we ’ l l run r e l a p f o r # each p a r t i c u l a r input f i l e . ) # res dict = r e s u l t s d i c t i o n a r y . Items in the r e s u l t s d i c t i o n a r y are s t o r e d # a s run number and t h e n c o r r e s p o n d i n g key o u t p u t p a r a m e t e r # g e n e r a t e d f o r t h a t p a r t i c u l a r run . # For ex : [ ’ 0 0 0 0 0 0 4 4 ’ : ’ 6 9 . 5 5 1 9 ’ , ’ 0 0 0 0 0 0 4 5 ’ : ’ 6 9 . 5 5 1 9 ’ , . . . ] # resFile = where t h e r e s u l t s f i l e i s opened , w r i t t e n t o ( r e s t e x t i s # w r i t t e n i n t o t h e f i l e ) , and c l o s e d . # resultsFile = name o f t h e r e s u l t s f i l e ( c o m b F i l e + ’ . r e s ’ ) # res text = f i l e where t h e l i s t o u t l i n e i s w r i t t e n t o . # runtime = a c a l l ( in p a r a l l e l s e c t i o n ) to the f u n c t i o n c o n t r o l l e r , # p a s s i n g i n a l l o f t h e i n p u t f i l e s ( 1 2 o f them a t a t i m e ) . # specFilePre = b a s e name o f t h e s p e c f i l e (NOTE: t h i s i s n o t t h e s p e c f i l e # g e n e r a t o r − r a t h e r i t i s t h e g e n e r a t e d c o p i e s which c o n t a i n # ’ run ’ a s t h e f i r s t word on l i n e 1 o f t h e s p e c f i l e . ) # Unlike the input / output pre i t doesn ’ t i n c l u d e a s t r i n g # within a s t r i n g . # specFiles = a l l o f t h e g e n e r a t e d s p e c f i l e s ( i . e . s p e c f i l e s which c o n t a i n # ’ run ’ a s t h e i r f i r s t word on l i n e 1 ) we ’ l l be u s i n g i n t h i s # s t u d y . To g e t a l l o f t h e s e f i l e s , we c a l l t h e f u n c t i o n # G e t I n p u t F i l e s , and p a s s i t t h e s t r i n g s p e c F i l e P r e + ’ ∗ ’ . # start2 = f l o a t i n g p o i n t r e p r e s e n t a t i o n o f t i m e ( u s e d t o d e n o t e when # e a c h s e t o f 12 i n p u t f i l e s i s run w i t h RELAP . ) I t i s u s e d i n # the p a r a l l e l section , in the f u n c t i o n c o n t r o l l e r . # tmpPath = l o c a t i o n on t e m p o r a r y d i s k f o r t h e RELAP5−3D c o d e and i n p u t # tmp run dir = t e m p o r a r y d i r e c t o r y where e a c h node ’ s ( o r combSet ’ s ) p a r t i c u l a r # c a s e w i l l be run . I t c a l l s t h e f u n c t i o n C r e a t e D i r s ( ) t o c r e a t e # e a c h p a r t i c u l a r d i r e c t o r y by p a s s i n g c u r r e n t P a t h , outputPath , # a s w e l l a s t h e s p e c F i l e P r e+s t r ( a r r y i d x )+ ’ − ’ , and tmpPath ) # ############################### # # 1.0 I n i t i a l i z e and s e t −up d i r e c t o r i e s a r r y i d x = i n t ( o s . e n v i r o n [ ’PBS ARRAY INDEX ’ ] ) c u r r e n t P a t h = o s . e n v i r o n [ ’PBS O WORKDIR ’ ] tmpPath = ” /tmp” + o s . s e p + ” r 5 s t a t s ” + o s . s e p o u t p u t P a t h = c u r r e n t P a t h + o s . s e p + ” Output ” + o s . s e p i n p u t F i l e P r e = ” l o f t T S %s . i ” o u t p u t F i l e P r e = ” l o f t T S %s . p” keyOutputString = ” pct stdfnctn ” specFilePre = ” loftTS gen ” markedInputFile = ” loftTS . i ” r e l a p e x e = ” /home/ g e r t a e / hpc−r u n s / rund ” combFilePre = ” loftTS comb ” # p r i n t >> s y s . s t d e r r , ’ a r r y i d x : ’ , a r r y i d x p r i n t >> s y s . s t d e r r , ’ c u r r e n t P a t h : ’ , c u r r e n t P a t h p r i n t >> s y s . s t d e r r , ’ tmpPath : ’ , tmpPath p r i n t >> s y s . s t d e r r , ’ o u t p u t P a t h : ’ , o u t p u t P a t h # # # 1.1 Construct & Populate s u b d i r e c t o r i e s # C o n s t r u c t s u b d i r e c t o r y s t r u c t u r e e x p l a i n e d above # # 1 . 1 . 1 Change t h e c u r r e n t w o r k i n g d i r e c t o r y t o c u r r e n t P a t h os . chdir ( currentPath ) p r i n t ”CWD: ” , o s . getcwd ( ) p r i n t ” l s : ” , o s . l i s t d i r ( o s . getcwd ( ) ) # # 1 . 1 . 2 C o l l e c t a l l o f t h e s p e c f i l e s we ’ l l u s e i n t h i s s t u d y . s p e c F i l e s = G e t I n p u t F i l e s ( s p e c F i l e P r e+ ’ ∗ ’ ) p r i n t ” Spec F i l e s : ” , s p e c F i l e s # # 1 . 1 . 3 I f t h e d i r e c t o r y ( tmpPath ) d o e s n o t y e t e x i s t , c r e a t e i t . # Then c r e a t e t h e d i r e c t o r y which w i l l h o l d a l l o f t h e r u n s # f o r e a c h combSet ( i . e . f o r e a c h node ) . i f o s . path . i s d i r ( tmpPath ) == F a l s e : 55 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 o s . mkdir ( tmpPath ) tmp run dir = CreateDirs ( currentPath , # # # # # # # # # # # # # # # # # # # # # # # # # # outputPath , s p e c F i l e P r e+s t r ( a r r y i d x )+ ’− ’ , tmpPath ) 1 . 2 Obtain l i s t o f computer n o d e s Each node h a s a number o f c o r e s n o d e s = open ( o s . e n v i r o n [ ’ PBS NODEFILE ’ ] , ’ r ’ ) . r e a d l i n e s ( ) numNodes = l e n ( n o d e s ) p r i n t ”Number o f t h r e a d s : ” , numNodes 1.3 Input file generation 1 . 3 . 1 Switch the c u r r e n t working d i r e c t o r y to tmp run dir ( i . e . the temporary d i r e c t o r y ) os . chdir ( tmp run dir ) 1 . 3 . 2 In each temporary d i r e c t o r y , c r e a t e a l i n k to the needed f i l e s : t h e RELAP5−3D e x e c u t a b l e ( rund ) , r e l a p 5 . x , i t s l i c e n s e and p r o p e r t y f i l e s , and t h e a p p r o p r i a t e s p e c f i l e . f o r l n f i l e i n [ ’ rund ’ , ’ r e l a p 5 . x ’ , ’ t p f h 2 o ’ , ’ r e l l i c . b i n ’ , s p e c F i l e P r e+ ’%d ’%a r r y i d x , markedInputFile ] : cmd = ’ l n −s %s/%s ’ %( c u r r e n t P a t h , l n f i l e ) p r i n t ”cmd : %s ”%cmd o u t p u t = s u b p r o c e s s . Popen ( cmd , s h e l l =True , s t d o u t=s u b p r o c e s s . PIPE ) . communicate ( ) [ 0 ] 1 . 3 . 3 I n e a c h t e m p o r a r y d i r e c t o r y , c r e a t e t h e command t o run t h e e x e c u t a b l e from i n p u t m o d g e n . f 9 0 ( a . o u t ) , p a s s i n g i t ’− i ’ ( n e c e s s a r y f o r e x e c u t a b l e t o work ) , and s p e c F i l e P r e a r r y i d x . cmd = c u r r e n t P a t h+o s . s e p+ ’ a . o u t − i %s%d ’ %( s p e c F i l e P r e , a r r y i d x ) p r i n t ”cmd : %s ”%cmd o u t p u t = s u b p r o c e s s . Popen ( cmd , s t d o u t=s u b p r o c e s s . PIPE , s h e l l =True ) . communicate ( ) [ 0 ] 1 . 3 . 4 C o l l e c t a l l of the input f i l e s . i n p u t F i l e s=G e t I n p u t F i l e s ( i n p u t F i l e P r e%” ∗ ” ) #i n p u t F i l e s = i n p u t F i l e s [ : 1 2 ] #Uncomment f o r s m a l l e r t e s t print i n p u t F i l e s 2.0 Output file generation through parallelization 2.1 Run P a r a l l e l : T h i s i s where a l l o f t h e i n p u t f i l e s t h a t were g e n e r a t e d w i l l be run w i t h t h e r e l a p e x e c u t a b l e rund . ############################### ## P a r a l l e l s e c t i o n ############################### 2 . 1 . 1 Grab 12 o f t h e i n p u t f i l e s a t a time , p a s s i n g them t o t h e f u n c t i o n PrepRunGetClean where t h e o u t p u t f o r t h o s e 12 i n p u t f i l e s w i l l be c r e a t e d . @fm . p a r a l l e l i z a b l e ( 1 2 ) def c o n t r o l l e r ( i n d e x ) : p r i n t >> s y s . s t d e r r , ’ i n d e x= ’ , i n d e x s t a r t 2 = time . time ( ) PrepRunGetClean ( i n d e x , currentPath , return t i m e . t i m e ( ) − s t a r t 2 r u n t i m e = fm . map ( c o n t r o l l e r , [ x f o r x i n ############################### ## End P a r a l l e l s e c t i o n ############################### # relap exe , tmp run dir ) inputFiles ]) # # 3.0 Results # # 3 . 1 C o l l e c t t h e newly g e n e r a t e d o u t p u t f i l e s o u t p u t F i l e s = g l o b . g l o b ( o u t p u t F i l e P r e% ’ ∗ ’ ) p r i n t ” Output F i l e s : ” , o u t p u t F i l e s # 3 . 1 . 1 C r e a t e a r e s u l t s d i c t i o n a r y where we ’ l l s t o r e # t h e run number and t h e c o r r e s p o n d i n g d e s i r e d # output parameter . res dict = dict () # # 3 . 1 . 2 Loop t h r o u g h o u t p u t f i l e s t o f i n d t h e key o u t p u t # p a r a m e t e r , and t h e n put t h a t v a l u e i n t o t h e r e s u l t s # d i c t i o n a r y a l o n g w i t h t h e c o r r e s p o n d i n g run number for o u t F i l e in o u t p u t F i l e s : d a t a=open ( o u t F i l e ) . r e a d ( ) f i d x = data . r f i n d ( keyOutputString ) keyOutputParam = ( d a t a [ f i d x : f i d x + 8 0 ] ) . s p l i t ( ) [ 2 ] #p r i n t ”%s Coremin : %s ”%( o u t F i l e , p c t ) r e s d i c t [ o u t F i l e . s p l i t ( ’ ’ ) [ 1 ] . s p l i t ( ’ . ’ ) [ 0 ] ] = keyOutputParam p r i n t ” R e s u l t s D i c t i o n a r y : \ n” , r e s d i c t # # 3 . 2 Find t h e f i l e w i t h t h e v a r i a b l e i n f o r m a t i o n f o r e a c h # run , copy t h a t i n f o r m a t i o n and put i n t o a new f i l e , # a p p e n d i n g t h e run i n f o r m a t i o n w i t h t h e d e s i r e d o u t p u t # from t h e r e s u l t s d i c t i o n a r y . Then s a v e t h e r e s u l t s f i l e # to the current d i r e c t o r y . # 56 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 # # # 3 . 2 . 1 Open and r e a d t h e comb f i l e f o r p r i n t ” Have n o t y e t f o u n d Comb F i l e ” c o m b F i l e=c o m b F i l e P r e+s t r ( a r r y i d x ) p r i n t ” Found Comb F i l e ” combLine=open ( c o m b F i l e ) . r e a d l i n e s ( ) 3 . 2 . 2 Create the outline = l i s t () # # for # # # # # # # # # # # # # # # # cline list p a r t i c u l a r combSet / node outline . 3 . 2 . 2 . 1 Loop t h r o u g h e a c h i n combLine : 3.2.2.1.1 cline = cline . strip () cline = cline . s p l i t () this Split each 3 . 2 . 2 . 1 . 2 Append e a c h try : combn = c l i n e [ 0 ] c l i n e . append ( r e s d i c t [ combn ] ) except : c l i n e . append ( ’ n o R e s u l t s ’ ) line o f combLine line i n each line with of the combFiles it ’s corresponding result 3.2.2.1.3 P l a c e m o d i f i e d c l i n e [ j o i n e d w/commas and w/ a ’ \ n ’ a t t h e end o f t h e l i n e t o i n d i c a t e a new l i n e f o r each r e s u l t ] i n t o the l i s t o u t l i n e o u t l i n e . append ( ” , ” . j o i n ( c l i n e ) + ” \n” ) 3 . 2 . 3 Save a l l o f o u t l i n e t o res text = join ( outline , ’ ’ ) res text . 3 . 2 . 4 Open c o m b F i l e . r e s , w r i t e a l l o f r e s u l t s F i l e =c o m b F i l e+ ’ . r e s ’ print ” R e s u l t s F i l e ( s ) : ” , r e s u l t s F i l e r e s F i l e = open ( r e s u l t s F i l e , ’w ’ ) resFile . write ( res text ) resFile . close () res text 3 . 2 . 5 Copy t h e f i l e t o t h e f o l d e r ’ r e s u l t s ’ s h u t i l . copy ( r e s u l t s F i l e , c u r r e n t P a t h ) in to it , then close the file . t h e home d i r e c t o r y 4.0 Remove t e m p o r a r y d i r e c t o r y and e x i t program try : p r i n t ”Remember t o c l e a n up a f t e r t h e run ” s h u t i l . r m t r e e ( tmpPath ) except E x c e p t i o n , e : p r i n t >> s y s . s t d e r r , e p r i n t >> s y s . s t d e r r , ” E r r o r o c c u r r e d w h i l e r e m o v i n g t e m p o r a r y d i r e c t o r i e s ” # p r i n t >> s y s . s t d e r r , ’ Node %i r u n t i m e s ( s e c ) : \ n Max %f , \ n Min %f , \ n Avg %f , \ n Tot %f ( a r r y i d x , max ( r u n t i m e ) , min ( r u n t i m e ) , sum ( r u n t i m e ) / l e n ( r u n t i m e ) , sum ( r u n t i m e ) ) p r i n t >> s y s . s t d e r r , ” For ” , l e n ( r u n t i m e ) , ” r u n s ” RunTime = t i m e . t i m e ( ) − R u n s t a r t 2 p r i n t >> s y s . s t d e r r , ” T o t a l run t i m e =” , RunTime 57 ’%\ F F.1 SAS Reports AP600 2 inch Break, Top 4 Variables 7KXUVGD\ $SULO    30  &RUUHODWLRQ $QDO\VLV 7KH &255 3URFHGXUH :LWK9DULDEOHV FRUHPLQ 9DULDEOHV 9$59$59$59$5 66&30DWUL[ 9$5 9$5 9$5 9$5 FRUHPLQ     &66&30DWUL[ 9$5 9$5 9$5 9$5 FRUHPLQ     &RYDULDQFH0DWUL[')  9$5 9$5 9$5 9$5 FRUHPLQ     9DULDEOH FRUHPLQ 9$5 9$5 9$5 9$5 FRUHPLQ FRUHPLQ FRUHPLQ FRUHPLQ 6LPSOH6WDWLVWLFV 1 0HDQ 6WG'HY 0HGLDQ 0LQLPXP 0D[LPXP                             (  3HDUVRQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5       6SHDUPDQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5       .HQGDOO7DXE&RUUHODWLRQ&RHIILFLHQWV1  3URE!_WDX_XQGHU+7DX  9$5 9$5 9$5       +RHIIGLQJ'HSHQGHQFH&RHIILFLHQWV1  3URE!'XQGHU+'  9$5 9$5 9$5       9$5   9$5   9$5   9$5   *HQHUDWHG E\ WKH 6$6 6\VWHP 6$6$SS  ;B(659 RQ $SULO   DW  30 58 F.2 AP600: 4 inch Break, Top 5 Variables 7KXUVGD\ $SULO    30  &RUUHODWLRQ $QDO\VLV 7KH &255 3URFHGXUH :LWK9DULDEOHV FRUHPLQ 9DULDEOHV 9$59$59$59$59$5 66&30DWUL[ 9$5 9$5 9$5 9$5 9$5 FRUHPLQ      &66&30DWUL[ 9$5 9$5 9$5 9$5 9$5 FRUHPLQ      &RYDULDQFH0DWUL[')  9$5 9$5 9$5 9$5 9$5 FRUHPLQ      9DULDEOH FRUHPLQ 9$5 9$5 9$5 9$5 9$5 FRUHPLQ FRUHPLQ FRUHPLQ FRUHPLQ 6LPSOH6WDWLVWLFV 1 0HDQ 6WG'HY 0HGLDQ 0LQLPXP 0D[LPXP                                   (  3HDUVRQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5 9$5         6SHDUPDQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5 9$5         .HQGDOO7DXE&RUUHODWLRQ&RHIILFLHQWV1  3URE!_WDX_XQGHU+7DX  9$5 9$5 9$5 9$5         +RHIIGLQJ'HSHQGHQFH&RHIILFLHQWV1  3URE!'XQGHU+'  9$5 9$5 9$5 9$5         9$5   9$5   9$5   9$5   *HQHUDWHG E\ WKH 6$6 6\VWHP 6$6$SS  ;B(659 RQ $SULO   DW  30 59 F.3 AP600: 6 inch Break, Top 5 Variables 7KXUVGD\ $SULO    30  &RUUHODWLRQ $QDO\VLV 7KH &255 3URFHGXUH :LWK9DULDEOHV FRUHPLQ 9DULDEOHV 9$59$59$59$59$5 66&30DWUL[ 9$5 9$5 9$5 9$5 9$5 FRUHPLQ      &66&30DWUL[ 9$5 9$5 9$5 9$5 9$5 FRUHPLQ      &RYDULDQFH0DWUL[')  9$5 9$5 9$5 9$5 9$5 FRUHPLQ      9DULDEOH FRUHPLQ 9$5 9$5 9$5 9$5 9$5 FRUHPLQ FRUHPLQ FRUHPLQ FRUHPLQ 6LPSOH6WDWLVWLFV 1 0HDQ 6WG'HY 0HGLDQ 0LQLPXP 0D[LPXP                                   (  3HDUVRQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5 9$5         6SHDUPDQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5 9$5         .HQGDOO7DXE&RUUHODWLRQ&RHIILFLHQWV1  3URE!_WDX_XQGHU+7DX  9$5 9$5 9$5 9$5         +RHIIGLQJ'HSHQGHQFH&RHIILFLHQWV1  3URE!'XQGHU+'  9$5 9$5 9$5 9$5         9$5   9$5   9$5   9$5   *HQHUDWHG E\ WKH 6$6 6\VWHP 6$6$SS  ;B(659 RQ $SULO   DW  30 60 F.4 AP600: 8 inch Break, Top 4 Variables )ULGD\ $SULO    30  &RUUHODWLRQ $QDO\VLV 7KH &255 3URFHGXUH :LWK9DULDEOHV FRUHPLQ 9DULDEOHV 9$59$59$59$5 66&30DWUL[ 9$5 9$5 9$5 9$5 FRUHPLQ     &66&30DWUL[ 9$5 9$5 9$5 9$5 FRUHPLQ     &RYDULDQFH0DWUL[')  9$5 9$5 9$5 9$5 FRUHPLQ     9DULDEOH FRUHPLQ 9$5 9$5 9$5 9$5 FRUHPLQ FRUHPLQ FRUHPLQ FRUHPLQ 6LPSOH6WDWLVWLFV 1 0HDQ 6WG'HY 0HGLDQ 0LQLPXP 0D[LPXP                             (  3HDUVRQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5       6SHDUPDQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5       .HQGDOO7DXE&RUUHODWLRQ&RHIILFLHQWV1  3URE!_WDX_XQGHU+7DX  9$5 9$5 9$5       +RHIIGLQJ'HSHQGHQFH&RHIILFLHQWV1  3URE!'XQGHU+'  9$5 9$5 9$5       9$5   9$5   9$5   9$5   *HQHUDWHG E\ WKH 6$6 6\VWHP 6$6$SS  ;B(659 RQ $SULO   DW  30 61 F.5 LOFT: 3 Values per Variable 7XHVGD\ $SULO    $0  &RUUHODWLRQ $QDO\VLV 7KH &255 3URFHGXUH :LWK9DULDEOHV 3&7 9DULDEOHV 9$59$59$59$59$59$5 66&30DWUL[ 9$5 9$5 9$5 9$5 9$5 9$5 3&7       &66&30DWUL[ 9$5 9$5 9$5 9$5 9$5 9$5 3&7       &RYDULDQFH0DWUL[')  9$5 9$5 9$5 9$5 9$5 9$5 3&7       9DULDEOH 3&7 9$5 9$5 9$5 9$5 9$5 9$5 3&7 3&7 3&7 3&7 1        6LPSOH6WDWLVWLFV 0HDQ 6WG'HY 0HGLDQ 0LQLPXP 0D[LPXP                                    3HDUVRQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5 9$5 9$5           9$5   6SHDUPDQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5 9$5 9$5           9$5   .HQGDOO7DXE&RUUHODWLRQ&RHIILFLHQWV1  3URE!_WDX_XQGHU+7DX  9$5 9$5 9$5 9$5 9$5           +RHIIGLQJ'HSHQGHQFH&RHIILFLHQWV1  3URE!'XQGHU+'  9$5 9$5 9$5 9$5 9$5           9$5   9$5   *HQHUDWHG E\ WKH 6$6 6\VWHP 6$6$SS  ;B(659 RQ $SULO   DW  $0 62 F.6 LOFT: 6 Values per Variable 0RQGD\ $SULO    $0  &RUUHODWLRQ $QDO\VLV 7KH &255 3URFHGXUH :LWK9DULDEOHV 3&7 9DULDEOHV 9$59$59$59$59$59$5 66&30DWUL[ 9$5 9$5 9$5 9$5 9$5 9$5 3&7       &66&30DWUL[ 9$5 9$5 9$5 9$5 9$5 9$5 3&7       &RYDULDQFH0DWUL[')  9$5 9$5 9$5 9$5 9$5 9$5 3&7       9DULDEOH 3&7 9$5 9$5 9$5 9$5 9$5 9$5 3&7 3&7 3&7 6LPSOH6WDWLVWLFV 1 0HDQ 6WG'HY 0HGLDQ 0LQLPXP 0D[LPXP                                           3HDUVRQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5 9$5 9$5           6SHDUPDQ&RUUHODWLRQ&RHIILFLHQWV1  3URE!_U_XQGHU+5KR  9$5 9$5 9$5 9$5 9$5           .HQGDOO7DXE&RUUHODWLRQ&RHIILFLHQWV1  3URE!_WDX_XQGHU+7DX  9$5 9$5 9$5 9$5 9$5           9$5   9$5   9$5   *HQHUDWHG E\ WKH 6$6 6\VWHP 6$6$SS  ;B(659 RQ $SULO   DW  $0 63