10.08.2013 Views

Code Manual for CONTAIN 2.0 - Federation of American Scientists

Code Manual for CONTAIN 2.0 - Federation of American Scientists

Code Manual for CONTAIN 2.0 - Federation of American Scientists

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2. Vector names used in expressions must have been previously defined<br />

in the PVEC file, a TDB, or in a previous expression in the mix<br />

block.<br />

3. All vectors used in an expression must have the same length.<br />

4. Every operation must involve at least one vector. For example,<br />

3.0*6.5 is not allowed; however, 3.O*vectorl *6.5 is allowed.<br />

5. Expressions may extend beyond a single line, but must be no longer<br />

than the limit set by MAXMIX in the control block (see Section<br />

16.5).<br />

Some examples <strong>of</strong> legal expressions follow:<br />

templ/press 1<br />

(templ-459.67)/press l+l .7e5<br />

(tcelll+tcel12+tcel13+tcel14+tcel15+tcel16+<br />

tcel17+tcel18)/8.O<br />

It should be noted that the expressions described above are evaluated element<br />

by element. That is, <strong>for</strong> vectors <strong>of</strong> length n, the equation<br />

VECTOR newvec = vec 1 * vec2<br />

is equivalent to<br />

newvec(i) = vec 1(i) * vec2(i), <strong>for</strong> i = 1 to n.<br />

EOI keyword that terminates the mix block.<br />

EOF keyword that terminates the input file. The physical end <strong>of</strong> the input file will<br />

also serve the same function.<br />

16.7.3 Error Handling<br />

Division by zero does not cause the program to abort. Jnstead, an error message is sent to the PERR<br />

file, and the quotient is set to zero.<br />

16.7.4 Adding Functions to the Mix Option<br />

The mix option was written to allow user-defined functions to be easily incorporated. For example,<br />

with very little ef<strong>for</strong>t, trigonometric functions can be added as operators to expressions. Adding each<br />

fimction is as simple as choosing a name to represent the function in expressions, modi~g a single<br />

Rev O 16-32 6/30/97

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!