Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

ARI 540-99sdf

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38
At a glance
Powered by AI
The key takeaways are that this standard establishes definitions, requirements and procedures for testing, rating, operating, marking and conformance of positive displacement refrigerant compressors and compressor units for refrigeration applications.

The purpose of this standard as stated in Section 1 is to establish definitions, requirements for testing, rating and operating, minimum data requirements for published ratings, marking and nameplate data, and conformance conditions for positive displacement refrigerant compressors and compressor units for refrigeration applications.

Section 2 discusses the scope which applies to electric motor-driven, engine-driven and other positive displacement compressors and compressor units using refrigerants. Section 3 provides definitions for terms used in the standard.

1999

STANDARD for

POSITIVE
DISPLACEMENT
REFRIGERANT
COMPRESSORS
AND
COMPRESSOR
UNITS

ANSI/ARI
Standard 540-1999

4100 N. FAIRFAX DR., STE. 200 ! ARLINGTON, VIRGINIA 22203


IMPORTANT

SAFETY RECOMMENDATIONS

It is strongly recommended that the product be designed, constructed, assembled and installed in accordance with
nationally recognized safety requirements appropriate for products covered by this standard.

ARI, as a manufacturers' trade association, uses its best efforts to develop standards employing state-of-the-art
and accepted industry practices. However, ARI does not certify or guarantee safety of any products, components
or systems designed, tested, rated, installed or operated in accordance with these standards or that any tests
conducted under its standards will be non-hazardous or free from risk.

Note:

This standard supersedes ARI Standard 540-99.

Price $20.00 (M) $40.00 (NM) ©Copyright 1999, by Air-Conditioning and Refrigeration Institute
Printed in U.S.A. Registered United States Patent and Trademark Office
TABLE OF CONTENTS

SECTION PAGE

Section 1. Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Section 2. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Section 3. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Section 4. Test Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Section 5. Rating Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Section 6. Minimum Data Requirements for Published Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Section 7. Operating Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Section 8. Marking and Nameplate Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Section 9. Voluntary Conformance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

TABLES

Table 1. Standard Rating Conditions for Compressors and Compressor Units for
Commercial Refrigeration Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Table 2. Standard Rating Conditions for Compressors Used In Air Conditioners and
Heat Pumps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

APPENDICES

Appendix A. References - Normative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Appendix B. References - Informative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Appendix C. Computer Program to Establish Performance Coefficients - Informative . . . . . . . 7


ANSI/ARI STANDARD 540-1999

POSITIVE DISPLACEMENT REFRIGERANT


COMPRESSORS AND COMPRESSOR UNITS

Section 1. Purpose Section 3. Definitions

1.1 Purpose. The purpose of this standard is to establish, 3.1 Definitions. All terms in this document will follow the
for positive displacement refrigerant compressors and standard industry definitions in the current edition of
compressor units for refrigeration applications: definitions; ASHRAE Terminology of Heating, Ventilation, Air Condi-
requirements for testing, rating and operating; minimum data tioning and Refrigeration unless otherwise defined in this
requirements for published ratings; marking and nameplate section.
data; and conformance conditions.
3.2 Compressor or Compressor Unit Efficiency.
1.1.1 Intent. This standard is intended for the
guidance of the industry, including manufacturers, 0 = 100 mC (h2s - h1) / P
engineers, installers, contractors and users.
where: m = mass flow of volatile refrigerant, lb/hr [kg/s]
1.1.2 Review and Amendment. This standard is h1 = specific enthalpy of refrigerant vapor enter-
subject to review and amendment as technology ing the compressor or compressor unit,
advances. Btu/lb [kJ/kg]
h2s = specific enthalpy of refrigerant vapor - at
discharge pressure, Btu/lb [kJ/kg] and s is
Section 2. Scope the specific entropy of refrigerant vapor
entering the compressor or compressor unit,
2.1 Scope. This standard applies to electric motor driven, Btu/lb A °F [kJ/kg A °C]
single capacity positive displacement refrigerant compres- C = 0.2931 W/Btu/h, 1.0 [kW/kJ/s]
sors and compressor units. This standard also applies to P = measured motor input power, W [kW]
the presentation of performance data for positive displace- 0 = compressor or compressor unit efficiency,
ment refrigerant compressors and compressor units. in percent

2.2 Exclusions. 3.3 External-Drive Refrigerant Compressor. A compres-


sor with a shaft or other moving part extending through a
2.2.1 This standard does not apply to compressors casing to be driven by an electric motor.
and compressor units employing ammonia, as covered
in ARI Standard 510. 3.4 Positive Displacement Refrigerant Compressor Unit.
A positive displacement compressor mounted on a struc-
2.2.2 This standard does not apply to compressors tural base with accessories, such as strainers, service
and compressor units intended for use in: valves, check valves, suction filters, oil separators, receiv-
ers, etc., as provided by the manufacturer.
a. Household refrigerators and freezers
b. Automotive air-conditioners
c. Dehumidifiers

1
ANSI/ARI STANDARD 540-1999

3.5 Published Rating. A statement of the assigned 5.1.2 Standard Ratings of a Compressor and
values of those performance characteristics, under stated Compressor Unit Used in an Air-Conditioner or Heat
rating conditions, by which a unit may be chosen to fit its Pump. The rating(s) when operated under one of the
application. These values apply to all units of like nominal Standard Rating Conditions presented in Table 2.
size and type (identification) produced by the same manu-
facturer. As used herein, the term "published rating" 5.2 Application Ratings of Compressor and Compressor
includes the rating of all performance characteristics shown Units. An application rating of a compressor or compressor
on the unit or published in specifications, advertising or unit is a mass flow rating, and associated power input rating
other literature controlled by the manufacturer, at stated when tested at completely stated conditions other than
rating conditions. those presented in Table 1 or 2, as specified by the manufac-
turer.
3.5.1 Standard Rating. A rating based on tests
performed at Standard Rating Conditions. 5.3 Publication of Ratings. Wherever application ratings
are published or printed, they shall include, or be accompa-
3.5.2 Application Rating. A rating based on tests nied by, the pertinent Standard Rating(s), clearly designated
performed at application rating conditions (other than as such, and shall include a statement of the conditions at
Standard Rating Conditions). which the rat ings apply and the accessories included in
obtaining those ratings.
3.6 "Shall," "Should," "Recommended" or "It is Recom-
mended" . "Shall," "should," "recommended" or "it is 5.4 Tolerances on the Standard Ratings. To comply with
recommended" shall be interpreted as follows: this standard, Standard Ratings shall be based on data
obtained in accordance with the provisions of this section,
3.6.1 Shall. Where "shall" or "shall not" is used for and shall be such that any production unit, when tested
a provision specified, that provision is mandatory if shall meet these ratings except for an allowance to cover
compliance with the standard is claimed. testing and manufacturing variations: 95% of rated values
tolerance for mass flow rate and efficiency. In addition, the
3.6.2 Should, Recommended or It Is Recommended. tolerance for power input shall be no more than 105% of the
"Should," "recommended" or "it is recommended" is rated value.
used to indicate provisions which are not mandatory
but which are desirable as good practice.
Section 6. Minimum Data Requirements for
Published Ratings
Section 4. Test Requirements
6.1 T abular Data. General performance data, covering the
4.1 Testing Compressors and Compressor Units . All operational spectrum of the equipment, shall be presented
standard ratings shall be verified by tests conducted in in tabular form within defined accuracies and ranges of
accordance with ASHRAE Standard 23. operation. The tables shall include:

a. Suction dew point temperature range, °F [°C]


Section 5. Rating Requirements b. Discharge dew point temperature range, °F [°C]
c. Applicable superheat, °F[°C]
5.1 Standard Ratings of Compressors and Compres s o r d. Input watts, W [W]
Units. A Standard Rating of a compressor or compressor e. Compressor or Compressor Unit Efficiency, percent
unit consists of Standard Mass Flow Ratings, identified at f. Refrigerant mass flow rate, lbs/hr [kg/hr]
the Standard Rating Conditions, plus its associated power g. Current, A [A]
input rating and efficiency rating when tested as specified h. Refrigerant designation per ASHRAE Standard 34
by the manufacturer.
The manufacturer's tabular data shall be based on data
5.1.1 Standard Rating of a Commercial Refrigerat- obtained from tests performed or calculated by whatever
ing Compressor or Compressor Unit. The rating when means or methods deemed necessary at conditions within
operated under one of the Standard Rating Conditions the range of application usage specified in 6.2.1, 6.2.2, 6.2.3
presented in Table 1. or 6.2.4.

