MODGEN: Compute New Module Factors

Last updated 19 Nov 97

MODGEN is a FORTRAN preprocessor that generates programs capable of creating new module factors from input module factor data. New module factors are computed by mathematically interacting available module factor data, conditional expressions, and data constants. Any mathematical computation may be performed to produce the new factor.

Program Invocation

The specific syntax for program invocation varies between operating systems. This document diplays the code for the AIX version.


@codap modgen <opt> <ssss> <MS1> [<MFf>] [<MS2>]

opt:  N  NOGO option, perform control card check, generate source
	 code, compile, list errors, stop
      L  List generated source code, compile, and map
      C  Copy input factors to output MODSET file
ssss:    The study number
MS1:     Input MODSET file
MFf:     Output Module Factor file, required only if the module
	 factor vectors created are to be added
MS2:     Output MODSET file (optional)

MODGEN Control Card


MODGEN <stdy> <title>

MODGEN:  cc 01-06  The literal 'MODGEN'
stdy:    cc 08-11  The study number for this run
title:   cc 13-72  The title to be used on the output report
Factor Description Cards

This set of control cards must contain one card for each module factor to be used for input or output during the MODGEN run. The information contained on these cards directs MODGEN to the proper source for acquiring the factors, and provide a means of assigning meaningful names to each of the factors used. The names provided on this set of cards are then used in the user specified logic to refer to the numeric values associated with that factor.

The cards used in this section must be in one of the following two forms. The form used depends on whether the factor is to be input from the input MODSET file, or output onto either of the two output files.

Factors Input from the Input MODSET File

This format is for input factors from a MODSET file. This card allows the user to name any of the values desired for use in computations. The module factor value, mean, standard deviation, minimum value, and maximum value are all available for use in computations. It is only necessary to provide names for the values which are to be used in computations.


I <value> = <factor> <mean> <s.d.> <min> <max>

I:       cc 01     The literal 'I'
value:   cc 03-08  The name assigned to this module factor.  May
		   be one to six characters in length.  The first
		   character must be alphabetic.
=:       cc 09     The literal '='
factor:  cc 10-12  The factor number from the MODSET file
mean:    cc 14-19  The name for the factor mean
s.d.:    cc 21-26  The name for the factor standard deviation
min:     cc 28-33  The name for the factor minimum value
max:     cc 35-40  The name for the factor maximum value 
Factors Created for Output

This format is used for module factors which are to be generated. Like the input factors cards, these cards provide a means of naming the module factor for use in the user logic section of this run. Values stored into this factor in the logic section may be used as input for other computations. This card also captures a title for the generated output factor.


O <value> = <title> <min> <max>

O:       cc 01     The literal 'O' (the capital letter O)
value:   cc 03-08  The name to be assigned to this module factor.
		   The first character must be alphabetic.
=:       cc 09     The literal '='
title:   cc 10-62  The title for the output factor
min:     cc 64-71  The minimum acceptable value
max:     cc 73-80  The maximum acceptable value 

These cards are terminated by an '@eof' image.

User Logic Specification Cards

The cards in this section determine the values assigned to the generated module factors. All input and output module factors must be defined as described in the previous sections. All factors in the previous sections are floating point decimal values. Any variables created with the cards described in this section will be treated as integers if the first character of the variable name is one of the letters I through N. Any variable name which begins with a letter other than I through N will be treated as a floating point decimal number. The cards described below may be used in any combination desired. The cards will be executed once for each task in the inventory.

A special feature exists for statements which are too long to fit on a card. The statement may be continued on subsequent cards by adding a '#' character as the last non-blank character of the card. The '#' character is called a continuation sentinel and must occur before column 67 on the card containing the unfinished statement. This forces MODGEN to append the statement on the next card to the unfinished statement. As statement may be contained on as many as 25 cards using the continuation sentinel. The continuation sentinel is not used on comment cards.

Another feature is the availability of several extra variables for computations. These variables are the number of modules (N$MOD), number of duties (N$DUTY), number of cases (N$CASE), module number (I$MOD), and the CODAP invalid value (BADVAL).

The general format for the cards in this section is described below. Spaces are ignored by MODGEN, and it is recommended that spaces be used to improve the readability of the cards. All information on the cards in this set must be contained in card columns 1-66. Any information outside of these columns will be ignored.


[*] <statement> [#]

*:          cc 01     If an asterisk is placed in column 1 the
		      information on the card will be regarded as
		      comments and will not be evaluated.
statement:  cc 01-66  Any valid Fortran statement.
#:                    The # character can be used to force the next
		      statement to be regarded as a continuation.

Computation Cards

Computation cards contain mathematical expressions which assign a value to a variable. Any mathematical operation or function available to the FORTRAN compiler may be used on these cards. The general form for computation cards is as follows.


<variable> = <expression>

The expressions used on these cards may contain more than one operation. If multiple operations are used, the order in which the operations are evaluated conforms to the rules set forth in your installation's current Fortran Manual. Parentheses may be used to change the order of evaluation. Any mathematical expression constructed to the specifications above and valid according to the FORTRAN manual is acceptable.

Condition Specification Cards

The condition specification cards are used to cause or prevent the performance of a statement or a group of statements. The user may build IF-THEN-ELSE constructs as long as the statements are acceptable to the FORTRAN compiler.

Do not use GOTO statements or any statement with a label.

These cards are terminated by an end-of-file or an '@eof' image.

Example

@codap modgen l ssss ms001 mf000 ms002
modgen ssss This is the test for four factors
I VAR001=002
I VAR002=004
O NUMB01=Module factor 2
O NUMB02=Module factor 4
O NUMB03=Minimum of mod factors 2 and 4
O NUMB04=Difference between mod factors 2 and 4
@EOF
NUMB01=VAR001
NUMB02=VAR002
NUMB03=MIN(VAR001,VAR002)
NUMB04=ABS(VAR001-VAR002)
IF (VAR001.EQ.BADVAL.OR.VAR002.EQ.BADVAL) NUMB04=BADVAL
@eof

Four new factors will be added to the Module Factor file mf000, and new MODSET file ms002 will be created.

Back to document index