unclassified 1iiii,e army caad conicepts analysis … · 2014-09-27 · caa-d-8o- 1 silcurity...
TRANSCRIPT
A -A GG 653 ARMY CONICEPTS ANALYSIS AGENCY BETHESDA MD F/6 /2PR06TEST: A COMPUTER SYSTEM FOR THE ANALYSIS OF COMPUTATIONAL C-ETC(U)U N D A P R 8 0 S R A V Y
UNCLASSIFIED CAAD 80-11IIII,E EIImuuuuuuuuuuuE-EEEEEllllEI*innnllllllllnI-EIIEIIIIEEEE-EEEEEEEEEIE-im/EEEEEEEEE/
DISCLAIMER
The findings in this document are not be construedas an official Department of the Army position unless sodesignated by other authorized documents. Commients orsuggestions should be addressed to:
CommnanderUISA Concepts Analysis AgencyATTN: Director of Methodology and Computer
Support8120 Woodmont AvenueBethesda, Maryland 20014
CAA-D-8O- 1
SILCURITY CLASSIFI('-TlrTh OF THIIS -AGE rWhen Data* E.-d)
REPORT DOCUMENTATION PAGE BFRE COINSTuCTINS o
CAA0-8-2. GOVT ACCESSION NO. 3. RECIPIENT'S CATALOG NUMBER
e&£ ZQLWgATAFLBI D COVERED
' ~PR0GTEST: A Computer System for the Analysis %OCU1ENTATION
S. PERFORMING ORO. REPORT NUMBER
7. j.OWNe2 S. CONTRACT OR GRANT NUMBER(.)
D teve ravY
T. PERFORMING ORGANIZATION NAME AND ADDRESS 10. PROGRAM ELEMENT. PROJECT. TASK
US Army Concepts Analysis Agency AREA II WORK UNIT NUMBERS
8120 Woodmont AvenueBc~hesda. Maryland 20014 __________________
It. CONTROLLING OFFICE NAME AND ADDRESS 4.Methodology and Computer Support Directorate /2 Aprf 0l80?US Army Concepts Analysis Agency J3. NUMBERarOFVGES
8120 Woodmont Avenue, Bethesda, MD 20014 13014. O N AGENCY NME & DR Sill diffeet front Cc'nftoiIlfl Ollie*) 1S. SECURITY CLASS. (of 0.1e te.po)
Unclassified_________________________________________ IS. OECLASSIFICATIONOOWNGRADIiiG
16. DIT1 UJI STTMN @ tl eof
Distribution Unlimited
17. DISTRIBUTION STATEMENT (of the abstract enlted In Slock 20. it different free. Report)
IS. SUPPLEMENTARY NOTES
1S. KEY WORDS (Coninuae an rev.ee side it necessary md Identify by IN ock numeber)
Computer debugging, computer benchmarking,1 computer program, computer routinetesting package, computer aided diagnosis, computer program reliability, com-puter program verification, software diagnosis, software testing, softwarereliability, software verification, model testing, model diagnosis, modelrelabilit., model verification.
This system assists the testing and debugging of computational computerprograms by generating test points for the tested program at each test point.This information may be used to infer the operation of, or to predict outputvalidet df an 6peratinal prbgram'as well. The performance data highlightinginput variable sensitivities is analyzed further by one of the components ofthe system. ------ 40vr),
DD FOR 1473 EWe-oN OF I NOV SW IS OBNSOLETE UCASfE.
SECURITY CLASIFICATION OF THIS PAGE (Nh.,, Dae. ne.f
CAA-D-80- 1
I -INC AcSTItEnSECURITY CLAS3IFICA FION OF TF-IS pA'K'' . D.Is KnIet~d)
20. Abstract (continued)
This writeup contains complete documentation of the system. including descrip-tion of the methodology, sample outputs, flowcharts and listincs.
The package is written in UINIVAC's FORTRAN V.
Acces'siof
0nal all2 C ed
'- i
UNCLASSIFIEDSECURITY CLASSIF(CArioN OF TIlS PAGLrII7,. PI. EMs..s.d)
DOCUMENTATIONCAA-D-80-1
PROGTEST: A COMPUTER SYSTEM FOR THE ANALYSIS OF
COMPUTATIONAL COMPUTER PROGRAMS
April 1980
Prepared by
.Meth~docrgy and Computer -Support Directorate .
US Army Concepts Analysis Agency8120 Woodmont Avenue
Bethesda, Maryland 20014
CAA-D-80-1
ABSTRACT
1. PROGTEST. This Computer System for the Analysis of Computa-tional Computer Programs consists of three interrelated subsys-tems:
POINTCOMP consisting of the major components POINTCOMPand VARVARY1
ANALYZ containing the ANALYZ routine
GRID consisting of the GRID, REARRANGE and DIFFQUOTroutines as major components
2. POINTCOMP
a. The POINTCOMP routine of the POINTCOMP subsystem utilizesthe method of steepest ascent/descent to generate input variablevalues maximizing/minimizing the output of the program beingtested (one output at a time). The points generated by the rou-tine are printed out and may be used by the analyst to determinewhether increasing or decreasing thp variable increases/decreasesthe output, or whether a maximum/minimum is reached. The routinealso prints out sensitivity information usable by the analyst indetermining the comparative effect of each variable upon the out-put variable. Points generated by this routine are used as inputby some of the other subsystems.
b. The VARVARY1 component of the POINTCOMP subsystem uses in-put variable values produced by POINTCOMP or chosen by the ana-lyst. For each combination produced or chosen by the analyst,each variable is varied uniformly through a range while keepingthe other variables fixed. The tested routine is evaluated ateach new point and the gradient is computed at each new point. Inaddition, statistics showing the average marginal return overvarious portions of the variables range are printed out. The out-put of this program can be used to generate curves showing the ef-fect of the variable being varied upon the output.
3. ANALYZ. The ANALYZ subsystem uses a file of gradients as in-put. This type of file is produced by several subsystems. Thesubsystem computes and outputs sensitivity statistics derived fromthe gradients.
iii
CAA-D-80-1
4. GRID. The GRID routine of the GRID subsystem utilizes a userdefined grid to intensively analyze a small area of input values.The subsystem evaluates the routine to be tested at each node inthe grid, and prints out the input values, the evaluated values,and the gradients at each point. The REARRANGE routine of theGRID subsystem rearranges the data to show the variable by vari-able variation, and the DIFFQUOT routine computes difference quo-tients for the generated points for one variable at a time.
iv
CAA-D-80- 1
CONTENTS
Page
ABSTRACT ............................................. ii
CHAPTER
1 OUTLINE OF SUBSYSTEMS .......................... 1-1
Subsystem Descriptions ......................... 1-1POINTCOMP Subsystem .......................... 1-1ANALYZ Subsystem............................. 1-2GRID Subsystem............................... 1-3
Description of Subsystems....................... 1-5Subsystem Inputs and Outputs................... 1-5Standard File Structure ........................ 1-7
2 THE POINTCOMP SUBSYSTEM ........................ 2-1
Section 1. THE POINTCOMP ROUTINE............... 2-1Introduction................................. 2-1Background..................2-1Discussion ofMtoooy..........2-3Limitations ................................. 2-3Run Setups .................................. 2-4Output Descriptions and Sample Output ..... 2-8POINTCOMP Routine Listing .................... 2-12POINTCOMP Routine Flowchart .................. 2-18
Section 11. THE VARVARY1 ROUTINE.............. 2-25Introduction ................................ 2-25Limitations ................................. 2-25Run Setup ...:..:...............2-25Output Description and *Sample Output'."......2-29VARVARY1 Routine Listing ..................... 2-38VARVARYl Routine Flowchart ................... 2-40
3 THE ANALYZ SUBSYSTEM ........................... 3-1
Introduction....... ......................... 3-1Discussion of Statistics ....................... 3-1Limitations ................................... 3-1Run Setups ...................... 3-1Output Description and*Sample*Output ............. 3-3 ..
ANALYZ Routine Listing ......................... 3-6ANALYZ Routine Flowchart....................... 3-11
V
CMA-D-80- 1
C HA PTER Page
4 THE GRID SUBSYSTEM ............................. 4-1
Section I. THE GRID ROUTINE .................... 4-1Introduction................................ 4-1Limitations................................. 4-1Run Setups..................................4-1Output Descriptions and Sample Output ........... 4-4GRID Routine Listing.......................... 4-8GRID Routine Flowchart ....................... 4-11
Section II. THE REARRANGE ROUTINE .............. 4-16Introduction .................... 4-16Limitations ............................ i 4-16Run Setups................ i................. 4-16Output Descriptions and Sample Output .......... 4-19REARRANGE Routine Listing..................... 4-23REARRANGE Routine Flowchart................... 4-25
Section III. THE DIFFQUOT ROUTINE .............. 4-29Introduction................................ 4-29Background ................................. 4-29Limitations ................................ 4-29Run Setups......................4-29DIFFQUOT Routine Listing...................... 4-33DIFFQUOT Routine Flowchart.................... 4-35
5 COMMON SULROUTINES............................ 5-1
Introduction ................................. 5-1
Section I. THE PARTL SUBROUTINE ................ 5-1Introduction................................ 5-1Background ................................. 5-1Discussion of Methodology..................... 5-1Limitations................................. 5-2Calling Sequence ........................ 5-2PARTL Subroutine Listing...................... 5-3PARTL Subroutine Flowchart.................... 5-4
Section II. THE PREPR DRIVER SUBROUTINE .......... 5-6Introduction................................ 5-6Discussion ....................... 5-6
* RPRLa~out ... . ... ..................
APPENDIX
A CONTRIBUTORS................................. A-1B DISTRIBUTION................................. B-i
vi
CAA-D-80-1
PROGTEST: A COMPUTER SYSTEM FOR THE ANALYSIS OFCOMPUTATIONAL COMPUTER PROGRAMS
CHAPTER 1
OUTLINE OF SUBSYSTEMS
1-1. SUBSYSTEM DESCRIPTIONS
a. POINTCOMP Subsystem
(1) POINTCOMP. The POINTCOMP routine of the POINTCOMP sub-system creates input variable values by using maximum ascent/de-scent techniques to maximize/minimize the output of the programbeing tested. The output from POINTCOMP includes:
(a) A file in standard format for which data lines arecomprised of variable values and the corresponding value of theprogram being tested. This file is created on FORTRAN unit 10 andis one possible input to VARVARYI. FORTRAN allows usage of a diskfile as on I/0 unit.
(b) A file of the corresponding gradients in standard for-mat on FORTRAN unit 11.
(c) A listing containing the new points and the corre-sponding program values, the gradients, and the computed incre-ments is produced on the printer.
(d) The subsystem includes the following routines:
1. POINTCOMP.
2. PARTL.
3. PREPR.
4. The program to be tested.
(2) VARVARYI. The VARVARY1 component of the POINTCOMP sub-system takes the file created by POTNTCOMP on unit 10 as input ora similarly structured user provided file. The user must also in-put a fil containiRg hgher. and Jower bou-nds-and inccements.for..each variable. VARVARYl will read in each line of the unit 10file and from each point inputted VARVARYI creates new points byvarying each variable in turn through the given range using the
1-1
IJCAA-D-80-1
given increment keeping the other values fixed. For each newpoint, the program to be tested is evaluated and the point and thecorresponding tested program value are printed out.
(3) In addition, The VARVARY1 routine computes the gradientat each new point and prints its components. The new points andthe corresponding tested routine values are written out on unit 12and the corresponding gradients are written out on unit 11. Whenone variable is varied and the others held constant, the differ-ence in the output values divided by the difference in the variedvariable values is called the difference quotient. As theVARMARf routine varies a variable through its range, various com-binations of difference quotients are computed and printed forthat variable.
(4) The output from the VARVARYl routine includes:
(a) A listing of the new input points and the associatedoutput values of the routine being tested. This listing also con-tains the difference quotients.
(b) A listing of the corresponding gradients.
(c) A file containing the new gradients in standard formaton unit 11.
(d) A file containing the new generated points in standardformat on unit 12.
(e) A scratch file containing input variable values andthe associated output values on unit 14.
(f) The subsystem includes the following routines:
1. VARVARYl.
2. PARTL.
3. PREPR.
4. The program being tested.
b. ANALYZ Subsystem. This subsystem analyzes a file of gradi-ents instandard fo at on unit 11 produced by the POINTCOMP,VARVARYI, or GRID subsystem. The statistics produced include:
(1) For each gradient, the ratio of every component to theminimum component in absolute value.
1-2
CAA-D-80-1
(2) For each component of each gradient the chanqe needed inthe corresponding variable in order to change the output by oneunit.
(3) For each component of each gradient:
(a) If the component is not the largest in absolute value,the ratio of the component to the absolute value of the maximalcomponent.
(b) For the maximal component, the ratio of the absolutevalue of the maximal component to the absolute value of the nextlargest components.
(4) The gradients are also aggregated component by component,and statistics (1) to (3) described above are computed for theaggregate vector.
(5) The output from ANALYZ includes a listing of the statis-tics described above.
(6) The subsystem includes the following routine: ANALYZ.
c. GRID Subsystem. This subsystem is comprised of threelinked but independent components--GRID, REARRANGE, and DIFFQUOT.
(1) GRID. The GRID subsystem needs a range and step sizefor each variable. The subsystem varies each variable from thelower bound to the upper bound, incrementing each value by a qivenstep size to obtain the next value., thereby producing all combinationsof variable values. The routine to be tested is evaluated at eachpoint and the gradient is computed at each point as well.
(a) The outputs from GRID include:
1. A listing of the new points and the associated rou-tine values.
2. A listing of the gradients.
3. A file in standard format containing the new pointsand the associated values on unit 10. This file is one possibleinput to REARRANGE.
4. A file in standard format containinq the correspondinqgradients on unit 11. This file is the other possible input toREARRANGE.
1-3
CAA-D-80-1
5. A scratch file containing the new points, the asso-ciated vaTues and some pointers on unit 12. This file is used asan input to REARRANGE.
6. A scratch file containing the gradients and tested
routine values on unit 13.
(b) The components of this subsystem are:
1. GRID.
2. PARTL.
3. PREPR.
4. The program to be tested.
(2) REARRANGE. This routine reads from unit 14, one of twofiles produced by GRID on units 12 or 13. The routine also util-izes the file produced by GRID on unit 12. The output data is re-arranged variable by variable to facilitate further analyses.
(a) The output from REARRANGE includes:
1. A listing of the rearranged input file, where adjoin-ing lines in the same section differ only in one variable value,each point is numbered to facilitate linkage of this output to theGRID output.
2. A file containing similar information produced onunit 15.
(b) The subsystem has one component: REARRANGE.
(3) DIFFQUOT. This routine reads the GRID output files pro-duced on units 10 and 12. The routine outputs a list of differ-ence quotients for the variable requested. The outputtedquotients are headed by the numbers of the relevant GRID points,facilitating the linkage between the GRID output and this output.The subsystem has one component: DIFFQUOT.
1-4
CAA-D-80-1
1-2. DESCRIPTION OF SUBSYSTEMS. Subsystem components are shownin Table 1-1.
Table 1-1. Subsystem Composition
Major MinorSubsystem components components
POINTCOMP POINTCOMP PARTL
VARVARY1 PREPR
ANALYZ ANALYZ --
GRID GRID PARTLREARRANGE PREPRDIFFQUOT
1-3. SUBSYSTEM INPUTS AND OUTPUTS. Figure 1-1 and Table 1-2 showinputs, outputs, and interconmunication between the subsystems.
PARTYL --- POINTCOMP GRID *---- PARTIL
PREPR P REPR
/ / u !Units 10, 12
Unit 10 Unit 11/
\,, /
Unit 11 IUnit 11 Units 10, 12
PAR YL -VARVARYI ANALYZ REARRANGE DIFFQUOT P----RREPR
IIUToS. POINTCOMP, VARVARYI, and GRID routines each may be run Independently of the othermajor routines. The other viejor routines may be run independently once POINTCOMP or GRID hdvebeen run tn get up the required input tiles, as indicated above.
The head of the arrow denotes Input; the tail of the arrow, output.
Figure 1-1. Data Flow 1-5
CAA-D-80-1
Table 1-2. Unit Utilization (all routines utilize Units 5 and 6in addition to those listed below.)
Routine Unitname number Type Format Description
POINTCOMP 10 Output Standard Each line contains input variable valuesand the corresponding value.
11 Output Standard Each line contains the corresponding gradients.
VARVARY1 10 Input Standard File created by PONTCOMP, containing thethe variable values.
11 Output Standard Gradients corresponding to new pointsgenerated by VARVARYI.
12 Output Standard New points generated by VARVARY1 and theassociated value of the tested routine.
13 Output Nonstandard Scratch file containing gradients.14 Output Nonstandard Scratch file containing input variable values.
ANALYZ 11 Input Standard Gradient file created by POINTCOMP, VARVARY1,or GRID
GRID 10 Output Standard File containing input variable values andthe associated values of the tested routine.
11 Output Standard File containing the corresponding gradients.12 Output Nonstandard Scratch file containing the input variable
values tested routine value and a pointer tothe variable varied to create the point.Used as input to REARRANGE.
13 Output Nonstandard Scratch file containing the correspondinggradients and the value of the testedroutine. Used as input to REARRANGE.
REARRANGE 10 Input Standard File produced by GRID, containing theinput variable values and tested routinevalue on Unit 12, containing the indicationof which variables were varied.
12 Input Nonstandard File produced by GRID on Unit 12, containingthe indication of which variable was varied.Used in the reordering computations by REARRANGE.
14 Input Nonstandard The file to be reordered, this file couldbe the file produced by GRID on Units12 or 13.
15 Output Nonstandard A file containing the rearranged output.
DIFFQUOT 10 Input Standard File containing input variable values,produced'b GkID."
12 Input Nonstandard File produced by GRID, indicating which variableswere varied to create each point.
1-6
CAA-D-80- 1
The following (Figure 1-2) outlines the units utilized by the dif-ferent routines.
POINTCOMp
GRID
VAR yARYI
12~' 12' .or13 1
or1
ANALYZ R ARRANGE DIFFOUOT
NOTE: Numbers denote I/0 unit numbers; primes denote same unitbut different formats.
Figure 1-2. Subsystem Unit Utilization
1-4. STANDARD FILE STRUCTURE. A standard file has the followingstructure:
a. Line 1 is Comprised of Fields Al, A2, and A3
(1) Al is the number of points or gradients in 15 format.
(2) A2 is the number of variables in 13 format.
(3) A3 is a positive number in F1O.7 format. Any vectorcomponents smaller than this number in absolute value will be con-sidered to be zero.
b. Line 2 (format). This line indicates the format that wasused to write each data line in the file and which may be used toread the subsequent lines in the file.
c. Other Lines. These lines contain data consisting either ofvariable value vectors (points) or gradients. The leftmost columngives data on variable 1, the next column to the right on variable2, etc.
1-7
CAA-D-80-1
CHAPTER 2
THE POINTCOMP SUBSYSTEM
Section I. THE POINTCOMP ROUTINE
2-1. INTRODUCTION. This routine uses the gradient to pick newpoints which minimize/maximize (locally) the value of the outputof the routine being tested. In addition, the gradient at eachpoint is also printed out. The analyst may use the output tocheck out the routine being tested in the following manner:
a. The analyst can examine each variable to see if it must beincreased/decreased to increase/decrease the output. The analystcan also check for attainment of values from which no increase/decrease of the output variable is possible. These results shouldbe explainable intuitively.
b. The analyst may examine each gradient to determine therelative effect of each variable at that point.
c. The analyst may examine the components of the gradients forall points to analyze the marginal returns.
d. Changes in the sign of a component of a gradient from onepoint to the next indicate that a potential local optimum for thatvariable lies between the two successive values of the coordinate.
e. POINTCOMP calls PARTL to cnmpute partial derivatives nu-merically. POINTCOMP calls PREPR, a user provided driver routinewhich obtains an output value from the program being tested.
2-2. BACKGROUND
If f(xl, ... , xn) is a real valued function of several variables,V f(x , ,%x ) :(- f (XI ... x-x x)
points in the direction of greatest local increase in f from (x,.. xYn), and -Vf(xl, ... , xr) points in the direction of great-est local decrease in f from 'Xl, ... , Xn). We justify this factby the following argument:
2-1
... . -
If (YI, . Yn) is a point "close" to (xj, ... , Xn),
f(Y1,---, Yn) - f(x1 ' ""I Xn) is approximated by:
n f..
l " xn) (yi " xi)i=1 i
=Vf(x1 , ... , Xn) • (y - x)
=IlVf(xl, ... , Xn)Ij IlY" x-Icos 0
where: Y = (Y1' "" Yn) ;
x = (X1, .... , Xn);
IhAII is the magnitude of a vector A; and
9 is the angle betweenVf(xl, .. , xn ) and (y - x).
So
f(Yl' "", Yn) - f(x1 ""I Xn) -hhVf(xl' ""' Xn)l{ HI - xIIcos 6,
and therefore:
f(YI - Y - f(xI, ... , x n) -hlVf(xP, n.. Xfl~CO5 el - xmli
Now -1 cos f j 1, so
max f(Yl "", Yn) - f(xl ."" Xn)llY-X i#U fY - xl = lV f(xl ""' xn)II"
IllyxII#U Ii)' - X11
Therefore the greatest change in the function f per unit distance
between y and x (i.e., jJy - xlj) is the magnitude of the gradient
I lVf(xl, .. , Xnfll. This maximum is reached for cos 6 = 1 or 0= U, so the direction of greatest increase is 0 0, so y - x and
f(x1,..., Xn) are collinear. Therefore, f(x1 , ... , xn) givesbotr the magnitude and direuiion of the maximal change.
Likewise:
111in f(Yl "',Yn) " f(xl .", xn)
Ily-xlIlo Ily - x1I
2-2
I
CAA-D-80-1
In this case, cos g = -1, so 8 = 180 and the direction of great-est decrease (least increase) per unit distance between y and x
ys( - x1i) is -Vf(xl, .. ,.i ,x) the magnitude of greatest de-
crease is HlVf(xi, -. , xnI
2-3. DISCUSSION OF METHODOLOGY. Several criteria are used in theprogram to decide upon the distance to be moved along the gradientin order to obtain the next point. These criteria are:
a. The maximum change in one step for each variable (an inputparameter) divided by the size of the component of the gradientcorresponding to that variable.
b. First, compute a certain fraction of the difference betweenthe current variable value and the bound on the variable in theappropriate direction (an input parameter) whenever the bound ex-ists. When the variable isn't bounded, use twice the currentvalue as a bound. Next, the number just described is divided bythe size of the corresponding component of the gradient.
c. Compute the minimum of the numbers developed in parts a andb and the default multiplier read in as an input parameter on the8th input card (see pg 2-6). This step computes a gradient multiplier.
d. A candidate increment is determined by multiplying the gra-dient by the number derived by the process described in c. If thegradient multiplier is too small, use the A7 field on card 1. Ifnecessary, the increment is multiplied by a number sufficient toincrease each component to the minimum threshold. These minimumthresholds are also input.
e. Lastly, the increment vector is added to the originalpoint, obtaining a new point candidate. The components of thisnew point exceeding the bounds of the corresponding variable (ifany) are set equal to the value of the bound, and the result istaken to be the next point.
2-4. LIMITATIONS. As currently compiled, the POINTCOMP routineis subject to the following limitations:
a. Testing of the program must proceed by testing one out-put variable dt a time if the program has several output vari-ables.
b. If any variables input to the program being tested areintegers, it is possible that their incrementation and effect uponthe output variables will be reduced due to truncation.
2-3
CAA-D-80-1
c. Current limits are set to 20 variables and 500 generatedpoints at most. This is easily changed.
d. Testing Monte Carlo programs is feasible, but potentiallytime consuming. The PREPR routine, called by POINTCOMP, must callthe routine being tested repetitively and average the output val-ues before returning. Replication is necessary in order to aver-age out random effects. A better approach is to use the MonteCarlo variables as ordinary input variables and let POINTCOMP as-sign their values with no replication.
e. The function represented by the routine to be tested shouldbe well-behaved (i.e., differentiable).
f. The order in which the criteria for step size are examinedis fixed, so there is a hard wired priority among the criteria.
2-5. RUN SETUPS
a. Developing an Absolute File in ASCII
@MAP,S ,Name of absolute elementIN O3PROGTEST. POINTCOMPIN 03PROGTEST. PARTIALIN Element containing PREPR subroutineIN Programs to be testedLIB LIB$*FTNS.END
b. To Execute
@USE 10, file name to contain variable values andvalues of the tested routine
@USE 11, data file name for gradient file in standard format@ASG,A First file name@ASG,A Second file name@XQT Absolute element created by the @MAPInputDeck
c. Input Deck. The following tables describe the input deck(Table T-T), show a sample input deck (Table 2-2), and a samplerun deck (Table 2-3).
2-4
CAA-D-80-1
Table 2-1. Description of Input Deck(page 1 of 2 pages)
Line 1
Field: Al A2 A3 A4 A5 A6 A7 A8
Format: 13 13 12 F10.7 F10.7 F12.0 F12.5 13
where the fields are defined as follows:
Al is the maximum number of points to be generated.
A2 is the number of variables.
A3 is +1 if output is to be increased, -1 if output is to bedecreased.
A4 is a positive real number. Any number smaller than thisnumber will be considered to be zero.
A5 is a positive real number, gradients smaller thanthis number will be considered to be zero.
A6 is a code number. This number can be used to indicatethat a variable is unbounded above or below.
A7 describes the minimal multiplier desired for the gradi-ent.
A8 the run is executed in a debugging mode (more printout)when this field contains a -1.
Line 2. (Format for reading in each of the following six lines,lines 3-8 which follow. Parentheses must bound the formatas shown.)
Line 3. Initial values, one for each variable, in the format de-scribed by line 2.
2-5
CMA-D-80-1
Table 2-3. Description of Input Deck(page 2 of 2 pages)
Line 4. Lower bounds allowed for each variable, in the format de-scribed by line 2. If some variable is unbounded below,indicate this by using the number from field A6 of thefirst line.
Line 5. Upper bounds allowed for each variable. Rest of descrip-tion as in line 4.
Line 6. The preferred maximum single step change in each vari-able, one number for each variable.
Line 7. The preferred minimum single step change in each vari-able, one for each variable.
Line 8. Default gradient multiplier for each variable, one numberfor each variable. These will only be used for unboundedvariables and are only useful to reduce the number by whichthe gradient will be multiplied.
Line 9. (Format for writing one line of variable values and thecorresponding program output value on unit 10. This formatshould accommodate at least n+3 values, where n is the num-ber of variables.)
Line 10. (Format for writing out one line of variable values andthe corresponding program output value on the printer.)
2-6
CAA-D-80-1
Table 2-2. Sample Input Data
4a 9b+1c .00 1d .001e 1001.f .1000g+1h
(13F5.0) format for inputting the following six lines
5.0 0.5 0.5 0.5 Initial value0.0 0.0 0.0 0.0 Lower bounds
1000.0 1000.0 1000.0 0.9 Upper bounds
10.0 10.0 10.0 0.5 Preferred maximum step0.0 0.0 0.0 0.0 Preferred minimum step1.0 1.0 1.0 1.0 Default multiplier
(not really needed forbounded variables)
First column describes variable 1.
Second column describes variable 2.
Etc.
(6(7X,F13.5)) Format for writing values andoutput on unit 10
(1X,6(fX,F13.5)) Format for writing valuesand output on the printer
aNumber of variables.
bMaximum number of points.
Clncrease the output.
dNumbers lower than this are considered zero.
eGradients smaller than this are considered zero.
fCode number indicating no bounds.
gMinimal gradient multiplier.
hNot in debug mode.
2-7
. . . .
CAA-D-80-1
Table 2-3. Sample Run Deck
@USE 10,03MATI.
@ASG,A 03MAT1.
@USE 11,03MAT2.
@ASG,A 03MAT2.
@XQT absolute deck created by @MAP
04009 +1 .001 .001 1001. .1000 +1(13F6.0)
5.0 0.5 0.5 0.50.0 0.0 0.0 0.0
1000.0 1000.0 1000.0 0.910.0 10.0 10.0 0.50.0 0.0 0.0 0.01.0 1.0 1.0 1.01
(6(7X,F13.5))(1X,6(7X,F13.5))
2-6. OUTPUT DESCRIPTIONS AND SAMPLE OUTPUT
a. Tuples. Each row corresponds to a point where the right-most column is the value of the routine being tested and the left-most column represents variable 1, the column to its right vari-able 2, etc.
b. Gradients. Each row is the gradient at the point describedby the corresponding row of the tuples output, e.g., the first rowis the qradient at the point described by the first row of thetuples printout.
c. Increments. Each row is the computed vector difference ofthe corresponding tuples (except where boundaries areencountered). The first row is the second tuple minus the first,the second row is the third tuple minus the second, etc. The fol-lowing (Table 2-4) exhibits sample printer output.
2-8
CAA-D-80- 1
Table 2-4. Sample Output to the Printer
Tuples
5.00000 .50000 .50000 .50000 .738215.00000 .61902 .75809 .63333 .999165.00119 .73820 .97516 .76667 1.241595.00270 .80924 1.08781 .84667 1.379025.00270 .84061 1.13401 .88222 1.438335.00270 .85178 1.14995 .89492 1.459265.00270 .85513 1.15468 .89873 1.465515.00270 .85513 1.15590 .89873 1.466265.00270 .85513 1.15715 .89975 1.46753
Gradi ents
.00048 .30919 .67048 .34638.00359 .35940 .65458 .40207.00852 .40086 .63565 .45144.01236 .42295 .62294 .47942.01428 .43221 .61698 .49139.01500 .43545 .61481 .49560.01522 .43641 .61415 .49686.01523 .43631 .61415 .49674.01527 .43670 .61405 .49663
Increments
.00000 .11902 .25809 .13333.00119 .11919 .21707 .13333.00151 .07104 .11264 .08000.00000 .03137 .04620 .03556.00000 .01117 .01594 .01270.00000 .00335 .00473 .00381.00000 .00000 .00122 .00000.00000 .00000 .00126 .00102
2-9
ICAA-D-80-1
d. Output File Descriptions
(1) File on Unit 10
(a) Line 1
Fields Al A2 A3
Formats 15 13 F10.7
where
Al is the number of points in the file.
A2 is the number of variables.
A3 is the number determining when small numbers are consideredto be zero.
(b) Line 2. (Format for reading in one point and its cor-responding program value.)
(c) Other Lines. Each line contains a set of variablevalues and the corresponding tested program value.
(2) File on Unit 11
(a) Same as file on unit 10.
(b) Same as file on unit 10.
(c) Other lines - Each line contains the correspondinggradient.
2-10
CAA-D-80-1
e. Sample Output File--Unit 10
9 4 .0010000(6(7X,F13,5))
Tuples
5.00000 .50000 .50000 .50000 .738215.00000 .61902 .75809 .63333 .999165.00119 .73820 .97516 .76667 1.241595.00270 .80924 1.08781 .84667 1.379025.00270 .84061 1.13401 .88222 1.438335.00270 .85178 1.14995 .89492 1.459265.00270 .85513 1.15468 .89873 1.465515.00270 .85513 1.15590 .89873 1.466265.00270 .85513 1.15715 .89975 1.46753
f. Sample Output File--Unit 11
9 4 .0010000(6(7X,F13,5))
.00048 .30919 .67048 .34638
.00359 .35940 .65458 .40207
.00852 .40086 .63565 .45144
.01236 .42295 .62294 .47942
.01428 .43221 .61698 .49139
.01500 .43545 .61481 .49560
.01522 .43641 .61415 .49686
.01523 .43631 .61415 .49674
.01527 .43670 .61405 .49663
2-11
CAA-D-80-1
2-7. POINTCOMP ROUTINE LISTING
PARAMETER FILE1=Z1OFILE2=11.NOVALS=20,NOPTS=500,INFILE=5,OUTFIL=6PARAMETER NOVRL1ZNOVALS41
CH4ARACTER.80 FORMT19FORNT29FORHT3
DIMENSION FS1VAL(NOVALS).LOWBDStNOVALS3,HYBDS(NOVALSIDIMENSION MAXCHGINOVALS) ,ORADItOPTS.NOVALS1,TUPLES(NOPTS.NOVAL1IDIMENSION DELJA1 INOVALS) 9DELTA21 NOVALS) @DELTA (NOPTS 9NCVALS IDIMENSION SI6N(NOVALSI ,INPUTINOVALSSMININOVALS) ,NOMULT(NOVALSI
CINTEGER NOVARSUPOOWN.MAXPTS.SIGNIJ.PQSWITCN
CREAL EPSLONFLATNOLTMFSTVALLOWBDSHYBDS.MAXCHGREAL GRADeSUM.INPUT, INCRPARTYLOELTAI.DELTA2,OELTAREAL TUPLESiVALUE ,NOMULTMIN.MIN1,NINMLTMAX
CREWIND FILE1REWIND FILE2
READI INrILEs1C000) NOVARSMAXPTS.UPDOWN.EPSLDNFLATNOLIM.I MINMLT9SWI'VCH
10000 FORMAT(213vI292F10.7,2Fl2.O9I3)
IF (SWITCH ttE. -1) GOTO 30010WRITE (OUTFIL920060) NOVARS.MAXPTS.UPOOWNEF'SLON.FLATPNOLIMMINMLT
20060 FORMAT('l **INVALS..,t/.1X,213,12,2FI0.7.F12.0.FlZ.5130010 CONTINUE
READtINVILEolDD101 FORMT110010 FORMATIASO)
READIINFILE.FORMTI) (FSTVALlI~oi-1,NOVARS)READ(INFILEFORMT1I ILOWODSgIloIz19NOVARSIREAD(INFILEtORMT1I (HYBDSEIIIPI=19NOVARSIREA0(INFILE@FOFMT1) (MAXCHG(13,I1lNOVARS)READI INFILroFORMTII IMINEI) ,I=1,NOVARSJREAOITNFILEPFCRMT1I (NGPULT4I)9I:1,NOVARS)REA01INFILEv1D0010) FORMT2READI INrILE*100101 FORMT3
C 0 0IF ISWITCH .NE. -13 GOTO 30020WHITE40UTItL,210001 OFSTVAL(IltIz19NOVARSI
21000 FORMATIO *sFSTVAL~s*#lUf/vlX9&F20.1D?1WRITE(OUTFILZ10101 fLOWbDSfI) #I=1vNOVARSl
21010 FORMAT(* s4L&W8OS..'1lUI/vlXipF2O.103)WRITEICUTFIL*210201 (HYRDS1I3,I=1,NOVARS)
21020 FORMAT1 s*.Hg8DSs*9vlD(/vlXo6F20.10))IWRITUO&ITFILvZlO3UI EMAXCNG(II ,Iz1.NCVARS)
1030 FORMAT11 *oMRtXCHG*.'v10(/91Xv6F2G.11))WRITE(OUTFIL*20065) IMrNII).1z1.NOVARSR
20065 FORMAI s#MTNSe'v,10(/9lX9GF20.1O)JWRIT[IOUTFIL-ZU0671 V4OMULTfI2,Ir1,NOVARSl
Z0067 FORMAT19 #$N0OMULT..',lUl/tlXq6F20.1I))30020 CONrINUrCse*
CAA-D-80-1
C INITIALIZATIONDO 100 1z1,N0VARSTUPLES1I1)=p-STVAL4l UINPUT(II=FSTWALII)
100 CONTINUECALL PREPRIINPUTtVALUE)TUPLESI11,NOVXL.1IVALUE
C LOOP TO CRirATE POINTSDO 3000 PZ29WAXPTSDO 300 I:1,N8VARSINPUTITIZlTUPLESIP-19I3
300 CONTINUEDO 400 I=1,NtVARSCALL PARTLU NOVARS @I@INPUT 9FPSLON #PART YL. 9 NCR,9TUPLES IP-1#NOVAL1II
C 00IF ISWdITCH MNE- -11 GOTO 30030WRITE(OUTFILo.Z0000) IINPUT(JIJ=JZ1NOVARSRPARTYLINCRt
1 TUPLESIP-19NOVALI)20000 FORMATI//.' **INPUT PARTIALs.'tj0t/o1X,6F20.1D3330030 CONTINUEC 0*
GRADIP-191UZPARTYL
4100 CONTINUE00 500 I=1.NVVARSSIGNII)=UPDONIF IGRACIP-1.iR *LT. 0.1 SIGN(II=-UPDOWN
S0o CONTINUEC **
IF (SWITCH .NE. -1.) GOTO 3004LIWRITEIOUTFIL9200101 fGRAD(P-1,U Iz3.,lNOVARS)
20010 FORMATI//vo .*GRAD*..rl0I/plXt6F20.1O))WRITE(OUTFILv2i0153 (SIGN(I2 ,I=1.NOVARS)
20015 FORMAT(//os *4SIGN..'.l~f/9IXv,10133040 CONTINUEC **C COMPUTE CANDIDATE MULTIPLIER BASED 4lAX CHANGE PER COORDINATE
DO 600 I=1,NCVAR'DELTAlfI IABS(NOMULTlI))IF (ASGRADIP-1,I)) LT1. EPSLON) GOTO 600DELTAltrIJACS(MAXCHGtIlI/ABS3RAD(P-1,l)
600 CONTINUEC ... e.
IF 4SWITCH *NF. -1) GOTO 30050WRITEIOUTFIL92002UI (DELTA1(Ii ,1,NCVARS)
20020 FCRHfATt//P' *bDELTA1**99l0(/v!Xv6F20.101)30050 CONTINUE
2-13
CAA-D-80-1
C *cooC COMPUTE CANO-ZOATE MULTIPLIER BASED ON DISTANCE FROM BOUNDSC OR DOUBLING THE VALUE IF NO BOUND EXISTS
00 800 IZ19NOWARSOELTAZtII=AtlNI(A8S(TUPLESIP-2tI1/ABSI0RADIP-1.I3)NQMULTII)IIF (SIGN(I LAT. 0 1 SOTO 700IF (ARSOHY80941I-NOLPII .GE. EPSLON) DELTA21I)=
1 *IFLOATIP)-l.)/(FLOATlJ4.3J.IABSINYBDSII)-TUPLESIP-1.I)32 /ABSIGRADIP-1,I)1SOTO 800
100 IF IABSILOWBDSII)-NOLIM) .GES EPSLONJ DELTAZ(I1=
2 /ASGRADP-1II)l800 CONTINUE
IF (SWITCH *NE. -1) SOTO 30060WRITECOUTFILZO0i.6) fDELTA2(1),TI*NCVARSI
2001.6 FORMAT(//P' d*ELTA2*e'.1D1/.1X,1.F30o11)30060 CONTINUEC ***soC COMPUTE THE INCREMENTATTON VECTOR
DO 900 I:1,NaVARSDELTAIP-1,I)=AMINI(OELThI(I),OELTAZ(I1)
S00 CONTINUE
IF ISWIITCH .NE. -1) SOTO 30010IRITEIDUTFIL9200.5) (DELTRIP-1ItI=1,NOVARS)
20015 FORMATI//@' *#OELTA.O'e',l0(/tlX96F2D.10))30070 CONTINUECso*C TO COMPUTE THE MNIMUM GRAVIENT MULTIPLIER.
HINIZOELTAI P-1 .1300 925 I1,NO(VARS
IF IOELTAIP-1T)I *LT. EPSLONI GOTO 925IF IDELTA(P-lII .LT. MINlI MIN1ODELTA(P-1.t?
925 CONTINUEC 00
IF (SWITCH NME. -11 GOTO 30080WRITE(OUTFIL,200441 IDELTA(P-lp1 ,I:1,NOVARS)@MIN1
2004.4 FORMATI /I.' **OELTA.1..' .10(/#lX#6F20.1D1)30080 CONTINUF
C TO COMPUTE A CANDIDATE INCREMENTIF IMINI .LT. EPSLON) MIN1=MINMLT00 950 I=1,NVVARSDELTA(P-l.I):MIN1.ABSIGRAOIP-1.131
950 CONTINUEC
(14
CAA-D-80- 1
IF (SWITCH .ME. -11 GOTO 30090WRITE(OUTFIL9200401 fOELTA4P-lvIII1,tOVARS)rMINl
20040 FORMATI//*' *.DELTA.2,MINI..',10I/,1Xe6F20.1U)II30090 CONTINUEC *oossC TO GUARANTEE A MINIMAL STEP IN EACH COORDINATE
N AXOD.DO 990 I~lvNSVARS
C SET MINISCULE STEPS TO ZEROIF (OELTAIP-1eI) .GE. EPSLON) GOTO 980DEL TA(P-1*11=0.SOTO 990
C CHECK TO SEE IF CIANDIDATE INCREMENT EXCEEDS MINIMUM980 IF 4 DELTAIP-19I3 .GE. MIN(II ) SOTO 990C *to**
IF ISWITCH .ME. -1) GOTO 30200WRITEIOUTFIL9,2020OD I.MAXMIN(I)/ABSIOELTA (P-1il(i
ZOZUO FORMAT(/t100E/t' s*MAX*.'9v15v4F2O.j0))30200 CONTINUEC *****
IF ((MIN(i)/OELTA(P-,II) .Lt. MAX) SOTO 990MAX=MINfI)/OEL7AlP-1 #11
990 CONTINUEIF ( MAX .LT. EPSLON) GOTO 975
C INCREASE THE STEP SIZEDO 970 I=1,NVARSOELTAfP-l#I I=HAXeDELTA IP-1,I)
970 CONTINUEC ***..
IF (SWITCH NME. -11 SOTO 30110WRITE(OUTFILs20O42) lDELTAlP-1vT~tI=1NOVARSI ,MAX
20042 FORMAT(//#' 6.*DELTA.3,MAX.. ,10(/.1X.6F20.1O))30110 CONTINUEC **oss975 DO 985 I=1.NSVARS
IF 4 DELTAIP-19I) .GT% MAXCHG(I) I DELTAcP-1iIr)MAXCHOIIDELTAIP-1Il)=DELTAIP-1Il)*SIGN(T)
985 CONTINUEC **so*
IF (SWITCH *NE. -1) SOTO 30120WRITEfOUTFILw20O43) lOELTA(P-lI~II#NOVARS)
20043 FORMAT(//@* s*DELTA.4oo',10f/#1Xv6F20el0II
30120 CONTINUEC ***soC CHECK TUPLE VALUZS AGAINST THE BOUNDSC If ANY
DO 1100 I119iOVARS
2-15
CAA-D-80-1
TUPLESIP,13:TUPLESIP-1,II.OELTAF'-1,13IF (ASHYBDSCI-NDLIM) .LT. EPSLON3 GOTO 100UIF ITUPLESIPPI) >. HYBOS1II) TUPLES(PoI):NYBDS(13
1000 IF 4ABS(LGWB[lSlIl-NOLIMl *LTo EPSIONI GOTO 1100IF fTUPLESfP.I3 .LT* LOWBDS(I33 TUPLESIPoIJLOWSDS(I3
1100 CONTINUEC os...
IF fSWITCH WME* -11 GOTO 30140WRITE(OUTFIL920047) lTUPLESPo13.I1NOVARS)
20047 FORMATlj'/e' .j.UPLES4'#10l/lx9GF2U*103 I30140 CONTINUEC *0
00 1200 1=19NOVARSINPUTtI)TUPL)ES(P .13
1200 CONTINUECALL PREPRI INPUTvVALUE 3TUPLES( PNOVAtl)=VALUE
C CHECK FOR A ShAtL GRADIENTsuH=0.DO 1300 I1.M9tOVARSSUM=SUM+GRAD&P-1. 13..2
1300 CONTINUESUN=SUH**t.SlQ=P-1IF ISUM .LTa FLATI 9=0-1IF (SUM .LT* FLAT$3 GOTO 3100
C TO EXIT IF NO SIGNIFICANT CHANGE FROM PREVIOUS VALUESDO 3600 I=leNOV*RSIF IASS(TUPLEIIP.I3-TUPLES(P-1.T3I GOE. EPSLON1 GOT0 3700
3600 CONTINUE0=2-16070 3109
3700 CONTINUEC END OF POINT COMPUTATION LOOP3090 CONTINUE3100 P=Q,1
DO 1400 I=19MOVARSINPUYII3=TUPL.ES(P .1)
1400 CONTINUEDO 1500 I~lvNOVARSCALL PARTL(NOVARS.IeINPUTEPSLONPARTYL, INCRTUPLES(P.NOVALLI
C **so*IF 4SWITCH .ME. -13 GOTO 30150WRITEIOUTFIL.&200301 IINPUTIJI .J= 1NOVARSI.PARTYL.INCRe
1 1UPLES(PtNOVALLI20030 FORMAT(//#9 **LAST INPUT PARTIAL..'.10l/91X96F20.l01)301S1 CONTINUE
2-16
CAA-D-80-1
GRAD( PtI I=PAR7 YL1500 CONTINUE
IF 1Q .LT. 11 Q=1
IF (SWITCH KES. -1) GOTO 30130WRITE(OUTFIL9200501 SUM
20050 FORMAT[//#* **SUH**qF30.15)30130 CONTINUEC *so**C BEGIN OUTPUT OF COMPUTATIONSC WRITE FILE FOR VARIABLE VARIATION ROUTINE IVARYVARI
WRITE IFILE1910020 I PtNCVARSvEPSLON10020 FORMAT115PI39F1O.71
WRITEIFILElit1003OI FORMT210030 FORMATI A8O)
Do 3200 I~lvPWRITE(FILE19FORMTZI ITUPLES(IJ),J:1,NOVARSI .TUPLESII.NOVALII
32001 CONTINUEC OUTPUT TO PRINIER
WRITE40UTFIL91004011004.0 FORMATff//vZ1X.*TUPLEStv/I
00 3300 I=lvPWRITEfOUTFILtFORMT3I (TUPLESIIJ),J=1,NOVAPS1,TUPLES(INOVAL11
3300 CONTINUEWRITE IOUTFIL9100501
10050 FORMAT(///921X.(oGRADIENTS'IDO 3400 I~ltPWRITEIOUTFILFDRNT31 (GRAD1II4),J1,vNOVARS)
3400 CONTINUEWRITECOUTFIL*10060)
10060 FORMATl///,21X.'INCR[MENTS',/)00 3500 1=190WRITEIOUTFILvFORMT31 (GELTAfIJ)9J--1,NOVARS3
3500 CONTINUEWRITE iFILEZ.100701 PNOVARS@EPSLON
10070 FORMATII5eI3PF1O.71WRITE(FILE2@100301 FORMT2DO 3800 I=1.PWRITEfFILE29FORHT21 fGRAD(IIJ),J1,vNOVARSI
3800 CONTINUEWRITE(OUTFILsI00901
10090 FORMAT1(///1END
2-17
w po"Po 1-T
CAA-0-80-1
2-8. POINTCOMP ROUTINE FLOWCHART
Start
Read inpara-
meters
Debug Yesmode
Wrfte outNo parameters
ea ina form areadin initia IPoint, variabl
bounds , min andax step sizes &
efault gradientMultiplierz4
Read inn formafor disk andformat forP j trinted outpu
Debuq Yesmode
ou0orn
i t rb,,ou n Id s e,
PTa a
No I z e s a A ( I ]-ult Multi-I P r s
2-18
CAA-D-80- I
PREPRCall program tobe tested to
evaluate it onthe initial
01int
5PARTL
CalIl routineto compute
partial
thmdfoldeli
pathel andt
p 0 n c2-19
CAA-D-80-1
Compute candidate If no bound set
multiplier based appropriate conponenton distance to to the minimum of
bound or the correspondingdoubling default multiplier
NOMULT) and the quo-
comnonent and the partialfor that variable
2ebu2Ye
CAA-D-80-1
multiply gradien Use the minimalby mi 11111"m to multiplier pro-
obta n candidate i as a In 1t - -- -- -- v4ded as an ln]pu
ncremen 7p;aramet Injer ifMUM is too small
(MINML r
ebug Yesmo4e
No I JtI t
Compute ai, increasefact
r if c O.P..nent s are s m.";'tmn IN( I ) - Findthe me, Inial suchfac or , f jy
ex I st
Debug Yesmode? 0 n qu ra os
in n mum0 nze t can t
c ment co one0 components10 the minimum
increase increlrE- tif necessar v inr)rder to oi(e e d
MIN(l) ,alues
Detug Yesmode
r n n-crement andnul t ipi ier if
No increase Oc-curred
Multiply incrementby thC 'P
propriate sign
Deb -q Yesmoft
Print t "ecand datenc emen
2-21
a
CAA-D-80-1
Incrementcurrent valuesto obtain new
candidate values
rSet values
exceedinq boundsto the value of
the bound
us Yes
IEvaluate atnew point
eYes
No
e
Delete last
Yes pointspoioint
needed
0
2-22
CAA-D-80- 1
Compute thegradient ofDeuYse last point md
nates~ andn eahoponsonti
2-2iud3 o
CAA-D-80-1
Section II. THE VARVARYI ROUTINE
2-9. INTRODUCTION. The purpose of this routine is to take eachof the points generated by the POINTCOMP routine or chosen by theuser and to vary each variable in turn (using the bound and incre-ment) while keeping the other variables fixed. The program to betested is evaluated at each of these new points, and the newpoints and their associated program values and gradients areprinted out. Difference quotients are computed and printed foreach variable as it is varied. The puints at which the differencequotient is computed are those defined by the user provided incre-ments and lower bounds. The new points can be used to study theeffects of varying just one variable at a time and to providepoints for graphs.
2-10. LIMITATIONS
a. When varying a single variable, the only values tested arethose of the form: lower bound + integer x increment higherbound. The current routine will not accept a list of values ofthe form 1, 3, 5, 17, 98.
b. All variables are real.
c. Currently restricted to 100 variables.
d. Currently restricted to a maximum of 500 steps per variablebeing varied.
e. When this routine is used on output from POINTCOMP or GRID,the limitations of these routines apply as well.
2-11. RUN SETUP
a. Developing an Absolute File in ASCI
@MAP,S , name of absolute element
IN 03PROGTEST.VARVARfI
IN 03PROGTEST.PARTIAL
IN element containing PREPR
IN program to be tested
LIB$*FTN.8.
END
2-24
CAA-D-80-l
b. To Execute
@USE 10, name of file containing input points
@USE 11, name of file into which gradients are placed instandard format
@USE 12, name of file into which new points are placed instandard format
@USE 13, name of scratch file
@USE 14, name of scratch file
@ASG,A name of file containing input points
@ASG,A name of file into which gradients will be placed
@ASG,A name of file into which new points are placed
@ASG,A name of scratch file
@ASG,A name of scratch file
@XQT absolute element
[Input deck]
c. Description of Input Deck
(1) Line 1. (Format to read in each of the following threelines, one at a time.)
(2) Line 2. Lower bounds for the variables; the leftmostbound pertains to the first variable. The line must adhere to theabove format.
(3) Line 3. Upper bounds for the variables.
(4) Line 4. Increments for the variables.
(5) Line 5. (The format to print out the point identifica-tion number, t e new variable values and the output value from theroutine being tested, one point at a time.) This format is alsoused to print out the gradient identification number and the gra-dient coordinates.
2-25
CAA-D-80-1
(6) Line 6. (The format to print out one line of differencequotients.)
d. Sample Input Data for VARVARYI
(13F5.2) Format for reading in the nextthree lines, one at a time.
5.0 0.5 0.5 0.5 Lower bounds.
18.0 9.0 48.0 1.0 Upper bounds.
3.5 1.5 10.0 0.1 Increments
The leftmost column in rows 1-4 pertains to the first variable,the middle column to the second variable, etc.
e. Sample Input File for VARVARY1--Unit 10
(' POINT NUMBER ',15,2X,8F10.5) Format for printing out newpoints and gradients, one to aline.
(1X,13FIO.5) Format to print out one line of difference quo-tients.
INPUT VALUES
9 4 .0010000(6(7X,F13.5))
5.00000 .50000 .50000 .50000 .738215.00000 .61902 .75809 .63333 .999165.00119 .73820 .97516 .76667 1.241595.00270 .80924 1.08781 .84667 1.379025.00270 .84061 1.13401 .88222 1.438335.00270 .85178 1.14995 .89492 1.459265.00270 .85513 1.15468 .89873 1.465515.00270 .85513 1.15590 .89873 1.466265.00270 .85513 1.15715 .89975 1.46753
This file was created by POINTCOMP on unit 10.
(1) Line 1. The first number is the number of points in the15 format an-d--Te second is the number of variables in an 13 for-mat. The third number is used to determine when a number is es-sentially zero, in FIO.7 format.
2-26
CAA-D-80-1
(2) Line 2. The format with which the following lines werewritten, and w1th which they may be read.
(3) Lines 3-7. The leftmost four columns represent the val-ues of variables one to four, reading from left to right. Eachentry in the rightmost column gives the tested program value whenrun with the variable values printed on the same row. Each rowrepresents an input point. The leftmost four columns are valuesof the input variable. The last column is the output value of theroutine being evaluated.
f. Sample VARVARY1 Run Setup
@USE 1O,03MAT1.
@ASG,A 03MAT1.
@USE 11,03MAT3.
@ASG,A 03MAT3.
@USE 12,03MAT4.
@ASG,A 03MAT4.
@USE 13,03MAT5.
@ASG,A 03MAT5.
@USE 14,03MAT6.
@ASG,A 03MAT6.
@XQT 03PROGTEST.VARVARYI
Input cards:(13F5.2)
5.0 0.5 0.5 0.518.0 9.0 48.0 1.0
3.5 1.5 10.0 0.1(' POINT NUMBER ',15,2X,8F10.5)(IX,13F1O.5)
2-27
*73CAA-D-80-1
2-12. OUTPUT DESCRIPTION AND SAMPLE OUTPUT
a. Printer
(1) Sample VARVARYl Output--Points
------- -------------------- VARYING VARIABLE NUMBER 1-------------------
POINT NUMBER 1 5.00000 .50000 .50000 .50000 .73821
POINT NUMBER 2 8.50000 .50000 .50000 .50000 .73934POINT NUMBER 3 12.00000 .50000 .50000 .50000 .73985
POINT NUMBER 4 15.50000 .50000 .50000 .50000 .74014
POINT NUMBER 5 19.00000 .50000 .50000 .50000 .74033
....................+DIFFERENCE QUOTI ENT MATRIX+........+..........
.00000
.00032 .00000
.00023 .00015 .00000
.00018 .00011 .00008 .00000
.00015 .00009 .00007 .00005 .00000
---------------------------- VARYING VARIABLE NUMBER 2-----------
POINT NUMBER 6 5.00000 .50000 .50000 .50000 .73821
POINT NUMBER 7 5.00000 2.00000 .50000 .50000 1.10039POINT NUMBER 8 5.00000 3.50000 .50000 .50000 1.32998
POINT NUMBER 9 5.00000 5.00000 .50000 .50000 1.48843POINT NUMBER 10 5.00000 6.50000 .50000 .50000 1.60434POINT NUMBER 11 5.00000 8.00000 .50000 .50000 1.69280
POINT NUMBER 12 5.00000 9.50000 .50000 .50000 1.76252
++..................DIFFERENCE QUOTIENT MATRIX+...................
.00000
.24145 .00000
.19726 .15306 .00000
.16672 .12935 .10564 .00000
.14436 .11199 .09145 .07727 .00000
.12728 .09874 .08063 .06812 .05897 .00000
2-28
CAA-D-80-1
(2) Sample VARVARY1 Output--Gradients
THE VARIABLE VARIED IS NUMBER 1
POINT NUMBER 1 .00048 .30919 .67048 .34638POINT NUMBER 2 .00019 .32471 .68200 .34773POINT NUMBER 3 .00010 .33081 .68706 .34836POINT NUMBER 4 .00006 .33495 .68991 .34871POINT NUMBER 5 .00004 .33762 .69173 .34894
THE VARIABLE VARIED IS NUMBER 2
POINT NUMBER 6 .00048 .30919 .67048 .34638POINT NUMBER 7 .02158 .18565 .60644 1.08123POINT NUMBER 8 .05104 .12313 .56450 1.55265POINT NUMBER 9 .07778 .08812 .53491 1.88027POINT NUMBER 10 .10199 .06543 .51291 2.12195POINT NUMBER 11 .12182 .05001 .49591 2.30725POINT NUMBER 12 .13869 .04014 .48239 2.45384
(3) Description of Points Output. Each row describes apoint. The leftmost four columns are values of variables onethrough four, reading from left to right. The rightmost entry oneach row is the output value when the inputs are those in columnsone through four.
(4) Description of Gradients Output. Each row is the gradi-ent of the routine being tested at the point whose number islisted on the left. Again, the values of variables one to fourare listed from left to right. The point numbers link the print-out of the points and variable values to the gradient printout.
(5) Sample VARVARY1 Output--Difference quotients
GIVEN SAMPLE OUTPUT
POINT NUMBER 51 5.00000 .73820 .97516 .76667 1.24158POINT NUMBER 52 8.50000 .73820 .97516 .76667 1.26175POINT NUMBER 53 12.00000 .73820 .97516 .76667 1.27087POINT NUMBER 54 15.50000 .73820 .97516 .76667 1.27607POINT NUMBER 55 19.00000 .73820 .97516 .76667 1.27942
2-29
CAA-D-80-1
We define the following labels for some of the variable values andoutputs:
Values Outputs
XI = 5.00000 Y "1.241582 = 8.50000 Y2 = 1.26175
X3 = 12.00000 Y3 = 1.27087X4 = 15.50000 Y4 = 1.27607X5 = 19.00000 Y5 = 1.27942
THE ASSOCIATED DIFFERENCE QUOTIENTS ARE
.00000
.00576 .00000
.00418 .00261 .00000
.00328 .00204 .0014 .00000
.00270 .00168 .00122 .00096 .00000
If we denote the varying coordinate of point numbers 51-55 by xto x5, and denote the corresponding values (the rightmost colum)by y1 to Y5, the second row in the matrix has the nonzero entry:
- .00576.
x2 - x1
Note that the difference in y is in the numerator and the differ-ence in x is in the denominator. The third row has the nonzeroentries:
Y3 - Y- .00418
x3 - x1
Y3 - Y2= .00261
x3 - x2
Note that the third row has the first term of numerators and de-nominators indexed by 3 and the second terms are indexed by 1 and2 (i.e., 3-1). The fourth row has the nonzero entries:
2-30
I!
CAA-D-80-1
Y4 -Y- = .00328
x4 -x 1
Y4 - Y2- = .00204
x4 - x2
Y4 - Y3-4 = .00148x4 -x 3
Note that the fourth row has the first term in each numerator anddenominator indexed by 4 and the second terms are indexed by 1, 2,and 3 (i.e., 4-1). In general, the nth row is comprised of theordered set:
( Yn - Yj
~x i j=1,...,n-1)X n - Xj
To show the' geometrical significance of these computations giventhe following points:
POINT NUMBER 51 5.00000 .73820 .97516 .76667 1.24158POINT NUMBER 52 8.50000 .73820 .97516 .76667 1.26175POINT NUMBER 53 12.00000 .73820 .97516 .76667 1.27087POINT NUMBER 54 12.50000 .73820 .97516 .76667 1.27607POINT NUMBER 55 19.00000 .73820 .97516 .76667 1.27942
2-31
CAA-D-80- 1
and the difference quotients:
.00328 .00204 .001 000
.00270 .00168 .00122 00
Table 2-1. Table of Difference Quotients
The purpose of these computations will now be explained. The im-port of the quotients in triangle A is illustrated in Figure 2-1(drawn not to scale).
slope .00261
slope .00576 / ,-
slope .00418
51 52 53 54
Figure 2-1. Triangle A in Table 2-1
2-32
CAA-D-80-l
The figures in triangle B show that;
slope .00096
slope .00148 ~"
Sslope .00122
53 54 55 56
Figure 2-2. Triangle B in Table 2-1
The fourth line gives the following picture (not to scale):
slope .00148
slope .00204-,-
- slope .00328
51 52 53 54 5
Figure 2-3. Slopes on the Fourth Line of Table 2-1
2-33
CAA-D-80- 1
Note that since this is the fourth row, all lines have the fourthpoint as terminus, reading from left to right. The second columngives the following picture (not to scale):
slope .00261
slope .00204 -
slope .00168
51 52 53 54 55
Figure 2-4. Slopes on the Second Column of Table 2-1
Note that since this is the second column, all lines start atpoint number 52, reading from left to right.
2-34
CAA-D-80-1
b. Sample VARVARY1 Output Files and Descriptions
(1) Standard Format File on Unit 12--Points
225 4 .0010000(6(7X,F13.5))
5.00000 .50000 .50000 .50000 .738218.50000 .50000 .50000 .50000 .7393412.00000 .50000 .50000 .50000 .7398515.50000 .50000 .50000 .50000 .7401419.00000 .50000 .50000 .50000 .74033
The first row indicates that there are 225 points in the file,that there are four variables (the rightmost column gives the out-put values), and that numbers smaller than .001 are considered tobe zero. The second row gives the format in which the file waswritten, which may be used for reading in the file. The 225points and values commence at line 3 and comprise the remainder ofthe file. (Only five points are illustrated.)
(2) Standard Format File on Unit 11--Gradients
225 4 .0010000(6(7X,F13.5))
.00048 .30919 .67048 .34638
.00019 .32471 .68200 .34773
.00010 .33081 .68706 .34836
.00006 .33495 .68991 .34871
.00004 .33762 .69173 .34894
The first two rows of this file are described as above. The gra-
dients comprise the following rows.
(3) Scratch Files
(a) Unit 13
-19.00100 4.00100 .00048 .30919 .67048 .3463820.00100 4.00100 .00055 .37265 .66454 .3468421.00100 4.00100 .00061 .43536 .65859 .3473122.00100 4.00100 .00067 .49823 .65264 .3477823.00100 4.00100 .00072 .56128 .64668 .3482524.00100 4.00100 .00076 .62451 .64071 .3487225.00100 4.00100 .00079 .68?90 .63473 .34920-26.00100 1.00100 .00359 .35940 .65458 .40207
2-35
CAA-D-80- 1
The first column is a point count. A negative sign indicates anew variable is being varied. The second column indicates whichvariable is being varied. Columns 3 through 6 are the gradientvalues for variables 1 to 4, respectively.
(b) Unit 14
5.00000 .50000 .50000 .50000 .738218.50000 .50000 .50000 .50000 .7393412.00000 .50000 .50000 .50000 .7398515.50000 .50000 .50000 .50000 .7401419.00000 .50000 .50000 .50000 .740335.00000 .50000 .50000 .50000 .738215.00000 2.00000 .50000 .50000 1.10039
The first four columns indicate variable values. The fifth columngives the output values, each one corresponding to the input val-ues listed on the same row.
2-36
CAA-D-80-1
2-13. VARVARYl ROUTINE LISTING
PARAMETER rILE1:1lJvrLE4zl3,NOVALS=100,INFILE=5.OUTFIL=6PARAMETER POINTS= 500 FLEZ:=11F rLE3=12,FILr=14
CDIMENSION TUPLE3(NOVAL I ,LGWBDSENOVAL;) .HYROSPtJOVALSI sINCRENOVALS)VIMFNS!ON VALUF!:INCVALS3,SRAD(N(OVALS)oVALU(PCINTS~,LINEIPOINTSI
CREAL TUPLES sLOW90DStHYRPS v NCR vVALUE So VALUF v VALUoL INE vINCRIREAL PARTYLtF.:,F& .CPSLON
INTEGER NOVARSNOPTS*IJKvLPv.C
CI4ARACTVR.S0 F~qMT1. FO'4T2 ,FDRM T3 ,FOPMT4C
REWIND FILEIREWIND FILE2REWIND FILE3REWIND FILE4REW:NO FILES
READCFTLEl.'rl000 I NOFTS@NOVAR:;.FPSLON1UDUD FORMAT([email protected])
READF:LEolunlirj FORMT1100O10 FORI4ATfASO)
READ(INrILCIUD1U) FC'MT2REAC(INFILrFOFMT2I (LOWBDS(I)r!1OOVARS)PEACI INFILEvl"C'?172) lHYlDSlI),I~lvNOVARSIFEADEINFILEuFORMT21 (!NCR(IlvI:1,oN0VARSlk EA Dl INFILF .1~D10 I FORMTi3PFA DI INFILF olUD1O) FORMT4WRIlTE IOUTFILvlDl)tJ)
lU030 FORMATI I//IDO 4UD PZ1,NDPTSREAD(F!LE1#FCPMTII (TUFLESl ),Il 1,NO'dARSIDO IUU !:1vNQVAPSWRITE (OUTFILt1IOU701 I
10070 FCRMAT(lX~lUtlH-Ue'VARYING VARTAeLF NUMBER ,1T3,104IHt43//IDO 500 J1,vNOVARSVALUE SE J)TUPtLES(J)
Soo CONTINUE10(i I(ZINTIIHYBD)SII)-LDWPCS(lI) /INCR(IiI1
0O 2003 J=OKVALUESI 1JZLOWBDSII)+J*INCRIIICALL PRFPRIVRtUFStVfALUE)GZQ+1WRITE(OUTFILvFDRMT'l (;,IVALUE~i(L)vL:1,NOVARSI .VALUEWRITEIFILE5#FCPMTI) lVALUESfL),L:1,NOVAR!:)oVALUFVALUE J*1 IVALUF
2-37
C AA- D- 80-1
P 0:0.OP SL ONVI: I4EPSLONDO 15n L1,PNOVARSCALL PARIL(NOVARSLVALUESEPS LOHPAPTYLINCRlVALUEICRAD( U PAATYL
151) CONTINUEIF (j *EG. 0) FO=-F1WRITE (FILF.4 PORMT I) FGvF It (GRAtO(L)9L :-I* NOV ARS I
z00 CONTINUFWRITE IOUTFIL91005U)
10050 FORMATl/,1X,2OEIH+)o*DIFFERENCF GUCTIFNT MATRIX*920(lH,1,/)D0 100 J=0,KDO GU0 L=O,jLINEIL41):E VALU(J+1)-VALU IL+lp I fMAXO(IJ*L. ii INCR( I))
F, ) r CONTINUFWRITE (OUTFILsFORMT41 (LINECL41IL:ZUvj)
700 CONTINUE6RITE (OUTFTL, 100601
10060 FORMAT(/I300 CONTINUE
WRITE(OUTFILilD003U) P10030 EORMATE/,lX93(IH/),lEN0 OF COMPUTATIONS FOR POINT NUMBER '
I I5v3Xt3D(lH/1.///I4[00 CONT.NUE
WRITE(FILE2@10000) ')YNOVARS@EP'LONWRITE(FILE2#10O)log 'CRMT1WRITE(FILE3+.I00001 QtNCVARSvEP;LCN
REWIND FILE4REWIND FILESWRITE (OUTFILtIOOC9 I
160110 PORmATf//p1X,3JI1H 1,-74E CORRESPONDING GRADIENTS'#/)DO 800 PzlOREAD(FILE4,FCPMT11 FQ9FIql'RA0(L, ,L=19NOVARSlPEAO(FILE5,FCRMTI I (V4LUESlL).LZ1.J0VARS),VALUFIF (PG *GT. D.) GOTO 7511F 0:-EQK:I NTIFl)WRITE(OUTFIL@loloo) 11
10100 FORMAT(/910(IH It' THE0 VARIACLE VARIED IS NUMBER '9150/)750 J=INTIFQI
WRITE (OUTFILPFORMT3) Jt(GRAC(L IvLZ1.NOVARS)WRITE(FILE3vFORNMTjI (VALUES(LIL:19NOVARS,9.ALUEWRITE(ILE2.EromTil (GRADlILLvNOVlRS)
1300 CONTINUE
WRITE (OUTFIL9100AO I10040 FORMATf I//I
END
2-38
CAA-D-80-1
2-14. VARVARYl. ROUTINE FLOWCHART
Rew 1 ndthe
fe]
nf .' ., he
t, ie z"raipp:ox ima tor
front the file
Rtead inti1e fould
"i ft 1mt
tiit
Pead in
."af., th
c-r r e a
F d i fe e e
iit iett
Reald, i n t he
St a st
Deiethe1Fat all ((.Ii
le aled
2-39
CAA-D--80-1
I nc
'w, I e'
th!
PRI In
r.utin,. atthn ne. I Lo
P, i,, ''p
Wniir' tlhpCu - dirraf no
Write the poin t
/no.,*frlllr
on a lirOI, N
I-I In
No hi7)~ d
2-40
CAA-D-80-1
3)
1) r i I n I ts No<rr Jcnrocesse
Yes
Write outheaders Fo Istalida I d
filesJ1.I I"I
Read ita poillfand it,,
radien'
Newvariable Yes
being varied? Printa
messagedescribijngNo evariab
-rrir-n t thepoint miffiberand qradiont
ri P. epoill! "if,
value into onestanddrd file,
the niidientinto the other
No om-
nleted theast poin
Yes
2-41
CAA-D-80-1
CHAPTER 3
THE ANALYZ SUBSYSTEM
3-1. INTRODUCTION. This routine computes variable sensitivitystatiStics from gradients in a standard format file on unit 11.Statistics are initially computed on each gradient. The gradientsare summed, component by component, and the same statistics arecomputed for the sum vector.
3-2. DISCUSSION OF STATISTICS
a. The first statistic is the ratio of each componentof the gradient to the component with the smallest abso-
lute value.
b. The second statistic is the change in the component re-quired to achieve a unit change in the output for each componentof the gradient. For the summed vector, a change in the outputequal to the number of gradients rather than a unit change isutilized.
c. The third statistic is the ratio of each component to thecomponent with the largest absolute value; except that for thelargest component, its ratio with the next largest component istaken.
3-3. LIMITATIONS
a. The gradients input to ANALYZ must all be real.
b. No more than 500 gradients can be analyzed in a single runby the currently compiled version of ANALYZ.
c. No more than 20 variables way be analyzed by the currentversion of ANIALYZ.
3-4. RUN SETUPS
a. To Execute
@USE 11, name of file containing gradients in standard format.
OASG,A filename.
@XQl 03PROGTEST.ANALYZ
[Input deck]
3-1
CAA-D-80-1
b. Description of Input Deck
(1) Line 1. Field: Al
Format: 13
Al is +1 if no debugging informiation is desired, -1 if debuggingis desired.
(2) Line 2. (Format for printing the statistics.)
(3) Line 3. (Format for debug printouts.)
c. Sample Input Data
+1 Indicates no debugging output re-quested.
(6(7X,F13.5),/,l00(21X,5(FI3.5,7X) ,/)) Format for statisti-cal output
(6(lX,F13.5) ,/,l00(21X,5(F13.5,7X) ,/)) Debugging data outputformat
d. Input File Description on Unit 11
Produced by POINVCOMP on Unit 11
9 4 .0010000(R(7,F13.5))
A00048 .30919 .67048 .34638.00359 .35940 .65458 .4020-1.00852 .40086 .63565 .451,44.01236 .42295 .62294 .479)42.01428 .43221 .61698 .49139.01500 .43545 .61481 .49560.01522 .43641 .61415 A49686.01523 .43631 .61415 .49674.0152, .43670 .61405 .49663
(1) Line I
(a) Format: 15, 13, F10.7.
CAA-0-80-I
(b) Meaning: Nine lines, four variables, zero approxima-tot .001.
(2) Line 2. Format for reading in the following lines ofdata, one at a time.
(3) Other Lines. Each row is a gradient, variable I valuesare in the leftmost olumn, variable 2 values are in the next col-umn, etc.
e. Sample Run Setup
@USE II,03MAT2.
@ASG,A 03MAT2.
@XOT 03PROGTEST.ANALYZ+1
(6(7X,F13.5),/,100(21X,5(FI3.5,7X),/))
(b(7X,F13.5),/,100(21X,5(F13.5,7X),/))
3-5. OUTPUT DESCRIPTION AND SAMPLE OUTPUT
a. Sample Output--Gradient by Gradient
STATISTICS ON EACH GRADIENT
************************EQUIVALENT CHANGES************************
.00000 3.23426 1.48147 2.88/00278.55153 2.78242 1.52770 2.48/13117.37089 2.49464 1.57319 2.2151380.90615 2.36435 1.60529 2.0858570.02801 2.31369 1.62080 2.0350466.66667 2.29647 1.62652 2.0177665.70302 2.29142 1.62827 2.0126465.65988 2.29195 1.62827 2.0131365.48788 2.28990 1.62853 2.01357
3-3
/I
(AA-D-80-I
***************************C*O***MPA*****************
.00000 .46155 1.93568 .51661
.00548 .54905 1.62802 .61424
.01340 .63063 1.40805 .71020
.01984 .67896 1.29936 .7b961
.02314 .70053 1.25558 .19644
.02440 .70827 1.24054 .80610
.02478 .71059 1.23606 .80902
.02480 .71043 1.23636 .80883
.02487 .71118 1.23643 .80878
*************************RELATIVE RATIOS***********************k**
.00000 1.00000 2.16850 1.120281.00000 100.11142 182.33426 111.997211.00000 47.04930 74.60681 52.985911.00000 34.21926 50.39968 38.788031.00000 30.26681 43.20588 34.411061.00000 29.03000 40.99733 33.040001.00000 28.67346 40.35151 32.645201.00000 28.64806 40.32502 32.615891.00000 28.59856 40.21284 32.523K5
b. Description. The preceding statistics are described inparagraph 3-?. -Fr each statistic, each row corresponds to agradi ent.
c. Sample Output--Sum of Gradients
SUMMED GRADIENT COMPUTATIONS
*************************SUMMEI) GRADIENTS*************************
.09947 3.66948 5.65779 4.15653
********************EQUVALENT SUMMED CHANGES********************
90.47954 ?.45266 1.59073 2.16427
3-4
I!
CAA-D-80-1
*****k*****************SUMMED COMPARISONS************************
.017b8 .64857 1.36118 .73466
**************k*******RELATIVL SUMMED RATIOS**********************
1.00000 36.89032 56.87936 41.78677
d. Description. The first row is the sum of the gradients.The last three rows are the same statistics as before, in the sameorder, but applied to the sum vector only.
3-5
CAA- D- 80-1
3-6. ANALYZ ROW. -LISTING
1. PARAMETEP FILE2=jjvINFTLF-5tOUTFTLzEL2. PARAMETER NOVAL=2UtN0GRA:51Jfl
4. n?'PENSION G-RAD INCGAtNOVALS )*FMINSI NUGPAO3.C#rSms(NOVALS IS. DLMENSION RI4X(NOC.;A)22J,MAXS(If?.R"NTINOVALSI
;. ct,-AL !RADRMIN',tC ;UM;, XMAS.CSAXC.#P~ I4TEPSLON
3. INTEGER C.I.V.'VARSN*tA;;SjITCqit). Cit. CHARACTEF'*8U FMTROt~mTW,7T*FMTCE,312. L
1.: C RFAC THE !NPUTS
15. RFEADEINFIL~v ,il) SWIT7H16. ifit) FORMAT(13117. PrAO(INFTLE #2LU I FM TWRT18. 2Uli FORMAT(A8Q)
7Z. REWIND FILE2
23. READI FILE293003l NCRwNOVARSoEF-.LON24. 3UUi FORMAT1I59I39F(J.7)
?5. REAO(FILE2,ZOO) FMTRC26. 00 4010 G:1,NCCRD27. REAO(FILF29FMTRO) (GFA~fGV ~,V:1,NOVA'l)24. 400j CONTINUE21. C3n. C READ) Tr4 I"'BUG MODE FC"IMAT 'tE TN .FBU! MODE31. C32. IF 11WITCH .Eg. -1) O'EV~tNFILE&?I001 FM7D3G33. C *e.a.34. IF (SWITCH .NE. -1) '3CTC ?UziDU35. WRITE(OUTFILt2UDflU) NOCP 'tNOVAPS3 G. 20f0i1U FORMAT(h/,' **INPUT*** o' I3 1. 00 211GuU C=1,NOGPD31). WRT GfCUTFILwFV-' RG) ('PAr~fGvV),V=1tNCVARS)313. iflluv CONTINUE41J. 2 0r.- f) CONTINUE41. C42. c43. c COMrUTE ROW MINIMA44. c45. 0O ?750 G71PNOGRCits. CO SU0 VZl PNCVAqs4 ?. RMNSIG)=0.G4A. IF lAB'CfGPADIG.I)J LT. FPSLON) ^,CO 'IOU49. RMNAG,:A9SIGRAn'ICvV)
3-6
CAA-D-80-1
5.9t CCTG 6UuF,. 1 501 CONTINUE
52. E0u 0O 700 V:1,NOVARSC!3* IF IABSIC'RADtISII~ *LT. EPSLON) COAOIOV):U.054. lF IARSICRAO(GeVI) *LT. EPSLO141 rCTO 70055. IF (ASSIGRAOI GeV) I.LT. RM4INSIG) I RNINS(CIZASSAGRAO(GoVI I5G. 10 0 CONTINUE57. 75u CONTINUE58. C59. TF (SWITCH *NE. -ij C3Tr 2U40UUED. WRITE (OUTFIL9ZU!0)
C2. WRlT! I0UTFIL9FMTl)'2 (R41INSlGltG:lvN0CRDlF)3. 2U', UI. CONTINUE(4. CF 5. C6G. CCOMPUTE THE COLUMN SUMASF7. CFs. D0 iUt) V:19NOVXRS69. cSUMSIV)=rl.70. CO SOU G1.tNOGkD71. C:SUMS(V)=CSUMSE Vl+GRA3(GoVl7.1. SOL CONTINUE73. IF (ABS(CCUMS(vfl *LT. fNOGRC.EPSLON)) CSUMCtV)=D.074. 9duL CONTINUE75, CSFIN=ABSICSUMSI11))76. CO IIUU Vz2PNCVAFV77. !F (A8S(CSUMS(Vl) .LT. (NCCR0.CPSLONfl GOTO 1OLDO78. IF (A3StC7UMS(Yli .LT. StMTA4I C:WmN3SCSUMV~ll73. 1LILU !7CNTINUEI80. C81. C TO COMPUTE THE TWC DI'-TINCT LARGEST FARTTALS(IN AQSOLUTE VALUE)92. C TN EACH GRADTFNTaB!. C84. T (NOVARS -LT. 21 GOT IC.UU85. 00O 13501 G-L1.NCGP!)86. PMAXS(G.llA6SfGRAD(Gtl))97. DO 11ULJ V=29NOVARS89. IF IABS(CPADIGPV)) riT. RMAXSIC91)) RMAXSlG#1)=ABSGRADIt.VllE 3. 1llDu CONTINUE90. 0O 1150 V=19NCVAR,91. IF 14S(GRAD(GoVil *LT. EPSLON) COTO 115092. IF 1ABSIGRAOIGoV) .C7. RI4AXSIGil)) GOTO 11509!. RMAXSlG92)zAeS(GRAD(G.Vl)94. G070 120095. 1150 CONTINUi96. RMAXS(Ge21=RMAYSlG,1 I937. COTO 135n1
3-7
LAA-fl-80-1
93. 1200 DO 13UO V=1@NCVARS99. IF I( AE3f GRAf(G 9V)) CT.PMAX'fGv2)) AND. (AF3(GRAD(GvV I) .
100. 1 PMAXSI'3.1lI) RMAXS((C,?=A9SI3RA)(GvVf)101i. 13UU. CONTINUE10j2. 1350 CONTINUE103. C **.t.
104l. IF fSWITCP .NE. -11 "') 71.0611V5. WRITEIOUTFIL9217l02106. 211700 FORZMAT(/v* **ROW MAXIMlh..'t/)1L7. DO 2U90U G=1,NOC'PDIca. WRITF (OUTVILPVMTfDFG I (rA!'1GVI ,VzNfVARC;)ePMAXStG,1) .RMAXSl ,?1109. 2059U0 CCNTINUE110. 21CUOn CONTINUE111. C11?. C113. C TO COMPUTE THlE TWO LARGEST 'fl'PONENTS OF CSUMS IN ARSOLUTE VALUE114. C115. rMAXS(1)=AICV"UMS(1))11G. 00 14L) Vr729N0VAR-,i17. IF lA'SICSUM!1VI) .11T. 1-7AXS41)) CSMAXS1):&'3C(CSUMSfVl)113. 1,4 cJU CON TI NU E1113. tIC 147S V719NOVAR120. IF IAI3S(CSUMSMV) .LT. IN"'Cqn1P LON)) GOTO 1425121. IF (APSICSUMS(V)) *GF. S-'MAXS(3j1 6070 1425172. rSMAXS(2j:A95ll-C;UMSfV))12 3. 33010 14511124. 14,:5 CONT:NUE12E. '7PMAXS(22:CSmAxII)126. C010 1550127. 14',L '10 1!0(j V=1,fCVARS123. IF ((AB';(CSUM33(Vll .'T1. C£'MAX3EI.I) .AND. (AB'7(CSUMSIV)l .LT.121. 1 CSMAX33(1fl) C;AXS2):ASlESL~lVtV)?130. i5tUO CONTINUE131. 15rU CONT!NUE132. C *....133. IF (rWITCM .NE. -1) JTO Z13100134. WRTE(OUTTL@21lrOU)135. 211U.1I rORMATI,,. **C;UMS MA>1A..'./3136. W!ITE (CUTrILtViT'9G) IC-,UY(VI.V:1NOVARzI ,CC7dAXSdt3,CSMAXSI2I117. ~13 UU CONTINUE
13 3. 16UU rON T :NUE140O. C141. C TO COMFUTF TH!r RELATIVE PA1IC142. C14 !. WRI TF IOUTF L 911130014ll. 10000 FORMAT(//#1X,3111H.3.tPrLATIV' PATIOS!0l1H.) ./l14!'. PO 1860 G=11NG3Rr
3-8
CAA-D-80-1
146. 00 1700 Vzl*NOVARS147. PRINTIV)zl.U148. IF ( RMINS(G) .GF. EPSLON I PR:NTfV)GRA(GtVI/RMTNS(G)l4q. 1700 CONTINUE150. WRITE(OUTFIL.FMTWRTI (PPTNT(VlV=1,NOVARSl
151. 18013 CONTINUE152. C153. C PRINT THE EGUTVALENT CHANCf-154. C
155. WRITEIOUTFIL9101l0)4ISE. lJ1UI) FORMATI//,1X,31111H.).'E3U;TVALENT 'HANGrsoo3u(iHo./i11F7. r00 ZUO~j C:1.NOCRD158. DO iJUC V=1.NCVARS159. FRINT(VIZbU
160. IF ( GRADIGPV) .CF. E PSLVN ) PRIKT(V):1./GRAV(GoV)16 1. 19EUri CONTINUE162. WRITE IOUTFIL*FM~TWRTI (F-IINTIV) ,V71tNOVARS)1L13. 20L0 CONTINUE16 4. C165. C FRTNT THE COMPARTSONS166. C167T. IF INGVARS *LT. 21 G3(10 :I2ruIF 8. WRITE(OUTFILs10201
170. 00 2200 SZ19NOGRfO171. DO 21UG V=19NOVARS172. PRI NT(V I =.0173. IF ( RKAXS(3911 .GE. EPSLON I PRINTfV):GkADICqV)/RMAXSIG,1)174. IF IASS(PRINTIV)) E6G. l.) PRlNT(VJZGRADIGVI/RMAXSfG#2)17S. 21(UU CONTINUE176. WRITE IOUTFILFMTWPT) (i PrINTtVI ,V:lNOVAR!I177. 22UU CONTINUE178. 22E0 CONTINUE171). C180. C SUMME) bRADTF*NT CCMPUTATTW,-,
181. C182. WRI TE (CUTFILv 1113011)183. 111201) FOR;MAT//v1X,3CH *9!CIIMMED 3RADIENT C0MPUTATONS'3UIHl./)1854. C195. C WRITE CUT THE SUMMED C RADT!INTS186. C187. WRI TF IOUTFIL P1U3ELJ188. 1a3250 roRMATl//t1X#3IJI1H.I .'UMMED GRAOTENTS',3011H'Ie/l
189. WPITE(OUTFILFMTWOT) fC-UMS4VI .V:1,NOVARIl190. C191. C COMPUTE THE SUMMED RATIOS192. C
3-9
f'\A-D-80-1
193. WRITFICUTFIL9104fl)1914. 1U4011 FORMAT(//,1Xv3U(lH. I.PFLATiVE SUMOME) PATIOS'93U0i.H' 3/1195. DO lLl5L)U V=1#NCVARS196. P91INT (V )0.U197. IF (CSMIN *GE. rPSLGN I PRINTfV)=CSUMS(V)/CZ MIN193. 143 0U CChTINUE199. WRITE(OUTFILPFMTWRTI (l:')NT(V)rV71,NOVARS)200. C201. C COPPUTr THE SUMMFO ['GUI VALtN I CHANCES202. C203. WRI Tr 10UT FIL 9 lt6tl332014. luU0 r"OkMA T(/,X t3111 H. I ).U V ALF NT 7U Mtl D C HAN ES 30 IHo IP/)20?5. CC 10j700 V1.oNCV5P2l6. FPINT(v):fl.u20 7. !F (CSUPO'(VJ SZF. FrPLONI ) rRINTiVW:,GP0/C-UMS(V)20 3. 111710 CONTI NUE2093. WRITrfOUTfE1LFMT%4P7) I "i IT IV I PV : 1 9NfJVAI'21 U. I211. C COMPUTE ummrF! CfOmrAPISCN£21'. r213. !F ( NOVARS *LT. 2) GTU 11000214. WRITF(OUTFIL9l1taOO)215. lu800 rORMATl/1X3t(lH*4 1. UMMEU COMPARISONS' 3tiflH. 3,/I216. CDO 103LU V=19NLVAPS217. PRINT(VJ=O.3211. IF I CSM4XSI11 CGE. EP£LC,4 I V'RINT(V):CSUMStVf/CSMAXSf1I213. IF (ABSIPPINT(V1) .EQ. 1.1 PPINT(V)ZC£,UMS(V)/CSMAXS(2)220. 11)900 CONTINUE221. WPITEEfOUTFILF7MTWq1I t,-UTIV1,V:lPNOVARSI?22?. 11 0 CONTINUE
"21.W~I Tr(IOUTE IL. 111113 I224. 11100( FCPMATI///)125.NC
3-ia
I.AA-D-8l-1
3-7. ANALYZ ROUTINE FLOWCHART
"td) t
Readdebug/nude~bun
Rea d
Pedin tlie um -b er of qradients,
/n. () f 11asit 1,d (-Snd smal 1nes,
the formatfar file
eadwain
the d3-mi
CAA-D-80-1
el r I ot ao d l ti n t s
Find thefir ?t
non-tv vialnt.
el eme ]
Set sinallvallies to7ero
FlnI Ile
tr i v I a I n-,,r) r, Ifor pach qradign,
,4n debu fesode?" i
W, P, I ot I ha I le, t
om po n n t
I I r
rmnpW, theC or qwn of
t hewadients
Wa les t no,')f
,pc t Or
I 1w, the
,,Mvnnp"tea,
3-12
CAA-D-80-1
gradienhave a '.1 Her Nunon-trivialcomponent
Yes Set the tlargest
omponent equal
o the largest
F i 1'next I ai)-,component to
4
the gadient
No Doneall gradt-
e
nt
1. dbug Yes
?No P r i n t dI el q aed,
en t' "voand .re,components
Fin d thelargestc omponent ofthe sum vector
have a sm, NOnon-trJv!;lcomponent
< the
No Ise theJ.r'e', asYes r "!":ast e e nd
Use i I larg st Ia ,, ,,,
I a, 'P
Find th, e x t
lar,,es t OrIvone"tof th gradient
(4)
3-13
CAA-D-80- I
hip larget nd
11, Il
F iitii nj n igrral i i
Yes n
1-14
CAA-D-80- 1
radient
To ye~sexamninethe nextgrad ,ent Only Yes
o3-1
CAA-D-80- 1
Compute and printthe same statistics
for the l-umtvector
CStop
3-16(
CAA-D-80-1
CHAPTER 4
THE GRID SUBSYSTEM
Section 1. THE GRID ROUTINE
4-1. INTRODUCTION. This routine utilizes a user specified sub-division of each variable in order to generate a grid of inputvariable values. The routine to be tested is evaluated at eachnode of the grid, and the gradients are also computed at eachnode. The output of the grid routine is used by REARRANGF andDIFFQUOT.
4-2. LIMITATIONS
a. As corently compiled, the routine is restricted to 20 in-put variables at the most.
b. All input variables (being varied) must be real.
c. Only one output from the routine being tested may bechecked out at one time.
d. Testing time-consuming Monte Carlo routines may be too ex-pensive. Rather than making several runs per point and averagingthe output values, it is better to run one component of the systemat a time, testing random variables no differently from determi-nistic variables.
e. The function represented by the routine being tested mustbe well-behaved.
4-3. RUN SETUPS
a. To Develop an Absolute ASCI Program File
@MAP,S name to be given to absolute element
IN 03PROGTEST.GRID.
IN 03PRDGTEST.PARTIAL.
IN element containing the driver PREPR.
IN programs to be Lested.
LIB$*FTN8.
END.
4-1
CAA-D-80-1
b. To Execute
@USE 10, name of file into which points will be stored.
@ASG,A name of this file.
@USE 11, name of file into which gradients will be stored.
@ASG,A name of this file.
@USE 12, name of scratch file (used as input to REARRANGE andDIFFQUOT).
@ASG,A name of this file.
@USE 13, name of scratch file.
@ASG,A name of this file.
@XQT name of absolute deck created by @MAP.
[Input deck]
c. -Description of the Input Deck
(1) Line 1. Number of variables - 13
Zero approxiidtol - F10.7
Debug mode field - 13
The zero approximator is a threshold- numbers smaller in absolutevalue are considered to be zero. If the debug mode field containsthe numhet -1, the run will be in debug mode. Any other value im-plies run will not print debugging information.
(2) Litie 2. (Format for reading in one line of variablevariativo data.)
(3) Line 3. Initial variable values. Variable one'sinitial valueis leftmost, variable two's initial value is to theright of variable one, etc.
(4) Line 4. Bounds for variable values.
(5) Line 5. Increment (step) value for each variable.
4-?
CAA-D-80-1
(6) Line 6. Format for one line of out put. First fieldshould be 16, other fields should be real. The number of fieldsspecified must be no less than number of variables + 1.
(7) Line I. File I/O format for one line of output. Allfields shouTd-- real and at least (number of variables + 2)fields nmost be specified.
(8) Line 8. Optional; should contain a format for writingone line oT-debugging data if in debug mode.
d. Sample Input Data
4 .001 +1 Four variables. Zero ap-proximator value of .001.Not in debug mode
(13F6.0) Format for reading vari-
able variation data
5.0 0.5 0.5 0.5 Initial values
18.00 9.00 48.00 0.9 Terminating values for in-crementat ion
3.5 1.5 10.0 0.1 Step values for each vari-
able
(' POINT NUMBER ',16,5(7X,F13.51)) Format for output
(6(7X,F13.5)) File I/0 format
Not a debugging run, so debugging format is omitted.
e. Sample Run Setup
USE 10,03MAT5.
@ASG,A 03MAT5.
@USE 11,03MAT6.
@ASG,A 03MAT6.
@USE 12,03MAT7.
@ASG,A 03MAT7.
4-3
ICAA-D-8U-1
@USE 13,03MAT8.
@ASG,A 03MA18.
@XQT 03PROGTEST.COMGRIDI.
4 .001 +1
(13F6.0)5.0 0.5 0.5 0.5
18.00 9.00 48.00 0.9
3.5 1.5 10.0 0.1
( POINT NUMBER ',16,5(7X,F13.5))
(6(7X,F13.5))
4-4. OUTPUT DESCRIPTIONS AND SAMPLE OUTPUT. These outputs are ofthe same types as the outputs of POINTCOMP and are comprised ofvariable values and gradients. The two routines differ in thepoint selection algorithm.
a. Sample Output--Variable Values and Output Values
VARIABLE NUMBER 3 HAS BEEN INCREMENTED
POINT NUMBER 31 5.00000 .50000 50.50000 .50000 34.26218POINT NUMBER 32 5.00000 .50000 50.50000 .60000 33.99982POINT NUMBER 33 5.00000 .50000 50.50000 .70000 33.73710POINT NUMBER 34 5.00000 .50000 50.50000 .80000 33.47402POINT NUMBER 35 5.00000 .50000 50.50000 .90000 33.21060POINT NUMBER 36 5.00000 .50000 50.50000 1.00000 32.94681
VARIABLE NUMBER 2 HAS BEEN INCREMENTED
POINT NUMBER 3/ 5.00000 2.00000 .50000 .50000 1.10039POINT NUMBER 38 5.00000 2.00000 .50000 .60000 1.20860POINT NUMBER 39 5.00000 2.00000 .50000 .70000 1.31727POINT NUMBER 40 5.00000 2.00000 .50000 .80000 1.42641POINT NUMBER 41 5.00000 2.00000 .50000 .90000 1.53502POINT NUMBER 42 5.00000 2.00000 .50000 1.00000 1.64610
4-1
CAA-D-8I-
VARIABLE NUMBER 3 HAS BEEN INCREMENTED
POINT NUMBER 43 5.00000 2.00000 10.50000 .50000 7.16476POINT NUMBER 44 5.00000 2.00000 10.50000 .60000 7.08334POINT NUMBER 45 5.00000 2.00000 10.50000 .70000 7.00158POINT NUMBER 46 5.00000 2.00000 10.50000 .80000 6.91946POINT NUMBER 47 5.00000 2.00000 10.50000 .90000 6.83699POINT NUMBER 48 5.00000 2.00000 10.50000 1.00000 6.75416POINT NUMBER 48 5.00000 2.00000 10.50000 1.00000 6.75416
In each row, the four columns to the right of the point numbercontain the four input variable values, and the fifth contains thecorrespondinq output value from the routine being tested. Thefirst variable, as usual, is the leftmost, i.e., in the column tothe right of the point number. Note that in each group, the last(fourth) variable is being varied through its range while theother variable values remain fixed. The headings explain how thisgroup differs from the preceding group. Whenever the first, sec-ond, or third variable is incremented, the variables to its rightare reset to their initial values.
b. Sample Output--Gradients
VARIABLE NUMBER 3 HAS BEEN INCREMENTED
POINT NUMBER 31 .26871 -2.38501 .67048 -2.62300POINT NUMBER 32 .32286 -2.86548 .66454 -2.62653POINT NUMBER 33 .37827 -3.34741 .65860 -2.63007POINT NUMBER 34 .43280 -3.83228 .65264 -2.63362POINT NUMBER 35 .48479 -4.31738 .64668 -2.63718POINT NUMBER 36 .54242 -4.80347 .64071 -2.64073
VARIABLE NUMO1CR 2 HAS BEEN INCREMENTED
POINT NUMBER 37 .02158 .18565 .60644 1.08123POINT NUMBER 38 .02576 .22479 .58747 1.08586POINT NUMBER 39 .03090 .26340 .56843 1.09051POINT NUMBER 40 .03513 .30235 .54930 1.09520POINT NUMBER 41 .03931 .34164 .53010 1.09991POINT NUMBER 42 .04344 .38127 .51081 1.10466
VARIABLE NUMBER 3 HAS BEEN INCREMENTED
POINT NUMBER 43 .15683 -.14934 .60644 -.81352POINT NUMBER 44 .18874 -.17997 .58747 -.81700POINT NUMBER 45 .22084 -.21085 .56843 -.82051POINT NUMBER 46 .25426 -.24200 .54930 -.82403POINT NUMBER 47 .28688 -.27446 .53010 -.82758POINT NUMBER 48 .31969 -.30626 .51081 -.83115
4-5
LAA-U--3U-1i
The point numbers link the gradients to the variable values atwhich the gradients were computed.
c. Sample Output Files. On unit 10--points in standard for-mat.
1260 4 .001000(6(7X,F13.5))
5.00000 .50000 .50000 .50000 .738215.00000 .50000 .50000 .60000 .772765.00000 .50000 .50000 .70000 .807355.00000 .50000 .50000 .80000 .841995.00000 .50000 .,0000 .90000 .876675.00000 .50000 .50000 1.00000 .911405.00000 .50000 10.50000 .50000 7.443015.00000 .50000 10.50000 .60000 7.418175.00000 .50000 10.50000 .70000 7.39330
The first line is the standard heading, component of:
(1) The number of points in 15 format.
(2) The number of variables in 13 format.
(3) The zero approximator in F1O.7 format.
The second line is the format used to write/read the file. Thefollowing lines comprise the variable values and correspondirngoutput values.
d. On Unit 11--Gradients in Standard Format
1260 4 .0010000(6(7X,F13.5))
.00048 .30919 .67048 .34638on055 .37265 .66454 .34684•00061 .43536 .65859 .34731.00061 .49823 .65264 .34778.00072 .56128 .64668 .34825.00076 .62541 .64071 .34872.0532') -.22734 .67048 -.24905.06396 -.27318 .66454 -.24938.07469 -.31915 .65859 -.24972
The first two lines are as described previously. The followinglines contain gradient values corresponding to the variable valuescontained in the previously described file.
4-6
CAA-D-80-1
e. On Unit 12--File Used to Communicate with DIFFQUOT andREARRANU-
5.00000 .5000 .50000 .50000 .73821 4.001005.00000 .50000 .50000 .60000 .77276 4.001005.00000 .50000 .50000 .70000 .80735 4.001005.00000 .50000 .50000 .80000 .84199 4.001005.00000 .50000 .50000 .90000 .87667 4.001005.00000 .50000 .50000 1.00000 .91140 4.001005.00000 .50000 10.50000 .50000 7.44301 3.001005.00000 .50000 10.50000 .60000 7.41817 4.001005.00000 .50000 10.50000 .70000 7.39330 4.00100
In each row, the first four columns represent variable values.The fifth column contains output values. The integer portion ofthe sixth number is the variable being varied in obtaining thevalues for that row. The rightmost column is used by REARRANGEand DIFFQUOT. This file is written and may be read by the formatlocated at the second line of the standard format files on units10 and 11.
f. On Unit 13--Scratch File Containing Gradients
.00048 .30919 .67048 .34638 .73821
.00055 .37265 .66454 .34684 .77276
.00061 .43536 .65859 .34731 .80735
.00067 .49823 .65264 .34778 .84199
.00072 .56128 .64668 .34825 .87667
.00076 .62451 .64071 .34872 .91140
.05325 -.22734 .67048 -.24905 7.44301
.06396 -.27318 .66454 -.24938 7.41817
.07469 -.31915 .65859 -.24972 7.39330
The first four columns contain the gradient components. The fifthcolumn contains the variable values corresponding to the inputvariable values at which the gradient was evaluated. This filewas also written and may be read using the format on the secondline of the files on units 10 and 11.
4-7
CAA-V-80- 1
4-i. GRID RUUIINL LISTING
PARAMETER INFtLE=5,OUTFIL=6,FILE1Z1D,FILE2Zl1 ,FILE3=12.FILEM=13PARAMETER NOVALS=20,NOVAL1=NOVALS,1.NDVAL2=NOVAL1,1
DIMENSION FSTVAL (NOVALSI ,LSTVAL(NOVALS2 ,STEPS (NOVALS I VALU(NOVALSIDIMENSION COUNTS(NOVALS2,LI4E(NOVAL*-2,GRAD(NOVALSI
CINTEGER NOV ARS9"W ITCH* POINTS #COUNTSINTEGER PTP*PTRloVoP
CREAL FSTVAL ,LSTVALlTEPSVALU, 'AD, VALUEgLINEREAL EPSLONsPARTYL@INCRIFPTR
CCHARACTFR.80 rMTROFMTPRT*FMTFIL .FMTDBG
CC INITIALIZATION
REWING FILE1REWIND FILE2REWIND FILE3qEWIND rILE4READ(INFILEol10000) NOVARSEPSLONSWTTCH
10000 FOPMATI 13vrlO.7913)REACIINFIL1#10010) FMTRf)
100111 FORMATIA8O)READI INFILE .FMTRDI (E.STVAL 4VI ,V: 1N0VARS)READ(INFILE .FMTRD) (L3TVAL(VI ,V:1,vNOVARSJREADE INFILEtFMTRDI (I-TEPS(VIV=1,NCVAPS)P01 NTS=0P.EADIINFILE.1OC11u) FMTPPTREADIINFILEolUD101 FMTFILIF (SWITCH .F9. -1) REAC(INcrILEtlU01U1 FMTP,9rDO 100 V~lPNOVAqSVALUE V)=FSTVAL IV)
100 CONTINUFC ***o*
IF (SWITCH ONE. -11 CO'O 20000)WRITE (OUTFILtl11102U)
WRITE (OLITFIL9100251 NOVARSEE ,LONtSWITCH10025 F ORF.AT( [email protected]
WRITE ((UTFIL .1003b310030r FOPMAT(/vlXo*** FIRST VALUFS *'
WRITE (CUTFIL9FMTDBC) (FSTVALIV19V=1,NOVARS)WRITE EOUTFIL100'.L2
100lO FORMAT(/#lX,'** LAST VALUES **OfWRITE (OUTFILFMTOBZ' IL L'TVAL (VI ,V:"1 NCVARS)WRITE (OUTFILvlflO5U)
10050 FOR.AT/vlXq'*e INCRFM!NTS o*)
.CAA-D-80-1
WRITE(OUTFILFMTDBGI ("TEPSfV)9V1,*NOVARSl20000 CONTINUEC
rPTR=FLOATI NLVARSI.EPSLON6010 500
CC TO COMPUTE THE NEXT SET OF VARIABLE VALUESC200 DO 30 PTR=NOVARSP1.-1
PTR LZPTPFPTR:FLCATI PTRI4+EPSLONIF (VALUIPTR) *LT. LSTVAL(PTF)) GOTO 400VALUC PTq)=FSTVAL IPTR)
300 CONTINU!rGOTO 6V0
400 VALU(PTRIDzVALU(PTRI )+,TEPSIPT1IV500 CONTINUE
POINTS:POINTS+1CALL PREPR(VALUiVALUE)WRITEfFILE3vFMTFILl (VALU(V)tV=1*NOVARSI .VALUEtFPTRD0 550 VZ1,NC.VARSCALL PARTLI NOVARS.V.VALUEPSLON.PARTYLINCR.VALUEIGRADE VI=PARTYL
CIF (SWITCH *NE. -1) GOTO 20010JWRITE(OUTFIL*1006Ui POINTSvV
10060 FORMAT(/PlXt'os PARTIAL SUBROUTINE OUTPUT FOR POINT vp1 169' AND VARIABLE Iv1394H **)WRITE (OUTFILvFPITDaGI PARTYLVALUE9TNCR
20010 CONTINUEC55n CONTINUE
WRITE (rILE~tFMTFILI (GRAD( V) *V=19NGVARS) 9VALUEC RETURN TO COMPUTE THE NEXT SET OF VARIARLF VALUES
GOTO 200EO0 REWIND FILE3
REWIND FILE4WRITE(FILEIP1007U) POINTSNOVARSPEPSLON
10070 FCRMATfI5#13vF1O.7)WRITE(FILElo101 FMTFILWRITE IFTLE2 .10070 I POirNTS#NOVAPS#EPSLONWRITEiFILE291001U) FMTFTLWRITE(OUTFIL#10075) POINTS
10075 FOPMATl///v31Xv'T4E 'v15.' POINTS AND OUTPUT VALUES**/)DO 801) PZ1,POINTSREADIFILE3vFMTFTI (LINV(VIV 1,NOVARS) ,LINrINOVAL1) ,LINEINOVAL21PTR::INTILINEINOVAL2) IIF IPTR *EQ. NOVARS1 'OCTO 710L
4-9
CAA-D-BOl
WRITE(OUTFIL,1U081a) PTRioflDt FORI4ATI/PlXt'VARIARLE NUMBER 1#13o' HAS SEEN INCREMENTED99
1 / 1700 WRITE(OUTFILoFMTPRT3 Pt(LINE(VIVrZl.NOVAR5 I ,LINEINOVALlI
WRIT9*fF1LEl~r4T7lL) (LINEIVIV-1.NOVARS) .LINE(NOVAL11BOB CONTINUE
WRITE (OUTFILP10085)IU035 FORMAT(///#31X**THE CORRESPONDING GRADIENTS,9/)
REWING FILE3DO 3DU P:1tPOINTSREADIFTLE3tFMTFILI (LINE(VhvV:1,NOVARSJ.LTNE(NOVAL1I ,LINE(NOVAL2IPTR=TNT (LINE( NOVAL2 I IIF (PTR *EG. NOVARS) GOTO P5LWRITE(OUTFIL*1C?08U) PTR
85U PEADIFILE4#F'M7FIL) ( LIN!r(VIV=l.NOVAPS)WRITE (OUTFILoFMTPRT PP(LINE(V) .V=1tNOVARS?WRITEIFILE,FMTFIL) lL~TJE(VI ,V:1,NCVARSl
9UGi CONTINUEWRITE IOUTFIL .100BU I
IOU030 F OR MATt/I/END
4- 10
CAA-D-80-1
4-6. GRID ROUTINE FLOWCHART
S ta rt
Rewind
used
Read in thenumber ofvariables,
zero estimatorand debuq iode
indicator
Read in theformat for
reading theinput deck
Read in theinitial variablevalueS, ctiterbounds and
steps
Set the
abl ia [0
to ,ero
Redt the
prin1an
CAA-D-80-1
In debug Nomode
Yes
Writeout thei nput
va I ues
Set up to
trite thfi tvluev"ari abl e
t4-1n2 t
CAA-0-80-1
P E P ,IR
thetes tedrouti ne
the variablevalues, ou tputvalue and
variable no.to unit 12 file
S4et
t r\-U-80- 1
the,cratch f -,e, li
Write th estandard
fi 1ieheadings
ariaole va Jes,output Val LS,and variables
fo netponvarid indicator
fo et point
to tevariablevaried
Last Yes<'..vable
NoWrite headingon print fi leStart new Oxtout
q rouIp i no(
drite out 'lieprint. no., thevariable valuesand the outpuvi alu
Write thev ariabl e and
ou tput v aIleinto t he
point file
No ; oiiple-
ted lastp 0int
4-14
CAA-D-80-1
Priiitgrad ien theading
Reviind I'LF3
Read in thenext vari'able
variledindicator
the next
Read inqradient
point nijiibe r
and gradjient
Write4-15
CAA-D-80-1
Section 11. THE REARRANGE ROUTINE
4-7. INTRODUCTION. The output of the GRID routine is so organ-ized that within each group of output lines, the lines agree inall variable values except the last, i.e., the last variable isvaried most frequently. The REARRANGE routine reorders the out-put, grouping on each variable in turn, except the last. This re-ordering facilitates the analysis of the output.
4-8. LIMITATIONS
a. The currently compiled version is limited to 20 variables.
b. Since this routine utilizes output from GRID, the limita-tions of the GRID routine are applicable.
c. This routine uses much I/0, so the smaller the number ofpoints produced by GRID, the better.
4-9. RUN SETUPS
a. To Execute
@USE 10, name of standard formiat file produced by GRID onunit 10.
@ASG,A name of above file.
O~USE 12, name of communication file produced by GRID on unit12.
O)ASG,A name of above file.
@USE 14, name of file to be rearranged. This file should bethe nonstandard format file produced by GRID on units 12(points) or 13 (gradients).
(OASG,A name of this file.
@USE 15, name of scratch file into which REARRANGE pldcesoutputs.
@ASG,A name of scratch file.
4-16
CAA-D-80-1
@XQT name of absolute file developed earlier.
[Input deck]
b. Description and Sample of Input Deck
(1) Line 1. (' POINT NUMBER',15,2X,7(F1O.5,5X),/21X,8(F1O.5,5X))
This format wil! bring out the point number and regrouped data.
(2) Line 2. (15,2X,7(FIO.5,5X),/,21X,8(F1O.5,5X))
This format will be used to printout the file of reordered data.
c. Sample Input File
(1) Unit. !0
1260 4 .0010000(6(7X,F13.5))
5.00000 .50000 .50000 .50000 .738215.00000 .50000 .50000 .60000 .772765.00000 .50000 .50000 .70000 .807355.00000 .50000 .50000 .80000 .841995.00000 .50000 .50000 .90000 .876675.00000 .50000 .50000 1.00000 .911405.00000 .50000 10.50000 .50000 7.443015.00000 .50000 10.50000 .60000 7.418175.00000 .50000 10.50000 .70000 7.393305.00000 .50000 10.50000 .80000 7.368395.00000 .50000 10.50000 .90000 7.34346
This is a standard format file of variable values and an outputvalue. This file is developed by GRID on unit 10, and is de-scribed in the GRID documentation.
4-17
CAA-D-80-1
(2) Unit 12
5.00000 .50000 .50000 .50000 .73821 4.001005.00000 .50000 .50000 .60000 .77276 4.001005.00000 .50000 .50000 .70000 .80735 4.001005.00000 .50000 .50000 .80000 .84199 4.001005.00000 .50000 .50000 .90000 .87667 4.001005.00000 .50000 .50000 1.00000 .91140 4.001005.00000 .50000 10.50000 .50000 7.44301 3.001005.00000 .50000 10.50000 .60000 7.41817 4.001005.00000 .50000 10.50000 .70000 7.39330 4.001005.00000 .50000 10.50000 .80000 7.36839 4.001005.00000 .50000 10.50000 .90000 7.34346 4.00100
This communication file is developed by GRID on unit 12 and is de-scribed in the GRID documentation.
(3) Unit 14. This is the file to be rearranged. It may bethe GRID file produced on unit 12 described earlier or the analo-gous nonstandard format gradient file produced by GRID on unit 13.A portion of the gradient file follows:
.00048 .30919 .67048 .34638 .73821
.00055 .37265 .66454 .34684 .77276
.00061 .43536 .65859 .34731 .80735
.00067 .49823 .65264 .34778 .84199
.00072 .56128 .64668 .34825 .87667
.00076 .62451 .64071 .34872 .91140
.05325 -.22734 .67048 -.24905 7.44301
.06396 -.27318 .66454 -.24938 7.41817d. Sample Run Stream
@USE 10,03MAT5.
@UASG,A 03MAT5.
OUSE 12,03MAT7.
@ASG,A 03MAT7.
@USE 14,03MAT7.
@ASG,A 03MAT7.
@USE 15,03MAT9.
@ASG,A 03MAT9.
4-18
CAA-D-80-1
@XQT 03PROGTEST.REARRANGE.
(' POINT NUMBER ',15,2X,7(FIO.5,5X),/,21X,8(F1O.5,5X))
(15,2X,7(FlO.5,5X),1,21X,8(F1O.5,5X)).
4-10. OUTPUT DESCRIPTIONS AND SAMPLE OUTPUT
a. Printed Output
+++++.+.+++++++++++++++VARIABLE NUMBER 1+++++++++++++++++++++++
POINT NUMBER 1 .00048 .30919 .67048 .34638 .73821POINT NUMBER 253 .00019 .32471 .68200 .34773 .73934POINT NUMBER 505 .00010 33081 .68706 .34836 .73985POINT NUMBER 757 .00006 .33495 .68991 .34871 .74014POINT NUMBER 1009 .00004 .33762 .69173 .34894 .74033
END OF VARIATION FOR INITIAL POINT 1
POINT NUMBER 2 .00055 .37265 .66454 .34684 .77276POINT NUMBER 254 .00022 .38998 .67838 .34892 .77406POINT NUMBER 506 .00012 .39826 .68446 .34856 .77465POINT NUMBER 758 .00007 .40214 .68788 .34887 .77498POINT NUMBER 1010 .00005 .40531 .69006 .34908 .77520
END OF VARIATION FOR INITIAL POINT 2
This particular output file is a file of gradients, a reorderedversion of the gradient file produced by GRID. The gradients inthe first group were evaluated at points whose values for vari-ables 2-4 are identical. Adjacent gradients were evaluated atpoints whose variable 1 coordinates differ by the step value forvariable 1. The gradients in the second group are similar, thesegradients were also evaluated at points whose coordinates 2through 4 are identical and where adjacent gradients were evalu-ated at points differing only in the variable 1 coordinate and thedifference is the step size. Note that the fifth column containsthe corresponding output values. The points at which these gradi-ents were evaluated are exhibited below.
4-19
CAA-D- 80-1
........................+VARIABLE NUMBER I+........................
POINT NUMBER 1 5.00000 .50000 .50000 .50000 .73821POINT NUMBER 253 8.50000 .50000 .50000 .50000 .73934POINT NUMBER 505 12.00000 .50000 .50000 .50000 .73985POINT NUMBER 757 15.50000 .50000 .50000 .50000 .74014POINT NUMBER 1009 19.00000 .50000 .50000 .50000 .74033
END OF VARIATION FOR INITIAL POINT 1
POINT NUMBER 2 5.00000 .50000 .50000 .60000 .77276POINT NUMBER 254 8.50000 .50000 .50000 .60000 .77406POINT NUMBER 506 12.00000 .50000 .50000 .60000 .77465POINT NUMBER 758 15.50000 .50000 .50000 .60000 .77498POINT NUMBER 1010 19.00000 .50000 .50000 .60000 .77520
END OF VARIATION FOR INITIAL POINT 2
Note that within each group, only variable 1 varies. The follow-ing printout is a later segment of the same output.
FINISHED VARIABLE NUMBER 1
........................+VARIABLE NUMBER 2++........................
NEW INITIAL POINT
POINT NUMBER 1 .00048 .30819 .67048 .34638 .73821POINT NUMBER 37 .02158 .18565 .60644 1.08123 1.10039POINT NUMBER 73 .05104 .12313 .56450 1.55265 1.32998POINT NUMBER 109 .07778 .08812 .53491 1.88027 1.48843POINT NUMBER 145 .10199 .06543 .51291 2.12195 1.60434POINT NUMBER 181 .12181 .OE001 .49491 2.30725 1.69280POINT NUMBER 217 .13869 .04014 .48239 2.45384 1.76252
NEW INITIAL POINT
POINT NUMBER 253 .00019 .32471 .68200 .34773 .73934POINT NUMBER 289 .00997 .23380 .63786 1.18644 1.15472POINT NUMBER 325 .02581 .17577 .60447 1.81117 1.46142POINT NUMBER 361 .04306 .13756 .57832 2.29508 1.69706POINT NUMBER 397 .05990 .10961 .55728 2.67928 1.88374POINT NUMBER 433 .07674 .09007 .54000 2.99334 2.03525POINT NUMBER 469 .09131 .07532 .52555 3.25328 2.16066
4-20
CAA- 0-80-1
These gradients were evaluated on,,point groups where only variable2 varied within each group. The ~'EW IN IA P01NT" message indi-cates that variable 1 varied between points 217 and 253, so thesepoints vary in two coordinates--hence it's time to start a newgrouping. This situation will not occur for variable 1 becausevariable 1 is varied the least. The following printout exhibitsthe points at which the gradients were evaluated.
FINISHED VARIABLE NUMBER 1
........................++1VAR IABLE NUMBER 2++........................
NEW INITIAL POINT
POINT NUMBER 1 5.00000 .50000 .50000 .50000 .73821POINT NUMBER 37 5.00000 2.00000 .50000 .50000 1.10037POINT NUMBER 73 5.00000 3.50000 .50000 .50000 1.32998POINT NUMBER 109 5.00000 5.00000 .50000 .50000 1.48843POINT NUMBER 145 5.00000 6.50000 .50000 .50000 1,60434POINT NUMBER 181 5.00000 8.00000 .50000 .50000 1.69280POINT NUMBER 211 5.00000 9.50000 .50000 .50000 1.76252
NEW INITIAL POINT
POINT NUMBER 253 8.50000 .50000 .50000 .50000 .73934POINT NUMBER 289 8.50000 2.00000 .50000 .50000 1.15472POINT NUMBER 325 8.50000 3.50000 .50000 .50000 1.46142POINT NUMBER 361 8.50000 5.00000 .50000 .50000 1.69706POINT NUMBER 397 8.50000 6.50000 .50000 .50000 1.88374POINT NUMBER 433 8.50000 8.00000 .50000 .50000 2.03525POINT NUMBER 469 8.50000 9.50000 .50000 .50000 2.16066
Note that all points in each group vary only in the secondvariable. Note also that, as before, while the point numbers con-tinue increasing, points 217 and 253 differ in two coordinatessince variables 1 and 2 change simultaneously. This fact necessi-tates creating a new group.
b. Sample Output File Segment
252 5.00000 9.50000 50.50000 1.00000 15.70270504 8.50000 9.50000 50O.50000 1.00000 21.01859756 12.00000 9.50000 50.50000 1.00000 24.55868
1008 15.50000 9.50000 50.50000 1.00000 27.085531260 19.00000 9.50000 50.50000 1.00000 28.97974
25 ......................................................
4-21
CAA-D-80-1
VARIABLE 2
----- ----------------------- NEW INITIAL POINT-----------------------
1 5.00000 .50000 .50000 .50000 .7382137 5.00000 2.00000 .50000 .50000 1.1003973 5.00000 3.50000 .50000 .50000 1.32998
109 5.00000 5.00000 .50000 .50000 1.48843145 5.00000 6.50000 .50000 .50000 1.60434181 5.00000 8.00000 .50000 .50000 1.69280217 5.00000 9.50000 .50000 .50000 1.76252
The leftmost integers are point numbers.
(1) The line252 + + + .. indicates the end of the grouping whoseinitial point was 252, i.e., if there was a point 253,the point numbers, now at 1260, would decrease to 253next and commence to increase from that value, i.e., thenext point numbers would be:
253289325etc.
(2) The line1 liii . . . indicates the end of regroupings for whichonly variable 1 varies within each preceding group.
(3) The lineVARIABLE 2 indicates that now groupings where onlyvariable 2 varies will be derived.
(4) The line----NEW INITIAL POINT - . indicates
that while the point numbers may continue to increase , anew grouping must nevertheless begin.
4-22
CAA-U-80-1
4-11. REARRANGE ROUTINE LISTING
FAR ASETER INFzLEZ:5.OUTFIL:6,FILFIZIOFILE3=12 ,SRTFIL:-14@GRPFIL:15PARAMFTr'R NOVAL' =20,NQVALI=NCVALS+I .NOVAL2Z:N0VALS+2
CCHARACTER.BU FMTFIL#F MTPR I ,MTGP
CINTEGER POTISPTRSTEPeSTFPNRFRIOOrFIG ,Q.P.VlN7EGEP NOVRM1. NOVAR5,NOVRP19 NOVPP2
CREAL LINE
CDIMENSION PERIOD(NOVALS) ,LINE(NCVAL2)
CC INITIALIZATIONC
REWIND FILElREWIND FILE3REWIND SRTFILREWIND GRPF:-LREAD(FVLE1looD0s POINTSvNOVARS
10()00 FCRMATWI5913)READS FILEl PIt01i) FMTFIL
100111 FORMATS AS(1)READIlNFIL~EPD)1O) FMTPRTREAO(INFILE.1Dfl10) FMTGRPNOVRFIzNCVAPS INOV RP2:NOVARS+2NOV RM1=N0VAPS-1
CC TO "IND THF PERIOSC
DO l1it1 v:1SN0VARSPER ICD( V)=U
li)D CDNTINUEDO 200 Pzl,POINTSREADIFTLE3iFMTFIL ) (LINEEI),I1,vNOVRP2)P TR=! N'(fI NE iNC R P2'IFIPERICO(PT'I *EQ. 0) PERIOOIPTRIZMAXOIP-191)IFIPERIOD~lI *NE. 01 G010 3(10
2010 CONTINUSCC TO PRODUCE A REORDERED PILE9 VARYINC EACH VARIABLE THRCUCHOUTr! TTS RANGE IN TURNC300 DO 6(10 F=19N0VRMI
WRITE[OUTFILPID020)113OZO FORMATl//elX,3D(lH4.t'VARIABLE NUMBER 9vI5v2X#10I1H+)/)
WRITE 'GRPF!LoiflDJU) F10013n FORMAT(*VARIABLr 00151
4-23
7AD-AOOI 653 ARMY CONCEPTS ANALYSIS AGENCY BETHESDA MD F/6 9/2FROOTEST: A COMPUTER SYSTEM FOR THE ANALYSIS OF COMPUTATIONAL C--ETC(U)
W4CLASSIFIED CAA080-12,2ffffffffffff
I flfflflf..fl2l...flflfl
CAA-D.-80-1
S TEPN=()sTEP=PEPICD IF)IF IF *NE. 1) STEPN=PERIODF-11
CC To PICK UP THE 0 TH ENTRY FROM EACH BLOCK OF SIZE STEP
DO 500 OzlSIEPREWIND SRTF IL01=0IF (01 *EQ. STEPI Gl=ODO 400 P=1,POINTS RJPEADISRTFIL*FMTFIL) ILINEIVlvV:1,NOVRIIF IMOD(PiSTEP) *NE. 91) GOTO 400IF 101 .EG. (1) GOTO 35LI
CC CHFCK FOR VARIATION IN THE NEXT yAP TABLE
IF (IF *NEo 11 *AND- (MODIPoSrEPNI E*EO 01)) WRITEIOUTFIL9100321
1OU32 FORMAT(/#" NEW INIT!AL POINT*#/)IF (IF .NEe 11 .AND. (MODIP.STEPNI *EQ. 01)) WRITE(URPFIL9100361
10U36 FORMAT(55(IH-lPONEW INITIAL POTNTIP55IIH-11350 WRITE(OUTFILFMTPRT) PILINEIV).V=1.NOVARS),LINEINOVRP1)
WRITEIGRPFIL*FPOTGRP) P.(LINEiV),V=1.NOVkRS) ,LINEINCVRPIIIF 4 G2 *NE. 0 ) 0070 400IF tIF .NE. 1) *AND. IMODIP#STEPNI .EGo O)2 WRITE(OUTFILPLOO321IF IPF .NE. 1) *ANT). (MOO(P@ST7PNl .El. 0)) WPITEIGRPFIL9100361
400 CONTINUEWPITE(OUTFILolIDC)4U)32
1O040 FORMAT(W. END OF VARIAtION Qrp INITIAL POINT *vI5./I3RITEIGRPFILPl~flSO) 0
10050 FORMATIT5,12011H4)ICC FINISHED PASS FOR THE 0 TH FNTRY IN EACH BLOCKCs00 CONTINUE
WRITEIOUTFIL91006U) F10060 FORMAT(ftl FINISHED VARIA6LE NUMBER '#13)
WPITE(CPPFIL*1007OI F10070 FORMAT(595Xv12O(11H/)2suU CONTINUF
WRITE (OUTFIL. 100801L 003H FORMAT(///)
END
4 -24
CAA-D-80- 1
4-12. REARRANGE ROUTINE FLOWCHART
Start
Rewindfiles
Read in the
no.
the no. ofvariables
FRead in theprinte r andfile 1/0
forma ts
Initile
perl~di-
vector
Read njextvariable
variedindicator from
F i 14-23
Has
CAA-D-80-1
i)i
Set u p tnanalyzefirst
variable
1fIPrint
the num-I
ber of thevariable
grouped upon
Write the numberof the variablebeinci arouped
upon into theoutput file
Determine the period!of the varied
variable and its
lower numberedneighbor
ini atIpoin t
Ipointer
Rewindfile to be
rearranged
et up toread first
Il ine of fileto be
rea r~anoed
I g®
fije
this the NoeK poin3
Yes
4-26
CAA-D-80-1
2,
yes inianlaloint
inilial No
oint
Yes
Print newinitial pointheading
Write newini I po
tici:l.r ""ird 0 n
Gtp.t file
poin t n umband data onthe output file
a tin ti3i Yes
L
Write
th:,
No
NoInitial
int
Yes
ewI ()Int
4 heading
WrIle nein I t I a I Point
head , nq on t heoutput file
nd Offil
No le o bereordered
e n ?
to real. '... t'et upu 'o -< $,s >vespoint.
4-27
7
CAA-D-80-1
Print "End ofvariation for
initial point_
message
Write the
analogous line
into theOutput file
4-28t
CAA-D-80-1
Section III. THE DIFFQUOT ROUTINE
4-13. INTRODUCTION. This routine utilizes the output developedby GRID on unit 10 in order to compute difference quotients forone variable. The point numbers listed in the output identify thepoints used to compute the difference quotients. These points aredeveloped by GRID, and the point numbers link the GRID outputpoints to the difference quotient computations.
4-14. BACKGROUND. See the discussion of difference quotients inthe VARVARY1 documentation (Chapter 5).
4-15. LIMITATIONS
a. The current compiled version is limited to 20 variables.
b. The current compiled version is limited to a maximum of 500lines of difference quotient computations in each difference quo-tient block.
c. Since this routine utilizes GRID output, the limitations
applicable to GRID apply.
4-16. RUN SETUPS
a. To Develop an Absolute ASCI Program File
@MAP,S name of absolute element.
IN 03PROGTEST.DIFFQUOT.
IN 03PROGTEST.PARTIAL.
IN element containing the driver PREPR.
IN programs to be tested.
LIB$*FTN8.
END
4-29
CAA-D-80-1
b. To Execute
@UJSE 10, name of file produced by GRID on unit 10.
@ASG,A name of above file.
@USE 12, name of file produced by GRID on unit 12.
@ASG,A name of this file.
@XQT name of absolute deck created earlier.
[Input deck]
c. Sample Input Deck and Description
(1) Line 1.
2
The number of the variable for which difference quo-tients are to be computed, in 13 format.
(2) Line 2.
(13F6.0)
The format for reading each line of input data.
(3) Line 3.
5.0 0.5 0.5 0.5
Initial values for each variable, where variable 1 isleftmost.
(4) Line 4.
18.00 9.00 48.00 0.9
Terminal values for each variable, variable 1 leftmost.
(5) Line 5.
3.5 1.5 10.0 0.1
Step values for each variable.
(6) Line 6.
4-30
CAA-D-80-1
(1X,8F13.5)
Format for one line of difference quotient printouts.
(7) Line 7.
(1X,8(5X,16))
Format for printing out the point numbers whose differ-ence quotients are being computed.
d. Sample Input Files and Descriptions
(1) Unit 10
1260 4 .0010000(6(7X,F13.5))
5.00000 .50000 .50000 .50000 .738215.00000 .50000 .50000 .50000 .772765.00000 .50000 .50000 .70000 .897355.00000 .50000 .50000 .80000 .841995.00000 .50000 .50000 .90000 .876675.00000 .50000 .50000 1.00000 .911405.00000 .50000 10.50000 .50000 7.443015.00000 .50000 10.50000 .60000 7.418175.00000 .50000 10.50000 .70000 7.39330
This file is in standard format; it contains variable values(points) and output. This file is produced by GRID on unit 10,see GRID documentation (Chapter 4) for a more detailed descrip-tion.
(2) Unit 12
5.00000 .50000 .50000 .50000 .73821 4.001005.00000 .50000 .50000 .60000 .77276 4.001005.00000 .50000 .50000 .70000 .80735 4.001005.00000 .50000 .50000 .80000 .84199 4.001005.00000 .50000 .50000 .90000 .87667 4.001005.00000 .50000 .50000 1.00000 .91140 4.001005.00000 .50000 10.50000 .50000 7.44301 3.001005.00000 .50000 10.50000 .60000 7.41817 4.001005.00000 .50000 10.50000 .70000 7.39330 4.00100
. . J..this.fJ.e.js.god~ced by GRID on unit 12 and is used by DIFFQUOTto determine the periodicity of each variable.°°Fol Vhotre'de- *
tailed description, see the GRID documentation (Chapter 7).
4-31
CAA-D-80-1
e. Sample RUN SETUP
@USE 1O,03MAT5.
@ASG,A 03MAT5.
@USE 12,03MAT7.
@ASG,A 03MAT7.
@XQT 03PROGTEST.DIFFQUOT1
(13F6.0)5.0 0.5 0.5 0.5
18.00 9.00 48.00 0.93.5 1.5 10.0 0.1
(1X,8F13.5)(IX,8(5X,16))
4-17. DESCRIPTION AND SAMPLE OUTPUT
- DIFFERENCE QUOTIENTS FOR VARIABLE 1---------AND POINTS
1 253 505 757 1009
.00000
.00032 .00000
.00023 .00015 .00000
.00018 .00011 .00008 .00000
.00015 .00009 .00007 .00005 .00000
The following figure (4-1) may help explain the output:
The slope of the 'ine to point
From 1 253 505 757 1009point
/1 .0032 .00023 .00018 .00015253 _ .00015 .00011 .00009505 /.00008 .00007757 I.000051009 Slope of the line
to..... .... om no.. .... . Slt.qpe ofthe line from"point no. 253 to pointno. 757
Figure 4-1. Explanatory Figure
4-32
6L ilk,
CAA-D-80-1
For more details, examine the description of difference quotientsin the VARVARY1 documentation (Chapter 2, Section 11).
4-18. DIFFQUOT ROUTINE LISTING
PARAMETER INrILE5 (UUTFTLZE ,N3PTrSzEjuNCVALS=2nFILEI:1OPARAMETER FrLE3:12,NCVAL1ZNOVAL'., NVAL2=NIVAL1II
DIMENSION FSTVAL(NWCVAL-) PL TVALI NOVALS) eSTEPSINOVALSIrIMENi1!ON !NpEX(NCVALS),VALUINCVAL)CCODANPTSoNOV4L1)DIlENSTON rIFFINOVAL',I POINTS(NOPTSJCLCCKINCVALSIDIMENJ;CN FERbG'INOVALSI
CRFAL EPSLONPFSTVALLSTAL,:TLPSVALU*DIFFiCOORDS
C
CHARACTER*iU rMTRnvJTvPT .FMTP,:!FMTF!LC
PEWINC FILEIREW IND FTLF3RFAn( FILE1t1f1U40) I .UM3Cr9NCVAR',vErSLON
I UL 4 V FORMATC 5,13PF10..7 IRFACIFTLEI1t1CU FMTFIL
CRFAO(INFILEoiaoflu) wA i cH
10613 U FCRMAT(T3)REAL( INFILr P1LIu1u M1 TR 1
113('10 FOFM'ATIA60)REA'( INF1Lf~ MR0 (F:TVAL4VI ,VZ1,NCVA7:1
READ( TNFILrF 91TRD I (LTVALfVIV=1#N)VAR3)REAZ(INFTLrvrMTt'D1 ('1TLFS(V)vJNOV&RS2R LADOfINFILF ,11161UfI r MTFRTPEAD(INFIL#11IL1fl) FMTR2
NOVRP1:,140VARS+tNOV RP2=t!OVPP1+lNOV RM!=?;0VAiiz-1DO II0ij !1vrIVAR1cLC^K( T I=iTNI)EX(I 1:1VALUg I):FSTVAL1II
I tLb C 0N T I N U1F I WHTIH ECQ. NOVAPS I GOTC
7 11UDC 2LuU I:WHICH#NOV 1MlTNCEXIT I:INDEX(I1)
2LiU CONTINUrINjEX (NCVARS)ZW'A!CH
3DU LO:CCO 1200 I11NOVARSPERIOD( 1IZD
120U C3N TI NUE
4-33
CAA-D-80-1
Do 1300 1=19NUMIERFEADE FILE3,FMTF'LI (VALO (J ) J=1 ,NOVPPZIPTRINT( VAL U(%OVRPI)IF i PrRfODIFTRI Fl3. 0 ) FERlC0(PTnl:MAXflj-1,1,IF I PERIOn~(l) *NE. 0 1 GOIO 175U
1300) CONTINUJESTOP
1,350 00 1375 1=19NOVi&RSVALU(I IlFSTVAL(l)
1375r CON Tr UE
300o DC 4Ui, VAR:NOVAPSoI.-.V AR 1: VA QIF ( VALUIINDFX(VARI) .LT. LSTVAL(INOf:XtVAP2)) COTO 700CLOCK17NDEX (YAP) )=lVALUIINtEY(VAPIFSTVAL(INEXIVAR))
C IF LOC IS ZERO, IVE ALREADY PRINTrC THE LAST S TC Or DIFFERENCE-,
IF ( LOC *1G. n3 I 'COTO 400)WRITE IOUTF.L lrr)zU ) 6.HICH
l1tl20 FO~PATI/,,1Xvzp(1H-1,'DTFFrRENr~ OUOTTENTS "'OR VARTA8LE ',
1 5q2),2U(lH-lIWRITE4IOUTF!L91CO2SI
101,25 FORMATI?1X9,XND P07TS')WRITE IOUTFILvFM'TPR21 fPCINTIJ I J:= ,LCC)WPI YEIOUTFILt1'lZS2)
1r11122 FORMATI/)VO 500 T=19jOCDIF FEI IU.00 S00 J=ItIIF ( J .EQ. I I GOTO 600DIFF(J)=(COOR0S(INOVRf1 )-COORD'S(JNovRPlI 3/
1 (COORDStIWHIC4)-COORnStJWHICH))600 CONTINUE
WPITI(OUTFIL,FMTPRT) ICIFFIJI .J719I)suu CONTINUE
400 CONTINUFWRITE (OUTFIL,10030)
10030 FORPOATI///iS TOP
70U VALUE INDEXIVAR1I IVALUUINEXIVArl +STEPS( NOE'(IVA~I))CLOCK(T NDEX IVAIRl))=C:LOCK (INDEXI VAP1II+l
100U CALL PRFPR(VD.LUiVALU('40VRPPII)LOC=LOC,1POINTSI LOC)=iDC 1100 I=1eNCVAR;POINTStLOCI=P0INTS(LCCI*ICL:)CKITI-1I.PERbO-1(II
1100 CONTINUED300 SOO I1NCVPP1C 00RD S (LOCIp ?=V ALU I I
sou CONTINUECOTO 300E ND
4-34
CAA-D-80-1
4-19. DIFFQUOT ROUTINE FLOWCHART
Start
/ rewind!file s
ifRead in the
number of points,variables, andthe zero
approxinator
ea Inthe"Ml leinput
format
Read in the numberof the variable
for which difference quotientsmust becomputed
ARead in theformat forthe input
data
Read in thenitial , terminal
andvalues
Read in theformat for one/
line of differ-ence quotient
output
Read in theformat for
printing thepoint numbers
. ....... .[ tn'it e the -point desc iptorindirect addressnq and value
-vectors
4-35
CAA-0-80-1
< s
ndi re Noaddressin
eede
Yes
ddressing vector to[ Shift indirectI's t location 1,,,intsto variable being
varied
Initithe pvect
OP
Read in thenext variable
variedindicator
sthis
variable's Noperiod beendetermi
? Use the linecount to set
theYes eriod
Are
No all theperiods
determined
Yes
Initial-ize thevaluevector
First Yestime
No
4-36
CAA-D-80-1
set up0 Pointto I . S tvariable
5-'Is
4 .1 ueobe Yesvalue belo Yes
boundondI IncrNoNo mentv alue
oector byInitialize the step
t e c. omponents valueof the pointdescriptorand Va I Ileve , tors
Incrementthe pointdescriptor
Is
< anythere Not h _ n t q tonytk, > Evaluate
at theou tpu t
Yes vector
e re'nWrite
n,,ej,fer,
M-ent.,i ch rIncren
"..tP,-e " quotient"mpu Iiie count
Compute theWrite the point number
Ant rumbers frgisthojoint,:rfpror
Fo,,nt Store hto,.Ie Poinf! st coordinatespoint
Lmn"t,, aHop of
Jifferinceqjotints
wr ite " I inI)f differene
'11 otipts
Ye% Pof ts0 t?
Pointto thenext Nopo nt
setQuotientI ine -untt 0 , er.
4-37
CAA-D-80-1
4
AnyYes ariables
left?
Point to 0the next -+variable Space
threelines
Stop
4-38
CAA-D-80-1
CHAPTER 5
COMMON SUBROUTINES
5-1. INTRODUCTION. Two subroutines are used by both the
POINTCOMP and GRID subsystems:
a. PARTL
b. PREPR
Detailed writeups of these subroutines follow.
Section I. THE PARTL SUBROUTINE
5-2. INTRODUCTION TO THE PARTL SUBROUTINE. This routine computesthe partial derivative at a point numerically by using the defini-tion of the right partial derivative. PARTL is called by POINT-COMP and other routines repetitively to construct the gradient,but it may be used by anyone as a standalone subroutine. PARTLcalls PREPR which must be a user-provided driver subroutine whosefunction is to obtain an output value from the program beingtested.
5-3. BACKGROUND. Given a real valued function f(xl, .. , xthe jth right partial derivative of f at (xl, ... , xn) is definedto be:
) f -(x, X*. ) -fx 1 , .-.., Xjl,Xj+hXj+
, ...,xn ) - f(x-, .. , xn )1imO h
5-4. DISCUSSION OF METHODOLOGY
a. The methodology is derived directly from the definition:
For h = 1/2, we approximate the jth partial derivative at(x1, ..., Xn) to be:
f(x1 , ..., Xj-lxj+1/2, xj+ 1, ... xn) - f(x1, ..., xn )
1/2b. We repeat this procedure for h = 1/4, 1/8, 1/16, etc. When
the difference between two successive approximations is suffi-ciently small (as determined by an input parameter), the process
5-1
CAA-D-80-1
is terminated and the approximation is returned as the value ofthe partial derivative. The process terminates automaticallyafter 50 approximations.
5-5. LIMITATIONS
a. As currently compiled, all inputs to PARTL must be real.
b. The function whose partials are being computed should bedifferentiable.
5-6. CALLING SEQUENCE
Call PARTL (11, 12, R1, R2, R3, R4, R5)
where
11 is an integer input variable containing the number of vari-ables.
12 is an integer input variable containing the index value ofthe variable whose partial is to be found. The index valuerefers to the subscript locating the variable in the inputarray RI.
RI is a real input array containing the values of the vari-ables at the point at which the partial is to be evaluated.
R2 is a real input variable containing a positive number. Anynumber smaller than this number will be considered to bezero.
R3 is a real output variable into which the approximate valueof the partial will be placed by PARTL.
R4 A real output variable into which the last increment testedwill be placed by PARTL.
R5 is a real input variable containing the value returned byPREPR for the variable values in RI.
5-2
CAA-D-80-1
5-7. PARTL SUBROUTINE LISTING
SUBROUTINE PARTLI(iOVARS.SNICNVAL.EPSPARTYL, INCR.BASEIC
PARAMETER NOVALS620,INF!LEN5,OUTFIL*6C
DIMENSION VALINOVALSI .VALI INOVALSIC
INTEGER NOVARSeNNICtFIRST*l .J
REAL VALiVALIINCR,VALUEIVALUCZPARTYL.EPSsSASE
CP IRSTaII NCRR-Is00 100 IuINOVARSVAL III) EVAL I II
100 CONTINUEDo 200 JUIs0INCROINCROI .S1VAL I (HICH I6VAL WHICH)I* INCKCALL PREPRIVALIeVALUCIIIF IFIRST PNE. 11 6010 300PARTYLGIVALUEI-DASCI #INCRP RST .040TO 200
300 IF (ABSIIIVALUEI.UASEI/INCRI.PARTYL) *LT. EPS1 RETURNPARTYLO IVA.UE I-SASE)/ INCR
200 CONTINUERETURNEND
5-3
CAA-D-80-1
5-8. PARTL SUBROUTINE FLOWCHART
Start
Setincre-
mentto 1
Hal vethe
incre-ment
Computeincremented
poin
PREPjv-a fifte a
incrementedpoi A
First Yespartial
approximation?
Yes Save
No partialvalue
Compareto
*previouspproximation
ufficient No eReturnhagge
Yes
Replaceformer bycurrentestimate
2
5-4
CAA-D-80-i
2
Were fifty N
5-5
CAA-D-80-1
Section II. THE PREPR DRIVER SUBROUTINE
5-9. INTRODUCTION. This subroutine must be written by the userto provide an interface between the PROGTEST, PARTL, VARVARY1,GRID, and DIFFQUOT routines and the routine being tested. PREPRreceives variable values from POINTCOMP or the other routines andreturns the output value determined by calling the program beingtested with the given variable values as input.
5-10. DISCUSSION. The input variable values are passed to PREPRin array V, in the same order as the values read in, i.e., theleftmost variable defined in the input is in V(1), etc.
5-11. PREPR LAYOUT
SUBROUTINE PREPR(V,VALU)
PARAMETER NOVALS = 20DIMENSION V(NOVALS)
REAL V,VALU
Pass input values given in V to the program being tested.
Call program being tested as a subroutine using input valuespassed in V.
VALU = value returned by the program.
END
5-6
CAA- 0-80-1
APPENDIX A
CONTRIBUTORS
1. DOCUMMENTALIST
Dr. Steve Bravy, Methodology and Computer SupportDirectorate
2. TECHNICAL SUPPORT PERSONNEL
Mr. Joseph M. Tessmer
3. OTHER SUPPORT PERSONNEL
Ms Carrie Allen, Word Processing Center
Ms Julie Fuller, Word Processing Center
Ms Bobbie Guenthner, Word Processing Center
Ms Joyce Garris, Word Processing Center
SSG Richard Loller, Graphic Arts Branch
Ms Linda Prieto, Word Processing Center
A-i
APPENDIX B CAA-D-80-1
DISTRIBUTION
Addressee # of Copies
Defense Technical Information CenterBuilding 52Cameron StationAlexandria, VA 22314
The Army Central Library (ASDIRS)Room IA600Pentagon Washington, DC 20310
Federal Software Exchange Center5285 Port Royal Rd.Springfield, VA 22161
National Technical Information ServiceSpringfield, VA 22161
Command and Control Technical Center (CCTC)Room BE685ATTN: Technical LibraryPentagon Washington, D 20301
Dept of Defense Computer InstituteTechnical LibraryWashington Navy YardBuilding 175, Room 37Washington, DC 20374
Assistant for AutomationOJCSRoom 2A932ATTN: CPT Goddard (Navy)Pentagon Washington, DC 20301
Defense Sciences Office, Cybernetics TechnologyDivision (DARPA)
DSO/CTD1400 Wilson BlvdArlington, VA 22209
B-1
CAA-D-80-1
Defense Communication Engineering CenterR801 (Lt. Col. Tufts) 11860 Wichie Ave.Reston, VA 22090
Defense Communication AgencyCommand Control Technical Center/C44011440 Isaac Newton Square, NorthReston, VA 22090
Director, Defense Nuclear AgencyATTN: NASD Lt. Cdr GladwinWashington, DC 20305
Defense Advanced Research Project Agency (DARPA)Cybernetics Technology DivisionATTN: Dr. Fields1409 Wilson BlvdArlington, VA 22209
CommanderUS Army and Electronic Research and
Development CommandFort Monmouth, NJ 07703
DirectorUS Army TRADOC Systems Analysis Activity 2ATTN: ATAA-SL
ATAA-TWhite Sands Missile Range, NM 88002
DirectorUS Army Tank-Automotive Research and
Development CommandWarren, MI 48090
CommanderUS Army Mobility Equipment Research and
Development CommandFort Belvoir, VA 22060
CommanderUS Army Computer Systems CommandFort Belvoir, VA 22060
B-2
CAA-D-80-1
CommanderUS Army Natick Research and Development Cmd 1Natick, MA 01760
Chief,Defense Logistics Studies Information Exchange 2US Army Logistics Management CenterFort Lee, VA 23801
CommanderUS Army Logistics Center 1Fort Lee, VA 23801
CommanderArmy TRADOC Systems Analysis Activity 1White Sands Missile RangeWhite Sands, NM 88002
Office of the Deputy Chief of Staff forResearch, Development and Acquisition 1
Headquarters, Department of the ArmyPentagonWashington, DC 20310
Director of Army AutomationOffice Chief of Staff, Army 1PentagonWashington, DC 20310
CommanderRock Island ArsenalATTN: Technical LibraryRock Island, IL 61201
CommanderUS Army Armament Research and Development Cmd.Dover, NJ 07801
CommanderHarry Diamond Laboratories2800 Power Mill RdAdelphi, MD 20783
B-3
CAA-D-80-1
CommanderUS Army Test & Evaluation CommandDugway Proving Ground, MD 84022
CommanderUS Army Aviation Research and Development CmdP.O. Box 209St. Louis, MO 63166
CommanderArmy Training and Doctrine CommandFort Monroe, VA 23651
CommanderArmy Material Systems Analysis AgencyAberdeen Proving GroundAberdeen, MD 21005
CommanderComputer Systems CommandFort Belvoir, VA 22060
Office of the Deputy Under Secretary of the Armyfor Operations Research
ATTN: Mr. Dick LesterPentagon Room 2E621Washington, DC 20310
Communications Research and Development CommandCenter for Tactical Computer SystemsDivision for Software EngineeringATTN: Mr. Joe KernanFort Monmouth, NJ 07703
Ballistic Research Laboratory'Building 393ATTN: Mr. Jerry ThomasAberdeen Proving GroundAberdeen, MD 21005
Ballistic Research Laboratory Technical LibraryBuilding 305Aberdeen Proving Groundfberdeen, MD 21005
B-4
CAA-D-80-1
US Army Computer Systems CommandCommand Technical Library H9Fort Belvoir, VA 22060
US Army Management Systems Support AgencyDA-ACAM-DPD-EATTN: Jim KilgoreRoom BD1022Pentagon Washington, DC 20310
Army Insitiute for Research in Management Informationand Computer Science (AIRMICS)
3131 Calculator BuildingATTN: John MitchellGeorgia TechAtlanta, GA 30332
US Army Computer Systems Selection andAcquisition Agency
Room 284Hoffman IATTN: ACSA-TD-R2461 Eisenhower Ave.Alexandria, VA 22331
Chief of Naval Operations (OP-966D)Department of the NavyWashington, DC 20350
Director, Technology and Training DepotNaval Data Automation CommandWashington Navy YardWashington, DC 20374
Headquarters, Dept of the NavyNaval Material CommandATTN: Mr. Owen McOmber MAT-084Washington, DC 20360
Naval Data Automation Command (Code 40)Washington Navy YardATTN: Cpt WocdwardWashington, DC 20374
B-5
CAA-D-80-1
Office of Naval ResearchWestern Regional OfficeATTN: R. Lau1030 East Green St.Pasadena, CA 91106
Dr. Robert E. ConleyOffice of the Chief of Naval OperationsOP-094HDept of the NavyRoom 4C679PentagonWashington, DC 20350
Headquarters, USAF (AF/SAT)PentagonWashinqton, DC 20330
Headquarters, Air ForceATTN: Mr. Oscar GoldfarbSAF-ALGWashington, DC 20330
Air Force Geophysics LaboratoryATTN: COL James BakerHanscom Air Force Base, MA 01731
Air Force Weapons Laboratory, Computer Branch (AFWL/AD)ATTN: David McIntyreKirtland Air Force BaseAlbequerque, NM 87117
Air Force Test & Evaluation Center, Software BranchATTN: LtCol ArnerKirtland Air Force BaseAlbequerque, NM 87117
Rome Air Development CenterATTN: Alan BarnumIsGriffiss Air Force Base, NY 13441
B-6
CAA-D-80-1
Mr. Glen IngramScientific Computing DivisionRoom A151 Technology BuildingNational Bureau of StandardsWashington, DC 20234
US Army Concepts Analysis Agency
Chief, AD, ATTN: Library Branch 3Director, FA 1Director, JF 1Director, RQ 1Director, SM 1Director, MC 25
B-7