2
ANSI/ARI STANDARD 540-1999

6.2 Data to be Reported. The tabular data shall be ! 80°F to 140°F [25°C to 60°C] Discharge Dew
reported at the following conditions for the compressor or Point Temperature (10°F [5°C] increments)
compressor unit application us age intended. The extreme ! Superheat per Table 1
ends of the tabular data may be omitted and not reported
due to limits of acceptable operation of the compressor or 6.2.4 Low Temperature (freezer cases, for example).
compressor unit as determined by the manufacturer.
! -40°F to 10°F [-40°C to 12.5°C] Suction Dew
6.2.1 Air-Conditioning (including heat pumps). Point Temperature (5°F [2.5°C] increments)
! 80°F to 140°F [25°C to 60°C] Discharge Dew
! -10°F to 55°F [-25°C to 12.5°C] Suction Dew Point Temperature (10°F [5°C] increments)
Point Temperature (5°F [2.5°C] increments) ! Superheat per Table 1
! 80°F to 140°F [25°C to 60°C] Discharge Dew
Point Temperature (10°F [5°C] increments) 6.3 Polynomial Equation. The polynomial equation that
! 20 °F [11.1°C] Superheat shall be used to represent the tabular data is a third degree
equation of ten coefficients in the form of:
6.2.2 High Temperature (water coolers and walk-in
coolers, for example). X = C1 +C2 * (S) + C3 * D +C4 * (S2) + C5 * (S*D) + C6
* (D2) + C7 * (S3) + C8 * (D * S2) +C9 * (S*D2) + C10 *
! 20°F to 50°F [-7.5°C to 10°C] Suction Dew Point (D3)
Temperature (5°F [2.5°C] increments)
! 80°F to 140°F [25°C to 60°C] Discharge Dew where:
Point Temperature (10°F [5°C] increments)
! Superheat per Table 1 C = Equation Coefficient, represents compressor
performance
6.2.3 Medium Temperature (display cases, for S = Suction Dew Point Temperature, °F [°C]
example). D = Discharge Dew Point Temperature, °F [°C]

! -10°F to 32°F [-25°C to 0°C] Suction Dew Point


Temperature (5°F [2.5°C] increments)

Table 1. Standard Rating Conditions for Compressors and Compressor Units for Commercial Refrigera-
tion Applications (Based on 95°F [35°C] Ambient Temperature)

Suction Dew Point Tem- Discharge Dew Point


perature Compressor Type Temperature Return Gas Temperature

°F °C °F °C °F °C

45 7.2 All 130 54.4 65 18.3

20 -6.7 All* 120 48.9 40/65* 4.4/18.3*

-10 -23.3 Hermetic 120 48.9 40 4.4

-25 -31.7 All* 105 40.6 40/65* 4.4/18.3*

-40 -40 All* 105 40.6 40/65* 4.4/18.3*

If air flow across the compressor is used to determine ratings, it shall be specified by the compressor manufacturer.
* For hermetic type compressors 40°F [4.4°C] return gas temperature shall be used.
For external drive and accessible hermetic type compressors 65°F [18.3°C] return gas temperature shall be
used.

3
ANSI/ARI STANDARD 540-1999

Table 2. Standard Rating Conditions for Compressor(s) and Compressor Unit(s) Used In Air Conditioners
and Heat Pumps (Based on 95°F [35°C] Ambient Temperature)

Suction Dew Point Tem- Discharge Dew Point


Application Test Points perature Temperature Return Gas Temperature

°F °C °F °C °F °C

Air Source (Cooling) 45 7.2 130 54.4 65 18.3

Air Source (Heating - 30 -1.1 110 43.3 50 4.4


High Temp.)

Air Source (Heating - 5 -15 95 35 25 -3.9


Low Temp.)

Water Source Cooling & 45 7.2 120 48.9 65 18.3


Heating

If air flow across the compressor is used to determine ratings, it shall be specified by the compressor manufacturer.

X represents (as designated) 30°F, [8.3°C to 16.7°C] superheat.

C Power input, W or kW [W] 6.4.1.2 High Temperature (see 6.2.2)...15°F to


! Mass flow rate, lbs/hr [kg/hr] 45°F, [8.3°C to 25°C] superheat.
! Current, A [A]
! Compressor or Compressor Unit efficiency 6.4.1.3 Med. Temperature (see 6.2.3)...15°F to
75°F, [8.3°C to 41.7°C] superheat.
6.3.1 To establish the coefficients to be used in the
equation above, the method of “Least Squares” shall be 6.4.1.4 Low Temperature (see 6.2.4)...15°F to
used (Appendix C illustrates one acceptable computer 105°F, [8.3°C to 58.3°C] superheat.
program for establishing the coefficients).
6.5 Values Calculated Using the Equation of 6.3. Values
To establish the coefficients, sufficient test data needs of the same performance characteris tics calculated from the
to be entered into the computer program. For those ten coefficient third order equation and the coefficients
conditions where the tabular data cannot be published provided by the compressor manufacturer shall agree with
due to the operating limits of the compressor, the the tabular values within ± 1%. In the event that the
compressor manufacturer will use test data or extrapo- compressor manufacturer determines that the values
lated values for the omitted points inside the range(s) calculated from the ten coefficient equation may differ by
specified in 6.2 so that the calculation may be com- more than 1% from the tabulated values in portions of the
pleted and generate the coefficients to be used in the operating range, the compressor manufacturer will indicate
equation (6.3) specified. this by shading, cross-hatching or otherwise identifying
those affected data points in the table.
6.3.2 The polynomial equation (6.3) shall not be used
to extrapolate beyond the range of data specified in 6.2
Section 7. Operating Requirements
6.4 Superheat Corrections.
7.1 Loading Requirements . The compressor or compres-
6.4.1 Superheat Range. For superheat, other than sor unit shall be capable of operating continuously at the
that specified, correction values will be provided, upon stated maximum loading conditions of 7.2 for a minimum
request of the user, for the following applications and period of two hours at minimum and maximum utilization
ranges: voltage as described in ARI Standard 110, Table 1.

6.4.1.1 Air-Conditioning (see 6.2.1)...15°F to 7.2 Maximum Loading Conditions. The maximum

4
ANSI/ARI STANDARD 540-1999

suction dew point temperature limit shall be published. This 8.2 Compressor Unit Nameplate Marking. Each com-
limit shall be established with the compressor operating at pressor unit should carry a nameplate, affixed to its housing
conditions described below: or base, on which at least the following information should
be marked, in addition to that required under 8.1:
a. Ambient temperature surrounding the compressor
of 115°F [46.1°C] dry bulb for all types. a. Manufacturer's name and/or symbol
b. 145°F [62.8°C] discharge dew point temperature for b. Model number
compressors or compressor units for air cooled c. Refrigerant designation
applications; 120°F [48.9°C] discharge dew point d. Input voltage and frequency (Hz)
temperature for compressors and compressor units e. Rated-load current (where applicable)
for water cooled applications.
c. Superheated return gas temperature shall be no
lower than 65°F [18.3°C]. Section 9. Voluntary Conformance

9.1 Conformance. While conformance with this standard


Section 8. Marking and Nameplate Data is voluntary, conformance shall not be claimed or implied for
products or equipment within its Purpose (Section 1) and
8.1 Compressor Electrical Marking. The voltage, phase, Scope (Section 2) unless such claims meet all of the require-
frequency, and locked-rotor current of all motors furnished ments of the standard.
as part of the compressor shall be clearly marked on a
nameplate.

Recommended nameplate voltages for 60 Hertz systems shall


include one or more of the utilization voltages shown in
Table 1 of ARI Standard 110. Recommended nameplate
voltages for 50 Hertz systems shall include one or more of
the equipment nameplate voltages shown in Table 1 of IEC
Standard Publication 38.

5
ANSI/ARI STANDARD 540-1999

APPENDIX A. REFERENCES - NORMATIVE

