home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / intro_conversion.z / intro_conversion
Encoding:
Text File  |  2002-10-03  |  16.1 KB  |  295 lines

  1. INTRO_CONVERSION(3F)                                  Last changed: 1-22-99
  2.  
  3.  
  4. NNAAMMEE
  5.      IINNTTRROO__CCOONNVVEERRSSIIOONN - Introduction to conversion routines
  6.  
  7. IIMMPPLLEEMMEENNTTAATTIIOONN
  8.      See individual man pages for implementation details.
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.      These Fortran-callable subroutines perform conversion of data residing
  12.      in Cray Research systems memory.  Conversion subprograms are listed
  13.      under the following types of routines:
  14.  
  15.      * Foreign data conversion
  16.  
  17.      * Numeric conversion
  18.  
  19.      * ASCII conversion
  20.  
  21.      * IEEE conversion
  22.  
  23.      * Other conversion
  24.  
  25.      For more information regarding foreign data conversion, see the
  26.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _I/_O _G_u_i_d_e.
  27.  
  28.      The UUSSCCCCTTCC and UUSSCCCCTTII routines are available on IRIX systems.  Both
  29.      routines are documented on the UUSSCCCCTTCC man page. In addition, the
  30.      CCRRYY22MMIIPPSS and MMIIPPSS22CCRRYY routines are available on IRIX systems.  Both
  31.      routines are documented on the CCRRYY22MMIIPPSS man page.
  32.  
  33. FFOORREEIIGGNN DDAATTAA CCOONNVVEERRSSIIOONN RROOUUTTIINNEESS
  34.      The foreign data conversion routines translate data in both directions
  35.      between Cray Research internal representations and that of other
  36.      vendors, including IBM, CDC, ETA, IEEE, and DEC (VAX systems).  The
  37.      following tables list these conversion routines by the data type on
  38.      which they operate.  Cray Research recommends the newer routines:
  39.      IIBBMM22CCRRAAYY, CCDDCC22CCRRAAYY, VVAAXX22CCRRAAYY, NNVVEE22CCRRAAYY, IIEEGG22CCRRAAYY, EETTAA22CCRRAAYY, CCRRAAYY22IIBBMM,
  40.      CCRRAAYY22CCDDCC, CCRRAAYY22VVAAXX, CCRRAAYY22NNVVEE, CCRRAAYY22IIEEGG, and CCRRAAYY22EETTAA.  Generally,
  41.      routines that are inverses of each other (that is, converted from Cray
  42.      Research data types to IBM and IBM to Cray Research) are listed under
  43.      a single entry.  Routine descriptions follow later in this section,
  44.      listed alphabetically by entry name.
  45.  
  46.      These routines are used for data conversion:
  47.  
  48.    CCoonnvveerrssiioonn rroouuttiinneess oonn CCrraayy PPVVPP ssyysstteemmss
  49.      --------------------------------------------------------------------
  50.      Name                     Foreign->Native       Native->Foreign
  51.      --------------------------------------------------------------------
  52.      IBM                      IIBBMM22CCRRAAYY               CCRRAAYY22IIBBMM
  53.      VAX/VMS                  VVAAXX22CCRRAAYY               CCRRAAYY22VVAAXX
  54.      CDC (NOS)                CCDDCC22CCRRAAYY               CCRRAAYY22CCDDCC
  55.      CDC (NOS/VE)             NNVVEE22CCRRAAYY               CCRRAAYY22NNVVEE
  56.      CDC CYBER 205            EETTAA22CCRRAAYY               CCRRAAYY22EETTAA
  57.      Generic IEEE (32-bit)    IIEEGG22CCRRAAYY               CCRRAAYY22IIEEGG
  58.      IEEE little-endian       IIEEUU22CCRRAAYY               CCRRAAYY22IIEEUU
  59.      Cray IEEE (64-bit)       CCRRII22CCRRAAYY               CCRRAAYY22CCRRII
  60.      SGI MIPS                 MMIIPPSS22CCRRYY               CCRRYY22MMIIPPSS
  61.      User conversion          UUSSRR22CCRRAAYY               CCRRAAYY22UUSSRR
  62.      Site conversion          SSTTEE22CCRRAAYY               CCRRAAYY22SSTTEE
  63.      --------------------------------------------------------------------
  64.  
  65.    CCoonnvveerrssiioonn rroouuttiinneess ffoorr CCrraayy MMPPPP ssyysstteemmss::
  66.      --------------------------------------------------------------------
  67.      Name                     Foreign->Native       Native->Foreign
  68.      --------------------------------------------------------------------
  69.      Cray PVP systems (non-   CCRRAAYY22CCRRII and CCRRYY22CCRRII   CCRRII22CCRRAAYY and CCRRII22CCRRYY
  70.      IEEE)
  71.      IBM                      IIBBMM22CCRRII                CCRRII22IIBBMM
  72.      Generic IEEE (32-bit)    IIEEGG22CCRRII                CCRRII22IIEEGG
  73.      User conversion          UUSSRR22CCRRAAYY               CCRRAAYY22UUSSRR
  74.      Site conversion          SSTTEE22CCRRAAYY               CCRRAAYY22SSTTEE
  75.      --------------------------------------------------------------------
  76.  
  77.    CCoonnvveerrssiioonn rroouuttiinneess oonn CCRRAAYY TT9900 ((nnoonn--IIEEEEEE))
  78.      --------------------------------------------------------------------
  79.      Name                     Foreign->Native       Native->Foreign
  80.      --------------------------------------------------------------------
  81.      Cray PVP systems (non-   CCRRYY22CCRRII                CCRRII22CCRRYY
  82.      IEEE)
  83.      IBM                      IIBBMM22CCRRII                CCRRII22IIBBMM
  84.      Generic IEEE (32-bit)    IIEEGG22CCRRII                CCRRII22IIEEGG
  85.      User conversion          UUSSRR22CCRRAAYY               CCRRAAYY22UUSSRR
  86.      Site conversion          SSTTEE22CCRRAAYY               CCRRAAYY22SSTTEE
  87.      --------------------------------------------------------------------
  88.  
  89.    CCoonnvveerrssiioonn rroouuttiinneess oonn IIRRIIXX ssyysstteemmss ((MMIIPPSS))
  90.      --------------------------------------------------------------------
  91.      Name                     Foreign->Native       Native->Foreign
  92.      --------------------------------------------------------------------
  93.      Cray PVP systems (non-   CCRRYY22MMIIPPSS               MMIIPPSS22CCRRYY
  94.      IEEE)
  95.      User conversion          UUSSRR22CCRRAAYY               CCRRAAYY22UUSSRR
  96.      Site conversion          SSTTEE22CCRRAAYY               CCRRAAYY22SSTTEE
  97.      --------------------------------------------------------------------
  98.  
  99.    SSuuppeerrsseeddeedd rroouuttiinneess:: FFoorreeiiggnn ttoo CCrraayy RReesseeaarrcchh
  100.      The following table lists superseded, older routines that are
  101.      supported to maintain continuity.  Cray Research recommends using the
  102.      newer routines named in the preceding list.
  103.  
  104.      --------------------------------------------------------------
  105.      Conversion                           IBM     CDC       VAX/VMS
  106.      --------------------------------------------------------------
  107.      Foreign single precision to Cray    UUSSSSCCTTCC   FFPP66006644    VVXXSSCCTTCC
  108.      single precision
  109.      Foreign double precision to Cray    UUSSDDCCTTCC    ------      VVXXDDCCTTCC
  110.      single precision
  111.                                                             VVXXGGCCTTCC
  112.      Foreign double precision to Cray      ------     ------      VVXXBBCCTTCC
  113.      double precision
  114.      Foreign integer to Cray integer     UUSSIICCTTCC   IINNTT66006644   VVXXIICCTTCC
  115.      Foreign logical to Cray logical     UUSSLLCCTTCC    ------      VVXXLLCCTTCC
  116.      Foreign character to ASCII          UUSSCCCCTTCC   DDSSAASSCC      ------
  117.      VAX 64-bit complex to Cray single     ------     ------      VVXXZZCCTTCC
  118.      precision
  119.      IBM packed-decimal field to Cray    UUSSPPCCTTCC    ------       ------
  120.      integer
  121.      --------------------------------------------------------------
  122.  
  123.    SSuuppeerrsseeddeedd rroouuttiinneess:: CCrraayy RReesseeaarrcchh ttoo FFoorreeiiggnn
  124.      The following routines convert Cray Research types to foreign types.
  125.      The man pages for these routines appear under the name of the inverse
  126.      of each routine (for example, CCRRAAYY22IIBBMM is described under entry
  127.      IIBBMM22CCRRAAYY).
  128.  
  129.      RRoouuttiinnee   TTyyppee
  130.      CCRRAAYY22IIBBMM  IBM
  131.      CCRRAAYY22CCDDCC  CDC
  132.      CCRRAAYY22VVAAXX  VAX/VMS
  133.      CCRRAAYY22NNVVEE  NOS/VE
  134.      CCRRAAYY22EETTAA  ETA/CYBER 205
  135.      CCRRAAYY22IIEEGG  IEEE (32-bit)
  136.      CCRRAAYY22IIEEUU  DEC
  137.      CCRRAAYY22CCRRII  IEEE (UNICOS/mk)
  138.  
  139.      The following table lists older routines that convert Cray Research
  140.      types to foreign types.  These routines are supported to maintain
  141.      continuity.  Cray Research recommends using the newer routines named
  142.      in the preceding list rather than these routines.
  143.  
  144.      --------------------------------------------------------------
  145.      Conversion                         IBM       CDC       VAX/VMS
  146.      --------------------------------------------------------------
  147.      Cray single precision to foreign   UUSSSSCCTTII    FFPP66446600    VVXXSSCCTTII
  148.      single precision
  149.      Cray single precision to foreign   UUSSDDCCTTII     ------      VVXXDDCCTTII,
  150.      double precision                                       VVXXGGCCTTII
  151.      Cray double precision to foreign    ------       ------      VVXXBBCCTTII
  152.      double precision
  153.      Cray integer to foreign integer    UUSSIICCTTII    IINNTT66446600   VVXXIICCTTII
  154.      Cray logical to foreign logical    UUSSLLCCTTII     ------      VVXXLLCCTTII
  155.      ASCII character to foreign         UUSSCCCCTTII    AASSCCDDCC      ------
  156.      character
  157.      Cray complex to foreign complex     ------       ------      VVXXZZCCTTII
  158.      Cray integer to foreign packed-    UUSSIICCTTPP     ------       ------
  159.      decimal field
  160.      --------------------------------------------------------------
  161.  
  162. NNUUMMEERRIICC CCOONNVVEERRSSIIOONN RROOUUTTIINNEE
  163.      CCHHCCOONNVV converts decimal ASCII numerals to an integer format.  It is an
  164.      internal library routine.
  165.  
  166. AASSCCIIII CCOONNVVEERRSSIIOONN FFUUNNCCTTIIOONNSS
  167.      The ASCII conversion functions convert binary integers to or from
  168.      1-word ASCII strings (not Fortran character variables).
  169.  
  170.      Note:  The ASCII conversion functions are not intrinsic to Fortran.
  171.      Their default type is real, even though their results are generally
  172.      used as integers.
  173.  
  174.      The ASCII conversion routines use one type integer argument.  The DDTTBB
  175.      and OOTTBB routines can also use a second optional argument as an error
  176.      code.  The resulting error codes (0 if no error; -1 if there are
  177.      errors) are returned in the second argument for Fortran calls.  If no
  178.      error code argument is included in Fortran calls, the routine aborts
  179.      if an error is encountered.
  180.  
  181.      The following calls show how the ASCII conversion routines are used.
  182.      These Fortran calls convert a binary number to decimal ASCII, then
  183.      convert back from ASCII to binary. They use internal I/O routines.
  184.  
  185.      _r_e_s_u_l_t=BBTTDD((_i_n_t_e_g_e_r))
  186.  
  187.      _r_e_s_u_l_t    Decimal ASCII result (right-justified, blank-filled)
  188.  
  189.      _i_n_t_e_g_e_r   Integer argument
  190.  
  191.      _r_e_s_u_l_t=DDTTBB((_a_r_g,_e_r_r_c_o_d_e))
  192.  
  193.      _r_e_s_u_l_t    Integer value
  194.  
  195.      _a_r_g       Decimal ASCII (left-justified, zero-filled)
  196.  
  197.      _e_r_r_c_o_d_e   0 if conversion successful; -1 if error
  198.  
  199.      The following table lists the ASCII conversion functions.
  200.  
  201.      -------------------------------------------------------------
  202.      Purpose               Name   Argument range  Result
  203.      -------------------------------------------------------------
  204.      Binary to decimal     BBTTDD    0 <= x <=       One-word ASCII
  205.      ASCII (right-                99999999        string (right-
  206.      justified, blank-                            justified,
  207.      filled)                                      blank-filled)
  208.      Binary to decimal     BBTTDDLL   0 <= x <=       One-word ASCII
  209.      ASCII (left-                 99999999        string (left-
  210.      justified, zero-                             justified,
  211.      filled)                                      zero-filled)
  212.      Binary to decimal     BBTTDDRR   0 <= x <=       One-word ASCII
  213.      ASCII (right-                99999999        string (right-
  214.      justified, zero-                             justified,
  215.      filled)                                      zero-filled)
  216.      Binary to octal       BBTTOO    0 <= x <=
  217.      ASCII (right-                77777777        One-word ASCII
  218.      justified, blank-                    8       string (right-
  219.      filled)                                      justified,
  220.                                                   blank-filled)
  221.      Binary to octal       BBTTOOLL    0 <= x <=
  222.      ASCII (left-                 77777777        One-word ASCII
  223.      justified, zero-                     8       string (left-
  224.      filled)                                      justified,
  225.                                                   zero-filled)
  226.      Binary to octal       BBTTOORR   0 <= x <=
  227.      ASCII (right-                77777777        One-word ASCII
  228.      justified, zero-                     8       string (right-
  229.      filled)                                      justified,
  230.                                                   zero-filled)
  231.      Decimal ASCII to      DDTTBB    Decimal ASCII   One word
  232.      binary                       (left-          containing
  233.                                   justified,      decimal
  234.                                   zero-filled)    equivalent of
  235.                                                   ASCII string
  236.      Octal ASCII to        OOTTBB    Octal ASCII     One word
  237.      binary                       (left-          containing octal
  238.                                   justified,      equivalent of
  239.                                   zero-filled)    ASCII string
  240.      -------------------------------------------------------------
  241.  
  242.      The Cray Assembly Language (CAL) entry points are the same as the
  243.      Fortran entry points for the preceding routines with the percent sign
  244.      (%) appended.  For example, BBTTDDLL is called as BBTTDDLL%% from CAL.
  245.  
  246. IIEEEEEE CCOONNVVEERRSSIIOONN RROOUUTTIINNEESS
  247.      The IEEE conversion routines convert Cray single-precision real
  248.      numbers to or from IEEE single- or double-precision real numbers.
  249.  
  250.      The following list contains the purpose and name of the IEEE
  251.      conversion routines.  See the individual man pages for implementation
  252.      details.
  253.  
  254.      * IIEEGG22CCRRAAYY:  Converts IEEE/Generic 32-bit data to Cray data
  255.  
  256.      * CCRRAAYY22IIEEGG:  Converts Cray data to IEEE/Generic 32-bit data
  257.  
  258.      * IIEEUU22CCRRAAYY:  Converts DEC ULTRIX/Generic Little Endian 32-bit data to
  259.        Cray data
  260.  
  261.      * CCRRAAYY22IIEEUU:  Converts Cray data to DEC ULTRIX Generic Little Endian
  262.        32-bit data
  263.  
  264.      * CCRRII22CCRRYY:  Converts Fortran data from UNICOS/mk to UNICOS type
  265.  
  266.      * CCRRYY22CCRRII:  Converts Fortran data from UNICOS to UNICOS/mk type
  267.  
  268.      * CCRRII22CCRRAAYY:  Converts IEEE/MPP 32-bit data to Cray Research PVP 64-bit
  269.        data
  270.  
  271.      * CCRRAAYY22CCRRII:  Converts Cray Research PVP 64-bit data to IEEE/MPP 32-bit
  272.        data
  273.  
  274. OOTTHHEERR CCOONNVVEERRSSIIOONN RROOUUTTIINNEESS
  275.      These routines place the octal ASCII representation of a Cray word
  276.      into a character area, convert trailing blanks to nulls or trailing
  277.      nulls to blanks, and translate a string from one code to another,
  278.      using a translation table.
  279.  
  280.      The following list contains the purpose and name of these conversion
  281.      routines.
  282.  
  283.      * BB22OOCCTT:  Places an octal ASCII representation of a Cray word into a
  284.        character area
  285.  
  286.      * CCHHCCOONNVV:  Converts decimal ASCII to integers
  287.  
  288.      * RRBBNN:  Converts trailing blanks to nulls
  289.  
  290.      * RRNNBB:  Converts trailing nulls to blanks
  291.  
  292. SSEEEE AALLSSOO
  293.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed
  294.      version of this man page.
  295.