intro_conversion(3F)
INTRO_CONVERSION - Introduction to conversion routines
As shipped in IRIX 6.5.5. Last changed in IRIX 6.5.5.
NAME INTRO_CONVERSION - Introduction to conversion routines IMPLEMENTATION See individual man pages for implementation details. DESCRIPTION These Fortran-callable subroutines perform conversion of data residing in Cray Research systems memory. Conversion subprograms are listed under the following types of routines: * Foreign data conversion * Numeric conversion * ASCII conversion * IEEE conversion * Other conversion For more information regarding foreign data conversion, see the Application Programmer's I/O Guide. The USCCTC and USCCTI routines are available on IRIX systems. Both routines are documented on the USCCTC man page. In addition, the CRY2MIPS and MIPS2CRY routines are available on IRIX systems. Both routines are documented on the CRY2MIPS man page. FOREIGN DATA CONVERSION ROUTINES The foreign data conversion routines translate data in both directions between Cray Research internal representations and that of other vendors, including IBM, CDC, ETA, IEEE, and DEC (VAX systems). The following tables list these conversion routines by the data type on which they operate. Cray Research recommends the newer routines: IBM2CRAY, CDC2CRAY, VAX2CRAY, NVE2CRAY, IEG2CRAY, ETA2CRAY, CRAY2IBM, CRAY2CDC, CRAY2VAX, CRAY2NVE, CRAY2IEG, and CRAY2ETA. Generally, routines that are inverses of each other (that is, converted from Cray Research data types to IBM and IBM to Cray Research) are listed under a single entry. Routine descriptions follow later in this section, listed alphabetically by entry name. These routines are used for data conversion: Conversion routines on Cray PVP systems -------------------------------------------------------------------- Name Foreign->Native Native->Foreign -------------------------------------------------------------------- IBM IBM2CRAY CRAY2IBM VAX/VMS VAX2CRAY CRAY2VAX CDC (NOS) CDC2CRAY CRAY2CDC CDC (NOS/VE) NVE2CRAY CRAY2NVE CDC CYBER 205 ETA2CRAY CRAY2ETA Generic IEEE (32-bit) IEG2CRAY CRAY2IEG IEEE little-endian IEU2CRAY CRAY2IEU Cray IEEE (64-bit) CRI2CRAY CRAY2CRI SGI MIPS MIPS2CRY CRY2MIPS User conversion USR2CRAY CRAY2USR Site conversion STE2CRAY CRAY2STE -------------------------------------------------------------------- Conversion routines for Cray MPP systems: -------------------------------------------------------------------- Name Foreign->Native Native->Foreign -------------------------------------------------------------------- Cray PVP systems (non- CRAY2CRI and CRY2CRI CRI2CRAY and CRI2CRY IEEE) IBM IBM2CRI CRI2IBM Generic IEEE (32-bit) IEG2CRI CRI2IEG User conversion USR2CRAY CRAY2USR Site conversion STE2CRAY CRAY2STE -------------------------------------------------------------------- Conversion routines on CRAY T90 (non-IEEE) -------------------------------------------------------------------- Name Foreign->Native Native->Foreign -------------------------------------------------------------------- Cray PVP systems (non- CRY2CRI CRI2CRY IEEE) IBM IBM2CRI CRI2IBM Generic IEEE (32-bit) IEG2CRI CRI2IEG User conversion USR2CRAY CRAY2USR Site conversion STE2CRAY CRAY2STE -------------------------------------------------------------------- Conversion routines on IRIX systems (MIPS) -------------------------------------------------------------------- Name Foreign->Native Native->Foreign -------------------------------------------------------------------- Cray PVP systems (non- CRY2MIPS MIPS2CRY IEEE) User conversion USR2CRAY CRAY2USR Site conversion STE2CRAY CRAY2STE -------------------------------------------------------------------- Superseded routines: Foreign to Cray Research The following table lists superseded, older routines that are supported to maintain continuity. Cray Research recommends using the newer routines named in the preceding list. -------------------------------------------------------------- Conversion IBM CDC VAX/VMS -------------------------------------------------------------- Foreign single precision to Cray USSCTC FP6064 VXSCTC single precision Foreign double precision to Cray USDCTC --- VXDCTC single precision VXGCTC Foreign double precision to Cray --- --- VXBCTC double precision Foreign integer to Cray integer USICTC INT6064 VXICTC Foreign logical to Cray logical USLCTC --- VXLCTC Foreign character to ASCII USCCTC DSASC --- VAX 64-bit complex to Cray single --- --- VXZCTC precision IBM packed-decimal field to Cray USPCTC --- --- integer -------------------------------------------------------------- Superseded routines: Cray Research to Foreign The following routines convert Cray Research types to foreign types. The man pages for these routines appear under the name of the inverse of each routine (for example, CRAY2IBM is described under entry IBM2CRAY). Routine Type CRAY2IBM IBM CRAY2CDC CDC CRAY2VAX VAX/VMS CRAY2NVE NOS/VE CRAY2ETA ETA/CYBER 205 CRAY2IEG IEEE (32-bit) CRAY2IEU DEC CRAY2CRI IEEE (UNICOS/mk) The following table lists older routines that convert Cray Research types to foreign types. These routines are supported to maintain continuity. Cray Research recommends using the newer routines named in the preceding list rather than these routines. -------------------------------------------------------------- Conversion IBM CDC VAX/VMS -------------------------------------------------------------- Cray single precision to foreign USSCTI FP6460 VXSCTI single precision Cray single precision to foreign USDCTI --- VXDCTI, double precision VXGCTI Cray double precision to foreign --- --- VXBCTI double precision Cray integer to foreign integer USICTI INT6460 VXICTI Cray logical to foreign logical USLCTI --- VXLCTI ASCII character to foreign USCCTI ASCDC --- character Cray complex to foreign complex --- --- VXZCTI Cray integer to foreign packed- USICTP --- --- decimal field -------------------------------------------------------------- NUMERIC CONVERSION ROUTINE CHCONV converts decimal ASCII numerals to an integer format. It is an internal library routine. ASCII CONVERSION FUNCTIONS The ASCII conversion functions convert binary integers to or from 1-word ASCII strings (not Fortran character variables). Note: The ASCII conversion functions are not intrinsic to Fortran. Their default type is real, even though their results are generally used as integers. The ASCII conversion routines use one type integer argument. The DTB and OTB routines can also use a second optional argument as an error code. The resulting error codes (0 if no error; -1 if there are errors) are returned in the second argument for Fortran calls. If no error code argument is included in Fortran calls, the routine aborts if an error is encountered. The following calls show how the ASCII conversion routines are used. These Fortran calls convert a binary number to decimal ASCII, then convert back from ASCII to binary. They use internal I/O routines. result=BTD(integer) result Decimal ASCII result (right-justified, blank-filled) integer Integer argument result=DTB(arg,errcode) result Integer value arg Decimal ASCII (left-justified, zero-filled) errcode 0 if conversion successful; -1 if error The following table lists the ASCII conversion functions. ------------------------------------------------------------- Purpose Name Argument range Result ------------------------------------------------------------- Binary to decimal BTD 0 <= x <= One-word ASCII ASCII (right- 99999999 string (right- justified, blank- justified, filled) blank-filled) Binary to decimal BTDL 0 <= x <= One-word ASCII ASCII (left- 99999999 string (left- justified, zero- justified, filled) zero-filled) Binary to decimal BTDR 0 <= x <= One-word ASCII ASCII (right- 99999999 string (right- justified, zero- justified, filled) zero-filled) Binary to octal BTO 0 <= x <= ASCII (right- 77777777 One-word ASCII justified, blank- 8 string (right- filled) justified, blank-filled) Binary to octal BTOL 0 <= x <= ASCII (left- 77777777 One-word ASCII justified, zero- 8 string (left- filled) justified, zero-filled) Binary to octal BTOR 0 <= x <= ASCII (right- 77777777 One-word ASCII justified, zero- 8 string (right- filled) justified, zero-filled) Decimal ASCII to DTB Decimal ASCII One word binary (left- containing justified, decimal zero-filled) equivalent of ASCII string Octal ASCII to OTB Octal ASCII One word binary (left- containing octal justified, equivalent of zero-filled) ASCII string ------------------------------------------------------------- The Cray Assembly Language (CAL) entry points are the same as the Fortran entry points for the preceding routines with the percent sign (%) appended. For example, BTDL is called as BTDL% from CAL. IEEE CONVERSION ROUTINES The IEEE conversion routines convert Cray single-precision real numbers to or from IEEE single- or double-precision real numbers. The following list contains the purpose and name of the IEEE conversion routines. See the individual man pages for implementation details. * IEG2CRAY: Converts IEEE/Generic 32-bit data to Cray data * CRAY2IEG: Converts Cray data to IEEE/Generic 32-bit data * IEU2CRAY: Converts DEC ULTRIX/Generic Little Endian 32-bit data to Cray data * CRAY2IEU: Converts Cray data to DEC ULTRIX Generic Little Endian 32-bit data * CRI2CRY: Converts Fortran data from UNICOS/mk to UNICOS type * CRY2CRI: Converts Fortran data from UNICOS to UNICOS/mk type * CRI2CRAY: Converts IEEE/MPP 32-bit data to Cray Research PVP 64-bit data * CRAY2CRI: Converts Cray Research PVP 64-bit data to IEEE/MPP 32-bit data OTHER CONVERSION ROUTINES These routines place the octal ASCII representation of a Cray word into a character area, convert trailing blanks to nulls or trailing nulls to blanks, and translate a string from one code to another, using a translation table. The following list contains the purpose and name of these conversion routines. * B2OCT: Places an octal ASCII representation of a Cray word into a character area * CHCONV: Converts decimal ASCII to integers * RBN: Converts trailing blanks to nulls * RNB: Converts trailing nulls to blanks SEE ALSO Application Programmer's Library Reference Manual for the printed version of this man page.