A.1 Listed here are all standards, handbooks, and other A.1.3 ASHRAE Standard 23-1993, Methods of Testing
publications essential to the formation and implementation for Rating Positive Displacement Refrigerant Com-
of the standard. All references in this appendix are consid- pressors and Condensing Units , 1993, American
ered as part of the standard. Society of Heating, Refrigerating and Air-Conditioning
Engineers, Inc., 1791 Tullie Circle N.E., Atlanta, GA
A.1.1 ANSI/ASHRAE Standard 34-1997 and 30329, U.S.A.
ANSI/ASHRAE Standard 34-1997 Addenda, Number
Designation and Safety Classification of Refrigerants, A.1.4 ASHRAE Terminology of Heating, Ventilation,
1997, American National Standards Institute/American Air Conditioning and Refrigeration, American Society
Society of Heating, Refrigerating and Air-Conditioning of Heating, Refrigerating and Air-Conditioning Engi-
Engineers, 11 West 42nd Street, New York, NY 10036, neers, Inc., 1791 Tullie Circle N.E., Atlanta, GA 30329,
U.S.A./1791 Tullie Circle N.E., Atlanta, GA 30329, U.S.A.
U.S.A.
A.1.5 IEC Standard Publication 38, IEC Standard
A.1.2 A RI Standard 110-97, Air-Conditioning and Voltages, 1983, International Electrotechnical Commis-
Refrigerating Equipment Nameplate Voltages, 1997, sion, 3, rue de Varembe, P.O. Box 131, 1211 Geneva 20,
Air-Conditioning and Refrigeration Institute, 4301 North Switzerland.
Fairfax Drive, Suite 425, Arlington, VA 22203, U.S.A.

APPENDIX B. REFERENCES - INFORMATIVE

B.1 Listed here are all standards, handbooks and other B.1.2 ARI Standard 510-93, Ammonia Compressor
publications which may provide useful information and Units, 1993 Air- Conditioning and Refrigeration Insti-
background but are not considered essential. References in tute, 4301 North Fairfax Drive, Suite 425, Arlington, VA
this appendix are not considered part of the standard. 22203, U.S.A.

B1.1 ANSI/ARI Standard 500-90, Variable Capacity B.1.3 ARI Standard 520-97, Positive Displacement
Positive Displacement Refrigerant Compressors and Condensing Units, 1997, Air-Conditioning and Refriger-
Compressor Units for Air-Conditioning and Heat ation Institute, 4301 North Fairfax Drive, Suite 425,
Pump Applications, 1990, American National Standards Arlington, VA 22203, U.S.A.
Institute/Air-Conditioning & Refrigeration Institute, 11
West 42nd Street, New York, NY 10036, U.S.A./4301
North Fairfax Drive, Suite 425, Arlington, VA 22203,
U.S.A.

6
ANSI/ARI STANDARD 540-1999

APPENDIX C. COMPUTER PROGRAM TO ESTABLISH


PERFORMANCE COEFFICIENTS - INFORMATIVE

C.1 Purpose. The computer program described in this C.3.2.1 Program. Refer to diskette. (See pages
appendix may be used to establish the compressor perfor- 15 thru 17 also).
mance coefficients for the polynomial equation (see 6.3
also). C.3.3 Main Program (SURFACEC.FOR:). The main
program provides the minimum requirements to accept
X = C1 + C2 * (S) + C3 * D + C4 * (S2) + C5 * (S*D) + C6 * tabulated values for input and prints out the results of
(D2) + C7 * (S3) + C8 * (D*S2) + C9*(S*D2) + C10 * (D3) the coefficients generating program.

Where: C.3.3.1 Program. Refer to diskette. (See pages


18 through 24 also).
S = Suction Dew Point Temperature °F [°C]
D = Discharge Dew Point Temperature °F [°C] C.3.4 Subroutine Program (SURFAC03.FOR:). The
subroutine does the basic calculations for the main
C.2 Program Description. program (C.3.3) which reads the compressor perfor-
mance values and performs a "Least Squares Curve Fit"
C.2.1 The program was compiled using Microsoft™ with a ten coefficient polynomial equation.
Fortran Optimizing Compiler version 5.0.
C.3.4.1 Program. Refer to diskette. (See pages
C.2.2 The program is supplied on one DOS compati- 25 through 31 also).
ble diskette.
C.3.5 Subroutine Program (SOLVES10.FOR:). This
C.2.2.1 The available disk program was com- subroutine solves for simultaneous equations with a
p iled to allow execution on any IBM or IBM com- maximum order of 10. The method of solution is Gaussi-
patible system with or without a math coprocessor. an Elimination which consists of two major steps:

C.3 Computer Program. a) Triangularization


b) Back Substitution
C.3.1 General. This program is written for ARI
Standard 540. It will utilize compressor performance C.3.5.1 Program. Refer to diskette. (See pages
tabulated data and then perform a "Least Squares Curve 32 through 35 also).
Fit" with a ten coefficient polynomial equation.
C.3.6 Subroutine Program (CMPHLP01.FOR:). This
C.3.2 Instructions (README.DOC:). This file subroutine reads the ASCII text in the instruction file,
contains ASCII text which provides instructions for C.3.2, and displays it on the computer screen.
execution and help information.
C.3.6.1 Program. Refer diskette. (See pages 35
through 38 also).

7
ANSI/ARI STANDARD 540-1999

C.4 Instruction File Computer Calculations


The Instruction File is included for your information only.

This program was written for ARI Standard 540. fl /Fpc SURFACEC.FOR CMPHLP01.FOR
SURFAC03.FOR SOLVES10.FOR
Background
Data Files
This program reads compressor performance values and
then performs a Sum of the Least Squares curve fit to a ten The menu for changing the data file is N - Next, P -
coefficient equation. The ten coefficient equation repre- Previous, C - Change, H - Help or E - End.
sents a two dimensional parabolic curve.
There is one support file that is required for this program.
The Method of Least Squares for establishing the coeffi- This file is called SURFACE.DAT. The input data is read in
cients of an equation is defined as the best fit in which the from this data file. The data can then be changed or modi-
sum of the squared values of the deviations between the fied on the screen.
data points and the calculated values is a minimum.
There is an optional report file called SURFACE.REP. See
This method will only be explained using a linear equation Execution for an explanation on how to use this file in the
as an example. The "Ten Coefficient Equation" of 6.3 carries program.
the same principles and the steps of the solution are ex-
plained throughout the program. Equation

Linear Example: Y = A0 + A1 * X The equation used to represent the performance of a


compressor in this program is a Ten Coefficient equation.
For a given set of data values of X and Y, the objective The equation represents a two dimensional parabolic
is to find A0 and A1 so that the deviation between the surface with all combined terms higher than a third order
data values and the values calculated by the above dropped.
equation are at a minimum.
Format:
Deviation = A0 + A1 * X - Y
S S2 S3
The Sum of the Least Squares curve is the curve in C1 C2*S C4*S2 C7*S3
which the summation of the deviation squared is a
minimum. D C3*D C5*S* C8*S2*
D D
The minimum occurs when the partial derivatives of the
above equation with respect to A0 and A1 are equal to D2 C6*D2 C9*S*
0. D2

D3 C10*D3
and

The above two equations can be expressed in matrix


Execution
equation form after dividing by two and separating into
individual terms as follows:
There are two ways to execute the compressor surface
program. One way is to start an interactive execution by
This matrix can now be solved for A0 and A1 by
typing SURFACE to start the executable program.
Gaussian Elimination.
Tabulated data is read from a Data file, SURFACE.DAT.

Compile
The operator is prompted for commands to C - Change data
R - Run H - Help Q - Quit and the results are shown on
This program has been compiled using the Microsoft
the screen. These commands are executed by entering the
Fortran Optimizing Compiler Version 5.0. The command for
capitalized letter shown and pressing enter.
compiling and linking is as follows.

8
ANSI/ARI STANDARD 540-1999

The second method is for prompted information to be SURFAC03.FOR


passed into the file using Redirection of the input and
output (see redirection of I/O in your DOS manual). This is This subroutine does the basic calculations for the main
accomplished via a batch file, SURFACE.BAT. To execute program SURFACEB.FOR which reads the compressor
the program using this method, type SURFACE and enter. performance values and performs a least squares curve fit
The output from this method can be found in a file called with a ten coefficient equation.
SURFACE.REP.
Zero

The computer will not accept a zero value while in the


SOLVES10.FOR Change data mode. To get Zero, enter a value that is lower
than four significant digits (0.0001). Another solution would
This SUBROUTINE Solves for simultaneous equations with be to edit the data file SURFACE.DAT with an ASCII editor.
a maximum order of 10. The method of solution is Gaussian
Elimination which consists of two major steps:

a) Triangularization
b) Back Substitution

