RQ1R, RQ1I, RQ1L, and RQ1C are EARTH subroutines which permit the reading of data from the Q1 file
They are akin to, but more flexible than the READQ1 feature.
Suppose that, for a simulation with the (4-character) name NUGR, GROUND coding is being provided which makes use of:
Suppose further that it is desired to give these variables the values:
Two methods are available for doing so, in addition to the use of READQ1 (and to the rather dangerous practice of using LSGx, LG(x), ISGx, etc, which may already be used for other purposes).
They are best explained by the following example.
For both methods, it is necessary to include the following lines at any point within the Q1 file:
The number of blanks between entries on a line has no significance; but the first two spaces on the line should always be left blank. Lower-case characters may be used; they will be converted to upper- case by the SATELLITE.
For method 1, at the point in the GROUND coding where it is desired to read the data, the following FORTRAN lines should be inserted:
LOGICAL LOG1 CHARACTER*4 CHA1 CALL RQ1L('NUGR','LOG1',LOG1) CALL RQ1I('NUGR','INT1',INT1) CALL RQ1R('NUGR','REL1',REL1) CALL RQ1C('NUGR','CHA1',CHA1)
only upper-case characters being allowed between the ' ' marks.
Method 2 provides a more economical way to set information in Q1 files and to read it in by FORTRAN coding.
Moreover, as well as being able to read lines such as are shown above, it can interpret lines with several data settings such as the following:
LOG1 T INT1 10 REL1 -1.2E3 CHA1 CHAM
To process these lines, the user needs to insert Fortran coding such as the following:
LOGICAL LOG1,RQ1LG,RQ1IN,RQ1RL,RQ1CH,RQ1OK CHARACTER*4 CHA1 10 IF(RQ1BG('NUGRBEGIN')) THEN IF(.NOT.RQ1EN('NUGREND'))) THEN RQ1OK=RQ1LG(1,'LOG1',LOG1) RQ1OK=RQ1IN(3,'INT1',INT1) RQ1OK=RQ1RL(5,'REL1',REL1) RQ1OK=RQ1CH(7,'CHA1',CHA1) GO TO 10 ENDIF ENDIF
Note that the first argument of each RQ1-subroutines designates the position of the keyname (say LOG1 or CHA1) in the line of the Q1-file. This line is read in by the RQ1EN subroutine, and thereafter processed by the RQ1LG, RQ1IN, RQ1RL or RQ1CH subroutine.
Lines containing single settings, such as are appropriate to the first method, can also be used in the second, provided that the first argument is set to 1.
For economy, the second method is preferable, because the first opens and closes the Q1 file at each call. However, a very large number of data items would have to be read in for the penalty of using the first method to be noticeable.
It will be obvious to FORTRAN specialists that there is no necessity for the name used in the GROUND coding to be the same as that which appears in the Q1 file. For example,
in the second method would give the value of Q1's INT1 to GROUND's INT2.
Usually, it is required to read the Q1 file only once, Then some such device as the setting of a logical Q1DONE is appropriate. An example may be found in subroutine GXMASK.