Detailed Subroutine Specifications
- Last UpdatedNov 07, 2025
- 54 minute read
The following pages provide the subroutine specifications for all Marine and general utility routines in alphabetical order. Each subroutine specification contains the following:
-
The subroutine (or function) statement.
-
The type declaration for each argument as it appears in the routine.
-
A description of the function of the routine.
-
A full definition of each argument.
-
A list of possible returned error codes.
-
Other possible errors and warnings.
D3ECHK - Switch Error Handling ON and OFF
Specification
|
SUBROUTINE D3ECHK( CD3ERR ) |
||
|
CHARACTER*(*) |
CD3ERR |
|
Description
This routine enables the user to switch the internal error handling mechanism on and off. The default action at program entry is for error handling to be switched ON. When ON, the user must call D3ERST to reset the internal error flag whenever a DARs routine generates an error condition (see D3ERST). When OFF, routine D3ERST need not be called. Unlike most other D3 routines, it does not require a previous successful call to D3INIT. Thus it can be used to switch error handling off before the first call to D3INIT.
Arguments
|
CD3ERR |
Internal error switch 'ON' or 'OFF' Any text other than 'OFF', after upper-casing, is interpreted as 'ON'. |
Errors/Warnings
No errors or warnings are generated by this routine.
D3EMSG - Return Error Message
Specification
|
SUBROUTINE D3EMSG( ID3ERR, LD3DIS, CD3MSG ) |
||
|
CHARACTER*(*) |
CD3MSG |
|
|
LOGICAL |
LD3DIS |
|
|
INTEGER |
ID3ERR |
|
Description
This routine returns the error message corresponding to a given error code. Unlike other D3 routines, it does not require a previous successful call to D3INIT. Thus it can be used to interpret an error code returned by D3INIT itself.
If the error code is invalid, the message 'Unknown error' will be returned.
The routine will display the error message if requested.
Arguments
|
ID3ERR |
Error code for which the corresponding message is required. If the value is invalid, the message 'Unknown error' is returned. |
|
LD3DIS |
Display flag. |
|
.TRUE. - display error message to the default device |
|
|
.FALSE. - display nothing |
|
|
CD3MSG |
Error message corresponding to error code. |
|
Maximum length of text string is 50 characters. If the supplied character field is shorter than the returned message, the message will be truncated but no error condition will arise. If the field is too long, it will be padded with blanks. |
|
|
The returned (and printed) error message will be as listed in this section of the User Guide and in Error Codes and Messages. |
Errors
No errors or warnings can arise in the use of this routine, other than those described above. It may return 'INVALID CALL TO D3EMSG' if called prior to a call to D3INIT.
D3ERST - Reset Internal Error Flag
Specification
SUBROUTINE D3ERST
Description
This routine resets the Marine data access internal error flag.
Whenever a positive error code is returned by a Marine data access routine, an internal error flag is set to prevent the next D3 routine from executing. If the programmer wishes to cancel an intentional error condition, and error handling has not been switched off by D3ECHK, then routine D3ERST must be called to reset the error flag before the next routine is called. The programmer should not call D3ERST without proper cause, otherwise the purpose of the error flag is negated.
Arguments
None
Errors/Warnings
No errors or warnings are generated by this routine.
D3FEND - Exit System
Specification
SUBROUTINE D3FEND
Description
This routine was necessary prior to Mk10.2 as a means of terminating DARs in conjunction with D3IBEG. It remains available and results in a program exit, equivalent to a CALL EXIT statement. Programmers should call D3FEND or EXIT but are advised not to use a STOP statement as this may be trapped by Aveva software and give rise to a warning message.
Arguments
None
Errors/Warnings
No errors or warnings are generated by this routine.
D3FIN - Finish
Specification
|
SUBROUTINE D3FIN( ID3ERR ) |
||
|
INTEGER |
ID3ERR |
|
Description
This is the termination routine for a Marine project.
This routine signals that the application has completed its function in respect of the current Marine project. It closes all Marine database files and removes the user from the system database/site-file. Any error code set on entry to this routine is preserved and returned. This routine has no error conditions of its own.
This routine should always be called at the end of a data access applications program. It may called several times in a program, in which case, calls should match the calls to D3INIT one for one. If D3FIN is called without a previous call to D3INIT, it will have no effect.
This routine is called automatically from D3INIT in the event of an error condition and from D3MMDB in the event of a serious error (for example, corrupt databases). It is also called automatically by D3INIT if there have been consecutive calls to D3INIT without a call to D3FIN. Automatic calls are not shown when monitoring is activated.
If this routine is not called before terminating a program, or if the program terminates abnormally, project database files will remain open (with some operating systems) and should be closed by the user.
Arguments
|
ID3ERR |
Error code (not used; for possible future use) |
|
Possible values are: |
Any error code set prior to this routine is preserved and returned. |
D3INIT - initialize
Specification
|
SUBROUTINE D3INIT( CD3PRJ, CD3USR, CD3PAS, CD3MON, CD3RWK, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3PRJ, CD3USR, CD3PAS, CD3MON, CD3RWK |
|
|
INTEGER |
ID3ERR |
|
Description
This routine initializes the system for the Marine data access routines and so must be called before any of the other routines. It identifies the Marine project, validates the Marine project username and password, and records the presence of the user in the Marine system. If an error occurs then an error code as specified below is returned and the project is closed down with an automatic call to D3FIN. The project, username and password may be entered as arguments or interactively at runtime in a manner similar to the Marine entry procedure.
This routine may be called more than once in a program. If the programmer has not previously called D3FIN to close down the first project, then D3FIN will be called automatically.
The user is allowed three attempts at calling D3INIT. After the third consecutive unsuccessful attempt, a corresponding error condition will be raised and all successive attempts will be unsuccessful. On successful completion of D3INIT the counter is reset and the user is allowed a further three attempts at a subsequent project.
If any navigation or attribute retrieval routine is called prior to a successful D3INIT, error 3 (Routine D3INIT has not been called) will be returned to the user and no further action will be taken.
A monitoring facility may be invoked to assist the programmer in tracking down errors. Three levels of monitoring are available: FULL, SOME and NONE. 'SOME' monitoring will cause the names of databases opened by D3MMDB to be output. 'FULL' monitoring will in addition cause the details of all the data access routines which are called together with their arguments to be output to the default output device, including all warning/error conditions encountered. By default no monitoring is provided. The monitoring level can be changed by a subsequent call to D3UMON.
Arguments
|
CD3PRJ |
Marine project name (3 characters), for example, 'XXX' |
|
Input characters will be converted to upper case. Strings exceeding three characters will be truncated. |
|
|
If the argument is blank (' '), the routine will prompt the user interactively for the project name in the manner of the Marine entry procedure. The user is allowed three attempts to enter a valid project name. As with Marine , a valid but non-existent project name will result in an error condition (error 108). |
|
|
CD3USR |
Marine Username (up to 32 characters), for example, 'SMITH' or ‘Smith’ |
|
Input characters will be converted to upper case if an exact-case match is not found, for example, the correct case must be used if the desired username does not consist entirely of upper-case alphabetic characters. Strings exceeding 32 characters will be truncated. |
|
|
If one or both of the CD3USR and CD3PAS arguments are blank, the routine will prompt interactively. The user will be allowed three attempts at entering a valid user/password combination. |
|
|
CD3PAS |
User password (up to 6 characters). |
|
Will differentiate between upper and lower case characters (Marine password is 'case-sensitive'). Strings exceeding six characters will be truncated. |
|
|
If one or both of the CD3USR and CD3PAS arguments are blank, the routine will prompt interactively. The user will be allowed three attempts at entering a valid user/password combination. |
|
|
CD3MON |
Required monitor level (up to 4 characters). |
|
Input characters will be converted to upper case. Strings exceeding four characters will be truncated. Any string other than 'SOME' or 'FULL' (after truncation) will be interpreted as 'NONE'. |
|
|
NONE - no monitoring. If required, D3EMSG can be called selectively to output messages. |
|
|
SOME - display names and types of databases opened by D3MMDB. |
|
|
FULL - as SOME plus display routine name and values of input and output arguments for all routines called and display all non-zero error messages. |
|
|
CD3RWK |
Read/write key (for future use) Enter as ' ' in this release. The argument will be ignored. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
101 |
Error opening Dabacon workfile |
|
102 |
Bad password |
|
103 |
Unknown username |
|
104 |
Too many users in project |
|
105 |
Project currently locked |
|
106 |
Project is incompatible version |
|
107 |
Too many failed initializations |
|
108 |
Project not found |
|
109 |
Error opening runfile data file |
|
115 |
Sitefile/Security error |
|
116 |
Invalid project name |
|
119 |
System database error |
Other Error Conditions
Only very few (and serious) error conditions result in immediate stop of the DARs application program during a call to D3INIT. In each case, a suitable error message will be output to the default output device.
D3MCDB - Make a Database Current in MDB
Specification
|
SUBROUTINE D3MCDB( CD3NAM, ID3POS, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3NAM |
|
|
INTEGER |
ID3POS, ID3ERR |
|
Description
This routine makes a named database in the current MDB current at the specified position. Other databases are shuffled up or down, as necessary. This is equivalent to the Marine command CURRENT.
If an error occurs then an error code is returned as specified below and the named database remains in an unchanged state. The change in database status is temporary, for the duration of the DARs application, similar to the use of CURRENT in the Design module.
Arguments
|
CD3NAM |
The name of the database. |
|
ID3POS |
The list order position required. If the specified position is greater than the existing number of current databases (but less than 100) the database will be made current at the next position. A position less than 1 or greater than the maximum possible (currently 100) will result in error code 125. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
120 |
Database not found |
|
121 |
Database not in current MDB |
|
122 |
Database already current |
|
124 |
Too many current databases |
|
125 |
Invalid database position |
D3MDDB - Defer a Database in MDB
Specification
|
SUBROUTINE D3MDDB( CD3NAM, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3NAM |
|
|
INTEGER |
ID3ERR |
|
Description
This routine defers a named database in the current MDB. This database is also placed in the last list order position and other databases are shuffled up to fill the gap. This is equivalent to the Marine command DEFER.
If an error occurs then an error code is returned as specified below and the named database remains in an unchanged state. The change in database status is temporary, for the duration of the DARs application, similar to the use of DEFER in the Design module.
Arguments
|
CD3NAM |
The name of the database. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
120 |
Database not found |
|
121 |
Database not in current MDB |
|
123 |
Database not current |
D3MEDB - Exchange Databases in MDB
Specification
|
SUBROUTINE D3MEDB( CD3NM1, CD3NM2, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3NM1, CD3NM2 |
|
|
INTEGER |
ID3ERR |
|
Description
This routine exchanges a current and a deferred database in the current MDB. One of the named databases must have 'current' status and the other must have 'deferred' status before this routine is called. Following successful execution their status and list order positions will be reversed. This is equivalent to the Marine command EXCHANGE.
If an error occurs then an error code is returned as specified below and the named databases remain in an unchanged state. The change in database status is temporary, for the duration of the DARs application, similar to the use of EXCHANGE in the Design module.
Error codes 122 and 123 require a slightly different interpretation than suggested by the standard text (see below). Error codes 120 and 121 may apply to either database.
Arguments
|
CD3NM1 |
The name of the first database. |
|
CD3NM2 |
The name of the second database. The order of the two databases is not important. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
120 |
Database not found |
|
121 |
Database not in current MDB |
|
122 |
Database already current (that means, both are current) |
|
123 |
Database not current (that means, both are deferred) |
D3MMDB - Select MDB
Specification
|
SUBROUTINE D3MMDB( CD3MDB, CD3RWK, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3MDB, CD3RWK |
|
|
INTEGER |
ID3ERR |
|
Description
This routine (re)selects an MDB within the requested Marine project. It closes any Marine databases that this user has open and, by default, it opens all current databases in the MDB in read mode and updates the Marine system database accordingly. Subsequent database navigation will have access to the MDB databases in the order determined by the LIST MDB command in Marine . That is, the default database is the first database, which may for example be a design database or a catalogue database. A further option allows the user/programmer to specify the default database and, at the same time, to limit the number of databases that are opened.
After a successful call to this routine, the current position is the world corresponding to the default database.
If an error occurs then an error code as specified below is returned and all databases in the MDB are closed. To allow the programmer to use this routine interactively, some error conditions (110, 111, 117, 118) do no more than set the internal error flag and return the error code. This allows the programmer to call the routine repeatedly to allow the user to select a valid MDB. All other errors, which generally denote an more serious problem, result in an automatic call to D3FIN to close the project down.
If any navigation or attribute retrieval routine is called prior to a successful D3MMDB, error 4 (Routine D3MMDB has not been called) will be returned to the user and no further action will be taken.
When SOME or FULL monitoring is activated, a list of all databases opened, together with open mode and database type, is output to the default output device.
Arguments
|
CD3MDB |
Default database (up to 9 characters) & MDB Name (up to 32 characters, including the leading '/'), concatenated together. The default database is interpreted as the text string preceding the first '/' and it will be converted to upper case. If omitted (CD3MDB starts with a '/'), the default database will be the first database in the MDB. |
The following keywords are valid:
|
Keyword |
Default database |
Other databases open |
|---|---|---|
|
DES/IGN |
Design (DESI) |
CATA PROP DICT |
|
CAT/ALOGUE |
Catalogue (CATA) |
PROP DICT |
|
PROP/ERTY |
Properties (PROP) |
CATA DICT |
|
PAD/DLE |
PADDLE (PADD) |
DESI CATA PROP DICT |
|
DIC/TIONARY |
Dictionary (DICT) |
None |
|
Blank or null |
1st database |
All |
If a default database is specified, all databases of the types specified in the above table are opened by this routine.
The MDB name (the string commencing with the first '/'), for example, '/MDB1' will NOT be converted to upper case (MDB name is case-sensitive). Names exceeding 32 characters will be truncated.
Examples of valid entries for this argument:
|
DESI/PLANT |
: Default database DESI, MDB /PLANT |
|
CAT/TEST |
: Default database CATA, MDB /TEST |
|
/PLANT |
: No default database (defaults to first), MDB /PLANT |
|
CD3RWK |
Read/write key (for future use) Enter as ' ' in this release. The argument will be ignored. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
110 |
MDB not found |
|
111 |
No databases to open |
|
112 |
Corrupt databases |
|
113 |
Databases in use |
|
114 |
Error opening database file |
|
117 |
Invalid default database type |
|
118 |
No databases of default type in MDB |
D3MNAM - Move to an Element by Name
Specification
|
SUBROUTINE D3MNAM( CD3NAM, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3NAM |
|
|
INTEGER |
ID3ERR |
|
Description
This routine navigates the hierarchy by an element name or reference number. If an error occurs then an error code as specified below is returned and the database position is not updated.
Arguments
|
CD3NAM |
Element name (up to 50 characters) or reference number |
|
Should include the leading '/' if a name or the '=' and '/' characters if a reference number, for example, '/C1101', '=29/1301'. |
|
|
For a name, an input string exceeding 50 characters will be truncated and input characters will NOT be converted to upper case. |
|
|
For a reference number, any string that is not of the form '=m/n', where m and n are valid integers, will be rejected with error code 9. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
9 |
Bad name/reference argument |
|
402 |
Undefined name/reference |
D3MNUM - Move to Element by Order Position
Specification
|
SUBROUTINE D3MNUM( CD3TYP, ID3LIS, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3TYP |
|
|
INTEGER |
ID3LIS, ID3ERR |
|
Description
This routine navigates the hierarchy by list order position. It enables the user to either move to an explicit list order position, or to move to the nth member of a particular element. It mimics Marine commands such as '1', 'BRAN 3', 'EQUIP 1'. The type of element specified may be a Marine noun or special keywords to move in the current list or to move to a member owned by the current element. If an error occurs then an error code as specified below is returned and the database position is not updated.
Arguments
|
CD3TYP |
Type of element to be selected. |
|
This may be a special keyword or a Marine noun, for example, 'PIP/E', 'BOX', 'SPCO/MPONENT'. |
|
|
Input characters will be converted to upper case. Abbreviations accepted in Marine will be accepted by this routine (for example, 'PIP', 'SPCO' are accepted) |
|
|
The following special keywords are valid: |
|
|
ELEM/ENT |
Move in the current list |
|
MEMB/ER |
Move to a member owned by the current element |
|
ID3LIS |
Element's list position in the hierarchy, for example, 1, 8 |
|
An entry greater than the highest available position will result in error code 203 (List exhausted). An illegal value (for example, negative) will result in error code 10 (Argument has illegal value). |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
10 |
Argument has illegal value |
|
201 |
Element has no list part |
|
202 |
No members |
|
203 |
List exhausted |
|
205 |
Cannot access this type of element |
D3MOWN - Move to Owner of Current Element
Specification
|
SUBROUTINE D3MOWN( ID3ERR ) |
||
|
INTEGER |
ID3ERR |
|
Description
This routine navigates to the owner of the current element. If an error occurs then an error code as specified below is returned and the database position is not updated.
Arguments
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
204 |
Current element has no owner |
D3MQDB - Query database in Current MDB
Specification
|
SUBROUTINE D3MQDB( ID3POS, CD3NAM, CD3TYP, ID3STA, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3NAM, CD3TYP |
|
|
INTEGER |
ID3POS, ID3STA, ID3ERR |
|
Description
This routine reads the name and status of the database in a defined position in the current MDB. If executed within a loop, this is equivalent to the Marine command STATUS.
If an error occurs then an error code is returned as specified below, ID3STA is returned as zero and the character arguments are returned blank. The error code can be used to terminate a loop if the user wishes to query the status of all databases.
Arguments
|
ID3POS |
The list order position of the database. |
|
CD3NAM |
The name of the database at this position. |
|
The database name can be up to 64 characters long. If this character string is declared shorter than the current database name length, the returned string will be truncated and no error will result. The name is of the form team/name (for example, 'PIPE/DESIGNA'). |
|
|
CD3TYP |
The type of the database. |
|
This is the four-character database type (for example, DESI, CATA). If this character string is declared shorter than 4, the returned string will be truncated and no error will result. |
|
|
ID3STA |
Status of the database. |
|
The returned status has a value between 1 and 3, as follows: |
|
|
1: |
Current, Read |
|
2: |
Current, Closed |
|
3: |
Deferred |
|
ID3STA will be returned as zero if the routine fails. |
|
|
ID3ERR |
Error code |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
125 |
Invalid database position |
D3MREL - Move Relative to the Current Position
Specification
|
SUBROUTINE D3MREL( CD3POS, CD3TYP, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3POS, CD3TYP |
|
|
INTEGER |
ID3ERR |
|
Description
This routine navigates the hierarchy relative to the current database position, mimicking Marine commands such as PREV, LAST MEMB, NEXT BOX. The movement is specified using the two arguments CD3POS, which specifies the relative position (PREV, NEXT, LAST, FIRS) and CD3TYP which qualifies the above instruction with the type of element required (a keyword or a Marine noun). If an error occurs then an error code as specified below is returned and the database position is not updated.
Arguments
|
CD3POS |
The relative position. Input characters will be converted to upper case. |
|
The following keywords are valid: |
|
|
FIRS/T |
first element |
|
LAST |
last element |
|
NEXT |
next element |
|
PREV/IOUS |
previous element |
|
CD3TYP |
Type of element to be selected. |
|
This may be a special keyword or a Marine noun, for example, 'ELB/OW', 'BOX', 'EQU/IPMENT'. |
|
|
Input characters will be converted to upper case. Abbreviations accepted in Marine will be accepted by this routine (for example, 'ELB', 'EQU' are accepted). |
|
|
The following special keywords are valid: |
|
|
ELEM/ENT |
Move in the current list |
|
MEMB/ER |
Move to a member owned by the current element |
|
TID3ERR |
Error code |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
6 |
Invalid position keyword |
|
201 |
Element has no list part |
|
202 |
No members |
|
203 |
List exhausted |
|
205 |
Cannot access this type of element |
D3MRST - Restore Last Saved Database Position
Specification
|
SUBROUTINE D3MRST( ID3ERR ) |
||
|
INTEGER |
ID3ERR |
|
Description
This routine restores the database position saved by the previous call to D3MSAV.
Calls to D3MSAV and D3MRST must be paired and can be nested to a depth of 10. Attempts to restore a position when none has been saved or when any saved positions have already been restored will result in error code 127. This could occur, therefore, if nesting is unbalanced. When the routine fails, the database position is unchanged.
Arguments
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
127 |
No saved database position |
D3MSAV - Save Current Database Position
Specification
|
SUBROUTINE D3MSAV( ID3ERR ) |
||
|
INTEGER |
ID3ERR |
|
Description
This routine saves the current database position so that it may subsequently be restored by calling D3MRST. This is more efficient than using D3RNAM and D3MNAM.
Calls to D3MSAV and D3MRST must be paired and can be nested to a depth of 10. Attempts to exceed this depth will result in the return of error code 126 and the position will not be saved.
Arguments
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
126 |
Too many saved database levels |
D3RBDU - Read Bore and Distance Units
Specification
|
SUBROUTINE D3RBDU( CD3BUN, CD3DUN, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3BUN, CD3DUN |
|
Description
This routine returns the bore and distance units defined for the current MDB. It returns two character strings of maximum length 4 containing the linear units.
Arguments
|
CD3BUN |
Bore units, 'MM', 'INCH' or 'FINC' |
|
If the units are undefined or null, 'MM' will be returned. The maximum length of the returned text string is 4 characters. If the supplied character field is shorter than the returned units, the text will be truncated but no error condition will arise. If the field is too long, it will be padded with blanks. |
|
|
CD3DUN |
Distance units, any hash code standard distance unit as a string including 'MM', 'INCH' or 'FINC' 'FINC' but also ANGS, CM, FOOT, KM, METR, MICR, MILE, THOU, YARD. |
|
If the units are undefined or null, 'MM' will be returned. The maximum length of the returned text string is 4 characters. |
|
|
Units of other Physical Quantities The current units of other physical quantities (mass, area ) can be deduced from the distance units. The setting of CD3DUN determines which of imperial or metric units are to be generally used. Some physical quantities will use their database unit regardless of imperial or metric CD3DUN settings (for example, angles, voltages, current, time, power). The working units of most other quantities are directly dependent on (that means, DERIVED from) the setting of the CD3DUN unit (and sometimes units of other quantities. For example Area, Volume, Surface and Linear Density, Content, Temperature gradient. |
|
|
Some quantities have special initial imperial or metric settings applied which are dependent on whether CD3DUN is imperial or metric
|
|
|
If the supplied character field is shorter than the returned units, the text will be truncated but no error condition will arise. If the field is too long, it will be padded with blanks. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
D3RBOX - Read Enclosing Box Co-ordinates
Specification
|
SUBROUTINE D3RBOX |
( LD3TUB, RD3BOX, ID3ERR ) |
|
|
LOGICAL |
LD3TUB |
|
|
INTEGER |
ID3ERR |
|
|
REAL |
RD3BOX(6) |
|
Description
This routine reads the co-ordinates of the surrounding box for the current element or its leave tube. This is valid for any database element and is equivalent to the CLASHER command 'QUERY BOX':
QUERY BOX name/ref
QUERY BOX LEAVE of name/ref
QUERY BOX HEAD of name/ref
In the case of branches, the leave tube is interpreted as the branch head tube. The surrounding box is returned as a six element real array containing the x/y/z co-ordinates of opposite corners of the box. Array RD3BOX must be declared at least six elements.
If an error occurs then an error code is returned as specified below and six elements of RD3BOX are returned as zero. Error 310 can only be returned if LD3TUB, the leave tube flag, is set to true.
Arguments
|
LD3TUB |
Leave tube flag. |
|
.TRUE. |
Return box for leave tube (or branch head tube for branch) |
|
.FALSE. |
Return box for current element |
|
RD3BOX |
Surrounding box |
|
The box is returned as a six element real array containing the x/y/z world co-ordinates of opposite corners of the box. The six elements have the following arrangement: |
|
|
1st corner - E (element 1), N (element 2), U (element 3) |
|
|
2nd corner - E (element 4), N (element 5), U (element 6) |
|
|
Array RD3BOX must be declared at least six elements. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
309 |
Element not on spatial map |
|
310 |
Leave or head tube does not exist |
D3RDAT - Read Latest MDB Date-Stamp
Specification
|
SUBROUTINE D3RDAT( ID3DAT, CD3DAT, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3DAT |
|
|
INTEGER |
ID3DAT(6), ID3ERR |
|
Description
This routine returns the latest date-stamp for any database in the mdb system. For user convenience, the date/time is returned in two arguments: an integer array and a character string.
In a Marine run, each database of the current MDB is date-stamped with the current operating system date/time when a user with WRITE access leaves a design module (for example, Design) after making a change to the data and without QUITting. This maintains a record of the date and time of the last database change.
Error code 306 is returned if no date-stamps can be found.
Arguments
|
ID3DAT |
Latest database date-stamp as an integer array. |
|
The date/time is represented as six integers: |
|
|
ID3DAT(1) |
Year (As a 4-digit number) |
|
ID3DAT(2) |
Month (1 = January, 12 = December) |
|
ID3DAT(3) |
Day (1 to 31) |
|
ID3DAT(4) |
Hour (0 to 23) |
|
ID3DAT(5) |
Minute (0 to 59) |
|
ID3DAT(6) |
Second (0 to 59) |
|
The ID3DAT array must be dimensioned to a minimum of six. The array will be returned as zeros if an error condition occurs. |
|
|
CD3DAT |
Latest database date-stamp as a character string. |
|
The date/time format is of the form 'dd Mon yyyy hh:mm:ss', where:
|
|
|
CD3DAT should be declared at least CHARACTER*20 for the complete date/time to be returned. The date/time will be truncated to fit the declared length of CD3DAT, but only as follows: |
|
|
1-10: |
returns blank string |
|
11-16: |
returns dd Mon yy |
|
17-19: |
returns dd Mon yy hh:mm |
|
No error code will be returned if a blank or truncated string is returned. A blank string will be returned if an error condition occurs. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
306 |
No date-stamp found |
D3RIA - Read an Integer Array Attribute
Specification
|
SUBROUTINE D3RIA( CD3ATT, ID3NIN, ID3IA, ID3NOU, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT |
|
|
INTEGER |
ID3NIN, ID3IA(ID3NIN), ID3NOU, ID3ERR |
|
Description
This routine reads an integer array attribute of the current element. The attribute may be a UDA. The maximum size of array required is specified by ID3NIN. The array must be dimensioned at least this big. The number of values returned is output in ID3NOU. Any excess elements of ID3NIN over ID3NOU are returned as zero.
The routine will return a single value for a single integer attribute.
If an error occurs then an error code is returned as specified below, ID3NOU is returned as zero and ID3NIN elements of array ID3IA are returned as zero.
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no values set (see Dynamic Array Attributes).
The routine will return a valid (but meaningless) integer array for a text attribute. This results from the way that text attributes are stored on the databases. Error code 302 will not therefore be returned for a text attribute.
Arguments
|
CD3ATT |
The name of the attribute required. |
|
This must be a Marine attribute name, for example, 'LEV/EL' or a UDA name. Input characters will be converted to upper case. |
|
|
In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine (for example, 'LEV' is accepted). |
|
|
A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
|
ID3NIN |
Maximum number of array elements required. |
|
Array ID3IA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed. |
|
|
ID3IA |
The array of integer values. |
|
If the attribute is user-defined, the units pertaining to the returned integer array may be obtained by calling routine D3RUNI. |
|
|
ID3NOU |
The number of values returned in ID3IA. |
|
If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails. If the number of values is genuinely zero (for example, an unset UDA array), ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
|
308 |
Attribute unset |
D3RINT - Read an Integer Attribute
Specification
|
SUBROUTINE D3RINT( CD3ATT, ID3INT, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT |
|
|
INTEGER |
ID3INT, ID3ERR |
|
Description
This routine reads an integer attribute of the current element. The attribute may be a UDA. If an error occurs then an error code is returned as specified below and the ID3INT argument is returned as zero.
Arguments
|
CD3ATT |
The name of the attribute required. |
|
This must be a Marine attribute name, for example, 'SAFC/LASS', 'ARR/IVE', 'QUAL/IFIER' or a UDA name. Input characters will be converted to upper case. |
|
|
In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine (for example, 'ARR', 'SAFC' are accepted). |
|
|
A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
|
ID3INT |
The value of the integer attribute. |
|
If the attribute is user-defined, the units pertaining to the returned integer value may be obtained by calling routine D3RUNI. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
D3RLA - Read a Logical Array Attribute
Specification
|
SUBROUTINE D3RLA( CD3ATT, ID3NIN, LD3LA, ID3NOU, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT |
|
|
INTEGER |
ID3NIN, ID3NOU, ID3ERR |
|
|
LOGICAL |
LD3LA(ID3NIN) |
|
Description
This routine reads a logical array attribute of the current element. The attribute may be a UDA. The maximum size of array required is specified by ID3NIN. The array must be dimensioned at least this big. The number of values returned is output in ID3NOU. Any excess elements of ID3NIN over ID3NOU are returned as false.
The routine will return a single value for a single logical attribute.
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no values set (see Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below, ID3NOU is returned as zero and ID3NIN elements of LD3LA are returned as false.
The only use of logical arrays is for UDAs.
Arguments
|
CD3ATT |
The name of the attribute required. |
|
This must be a Marine attribute name or a UDA name. Input characters will be converted to upper case. |
|
|
In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine. |
|
|
A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
|
ID3NIN |
Maximum number of array elements required. |
|
Array LD3LA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed. |
|
|
LD3LA |
The array of logical values. |
|
ID3NOU |
The number of values returned in LD3LA. |
|
If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails. If the number of values is genuinely zero (for example, an unset UDA array), ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
|
308 |
Attribute unset |
D3RLOG - Read a Logical Attribute
Specification
|
SUBROUTINE D3RLOG( CD3ATT, LD3LOG, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT |
|
|
INTEGER |
ID3ERR |
|
|
LOGICAL |
LD3LOG |
|
Description
This routine reads a logical attribute of the current element. The attribute may be a UDA. If an error occurs then an error code is returned as specified below and LD3LOG is returned as false.
Arguments
|
CD3ATT |
The name of the attribute required. |
|
This must be a Marine attribute name, for example, 'LOCK', 'BUI/LT', 'SHO/P' or a UDA name. Input characters will be converted to upper case. |
|
|
In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine (for example, 'BUI', 'SHO' are accepted). |
|
|
A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
|
LD3LOG |
The value of the logical attribute. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
D3RNAM - Read Element Name or a Name Attribute
Specification
|
SUBROUTINE D3RNAM( CD3ATT, CD3NAM, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT, CD3NAM |
|
|
INTEGER |
ID3ERR |
|
Description
This routine reads the name of the current element or the name of a reference attribute of the current element. The reference attribute may be a UDA. It returns a reference number if the requested name does not exist.
A name is returned with the leading '/' character. If a reference number is returned, it includes the '=' and '/' characters.
If an error occurs then an error code is returned as specified below and CD3NAM is returned as blank.
Use routine D3RREF to obtain the reference specifically even if a name is available.
Arguments
|
CD3ATT |
The name of the attribute required. |
|
This must be a Marine attribute name, for example, 'PSPE/CIFICATION', 'CAT/REFERENCE', ‘HEA/D’ or a UDA name. Input characters will be converted to upper case. |
|
|
In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine (for example, 'PSPE', 'CAT' are accepted). |
|
|
A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
|
CD3NAM |
The value of the name attribute. |
|
It is the programmer's responsibility to ensure that CD3NAM is declared large enough. Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs, CD3NAM is returned as blank. |
|
|
If CD3ATT is 'NAM/E' and the element is not named, then CD3NAM will return the reference number (if the declared string is large enough). |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
5 |
Character output string parameter too short |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
D3RORL - Read Orientation of the Current Element
Specification
|
SUBROUTINE D3RORL( CD3CRD, RD3ORI, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3CRD |
|
|
INTEGER |
ID3ERR |
|
|
REAL |
RD3ORI(9) |
|
Description
This routine reads the orientation of the current element relative to a specified co-ordinate system. Valid co-ordinate systems include Marine names, Marine reference numbers, Marine nouns and the text 'OWN/ER'. The orientation is returned as a nine element real array containing the three unit vectors. Array RD3ORI must be declared at least nine elements.
If an error occurs then an error code is returned as specified below and nine elements of RD3ORI are returned as zero.
Arguments
|
CD3CRD |
The requested co-ordinate system. |
|
This may be the keyword 'OWN/ER' or a Marine noun (for example, 'ZON/E', 'WORL/D'), or a Marine name (for example, '/DATUM'), or a Marine reference number. |
|
|
The input string will be tested against each type of input in turn. An unrecognized entry for CD3CRD will result in error code 7 (Invalid co-ordinate system keyword) or error code 205 (Cannot access this type of element). |
|
|
When testing for 'OWNER' or a Marine noun, input characters will be converted to upper case. In the case of Marine nouns, abbreviations accepted in Marine will be accepted by this routine (for example, 'ZON', 'WORL' are accepted). |
|
|
When testing for a Marine name, the input string will not be converted to upper case and strings exceeding 50 characters will be truncated. |
|
|
For a reference number, any string that is not of the form '=m/n', where m and n are valid integers, will be rejected with error code 9. |
|
|
An undefined name or reference number will result in error code 402. |
|
|
RD3ORI |
Orientation array of three unit vectors. |
|
The orientation is returned as a nine element real array containing the three unit vectors. The nine elements have the following arrangement: |
|
|
X axis unit vector - E (element 1), N (element 2), U (element 3) |
|
|
Y axis unit vector - E (element 4), N (element 5), U (element 6) |
|
|
Z axis unit vector - E (element 7), N (element 8), U (element 9) |
|
|
Array RD3ORI must be declared at least nine elements. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
7 |
Invalid co-ordinate system keyword |
|
9 |
Bad name/reference argument |
|
205 |
Cannot access this type of element |
|
402 |
Undefined name/reference |
D3RPAT - Read PPOINT Attributes
Specification
|
SUBROUTINE D3RPAT( CD3POI, CD3CRD, RD3POS, RD3DIR, RD3BOR, CD3CON, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3POI, CD3CRD, CD3CON |
|
|
INTEGER |
ID3ERR |
|
|
REAL |
RD3POS(3), RD3DIR(3), RD3BOR |
|
Description
This routine reads the PPoint attributes (position, direction, connection type and bore) for a piping component or equipment primitive, relative to a specified co-ordinate system. Valid co-ordinate systems include Marine names, Marine reference numbers, Marine nouns and the text 'OWN/ER'. For branch and piping component PPoints the co-ordinate system 'OWNER' is interpreted as 'ZONE' since 'BRAN' and 'PIPE' are not meaningful co-ordinate systems.
The specified PPoint may be 'PH', 'PT', 'PA', 'PL', or 'P<n>'. Implied tubing points may thus be obtained by interrogating the arrive and leave points of the appropriate components. For equipment primitives, a zero bore and blank connection type are returned. Position and direction are returned as real arrays of three elements each. Direction is in the form of a unit vector.
Arrays RD3POS and RD3DIR must be declared at least three elements each.
If an error occurs then an error code is returned as specified below, 3 elements of RD3POS, 3 elements of RD3DIR, and RD3BOR are returned as zero, and CD3CON is returned blank.
Arguments
|
CD3POI |
The required PPOINT. |
|
that means, 'PH/EAD', 'PT/AIL', 'PA/RRIVE', 'PL/EAVE', or 'P<n>', where n is an integer ('P1', 'P2', ). |
|
|
The input string will be converted to upper case. |
|
|
CD3CRD |
The requested co-ordinate system. |
|
This may be the keyword 'OWN/ER' or a Marine noun (for example, 'ZON/E', 'WORL/D'), or a Marine name (for example, '/DATUM'), or a Marine reference number. |
|
|
For branch and piping component PPoints the co-ordinate system 'OWNER' is interpreted as 'ZONE' since 'BRANCH' and 'PIPE' are not meaningful co-ordinate systems. |
|
|
The input string will be tested against each type of input in turn. An unrecognized entry for CD3CRD will result in error code 7 (Invalid co-ordinate system keyword) or error code 205 (Cannot access this type of element). |
|
|
When testing for 'OWNER' or a Marine noun, input characters will be converted to upper case. In the case of Marine nouns, abbreviations accepted in Marine will be accepted by this routine (for example, 'ZON', 'WORL' are accepted). |
|
|
When testing for a Marine name, the input string will not be converted to upper case and strings exceeding 50 characters will be truncated. |
|
|
For a reference number, any string that is not of the form '=m/n', where m and n are valid integers, will be rejected with error code 9. |
|
|
An undefined name or reference number will result in error code 402. |
|
|
RD3POS |
The PPoint position. |
|
The position is returned as a three element real array containing the three vectors in E, N, U order. Array RD3POS must be declared at least three elements. |
|
|
RD3DIR |
The PPoint direction. |
|
The direction is returned as a three element real array containing the unit vector in E, N, U order. Array RD3DIR must be declared at least three elements. |
|
|
RD3BOR |
The PPoint bore. |
|
CD3CON |
The PPoint connection type |
|
It is the programmer's responsibility to ensure that CD3CON is declared large enough (usually CHARACTER*4). Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs, CD3CON is returned as blank. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
5 |
Character output string parameter too short |
|
7 |
Invalid co-ordinate system keyword |
|
8 |
Invalid PPoint keyword |
|
9 |
Bad name/reference argument |
|
205 |
Cannot access this type of element |
|
303 |
Element does not have PPoints |
|
304 |
Illegal PPoint number |
|
402 |
Undefined name/reference |
D3RPRJ - Read a Project Data Item
Specification
|
SUBROUTINE D3RPRJ( CD3NAM, CD3TEX, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3NAM, CD3TEX |
|
|
INTEGER |
ID3ERR |
|
Description
This routine retrieves project code, name, number, description or message from the System Database as a character string. The routine is equivalent to Marine Admin/Monitor command 'Q/UERY PROJ/ECT <keyword>'.
If an error occurs then an error code is returned as specified below and the CD3TEX argument is returned blank.
This routine may be called before D3MMDB has been called.
Arguments
|
CD3NAM |
The data item keyword. |
|
The following keywords are valid: |
|
|
COD/E |
project code |
|
NUM/BER |
project number |
|
NAM/E |
project name |
|
DES/CRIPTION |
project description |
|
MES/SAGE |
project message |
|
The nomenclature of 'code' and 'name' may appear confusing. Project 'code' is the 3-character code normally known as 'project name' (see CD3PRJ in routine D3INIT). Project 'name' is a descriptive text (up to 119 characters), specified in the Marine Admin module. |
|
|
CD3TEX |
The returned text. |
|
3 characters will be returned for project code, up to 16 characters for project number and up to 119 characters for the other three items. If the data item is unset, a blank string will be returned, but no error condition will arise. |
|
|
It is the programmer's responsibility to ensure that CD3TEX is declared large enough. Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs, CD3TEX is returned as blank. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
5 |
Character output string parameter too short |
|
11 |
Invalid project data keyword |
D3RPRL - Read Position of the Current Element
Specification
|
SUBROUTINE D3RPRL( CD3CRD, RD3POS, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3CRD |
|
|
INTEGER |
ID3ERR |
|
|
REAL |
RD3POS(3) |
|
Description
This routine reads the position of the current element relative to a specified co-ordinate system. Valid co-ordinate systems include Marine names, Marine reference numbers, Marine nouns and the text 'OWN/ER'. The position is returned as a three element real array. Array RD3POS must be declared at least three elements.
If an error occurs then an error code is returned as specified below and three elements of RD3POS are returned as zero.
Arguments
|
CD3CRD |
The requested co-ordinate system. |
|
This may be the keyword 'OWN/ER' or a Marine noun (for example, 'ZON/E', 'WORL/D'), or a Marine name (for example, '/DATUM'), or a Marine reference number. |
|
|
The input string will be tested against each type of input in turn. An unrecognized entry for CD3CRD will result in error code 7 (Invalid co-ordinate system keyword) or error code 205 (Cannot access this type of element). |
|
|
When testing for 'OWNER' or a Marine noun, input characters will be converted to upper case. In the case of Marine nouns, abbreviations accepted in Marine will be accepted by this routine (for example, 'ZON', 'WORL' are accepted). |
|
|
When testing for a Marine name, the input string will not be converted to upper case and strings exceeding 50 characters will be truncated. |
|
|
For a reference number, any string that is not of the form '=m/n', where m and n are valid integers, will be rejected with error code 9. |
|
|
An undefined name or reference number will result in error code 402. |
|
|
RD3POS |
The position. |
|
The position is returned as a three element real array containing the three vectors in E, N, U order. Array RD3POS must be declared at least three elements. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
7 |
Invalid co-ordinate system keyword |
|
9 |
Bad name/reference argument |
|
205 |
Cannot access this type of element |
|
402 |
Undefined name/reference |
D3RPTX - Read REPORTER Text for a UDA
Specification
|
SUBROUTINE D3RPTX( CD3ATT, CD3RPT, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT, CD3RPT |
|
|
INTEGER |
ID3ERR |
|
Description
This routine reads the REPORTER text for a given UDA. REPORTER text may be up to 20 characters long and is used in column headers by the Marine module REPORTER.
If no REPORTER text has been defined, the routine will return the UDA name.
Arguments
|
CD3ATT |
The name of the attribute required for which REPORTER text is required. |
|
The attribute string will be checked for a leading colon. If one does not exist the routine will insert one. Valid abbreviations will be accepted. For example, valid attribute strings for a UDA called :CONTROLLER would include: |
|
|
:CONTROLLER :CONT CONT |
|
|
assuming a minimum abbreviation of 4 or less. |
|
|
CD3RPT |
The REPORTER text string. |
|
If the supplied string is not sufficient to hold the complete REPORTER text the output will be truncated. |
|
|
If no REPORTER text string is found, the UDA name will be returned, including leading |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
307 |
UDA not found |
D3RRA - Read a Real Array Attribute
Specification
|
SUBROUTINE D3RRA( CD3ATT, ID3NIN, RD3RA, ID3NOU, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT |
|
|
INTEGER |
ID3NIN, ID3NOU, ID3ERR |
|
|
REAL |
RD3RA(ID3NIN) |
|
Description
This routine reads a real array attribute of the current element. The attribute may be a UDA. The maximum size of array required is specified by ID3NIN. The array must be dimensioned at least this big. The number of values returned is output in ID3NOU. Any excess elements of ID3NIN over ID3NOU are returned as zero.
The routine will return a single value for a single real attribute.
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no values set (see Section Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below, ID3NOU is returned as zero and ID3NIN elements of array RD3RA are returned as zero.
Arguments
|
CD3ATT |
The name of the attribute required. This must be a Marine attribute name, for example, 'POS/ITION', 'PARA/METERS', 'HDI/RECTION' or a UDA name. Input characters will be converted to upper case. In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine (for example, 'HDI', 'POS' are accepted). A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
ID3NIN |
Maximum number of array elements required. Array RD3RA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed. |
|
RD3RA |
The array of real values. If the attribute is user-defined, the units pertaining to the returned real array may be obtained by calling routine D3RUNI. |
|
ID3NOU |
The number of values returned in RD3RA. If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails. If the number of values is genuinely zero (for example, an unset UDA array), ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
|
308 |
Attribute unset |
D3RREA - Read a Real Attribute
Specification
|
SUBROUTINE D3RREA( CD3ATT, RD3REA, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT |
|
|
INTEGER |
ID3ERR |
|
|
REAL |
RD3REA |
|
Description
This routine reads a real attribute of the current element. The attribute may be a UDA. If an error occurs then an error code is returned as specified below and the RD3REA argument is returned as zero.
Arguments
|
CD3ATT |
The name of the attribute required. This must be a Marine attribute name, for example, 'BOR/E', 'TEM/PERATURE', 'XLE/NGTH' or a UDA name. Input characters will be converted to upper case. In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine (for example, 'TEM', 'XLE' are accepted). A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
RD3REA |
The value of the real attribute. If the attribute is user-defined, the units pertaining to the returned real value may be obtained by calling routine D3RUNI. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
D3RREF - Read Element RefNo or a Reference Attribute
Specification
|
SUBROUTINE D3RREF( CD3ATT, CD3REF, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT, CD3REF |
|
|
INTEGER |
ID3ERR |
|
Description
This routine reads the reference number of the current element or of a reference attribute of the current element (for example, a connection reference, specification reference). The reference attribute may be a UDA.
If an error occurs then an error code is returned as specified below and CD3REF will be returned zero.
Use routine D3RNAM to obtain the name, if available, in preference to the reference number.
Arguments
|
CD3ATT |
The name of the attribute required. This must be a Marine attribute name, for example, 'CREF/ERENCE', 'HREF/ERENCE', ‘HEAD’ or a UDA name. Input characters will be converted to upper case. In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine (for example, 'CREF', 'HREF' are accepted). A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
CD3REF |
The value of the reference number attribute. The reference number will include the '=' and '/' characters. It is the programmer's responsibility to ensure that CD3REF is declared large enough. Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs, CD3NAM is returned as blank. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
5 |
Character output string parameter too short |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
D3RRFA - Read a Reference Number Array Attribute
Specification
|
SUBROUTINE D3RRFA( CD3ATT, ID3NIN, CD3RFA, ID3NOU, ID3ERR ) |
||
|
CHARACTER*(*) |
ID3NIN, ID3NOU, ID3ERR |
|
|
INTEGER |
CD3ATT, CD3RFA(ID3NIN) |
|
Description
This routine reads a reference number array attribute of the current element, for example, connection reference array. The attribute may be a UDA. The reference numbers returned by the routine will include the '=' and '/' characters. The maximum size of array required is specified by ID3NIN. The array must be dimensioned at least this big. The number of values returned is output in ID3NOU. Any excess elements of ID3NIN over ID3NOU are returned as blank.
The routine will return a single value for a single reference attribute.
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no values set (see Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below. Except for error code 5, ID3NOU is returned as zero and ID3NIN elements of array CD3RFA are returned as blank.
Arguments
|
CD3ATT |
The name of the attribute required. This must be a Marine attribute name, for example, 'CRF/A' or a UDA name. Input characters will be converted to upper case. In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine (for example, 'CRF' is accepted). A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
ID3NIN |
Maximum number of array elements required. Array CD3RFA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed. |
|
CD3RFA |
The array of reference numbers. The reference numbers will include the '=' and '/' characters. It is the programmer's responsibility to ensure that the elements of CD3RFA are declared large enough. Truncated strings are not returned. Error code 5 will indicate that one or more elements of the declared string is too short. Those elements are returned as blanks and the remainder are returned normally. Otherwise, if an error occurs, all array elements are returned as blank. |
|
ID3NOU |
The number of values returned in CD3RFA. If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails with an error code other than 5. If the number of values is genuinely zero (for example, an unset UDA array), ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
5 |
Character output string parameter too short |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
|
308 |
Attribute unset |
D3RTEX - Read a Text Attribute
Specification
|
SUBROUTINE D3RTEX( CD3ATT, CD3TEX, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT, CD3TEX |
|
|
INTEGER |
ID3ERR |
|
Description
This routine reads a system-defined text attribute of the current element or a user-defined text or word attribute.
The routine will return the error 'Attribute unset' for a dynamic text attribute that has no text set (see Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below and CD3TEX is returned as blank.
In some circumstances, the routine will return a valid (but meaningless) text string for an integer array attribute. This results from the way that text attributes are stored on the databases. Error 302 will only be returned for an integer array attribute in circumstances where the array does not convert into a valid text string.
Arguments
|
CD3ATT |
The name of the attribute required. This must be a Marine attribute name, for example, 'STEX/T', 'DUT/Y', 'PTSP/ECIFICATION' or a UDA name. Input characters will be converted to upper case. In the case of Marine attribute name, abbreviations accepted in Marine will be accepted by this routine (for example, 'STEX', 'DUT' are accepted). A UDA name must include the leading ':' character and may be a word or a text UDA. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. |
|
CD3TEX |
The value of the text attribute. It is the programmer's responsibility to ensure that CD3TEX is declared large enough. The maximum length of a text string is 120 characters. Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. Error code 308 will indicate a null (unset) string. Marine treats blank strings ' ' and null strings '' differently. A null string signifies 'unset'; a blank string signifies a deliberate setting to 'blank'. If an error occurs or if no text is defined for the attribute, CD3TEX is returned as blank. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
5 |
Character output string parameter too short |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
|
308 |
Attribute unset |
D3RTYP - Read a Type Attribute
Specification
|
SUBROUTINE D3RTYP( CD3TYP, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3TYP |
|
|
INTEGER |
ID3ERR |
|
Description
This routine reads the Marine 'type' attribute of the current element. If an error occurs then an error code is returned as specified below and CD3TYP is returned as blank.
This routine gives the same result as calling D3RWOR with 'TYPE' as the attribute name.
Arguments
|
CD3TYP |
The 'type' of the current element. It is the programmer's responsibility to ensure that CD3TYP is declared large enough (usually CHARACTER*6). Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs, CD3TYP is returned as blank. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
5 |
Character output string parameter too short |
D3RUDA - Read Lists of UDA Names, Abbreviations and Types
Specification
|
SUBROUTINE D3RUDA( CD3TYP, ID3MAX, CD3NMS, ID3ABV, CD3ATP, ID3NUM, ID3ERR ) |
||
|
CHARACTER*(*) |
ID3MAX, ID3ABV(ID3MAX), ID3NUM, ID3ERR |
|
|
INTEGER |
CD3TYP, CD3NMS(ID3MAX), CD3ATP(ID3MAX) |
|
Description
This routine reads, for a specified element type, parallel lists of UDA names, lengths of minimum valid abbreviations and attribute types. If an error occurs all lists will be set to blanks, the number of attributes returned (ID3NUM) will be set to zero, and a value indicating the type of error will be returned in ID3ERR. If no UDAs exist for the given element type or if the element type is invalid, the number of attributes returned will be zero. ID3MAX specifies the number of attributes expected to be returned in the list and must be set by the call to the routine. If the actual number of UDAs associated with the given element type exceeds this value the list will be truncated.
Arguments
|
CD3TYP |
The type of element for which the UDAs are to be read. This must be a Marine noun for example, 'ELB/OW', 'BOX', 'EQU/IPMENT'. Input characters will be converted to upper case. Abbreviations accepted in Marine will be accepted by this routine (for example, 'ELB', 'EQU' are accepted). |
|
ID3MAX |
The maximum number of UDA definitions expected for the specified element type. This must be equal to the size of the arrays declared for CD3NMS, ID3ABV and CD3ATP. |
|
CD3NMS |
Array containing a list of UDA names valid for the specified element type. This array variable should be declared to at least CHARACTER*13. If declared less than this, some or all of the returned array positions may contain truncated names. No warning will be given if truncation occurs. The names include the leading ':' character. |
|
ID3ABV |
Array containing a list of the lengths of minimum valid abbreviations. The lengths exclude the leading ':' character. |
|
CD3ATP |
Array containing a list of the UDA types. Possible UDA types are: |
|
REAL |
: Real |
|
INT |
: Integer |
|
REF |
: Reference |
|
TEXT |
: Text |
|
WORD |
: Word |
|
LOG |
: Logical |
|
This array variable should be declared to at least CHARACTER*4. If declared less than this, the returned words will be truncated. No warning will be given if truncation occurs. Truncation is only significant in distinguishing between 'REF' and 'REAL', so CHARACTER*3 would be acceptable. |
|
|
ID3NUM |
The actual number of attributes returned. When an element type has no UDAs defined or if the element type is invalid, the value returned will be zero. In neither case will an error condition arise. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
D3RUNI - Read Unit of Measurement for a Real or Integer UDA
Specification
|
SUBROUTINE D3RUNI( CD3ATT, CD3UNT, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3ATT, CD3UNT |
|
|
INTEGER |
ID3ERR |
|
Description
This routine returns a text string indicating the UNIT (of measurement) which applies to the specified UDA. Only real or integer attributes may have a UNIT specified. This routine will generally be used in conjunction with the attribute retrieval routines (D3RINT, D3RIA, D3RREA and D3RRA). Thus, for example, an attribute value of 1000.0 and units of 'mm' may be interpreted as 1000.0mm.
Arguments
|
CD3ATT |
The name of the attribute for which UNIT is to be found. The attribute string will be checked for a leading colon. If one does not exist the routine will insert one. Valid abbreviations will be accepted. For example, valid attribute strings for a UDA called :CONTROLLER would include: |
|
:CONTROLLER :CONT CONT assuming a minimum abbreviation of four or less. |
|
|
CD3UNT |
The UNIT text string. These will always be the database units of the physical quantity stored in the UDA, because DARS gets these values directly from the database. If the units have been defined as BORE or DISTANCE, CD3UNT will return the default distance units of 'mm'. For other quantities (for example, MASS, PRESSURE, ANGLE) they will need the appropriate units (see D3RDBU routine for further information of how these are determined. |
|
For generic types of UDA which have no standard units they will be derived from other database units of the component dimensions. If no units have been defined, CD3UNT will return a blank string with no error condition. If the UNIT text is too long to fit the supplied string, a blank string will be returned along with error code 5. |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
5 |
Character output string parameter too short |
|
307 |
UDA not found |
D3RWA - Read a Word Array Attribute
Specification
|
SUBROUTINE D3RWA( CD3ATT, ID3NIN, CD3WA, ID3NOU, ID3ERR ) |
||
|
CHARACTER*(*) |
ID3NIN, ID3NOU, ID3ERR |
|
|
INTEGER |
CD3ATT, CD3WA(ID3NIN) |
|
Description
This routine reads a word array attribute of the current element (for example, CTYP). The maximum size of array required is specified by ID3NIN. The array must be dimensioned at least this big. The number of values returned is output in ID3NOU. Any excess elements of ID3NIN over ID3NOU are returned as blank.
The routine will return a single value for a single word attribute.
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no values set (see Section Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below. Except for error code 5, ID3NOU is returned as zero and ID3NIN elements of array CD3WA are returned as blank.
In some cases, word attributes are stored within a real array (for example, the PARA attribute). In this situation, the word attributes can be extracted by using successive calls to D3RRA and D3UDEH, as illustrated by the following extract from Example 1 (see Example 1).
|
INTEGER |
ID3NOU, ID3ERR, I |
|
|
REAL |
PARA( 100 |
|
|
CHARACTER*6 |
PARWOR( 100 ) |
|
|
INTRINSIC |
INT |
|
CALL D3RRA( ‘PARA’, 100, PARA, ID3NOU, ID3ERR ) |
|||||
|
IF ( ID3ERR .NE. 0 ) THEN |
|||||
|
DO 100 I = 1, ID3NOU |
|||||
|
PARWOR( I ) = ‘ ’ |
|||||
|
IF ( PARA( I ) .GT. 531442.0 ) THEN |
|||||
|
CALL D3UDEH( INT( PARA( I ) ), PARWOR(I ) ) |
|||||
|
ENDIF |
|||||
|
100 |
CONTINUE |
||||
|
ENDIF |
|||||
Alternatively, the word parameters can be extracted using D3RWA with ‘WPAR’ as the attribute name, but this will extract any non-word Real numbers as blanks (see Example 1).
Arguments
|
CD3ATT |
The name of the attribute required. This must be a Marine attribute name, for example, 'CTYP/E'. Input characters will be converted to upper case. Abbreviations accepted in Marine will be accepted by this routine (for example, ‘CTYP’ will be accepted). |
|
ID3NIN |
Maximum number of array elements required. Array CD3WA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed. |
|
CD3WA |
The array of words. It is the programmer's responsibility to ensure that the elements of CD3WA are declared large enough (usually CHARACTER*6). Truncated strings are not returned. Error code 5 will indicate that one or more elements of the declared string is too short. Those elements are returned as blanks and the remainder are returned normally. Otherwise, if an error occurs, all array elements are returned as blank. If any integer value does not translate into a word, that element of CD3WA is returned as blank. |
|
ID3NOU |
The number of values returned in CD3WA. If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails with an error code other than 5. If the number of values is genuinely zero, ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
5 |
Character output string parameter too short |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
|
308 |
Attribute unset |
D3RWOR - Read a Word Attribute
Specification
|
SUBROUTINE D3RWOR( CD3ATT, CD3WOR, ID3ERR) |
||
|
CHARACTER*(*) |
CD3ATT, CD3WOR |
|
|
INTEGER |
ID3ERR |
|
Description
This routine reads a Marine 'word' attribute of the current element (for example, connection type). UDAs of type WORD must be accessed by using routine D3RTEX.
If an error occurs then an error code is returned as specified below and CD3WOR is returned as blank.
Arguments
|
CD3ATT |
The name of the attribute required. This must be a Marine attribute name, for example, 'HCO/NN', 'BUNI/TS', 'FLOW/DIRECTION'. Input characters will be converted to upper case. Abbreviations accepted in Marine will be accepted by this routine (for example, 'HCO', 'FLOW' are accepted). |
|
CD3WOR |
The value of the word attribute. It is the programmer's responsibility to ensure that CD3WOR is declared large enough (usually CHARACTER*6). Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs or if the integer value does not translate into a word, CD3WOR is returned as blank. |
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
5 |
Character output string parameter too short |
|
301 |
Attribute not found |
|
302 |
Attribute of wrong type |
D3UCLU - Clear File Unit
Specification
|
LOGICAL FUNCTION D3UCLU( ID3UNI ) |
||
|
INTEGER |
ID3UNI |
|
Description
This routine accepts the return of a FORTRAN file unit number no longer needed by the DARs application program. This routine should only be used for returning a unit previously issued by the complementary routine D3UGTU.
The function's result is FALSE if the unit is invalid or was not issued by D3UGTU.
Arguments
|
ID3UNI |
FORTRAN file unit number. |
Function Value
|
D3UCLU |
.TRUE. if file unit number accepted. |
|
.FALSE. if unit invalid. |
D3UCTI - Character to Integer
Specification
|
LOGICAL FUNCTION D3UCTI( CD3STR, ID3INT, CD3BEF, CD3AFT, CD3ERR ) |
||
|
CHARACTER*(*) |
CD3STR, CD3BEF, CD3AFT, CD3ERR |
|
|
INTEGER |
ID3INT |
|
Description
This routine converts the digits in a given string to an integer value. The character string may start with any number of spaces, optionally followed by + or -, and is terminated by the end of the string. Trailing blanks are ignored.
The function's result is FALSE if a valid integer is not found or if a valid integer is found along with further characters.
If the function is FALSE, an error code is returned to identify the cause of the failure. If the failure is due to the presence of additional characters before and/or after an integer, these character strings are returned as well as the integer.
It is the programmer's responsibility to declare the character arguments large enough to hold the returned data. These character strings will be truncated if necessary.
Arguments
|
CD3STR |
Character string to be analyzed for presence of an integer. There is no limit to the length of the string. |
|
ID3INT |
Extracted integer, if found. |
|
CD3BEF |
String preceding extracted integer. Any leading blanks in CD3STR are included in this string. If the supplied string is shorter than the found string, the string will be truncated. No error condition will arise as a result. If the programmer wishes to make use of this functionality, it is recommended that this variable is declared the same size as CD3STR. |
|
CD3AFT |
String following extracted integer. If the supplied string is shorter than the found string, the string will be truncated. No error condition will arise as a result. If the programmer wishes to make use of this functionality, it is recommended that this variable is declared the same size as CD3STR. |
|
CD3ERR |
Error code, if function returned .FALSE. |
|
The following 3-character error codes may be returned: |
|
|
NAN |
Not a number |
|
OOR |
Out of range |
|
BLA |
Blank string |
|
ADD |
Additional data |
|
The 'out of range' error indicates that an integer has been identified, but that its value is outside the range of a FORTRAN INTEGER variable. The valid range is system dependent (typically -2147483648 to +2147483647). |
|
|
If the supplied string is shorter than 3, the returned code will be truncated. A declaration of CHARACTER*1 is acceptable whether the programmer wishes to ignore the error or distinguish between them. A declaration of CHARACTER*3 or more will return the full string. |
|
|
In the case of 'NAN', 'OOR' or 'BLA', no integer will be returned in ID3INT and blank strings will be returned in CD3BEF and CD3AFT. |
|
|
In the case of 'ADD', a valid integer has been found and is returned in ID3INT, but the string contained characters before and/or after the valid integer. These additional characters are returned in CD3BEF and CD3AFT. |
|
Function Value
|
D3UCTI |
|
|
.TRUE. |
if integer found without additional data. |
|
.FALSE. |
if no integer. |
|
.FALSE. |
if integer found with additional data. |
D3UCTR - Character to Real Number
Specification
|
LOGICAL FUNCTION D3UCTR( CD3STR, RD3VAL, CD3BEF, CD3AFT, CD3ERR ) |
||
|
CHARACTER*(*) |
CD3STR, CD3BEF, CD3AFT, CD3ERR |
|
|
REAL |
RD3VAL |
|
Description
This routine converts the digits in a given string to a real number. The character string may start with any number of spaces, optionally followed by + or -, and is terminated by the end of the string. Trailing blanks are ignored.
The function's result is FALSE if a valid real number is not found or if a valid number is found along with further characters.
The string must be of the following form:
(spaces)(+/-)nn(.((nn))(E(+/space/-)nn)
or
(spaces)(+/-).nn(E(+/space/-)nn)
for example,
' 1.2 ', '6E3', '6E 3', ' 6.5E-03', '-.005E7'
If the function is FALSE, an error code is returned to identify the cause of the failure. If the failure is due to the presence of additional characters before and/or after a real number, these character strings are returned as well as the real value.
It is the programmer's responsibility to declare the character arguments large enough to hold the returned data. These character strings will be truncated if necessary.
Arguments
|
CD3STR |
Character string to be analyzed for presence of a real number. There is no limit to the length of the string. |
|
RD3VAL |
Extracted value, if found. |
|
CD3BEF |
String preceding extracted real number. Any leading blanks in CD3STR are included in this string. If the supplied string is shorter than the found string, the string will be truncated. No error condition will arise as a result. If the programmer wishes to make use of this functionality, it is recommended that this variable is declared the same size as CD3STR. |
|
CD3AFT |
String following extracted real number. If the supplied string is shorter than the found string, the string will be truncated. No error condition will arise as a result. If the programmer wishes to make use of this functionality, it is recommended that this variable is declared the same size as CD3STR. |
|
CD3ERR |
Error code, if function returned .FALSE. |
|
The following 3-character error codes may be returned: |
|
|
NAN |
Not a number |
|
OOR |
Out of range |
|
BLA |
Blank string |
|
ADD |
Additional data |
|
The 'out of range' error indicates that a real number has been identified, but that its value is outside the range of a FORTRAN double precision REAL variable. The valid range is system dependent (typically about -1E308 to +1E308). A real number whose value is too close to zero to be represented by a REAL variable (typically between -1E-308 and +1E-308) will be returned as zero and will not return the 'out of range' error. |
|
|
If the supplied string is shorter than 3, the returned code will be truncated. A declaration of CHARACTER*1 is acceptable whether the programmer wishes to ignore the error or distinguish between them. A declaration of CHARACTER*3 or more will return the full string. |
|
|
In the case of 'NAN', 'OOR' or 'BLA', no value will be returned in RD3VAL and blank strings will be returned in CD3BEF and CD3AFT. |
|
|
In the case of 'ADD', a valid real number has been found and is returned in RD3VAL, but the string contained characters before and/or after the valid number. These additional characters are returned in CD3BEF and CD3AFT. |
|
Function Value
|
D3UCTR |
|
|
.TRUE. |
if real number found without additional data. |
|
.FALSE. |
if no real number. |
|
.FALSE. |
if real number found with additional data. |
D3UDEH - Dehash a Hashed Marine Word
Specification
|
SUBROUTINE D3UDEH( ID3INT, CD3WOR ) |
||
|
CHARACTER*(*) |
CD3WOR |
|
|
INTEGER |
ID3INT |
|
Description
This routine converts a hashed Marine word (a Marine word represented as an integer number) into the Marine word.
It will normally be use to dehash a hashed word returned by a data access routine (for example, some elements of an integer array attribute may be hashed words).
A hashed Marine word is an integer number in the range 531442 (‘A’) to 387951929 (‘ZZZZZZ’). This routine does not check that the decoded word is meaningful. If the decoded word is illegal, a blank word is returned.
Arguments
|
ID3INT |
Hashed integer number. This must be an integer number (for example, 534552), derived from 'hashing' of a Marine word by Marine . In the context of Marine DARs, it will be an integer number returned by a data access routine (for example, some elements of an integer array attribute may be hashed words). |
|
CD3WOR |
The word resulting from dehashing the integer number, for example, 534552 will return 'FGD' It is the programmer's responsibility to ensure that CD3WOR is declared large enough (usually CHARACTER*6, or less if word has trailing blanks). If the declared string is too short, CD3WOR is returned as blank. A zero or negative integer number results in the string 'NUL'. Otherwise, if the integer number is outside the valid range or the decoded word is illegal, CD3WOR is returned as blank. |
Errors/Warnings
As noted above, the routine will return a blank string if the integer number cannot be decoded or if the character string is too short for the returned word.
Failure of this routine does not set the internal error flag.
D3UDTM - Read Current System Date and Time
Specification
|
SUBROUTINE D3UDTM( ID3DAT, CD3DAT ) |
||
|
CHARACTER*(*) |
CD3DAT |
|
|
INTEGER |
ID3DAT(6) |
|
Description
This routine returns the current system date and time. For user convenience, the date/time is returned in two arguments: an integer array and a character string.
Arguments
|
ID3DAT |
Current system date / time as an integer array. |
|
The date/time is represented as six integers: |
|
|
ID3DAT(1): |
Year (As a 4-digit number) |
|
ID3DAT(2): |
Month (1 = January, 12 = December) |
|
ID3DAT(3): |
Day (1 to 31) |
|
ID3DAT(4): |
Hour (0 to 23) |
|
ID3DAT(5): |
Minute (0 to 59) |
|
ID3DAT(6): |
Second (0 to 59) |
|
The ID3DAT array must be dimensioned to a minimum of six. The array will be returned as zeroes if an error condition occurs. |
|
|
CD3DAT |
Current system date/time as a character string.
|
|
CD3DAT should be declared at least CHARACTER*20 for the complete date/time to be returned. The date/time will be truncated to fit the declared length of CD3DAT, but only as follows: |
|
|
1-10: |
returns blank string |
|
11-16: |
returns dd Mon yy |
|
17-19: |
returns dd Mon yy hh:mm |
Errors/Warnings
No errors or warnings can result from the use of this routine. If the array ID3DAT is not dimensioned to at least six, a program crash is possible.
D3UGTU - Get File Unit
Specification
|
SUBROUTINE LOGICAL FUNCTION D3UGTU( ID3UNI ) |
||
|
INTEGER |
ID3UNI |
|
Description
This routine supplies a valid available FORTRAN file unit number for use by the DARs application program. This provides a mechanism for avoiding units that are already in use by the DARS package, provided that the application calls this routine for ALL the file units it needs.
This routine must be called immediately before the associated file opening statement.
|
that means, |
IF |
(D3UGTU(IUNIT)) THEN |
|
|
OPEN(IUNIT ... |
|||
|
NOT |
DO 100 I=1,20 |
||
|
OK = |
D3UGTU(IUNIT(I)) |
||
|
100 |
CONTINUE |
||
|
OPEN (IUNIT(1).... |
|||
The function's result is FALSE if no further units are available. The application should use the complementary routine D3UCLU to return units no longer needed and to allow them to be re-allocated by this routine.
Arguments
|
ID3UNI |
FORTRAN file unit number. |
Function Value
|
D3UGTU |
|
|
.TRUE. |
if file unit number returned. |
|
.FALSE. |
if no unit available. |
D3UINI - Query initialization
Specification
SUBROUTINE D3UINI( LD3INI )
Description
This routine returns a true or false flag, depending on whether or not a Marine project is currently initialized.
It will return TRUE if D3INIT have been successfully called and D3FIN has not been subsequently called.
The routine can be called at any time; it does not set or unset the internal error flag, neither does it test whether the flag is currently set.
This routine does not provide any further information if DARs monitoring is ON.
Arguments
|
LD3INI |
|
|
.TRUE. |
if a project is not currently initialized |
|
.FALSE. |
if no unit available. |
D3ULDS - Test Latest MDB Date-Stamp
Specification
|
LOGICAL FUNCTION D3ULDS( CD3DAT, ID3ERR ) |
||
|
CHARACTER*(*) |
CD3DAT |
|
|
INTEGER |
ID3ERR |
|
Description
This routine checks whether any database in the current MDB has been date-stamped later than a specified date/time. It returns a TRUE function value if any database has a later date-stamp.
Refer to routine D3RDAT for an explanation of the date-stamp feature.
Arguments
|
CD3DAT |
Specified date/time to check date-stamp against. The date/time format is of the form 'dd Mon yyyy hh:mm:ss', as described for the CD3DAT argument of routine D3RDAT. Alternative formats are accepted as follows: The month can be upper, lower or mixed case and can be any abbreviation of the month, minimum length 3 (for example, JAN/UARY) Any delimiter or space can be used between the fields. Within the date, the delimiter/space can be omitted. (for example, '13/SEP/1997 12 13 14' or '13SEP2001,12.13:14'). Integers less than 10 may be entered as a single digit (for example, '9 Sep 1997 9.08.8'). |
|
If the time is omitted, it defaults to 23:59:59. Otherwise mm and ss default to zero. '13sept1997 12' is '13 Sep 1997 12:00:00' '13sept1997 12:15' is '13 Sep 1997 12:15:00' '13sept1997' is '13 Sep 1997 23:59:59' |
|
|
ID3ERR |
Error code. |
|
Possible values are: |
|
|
0 |
Success |
|
2 |
Internal error code set on entry |
|
3 |
Routine D3INIT has not been called |
|
4 |
Routine D3MMDB has not been called |
|
12 |
Invalid date/time |
|
13 |
Entered date/time later than current |
Function Value
|
D3ULDS |
|
|
.TRUE. |
if any db date-stamp later than CD3DAT |
|
.FALSE. |
if no db date-stamp later than CD3DAT, or error. In circumstances where error code 306 would be returned by D3RDAT, this routine returns FALSE and does not return an error. |
D3ULEN - Length of Character String
Specification
|
INTEGER FUNCTION D3ULEN( CD3STR ) |
||
|
CHARACTER*(*) |
CD3STR |
|
Description
This routine returns the significant length of a character string. That is, the length after stripping off all trailing blanks. Some compilers provide an intrinsic function for this purpose. This routine may be used whether or not an intrinsic function is available.
The function returns zero for a blank string. It returns the declared length for an undefined string.
Intrinsic function LEN should be used to obtain the declared length of a string.
Arguments
|
CD3STR |
String for which significant length is required. There is no limit to the length of the string. |
Function Value
|
D3ULEN |
Significant length of string. Zero for blank string ' '. Equivalent to LEN(CD3STR) for undefined string. |
D3UMON - Change Monitor Level
Specification
|
SUBROUTINE D3UMON( CD3MON ) |
||
|
CHARACTER*(*) |
CD3MON |
|
Description
This routine sets or resets the monitoring level. It re-defines the level set in the last call to the routine or set in D3INIT.
Three levels of monitoring are available: FULL, SOME and NONE. 'SOME' monitoring will cause the names of databases opened by D3MMDB to be output. 'FULL' monitoring will in addition cause the details of all the data access routines which are called, and their input and output arguments to be output to the default output device, together with all warning/error conditions encountered.
Arguments
|
CD3MON |
Required monitor level (up to 4 characters). |
|
Input characters will be converted to upper case. Strings exceeding four characters will be truncated. Any string other than 'SOME' or 'FULL' (after truncation) will be interpreted as 'NONE'. |
|
|
NONE |
no monitoring. If required, D3EMSG can be called selectively to output messages. |
|
SOME |
display names and types of databases opened by D3MMDB. |
|
FULL |
as SOME plus display routine name and values of input and output arguments for all routines called and display all non-zero error messages. |
Errors/Warnings
No errors or warnings can result from the use of this routine.