Subroutines required:

There are three subroutines that are required to support this


program. These are SURFAC03.FOR, SOLVES10.FOR and
CMPHLP01.FOR.

9
ANSI/ARI STANDARD 540-1999

C.5 SOURCE CODE COMPUTER CALCULATIONS


This section is the printed copy of the fortran source code described in Section C.3

C
C FILENAME SURFACEC.FOR DATE: 7-15-88
C
C
C THIS PROGRAM WILL READ COMPRESSOR PERFORMANCE VALUES AND C THEN
PERFORM A LEAST SQUARES CURVE FIT WITH A TEN COEFFICIENT C EQUATION.
C
C THIS PROGRAM WAS WRITTEN FOR ARI STANDARD 540P "METHOD FOR C
PRESENTATION OF COMPRESSOR PERFORMANCE DATA."
C
C SUBROUTINES REQUIRED: Surfac03.for, Solves10.for, CmpH1p01.for
C
C Required support files: Surface.txt
C
C Optional support files: Surface.dat, surface.rep
C
C
C
C
C
C*************** INITIALIZE ****************************************************
C
COMMON EVAP_TEMP(150), COND_TEMP(150), VALUE(150)
C
REAL*4 CALC_VALUE(150), VALUE_DIFF(150), DATANO(150), X(10)
CHARACTER*1 COMAND, comand2
CHARACTER*9 fit_to
CHARACTER*10 srch1
CHARACTER*80 Name, ATEMP
CHARACTER*16 MODEL
C
C**************** Initialize the source of input data ***********************************
C
Name = "Surface.dat"
Write (6, '(// ' ' The input file is: ' ' , A80,
1 /'' Change to: ' ',\)') Name
Read (5, ' ( A80 )') ATEMP
C
IF (ATEMP.NE. ' ') THEN

10
ANSI/ARI STANDARD 540-1999

Name = ATEMP
END IF
C
open (7, file = Name )
C
C**************** Initialize the location of output data *********************************
C
Write (6, '(// ' ' Enter a 1 for file Output or' ' /
1 '' a 0 for screen Output ' ')' )
Read (5, *) Iout
C
If (Iout .eq. 1) Then
Name = ' ' Surface.rep ' '
Write (6, '(// ' ' The output file is: ' ', A80,
1 /'' Change to: ' ', \)') Name
READ (5, '(A80 )' ) ATEMP
C
IF (ATEMP.NE. ' ') THEN
Name = ATEMP
END IF
C
open (6, file = Name )
C
end if
C
C
open (4, file = 'surface.txt' )
C
C**************** Read the input values from a data file ********************************
C
10 READ (7, '(T2, A9, T40, A16 ) ') FIT_TO, MODEL
C
IOErr = 0
I=I
DO While (IOErr .EQ. 0)
READ (7,*, IOSTAT = IOErr) DATANO(I), EVAP_TEMP(I),
1 COND_TEMP(I), VALUE(I)
I=I+1
End Do
I=I-2
Number = I
Close (7)
C

11
ANSI/ARI STANDARD 540-1999

200 IF (Iout.NE. 1) then


C
WRITE (6, '( ' ' Enter a (C)hange data, (S)ave data, (R)un, ' ',
1 ' '(H)elp, or a(Q)uit and press enter.' ' \)' )
READ(5, '(A1 )' ) COMAND
C
C Use IF, THEN, ELSE IF, and END IF to duplicate SELECT CASE,
C END SELECT commands.
C
If (COMAND .EQ. 'C' .OR.COMAND .EQ. 'c' ) THEN
WRITE (6, '( ' ' The number of data points is ' ', I4,
1 / )' ) NUMBER
C
WRITE (6, '( ' ' The Model Number is ' ', A16,
1 t45, ' ' Change to ' ', \ )') model
C
READ (5, '( A16 )' ) ATEMP
IF (ATEMP .NE. ' ') THEN
MODEL = ATEMP
END IF
C
WRITE (6, '( ' ' The Curve is fit to ' ', A9,
1 t45, ' 'Change to ' ', \)') fit_to
READ (5, '( A9 )' ) ATEMP
C
IF (ATEMP .NE. ' ') THEN
FIT_TO = ATEMP
END IF
C
i=1
C
500 WRITE (6, '(/ ' ' Data Point #, Evaporater temp, Condensing' ',
1 ' 'temp, nd Performance Value, ' ') ')
WRITE (6, '(T5, F4.0, T15, F8.1, T35, F8.1, T55, F9.2 \)' )
1 DATANO (I), EVAP_TEMP (I), COND_TEMP (I), VALUE (I)
C
WRITE (6, '(/, ' ' Enter an (N)ext, (P)revious, ' ',
1 ' ' (C)hange, (A)dd, (D)elete, (H)elp or (E)nd. ' ' /)' )
C
READ (5, '( A1 )' ) COMAND2
C
C Use IF, THEN, ELSE IF, and END IF to duplicate SELECT CASE,
C END SELECT commands.
C

12
ANSI/ARI STANDARD 540-1999

IF (COMAND2 .EQ. 'N' .OR. COMAND2 .EQ. 'n' ) THEN


I=I+1
C
C
ELSE IF (COMAND2 .EQ. 'H' .OR. COMAND2 .EQ. 'h' ) THEN
srch1 = 'Data files'
CALL CMPHLP (srch1)
C
ELSE IF (COMAND2 .EQ. 'P' .OR. COMAND2 .EQ. 'p' ) THEN
I=I-1
C
ELSE IF (COMAND2 .EQ. 'C' .OR. COMAND2 .EQ. 'c' ) THEN
WRITE (6, '(T5, f4.0, ' ' Change to ' ' \)' )
2 DATANO (I)
READ (5, '(F4.0 )' ) TEMP
C
IF (TEMP.NE. 0) THEN
DATANO(I) = TEMP
END IF
C
WRITE (6, '(T15, f8.1, ' ' Change to " ' \)' )
2 EVAP_TEMP(I)
READ (5, '( F8.0 )' ) TEMP
C
IF (TEMP .NE. 0) THEN
EVAP_TEMP(I) = TEMP
END IF
C
WRITE (6, '( T35, f8.1, ' ' Change to ' ' \)' )
2 COND__TEMP(I)
READ(5, '( F8.0 )' ) TEMP
C
IF TEMP .NE.0) THEN
COND_TEMP(I) = TEMP
END IF
C
WRITE (6, '(t55, f9.2, ' ' Change to ' ' \)' )
2 VALUE(I)
READ(5, '(F9.0 )' ) TEMP
C
IF (TEMP . NE. 0) THEN
VALUE(I) = TEMP
END IF
C

13
ANSI/ARI STANDARD 540-1999

ELSE IF (COMAND2 .EQ. 'A' .OR. COMAND2 .EQ. 'a' ) THEN


C
C Add a line after the current line.
C
NUMBER = NUMBER + 1
J = NUMBER
I = I +1
DO WHILE (J .GT. I)
DATANO(J) = DATANO(J - 1)
EVAP_TEMP(J) = EVAP_TEMP(J - 1)
COND_TEMP(J) = COND_TEMP(J - 1)
VALUE(J) = VALUE(J - 1)
J=J-1
END DO
DATANO(1) = 0.0
VALUE(I) = 0.0
WRITE (6, '(T5, f4.0, ' ' Change to ' ' \)' )
2 DATANO(I)
READ(5, '(F4.0 )' ) TEMP
C
IF (TEMP .NE. 0) THEN
DATANO(I) = TEMP
END IF
C
WRITE (6, '( T15, f8.1, ' ' Change to ' ' \)' )
2 EVAP_TEMP(I)
READ(5, '( F8.0 )' ) TEMP
C
IF (TEMP .NE. 0) THEN
EVAP_TEMP(I) = TEMP
END IF
C
WRITE (6, '( T35, f8.1, ' ' Change to ' ' \)' )
2 COND_TEMP(I)
READ (5, '( F8.0 )' ) TEMP
C
IF (TEMP .NE. 0) THEN
COND_TEMP(I) = TEMP
END IF
C
WRITE (6, '( T55, f9.2, ' ' Change to ' ' \)' )
2 VALUE(I)
READ(5, '( F9.0 )' ) TEMP
C

14
ANSI/ARI STANDARD 540-1999

IF (TEMP .NE. 0) THEN


VALUE(I) = TEMP
END IF
C
ELSE IF (COMAND2 .EQ. 'D' .OR. COMAND2 .EQ. 'd' ) THEN
C
J=I
DO WHILE (J .LT. NUMBER)
DATANO(J) = DATANO(J + 1)
EVAP_TEMP(J) = EVAP_TEMP(J + 1)
COND_TEMP(J) = VALUE(J + 1)
J=J+1
END DO
NUMBER = NUMBER - 1
DATANO(J) = 0.0
EVAP_TEMP(J) = 0.0
COND_TEMP(J) = 0.0
VALUE(J) = 0.0
C
ELSE IF (COMAND2 .EQ. 'e' .OR. COMAND2.EQ. 'E' ) THEN
GO TO 200
C
ELSE IF (COMAND2 .EQ. 'q' .OR. COMAND2 .EQ. 'Q' ) THEN
GO TO 1000
C
ELSE IF (COMAND2 .EQ. 'r' .OR. COMAND2 .EQ. 'R' ) THEN
GO TO 600
ELSE
END IF
GO TO 500
C
C
ELSE IF (COMAND. EQ. 'H' .OR. COMAND .EQ. 'h' ) THEN
srchl = ' '
CALL CMPHLP (srchl)
C
ELSE IF (COMAND .EQ. 'r' .OR. COMAND .EQ. 'R' ) THEN
GO TO 600
C
ELSE IF (COMAND .EQ. 'S' .OR. COMAND .EQ. 's' ) THEN
C
Write (6, '(// ' ' The data file is: ' ', A80,
1 /'' Change to: ' ', \)' ) Name
READ(5, '( A80 )' ) ATEMP

15
ANSI/ARI STANDARD 540-1999

C
IF (ATEMP .NE. ' ') THEN
Name = ATEMP
END IF
C
open (7, file = Name )
C
C
C**************** Write the data values to a data file **********************************
C
Write 7, '(T2, A9, T40, A16) ') FIT_TO, MODEL
C
I=1
DO While (I .LE. NUMBER)
Write (7, ' (F6.1, 2F8.1, F13.2 )' ) DATANO(I)
1 EVAP_TEMP(I), COND_TEMP(I), VALUE(I)
I+I+1
End Do
C
Close (7)
C
ELSE IF (COMAND .EQ. 'q' .OR. COMAND .EQ. 'Q') THEN
GO TO 1000
Else
END IF
GO TO 200
C
End if
600 CONTINUE
C
C
C**************** Test print of the input data ****************************************
C
C WRITE (6, 110)
C110 FORMAT ('0 EVAP_TEMP COND_TEMP VALUE'
C WRITE (6, ' (4E15.4) '), (EVAP_TEMP(I), COND_TEMP(I), VALUE(I).
C 1 I = 1, NUMBER)
C
C**************** Print the equation format *****************************************
C
WRITE (6, '( / /, ' ' EQUATION FORMAT ' ' / ' ' VALUE = ' ',
1 T26, ' 'C1 + (C2* (S) + C3 * (D) ' ' /
2 T21, ' ' + C4 * (S^2) + C5 * (S*D) + C6 * (D^2)' ' /
3 T21, ' ' + C7 * (S^3) + C8 * (D*S^2) + C9 * (S*D^2)''/

16
ANSI/ARI STANDARD 540-1999

4 T21, ' ' + C10 * (D^3) ' ' )')


C
C**************** Call the surface equation subroutine
C for capacity ***************************************************
C
CALL SURFAC (NUMBER, X)
C
C******** Print out the results of the subroutine ****************************************
C
WRITE (4, ' (' 'C, ' ', A9, /, A16, / , 10(1PE13.6/))') FIT_TO,
1 MODEL, (X(I), I = 1,10)
WRITE (6, ' ( / T2, A9, 1P, T21, 3E16.6, /,
1 t2, A16, T21, 3E16.61,
2 T21, 3E16.6 / T21, E16.6)') FIT_TO,
3 (X(I), I = 1, 3), MODEL, (X(I), I = 4, 10)
C
C******** Compare the input with the calculated ***************************************
C
WRITE (6,' (/ ' ' RUN EVAP. CON.' ',
1 ' ' ****** COMPRESSOR PERFORMANCE ****** ' ', /
1 '' # TEMP. TEMP.' ',
2 '' INPUT CALCULATED %DIFF.' ')')
C
DO 900 I = 1, NUMBER
C
C******** Calculate the performance using the ten coefficients
C defined as X(i) ***********************************************************
C
CALC_VALVE (I) = X(1) + EVAP_TEMP(I) * X(2) + (3) *COND_TEMP(I)
1 + X(4) * EVAP_TEMP(I) * EVAP_TEMP(I)
2 + X(5) * EVAP_TEMP(I) * COND_TEMP(I)
3 + X(6) * COND_TEMP(I) * COND_TEMP(I)
4 + X(7) * EVAP_TEMP(I) * EVAP_TEMP(I) * EVAP_TEMP(i)
5 + X(8) * EVAP_TEMP(I) * EVAP_TEMP(I) * COND_TEMP(i)
6 + X(9) * EVAP_TEMP(I) * COND_TEMP(I) * COND_TEMP(i)
7 + X(10) * COND_TEMP(I) * COND_TEMP(I) * COND_TEMP(i)
C
VALUE_DIFF(I) = ( VALUE(I) - CALC_VALUE(I) ) /
1 VALUE(I) * 100.0
900 CONTINUE
C
C******** Print the results of the comparison to screen **********************************
C
I=1

17
ANSI/ARI STANDARD 540-1999

DO WHILE (I .LT. 11 .AND. I .LE. NUMBER)


WRITE (6, '(F6.1, 2F8.1, 2F13.2, F10.2, )' ) DATANO(I),
1 EVAP_TEMP(I), COND_TEMP(I), VALUE(I), CALC_VALUE(I),
2 VALUE_DIFF(I)
I=I+1
END DO
WRITE (6, '( ' ' ' ')' )
C
IF (Iout .NE. 1) then
pause
end if
C
C******************** PRINT ONE SCREEN AT A TIME ****************************
C
DO WHILE (I .LE. NUMBER)
C
WRITE (6, '(/ ' ' RUN EVAP. COND.' ',
1 ' ' ******COMPRESSOR PERFORMANCE ****** ' ', /
1 ' ' # TEMP. TEMP.' ',
2 ' ' INPUT CALCULATED % DIFF.' ')' )
C
number_page = I + 19
DO WHILE(I .LT. number_page .AND. I .LE. NUMBER)
WRITE (6, '( F6.1, 2F8.1, 2F13.2, F10.2,)' 0 DATANO(I),
1 EVAP_TEMP(I), COND_TEMP(I), VALUE(I), CALC_VALUE(I),
2 VALUE_DIFF(I)
I=I+1
END DO
WRITE (6, '(' ' ' ')' )
C
C IF (Iout .NE. 1) then
pause
End if
C
END TO
C
IF(Iout .NE. 1) then
go to 200
End if
CC
1000 STOP
END

18
ANSI/ARI STANDARD 540-1999

C DATE 7-15-88
C FILENAME SURFACO3.FOR
C
C Purpose:
C
C This subroutine does the basic calculations for the
C program SURFACEC.FOR which reads the compressor performance
C values and performs a least squares curve fit with a ten
C coefficient equation.
C
C Reference: Stoecker, W, F. 1980, "Design of Thermal Systems",
C Second Edition, McGraw-Hill Book Company, New York,
C New York.
C
C Subroutines required: SOLVES10.FOR
C
C The Method of Least Squares for establishing the
C coefficients of an equation is defined as the best fit in
C which the sum of the squared values of the deviations between
C the data points and the calculated values is a minimum.
C
C This method will only be explained using a linear equation as an
C example. The "Ten Coefficient Equation" of section 5.3 carries
C same principles and the steps of the solution are explained
C throughout the program.
C
C Linear example: Y = A0 + A1 + X
C
C For a given set of data values of X and Y, the objective is
C to fine A0 and A1 so that the deviation between the data
C values and the value calculated by the above equation are at
C a minimum.
C
C Deviation = A0 + A1 * X - Y
C
C The Sum of the Least Squares curve is the curve in which
C the summation of the deviation squared is a minimum.
C

(A0 + A1 * Xi - Yi)2 3 minimum

C The minimum occurs when the partial derivatives of the above


C equation with respect to A0 and A1 are equal to 0.
C

19
ANSI/ARI STANDARD 540-1999

C
The above two equations can be expressed in matrix equation
C form after dividing by two and separating into individual
C terms as follows.

C This matrix can now be solved for A0 and A1 by gaussian elimination.


C
C
C
C
SUBROUTINE SURFAC ( NUMBER, X )
C
C
C INPUT REQUIRED:
C
C Number = The number of data points
C
C Evap_Temp = The saturated suction temperature
C
C Cond_Temp = The saturated discharge temperature
C
C OUTPUT:
C
C X = The array X contains the ten equation coefficients
C
C
C**************** Initialize ******************************************************

20
ANSI/ARI STANDARD 540-1999

C
COMMON EVAP_TEMP(150), COND_TEMP(150), VALUE(150)
C
REAL*4 A(10), 10), B(10), X(10)
C
C
C**************** Test print of the input data ****************************************
C
C DO 200 I = I, NUMBER
C
C WRITE (6,110) EVAP_TEMP(I), COND_TEMP(I), VALUE(I)
C100 FORMAT('0 EVAP_TEMP COND_TEMP(I), VALUEVALUE' / 3E16.4)
C200 CONTINUE
C
C**************** Initialize all the summation required *********************************
C
SUM_M = 0.0
SUM_X1 = 0.0
SUM_X2 = 0.0
SUM_X3 = 0.0
SUM_X4 = 0.0
SUM_X5 = 0.0
SUM_X6 = 0.0
C
SUM_X1_Y1 = 0.0
SUM_X2_Y1 = 0.0
SUM_X3_Y1 = 0.0
SUM_X4_Y1 = 0.0
SUM_X5_Y1 = 0.0
C
SUM_X1_Y2 = 0.0
SUM_X2_Y2 = 0.0
SUM_X3_Y2 = 0.0
SUM_X4_Y2 = 0.0
SUM_X5_Y2 = 0.0
C
SUM_X1_Y3 = 0.0
SUM_X2_Y3 = 0.0
SUM_X3_Y3 = 0.0
C
SUM_X1_Y4 = 0.0
SUM_X2_Y4 = 0.0
C
SUM_X1_Y5 = 0.0

21
ANSI/ARI STANDARD 540-1999

C
SUM_Y1 = 0.0
SUM_Y2 = 0.0
SUM_Y3 = 0.0
SUM_Y4 = 0.0
SUM_Y5 = 0.0
SUM_Y6 = 0.0
C
C**************** Initialize the summations with Zi ***********************************
C
SUM_Z = 0.0
SUM_X1_Z = 0.0
SUM_X2_Z = 0.0
SUM_Y1_Z = 0.0
SUM_X1_Y1_Z = 0.0
SUM_X2_Y1_Z = 0.0
SUM_Y2_Z = 0.0
SUM_X1_Y2_Z = 0.0
SUM_X3_Z = 0.0
SUM_X3_Z = 0.0
C
C************* The following loop is for each set of input data ***************************
C
DO 300 I = 1, NUMBER
C
C************* Calculate the base of the summations ***********************************
C
WRITE(6, '( ' ' TEST EARLY IN LOOP I = ' ', I3 )' ) I
C
XI = EVAP_TEMP(1)
XI_SQUARED = EVAP_TEMP(I) * XI
XI_CUBED = EVAP_TEMP(I) * XI_SQUARED
XI_FOURTH = EVAP_TEMP(I) * XI_CUBED
XI_FIFTH = EVAP_TEMP(I) * XI_FOURTH
XI_SIXTH = EVAPTEMP(I) * XI_FIFTH
C
YI = COND_TEMP(I)
YI_SQUARED = COND-TEMP(I) * YI
YI_CUBED = COND_TEMP(I) * YI_SQUARED
YI_FOURTH = COND_TEMP(I) * YI_CUBED
YI_FIFTH = COND_TEMP(I) * YI_FOURTH
YI_SIXTH = COND_TEMP(I) * YI_FIFTH
C
ZI = VALUE(I)

22
ANSI/ARI STANDARD 540-1999

C
C WRITE(6, ' ( ' ' Test after base sums I = ' ', 13 )' ) I
C
C************* Calculate all of the summations required ********************************
C
SUM_M = SUM_M +1.0
SUM_X1 = SUM_X1 + XI
SUM_X2 = SUM_X2 +XI_SQUARED
SUM_X3 = SUM_X3 +XI_CUBED
SUM_X4 = SUM_X4 +XI_FOURTH
SUM_X5 = SUM_X5 +XI_FIFTH
SUM_X6 = SUM_X6 +XI_SIXTH
C
SUM_X1_Y1 = SUM_X1_Y1 + XI * YI
SUM_X2_Y1 = SUM_X2_Y1 + XI_SQUARED * YI
SUM_X3_Y1 = SUM_X3_Y1 + XI_CUBED * YI
SUM_X4_Y1 = SUM_X4_Y1 + XI_FOURTH * YI
SUM_X5_Y1 = SUM_X5_Y1 +XI_FIFTH * YI
C
SUM_X1_Y2 = SUM_X1_Y2 + XI * YI_SQUARED
SUM_X2_Y2 = SUM_X2_Y2 + XI_SQUARED * YI_SQUARED
SUM_X3_Y2 = SUM_X3_Y2 + XI_CUBED * YI_SQUARED
SUM_X4_Y2 = SUM_X4_Y2 + XI_FOURTH * YI_SQUARED
C
SUM_X1_Y3 = SUM_X1_Y3 + XI * YI_CUBED
SUM_X2_Y3 = SUM_X2_Y3 + XI_SQUQRED * YI_CUBED
SUM_X3_Y3 = SUM_X3_Y3 + XI_CUBED * YI_CUBED
C
SUM_X1_Y4 = SUM_X1_Y4 + XI_ * YI_FOURTH
SUM_X2_Y4 = SUM_X2_Y4 + XI_SQUARED * YI_FOURTH
C
SUM_XI_Y5 = SUM_X1_Y5 + XI * YI_FIFTH
C
SUM_Y1 = SUM_Y1 + YI
SUM_Y2 = SUM_Y2 + YI_SQUARED
SUM_Y3 = SUM_Y3 + YI_CUBED
SUM_Y4 = SUM_Y4 + YI_FOURTH
SUM_Y5 = SUM_Y5 + YI_FIFTH
SUM_Y6 = SUM_Y6 + YI_SIXTH
C
SUM_Z = SUM_Z + ZI
SUM_X1_Z = SUM_X1_Z + XI * ZI
SUM_X2_Z = SUM_X2_Z + XI_SQUARED * ZI
SUM_X3_Z = SUM_X3_Z + XI_CUBED * ZI

23
ANSI/ARI STANDARD 540-1999

SUM_Y1_Z = SUM_Y1_Z + YI * ZI
SUM_X1_Y1_Z = SUM_X1_Y1_Z + XI * YI * ZI
SUM_X2_Y1_Z = SUM_X2_Y1_Z + XI_SQUARED * YI * ZI
SUM_Y2_Z = SUM_Y2_Z + YI_SQUARED * ZI
SUM_Y3_Z = SUM_Y3_Z + YI_CUBED * ZI
SUM_X1_Y2_Z = SUM_X1_Y2_Z + XI * YI_SQUARED * ZI
C
C WRITE(6, '( ' ' Test at the end of sums I = ' ', I3 )' ) I
C
300 CONTINUE
C
C**************** Set up the B array of the matrix *********************************
C
B(1) = SUM_Z
B(2) = SUM_X1_Z
B(3) = SUM_Y1_Z
B(4) = SUM_X2_Z
B(5) = SUM_X1_Y1_Z
B(6) = SUM_Y2_Z
B(7) = SUM_X3_Z
B(8) = SUM_X2_Y1_Z
B(9) = SUM_X1_Y2_Z
B(10) = SUM_Y3_Z
C
C
C************* Print out values of the orginal equations *****************************
C
C WRITE(6, '( / 1X, 1P10E12.3 // )') (B(I), I = 1, 10)
C
C******* Calculate partial derivative of the deviation squared **************************
C******* with respect to C1 for the first row of the matrix *****************************
C
A(1,1) = SUM_M
A(1,2) = SUM_X1
A(1,3) = SUM_Y1
A(1,4) = SUM_X2
A(1,5) = SUM_X1_Y1
A(1,6) = SUM_Y2
A(1,7) = SUM_X3
A(1,8) = SUM_X2_Y1
A(1,9) = SUM_X1_Y2
A(1,10) = SUM_Y3
C
C******* Calculate partial derivative of the deviation squared **************************

24
ANSI/ARI STANDARD 540-1999

C******* with respect to C2 for the 2'nd row of the matrix ****************************
C
A(2,1) = SUM_X1
A(2,2) = SUM_X2
A(2,3) = SUM_X1_Y1
A(2,4) = SUM_X3
A(2,5) = SUM_X2_Y1
A(2,6) = SUM_X1_Y2
A(2,7) = SUM_X4
A(2,8) = SUM_X3_Y1
A(2,9) = SUM_X2_Y2
A(2,10) = SUM_X1_Y3
C
C******* Calculate partial derivative of the deviation squared **************************
C******* with respect to C3 for the 3'rd row of the matrix *****************************
C
A(3,1) = SUM_Y1
A(3,2) = SUM_X1_Y1
A(3,3) = SUM_Y2
A(3,4) = SUM_X2_Y1
A(3,5) = SUM_X1_Y2
A(3,6) = SUM_Y3
A(3,7) = SUM_X3_Y1
A(3,8) = SUM_X2_Y2
A(3,9) = SUM_X1_Y3
A(3,10) = SUM_Y4
C
C******* Calculate partial derivative of the deviation squared **************************
C******* with respect to C4 for the 4'th row of the matrix *****************************
C
A(4,1) = SUM_X2
A(4,2) = SUM_X3
A(4,3) = SUM_X2_Y1
A(4,4) = SUM_X4
A(4,5) = SUM_X3_Y1
A(4,6) = SUM_X2_Y2
A(4,7) = SUM_X5
A(4,8) = SUM_X4_Y1
A(4,9) = SUM_X3_Y2
A(4,10) = SUM_X2_Y3
C
C******* Calculate partial derivative of the deviation squared **************************
C******* with respect to C5 for the 5'th row of the matrix *****************************
C

25
ANSI/ARI STANDARD 540-1999

A(5,1) = SUM_X1_Y1
A(5,2) = SUM_X2_Y1
A(5,3) = SUM_X1_Y2
A(5,4) = SUM_X3_Y1
A(5,5) = SUM_X2_Y2
A(5,6) = SUM_X1_Y3
A(5,7) = SUM_X4_Y1
A(5,8) = SUM_X3_Y2
A(5,9) = SUM_X2_Y3
A(5,10) = SUM_X1_Y4
C
C******* Calculate partial derivative of the deviation squared **************************
C******* with respect to C6 for the 6'th row of the matrix *****************************
C
A(6,1) = SUM_Y2
A(6,2) = SUM_X1_Y2
A(6,3) = SUM_Y3
A(6,4) = SUM_X2_Y2
A(6,5) = SUM_X1_Y3
A(6,6) = SUM_Y4
A(6,7) = SUM_X3_Y2
A(6,8) = SUM_X2_Y3
A(6,9) = SUM_X1_Y4
A(6,10) = SUM_Y5
C
C******* Calculate partial derivative of the deviation squared **************************
C******* with respect to C7 for the 7'th row of the matrix *****************************
C
A(7,1) = SUM_X3
A(7,2) = SUM_X4
A(7,3) = SUM_X3_Y1
A(7,4) = SUM_X5
A(7,5) = SUM_X4_Y1
A(7,6) = SUM_X3_Y2
A(7,7) = SUM_X6
A(7,8) = SUM_X5_Y1
A(7,9) = SUM_X4_Y2
A(7,10) = SUM_X3_Y3
C
C******* Calculate partial derivative of the deviation squared **************************
C******* with respect to C8 for the 8'th row of the matrix *****************************
C
A(8,1) = SUM_X2_Y1
A(8,2) = SUM_X3_Y1

26
ANSI/ARI STANDARD 540-1999

A(8,3) = SUM_X2_Y2
A(8,4) = SUM_X4_Y1
A(8,5) = SUM_X3_Y2
A(8,6) = SUM_X2_Y3
A(8,7) = SUM_X5_Y1
A(8,8) = SUM_X4_Y2
A(8,9) = SUM_X3_Y3
A(8,10) = SUM_X2_Y4
C
C******* Calculate partial derivative of the deviation squared **************************
C******* with respect to C9 for the 9'th row of the matrix *****************************
C
A(9,1) = SUM_X1_Y2
A(9,2) = SUM_X2_Y2
A(9,3) = SUM_X1_Y3
A(9,4) = SUM_X3_Y2
A(9,5) = SUM_X2_Y3
A(9,6) = SUM_X1_Y4
A(9,7) = SUM_X4_Y2
A(9,8) = SUM_X3_Y3
A(9,9) = SUM_X2_Y4
A(9,10) = SUM_X1_Y5
C
C******* Calculate partial deivative of the deviation squared ***************************
C******* with respect to C10 for the 10'th row of the matrix ***************************
C
A(10,1) = SUM_Y3
A(10,2) = SUM_X1_Y3
A(10,3) = SUM_Y4
A(10,4) = SUM_X2_Y3
A(10,5) = SUM_X1_Y4
A(10,6) = SUM_Y5
A(10,7) = SUM_X3_Y3
A(10,8) = SUM_X2_Y4
A(10,9) = SUM_X1_Y5
A(10,10) = SUM_Y6
C******************** TEST PRINT OF MATRIX ********************************
C
C DO 99J = 1, 10
C WRITE (6, 98) (A(J, I), I = 1, 10)
C98 FORMAT( 1X, 1P10E12.3)
C99 CONTINUE
C
C******************* Call the simultaneous equations subroutine *********************

27
ANSI/ARI STANDARD 540-1999

C******************* which uses gaussian elimination to find X **********************


C
NORDER = 10
CALL SOLVES (A, B, X, NORDER)
C
C*********** PRINT OUT THE RESULTS OF THE SUBROUTINE ******************
C
C WRITE (6, '( 1P10E12.5 )' ) (X(I), I = 1, 10 )
C
RETURN
END

C FILENAME Solves 10.for


C
C
C
C This SUBROUTINE Solves for simultaneous equations
C with a maximum order of 10. The method of solution is
C Gaussian Elimination which consists of two major steps:
C 1. Triangularization
C 2. Back substitution
C
C SUBROUTINE SOLVES (MATRIX_A, B, X, N)
C
C Input required:
C
C MATRIX A = The input matrix requiring solution
C
C B = The vector of the Matrix
C
C N = The order of the Matrix
C
C Output:
C
C X = The array X contains solution constants of the Matrix
C
C
C
REAL*4 MATRIX_A(10, 10), X(10), B(10), TEMPORARY_A(10,10)
REAL*4 TEMPORARY_B(10)
INTEGER*2 COLUMN, ROW
C
C********** Test print of input Matric_A and vector B *******************************

28
ANSI/ARI STANDARD 540-1999

C WRITE(6, '(/ ' 'Test print of input Matrix_A' ' /)' )


C WRITE(6, '( 1P10E12.3, E16.3)' ) ( (MATRIX_A(J, I), I = 1, 10),
C 1 B(J), J = 1, 10)
C
DO 30 K = 1, N
M=K
C
C**************** This test is to determine if any **********************************
C************** of the values on the diagnoal of MATRIX_A ************************
C**************** are equal to 0.0 **********************************************
C
10 IF ( ABS (MATRIX_A(K,K) ) .LE. 0.0000001) THEN
M=M+1
C
C************** Test to see if there is another row available **************************
C************** that can be interchanged with K ***********************************
C
IF ( M .GT. N ) THEN
WRITE (*, '( ' ' Equations are not independent' ') ' )
RETURN
END IF
C
C************** If row M does not have a zero on the diagonl ************************
C************** then try a different row ******************************************
C
If (ABS(MATRIX_A(M,K) ) .LE. 0.0000001 THEN
GO TO 10
ELSE
C
C************** If row M does not have a zero on the diagonal ***********************
C***************** then interchange rows M and K ********************************
C
TEMPORARY_B(K) = B(K)
B(K) = B(M)
B(M) = TEMPORARY_B(K)
C
DO 18 J = K, N
TEMPORARY_A(K,J) = MATRIX_A(K,J)
MATRIX_A(K,J) = MATRIX_A(M,J)
MATRIX_A(M,J) = TEMPORARY_A(K,J)
18 CONTINUE
C
C****************** Test print of M and K ***************************************
WRITE(6, '(/ ' ' Rows ' ', 2, ' ' and ' ' , I2,

29
ANSI/ARI STANDARD 540-1999

C 1 ' 'have been interchanged' ')' ) K, M


C
END IF
END IF
C
C********** Triangularize the matrix *********************************************
C********* Eliminate the current column below the diagonal ***************************
C
KPLUS = K + 1
C
IF (K .LT. N) THEN
C
DO 26 ROW = KPLUS, N
RATIO = MATRIX_A(ROW,K) / MATRIX_(K,K)
B(ROW) = B (ROW) - B(K) * RATIO
C
DO 24 COLUMN = K, N
MATRIX_A(ROW,COLUMN) - MATRIX_A(ROW,COLUMN) -
1 MATRIX_A(K,COUMN)*RATIO
24 CONTINUE
C
26 CONTINUE
C
C********* Test print after triangularization ***************************************
C WRITE(6, '(/ ' ' Test print after triangularization ' ' /)' )
C WRITE(6, ' ( 1P10E12.3, E16.3)' ) (MATRIX_A(J, I), I = 1, 10),
C 1 B(J), J = 1, 10)
C
END IF
30 CONTINUE
C
C*********** Triangularization is complete, now use ********************************
C*********** back substitution to determine the coefficients ***************************
C
L=N
32 SUM = 0.0
IF (L .LT. N) THEN
LPLUS = L + 1
C
DO 36 COLUMN = LPLUS, N
SUM = SUM + MATRIX_A(L, COLUMN) * X(COLUMN)
36 CONTINUE
C
END IF

30
ANSI/ARI STANDARD 540-1999

C
X(L) = (B(L) - SUM) / MATRIX_A(L,L)
C
IF (L .GT. 1) THEN
L=L-1
GO TO 32
END IF
C
C*********** Test print of results (coefficients) *************************************
C WRITE(6, ' (/ ' ' Test print of results' ' )' )
C WRITE(6, '(1P10E12.3)' ) (X(I), I = 1, 10)
C
RETURN
END
C
C
C FILENME CMPHLP01.FOR DATE: 4-12-90
C
C
C THIS PROGRAM WILL READ HELP INFORMATION FROM THE README.DOC
C FILE WILL SEARCH AND DISPLAY THE TEXT ONTO THE SCREEN.
C
C THIS PROGRAM WAS WRITTEN FOR ARI STANDARD 540P "METHOD
C FOR PRESENTATION OF COMPRESSOR PERFORMANCE DATA."
C
C SUBROUTINES REQUIRED: None
C
C Required support files: README.DOC
C
C Optional support files: None
C
C Revision Hisory: Revised: 5-15-91
C Revised to include a Reference:
C
C INPUT:
C
C SRCH1 = A CHARACTER VARIABLE OF LENGTH 10 This can be used to
C pass a search string to provide a predetermined type of
C help message.
C
C OUTPUT:
C
C All output is displayed to the screen.
C

31
ANSI/ARI STANDARD 540-1999

C************** INITIALIZE **************************************************


C
Subroutine emph1p (SRCH1)
CHARACTER*10 SEARCH, SRCH1
CHARACTER*75 TITLE1, TITLE2, TITLE3, TITLE4, HELP(15)
CHARACTER*10 S1, S2, S3, S4, S5, S6, S7, S8, S9, S0
CHARACTER*1 cmdchr, dummy
C
open (3, file = 'README.DOC', STATUS = 'OLD' )
C
5 REWIND (3)
DO 1, I = 1, 15
HELP(i) = ' '
1 CONTINUE
C
READ (3, 200) TITLE1, TITLE2, TITLE3, TITLE4
200 FORMAT (T6, A75)
READ (3, 95) S1, S2, S3, S4, S5, S6, S7, S8, S9, SO
95 FORMAT ( T6, A10, T21, A10, T36, A10,
1 T51, A10, T66, A10, /
2 T6, A10, T21, A10, T36, A10
3 T51, A10, T66, A10)
C
READ (3, 200, END = 5) (HELP (I), I = 1, 15)
C
10 IF (SRCH1 .NE. ' ') THEN
CMDCHR = 'S'
SRCH1 = ' '
C
ELSE
WRITE (6, '(T2, A75 )' ) TITLE1, TITLE2, TITLE3, TITLE4
WRITE (6, 100) S1, S2, S3, S4, S5, S6, S7, S8, S9, S0
100 FORMAT ( /, ' 1 - ", A10, ' 2 - ', A10, '3 - '. A10,
1 ' 4 - ', A10, ' 5 - ', A10, /
2 ' 6 - ', A10, ' 7 - ', A10, ' 8 - ', A10,
3 ' 9 - ', A10, ' 0 - ', A10, / )
C
WRITE (6, '(T2, A75 )' ) (HELP(I), I = 1, 15)
Write(6, '( / )')
WRITE (6, '(' ' 0-9 = Help topic, N = Next, P = Previous, ' ',
' ' R = Return to menu, q = Quit' ' \)' )
READ 5, '(A1)' ) CMDCHR
END IT
C

32
ANSI/ARI STANDARD 540-1999

DO 2, I = 1, 15
HELP(i) = ' '
2 CONTINUE
C
C
C***************** USE Select cas End Select to control help ************************
C
SELECT CASE (CMDCHR)
C
CASE('1')
REWIND (3)
read (3, '(6(/), al )') dummy
DO WHILE (SEARCH .NE. S1)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE ('2')
REWIND (3)
DO WHILE (SEARCH .NE. S2)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE ('3')
REWIND (3)
DO WHILE (SEARCH .NE. S3)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE ('4')
REWIND (3)
DO WHILE (SEARCH .NE. S4)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE('5')
REWIND (3)
DO WHILE (SEARCH .NE. S5)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3

33
ANSI/ARI STANDARD 540-1999

C
CASE('6')
REWIND (3)
read (3, '(6(/), al )' ) dummy
DO WHILE (SEARCH .NE. S6)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE('7')
REWIND (3)
DO WHILE (SEARCH .NE. S7)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE('8')
REWIND (3)
DO WHILE (SEARCH .NE. S8)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE('9')
REWIND (3)
DO WHILE (SEARCH .NE. S9)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE('0')
REWIND (3)
DO WHILE (SEARCH .NE. S0)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE('S', 's')
DO WHILE (SEARCH .NE. SRCH1)
READ (3, '(T6, A10 )', END = 5) SEARCH
END DO
BACKSPACE 3
C
CASE('P', 'p')

34
ANSI/ARI STANDARD 540-1999

DO 300 = 1, 30
BACKSPACE 3
300 CONTINUE
C
300
C
CASE('N', 'n')
SRCH1 = ' '
C
CASE('q', 'Q')
CLOSE (3)
RETURN
C
CASE('R', 'r')
CLOSE (3)
RETURN
C
END SELECT
C
READ (3, 200, END = 5) HELP(I), I = 1, 15)
C
GO TO 10
C
C

35

You might also like