You are on page 1of 334

Application Programmer’s Library

Reference Manual, Volume 2


004–2165–002
    "! #%$&'  !()+* #+! ,.-/ 102 )(&0234(534"623478,9 (+:;' #.<='>='? )(@ +34A34>B:;' C#+>>D3
A3E=A>7F<=!347G #%'#;B)> :H<#+ 3?(I(=34":;")J3?7KD>L! #)'!>MD>ONP"))3E#C=34 :L (5(I"#Q>BF" ! #L$&'  !()=* #!,
R > )"#+(SB2 + (2:;' #.<='M'A3D'(5347P#T:L')34 'A3E=A>7F<=!347L>'7' =)347GB)A :U*WV8V8VPF)7G?XX Y,  ? Z2! " +2[W!\+? ZD>Q +3
* #+(5)  <=)3]>BV8 34! )"!'8' #+7PV 3?!)A #+ ! (&VF#+> #+3434 ()2* #+! ,.98+3^*)V8V8VP)'_>34(2#+`A34()=#(I D  LBW' #7aNP 1'(5()<:;3#+` ' D"  GBW78' :;'>3?(
A34()<="J #+OB)A :U 3^A34'7834 b (+:; (5 #)34 =A3?)'?)"#cB2(I' 7d #+BW":;') #%A34()<= ) #eB)A :U 3== '! 3E:;3E#M' #7T! #+)3?fF #Q  (<D" !')  #+,
* #+BW> :;')  #L (&A3E=A>7<!347gNP  h +3=34 :L (5(5 #Q>B +3*)V8V8V8,

i * jc* 9V8kL-mlTkn02V8I902*W89Vko02*W$&pq9 i V8$&VFlTk


r 5( 3E+7F<= ! '?)"#2>78 (5! >()<=A3D>L 3^$& 6234 #:;3E#+"(q()<D>sW34!2)/A34(5) !)  #+(m'(&(I3?BW  Q #% +3^0+ )(& #%k&')'K! ' <=(I3'+t-/0
Z, ZZu e'#78v #%(5 :; "'?q>()<=!!3?(I(5>! ' <=(534(S #% +3t-/0w2q #; 3^kmxmk+k&x]Ve8lK-/I-Ht-/0LI<8= 3:;3E#)(I, r #.<D ()347T y+)(
A34(534"62347K<#+7834@ +3=  + i ' NP(&B2 +3 r #+ )3?7P)')34(5,2#)'!)>vF:;' #.<=BW'! <=A34S (& "! #L$&' + ! ()=* #+! , +zXX-m:/  +34')A3
R _yNaF, j{<#)' #T|& 3ENS2-H X ?Yu Y?,

-m<=)>)'(I_w #+y2=t> == 'I=' C-/7' +' 2F>B) =' `}2uWj R += ' >u5 02* #+BW":/+02*Wv~4w€A‚ƒq 62' pa5„2 i D! j RR -m=A3E#) !3k2
 r/R V802 ir 59V80w r lT*Wxm5„2u)j R V-m=' #+7 r lT*W=x]v:L_O'A3aB)347834 ' LA3?> (5)34A347G) '73E:L'_>(S' #+7G834!' <=(53#]NT>_w(I)')  #% (&' #
(5 ' #7=* ==8jP9>=t>X ==t 9>2t 98Z2t 9 #+8<=E3E#+j{'? #+)3E#'#!391> ()2=x]5' `-m# :;')  #e98+3?'?)3? += ' `- RR +' G=X 
' G?Xk+= ' L††P:/= " #+CI2(5)3E:/+= '2k&>!W== 'GV i +' C‡5X ' O‡X(I32= ' i #+_ ' OlPˆm52' 2v02V8V i D'"' #.
' G5u)j R +' Lk+u)9X ' L5|a 2' O9X = '`98Yk++' O98YVF' >9<=)> 2' C„2u)j R == '`„+jc5== ' >u)Z* jP8|9>
km34 623? #/ +3=NP34q,.,w, =k&$&' <=(5()+k&>!W62 3N@+VFjckm5=$& w'02 #+y+paVF„2-/0w+*Wxm5.lPk‰34 34(lT3? NT>_Okm (5_&-/ 'y
lT3? NT>_`ˆ<=3E<= #OVF#.6+ A#:;3E# lT34 NT>_`ˆ<=3E<= #+^98>"(J=x i lTVF9>02ˆ]5+V8$ i km0w5jd-/09VF r/R V0 i * lPƒ8
5(5)3E:Šjc' #)3E#+' #!3]' #+7G023:;>J3=9134(5) #OVF#.62"A#.:L3E#+ .91 <=(5)347 r lT*Wxm5'#7 r lP*)x]&jP-m„‹'?E3K) '73:;'_w(@>B' L023?(I3?'?E!W.
i , i , , 2'SNa+> L Na#347T()<D(5 78 ' ;>B+ " ! #L$&' +"!()=* #+! ,

$&*M (q'g)'783E:;'_g>B "! #L$&' + ! ()+* #!,*W02* „n' #+7P ! #L$& '  !(@'?E3A34w (5)34A347T) '73:;'_w(@' #+7P +3F" ! #L$&'  !(& >>` (q'
) '73E:L'_/>B "! #%$&'  !()+* #+! ,

k&%"(S'g)'783E:;'_OB2= #+)A>km')'^5(5)3E:L(J=* #+! ,+kmV8 r/i 902* „2.|-m„2=' #+7K|j{g'A3a)'783E:;'_w(@>Bk& w )'V8Œ <= :L3E#+
"= '?)"#,2V802XK (&')'783E:L'? _C>BVFjP-OF5* #+! ,+VF9>-"(S'g)'783E:;'_OB2V9>-ŽI2(5)3E:;()=* #!,*Wj"(S'g)'783E:;'_OB2* #)34 #') #'
F<=(5 #+3?(I(Mj{'!W+ #+34(S"= '?)"#,jc* R g (&')'783E:L'? _C>B>j{* R g= :/<=)34@I2(5)3E:;(5, r lT* „n (&'KA34w (5)34A347G)'783E:L'? _/ #% +3 r #+ )3?7
)')34(@'#7T> +34q! <#+)"34()M "!3E#(I3?7d34fF! <(I 6234 d A<=yT„&v8x+=3E#Q= :/=' #. i :;")3478,„&vx=3E#L"(q'A34>"(I)3?A347G)'783E:;'_OBw„&vx=3E#
:O='# i )78,.„hc #+78N‘I2(5)3E:’' #7G +3=„n73E6+ !3^'A3) '73:;'_w(&>B>983x=3E#Q$&A<=,

98+3 r lT*W=x]`=34 ') #+O()(5)3E:“ (&734 62347dB)A : r lP* „=”e52(I)3:Ž|=,498+3 r lT*W=x]a =34') #+e()(5)3E:• (&' (5]D'(5347P #e='? 2 #Q +3
tw<=  ;834 _>34 3EQBW NT'A3km (5) D><=) #c[)8k&\.<#7834= ! 3E#+(53aBWA :Š98+3^0234>3#+)(&B2 +3 r #+ 6234(5  G>B=' "B)> #+"',
New Features

Application Programmer’s Library Reference Manual, Volume 2 004–2165–002

–&—q˜A™Pšn›1œqS›1žmŸS™¡w¢?˜A£™P¤I—qQ¥G¦S¦SžA˜A¡>›1¤ ˜A§œ©¨&˜A£¢›1¢?ª‰«I§+¢T¬/¢›8ª=¨&˜A£™T­q® ­q®&–&—q%¡>—q›1œq¯™P¤I§‹¤I—qhšn›1œqS›1ž&›1¢y%Ÿ&¤ ›1˜AžAŸ


£žA§+°%®
±c°²¡>§œq³=¢?™˜A§œ´¢y§S¤ ˜Aœq™P›1¢y%›1³=›1˜AžA›1£žAh«I§+¢eµ5¶KµI·¸™ª=™¤Išn™1®m¹2 ­8»=¼K›1œqŸ ­1»¼®
IEG2MIPSº VAX2MIPSº
±c°²»»=µI½¾žA›1ª¢?™d›1¢y%›1³›8˜AžA›1£žAQ«I§+¢eµ5¶KµI·¸™ª=™¤Išn™1®m¹2 ­1»¼g«I§¢eŸ&¤ ›1˜AžA™1®&µ5œ©›1ŸSŸ&˜A¤I˜A§+œq¿q›%œq°
¢y§+¢Tšn™™›1¯Q™º ¤I¢?˜Aœq¯^®m¹
¢y§S¤ ˜AœqQ°c›1™P›1Ÿ&ŸÀ°c—q˜A¡w—Àšn›8¦S™d›1œ‰¢?¢y§¢eœqSšn£=¢e¤ §n›1œ´¢INTRO_FFIO ­8¬O¼K«I§¢/Ÿ&¤ ›1˜AžA™M®
ffstrerrorº
Record of Revision

ÁqÂ8ÃÄ8Å>Æ2Ç ÈÉÂ8ÄÊ8ÃÅyË`ÌÅ>Æ2Ç

Íq® Î ½L¡>¤ §£¢CÍ1Ï1Ï1Ð


½L¢?˜A¯˜Aœq›1žmÑS¢˜Aœq¤ ˜Aœq¯]®&–&—q˜A™Pšn›1œqS›8žm™S¦S¦S§+¢¤ ™G¤ —qQÑS¢y§¯¢?›1šnšn˜Aœq¯‰Ò&œq³=˜A¢y§œqšnœq¤gÍ® Î{¢yžA›1™=®
Ó›1œqª‰§+«a¤ —qQ¢y§+S¤I˜Aœq™G˜Aœ©¤ —q˜A™Pšn›1œqS›1žm°c¢yh§¢?˜A¯˜Aœq›1žAžAªn¦S¢?˜Aœq¤IŸŽ˜Aœ©¤I—qnÔ`Õ;ÖI×aØ;ÙnÚÛ>Ü?ÝIÜ?Þ>ß
à=Þ>ßáqâÞyáãOäaã å>ã?Ü ã?ßæFã^çèÞ>ß=âÞ>éê¿q¦SS£žA˜A¡w›8¤I˜A§+œÀ¹¶aë1Î1ì1í1Ïq®

Îq® ì ±c§+³šn£¢CÍ1Ï1Ï1î
¶K¦S¢˜Aœq¤^¤ §n™S¦S¦S§+¢¤a¤ —qQÑS¢y§¯¢?›1šnšn˜Aœq¯©Ò&œq³˜A¢ §œqšnœq¤^Îq® ì{¢yžA›1™=®

­q® ì ïISœqQÍ8Ï1Ï1í
¶K¦S¢˜Aœq¤^¤ §n™S¦S¦S§+¢¤a¤ —qQÑS¢y§¯¢?›1šnšn˜Aœq¯©Ò&œq³˜A¢ §œqšnœq¤^­q® ì{¢yžA›1™=®S–&—qc¹—q›1¢yŸÀӍšn§¢?ª
¨&˜A£¢›8¢ªð¢y§S¤ ˜Aœq™ ¹2ñcÓÒ&Ó¼K›1¢y%Ÿ&«I¢¢yŸSœq¤I˜AžS›{žA›1¤ ¢T¢yžA›1™Q§œ´µI¶KµI·ò™ª™¤Išn™1®
º
­q® Í ¥;S¯S™¤Í1Ï1Ï1ó
¶K¦S¢˜Aœq¤^¤ §n™S¦S¦S§+¢¤a¤ —qQÑS¢y§¯¢?›1šnšn˜Aœq¯©Ò&œq³˜A¢ §œqšnœq¤^­q® Í{¢yžA›1™=®S–&—qc¦S¢?˜Aœq¤IŸ¤ ô¤§+«
¤I—q˜A™Pšn›8œqS›1žm°c›1™dšn›8Ÿ&Q›1³=›1˜AžA›1£žAh˜Aœ©¦@§™¤I™¡>¢?˜A¦S¤ ® ¦S™¼a«I§+¢š‹›1¤K§+œqžAª‹«I§+¢T¤ —q˜A™P¢yžA›1™=®
º
­q® ­ ïISžAª‹Í1Ï1Ï8Ï
¶K¦S¢˜Aœq¤^¤ §n™S¦S¦S§+¢¤a¤ —qQÑS¢y§¯¢?›1šnšn˜Aœq¯©Ò&œq³˜A¢ §œqšnœq¤^­q® ­{¢yžA›1™=®S–&—qc¦S¢?˜Aœq¤IŸ¤ ô¤§+«
¤I—q˜A™Pšn›8œqS›1žm°c›1™dšn›8Ÿ&Q›1³=›1˜AžA›1£žAh˜Aœ©¦@§™¤I™¡>¢?˜A¦S¤ ® ¦S™¼a«I§+¢š‹›1¤K§+œqžAª‹«I§+¢T¤ —q˜A™P¢yžA›1™=®
º

004–2165–002 i
About This Guide

–&—q˜A™G¦SS£žA˜A¡w›8¤I˜A§+œoŸ&§+¡wSšnœq¤I™P»§¢?¤I¢?›1œqõI¡>›1žAžA›1£žAh™S£¦S¢y§+¯=¢?›1šn™P›1œqŸ¢y§+S¤I˜Aœq™
›1³=›1˜AžA›1£žA%¤I§‹S™¢™G§+«a¤ —qQ¬O¢?›1ª¨&˜A£™G¦S¢y§+Ÿ&S¡>¤I¿@°c—q˜A¡>—©˜A™T˜Aœq¡>žASŸ&ŸŽ˜Aœ©¤ —q
ÑS¢y§+¯=¢?›1šnšn˜Aœq¯©Ò&œq³=˜A¢y§œqšnœq¤ Ñ&ÒS¼K­q® ­c¢yžA›1™=®
º
–&—qh¬O¢?›1ª=¨S˜A£=™T¦S¢y§+Ÿ&S¡>¤g¡>§+œq¤I›1˜Aœq™P™³=¢?›1žmžA˜A£¢›8¢˜A™ö¤ —qcžA˜A£¢?›1¢?ª‹¢y§S¤ ˜Aœq™G¡w›8œ©£
¡>›1žAžAŸ«I¢y§š÷™§S¢y¡>%¡w§+Ÿ&Q°c¢˜A¤ ¤Iœ©˜Aœ©›{œqSšn£¢O§+«g¦S¢y§+¯=¢?›1šnšn˜Aœq¯‰žA›1œq¯S›1¯=™¿
˜Aœq¡>žASŸ&˜Aœq¯o»=§+¢?¤I¢?›1œq¿q¬/¿@ÑS›1™¡w›8žA¿@›1œqŸÀ›1™™šn£žAªnžA›1œq¯S›1¯=®m–&—qQ˜Aœq«5§+¢?šn›1¤I˜A§+œ´˜Aœ©¤ —q˜A™
Ÿ&§+¡>Sšnœq¤K™S¦S¦SžAšnœq¤I™P˜Aœq«I§+¢šn›8¤I˜A§+œ´¡>§œq¤ ›1˜AœqŸ˜Aœ©§+¤I—q¢Ošn›1œqS›1žA™P§«g¤ —q
ÑS¢y§+¯=¢?›1šnšn˜Aœq¯©Ò&œq³=˜A¢y§œqšnœq¤Ÿ&§+¡wSšnœq¤I›1¤ ˜A§œ©™¤F®
–&—q˜A™G˜A™P›{¢y«I¢yœq¡>hšn›1œqS›1ž&«I§¢e›1¦S¦SžA˜A¡>›1¤ ˜A§+œ©›1œqŸ™ª™¤Išø¦S¢y§¯¢?›1šnšn¢?™1®]¶K›8Ÿ&¢?™
™—q§+SžAŸ›1žA™§n—q›1³=%›{°c§+¢ù˜Aœq¯‰ùœq§°cžAŸ&¯=L§+«g˜A¤I—q¢e¤I—qQúG±cµ5¬/½L¹¿qú;±cµI¬O½;¹&ûšnù¿@§+¢
úG±cµ5·‘§+¦S¢?›1¤I˜Aœq¯‹™ª™¤Išü›1œqŸ›{°c§+¢ù˜Aœq¯‰ùœq§°cžAŸ&¯=%§«¤I—qQ»§¢?¤ ¢›1œ©§¢C¬
¦S¢y§+¯¢›1šnšn˜Aœ¯ožA›1œq¯S›1¯=®
ÑS§+¢¤ ˜A§œq™G§«¤I—q˜A™Pšn›1œqS›8žm›1¢y%£›1™Ÿ§œ‰šn›1¤I¢˜A›1žA™d¢y¦S¢y§+Ÿ&S¡>ŸŽ§+¢e›1Ÿ&›8¦S¤IŸÀ«I¢y§+š
µIÒ&Ò&Ò¹2¤ ŸÍ1ì1ì1­q® Ï8ë1Í1Ï1Ï1Î8¿q¡>§¦Sª¢?˜A¯=—q¤ ¡>¼KÍ1Ï1Ï8Î{£ª‰¤ —qQµ5œq™¤ ˜A¤IS¤ c§«Ò&žA¡>¤I¢?˜A¡>›1ž]›8œqŸ
Ò&žA¡w¤ ¢y§+œq˜A¡w™dÒ&œq¯=˜Aœq¢?™¿qµ5œq¡®S–&—qcµIÒ&º Ò&Ò¤I›1ù™Tœq§n¢y™¦S§+œq™˜A£˜AžA˜A¤Iª‰«I§+¢e›1œqŸ°c˜AžAž]›1™™Sšn
œq§nžA˜A›1£˜AžA˜A¤Iª‰«I§¢OŸS›1šn›1¯™d¢y™SžA¤ ˜Aœq¯o«I¢y§+šý¤ —qQ¦SžA›1¡>šnœq¤K›1œqŸ¡>§+œq¤IôM¤˜Aœ©¤ —q˜A™
¦SS£žA˜A¡>›1¤ ˜A§œa®mµ5œq«I§+¢?šn›1¤I˜A§+œ´˜A™T¢y¦S¢y§+Ÿ&S¡>ŸŽ°c˜A¤I—o¤I—qh¦S¢?šn˜A™™˜A§œ©§«¤I—qQµIÒ&Ò&Ò`®

Documentation Organization
–&—qh¦S¢˜Aœq¤ ŸÀ³¢™˜A§+œq™G§+«a¤ —qQ›1¦S¦SžA˜A¡>›1¤ ˜A§+œÀžA˜A£¢›1¢?ª‹šn›1œÀ¦@›1¯=™d›8¦S¦S›1¢O˜Aœ©Î{³=§žASšn™
›1œqŸŽ›1¢y%¯¢y§S¦@Ÿ›1¡>¡>§+¢yŸ&˜Aœq¯©¤ §n¤ §¦S˜A¡>™1®&¹Q¤ —q ­1»¼ašn›1œo¦S›1¯
«I§+¢TŸS¤I›8˜AžA™d›8£=§+S¤a¤I—qh¡>§œq¤ œq¤ ™T§+«g›1¡>—©³=§žASšn® INTRO_APPLIBSº
Ò&›8¡w—´¤ §¦S˜A¡;™¡w¤ ˜A§+œ©›1žA™§n—q›1™T›1œ´˜Aœq¤ ¢y§Ÿ&S¡>¤ §¢?ªnšn›1œÀ¦S›8¯=Q°c—q˜A¡>—oô¦@žA›1˜Aœq™d¤I—q
¡>§+œq¤Iœq¤ ™d§+«g¤I—qQ™¡>¤ ˜A§œ©›8œqŸ¦S¢y§+³˜AŸ&™;§+¤ —q¢C˜Aœq«I§+¢?šn›1¤I˜A§+œ´›1£§+S¤a¤I—qQS™›1¯%§+«g¤I—q§+™
¢y§+S¤I˜Aœq™M®]–&—qQ«I§žAžA§+°c˜Aœq¯n˜Aœq¤I¢y§+Ÿ&S¡>¤I§+¢ªošn›1œo¦S›1¯™P›1¢y%›1³=›1˜AžA›1£žA=þ
­1»=¼ ­1»¼
INTRO_CONVERSIONº INTRO_PROGAIDSº
­1»¼ ­1»¼
INTRO_FFIOº INTRO_PXFº
­1»¼ ­8»=¼
INTRO_HEAPº INTRO_SORTSEARCHº
­8»=¼ ­1¼
INTRO_INTERFACEº INTRO_STREAMSº
­1»¼ ­1»¼
INTRO_IOº INTRO_SYNCº

004–2165–002 iii
Application Programmer’s Library Reference Manual, Volume 2

Related Publications
–&—qh«5§+žAžA§+°c˜Aœq¯‰Ÿ&§+¡>Sšnœq¤I™P¡>§+œq¤I›1˜êœÀ›8Ÿ&Ÿ&˜A¤I˜A§+œq›1žS˜Aœq«5§+¢?šn›1¤I˜A§+œ´¤ —q›1¤ašn›1ªn£%—qžA¦S«ISžyþ
ÿ ÙãáGã?ß=ÝaàÛ>Þ1ã?Ü5Ù Cà;ä KÞ>ßcé häKã åã?Ü ã?ß=æãçèÞ>ßâ=Þ>é
ÿ Ô/ÕGÖI×KØGَÔ4ã?Üe×aÛ;Þ>ßCäKã å>ã?Ü ã?ßæFã^çèÞwßâÞwé
ÿ Câ 1ãOÝIÛ&ÞwÜ4Þ>éêéêã?é+ã?æÝIÛwÜ1é WæFÞ>ÝêÛ>ß
ÿ Þ1ãTÙâ "!#?ÝIã" Ô?ã?Ü $ %Câ&1ã
ÿ Ô/ÕGÖI×KØGÙnÙ!?ÝIã"à&Ü4ÞwÜ'êã"OäKã å>ã?Ü ã?ßæFã^çèÞwßâÞwé
ÿ Ô/ÕGÖI×KØGÙnÙ!?ÝIã"×KÞ>éêé&Cäaã å>ã?Ü ã?ßæFã^çèÞ>ß=âÞ>é
ÿ 1é&êæÞwÝêÛ>ß(&Ü Û áqÜ?Þ)Gã?Ü*$ eÖ,+4Ø-Câ&1ã
ÿ Ø)8Ý )&.Wßá/1é&êæÞwÝêÛ>ߋ×aÛ8ãeÛ>ߎÔ`Õ;ÖI×aØ;ÙoÙ!#?ÝIã")
–&—qh«5§+žAžA§+°c˜Aœq¯ðšn›1œqS›1žA™dŸ&§+¡>Sšnœq¤^¤I—qQ¬/¢›1ª¨&˜A£™T¦S¢y§+Ÿ&S¡w¤®]¥;žAž&šn›1œo¦S›1¯™P˜Aœ‰¤ —q™
šn›1œqS›8žA™d¡>›1œÀ›1žA™§ð£h³=˜A°cŸ§œqžA˜Aœq%£ª‰S™˜Aœq¯‰¤I—q ¡>§šnšn›1œqŸgþ
man
ÿ Ùæ0êã4ß=Ý 1gæPà .Ü?Þ>Ü"!häKã å>ã?Ü ã?ßæFã^çèÞwßâÞwé
ÿ ÖIß=ÝIÜ'êß'êæ2&Ü Û>æFã"1âÜ ã"Cäaã å>ã4Üyã?ßæFã^çèÞ>ß=âÞ>é
ÿ Ùæ0êã4ß=Ý 1gæPà .Ü?Þ>Ü"Wã"OäKã?Þ!%äKã å>ã?Ü ã?ßæFã
ÿ 1é&êæÞwÝêÛ>ß(&Ü Û áqÜ?Þ)Gã?Ü*$ eà&.Ü?Þ>Ü"!cäaã?Þ!{äaã å>ã?Ü ã?ßæFã
µIœ´›8Ÿ&Ÿ&˜A¤I˜A§+œ´¤ §n¤ —q™%Ÿ&§+¡wSšnœq¤I™¿@™³¢›1žmŸ&§+¡wSšnœq¤I™P›1¢y%›1³=›1˜AžA›1£žA%¤I—q›1¤]Ÿ&™¡>¢˜A£
¤ —qc¡>§+šn¦S˜AžA¢C™ª™¤Išn™d›1³›8˜AžA›1£žAQ§+œ´ú;±hµ5¬O½;¹{›1œqŸŽú;±hµ5¬O½;¹Sû2šnù]®S¹2§+šn%§«¤I—q™
šn›1œqS›8žA™d›1¢y=þ
ÿ ×aÚ34häKã?Þ!%äKã å>ã?Ü ã?ßæFã
ÿ ×aÚ34h×KÛ)GÞ>ßCÞ>ß/)WÜyã4æFÝ 51ã'Cäaã å>ã4Üyã4ß=æãKçèÞ>ß=âÞ>é
ÿ ÚÛwÜ4Ý5Ü4Þwßnà=Þ>ßáqâÞyáãOäaã å>ã?Ü ã?ßæFã^çèÞ>ß=âÞ>é 6 Û>éêâ;ã27
ÿ ÚÛwÜ4Ý5Ü4Þwßnà=Þ>ßáqâÞyáãOäaã å>ã?Ü ã?ßæFã^çèÞ>ß=âÞ>é 6 Û>éêâ;ã28
ÿ ÚÛwÜ4Ý5Ü4Þwßnà=Þ>ßáqâÞyáãOäaã å>ã?Ü ã?ßæFã^çèÞ>ß=âÞ>é 6 Û>éêâ;ã29
ÿ ×aÜ?Þ!{×+4× : :©äKã å>ã?Ü ã?ßæFã^çèÞwßâÞwé

iv 004–2165–002
About This Guide

–&—qh«5§+žAžA§+°c˜Aœq¯‰šn›1œqS›8žA™dŸ&§+¡wSšnœq¤¤ —qc¡>§+šn¦S˜AžA¢?™T¤I—q›8¤K›8¢yh›8³›1˜Ažê›1£žAh§œ´µI¶KµI·
™ª™¤ šn™1þ
ÿ çèÖ&Ù&ÜyÛ;{ÚÛ>Ü?ÝIÜ?Þ>ß<34h×aÛ);Þ>ßCÞ>ß=)êÜ ã?æÝ 51ã"eäKã åã?Ü ã?ß=æãçèÞ>ßâ=Þ>é
ÿ çèÖ&Ù1ÜyÛ"4ã").é !hà=Þ>ßáqâ=Þ áqã&Ü ÛyáÜ?Þ)Gã?Ü*$ Câ&1ã
ÿ çèÖ&Ù1ÜyÛ;ÚÛwÜ4Ý5Ü4Þwß>;;hà=Þ>ßáqâÞyáãeäKã åã?Ü ã?ß=æãçèÞ>ßâ=Þ>é
ÿ çèÖ&Ù1ÜyÛ;ÚÛwÜ4Ý5Ü4Þwß>;;=&Ü ÛyáÜ?Þ)Gã?Ü*$ Câ&1ã
ÿ çèÖ&Ù1ÜyÛ)?@AB WÝC&Û>Ü?Ýêßá©Þ>ß  Ü4Þwß"WÝDWÛwß>Câ 1ã

Obtaining Publications
¹FEdµ`šn›8˜Aœq¤I›1˜Aœq™T˜Aœq«I§+¢?šn›1¤I˜A§+œ´›1£§+S¤a›1³›8˜AžA›1£žAh¦SS£žA˜A¡>›1¤I˜A§+œq™P›1¤¤I—qQ«I§+žAžA§°c˜Aœq¯nú;¶a¨`þ

http://techpubs.sgi.com/library
–&—q˜A™HG‰£ð™˜A¤I%¡>§œq¤ ›1˜Aœq™C˜Aœq«5§+¢?šn›1¤I˜A§+œ‰¤I—q›8¤^›1žAžA§+°c™Tª=§+´¤ §ð£¢y§+°c™%Ÿ&§¡>Sšnœq¤ ™e§+œqžA˜Aœq¿
§+¢yŸ&¢eŸ&§¡>Sšnœq¤ ™¿S›8œqŸ™œqŸ«IŸ&£›1¡>ù‰¤ §n¹FEdµ®JIq§+¡>›1œo›1žA™§n§¢yŸS¢T›%¦S¢˜Aœq¤ ŸŽ¹FEdµ
Ÿ&§+¡>Sšnœq¤K£ª‰¡>›1žAžA˜Aœq¯‹Í{ó1ì1ì/K8Î1ícÏ1­1ì8íq®
–&—qoÔ?ã4Ü%&â.é êæÞwÝWÛwßC×KÞ>ÝIÞ>éêÛ á©Ÿ&™¡>¢˜A£™P¤ —qc›1³=›1˜AžA›1£˜AžA˜A¤ ª‹›1œqŸ¡>§œq¤ œq¤K§«›1žAž]¬O¢?›1ª
—q›1¢yŸS°{›8¢yc›1œqŸ™§+«5¤ °c›1¢ycŸ&§+¡wSšnœq¤I™P¤ —q›1¤a›1¢y%›1³=›1˜AžA›1£žAL¤I§‹¡wS™¤ §šn¢?™1®m¬OS™¤I§+šn¢?™
°c—q§‰™&£™¡>¢?˜A£=%¤ §n¤ —qQ¬O¢?›1ªnµIœq«I§¢?š ¬/¶KµIœq«I§¢?šn¼a¦S¢y§+¯¢›1šü¡w›8œ›8¡w¡>™™T¤ —q˜A™
˜Aœq«I§+¢šn›8¤I˜A§+œ´§+œ´¤I—qQ¬/¶Kµ5œq«I§+¢?š÷™ª™¤Išº Ž®
¹FEdµ`šn›8˜Aœq¤I›1˜Aœq™T˜Aœq«I§+¢?šn›1¤I˜A§+œ´§+œ´¦SS£žA˜A¡>žAªn›1³=›1˜AžA›1£žA%¬O¢?›1ªoŸ&§+¡wSšnœq¤I™P›1¤¤ —q
«I§+žAžA§°c˜Aœq¯©úG¶K¨`þ

http://www.cray.com/swpubs/
–&—q˜A™G‰£‰™˜A¤I%¡>§+œq¤I›1˜Aœq™P˜Aœq«I§+¢?šn›1¤I˜A§+œ´¤ —q›1¤a›1žAžA§+°c™Tª=§+¤I§‹£¢y§°c™%Ÿ&§+¡wSšnœq¤I™P§+œqžA˜Aœq
›1œqŸŽ™œqŸ´«IŸ&£›1¡>ù‰¤ §o¹LEdµF®8–2§ð§+¢yŸ&¢T›{¦@¢˜Aœq¤ Ÿ¬/¢›8ªnŸ&§+¡>Sšnœq¤I¿q˜A¤ —q¢e¡>›1žAž
M ÍNK1î8Í/K1ó1­cî8Ï1ì1íc§¢e™œqŸ›{«I›1¡>™˜Ašn˜AžA%§+«aª§S¢C¢yJO=S™¤K¤ §n«I›1ôɜqSšn£¢
M ÍNK1î8Í/K1ó1­c­8ó1Ð1ìq®&¹LEdµgšn¦SžA§+ª=™Tšn›1ªn›1žA™§n§+¢yŸ&¢e¦S¢?˜Aœq¤IŸÀ¬O¢?›1ªoŸ&§+¡>Sšnœq¤I™P£ª
™œqŸ&˜Aœq¯o¤I—q˜A¢e§¢yŸS¢?™d³=˜A›cžA¡>¤I¢y§+œq˜A¡Lšn›1˜Až&¤ § ®
orderdsk
¬/&™¤ §šn¢™d§+S¤I™˜AŸ&%§+«a¤ —qcúGœq˜A¤IŸ¹2¤ ›1¤ ™d›8œqŸ¬O›1œq›8Ÿ&›c™—q§SžAŸ¡>§+œq¤I›1¡>¤¤ —q˜A¢ežA§+¡>›1ž
™¢?³=˜A¡wh§+¢y¯›1œq˜QP1›1¤ ˜A§œ©«I§¢e§+¢yŸ&¢?˜Aœq¯‰˜Aœq«I§¢?šn›1¤ ˜A§œ©›1œqŸŸ&§+¡>Sšnœq¤I›8¤I˜A§+œ´˜Aœq«I§¢?šn›1¤ ˜A§œa®

Conventions
–&—qh«5§+žAžA§+°c˜Aœq¯‰¡>§+œq³œq¤I˜A§+œq™G›8¢yhS™Ÿ´¤ —q¢y§S¯—q§S¤g¤ —q˜A™PŸ&§+¡wSšnœq¤Fþ

004–2165–002 v
Application Programmer’s Library Reference Manual, Volume 2

¬ § œ ³ œ ¤˜§ œ Ó › œ ˜œ ¯
–&—q˜A™HRSôŸSõ5™¦S›1¡>%«I§+œq¤aŸ&œq§¤ ™džA˜A¤ ¢?›1ž]˜A¤ šn™T™&¡>—©›1™
command ¡>§šnšn›8œqŸ&™¿SR&žA™¿q¢y§+S¤I˜Aœq™¿@¦S›1¤ —©œq›1šn™¿@™˜A¯œq›1žA™¿
šn™™›1¯™¿q›1œqŸÀ¦S¢y§¯¢?›1šnšn˜Aœq¯‰žA›1œq¯=S›8¯=h™¤ ¢S¡>¤ &¢ ™1®
51Þ>Ü"WÞ.éWã µ5¤ ›1žA˜A¡;¤ ª=¦S«5›8¡wQŸ&œq§+¤I™d³=›1¢?˜A›1£žA%œq¤ ¢?˜A™P›8œqŸ°c§¢yŸ&™
§+¢e¡>§œq¡>¦S¤ ™T£˜Aœq¯‰Ÿ&*R&œqŸ`®
–&—q˜A™P£§žAŸ&¿SRSôŸ&õI™¦S›8¡wQ«5§+œq¤aŸSœq§¤ ™PžA˜A¤I¢?›1ž]˜A¤ šn™
user input
¤ —q›1¤a¤I—qQS™¢eœq¤ ¢?™P˜Aœ©˜Aœq¤ ¢›8¡w¤ ˜A³=%™™™˜A§+œq™1®
½;S¤I¦SS¤K˜A™T™—q§+°{œ©˜Aœ©œq§+œq£§+žAŸ&¿RSôMŸ&õI™¦S›1¡>%«I§œq¤®
µIœ´›8Ÿ&Ÿ&˜A¤I˜A§+œ´¤ §n¤ —q™%«I§¢?šn›1¤ ¤I˜Aœq¯o¡>§+œq³œq¤I˜A§+œq™¿q™³¢›1žmœq›1šn˜Aœq¯‹¡>§+œq³œq¤I˜A§+œq™d›1¢y
S™Ÿ¤ —q¢y§+S¯=—q§+S¤g¤I—qQŸS§¡>Sšnœq¤ ›1¤I˜A§+œa®UT1¬/¢›8ªnÑ VCÑÀ™ª=™¤ šn™XWhŸ&œq§+¤ ™d›1žAž
¡>§+œR&¯S¢›8¤I˜A§+œq™G§+«a¬/¢›1ª‰¦S›1¢?›1žAžAž]³=¡>¤ §¢C¦S¢y§+¡>™™˜Aœq¯ ÑYVCÑS¼™ª=™¤Išn™d¤I—q›8¤K¢?Sœo¤I—q
úG±cµ5¬/½L¹ð§¦S¢›1¤ ˜Aœq¯n™ª™¤ šŽ® T8¬O¢?›1ª©ÓÑSÑÀ™ª™¤ šn™XW{º Ÿ&œq§+¤I™T›8žAž]¡>§œRS¯&¢?›1¤ ˜A§œq™d§«
¤ —qc¬/¢›8ªn–&­1ҍ™¢˜A™P¤ —q›1¤a¢Sœo¤ —qQú;±cµI¬O½;¹&ûšnùo§+¦S¢?›1¤I˜Aœq¯‹™ª™¤IšŽ® T1µ5¶aµ5·
™ª™¤ šn™XW{Ÿ&œq§+¤I™d¹FEdµa¦SžA›1¤I«I§+¢?šn™;°c—q˜A¡>—o¢Sœo¤ —qQµ5¶KµI·è§+¦S¢?›1¤ ˜Aœq¯n™ª=™¤ šŽ®
–&—qhŸ&«I›1SžA¤™—qžAž]˜Aœ©¤ —qQú;±cµI¬O½;¹‹›1œqŸúG±cµI¬O½;¹&ûšnùn§+¦S¢?›1¤ ˜Aœq¯©™ª™¤Išn™¿q¢y«I¢¢ Ÿ
¤ §o›1™P¤ —q?ÝIÞwß1Þ>Ü"N"Z1ã?éWé꿘A™T›{³¢™˜A§+œ©§«¤I—q=[e§+¢?œ©™—qžAž]¤ —q›1¤^¡>§œq«I§+¢šn™G¤ §n¤ —q
«I§+žAžA§°c˜Aœq¯©™¤ ›1œqŸ&›1¢yŸ&™1þ
ÿ µ5œq™¤ ˜A¤IS¤ %§+«aÒ&žA¡w¤ ¢?˜A¡w›8ž]›1œqŸÒSžA¡>¤I¢y§+œq˜A¡>™GÒ&œq¯˜Aœq¢?™ µIÒ&Ò&Ò&¼KÑ&§+¢?¤I›1£žAQ½L¦@¢?›1¤I˜Aœq¯
¹ª=™¤ šøµ5œq¤ ¢«I›8¡w ÑS½;¹µ5·a¼¹2¤ ›1œqŸ&›8¢yŸŠÍ1ì1ì8­q® Î1ë1Í1Ï8Ï1Î º
º
ÿ ·Tû2½;¦SœoÑS§¢?¤I›8£=˜êžA˜A¤Iª>EdS˜AŸ&¿qµI™™S%Ð º ·aÑ EdÐ8¼
–&—qQú;±hµ5¬O½;¹{›1œqŸ©ú;±cµI¬O½;¹&ûšnùn§+¦S¢?›1¤ ˜Aœq¯n™ª=™¤ šn™T›8žA™§É™S¦S¦S§+¢¤]¤I—qQ§+¦S¤ ˜A§œq›1žSS™
§+«g¤I—qQ¬U™—qžAžy®

Man page sections


–&—qhœq¤I¢?˜A™T˜Aœ©¤I—q˜A™PŸS§¡>Sšnœq¤K›8¢yh£›1™ŸŽ§+œo›{¡>§šnšn§+œ©«I§¢?šn›1¤®m–&—qQ«5§+žAžA§+°c˜Aœq¯‰žA˜A™¤
™—q§+°{™d¤I—qQ§+¢yŸ&¢e§«g™¡>¤ ˜A§œq™e˜Aœ©›1œ´œq¤ ¢?ª‰›1œqŸŸ&™¡>¢?˜A£™P›1¡>—©™¡>¤I˜A§+œa®&Ó§™¤aœq¤ ¢?˜A™
¡>§+œq¤I›1˜Aœ´§+œqžAª‰›{™&£™¤^§«¤I—q™%™¡>¤ ˜A§œq™1®

¹ ¡ ¤˜§ œ — › Ÿ ˜œ ¯ \ ™ ¡ ¢ ˜¦ ¤˜§ œ
±c¥GÓÒ ¹¦S¡>˜QRS™G¤ —qQœq›1šnQ§+«g¤I—qQœq¤ ¢?ª‰›1œqŸ£¢?˜AJ]&ª‹™¤I›1¤ ™
˜A¤ ™d«ISœq¡>¤I˜A§+œa®
¹FIK±h½LÑS¹µ5¹ ÑS¢y™œq¤ ™d¤ —qc™ªœq¤I›1ôc§«¤I—qhœq¤ ¢ªM®
µIӍÑS¨&Ò&ÓÒ&±h–+¥O–&µI½L± µ5ŸSœq¤I˜QRS™T¤ —qc™ª™¤ šn™d¤ §n°c—q˜A¡>—©¤ —qQœq¤ ¢ªn›1¦S¦SžA˜A™1®

vi 004–2165–002
About This Guide

¹–+¥G±/\G¥;¶ \;¹ ÑS¢y§³=˜AŸ&™G˜Aœq«5§+¢?šn›1¤I˜A§+œ‰›1£§S¤a¤ —qc¦@§¢?¤I›1£˜AžA˜A¤ ª‰§+«a›


S¤I˜AžA˜A¤ ªn§+¢e¢y§S¤ ˜Aœq=®
\GÒ&¹¬O¶aµ5ÑS–&µ5½;± \G˜A™¡wS™™™d¤ —qQœq¤ ¢ª‰˜Aœ©ŸS¤I›8˜Ažy®
±c½;–&Ò&¹ ÑS¢y™œq¤ ™d˜A¤ šn™d§«¦S›1¢?¤I˜A¡>SžA›1¢C˜Ašn¦S§+¢¤ ›1œq¡>=®
¬/¥;úG–mµI½;±c¹ \G™¡>¢˜A£™d›1¡>¤I˜A§+œq™d¤ —q›1¤a¡>›1œ©Ÿ&™¤ ¢y§+ªnŸ&›1¤ ›É§¢
¦S¢y§+Ÿ&S¡>hSœqŸ&™˜A¢yŸ¢y™SžA¤ ™M®
G©¥;¶a±cµI±/Ed¹ \G™¡>¢˜A£™d›1¡>¤I˜A§+œq™d¤ —q›1¤a¡>›1œ©—q›1¢?š÷¦@§¦@žA¿
JO=S˜A¦@šnœq¤I¿@§+¢e™ª™¤ šü™§+«I¤I°c›1¢y®
Ò&±=VCµ5¶K½;±cÓÒ&±c– \G™¡>¢˜A£™d¦S¢yŸ&JRSœqŸ™—qžAž]³=›1¢?˜A›1£žA™T¤ —q›1¤
VS¥G¶KµI¥)^&¨&Ò&¹ Ÿ&¤ ¢?šn˜Aœqh™§+šnQ¡>—q›1¢?›1¡>¤I¢˜A™¤ ˜A¡w™P§«g¤ —qQ™—qžAž]§¢/¤ —q›1¤
›1««I¡w¤¤I—qh£—q›1³=˜A§+¢C§«™§+šnh¦S¢y§+¯¢›1šn™¿@¡>§+šnšn›1œqŸ&™¿
§+¢eS¤I˜AžA˜A¤ ˜A™1®
¶aÒ&–&ú;¶a±_VS¥G¨&úGÒ&¹ \G™¡>¢˜A£™d¦S§™™˜A£žAQ¢y¤IS¢?œÀ³=›1žAS™d¤I—q›1¤]˜AœqŸ&˜A¡>›1¤Ic›
žA˜A£¢?›1¢ª‰§¢/™ª=™¤ šý¡>›1žAžmôM¡>S¤IŸ™S¡>¡w™™«ISžAžAª>¿q§+¢
˜AŸ&œq¤ ˜QRS™G¤ —qQ¢?¢y§+¢T¡>§œqŸS˜A¤I˜A§+œ´SœqŸ&¢O°c—q˜A¡>—À˜A¤
«I›1˜AžAŸ`®
Ò&·aµ5–Ž¹–+¥/–&ú;¹ \G™¡>¢˜A£™d¦S§™™˜A£žAQô˜A¤a™¤I›1¤ S™d³=›1žAS™d¤ —q›1¤a˜AœqŸ&˜A¡>›1¤I
°c—q¤ —q¢O¤I—qh¡>§šnšn›1œqŸ´§¢eS¤ ˜AžA˜A¤IªoôM¡>S¤IŸ
™S¡w¡>™™«ISžAžAª®
ÓÒ&¹¹2¥EdÒ&¹ \G™¡>¢˜A£™d˜Aœq«5§+¢?šn›1¤I˜A§+œq›1žA¿qŸ&˜A›8¯=œq§+™¤I˜A¡>¿q›1œqŸ¢?¢y§+¢
šn™™›1¯™d¤ —q›1¤ašn›1ªn›1¦@¦S›1¢®S¹žA«IõIôM¦SžA›1œq›1¤ §¢?ª
šn™™›1¯™d›1¢y%œq§+¤žA˜A™¤ Ÿ`®
Ò&¶a¶K½;¶K¹ \G§¡>Sšnœ¤I™d¢¢y§+¢T¡>§+Ÿ&™1®m¥G¦S¦SžA˜A™T§+œqžAª‰¤ §n™ª=™¤ š
¡>›1žAžA™1®
»½;¶m–&¶K¥G± \G™¡>¢˜A£™d—q§° ¤I§‹¡w›8žAžm›{™ª=™¤Išü¡>›1žAžm«I¢y§+šý»§¢?¤I¢?›1œa®
Ò&·a–&Ò&±c¹µ5½;±c¹ ¥;¦@¦SžA˜A™d§œqžAªð¤I§o™ª™¤Išø¡w›8žAžA™M®
^&úEd¹ µ5œqŸS˜A¡w›8¤I™dùœq§°cœo£S¯™G›1œqŸŸSJRS¡w˜Aœq¡w˜A™M®
Ò&·a¥;ÓÑS¨&Ò&¹ ¹—q§°c™dôM›1šn¦SžA™d§+«aS™›1¯=®
»µ5¨&Ò&¹ ¨&˜A™¤I™HRSžA™G¤ —q›1¤^›8¢yh˜A¤I—q¢T¦@›1¢¤K§+«a¤ —qQœq¤ ¢ªn§¢e›8¢y
¢yžA›8¤IŸ¤I§‹˜A¤F®

004–2165–002 vii
Application Programmer’s Library Reference Manual, Volume 2

¹Ò&Ҏ¥G¨&¹½ ¨&˜A™¤I™Pœq¤ ¢˜A™P›1œqŸÀ¦SS£žA˜A¡w›8¤I˜A§+œq™;¤ —q›1¤^¡>§+œq¤I›1˜Aœ´¢yžA›1¤IŸ


˜Aœq«I§¢?šn›1¤ ˜A§œa®

Reader Comments
µI«gª§+—q›8³Q¡w§+šnšnœq¤ ™P›8£=§+S¤a¤I—qQ¤ ¡>—qœq˜A¡>›1ž^›1¡>¡>S¢›8¡wª¿S¡>§œq¤ œq¤ ¿§¢C§¢y¯›1œq˜QP1›1¤ ˜A§+œ´§+«
¤ —q˜A™;ŸS§¡>Sšnœq¤ ¿@¦@žA›1™%¤IžAžmS™1®Y^&c™S¢yh¤ §n˜Aœq¡>žASŸ&L¤ —qc¤ ˜A¤IžA%›8œqŸ¦S›1¢?¤œqSšn£¢C§«
¤ —qcŸS§¡>Sšnœq¤^°c˜A¤I—Àª§S¢C¡>§šnšnœq¤I™1®
I§¡>›1œ©¡>§œq¤ ›1¡>¤S™G˜Aœ©›1œqª‰§+«a¤ —qh«5§+žAžA§+°c˜Aœq¯‰°c›1ª™1þ
ÿ ¹œqŸõIšn›1˜Ažm¤ §n¤ —qQ«I§žAžA§+°c˜Aœq¯n›1Ÿ&Ÿ&¢y™™1þ

techpubs@sgi.com
ÿ ¹œqŸ›h«I›1ôɤ §n¤ —qh›1¤I¤ œq¤ ˜A§œ©§+« T8–M¡>—qœq˜A¡w›8ž]ÑSS£žA˜A¡w›8¤I˜A§+œq™XWc›1¤Fþ M ÍNK8î1ìcÏ1­1Îhì1ó1ì1Íq®
ÿ ú;™L¤I—qh»Ÿ&£›1¡>ùn§+¦S¤I˜A§+œ©§œ´¤ —qQ–M¡w—qœq˜A¡>›1žmÑSS£=žA˜A¡>›1¤ ˜A§+œq™;¨S˜A£=¢?›1¢?ª<G‰§+¢žAŸ`G˜AŸ&
G‰£‰¦@›1¯=þ

http://techpubs.sgi.com
ÿ ¬O›8žAžm¤I—qQ–¡>—qœq˜A¡w›8ž]ÑSS£žA˜A¡w›8¤I˜A§+œq™HEd¢y§+S¦S¿@¤ —q¢y§+S¯=—©¤I—qh–M¡w—qœq˜A¡>›1žm¥;™™˜A™¤I›1œq¡>
¬Oœq¤I¢ ¿S™˜Aœq¯‰§+œqh§«¤I—qQ«I§+žAžA§°c˜Aœq¯nœqSšn£¢?™Mþ
»§¢C¹LEdµaµI¶KµI·ò£›1™ŸŽ§+¦S¢?›1¤I˜Aœq¯‹™ª™¤Išn™Mþ&Íhó1ì1ìhó1ì1ìÉÐ1¹FEdµ
»§¢Cú;±cµI¬O½;¹É§+¢eúG±cµ5¬/½L¹Sûšnùn£›1™Ÿ§¦S¢›1¤ ˜Aœq¯n™ª™¤ šn™d§+¢e¬O¢?›1ª‹½L¢?˜A¯˜AœÀÎ1ì1ì1ì
™ª=™¤ šn™1þmÍhó8ì1ìcÏ1î1ìhÎ1í1Î1Ï ¤I§+žAžm«5¢yh«I¢y§+šý¤ —qQú;œq˜A¤ Ÿ¹¤ ›1¤I™d›1œqŸŽ¬O›8œq›1Ÿ&›1¼^§¢
º
M ÍNK1î1Í=K1ó1­cîK8ì1ì
ÿ ¹œqŸšn›1˜Až&¤ §n¤ —qc«I§+žAžA§°c˜Aœq¯n›1Ÿ&Ÿ&¢y™™1þ
–1¡>—qœq˜A¡w›8ž]ÑSS£žA˜A¡w›8¤I˜A§+œq™
¹FEdµ
ÍK1ì8ì{¥Gšn¦S—q˜A¤I—q›1¤I¢yQÑSù=°cª®
Ó§Sœq¤ ›1˜AœaVK˜A°T¿q¬O›8žA˜A«5§+¢?œq˜A›cÏ1Ð1ì1Ð8­1ë1Í1­1î1Í
G©h³=›1žAS%ª§+S¢e¡>§šnšnœq¤I™T›1œqŸ°c˜AžAž]¢y™¦S§+œqŸ¤I§‹¤I—qšü¦@¢y§šn¦S¤ žAª2®

viii 004–2165–002
CONTENTS

Conversion routines

intro_conversion, INTRO_CONVERSION ....... Introduction to conversion routines ........................................................... 327


b2oct, B2OCT ........................................................... Places an octal Hollerith representation of a Cray Research numeric
value into a specified part of an integer array .......................................... 333
cdc2cray, CDC2CRAY, CRAY2CDC ........................ Converts CDC data to Cray Research format and vice versa ................... 335
chconv, CHCONV ...................................................... Converts decimal ASCII numerals to an integer value ............................. 338
cri2cray, CRI2CRAY, CRAY2CRI ........................ Converts IEEE/MPP 64-bit data to Cray Research PVP 64-bit data
and vice versa ............................................................................................ 340
cri2ibm, CRI2IBM, IBM2CRI ............................... Converts Cray Research IEEE Fortran data types to IBM
(360/370-style) Fortran data types ............................................................. 343
cri2ieg, CRI2IEG, IEG2CRI ............................... Converts Fortran data types between Cray IEEE and generic IEEE
data types ................................................................................................... 346
cry2cri, CRY2CRI, CRI2CRY ............................... Converts Fortran data types between Cray floating-point and IEEE
floating-point systems ................................................................................ 349
cry2mips, CRY2MIPS, MIPS2CRY ........................ Converts Fortran data types between Cray Fortran data types and
MIPS IEEE Fortran data types .................................................................. 352
dsasc, DSASC, ASCDC ............................................. Converts CDC display code character to ASCII character and vice
versa ........................................................................................................... 355
eta2cray, ETA2CRAY, CRAY2ETA ........................ Converts ETA/CYBER 205 data to Cray Research format and vice
versa ........................................................................................................... 356
fp6064, FP6064, FP6460 ...................................... Converts between CDC 60-bit and Cray Research 64-bit numbers ......... 359
ibm2cray, IBM2CRAY, CRAY2IBM ........................ Converts IBM data to Cray Research format and vice versa ................... 360
ieg2cray, IEG2CRAY, CRAY2IEG ........................ Converts IEEE/Generic 32-bit data to Cray Research 64-bit data and
vice versa ................................................................................................... 363
ieg2cri_77, IEG2CRI_77, CRI2IEG_77 .......... Converts IEEE 32-bit data to Cray Research IEEE 64-bit data and
vice versa ................................................................................................... 366
ieg2mips, IEG2MIPS, MIPS2IEG ........................ Converts generic IEEE data to MIPS IEEE data and vice versa .............. 369
ieu2cray, IEU2CRAY, CRAY2IEU ........................ Converts DEC ULTRIX/generic little-endian 32-bit data to Cray
Research 64-bit data and vice versa .......................................................... 372
int6064, INT6064 .................................................. Converts CDC 60-bit integers to Cray Research 64-bit integers .............. 375
int6460, INT6460 .................................................. Converts Cray Research 64-bit integers to CDC 60-bit integers .............. 376
nve2cray, NVE2CRAY, CRAY2NVE ........................ Converts NOS/VE data to Cray Research format and vice versa ............ 377
rbn, RBN, RNB ........................................................... Converts trailing blanks to nulls and vice versa ....................................... 380
uscctc, USCCTC, USCCTI ...................................... Converts EBCDIC character data to ASCII character data, and vice
versa ........................................................................................................... 381
usdctc, USDCTC ...................................................... Converts IBM 64-bit floating-point numbers to Cray Research 64-bit,
single-precision numbers ........................................................................... 383
usdcti, USDCTI ...................................................... Converts Cray 64-bit single-precision, floating-point numbers to IBM
64-bit double-precision numbers ............................................................... 384
usictc, USICTC, USICTI ...................................... Converts between IBM INTEGER*2/INTEGER*4 and Cray Research
64-bit integer numbers ............................................................................... 385
usictp, USICTP ...................................................... Converts a Cray Research 64-bit integer to an IBM packed-decimal
field ............................................................................................................ 387
uslctc, USLCTC, USLCTI ...................................... Converts between IBM LOGICAL*1/LOGICAL*4 and Cray
Research 64-bit logical values ................................................................... 388
uspctc, USPCTC ...................................................... Converts specified number of bytes of IBM packed-decimal field to
64-bit integer field ..................................................................................... 389

004– 2165– 002 ix


ussctc, USSCTC ...................................................... Converts IBM 32-bit floating-point numbers to Cray Research 64-bit
single-precision numbers ........................................................................... 390
usscti, USSCTI ...................................................... Converts Cray Research 64-bit single-precision, floating-point
numbers to IBM 32-bit single-precision numbers ..................................... 391
vax2cray, VAX2CRAY, CRAY2VAX ........................ Converts VAX data to Cray Research format and vice versa .................. 393
vax2mips, VAX2MIPS, MIPS2VAX ........................ Converts generic IEEE data to MIPS IEEE data and vice versa .............. 396
vxdctc, VXDCTC ...................................................... Converts VAX 64-bit, D-format numbers to Cray Research 64-bit
single-precision numbers ........................................................................... 399
vxdcti, VXDCTI ...................................................... Converts Cray Research 64-bit single-precision, floating-point (real)
numbers to VAX D-format, 64-bit, double-precision, floating-point
numbers ..................................................................................................... 400
vxgctc, VXGCTC ...................................................... Converts VAX 64-bit G-format numbers to Cray Research 64-bit
single-precision numbers ........................................................................... 402
vxgcti, VXGCTI ...................................................... Converts Cray Research 64-bit single-precision, floating-point (real)
numbers to VAX G-format, 64-bit, single-precision, floating-point
numbers ..................................................................................................... 403
vxictc, VXICTC ...................................................... Converts VAX INTEGER*2 (16 bits) or INTEGER*4 (32 bits) to
Cray Research 64-bit integers ................................................................... 405
vxicti, VXICTI ...................................................... Converts Cray 64-bit integers to VAX INTEGER*2 (16 bit) or
INTEGER*4 (32 bit) numbers .................................................................. 406
vxlctc, VXLCTC ...................................................... Converts VAX 32-bit logical numbers to Cray Research 64-bit
logical numbers ......................................................................................... 408
vxlcti, VXLCTI ...................................................... Converts Cray Research 64-bit logical numbers to VAX 32-bit
logical numbers ......................................................................................... 409
vxsctc, VXSCTC ...................................................... Converts VAX 32-bit floating-point numbers to Cray Research 64-bit
single-precision real numbers .................................................................... 410
vxscti, VXSCTI ...................................................... Converts Cray Research 64-bit single-precision, floating-point (real)
numbers to VAX F format, 32-bit, single-precision, floating-point
numbers ..................................................................................................... 411
vxzctc, VXZCTC ...................................................... Converts VAX 64-bit complex numbers to Cray Research 128-bit
complex numbers ....................................................................................... 413
vxzcti, VXZCTI ...................................................... Converts Cray Research 128-bit complex numbers to VAX 64-bit
complex numbers ....................................................................................... 414

Interface routines
intro_interface, INTRO_INTERFACE ............ Introduction to system interface routines .................................................. 417
abort, ABORT ...........................................................
Requests abort with traceback ................................................................... 419
clearbt, CLEARBT, SETBT .................................... Temporarily disables or enables bidirectional memory transfers .............. 420
clearfi, CLEARFI, SENSEFI, SETFI ................. Modifies floating-point interrupt status ..................................................... 421
errexit, ERREXIT .................................................. Requests abort ........................................................................................... 422
exit, EXIT ................................................................
Exits from a Fortran program ................................................................... 423
getcwd, GETCWD ...................................................... Returns the current working directory ...................................................... 424
gethost, GETHOST .................................................. Returns name of host mainframe .............................................................. 425
getoarg, GETOARG .................................................. Gets command-line arguments .................................................................. 426
getoargc, GETOARGC ............................................. Gets command-line arguments .................................................................. 427
getvarg, GETVARG .................................................. Gets command-line arguments, allowing blanks or commas as
delimiters ................................................................................................... 428
getvargc, GETVARGC ............................................. Gets command-line arguments, allowing blanks or commas as
delimiters ................................................................................................... 429
iargc, IARGC, GETARG ........................................... Returns number of command-line arguments or the argument itself ....... 430
ishell, ISHELL ...................................................... Executes a UNICOS shell command ........................................................ 431

x 004– 2165– 002


nlimit, NLIMIT ...................................................... Provides an interface to setting or obtaining resource limit values .......... 432
remark, REMARK, REMARK2 .................................... Enters a message in the stderr file ....................................................... 437
remarkf, REMARKF .................................................. Enters a formatted message in the stderr file ....................................... 438
samefile, SAMEFILE ............................................. Checks to see whether two files have the same inode number ................ 440
sensebt, SENSEBT .................................................. Determines if bidirectional memory transfer is enabled or disabled ........ 441
uname, UNAME ........................................................... Returns name of current operating system (Fortran interface to
uname(2)) ................................................................................................. 442

Heap routines
intro_heap, INTRO_HEAP ................................... Introduction to heap, table, and data segment management ..................... 445
craydump, CRAYDUMP ............................................. Dump arrays of memory ........................................................................... 449
hpalloc, HPALLOC .................................................. Allocates a block of memory from the heap ............................................ 450
hpcheck, HPCHECK .................................................. Checks the integrity of the heap ............................................................... 451
hpclmove, HPCLMOVE ............................................. Extends a block or copies the contents of the block into a larger
block .......................................................................................................... 452
hpdeallc, HPDEALLC ............................................. Returns a block of memory to the list of available space (the heap) ....... 453
hpdump, HPDUMP ...................................................... Dumps the address and size of each heap block ...................................... 454
hpnewlen, HPNEWLEN ............................................. Changes the size of an allocated heap block ............................................ 455
hpshrink, HPSHRINK ............................................. Returns memory from the heap to the operating system .......................... 456
ihplen, IHPLEN ...................................................... Returns the length of a heap block ........................................................... 457
ihpvalid, IHPVALID ............................................. Returns validity of block address .............................................................. 458
tmadw, TMADW ........................................................... Adds a word to a table .............................................................................. 459
tmamu, TMAMU ........................................................... Reports table management operation statistics .......................................... 460
tmats, TMATS ........................................................... Allocates table space ................................................................................. 461
tminit, TMINIT ...................................................... Initializes table descriptor vector and zeroes table length vector ............. 462
tmmsc, TMMSC ........................................................... Searches the table by using a mask to locate a specific field within an
entry using an optional offset .................................................................... 463
tmmve, TMMVE ........................................................... Moves memory (words) ............................................................................ 464
tmptc, TMPTC ........................................................... Processes table collisions .......................................................................... 465
tmpts, TMPTS ........................................................... Presets table space ..................................................................................... 466
tmsrc, TMSRC ........................................................... Searches the table by using optional mask to locate specific field
within entry and offset .............................................................................. 467
tmvsc, TMVSC ........................................................... Searches a vector table for the search argument ....................................... 468

Programming Aid routines


intro_progaids, INTRO_PROGAIDS ................. Introduction to programming aids ............................................................. 469
auxstat, AUXSTAT .................................................. Gives the number of reads and writes to SDS that have occurred
while accessing auxiliary array variables .................................................. 473
bitvec, BITVEC ...................................................... Generates a bit mask corresponding to integer or real arrays
according to a specified condition ............................................................. 474
bitvecm, BITVECM .................................................. Generates a bit mask corresponding to masked integer arrays
according to a specified condition ............................................................. 477
byt, PUTBYT, IGTBYT ............................................. Replaces a byte in a variable or an array ................................................. 479
dtts, DTTS ................................................................ Converts ASCII date and time to time stamp ........................................... 480
fsigctl, FSIGCTL .................................................. Specifies action on receipt of signal ......................................................... 481
getcallerinfo, GETCALLERINFO ..................... Returns the name and line number of the calling routine ........................ 483
getpmc, GETPMC, GETTMC, GETHMC ..................... Returns 128-word output array describing machine characteristics .......... 485
iceil, ICEIL ........................................................... Returns integer ceiling of a rational number ............................................ 487
icpused, ICPUSED .................................................. Gets task CPU time in real-time clock (RTC) ticks ................................. 488
mov, STRMOV, MOVBIT, MOVBITZ .......................... Moves bytes or bits from one variable or array to another ...................... 489

004– 2165– 002 xi


mtts, MTTS ................................................................ Converts machine time (real-time clock value) to time stamp ................. 492
mvc, MVC .................................................................... Moves characters from one memory area to another ................................ 493
pack, PACK ................................................................ Compresses stored data ............................................................................. 494
p32, P32, U32 ........................................................... Packs or unpacks 32-bit words into or from Cray 64-bit words .............. 496
p6460, P6460, U6064 ............................................. Packs or unpacks 60-bit words into or from Cray 64-bit words .............. 497
reprieve, REPRIEVE ............................................. Describes error handling under the UNICOS and UNICOS/mk
operating system ........................................................................................ 498
second, SECOND ...................................................... Returns elapsed CPU time ........................................................................ 500
secondr, SECONDR .................................................. Returns elapsed wall-clock time in seconds .............................................. 502
setplimq, SETPLIMQ ............................................. Initiates a detailed tracing of each call and return .................................... 503
shutdsav, SHUTDSAV ............................................. Sets up the calling program to be checkpointed on system shutdown ..... 504
sigoff, SIGOFF, SIGON ........................................ Controls receipt of signals ......................................................................... 506
stop_all, STOP_ALL ............................................. Stops all PEs in an application .................................................................. 507
symdebug, SYMDEBUG ............................................. Produces a symbolic snapshot of a running process ................................. 508
symdump, SYMDUMP .................................................. Produces a symbolic snapshot dump of a running program ..................... 511
sysclock, SYSCLOCK ............................................. Returns real-time clock value and number of wraps ................................ 516
timef, TIMEF ........................................................... Returns elapsed wall-clock time in milliseconds since the previous
call to TIMEF ............................................................................................ 517
tracebk, TRACEBK .................................................. Prints a traceback ...................................................................................... 518
trbk, TRBK ................................................................ Lists all subroutines active in the current calling sequence ...................... 520
trbklvl, TRBKLVL .................................................. Returns information on current level of calling sequence ........................ 521
tremain, TREMAIN .................................................. Returns the CPU time (in seconds of type real) remaining for the
program ...................................................................................................... 523
trimlen, TRIMLEN .................................................. Returns the length of a character argument without counting trailing
blanks ......................................................................................................... 524
tsecnd, TSECND ...................................................... Returns elapsed CPU time for a calling task or process .......................... 526
tsdt, TSDT ................................................................ Converts time stamps to ASCII date and time strings .............................. 528
tsmt, TSMT ................................................................ Converts time stamp to machine time (real-time clock value) ................. 529
unitts, UNITTS ...................................................... Returns time-stamp units in specified standard-time units ........................ 530
unpack, UNPACK ...................................................... Expands stored data ................................................................................... 531
xpfmt, XPFMT ........................................................... Produces a printable image of an exchange package ................................ 532

Synch routines
intro_sync, INTRO_SYNC ................................... Introduction to synchronization routines ................................................... 535
clear_event ........................................................... Clears an event and returns control to the calling PE .............................. 536
set_barrier ........................................................... Registers the arrival of a PE at a barrier .................................................. 539
set_event ................................................................ Posts an event and returns control to the calling PE ................................ 540
test_barrier ......................................................... Tests a barrier to determine its state (set or cleared) ................................ 542
test_event ............................................................. Returns the state of an event, either posted or cleared ............................. 543
wait_barrier ......................................................... Suspends PE execution until all PEs arrive at the barrier ........................ 544
wait_event ............................................................. Delays the calling PE until the eureka event is posted ............................. 545

Search/sort routines
intro_sortsearch, INTRO_SORTSEARCH ....... Introduction to sorting and searching routines .......................................... 547
cluseq, CLUSEQ, CLUSNE ...................................... Searches a vector for clusters of values equal or not equal to a target .... 551
clusflt, CLUSFLT, CLUSFLE, CLUSFGT,
CLUSFGE .................................................................... Searches a real vector for clusters of values with a specified logical
relationship to a real target ........................................................................ 553

xii 004– 2165– 002


clusilt, CLUSILT, CLUSILE, CLUSIGT,
CLUSIGE .................................................................... Searches an integer vector for clusters of values with a specified
logical relationship to an integer target ..................................................... 555
iilz, IILZ, ILLZ, ILSUM ...................................... Returns number of leading occurrences of an object in a vector ............. 557
inflmax, INFLMAX, INFLMIN ............................... Searches for the maximum or minimum value in subfields of a vector
element ...................................................................................................... 559
intmax, INTMAX, INTMIN ...................................... Searches an integer vector for the maximum or minimum value ............. 561
isamax, ISAMAX, ICAMAX, ISAMIN ..................... Searches a vector for the first occurrence of the maximum or
minimum absolute value ............................................................................ 562
ismax, ISMAX, ISMIN ............................................. Searches a real vector for the first occurrence of the maximum or
minimum value .......................................................................................... 564
isortd, ISORTD ...................................................... Performs a distribution counting sort on the elements of an integer
vector ......................................................................................................... 566
isrcheq, ISRCHEQ, ISRCHNE ............................... Searches a vector for the first element equal or not equal to a target ...... 571
isrchflt, ISRCHFLT, ISRCHFLE, ISRCHFGT,
ISRCHFGE .................................................................. Searches a real vector for the first element with a specified logical
relationship to a real target ........................................................................ 573
isrchilt, ISRCHILT, ISRCHILE, ISRCHIGT,
ISRCHIGE .................................................................. Searches an integer vector for the first element with a specified
logical relationship to an integer target ..................................................... 575
isrchmeq, ISRCHMEQ, ISRCHMNE ........................ Searches a vector for the first element whose subfield is equal or not
equal to a target ......................................................................................... 577
isrchmlt, ISRCHMLT, ISRCHMLE, ISRCHMGT,
ISRCHMGE .................................................................. Searches a vector for the first element whose subfield has a specified
logical relationship with a target ............................................................... 579
orders, ORDERS ...................................................... Internal, fixed-length record-sorting routine optimized for Cray
Research systems ....................................................................................... 581
osrchi, OSRCHI, OSRCHF ...................................... Searches an ordered vector for the first location that contains a target .... 592
osrchm, OSRCHM ...................................................... Searches an ordered integer vector for the first element whose
subfield is equal to an integer target ......................................................... 594
ssortb, SSORTB, ISORTB ...................................... Performs Batcher’s Odd-Even Merge sort on the elements of a real or
integer general vector ................................................................................ 598
wheneq, WHENEQ, WHENNE ...................................... Searches a vector for all elements equal or not equal to a target ............ 605
whenflt, WHENFLT, WHENFLE, WHENFGT,
WHENFGE .................................................................... Searches a real vector for all elements with a specified logical
relationship to a real target ........................................................................ 607
whenilt, WHENILT, WHENILE, WHENIGT,
WHENIGE .................................................................... Searches an integer vector for all elements that have a specified
relationship to an integer target ................................................................. 609
whenmeq, WHENMEQ, WHENMNE ............................... Searches a vector for all elements whose subfields are equal or not
equal to a target ......................................................................................... 611
whenmlt, WHENMLT, WHENMLE, WHENMGT,
WHENMGE .................................................................... Searches a vector for all elements whose subfields have a specified
logical relationship with a target ............................................................... 613

Appendix A
cinter ....................................................................... Introduction to interfaces to C library routines ......................................... 615

004– 2165– 002 xiii


INTRO_CONVERSION ( 3F ) INTRO_CONVERSION ( 3F )

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 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 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; use 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 data types to IBM and IBM to Cray ) are listed under a single entry. Routine
descriptions follow later in this section, listed alphabetically by entry name.

004– 2165– 002 327


INTRO_CONVERSION ( 3F ) INTRO_CONVERSION ( 3F )

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-IEEE) CRAY2CRI and CRY2CRI CRI2CRAY and CRI2CRY
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-IEEE) CRY2CRI CRI2CRY


IBM IBM2CRI CRI2IBM
Generic IEEE (32-bit) IEG2CRI CRI2IEG
User conversion USR2CRAY CRAY2USR
Site conversion STE2CRAY CRAY2STE

328 004– 2165– 002


INTRO_CONVERSION ( 3F ) INTRO_CONVERSION ( 3F )

Conversion routines on IRIX systems (MIPS)

Name Foreign->Native Native->Foreign

Cray PVP systems (non-IEEE) CRY2MIPS MIPS2CRY


User conversion USR2CRAY CRAY2USR
Site conversion STE2CRAY CRAY2STE
IEEE Fortran converson IEG2MIPS MIPS2IEG
VAX Fortran conversion VAX2MIPS MIPS2VAX

Superseded routines: Foreign to Cray


The following table lists superseded, older routines that are supported to maintain continuity. Use the newer
routines named in the preceding list.

Conversion IBM CDC VAX/VMS

Foreign single precision to Cray single precision USSCTC FP6064 VXSCTC


Foreign double precision to Cray single precision USDCTC --- VXDCTC
VXGCTC
Foreign double precision to Cray double --- --- VXBCTC
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 precision --- --- VXZCTC
IBM packed-decimal field to Cray integer USPCTC --- ---

Superseded routines: Cray to Foreign


The following routines convert Cray 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)

004– 2165– 002 329


INTRO_CONVERSION ( 3F ) INTRO_CONVERSION ( 3F )

The following table lists older routines that convert Cray types to foreign types. These routines are
supported to maintain continuity; use the newer routines named in the preceding list rather than these
routines.

Conversion IBM CDC VAX/VMS

Cray single precision to foreign single precision USSCTI FP6460 VXSCTI


Cray single precision to foreign double precision USDCTI --- VXDCTI,
VXGCTI
Cray double precision to foreign double precision --- --- VXBCTI
Cray integer to foreign integer USICTI INT6460 VXICTI
Cray logical to foreign logical USLCTI --- VXLCTI
ASCII character to foreign character USCCTI ASCDC ---
Cray complex to foreign complex --- --- VXZCTI
Cray integer to foreign packed-decimal field USICTP --- ---

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

330 004– 2165– 002


INTRO_CONVERSION ( 3F ) INTRO_CONVERSION ( 3F )

The following table lists the ASCII conversion functions.

Purpose Name Argument range Result

Binary to decimal ASCII BTD 0 ≤ x ≤ 99999999 One-word ASCII string


(right-justified, blank-filled) (right-justified, blank-
filled)
Binary to decimal ASCII BTDL 0 ≤ x ≤ 99999999 One-word ASCII string
(left-justified, zero-filled) (left-justified, zero-
filled)
Binary to decimal ASCII BTDR 0 ≤ x ≤ 99999999 One-word ASCII string
(right-justified, zero-filled) (right-justified, zero-
filled)
Binary to octal ASCII BTO 0 ≤ x ≤ 77777777 8 One-word ASCII string
(right-justified, blank-filled) (right-justified, blank-
filled)
Binary to octal ASCII (left- BTOL 0 ≤ x ≤ 77777777 8 One-word ASCII string
justified, zero-filled) (left-justified, zero-
filled)
Binary to octal ASCII BTOR 0 ≤ x ≤ 77777777 8 One-word ASCII string
(right-justified, zero-filled) (right-justified, zero-
filled)
Decimal ASCII to binary DTB Decimal ASCII One word containing
(left-justified, zero- decimal equivalent of
filled) ASCII string
Octal ASCII to binary OTB Octal ASCII (left- One word containing
justified, zero-filled) octal equivalent of
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

004– 2165– 002 331


INTRO_CONVERSION ( 3F ) INTRO_CONVERSION ( 3F )

• 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 PVP 64-bit data
• CRAY2CRI: Converts Cray 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

332 004– 2165– 002


B2OCT ( 3F ) B2OCT ( 3F )

NAME
B2OCT – Places an octal Hollerith representation of a Cray numeric value into a specified part of an integer
array

SYNOPSIS
CALL B2OCT(s, j, k, v, n)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
B2OCT puts an octal Hollerith representation of a Cray numeric value into a specified part of an integer
array.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
s An integer array to contain the octal Hollerith representation of the integer input value.
j An integer variable, expression, or constant specifying the byte offset within array s where the
first character of the octal representation is to be placed. A value of 1 indicates that the
destination begins with the first (leftmost) byte of the first word of s. j must be greater than 0.
k An integer variable, expression, or constant containing the number of characters used in the
Hollerith representation; k must be greater than 0. k indicates the size of the total area to be
filled, and the area is blank-filled if necessary.
v An integer variable, expression, or constant containing a value to be converted. The low-order n
bits of word v are used to form the Hollerith representation. The value in v must be less than or
63
equal to 2 – 1.
n An integer variable, expression, or constant containing the number of low-order bits of v to
convert to octal Hollerith character representation; n must be within the range: 1 ≤ n ≤ 64. If
insufficient space is available in s (3k<n), the specified region in s is automatically filled with
asterisks (*).
B2OCT places the octal Hollerith representation of the low-order n bits of a full Cray word into a specified
part of s. The k bytes in array s, pointed to by j, are first set to Hollerith blanks. The low-order n bits of v
are then converted to octal Hollerith, using leading zeros if necessary. The converted value (n/3 bytes,
rounded up) is right-justified in the blanked-out destination area of s.

004– 2165– 002 333


B2OCT ( 3F ) B2OCT ( 3F )

The B2OCT routine is an internal library routine that may not be available in a future release. Use the octal
(O) edit descriptor with an internal file to create the octal representation of a numeric value. An example of
the O edit descriptor with an internal file is:
progra m tes tf
intege r iva r
character *22 cva r(2 )
iva r=1234567 89
write(cva r,2 ) iva r,i var
2 for mat (o2 2/o 22.15)
pri nt *,’cvar(1 )=’ ,cv ar( 1)
print *,’ cva r(2)=’ ,cv ar( 2)
end

The octal values in cvar are:


cvar(1)=0000 000 000000 726 746 425
cvar(2 )= 000 000 726 746 425

334 004– 2165– 002


CDC2CRAY ( 3F ) CDC2CRAY ( 3F )

NAME
CDC2CRAY, CRAY2CDC – Converts CDC data to Cray format and vice versa

SYNOPSIS
INTEGER CDC2CRAY
iret=CDC2CRAY(type, num, foreign, bitoff, cray[, strd[, craychar]])
INTEGER CRAY2CDC
iret=CRAY2CDC(type, num, foreign, bitoff, cray[, strd[, craychar]])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
CDC2CRAY converts CDC data to Cray format. It accepts as input a bit string starting at the first element of
the array or variable foreign, at bit bitoff, and converts the data according to type, placing the converted data
in cray.
CRAY2CDC converts Cray data to CDC format. It accepts as input a bit string starting at the first element of
the array or variable cray(1) and converts the data according to type, placing the converted data in foreign at
bit bitoff.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
type Type integer. The variable type code used by the libraries. The following lists these codes and
shows the corresponding CDC and Cray formats (and the formats’ mapping to one another). In
the real, double, and complex conversions between CDC and the Cray format, all of the bits in
the mantissas are retained; neither rounding nor truncation are required.

Code CDC Cray CDC2CRAY CRAY2CDC

1 INTEGER(60-bit) INTEGER(64-bit)
2 REAL(60-bit) REAL(64-bit) Neither Neither
3 DOUBLE(120-bit) DOUBLE(128-bit) Neither Neither
4 COMPLEX(2x60-bit) COMPLEX(2x64-bit) Neither Neither
5 LOGICAL(60-bit) LOGICAL(64-bit)
6 CHARACTER CHAR (ASCII)(8-bit)
(Display code)
7 INTEGER(60-bit) INTEGER(24)(64-bit)

004– 2165– 002 335


CDC2CRAY ( 3F ) CDC2CRAY ( 3F )

num Type integer variable, array, or constant. Number of data items to convert.
foreign CDC2CRAY: Variable or array of any noncharacter type and of any length containing the CDC
format data to convert.
CRAY2CDC: Variable or array of any noncharacter type and of any length to receive the
converted CDC data.
bitoff Type integer variable, expression, or constant in the range 0 ≤ bitoff ≤ 63.
CDC2CRAY: Bit number within foreign to begin the conversion
CRAY2CDC: Bit number within foreign to place the converted data
Bits are numbered from 0, beginning at leftmost bit of foreign. (Bit 0 is the sign bit.)
cray Variable or array of any noncharacter type and of any length containing the Cray format data,
word-aligned.
strd Type integer variable, expression, or constant.
CDC2CRAY: Memory increment for storing the conversion results in cray. If strd = 1, the items
are placed in contiguous memory locations in cray. If strd > 1, the items are placed in cray in
memory locations at intervals specified by strd. For example, if strd = 3, the input items are
stored in cray at locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are taken from foreign in a continuous bit stream.
CRAY2CDC: Memory increment for loading the Cray items to be converted. If strd = 1, the
items are taken from contiguous memory locations in cray. If strd > 1, the items are taken from
cray memory locations at intervals specified by strd. For example, if strd = 3, the items are
taken from cray locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are placed in foreign in a continuous bit stream.
For double-word items, this is a stride of items, not of words. Default stride for complex input
is 1. For data of type character, strd must equal 1.
Default value is 1.
This is an optional argument.
craychar Type Character*N. Variable or array containing the Cray format data. Must be used instead of
cray when the variable type is character. If craychar is supplied, cray is ignored. This is an
optional argument.

CAUTION
The foreign and cray variables should not be associated (aliased to each other).

336 004– 2165– 002


CDC2CRAY ( 3F ) CDC2CRAY ( 3F )

RETURN VALUES
The returned function values are as follows:
=0 All values converted without error.
<0 Error. An error was detected in the input parameters.

EXAMPLES
Example 1: The following code converts LENGTH CDC REAL(60-bit) numbers in array ACDC to Cray
REAL(64-bit) numbers and places the results in array ACRAY.
INT EGE R CDC 2CRAY
IRET=CDC2 CRA Y(2,LENGT H,A CDC ,0, ACR AY)
IF( IRE T.LT.0) GOTO 99 ! err or

Example 2: The following code converts the LENGTH CRAY REAL(64-bit) numbers in array ACRAY from
the previous example back to CDC REAL(60-bit) numbers and places the results in array ACDC2.
INT EGE R CRA Y2CDC
IRE T=C RAY2CDC(2 ,LE NGTH,A CDC2,0 ,ACRAY )
IF( IRE T.LT.0) GOTO 99 ! error

004– 2165– 002 337


CHCONV ( 3F ) CHCONV ( 3F )

NAME
CHCONV – Converts decimal ASCII numerals to an integer value

SYNOPSIS
CALL CHCONV(src, isb, num, ir)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
This routine converts decimal ASCII numerals to integer values.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine:
src A variable or array of type Hollerith containing ASCII data or blanks.
isb Starting character in the src string. Specify an integer variable, expression, or constant. Characters
are numbered from 1, beginning at the leftmost character position of src.
num Number of ASCII characters to convert. Specify an integer variable, expression, or constant.
ir Integer result.
Blanks in the input field are treated as zeros. A minus sign encountered anywhere in the input field
produces a negative result. Input characters other than blank, digits 0 through 9, a minus sign, or more than
one minus sign produce a fatal error.

338 004– 2165– 002


CHCONV ( 3F ) CHCONV ( 3F )

The CHCONV routine is an internal library routine that may not be available in future releases. Use an
internal file with a standard Fortran READ statement to convert the ASCII character representation to a
numeric value. An example of the READ statement with an internal file is:
pro gra m tes tf
rea l ava r
int ege r iva r
cha rac ter*22 cvar(2 )
cvar(1)=’ 123 456789 .012e0 ’
cvar(2)=’ 123 456789 ’
rea d(c var,2) ivar,i var
2 for mat (e2 2.1 0/i22)
print *,’ ava r=’,av ar
print *,’ iva r=’,iv ar
end

The value for avar is 123456789.012 and the value for ivar is 123456789.

004– 2165– 002 339


CRI2CRAY ( 3F ) CRI2CRAY ( 3F )

NAME
CRI2CRAY, CRAY2CRI – Converts IEEE/MPP 64-bit data to Cray PVP 64-bit data and vice versa

SYNOPSIS
INTEGER CRI2CRAY, ierr, type, num, foreign, bitoff, stride
CHARACTER * (*) nativech
DIMENSION foreign(*), native(*)
ierr = CRI2CRAY(type, num, foreign, bitoff, native[, stride[, nativech]])
INTEGER CRAY2CRI, ierr, type, num, foreign, bitoff, stride
CHARACTER * (*) nativech
DIMENSION foreign(*), native(*)
ierr = CRAY2CRI(type, num, foreign, bitoff, native[, stride[, nativech]])

IMPLEMENTATION
UNICOS and UNICOS/mk systems (deferred on Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
CRI2CRAY converts Fortran data types on Cray MPP systems (using IEEE floating-point representation) to
Cray PVP systems Fortran data types.
CRAY2CRI converts Cray PVP systems Fortran data types to Cray MPP systems (using IEEE floating-point
representation) Fortran data types.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
ierr An integer giving the returned function value, as follows:
<0 Parameter error; no translation performed.
=0 Translation complete; no errors.
>0 Translation complete; return value is the number of values that completely overflowed
(CRAY2CRI only).
type An integer giving the data type code, as follows (all float-to-float conversions are rounded):
Code Description
0 Typeless (no translation)
1 Integer
CRI2CRAY: 64-bit twos complement to 64-bit twos complement; no translation.
CRAY2CRI: 64-bit twos complement to 64-bit twos complement; no translation.

340 004– 2165– 002


CRI2CRAY ( 3F ) CRI2CRAY ( 3F )

2 Real
CRI2CRAY: 64-bit IEEE floating point to 64-bit, single-precision, Cray real numbers.
CRAY2CRI: 64-bit, single-precision, Cray real numbers to 64-bit IEEE floating point.
3 Double Precision
CRI2CRAY: 64-bit IEEE floating point to 128-bit, double-precision, Cray floating point.
CRAY2CRI: 128-bit, double-precision, Cray floating point to 64-bit IEEE floating point.
4 Complex
CRI2CRAY: 2 x 64-bit, single-precision, IEEE floating point to 2 x 64-bit,
single-precision, Cray floating point.
CRAY2CRI: 2 x 64-bit, single-precision, Cray floating point to 2 x 64-bit IEEE floating
point.
5 Logical
CRI2CRAY: 64-bit logical to 64-bit Cray logical; all nonzero values are converted to
Cray logical trues and all zero values are converted to Cray logical falses.
CRAY2CRI: 64-bit Cray logical to 64-bit logical; all negative Cray values are converted
to a value of 1, all positive Cray values remain unchanged.
6 Character
ASCII to ASCII; no translation.
7 Short integer
CRI2CRAY: 32-bit twos complement to 64-bit twos complement.
CRAY2CRI: 64-bit twos complement to 32-bit twos complement.
num An integer giving the number of data items to convert.
foreign Variable or array of any noncharacter type or length containing Cray PVP systems or Cray MPP
systems data, whichever is not native to the current system. This variable or array either receives
the converted data or contains data to be converted.
bitoff An integer giving the bit offset within foreign to begin the conversion. Bits are numbers from 0 to
63, beginning at the leftmost bit of foreign. Normally, bitoff is zero.
native Variable or array of any noncharacter type or length containing Cray PVP systems or Cray MPP
systems data, whichever is native to the current system. This variable or array either receives the
converted data or contains data to be converted. This may be a strided array. This variable should
be of a type corresponding to the type argument.
stride An integer variable or constant giving the memory increment for loading or storing data to the
native array. For two and four-word items (complex and double-precision), this is a stride of
items, not of words. For typeless, stride is always in words.
This parameter is ignored for CHARACTER (type = 6). Data in the foreign array is loaded or
stored in a continuous bit stream regardless of this parameter.
For 2-word items (complex and double precision), this is a stride of items, not of words. The
default value is 1.

004– 2165– 002 341


CRI2CRAY ( 3F ) CRI2CRAY ( 3F )

nativech Type Character.


CRI2CRAY: Optional character variable or array to receive the converted characters if type is 6
(character).
CRAY2CRI: Optional character variable or array containing the characters to be converted if type
is 6 (character).

CAUTION
The foreign and native variables should not be associated (aliased to each other).

342 004– 2165– 002


CRI2IBM ( 3F ) CRI2IBM ( 3F )

NAME
CRI2IBM, IBM2CRI – Converts Cray IEEE Fortran data types to IBM (360/370-style) Fortran data types

SYNOPSIS
INTEGER CRI2IBM, IBM2CRI
ierr= CRI2IBM(type, num, foreign, bitoff, native, stride, natlen, forlen [,nativech])
ierr= IBM2CRI(type, num, foreign, bitoff, native, stride, natlen, forlen [,nativech])

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
CRI2IBM converts Fortran data types for Cray MPP systems using IEEE into equivalent IBM
representation. The data consists of floating-point, integer, logical, and character representation.
IBM2CRI converts Fortran data types for Cray MPP systems using IEEE floating-point representation from
equivalent IBM representation.
A denormal is a signed value with the following magnitudes:
• 32-bit IEEE value: magnitude between 1.1 -38 and 0
• 64-bit IEEE value: magnitude between 2.2 -308 and 0
• 128-bit IEEE value: magnitude between 3.3 -4932 and 0
IBM2CRI converts input values which fall in the range of the denormal to zero.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk systems, the default kind is KIND=8 for
integer, real, complex, and logical arguments.
The following is a list of valid arguments for this routine.
type An integer giving the data type code, as follows:
1 Typeless (no translation): 32-bit, 64-bit, 128-bit, and 256-bit data items. natlen and forlen
must be equal. 32-bit typeless is not supported on Cray PVP systems and 256-bit typeless is
not supported on Cray MPP systems.
2 Integer
CRI2IBM: 32-bit or 64-bit twos complement to 64-bit, 32-bit, 16-bit or 8-bit twos
complement
IBM2CRI: 8-bit, 16-bit, 32-bit or 64-bit twos complement to 32-bit, or 64-bit twos
complement
3 Real

004– 2165– 002 343


CRI2IBM ( 3F ) CRI2IBM ( 3F )

CRI2IBM: 32-bit, 64-bit or 128-bit CRAY IEEE floating-point to 32-bit, 64-bit or 128-bit
IBM floating-point
IBM2CRI: 32-bit, 64-bit or 128-bit IBM floating-point to 32-bit, 64-bit or 128-bit CRAY
IEEE floating-point
4 Complex
CRI2IBM: 2 x 32-bit, 64-bit or 128-bit CRAY IEEE floating- point to 2 x 32-bit, 64-bit or
128-bit IBM floating-point
IBM2CRI: 2 x 32-bit, 64-bit or 128-bit IBM floating-point to 2 x 32-bit, 64-bit or 128-bit
CRAY IEEE floating-point
5 Logical
IBM2CRI: 32-bit or 64-bit zero/nonzero logical to 64-bit, 32-bit, 16-bit or 8-bit zero/nonzero
logical
CRI2IBM: 8-bit, 16-bit, 32-bit or 64-bit zero/nonzero logical to 32-bit or 64-bit
zero/nonzero logical
6 Character
CRI2IBM: ASCII to EBCDIC
IBM2CRI: EBCDIC to ASCII
The natlen and forlen arguments select the size of the data.
num The number of data items to convert. Type integer variable, expression, or constant.
foreign Variable or array of any noncharacter type or length containing IBM data. This variable or array
either receives the converted data or contains data to be converted.
bitoff An integer giving the bit offset within the foreign data variable or array to begin the conversion.
bitoff must be at least 0 and no more than 63. Bits are numbered from 0 to 63, beginning at the
leftmost bit of foreign.
native Variable or array that contains (or will contain) the native data. This variable or array either
receives the converted data or contains data to be converted. This variable should be of a type that
corresponds to the type argument. If type = 6 (character), this should be a dummy integer variable
and the optional nativech argument should be a character variable or array that contains (or will
contain) the native data. On Cray PVP systems which do not use Cray IEEE floating-point data,
native contains (or will contain) the Cray IEEE data.
stride An integer variable or constant giving the Memory increment for loading or storing data to the
native array. For two and four-word items (complex and double-precision) this is a stride of items,
not words. For typeless, stride is always in 64-bit words.
natlen Internal (native) storage length, in bits.
forlen External (foreign) storage length, in bits.

344 004– 2165– 002


CRI2IBM ( 3F ) CRI2IBM ( 3F )

nativech Optional character parameter specifying native ASCII character variable if it is of type 6. This
parameter is ignored if type is not character.

NOTES
Handling of IEEE denormalized numbers is controlled through a flag in the T@IEEE COMMON block (TASK
COMMON on Cray PVP systems). Setting the DENORM flag prevents any denormalized floating-point
numbers from being produced. The following example demonstrates this:
INTEGE R (KI ND= 4) DEN ORM , OVE RFLOW
COMMON /T@ IEEE/ DEN ORM , OVE RFL OW !MPP system s
TAS K COM MON /T@IEE E/ DEN ORM , OVE RFL OW !PV P sys tems
DEN ORM =1 !Flush den orm ali zed number s to zero
DEN ORM =0 !Prese rve/cr eate denorm alized num bers

The CRI2IBM/IBM2CRI routines are provided on Cray floating-point systems as a convenience even though
neither input nor output data formats are native to those systems. For parameter identification, "CRI" can be
considered the "native" data format on those systems.

CAUTION
The foreign and native variables should not be associated (aliased to each other).

RETURN VALUES
ierr is a returned function value, which can be as follows:
<0 Parameter error; no translation performed
-1 Parameter error; too few arguments or nativech not specified with type = 6
-2 Parameter error; invalid type
-3 Parameter error; invalid num
-4 Parameter error; invalid bitoff
-5 Parameter error; invalid natlen
-6 Parameter error; invalid forlen
-7 Unable to malloc() memory for translation
-8 Combination of natlen and forlen is invalid
-9 Parameter error; native must be 64-bit word-aligned (Cray MPP systems only)
-10 foreign must be 32-bit or 64-bit word-aligned (Cray MPP systems only)
0 Translation complete; no errors
>0 Translation complete; return value is the number of values that overflowed during translation.

004– 2165– 002 345


CRI2IEG ( 3F ) CRI2IEG ( 3F )

NAME
CRI2IEG, IEG2CRI – Converts Fortran data types between Cray IEEE and generic IEEE data types

SYNOPSIS
INTEGER CRI2IEG, IEG2CRI
ierr = CRI2IEG (type, num, foreign, bitoff, native, stride, natlen, forlen [,nativech])
ierr = IEG2CRI (type, num, foreign, bitoff, native, stride, natlen, forlen [,nativech])

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
CRI2IEG converts Cray IEEE Fortran data types for a system using 64-bit and 128-bit IEEE floating-point
representation (abbreviated as "CRI" in the following text) to data for systems that use generic 32-bit and
64-bit IEEE floating-point representation (abbreviated as "IEG" in the following text).
IEG2CRI converts generic 32-bit and 64-bit IEEE Fortran data types to 64-bit and 128-bit IEEE Fortran
data types.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
type An integer giving the data type code, as follows.
Code Description
1 Typeless (no translation; natlen and forlen must be equal and must be 64-, 128-, or
256-bits.)
2 Integer
IEG: 8-, 16-, 32- or 64-bit twos complement
CRI: 32- or 64-bit twos complement
3 Real
IEG: 32-, 64-bit, or 128-bit IEEE floating-point
CRI: 32-bit (Cray MPP systems only), 64- or 128-bit (Cray PVP systems only) IEEE
floating-point
4 Complex
IEG: 2 x 32-, 64-bit, or 128-bit floating-point
CRI: 2 x 32-bit (Cray MPP systems only), 64- or 128-bit (Cray PVP systems only)
floating-point

346 004– 2165– 002


CRI2IEG ( 3F ) CRI2IEG ( 3F )

5 Logical
IEG: 8-, 16-, 32- or 64-bit nonzero/zero logical
CRI: 32-, or 64-bit or minus/positive logical (Cray floating– point systems) or 32-bit or
64-bit nonzero/zero logical (Cray IEEE systems)
6 Character
ASCII to ASCII; no translation (Cray floating-point systems).
The natlen and forlen parameters select the size of the data.
num Number of data items to convert. Type integer variable, expression, or constant.
foreign Variable or array of any noncharacter type or length containing the data which is not native to the
current system. This variable or array either receives the converted data or contains data to be
converted.
bitoff Integer giving the bit offset within the foreign data variable or array to begin the conversion. bitoff
must be at least 0 and no more than 63.
native Variable or array of any noncharacter type or length containing the data which is native to the
current system. This variable or array either receives the converted data or contains data to be
converted. This may be a strided array.
This variable should be of a type that corresponds to the type argument. If type=6
(CHARACTER), native should be a dummy INTEGER variable and the optional nativech
argument should be a CHARACTER variable or array that contains or will contain the native data.
stride Integer variable or constant giving the memory increment for loading or storing data to the native
array. For two and four-word items (complex and double-precision), this is a stride of items, not
of words. For typeless, stride is always in words.
This parameter is ignored for CHARACTER (type = 6). Data in the foreign array is loaded or
stored in a continuous bit stream regardless of this parameter.
natlen Native storage length of an item, in bits. For COMPLEX data, natlen counts the total size of the
real and imaginary component.
forlen Fortran storage length of an item, in bits. For COMPLEX data, forlen counts the total size of the
real and imaginary components.
nativech Optional character parameter specifying native target variable if it is of type CHARACTER (type =
6). This parameter is ignored if type is not CHARACTER.

NOTES
Handling of IEEE denormalized numbers is controlled through a flag in the T@IEEE COMMON block (TASK
COMMON on Cray PVP systems). Setting the DENORM flag prevents any denormalized floating-point
numbers from being produced. The following example demonstrates this:

004– 2165– 002 347


CRI2IEG ( 3F ) CRI2IEG ( 3F )

INT EGE R (KIND= 4) DENORM, OVE RFL OW


COM MON /T@ IEE E/ DEN ORM , OVE RFL OW !MP P sys tems
TAS K COM MON /T@ IEE E/ DENORM , OVE RFL OW !PV P sys tem s
DEN ORM =1 !Flush den orm alized num bers to zer o
DEN ORM =0 !Prese rve /cr eate denorm ali zed num ber s

The CRI2IEG/IEG2CRI routines are provided on Cray Research floating-point systems as a convenience
even though neither input nor output data formats are native to those systems. For parameter identification,
"CRI" can be considered the "native" data format on those systems.

CAUTION
The foreign and native variables should not be associated (aliased to each other).

RETURN VALUES
The returned function values are as follows:
-1 Parameter error; too many arguments or nativech not specified with type = 6.
-2 Parameter error; invalid type.
-3 Parameter error; invalid num.
-4 Parameter error; invalid bitoff.
-5 Parameter error; invalid natlen.
-6 Parameter error; invalid forlen.
-7 Unable to malloc() memory for translation.
-8 Combination of natlen and forlen is invalid.
0 Translation complete; no errors.
>0 Translation complete; return value is the number of integer or real values that completely overflowed
during conversion.

348 004– 2165– 002


CRY2CRI ( 3F ) CRY2CRI ( 3F )

NAME
CRY2CRI, CRI2CRY – Converts Fortran data types between Cray floating-point and IEEE floating-point
systems

SYNOPSIS
INTEGER CRY2CRI, CRI2CRY
ierr = CRI2CRY(type, num, foreign, bitoff, native, stride, natlen, forlen[,nativech])
ierr = CRY2CRI(type, num, foreign, bitoff, native, stride, natlen, forlen[,nativech])

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
CRY2CRI converts Cray Fortran data types for a system using Cray floating-point representation
(abbreviated as "Cray" in the following text) to data for systems that use IEEE floating-point representation
(abbreviated as "IEEE" in the following text).
CRI2CRY converts IEEE Fortran data types to Cray Fortran data types.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid parameters for this routine.
type An integer giving the data type code, as follows.
Code Description
1 Typeless (no translation; natlen and forlen must be equal and must be 64-, 128-, or
256-bits.)
2 Integer
Cray: 64-bit twos complement
IEEE: 32- or 64-bit twos complement
3 Floating-point
Cray: 64- or 128-bit Cray floating-point
IEEE: 32-, 64-bit (available on all systems), or 128-bit IEEE floating-point (Cray T90
only)
4 Complex
IEEE: 2 x 32, 64-bit (all systems), or 128-bit floating-point (Cray T90 only)
Cray: 2 x 64 or 128-bit floating-point

004– 2165– 002 349


CRY2CRI ( 3F ) CRY2CRI ( 3F )

5 Logical
IEEE: 32- or 64-bit nonzero/zero logical
Cray: 64-bit minus/positive logical
6 Character
ASCII to ASCII; no translation.
The natlen and forlen parameters select the size of the data.
num Number of data items to convert. Type integer variable, expression, or constant.
foreign Variable or array of any noncharacter type or length containing Cray PVP systems or Cray MPP
systems data, whichever is not native to the current system. This variable or array either receives
the converted data or contain data to be converted.
bitoff Integer giving the bit offset within the foreign data variable or array to begin the conversion. bitoff
must be at least 0 and no more than 63.
native Variable or array of any noncharacter type or length containing Cray PVP systems or Cray MPP
systems data, whichever is native to the current system. This variable or array either receives the
converted data or contains data to be converted. This may be a strided array.
stride Integer variable or constant giving the memory increment for loading or storing data to the native
array. For two and four-word items (complex and double-precision), this is a stride of items, not
of words. For typeless, stride is always in words.
This parameter is ignored for CHARACTER (type = 6). Data in the foreign array is loaded or
stored in a continuous bit stream regardless of this parameter.
natlen Native storage length of an item, in bits. For COMPLEX data, natlen counts the total size of the
real and imaginary component.
forlen Fortran storage length of an item, in bits. For COMPLEX data, forlen counts the total size of the
real and imaginary components.
nativech Optional character parameter specifying native target variable if it is of type character (type = 6).
This parameter is ignored if type is not character.

NOTES
CRI2CRY and IEC2CRAY are comparable functions.
CRY2CRI and CRAY2IEC are comparable functions.
These data conversion routines also correctly translate CRAY-2 data files with the exception of logical data.

CAUTION
The foreign and native variables should not be associated (aliased to each other).

350 004– 2165– 002


CRY2CRI ( 3F ) CRY2CRI ( 3F )

RETURN VALUES
The returned function values are as follows:
-1 Parameter error; too few arguments or nativech not specified with type = 6.
-2 Parameter error; invalid type.
-3 Parameter error; invalid num.
-4 Parameter error; invalid bitoff.
-5 Parameter error; invalid natlen.
-6 Parameter error; invalid forlen.
-7 Unable to malloc() memory for translation.
0 Translation complete; no errors.
>0 Translation complete; return value is the number of integer or real values that completely overflowed
during conversion. Overflows and NaNs which exist before conversion, are not included.

004– 2165– 002 351


CRY2MIPS ( 3F ) CRY2MIPS ( 3F )

NAME
CRY2MIPS, MIPS2CRY – Converts Fortran data types between Cray Fortran data types and MIPS IEEE
Fortran data types

SYNOPSIS
INTEGER CRY2MIPS, MIPS2CRY
ierr = CRY2MIPS(type, num, foreign, bitoff, native, stride, natlen, forlen[,nativech])
ierr = MIPS2CRY(type, num, foreign, bitoff, native, stride, natlen, forlen[,nativech])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)
IRIX systems

DESCRIPTION
CRY2MIPS converts Cray Fortran data types (indicated as "Cray" in the following text) to data for systems
that use MIPS IEEE Fortran data types (abbreviated as "MIPS" in the following text).
MIPS2CRY converts MIPS IEEE Fortran data types to Cray Fortran data types.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on UNICOS or IRIX systems, all
arguments must be of default kind unless documented otherwise. On UNICOS systems, the default kind is
KIND=8 for integer, real, complex, and logical arguments; on IRIX systems, the default kind is KIND=4.
The following is a list of valid parameters for this routine.
type An integer giving the data type code, as follows.
Code Description
1 Typeless (no translation; natlen and forlen must be equal and must be 64-, 128-, or
256-bits.)
2 Integer
Cray: 64-bit twos complement
MIPS: 8-, 16-, 32- or 64-bit twos complement
3 Real
Cray: 64- or 128-bit Cray real
MIPS: 32-, 64-, or 128-bit MIPS real
4 Complex
Cray: 2 x 64 bit or 128-bit floating-point
MIPS: 2 x 32, 64-bit, or 128-bit floating-point

352 004– 2165– 002


CRY2MIPS ( 3F ) CRY2MIPS ( 3F )

5 Logical
CRAY: 64-bit positive/negative logical
MIPS: 8-, 16-, 32-, or 64-bit zero/nonzero logical
6 Character
ASCII to ASCII; no translation.
The natlen and forlen parameters select the size of the data.
num Number of data items to convert. Type integer variable, expression, or constant.
foreign Variable or array of any noncharacter type or length to contain data which is not native to the
current system.
bitoff Integer variable, expression, or constant giving the bit offset within the foreign data variable or
array to begin the conversion. bitoff must be at least 0 and no more than 63.
native Variable or array of any noncharacter type or length to contain data which is native to the current
system. This variable or array should be of a type that corresponds to type. If type=6, use a
dummy integer variable and the nativech parameter (see description of nativech).
stride Integer variable or constant giving the memory increment for loading or storing data to the native
array. For two and four-word items (complex and double-precision), this is a stride of items, not
of words. For typeless, stride is always in words.
This parameter is ignored for CHARACTER (type = 6). Data in the foreign array is loaded or
stored in a continuous bit stream regardless of this parameter.
natlen Native storage length of an item, in bits. For COMPLEX data, natlen counts the total size of the
real and imaginary component.
forlen Foreign storage length of an item, in bits. For COMPLEX data, forlen counts the total size of the
real and imaginary components.
nativech Optional character parameter specifying native target variable if it is of type character (type = 6).
This parameter is ignored if type is not character.

CAUTION
The foreign and native variables should not be associated (aliased to each other).

RETURN VALUES
The returned function values are as follows:
<0 Parameter error; no translation performed.
-1 Parameter error; too few arguments or nativech not specified with type = 6. This error is not returned
on IRIX systems.
-2 Parameter error; invalid type.
-3 Parameter error; invalid num.

004– 2165– 002 353


CRY2MIPS ( 3F ) CRY2MIPS ( 3F )

-4 Parameter error; invalid bitoff.


-5 Parameter error; invalid natlen.
-6 Parameter error; invalid forlen.
-7 Unable to malloc() memory for translation.
-8 Combination of natlen and forlen is invalid.
-9 native must be 64-bit word-aligned (CRAY only)
-10 foreign must be 64-bit word-aligned.
0 Translation complete; no errors.
>0 Translation complete; return value is the number of integer or real values that completely overflowed
during conversion. Overflows and NaNs which exist before conversion are not included.

354 004– 2165– 002


DSASC ( 3F ) DSASC ( 3F )

NAME
DSASC, ASCDC – Converts CDC display code character to ASCII character and vice versa

SYNOPSIS
CALL DSASC(src, sc, dest, num)
CALL ASCDC(src, sc, dest, num)

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
DSASC converts CDC display code characters to ASCII characters. ASCDC converts ASCII characters to
CDC display code characters.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
src For DSASC, a variable or array of any noncharacter type and of any length containing CDC display
code characters (64-character set), left-justified in a 64-bit Cray word. Contains a maximum of 10
display code characters per word. If the input string is packed 6-bit characters, use U6064(3F) to
unpack characters 10 per word. For ASCDC, a variable or array of any type or length containing
ASCII data.
sc Display code or ASCII character position to begin the conversion. Leftmost position is 1.
dest For DSASC, a variable or array of any noncharacter type and of any length to contain the converted
ASCII data. Results are packed 8 characters per word. For ASCDC, a variable or array of any type
or length to contain the converted CDC display code characters (64-character set). Results are
packed 60 ASCII characters with 4 blank end bits per 64-bit word.
num Number of CDC display code or ASCII characters to convert. Specify an integer variable,
expression, or constant.

004– 2165– 002 355


ETA2CRAY ( 3F ) ETA2CRAY ( 3F )

NAME
ETA2CRAY, CRAY2ETA – Converts ETA/CYBER 205 data to Cray format and vice versa

SYNOPSIS
INTEGER ETA2CRAY
iret=ETA2CRAY(type, num, foreign, bitoff, cray[, strd[, craychar]])
INTEGER CRAY2ETA
iret=CRAY2ETA(type, num, foreign, bitoff, cray[, strd[, craychar]])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
ETA2CRAY converts ETA/CYBER 205 data to Cray format. It accepts as input a bit string starting at
foreign(1) at bit bitoff, converts the data according to type, and places the converted data in cray.
CRAY2ETA converts Cray data to ETA/CYBER 205 format. It accepts as input a bit string starting at
cray(1), converts the data according to type, and places the converted data in foreign at bit bitoff.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine:
type Type integer. The variable type code used by the libraries. The following lists these codes and
shows the corresponding ETA/CYBER 205 and Cray formats (and the formats’ mapping to one
another).

Code ETA Cray

1 INTEGER INTEGER(64-bit)
2 REAL REAL(64-bit)
3 DOUBLE PRECISION DOUBLE(128-bit)
4 COMPLEX COMPLEX(2*64-bit)
5 LOGICAL LOGICAL(64-bit)
6 CHARACTER (ASCII) CHAR (ASCII)(8-bit)
7 Half-precision REAL REAL(64-bit)

num Type integer variable, array, or constant. Number of data items to convert.
foreign ETA2CRAY: Variable or array of any noncharacter type and of any length containing the
ETA/CYBER 205 format data to convert.

356 004– 2165– 002


ETA2CRAY ( 3F ) ETA2CRAY ( 3F )

CRAY2ETA: Variable or array of any type except CHARACTER and of any length to receive
the converted ETA/CYBER 205 data.
bitoff Type integer variable, expression, or constant in the range 0 ≤ bitoff ≤ 63.
ETA2CRAY: Bit number within foreign to begin the conversion.
CRAY2ETA: Bit number within foreign to place the converted data.
Bits are numbered from 0, beginning at leftmost bit of foreign. (Bit 0 is the sign bit.)
cray Variable or array of any noncharacter type and of any length containing the Cray format data,
word-aligned.
strd Type integer variable, expression, or constant.
ETA2CRAY: Memory increment for storing the conversion results in cray. If strd = 1, the items
are placed in contiguous memory locations in cray. If strd > 1, the items are placed in cray in
memory locations at intervals specified by strd. For example, if strd = 3, the input items are
stored in cray at locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are taken from foreign in a continuous bit stream.
CRAY2ETA: Memory increment for loading the Cray items to be converted. If strd = 1, the
items are taken from contiguous memory locations in cray. If strd > 1, the items are taken from
cray memory locations at intervals specified by strd. For example, if strd = 3, the items are
taken from cray locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are placed in foreign in a continuous bit stream.
For double-word items, this is a stride of items, not of words. Default stride for complex input
is 1. For data of type character, strd must equal 1.
Default value is 1.
This is an optional argument.
craychar Type Character*N. Variable or array containing the Cray format data. Must be used instead of
cray when the variable type is character. If craychar is supplied, cray is ignored. This is an
optional argument.

CAUTION
The foreign and cray variables should not be associated (aliased to each other).

RETURN VALUES
The returned function values are as follows:
=0 All values converted without error.
<0 Error. An error was detected in the input parameters.

004– 2165– 002 357


ETA2CRAY ( 3F ) ETA2CRAY ( 3F )

EXAMPLES
Example 1: The following code converts LENGTH ETA/CYBER 205 REAL numbers in array AETA to
Cray REAL(64-bit) numbers and places the results in array ACRAY.
INT EGER ETA2CR AY
IRE T=ETA2 CRAY(2 ,LE NGT H,A ETA ,0, ACR AY)
IF( IRET.L T.0) GOT O 99 ! err or

Example 2: The following code converts the LENGTH CRAY REAL(64-bit) numbers in array ACRAY from
the previous example back to ETA REAL numbers and places the results in array AETA2.
INT EGER CRAY2E TA
IRE T=CRAY 2ETA(2 ,LE NGT H,A ETA 2,0 ,AC RAY )
IF( IRET.L T.0) GOT O 99 ! err or

358 004– 2165– 002


FP6064 ( 3F ) FP6064 ( 3F )

NAME
FP6064, FP6460 – Converts between CDC 60-bit and Cray 64-bit numbers

SYNOPSIS
CALL FP6064(fpn, dest, num)
CALL FP6460(fpn, dest, num)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
FP6064 converts CDC 60-bit single-precision numbers to Cray 64-bit single-precision numbers.
FP6460 converts Cray 64-bit single-precision numbers to CDC 60-bit single-precision numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
fpn For FP6064, a variable or array of any type or length containing CDC 60-bit, single-precision
numbers, left-justified in a Cray 64-bit word. For FP6460, a variable or array of any length
and of type real containing Cray single-precision numbers.
dest Variable or array of type real to contain the converted Cray 64-bit, single-precision or CDC
60-bit single-precision numbers. (In FP6460, each floating-point number is left-justified in a
64-bit word.)
num Number of CDC or Cray single-precision numbers to convert. Specify an integer variable,
expression, or constant.

004– 2165– 002 359


IBM2CRAY ( 3F ) IBM2CRAY ( 3F )

NAME
IBM2CRAY, CRAY2IBM – Converts IBM data to Cray format and vice versa

SYNOPSIS
INTEGER IBM2CRAY
iret=IBM2CRAY(type, num, foreign, bitoff, cray [,strd [,craychar]])
INTEGER CRAY2IBM
iret=CRAY2IBM(type, num, foreign, bitoff, cray [,strd [,craychar]])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
IBM2CRAY converts IBM data to Cray format. It accepts as input a bit string starting at the first element of
foreign at bit bitoff and converts the data according to type, placing the converted data in cray.
CRAY2IBM converts Cray data to IBM format. It accepts as input a bit string starting at the first element of
cray and converts the data according to type, placing the converted data in foreign at bit bitoff.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
type Type integer. The variable type code used by the libraries. The following lists these codes and
shows the corresponding IBM and Cray formats (and the formats’ mapping to one another). In
the conversion from Cray to IBM floating-point format for real, double, and complex data, the
mantissa is truncated rather than rounded.

Code IBM Cray CRAY2IBM IBM2CRAY

1 INTEGER*4 INTEGER(64-bit)
2 REAL*4 REAL(64-bit) Truncation Not applicable
3 REAL*8 DOUBLE(128-bit) Truncation Not applicable
4 COMPLEX*4 COMPLEX(2*64-bit) Truncation Not applicable
5 LOGICAL*4 LOGICAL(64-bit)
6 CHARACTER CHAR (ASCII)(8-bit)
(EBCDIC)
7 INTEGER*2 INTEGER(24)(64-bit)

num Type integer variable, array, or constant. Number of data items to convert.

360 004– 2165– 002


IBM2CRAY ( 3F ) IBM2CRAY ( 3F )

foreign IBM2CRAY: Variable or array of any noncharacter type and of any length containing the IBM
format data to convert.
CRAY2IBM: Variable or array of any noncharacter type and of any length to receive the
converted IBM data.
bitoff Type integer variable, expression, or constant in the range 0 ≤ bitoff ≤ 63.
IBM2CRAY: Bit number within foreign to begin the conversion.
CRAY2IBM: Bit number within foreign to place the converted data.
Bits are numbered from 0, beginning at leftmost bit of foreign. (Bit 0 is the sign bit.)
cray Variable or array of any noncharacter type and of any length containing the Cray format data,
word-aligned.
strd Type integer variable, expression, or constant.
IBM2CRAY: Memory increment for storing the conversion results in cray. If strd = 1, the items
are placed in contiguous memory locations in cray. If strd > 1, the items are placed in cray in
memory locations at intervals specified by strd. For example, if strd = 3, the input items are
stored in cray at locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are taken from foreign in a continuous bit stream.
CRAY2IBM: Memory increment for loading the Cray items to be converted. If strd = 1, the
items are taken from contiguous memory locations in cray. If strd > 1, the items are taken from
cray memory locations at intervals specified by strd. For example, if strd = 3, the items are
taken from cray locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are placed in foreign in a continuous bit stream.
For double-word items, this is a stride of items, not of words. Default stride for complex input
is 1. For data of type character, strd must equal 1.
Default value is 1.
This is an optional argument.
craychar Type Character*N. Variable or array containing the Cray format data. Must be used instead of
cray when the variable type is character. If craychar is supplied, cray is ignored. This is an
optional argument.

CAUTION
The foreign and cray variables should not be associated (aliased to each other).

RETURN VALUES
The returned function values are as follows:
=0 All values converted without error.
<0 Error. An error was detected in the input parameters.

004– 2165– 002 361


IBM2CRAY ( 3F ) IBM2CRAY ( 3F )

EXAMPLES
Example 1: The following code converts LENGTH IBM REAL*4 numbers in array AIBM to Cray
REAL(64-bit) numbers and places the results in array ACRAY.
INT EGER IBM2CR AY
IRE T=IBM2 CRAY(2 ,LE NGT H,A IBM ,0, ACR AY)
IF( IRET.L T.0) GOT O 99 ! err or

Example 2: The following code converts the LENGTH CRAY REAL(64-bit) numbers in array ACRAY from
the previous example back to IBM REAL*4 numbers and places the results in array AIBM2.
INT EGER CRAY2I BM
IRE T=CRAY 2IBM(2 ,LE NGT H,A IBM 2,0 ,AC RAY )
IF( IRET.L T.0) GOT O 99 ! err or

362 004– 2165– 002


IEG2CRAY ( 3F ) IEG2CRAY ( 3F )

NAME
IEG2CRAY, CRAY2IEG – Converts IEEE/Generic 32-bit data to Cray 64-bit data and vice versa

SYNOPSIS
INTEGER IEG2CRAY, ierr, type, num, foreign, bitoff, stride
CHARACTER * (*) craych
DIMENSION foreign(*), cray(*)
ierr = IEG2CRAY(type, num, foreign, bitoff, cray[, stride[, craych]])
INTEGER CRAY2IEG, ierr, type, num, foreign, bitoff, stride
CHARACTER * (*) craych
DIMENSION foreign(*), cray(*)
ierr = CRAY2IEG(type, num, foreign, bitoff, cray[, stride[, craych]])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
IEG2CRAY converts Fortran data types on a generic 32-bit platform (using IEEE floating-point
representation) to Cray Fortran data types.
CRAY2IEG converts Cray Fortran data types to a generic 32-bit platform (using IEEE floating-point
representation) Fortran data types.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
ierr An integer giving the returned function value, as follows:
<0 Parameter error; no translation performed.
=0 Translation complete; no errors.
>0 Translation complete; return value is the number of values that completely overflowed
(CRAY2IEG only).
type An integer giving the data type code, as follows (all float-to-float conversions are rounded):

004– 2165– 002 363


IEG2CRAY ( 3F ) IEG2CRAY ( 3F )

Code Description
0 Typeless (no translation)
1 Integer
IEG2CRAY: 32-bit twos complement to 64-bit twos complement.
CRAY2IEG: 64-bit twos complement to 32-bit twos complement.
2 Real
IEG2CRAY: 32-bit, single-precision, IEEE floating point to 64-bit, single-precision, Cray
real numbers.
CRAY2IEG: 64-bit, single-precision, Cray real numbers to 32-bit, single-precision, IEEE
floating point.
3 Double
IEG2CRAY: 64-bit, double-precision, IEEE floating point to 128-bit, double-precision,
Cray floating point.
CRAY2IEG: 128-bit, double-precision, Cray floating point to 64-bit, double-precision,
IEEE floating point.
4 Complex
IEG2CRAY: 2 x 32-bit, single-precision, IEEE floating point to 2 x 64-bit,
single-precision, Cray floating point.
CRAY2IEG: 2 x 64-bit, single-precision, Cray floating point to 2 x 32-bit,
single-precision, IEEE floating point.
5 Logical
IEG2CRAY: 32-bit generic logical to 64-bit Cray logical; all nonzero values are converted
to Cray logical trues and all zero values are converted to Cray logical falses.
CRAY2IEG: 64-bit Cray logical to 32-bit generic logical; all nonzero Cray values are
converted to a value of 1, all zero Cray values remain unchanged.
6 Character
ASCII to ASCII; no translation.
7 Short integer
IEG2CRAY: 16-bit twos complement to 32-bit twos complement.
CRAY2IEG: 32-bit twos complement to 16-bit twos complement.
8 Special
IEG2CRAY: 64-bit, double-precision, IEEE floating point to 64-bit, single-precision, Cray
real numbers.
CRAY2IEG: 64-bit, single-precision, Cray real numbers to 64-bit, double-precision, IEEE
floating point.
num An integer giving the number of data items to convert.

364 004– 2165– 002


IEG2CRAY ( 3F ) IEG2CRAY ( 3F )

foreign IEG2CRAY: Variable or array of any noncharacter type containing the data to be converted.
CRAY2IEG: Variable or array of any noncharacter type to receive the converted data.
bitoff An integer giving the bit offset within foreign to begin the conversion. Bits are numbers from 0 to
63, beginning at the leftmost bit of foreign.
stride Integer.
IEG2CRAY: Optional memory increment for storing the converted values into the cray array.
CRAY2IEG: Optional memory increment for loading the Cray values to be converted.
For 2-word items (complex and double-precision), this is a stride of items, not of words.
The default value is 1.
craych Type Character.
IEG2CRAY: Optional character variable or array to receive the converted characters if type is 6
(character).
CRAY2IEG: Optional character variable or array containing the characters to be converted if type
is 6 (character).
cray IEG2CRAY: Variable or array of any noncharacter type to receive the converted values.
CRAY2IEG: Variable or array of any noncharacter type containing the values to be converted.
This variable should be of a type corresponding to the type argument.

CAUTION
The foreign and cray variables should not be associated (aliased to each other).

SEE ALSO
CRY2CRI(3F)

004– 2165– 002 365


IEG2CRI_77 ( 3F ) IEG2CRI_77 ( 3F )

NAME
IEG2CRI_77, CRI2IEG_77 – Converts IEEE 32-bit data to Cray IEEE 64-bit data and vice versa

SYNOPSIS
INTEGER CRI2IEG_77, ierr, type, num, foreign, bitoff, stride
CHARACTER * (*) nativech
DIMENSION foreign(*), native(*)
ierr = IEG2CRI_77(type, num, foreign, bitoff, native[, stride[, nativech]])
INTEGER CRI2IEG_77, ierr, type, num, foreign, bitoff, stride
CHARACTER * (*) nativech
DIMENSION foreign(*), native(*)
ierr = CRI2IEG_77(type, num, foreign, bitoff, native[, stride[, nativech]])

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
IEG2CRI_77 converts from 32-bit generic IEEE floating-point representation to Cray IEEE 64-bit Fortran
data types.
CRI2IEG_77 converts from Cray IEEE 64-bit Fortran data types to 32-bit generic IEEE floating-point
representation.
When using the CF90 compiler on UNICOS/mk systems, all arguments must be of default kind unless
documented otherwise. On UNICOS/mk systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
ierr An integer giving the returned function value, as follows:
<0 Parameter error; no translation performed. See IEG2CRI(3F).
=0 Translation complete; no errors.
>0 Translation complete; return value is the number of values that overflowed during
conversion(CRI2IEG_77 only). Infinities existing before conversion (and NaNs) are not
counted.

366 004– 2165– 002


IEG2CRI_77 ( 3F ) IEG2CRI_77 ( 3F )

type An integer giving the data type code, as follows (all float-to-float conversions are rounded):
Code Description
0 Typeless (no translation): 64-bit, 128-bit, and 256-bit data items.
1 Integer
IEG2CRI_77: 32-bit twos complement to 64-bit twos complement; sign extension.
CRI2IEG_77: 64-bit twos complement to 32-bit twos complement. Overflow results are
undefined.
2 Real
IEG2CRI_77: 32-bit IEEE floating point to 64-bit IEEE floating point. 32-bit IEEE
denormal values are converted.
CRI2IEG_77: 64-bit, IEEE floating point to 32-bit IEEE floating point. Overflows
result in signed infinity. 32-bit IEEE denormal values can result. Underflow results in
signed zero.
3 Double Precision
IEG2CRI_77: 64-bit IEEE floating point to 128-bit IEEE floating point (deferred).
CRI2IEG_77: 128-bit IEEE floating point to 64-bit IEEE floating point (deferred).
4 Complex
IEG2CRI_77: 2 x 32-bit, IEEE floating point to 2 x 64-bit, IEEE floating point.
CRI2IEG_77: 2 x 64-bit, IEEE floating point to 2 x 32-bit, IEEE floating point. Note
that two overflows can result from each item.
5 Logical
IEG2CRI_77: 32-bit logical to 64-bit Cray logical; all nonzero values are converted to
Cray logical trues and all zero values are converted to Cray logical falses.
CRI2IEG_77: 64-bit Cray logical to 32-bit logical; all nonzero values are converted to 1
and zero values are converted to zero.
6 Character
ASCII to ASCII; no translation.
7 Short integer
IEG2CRI_77: 16-bit twos complement to 32-bit twos complement.
CRI2IEG_77: 32-bit twos complement to 16-bit twos complement. Results are
undefined on overflow.
8 Special
IEG2CRI_77: 64-bit IEEE floating point to 64-bit Cray IEEE floating point. IEEE
denormal values become signed zero, other values are unchanged.
CRI2IEG_77: 64-bit, Cray IEEE floating point to 64-bit IEEE floating point. No
conversion.

004– 2165– 002 367


IEG2CRI_77 ( 3F ) IEG2CRI_77 ( 3F )

num An integer giving the number of data items to convert. A Fortran complex number is one item.
foreign IEG2CRI_77: Variable or array of any noncharacter type containing the data to be converted.
CRI2IEG_77: Variable or array of any noncharacter type to receive the converted data.
bitoff An integer giving the bit offset within foreign to begin the conversion. Bits are numbered from 0
to 63, beginning at the leftmost bit of foreign.
native IEG2CRI_77: Variable or array of any noncharacter type to receive the converted values.
CRI2IEG_77: Variable or array of any noncharacter type containing the values to be converted.
This variable should be of a type corresponding to the type argument.
stride An integer.
IEG2CRI_77: Optional memory increment for storing the converted values into the native array.
CRI2IEG_77: Optional memory increment for loading the Cray PVP systems values to be
converted from the native array.
For 2-word items (complex and double-precision), this is a stride of items, not of words.
The default value is 1.
nativech Type character.
IEG2CRI_77: Optional character variable or array to receive the converted characters if type is 6
(character).
CRI2IEG_77: Optional character variable or array containing the characters to be converted if
type is 6 (character).

CAUTION
The foreign and native variables should not be associated (aliased to each other).

SEE ALSO
IEG2CRI(3F)

368 004– 2165– 002


IEG2MIPS ( 3F ) IEG2MIPS ( 3F )

NAME
IEG2MIPS, MIPS2IEG – Converts generic IEEE data to MIPS IEEE data and vice versa

SYNOPSIS
INTEGER IEG2MIPS, MIPS2IEG
ierr = IEG2MIPS(type, num, foreign, bitoff, native, stride, natlen, forlen[,nativech])
ierr = MIPS2IEG(type, num, foreign, bitoff, native, stride, natlen, forlen[,nativech])

IMPLEMENTATION
IRIX systems

DESCRIPTION
IEG2MIPS converts generic IEEE data types (indicated as "IEEE" in the following text) to data for systems
that use MIPS IEEE data types (abbreviated as "MIPS" in the following text).
MIPS2IEG converts MIPS IEEE data types to IEEE data types.
When using the MIPSpro 7 Fortran 90 compiler on IRIX systems, all arguments must be of default kind
unless documented otherwise. On IRIX systems, the default kind is KIND=4.
The following is a list of valid parameters for this routine.
type An integer giving the data type code, as follows.
Code Description
1 Typeless (no translation; natlen and forlen must be equal and must be 8-, 16-, 32-, 64-,
128-, or 256-bits.)
2 Integer
IEEE: 64-, 32-, 16, or 8-bit twos complement
MIPS: 64-, 32-, 16, or 8-bit twos complement
3 Real
IEEE: 32-, 64-, or 128-bit IEEE floating-point
MIPS: 32-, 64-, or 128-bit MIPS IEEE floating-point
4 Complex
IEEE: 2 x 32-, 64-, or 128-bit IEEE floating-point
MIPS: 2 x 32-, 64-, or 128-bit MIPS IEEE floating-point
5 Logical
IEEE: 64-, 32-, 16-, or 8-bit zero/nonzero logical
MIPS: 64-, 32-, 16-, or 8-bit zero/nonzero logical
6 Character
ASCII to ASCII; no translation.

004– 2165– 002 369


IEG2MIPS ( 3F ) IEG2MIPS ( 3F )

The natlen and forlen parameters select the size of the data.
num Number of data items to convert. Type integer variable, expression, or constant.
foreign Variable or array of any noncharacter type or length to contain data which is not native to the
current system.
bitoff Integer variable, expression, or constant giving the bit offset within the foreign data variable or
array to begin the conversion. bitoff must be at least 0 and no more than 63.
native Variable or array of any noncharacter type or length to contain data which is native to the current
system. This variable or array should be of a type that corresponds to type. If type=6, use a
dummy integer variable and the nativech parameter (see description of nativech).
stride Integer variable or constant giving the memory increment for loading or storing data to the native
array. For two and four-word items (complex and double-precision), this is a stride of items, not
of words. For typeless, stride is always in words.
This parameter is ignored for CHARACTER (type = 6). Data in the foreign array is loaded or
stored in a continuous bit stream regardless of this parameter.
natlen Native storage length of an item, in bits. For COMPLEX data, natlen counts the total size of the
real and imaginary component.
forlen Foreign storage length of an item, in bits. For COMPLEX data, forlen counts the total size of the
real and imaginary components.
nativech Optional character parameter specifying native target variable if it is of type character (type = 6).
This parameter is ignored if type is not character.

CAUTION
The foreign and native variables should not be associated (aliased to each other).

RETURN VALUES
The returned function values are as follows:
<0 Parameter error; no translation performed.
-1 Parameter error; too few arguments or nativech not specified with type = 6. This error is not returned
on IRIX systems.
-2 Parameter error; invalid type.
-3 Parameter error; invalid num.
-4 Parameter error; invalid bitoff.
-5 Parameter error; invalid natlen.
-6 Parameter error; invalid forlen.
-7 Unable to malloc() memory for translation.

370 004– 2165– 002


IEG2MIPS ( 3F ) IEG2MIPS ( 3F )

-8 Combination of natlen and forlen is invalid.


-9 native must be 64-bit word-aligned.
-10 foreign must be 64-bit word-aligned.
0 Translation complete; no errors.
>0 Translation complete; return value is the number of integer or real values that completely overflowed
during conversion. Overflows and NaNs which exist before conversion are not included.

004– 2165– 002 371


IEU2CRAY ( 3F ) IEU2CRAY ( 3F )

NAME
IEU2CRAY, CRAY2IEU – Converts DEC ULTRIX/generic little-endian 32-bit data to Cray 64-bit data and
vice versa

SYNOPSIS
INTEGER IEU2CRAY, ierr, type, num, foreign, bitoff, stride
CHARACTER * (*) craych
DIMENSION foreign(*), cray(*)
ierr = IEU2CRAY(type, num, foreign, bitoff, cray[, stride[, craych]])
INTEGER CRAY2IEU, ierr, type, num, foreign, bitoff, stride
CHARACTER * (*) craych
DIMENSION foreign(*), cray(*)
ierr = CRAY2IEU(type, num, foreign, bitoff, cray[, stride[, craych]])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
IEU2CRAY converts Fortran data types on a generic little-endian 32-bit platform with IEEE floating-point
representation to Cray Fortran data types.
CRAY2IEU converts Cray Fortran data types to a Fortran data type on a generic little-endian 32-bit platform
with IEEE floating-point representation.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
ierr An integer giving the returned function value, as follows:
<0 Parameter error; no translation performed.
=0 Translation complete; no errors.
>0 Translation complete; return value is the number of values that completely overflowed
(CRAY2IEU only).

372 004– 2165– 002


IEU2CRAY ( 3F ) IEU2CRAY ( 3F )

type An integer giving the data type code, as follows (all float-to-float conversions are rounded).

Code Description
0 Typeless (no translation)
1 Integer
IEU2CRAY: 32-bit twos complement to 64-bit twos complement.
CRAY2IEU: 64-bit twos complement to 32-bit twos complement.
2 Real
IEU2CRAY: 32-bit, single-precision, IEEE floating point to 64-bit, single-precision, Cray
real numbers.
CRAY2IEU: 64-bit, single-precision, Cray real numbers to 32-bit, single-precision, IEEE
floating point.
3 Double
IEU2CRAY: 64-bit, double-precision, IEEE floating point to 128-bit, double-precision,
Cray floating point.
CRAY2IEU: 128-bit, double-precision, Cray floating point to 64-bit, double-precision,
IEEE floating point.
4 Complex
IEU2CRAY: 2 x 32-bit, single-precision, IEEE floating point to 2x64-bit, single-precision,
Cray floating point.
CRAY2IEU: 2 x 64-bit, single-precision, Cray floating point to 2 x 32-bit,
single-precision, IEEE floating point.
5 Logical
IEU2CRAY: 32-bit generic logical to 64-bit Cray logical; all nonzero values are converted
to Cray logical trues and all zero values are converted to Cray logical falses.
CRAY2IEU: 64-bit Cray logical to 32-bit generic logical; all nonzero Cray values are
converted to a value of 1, all zero Cray values remain unchanged.
6 Character
ASCII to ASCII; no translation.
7 Short integer
IEU2CRAY: 16-bit twos complement to 32-bit twos complement.
CRAY2IEU: 32-bit twos complement to 16-bit twos complement.
8 Special
IEU2CRAY: 64-bit, double-precision, IEEE floating point to 64-bit, single-precision, Cray
real numbers.
CRAY2IEU: 64-bit, single-precision, Cray real numbers to 64-bit, double-precision, IEEE
floating point.
num An integer giving the number of data items to convert.

004– 2165– 002 373


IEU2CRAY ( 3F ) IEU2CRAY ( 3F )

foreign IEU2CRAY: Variable or array of any noncharacter type containing the data to be converted.
CRAY2IEU: Variable or array of any noncharacter type to receive the converted data.
bitoff An integer giving the bit offset within foreign to begin the conversion. Bits are numbers from 0 to
63, beginning at the leftmost bit of foreign.
stride An integer.
IEU2CRAY: Optional memory increment for storing the converted values into the cray array.
CRAY2IEU: Optional memory increment for loading the Cray values to be converted.
For 2-word items (complex and double-precision), this is a stride of items, not of words.
The default value is 1.
cray IEU2CRAY: Variable or array of any noncharacter type to receive the converted values.
CRAY2IEU: Variable or array of any noncharacter type containing the values to be converted.
This variable should be of a type corresponding to the type argument.
craych Type Character.
IEU2CRAY: Optional character variable or array to receive the converted characters if type is 6
(character).
CRAY2IEU: Optional character variable or array containing the characters to be converted if type
is 6 (character).

NOTES
The IEU2CRAY and CRAY2IEU functions are little-endian versions of IEG2CRAY and CRAY2IEG. Most
generic IEEE systems use big-endian data representation and require the use of IEG2CRAY and CRAY2IEG.

CAUTION
The foreign and cray variables should not be associated (aliased to each other).

374 004– 2165– 002


INT6064 ( 3F ) INT6064 ( 3F )

NAME
INT6064 – Converts CDC 60-bit integers to Cray 64-bit integers

SYNOPSIS
CALL INT6064(src, idest, num)

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
INT6064 converts CDC 60-bit integer numbers to Cray 64-bit integer numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
src Variable or array of any noncharacter type and any length containing CDC 60-bit integers,
left-justified in a Cray 64-bit word.
idest Variable or array of type integer to receive the resultant Cray integer values. Each such integer
is left-justified and zero-filled.
num Number of CDC integers to convert. Specify an integer variable, expression, or constant.

NOTES
INT6460(3F) is the inverse of this routine.

004– 2165– 002 375


INT6460 ( 3F ) INT6460 ( 3F )

NAME
INT6460 – Converts Cray 64-bit integers to CDC 60-bit integers

SYNOPSIS
CALL INT6460(in, idest, num)

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
INT6460 converts Cray 64-bit integer numbers to CDC 60-bit integer numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
in Variable or array of any length and of type integer containing Cray integer numbers.
idest Variable or array of type integer to contain the converted values or CDC integer numbers. Each
such integer is left-justified and zero-filled.
num Number of Cray integers to convert. Specify an integer variable, expression, or constant.

NOTES
INT6064(3F) is the inverse of this routine.

376 004– 2165– 002


NVE2CRAY ( 3F ) NVE2CRAY ( 3F )

NAME
NVE2CRAY, CRAY2NVE – Converts NOS/VE data to Cray format and vice versa

SYNOPSIS
INTEGER NVE2CRAY
iret=NVE2CRAY(type, num, foreign, bitoff, cray[, strd[, craychar]])
INTEGER CRAY2NVE
iret=CRAY2NVE(type, num, foreign, bitoff, cray[, strd[, craychar]])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
NVE2CRAY converts NOS/VE data to Cray format. It accepts as input a bit string starting at foreign at bit
bitoff and converts the data according to type, placing the converted data in cray.
CRAY2NVE converts Cray data to NOS/VE format. It accepts as input a bit string starting at the first
element in cray and converts the data according to type, placing the converted data in foreign at bit bitoff.
No precision is lost in either conversion.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
iret The returned function values are as follows:
=0 All values converted without error.
<0 Error. An error was detected in the input parameters.
type Type integer. The variable type code used by the libraries. The following table lists these
codes, shows the corresponding NOS/VE and Cray formats (and the formats’ mapping to one
another).

004– 2165– 002 377


NVE2CRAY ( 3F ) NVE2CRAY ( 3F )

Code NOS/VE Cray

1 INTEGER(64-bit) INTEGER(64-bit)
2 REAL(64-bit) REAL(64-bit)
3 DOUBLE(128-bit) DOUBLE(128-bit)
4 COMPLEX(2*64-bit) COMPLEX(2*64-bit)
5 LOGICAL(64-bit) LOGICAL(64-bit)
6 (no-op) CHARACTER (ASCII) CHAR (ASCII)(8-bit)
7 INTEGER(64-bit) INTEGER(24)(64-bit)

num Type integer variable, array, or constant. Number of data items to convert.
foreign NVE2CRAY: Variable or array of any noncharacter type and of any length containing the
NOS/VE format data to convert.
CRAY2NVE: Variable or array of any noncharacter type and of any length to receive the
converted NOS/VE data.
bitoff Type integer variable, expression, or constant in the range 0 ≤ bitoff ≤ 63.
NVE2CRAY: Bit number within foreign to begin the conversion.
CRAY2NVE: Bit number within foreign to place the converted data.
Bits are numbered from 0, beginning at leftmost bit of foreign. (Bit 0 is the sign bit.)
cray Variable or array of any noncharacter type or length containing the Cray format data,
word-aligned.
strd Type integer variable, expression, or constant.
NVE2CRAY: Memory increment for storing the conversion results in cray. If strd = 1, the items
are placed in contiguous memory locations in cray. If strd > 1, the items are placed in cray in
memory locations at intervals specified by strd. For example, if strd = 3, the input items are
stored in cray at locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are taken from foreign in a continuous bit stream.
CRAY2NVE: Memory increment for loading the Cray items to be converted. If strd = 1, the
items are taken from contiguous memory locations in cray. If strd > 1, the items are taken from
cray memory locations at intervals specified by strd. For example, if strd = 3, the items are
taken from cray locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are placed in foreign in a continuous bit stream.
For double-word items, this is a stride of items, not of words. Default stride for complex input
is 1. For character data, strd must equal 1.
Default value is 1.
This is an optional argument.

378 004– 2165– 002


NVE2CRAY ( 3F ) NVE2CRAY ( 3F )

craychar Type Character*N. Variable or array containing the Cray format data. This must be used in
place of cray when the variable type is character. If craychar is supplied, cray is ignored. This
is an optional argument.

CAUTION
The foreign and cray variables should not be associated (aliased to each other).

EXAMPLES
Example 1: The following code converts LENGTH NOS/VE REAL(64-bit) numbers in array ANVE to Cray
REAL(64-bit) numbers and places the results in array ACRAY.
INT EGE R NVE 2CRAY
IRET=N VE2 CRAY(2,LE NGT H,A NVE ,0, ACR AY)
IF(IRE T.L T.0) GOTO 99 ! err or

Example 2: The following code converts the LENGTH CRAY REAL(64-bit) numbers in array ACRAY from
the previous example back to NOS/VE REAL(64-bit) numbers and places the results in array ANVE2.
INT EGE R CRA Y2NVE
IRE T=CRAY2NV E(2 ,LENGT H,ANVE 2,0,AC RAY)
IF(IRE T.L T.0) GOTO 99 ! err or

004– 2165– 002 379


RBN ( 3F ) RBN ( 3F )

NAME
RBN, RNB – Converts trailing blanks to nulls and vice versa

SYNOPSIS
INTEGER RBN, RNB, blanks, noblanks
noblanks=RBN(blanks)
blanks=RNB(noblanks)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
RBN converts trailing blanks to nulls; RNB converts trailing nulls to blanks. These routines convert 1 word
(up to 8 characters) for each invocation.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
blanks For RBN, the argument to be converted. For RNB, the argument after conversion.
noblanks For RBN, the argument after conversion. For RNB, the argument to be converted.

NOTES
Fortran programs using RBN or RNB must declare the function to be an integer.

380 004– 2165– 002


USCCTC ( 3F ) USCCTC ( 3F )

NAME
USCCTC, USCCTI – Converts EBCDIC character data to ASCII character data, and vice versa

SYNOPSIS
CALL USCCTC (src, isb, dest, num, npw [,val])
CALL USCCTI (src, dest, isb, num, npw [,val])

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems

DESCRIPTION
On IRIX systems, this routine is in libffio.so which is linked by default when compiling programs with
the MIPSpro 7 Fortran 90 compiler or when compiling programs with the -craylibs option to the
MIPSpro F77 compiler.
USCCTC converts EBCDIC character data to ASCII character data; USCCTI converts ASCII character data
to EBCDIC character data. All non-printing characters are converted to blanks.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on UNICOS, UNICOS/mk, or IRIX, the
arguments must be of type integer with KIND=8.
The following is a list of valid arguments for this routine.
src Variable or array of any type (except CHARACTER) containing the character data to be
converted.
isb An integer variable or constant containing the starting byte offset to begin the data conversion.
Bytes are numbered from left to right, with the leftmost byte as byte 1. The isb argument
applies to the src (USCCTC) or dest (USCCTI) argument.
dest Variable or array of any type (except CHARACTER) to receive the character data to be
converted.
num An integer variable or constant containing the number of characters to be converted.
npw An integer variable or constant containing the number of characters to be placed in each word of
dest (USCCTC) or obtained from each word of src (USCCTI). A positive value for npw (1 to 8)
indicates left-justification. A negative value (– 1 to – 8) indicates right-justification. For
USCCTC, left-justified output is also blank-filled. Note that npw values of 8 and – 8 are
equivalent.
val An optional integer or logical variable or constant which, if specified and nonzero (.TRUE.),
indicates that all lower case input is to be folded to upper case output. The default, if the
argument is not specified, is no case folding.

004– 2165– 002 381


USCCTC ( 3F ) USCCTC ( 3F )

NOTES
The following conditions must be met for any character data to be converted:
num ≥ 0
isb > 0
0 <  npw < 9
If num is not an even multiple of 8, the USCCTI routine will place the remaining converted characters in the
final word of dest while preserving the rest of the original contents of the word.

CAUTIONS
The same variable or array can be specified for src (input) and dest (output) if and only if isb is 1 and npw
is 8 (or – 8). The results of overlapping conversions using any other values for isb and npw are undefined.

EXAMPLES
The following Fortran code converts 800 characters from EBCDIC to ASCII. The ASCII characters are
placed one per word, right-justified.
INT EGER EBCDIC (10 0)
INT EGER ASCII (80 0)

CAL L USC CTC(EB CDI C, 1, ASC II, 800 , –1, .FA LSE .)

382 004– 2165– 002


USDCTC ( 3F ) USDCTC ( 3F )

NAME
USDCTC – Converts IBM 64-bit floating-point numbers to Cray 64-bit, single-precision numbers

SYNOPSIS
CALL USDCTC(dpn, isb, dest, num[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
USDCTC converts IBM 64-bit floating-point numbers to Cray 64-bit, single-precision numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
dpn Variable or array of any noncharacter type and of any length containing IBM 64-bit
floating-point numbers to convert.
isb Byte number to begin the conversion. Specify an integer variable, expression, or constant.
Bytes are numbered from 1, beginning at the leftmost byte position of fpn or dpn.
dest Variable or array of type real to contain the converted values.
num Number of IBM 64-bit floating-point numbers to convert. Specify an integer variable,
expression, or constant.
inc Memory increment for storing the conversion results in dest. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.

NOTES
USDCTI(3F) is the inverse of this routine.
The conversion loses (truncates) 5 to 8 bits of precision from the coefficient. No rounding is performed.

004– 2165– 002 383


USDCTI ( 3F ) USDCTI ( 3F )

NAME
USDCTI – Converts Cray 64-bit single-precision, floating-point numbers to IBM 64-bit double-precision
numbers

SYNOPSIS
CALL USDCTI(fpn, dest, isb, num, ier[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
USDCTI converts Cray Research 64-bit single-precision, real numbers to IBM 64-bit double-precision,
floating-point numbers. USDCTC(3F) is the inverse of this routine.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
fpn Variable or array of any length and type real, containing Cray Research 64-bit single-precision, real
numbers to convert.
dest Variable or array of type real to contain the converted values.
isb Byte number at which to begin storing the converted results. Specify an integer variable, expression,
or constant. Bytes are numbered from 1, beginning at the leftmost byte position of dest.
num Number of Cray Research real numbers to convert. Integer variable, expression, or constant.
ier Overflow indicator of type integer. The value is 0 if all Cray Research values convert to IBM values
without overflow; the value is nonzero if one or more Cray Research values overflowed in the
conversion.
inc Memory increment for fetching the number to be converted. This is an optional argument specified
as an integer variable, expression, or constant. The default value is 1.

Neither rounding nor truncation is required for the result. Precision is extended by introducing 8 more bits
into the rightmost byte of the fraction from the Cray Research number being converted. Numbers that
produce an underflow when converted to IBM format are converted to 64 binary 0’s. Numbers that produce
an overflow when converted to IBM format are converted to the largest IBM floating-point representation
with the sign bit set if negative. An error parameter returns nonzero to indicate that one or more numbers
converted produced an overflow. No such indication is given for underflow.

384 004– 2165– 002


USICTC ( 3F ) USICTC ( 3F )

NAME
USICTC, USICTI – Converts between IBM INTEGER*2/INTEGER*4 and Cray 64-bit integer numbers

SYNOPSIS
CALL USICTC(in, isb, dest, num, len[, inc])
CALL USICTI(in, dest, isb, num, len, ier[, inc])

IMPLEMENTATION
UNICOS systems

DESCRIPTION
USICTC converts IBM INTEGER*2 and INTEGER*4 numbers to Cray 64-bit integer numbers.
USICTI converts Cray 64-bit integer numbers to IBM INTEGER*2 or INTEGER*4 numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
in Variable or array of any noncharacter type and of any length containing IBM INTEGER*2 or
INTEGER*4 numbers or Cray 64-bit integers to convert.
isb Byte number at which to begin the conversion or at which to begin storing the converted results.
Specify an integer variable, expression, or constant. Bytes are numbered from 1, beginning at
the leftmost byte position of in (dest in USICTI).
dest Variable or array of type integer to contain the converted values.
num Number of IBM numbers or Cray integers to convert. Specify an integer variable, expression, or
constant.
len Size of the IBM numbers to convert or of IBM result numbers. These values must be 2 or 4. A
value of 2 indicates that input or output integers are INTEGER*2 (16-bit). A value of 4
indicates that input or output integers are INTEGER*4 (32-bit). Specify an integer variable,
expression, or constant.
inc Memory increment for storing the conversion results in dest or for fetching the number to be
converted. This is an optional argument specified as an integer variable, expression, or constant.
The default value is 1.
ier Overflow indicator of type integer. The value is 0 if all Cray values converted to IBM values
without overflow. The value is not 0 if one or more Cray values overflowed in the conversion.

004– 2165– 002 385


USICTC ( 3F ) USICTC ( 3F )

Numbers that produce an overflow when converted to IBM format are converted to the largest IBM integer
representation, with the sign bit set if negative. An error parameter returns nonzero to indicate that one or
more of the numbers converted produced an overflow.

386 004– 2165– 002


USICTP ( 3F ) USICTP ( 3F )

NAME
USICTP – Converts a Cray 64-bit integer to an IBM packed-decimal field

SYNOPSIS
CALL USICTP(ian, dest, isb, num)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
USICTP converts a Cray 64-bit integer to an IBM packed-decimal field.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
ian Cray integer to be converted to an IBM packed-decimal field. Specify an integer variable,
expression, or constant.
dest Variable or array of any noncharacter type and of any length to contain the packed field
generated.
isb Byte number within dest specifying the beginning location for storage. Specify an integer
variable, expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte
position of dest.
num Number of bytes to be stored. Specify an integer variable, expression, or constant.
If the input value contains more digits than can be stored in num bytes, the leftmost digits are not converted.

NOTES
USPCTC(3F) is the inverse of this routine.

004– 2165– 002 387


USLCTC ( 3F ) USLCTC ( 3F )

NAME
USLCTC, USLCTI – Converts between IBM LOGICAL*1/LOGICAL*4 and Cray 64-bit logical values

SYNOPSIS
CALL USLCTC(src, isb, dest, num, len[, inc])
CALL USLCTI(src, dest, isb, num, len[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
USLCTC converts IBM LOGICAL*1 and LOGICAL*4 values to Cray 64-bit logical values.
USLCTI converts Cray logical values to IBM LOGICAL*1 or LOGICAL*4 values.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
src Variable or array of any noncharacter type (type logical in USLCTI) and any length containing
IBM LOGICAL*1, LOGICAL*4, or Cray logical values to convert.
isb Byte number to begin the conversion or, in USLCTI, specifying the beginning location for
storage. Specify an integer variable, expression, or constant. Bytes are numbered from 1,
beginning at the leftmost byte position of src.
dest Variable or array of any noncharacter type and of any length to contain the converted values.
num Number of IBM or Cray logical values to be converted. Specify an integer variable, expression,
or constant.
len Size of the IBM logical values to convert or of the logical result value. These values must be 1
or 4. A value of 1 indicates that input or output logical values are LOGICAL*1 (8-bit). A
value of 4 indicates that input or output logical values are LOGICAL*4 (32-bit). Specify an
integer variable, expression, or constant.
inc Memory increment for storing the conversion results in dest or for fetching the number to be
converted. This is an optional argument specified as an integer variable, expression, or constant.
The default value is 1.
All arguments must be entered in the same order in which they appear in the SYNOPSIS section.

388 004– 2165– 002


USPCTC ( 3F ) USPCTC ( 3F )

NAME
USPCTC – Converts a specified number of bytes of IBM packed-decimal field to 64-bit integer field

SYNOPSIS
CALL USPCTC(src, isb, num, ian)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
USPCTC converts a specified number of bytes of IBM packed-decimal field to 64-bit integer field.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
src Variable or array of any noncharacter type and of any length containing a valid IBM
packed-decimal field.
isb Byte number to begin the conversion. Specify an integer variable, expression, or constant.
Bytes are numbered from 1, beginning at the leftmost byte position of src.
num Number of bytes to convert. Specify an integer variable, expression, or constant.
ian Returned integer result.
The input field must be a valid packed-decimal number less than 16 bytes long. Only the rightmost 15 digits
are converted.

NOTES
USICTP(3F) is the inverse of this routine.

004– 2165– 002 389


USSCTC ( 3F ) USSCTC ( 3F )

NAME
USSCTC – Converts IBM 32-bit floating-point numbers to Cray 64-bit single-precision numbers

SYNOPSIS
CALL USSCTC(fpn, isb, dest, num[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
USSCTC converts IBM real numbers to Cray real numbers. The result does not require rounding or
truncation.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
fpn Variable or array of any noncharacter type and of any length containing IBM 32-bit
floating-point numbers to convert.
isb Byte number to begin the conversion. Specify an integer variable, expression, or constant.
Bytes are numbered from 1, beginning at the leftmost byte position of fpn.
dest Variable or array of type real to contain the converted values.
num Number of IBM 32-bit floating-point numbers to convert. Specify an integer variable,
expression, or constant.
inc Memory increment for storing the conversion results in dest. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.

NOTES
USSCTI(3F) is the inverse of this routine.

390 004– 2165– 002


USSCTI ( 3F ) USSCTI ( 3F )

NAME
USSCTI – Converts Cray 64-bit single-precision, floating-point numbers to IBM 32-bit single-precision
numbers

SYNOPSIS
CALL USSCTI(fpn, dest, isb, num, ier[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
USSCTI converts Cray 64-bit single-precision, floating-point numbers to IBM 32-bit single-precision,
floating-point numbers. Numbers that produce an underflow when converted to IBM format are converted to
32 binary 0’s. Numbers that produce an overflow when converted to IBM format are converted to the
largest IBM floating-point representation, with the sign bit set if negative.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
fpn Variable or array of any length and type real, containing Cray 64-bit single-precision,
floating-point numbers to convert.
dest Variable or array of type real to contain the converted values.
isb Byte number at which to begin storing the converted results. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte position of
dest.
num Number of Cray floating-point numbers to convert. Specify an integer variable, expression, or
constant.
ier Overflow indicator of type integer. Value is 0 if all Cray values convert to IBM values without
overflow. Value is nonzero if one or more Cray values overflowed in the conversion.
inc Memory increment for fetching the number to be converted. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.
An error argument returns nonzero to indicate that one or more numbers converted produced an overflow.
No such indication is given for underflow.

004– 2165– 002 391


USSCTI ( 3F ) USSCTI ( 3F )

NOTES
USSCTC(3F) is the inverse of this routine. This routine truncates, rather than rounds, the result.

392 004– 2165– 002


VAX2CRAY ( 3F ) VAX2CRAY ( 3F )

NAME
VAX2CRAY, CRAY2VAX – Converts VAX data to Cray format and vice versa

SYNOPSIS
INTEGER VAX2CRAY
iret=VAX2CRAY(type, num, foreign, bitoff, cray[, strd[, craychar]])
INTEGER CRAY2VAX
iret=CRAY2VAX(type, num, foreign, bitoff, cray[, strd[, craychar]])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
VAX2CRAY converts VAX data to Cray format. It accepts as input a bit string starting at foreign at bit bitoff
and converts the data according to type, placing the converted data in cray.
CRAY2VAX converts Cray data to VAX format. It accepts as input a bit string starting at cray and converts
the data according to type, placing the converted data in foreign at bit bitoff.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
iret The returned function values are as follows:
=0 All values converted without error.
<0 Error. An error was detected in the input parameters.
type Type integer. The variable type code used by the libraries. The following table lists these
codes, shows the corresponding VAX and Cray formats (and the formats’ mapping to one
another), and lists the rounding versus truncation strategy of the result.

004– 2165– 002 393


VAX2CRAY ( 3F ) VAX2CRAY ( 3F )

Code VAX Cray VAX2CRAY CRAY2VAX

1 INTEGER*4 INTEGER(64-bit)
2 REAL*4 REAL(64-bit) Neither Rounding
3 REAL*8 DOUBLE(128-bit) Neither Rounding
4 COMPLEX*4 COMPLEX(2*64-bit) Neither Rounding
5 LOGICAL*4 LOGICAL(64-bit)
6 (no-op) CHARACTER (ASCII) CHAR (ASCII)(8-bit)
7 INTEGER*2 INTEGER(24)(64-bit)

num Type integer variable, array, or constant. Number of data items to convert.
foreign VAX2CRAY: Variable or array of any noncharacter type and of any length containing the VAX
format data to convert.
CRAY2VAX: Variable or array of any noncharacter type and of any length to receive the
converted VAX data.
bitoff Type integer variable, expression, or constant in the range 0 ≤ bitoff ≤ 63.
VAX2CRAY: Bit number within foreign to begin the conversion.
CRAY2VAX: Bit number within foreign to place the converted data.
Bits are numbered from 0, beginning at leftmost bit of foreign. (Bit 0 is the sign bit.)
cray Variable or array of any noncharacter type and of any length containing the Cray format data,
word-aligned.
strd Type integer variable, expression, or constant.
VAX2CRAY: Memory increment for storing the conversion results in cray. If strd = 1, the items
are placed in contiguous memory locations in cray. If strd > 1, the items are placed in cray in
memory locations at intervals specified by strd. For example, if strd = 3, the input items are
stored in cray at locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are taken from foreign in a continuous bit stream.
CRAY2VAX: Memory increment for loading the Cray items to be converted. If strd = 1, the
items are taken from contiguous memory locations in cray. If strd > 1, the items are taken from
cray memory locations at intervals specified by strd. For example, if strd = 3, the items are
taken from cray locations cray(1), cray(4), cray(7), cray(10), and so on. Regardless of this
argument, the input bits are placed in foreign in a continuous bit stream.
For double-word items, this is a stride of items, not of words. Default stride for complex input
is 1. For character data, strd must equal 1.
Default value is 1.
This is an optional argument.

394 004– 2165– 002


VAX2CRAY ( 3F ) VAX2CRAY ( 3F )

craychar Type Character*n. Variable or array containing the Cray format data. Must be used instead of
cray when the variable type is character. If craychar is supplied, cray is ignored. This is an
optional argument.

CAUTION
The foreign and cray variables should not be associated (aliased to each other).

EXAMPLES
Example 1: The following code converts LENGTH VAX REAL*4 numbers in array AVAX to Cray
REAL(64-bit) numbers and places the results in array ACRAY.
INT EGE R VAX 2CRAY
IRET=V AX2 CRAY(2,LE NGT H,A VAX ,0, ACR AY)
IF(IRE T.L T.0) GOTO 99 ! err or

Example 2: The following code converts the LENGTH CRAY REAL(64-bit) numbers in array ACRAY from
the previous example back to VAX REAL*4 numbers and places the results in array AVAX2.
INT EGE R CRA Y2VAX
IRE T=CRAY2VA X(2 ,LENGT H,AVAX 2,0,AC RAY)
IF(IRE T.L T.0) GOTO 99 ! err or

004– 2165– 002 395


VAX2MIPS ( 3F ) VAX2MIPS ( 3F )

NAME
VAX2MIPS, MIPS2VAX – Converts generic IEEE data to MIPS IEEE data and vice versa

SYNOPSIS
INTEGER VAX2MIPS, MIPS2VAX
ierr = VAX2MIPS(type, num, foreign, bitoff, native, stride, natlen, forlen[,nativech])
ierr = MIPS2VAX(type, num, foreign, bitoff, native, stride, natlen, forlen[,nativech])

IMPLEMENTATION
IRIX systems

DESCRIPTION
VAX2MIPS converts VAX data types (abbreviated as "VAX" in the following text) to data for systems that
use MIPS data types (abbreviated as "MIPS" in the following text).
MIPS2VAX converts MIPS data types to VAX data types.
When using the MIPSpro 7 Fortran 90 compiler on IRIX systems, all arguments must be of default kind
unless documented otherwise. On IRIX systems, the default kind is KIND=4.
The following is a list of valid parameters for this routine.
type An integer giving the data type code, as follows.
Code Description
1 Typeless (no translation; natlen and forlen must be equal and must be 8-, 16-, 32-, 64-,
128-, or 256-bits.)
2 Integer
VAX: 64-, 32-, 16, or 8-bit twos complement
MIPS: 64-, 32-, 16, or 8-bit twos complement
3 Real
VAX: 32- (F), 64- (D), or 128-bit (G) VAX floating-point
MIPS: 32-, 64-, or 128-bit MIPS floating-point
4 Complex
VAX: 2 x 32-, 64-, or 128-bit Ifloating-point
MIPS: 2 x 32-, 64-, or 128-bit MIPSfloating-point
5 Logical
VAX: 64-, 32-, 16-, or 8-bit zero/nonzero logical
MIPS: 64-, 32-, 16-, or 8-bit zero/nonzero logical
6 Character
ASCII to ASCII; no translation.

396 004– 2165– 002


VAX2MIPS ( 3F ) VAX2MIPS ( 3F )

The natlen and forlen parameters select the size of the data.
num Number of data items to convert. Type integer variable, expression, or constant.
foreign Variable or array of any noncharacter type or length to contain data which is not native to the
current system.
bitoff Integer variable, expression, or constant giving the bit offset within the foreign data variable or
array to begin the conversion. bitoff must be at least 0 and no more than 63.
native Variable or array of any noncharacter type or length to contain data which is native to the current
system. This variable or array should be of a type that corresponds to type. If type=6, use a
dummy integer variable and the nativech parameter (see description of nativech).
stride Integer variable or constant giving the memory increment for loading or storing data to the native
array. For two and four-word items (complex and double-precision), this is a stride of items, not
of words. For typeless, stride is always in words.
This parameter is ignored for CHARACTER (type = 6). Data in the foreign array is loaded or
stored in a continuous bit stream regardless of this parameter.
natlen Native storage length of an item, in bits. For COMPLEX data, natlen counts the total size of the
real and imaginary component.
forlen Foreign storage length of an item, in bits. For COMPLEX data, forlen counts the total size of the
real and imaginary components.
nativech Optional character parameter specifying native target variable if it is of type character (type = 6).
This parameter is ignored if type is not character.

CAUTION
The foreign and native variables should not be associated (aliased to each other).

RETURN VALUES
The returned function values are as follows:
<0 Parameter error; no translation performed.
-1 Parameter error; too few arguments or nativech not specified with type = 6. This error is not returned
on IRIX systems.
-2 Parameter error; invalid type.
-3 Parameter error; invalid num.
-4 Parameter error; invalid bitoff.
-5 Parameter error; invalid natlen.
-6 Parameter error; invalid forlen.
-7 Unable to malloc() memory for translation.

004– 2165– 002 397


VAX2MIPS ( 3F ) VAX2MIPS ( 3F )

-8 Combination of natlen and forlen is invalid.


-9 native must be 64-bit word-aligned.
-10 foreign must be 64-bit word-aligned.
0 Translation complete; no errors.
>0 Translation complete; return value is the number of integer or real values that completely overflowed
during conversion. Overflows and NaNs which exist before conversion are not included.

398 004– 2165– 002


VXDCTC ( 3F ) VXDCTC ( 3F )

NAME
VXDCTC – Converts VAX 64-bit, D-format numbers to Cray 64-bit single-precision numbers

SYNOPSIS
CALL VXDCTC(dpn, isb, dest, num[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
dpn Variable or array of any noncharacter type and of any length containing VAX D-format numbers
to convert.
isb Byte number within dpn at which to begin the conversion. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte of dpn.
dest Variable or array of type real to contain the converted values.
num Number of VAX D-format numbers to convert. Specify an integer variable, expression, or
constant.
inc Memory increment for storing the conversion results in dest. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.

NOTES
VXDCTI(3F) is the inverse of this routine. This routine truncates, rather than rounds, the result.

004– 2165– 002 399


VXDCTI ( 3F ) VXDCTI ( 3F )

NAME
VXDCTI – Converts Cray 64-bit single-precision, floating-point (real) numbers to VAX D-format, 64-bit,
double-precision, floating-point numbers

SYNOPSIS
CALL VXDCTI(fpn, dest, isb, num, ier[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
fpn Variable or array of any length and type real containing Cray 64-bit single-precision, real
numbers to convert.
dest Variable or array of type real to contain the converted values.
isb Byte number at which to begin storing the converted results. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte position of
dest.
num Number of Cray real numbers to convert. Specify an integer variable, expression, or constant.
ier Overflow indicator of type integer. The value is 0 if all Cray values convert to VAX values
without overflow. The value is nonzero if one or more Cray values overflowed in the
conversion.
inc Memory increment for fetching the number to be converted. This is an optional argument
specified as an integer variable, expression, or constant.
Numbers that produce an underflow when converted to VAX format are converted to 64 binary 0’s.
Numbers that are in overflow on the Cray system are converted to a "reserved" floating-point representation,
with the sign bit set if negative. Numbers that are valid on the Cray system, but overflow on the VAX
system, are converted to the most positive possible number or most negative possible number, depending on
the sign.
An error argument returns nonzero to indicate that one or more numbers converted produced an overflow.
(Deferred implementation. At present, you must supply the argument, which is always returned as 0.) No
such indication is given for underflow.

400 004– 2165– 002


VXDCTI ( 3F ) VXDCTI ( 3F )

NOTES
VXDCTC(3F) is the inverse of this routine. This routine rounds, rather than truncates, the result.

004– 2165– 002 401


VXGCTC ( 3F ) VXGCTC ( 3F )

NAME
VXGCTC – Converts VAX 64-bit G-format numbers to Cray 64-bit single-precision numbers

SYNOPSIS
CALL VXGCTC(dpn, isb, dest, num[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
VXGCTC converts VAX 64-bit G-format numbers to Cray 64-bit single-precision numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
dpn Variable or array of any noncharacter type and of any length containing VAX G-format numbers
to convert.
isb Byte number within dpn at which to begin the conversion. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte of dpn.
dest Variable or array of type real to contain the converted values.
num Number of VAX G-format numbers to convert. Specify an integer variable, expression, or
constant.
inc Memory increment for storing the conversion results in dest. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.

NOTES
VXGCTI(3F) is the inverse of this routine. This routine truncates, rather than rounds, the result.

402 004– 2165– 002


VXGCTI ( 3F ) VXGCTI ( 3F )

NAME
VXGCTI – Converts Cray 64-bit single-precision, floating-point (real) numbers to VAX G-format, 64-bit,
single-precision, floating-point numbers

SYNOPSIS
CALL VXGCTI(fpn, dest, isb, num, ier[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
VXGCTI converts Cray 64-bit single-precision real numbers to VAX G-format single-precision, floating-point
numbers. The result fits entirely in the target data structure, so neither rounding nor truncation is required.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
fpn Variable or array of any length and type real, containing Cray 64-bit single-precision,
floating-point numbers to convert.
dest Variable or array of type real to contain the converted values.
isb Byte number at which to begin storing the converted results. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte position of
dest.
num Number of Cray real numbers to convert. Specify an integer variable, expression, or constant.
ier Overflow indicator of type integer. The value is 0 if all Cray values convert to VAX values
without overflow. The value is nonzero if one or more Cray values overflowed in the
conversion.
inc Memory increment for fetching the number to be converted. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.
Numbers that produce an underflow when converted to VAX format are converted to 64 binary 0’s.
Numbers that are in overflow on the UNICOS system are converted to a "reserved" floating-point
representation, with the sign bit set if negative. Numbers that are valid on the UNICOS system, but
overflow on the VAX system, are converted to the most positive possible number or the most negative
possible number, depending on the sign.

004– 2165– 002 403


VXGCTI ( 3F ) VXGCTI ( 3F )

An error argument returns nonzero to indicate that one or more numbers converted produced an overflow.
(Deferred implementation. At present, you must supply the parameter, which is always returned as 0.) No
such indication is given for underflow.

NOTES
VXGCTC(3F) is the inverse of this routine.

404 004– 2165– 002


VXICTC ( 3F ) VXICTC ( 3F )

NAME
VXICTC – Converts VAX INTEGER*2 (16 bits) or INTEGER*4 (32 bits) to Cray 64-bit integers

SYNOPSIS
CALL VXICTC(in, isb, dest, num, len[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
VXICTC converts VAX INTEGER*2 (16 bits) or INTEGER*4 (32 bits) to Cray 64-bit integers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
in Variable or array of any noncharacter type and of any length containing VAX 16-bit or 32-bit
integers.
isb Byte number at which to begin the conversion. Specify an integer variable, expression, or
constant. Bytes are numbered from 1, beginning at the leftmost byte position of in.
dest Variable or array of type integer to contain the converted values.
num Number of VAX integers to convert. Specify an integer variable, expression, or constant.
len Size of the VAX numbers to convert. This value must be 2 or 4. A value of 2 indicates that
input integers are 16-bit integers. A value of 4 indicates that input integers are 32-bit integers.
Specify an integer variable, expression, or constant.
inc Memory increment for storing conversion results in dest. This is an optional argument specified
as an integer variable, expression, or constant. The default value is 1.

NOTES
Instead of using the VXICTC routine, use the newer VAX2CRAY routine. Select a type of 7 for an
INTEGER*2 conversion and 1 for an INTEGER*4 conversion.
VXICTI(3F) is the inverse of this routine.

SEE ALSO
VAX2CRAY(3F)

004– 2165– 002 405


VXICTI ( 3F ) VXICTI ( 3F )

NAME
VXICTI – Converts Cray 64-bit integers to VAX INTEGER*2 (16 bit) or INTEGER*4 (32 bit) numbers

SYNOPSIS
CALL VXICTI(in, dest, isb, num, len, ier[, inc])

IMPLEMENTATION
UNICOS systems

DESCRIPTION
VXICTI converts Cray 64-bit integers to VAX INTEGER*2 (16-bit) or INTEGER*4 (32-bit) numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
in Variable or array of any length and type integer, containing Cray integers to convert.
dest Variable or array of type integer to contain the converted values.
isb Byte number at which to begin storing the converted results. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte position of
dest.
num Number of Cray integers to convert. Specify an integer variable, expression, or constant.
len Size of the VAX result numbers. This value must be 2 or 4. A value of 2 indicates that output
integers are INTEGER*2 (16-bit). A value of 4 indicates that output integers are INTEGER*4
(32-bit). Specify an integer variable, expression, or constant.
ier Overflow indicator of type integer. The value is 0 if all Cray values are converted to VAX
values without overflow. The value is nonzero if one or more Cray values overflowed in the
conversion.
inc Memory increment for fetching the number to be converted. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.
Numbers that produce an overflow when converted to VAX format are converted to the largest VAX integer
representation, with the sign bit set if negative.
An error argument returns nonzero to indicate that one or more numbers converted produced an overflow.
(Deferred implementation. At present, you must supply the parameter, which is always returned as 0.) No
such indication is given for underflow.

406 004– 2165– 002


VXICTI ( 3F ) VXICTI ( 3F )

NOTES
Instead of using the VXICTI routine, use the newer CRAY2VAX routine, which is documented on the
VAX2CRAY man page. Select a type of 7 for an INTEGER*2 conversion and 1 for an INTEGER*4
conversion.
VXICTC(3F) is the inverse of this routine.

SEE ALSO
VAX2CRAY(3F)

004– 2165– 002 407


VXLCTC ( 3F ) VXLCTC ( 3F )

NAME
VXLCTC – Converts VAX 32-bit logical numbers to Cray 64-bit logical numbers

SYNOPSIS
CALL VXLCTC(src, isb, dest, num, len[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
VXLCTC converts VAX 32-bit logical values to Cray 64-bit logical values.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
src Variable or array of any noncharacter type and of any length containing VAX logical values to
convert.
isb Byte number at which to begin the conversion. Specify an integer variable, expression, or
constant. Bytes are numbered from 1, beginning at the leftmost byte position of src.
dest Variable or array of type logical to contain the converted values.
num Number of VAX logical values to be converted. Specify an integer variable, expression, or
constant.
len Size of the VAX logical values to convert. At present, this argument must be set to 4,
indicating that 32-bit logical values are to be converted. Specify an integer variable, expression,
or constant.
inc Memory increment for storing the conversion results in dest. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.

NOTES
Instead of using the VXLCTC routine, use the newer VAX2CRAY routine. Select a type of 5. VXLCTI(3F)
is the inverse of this routine.

SEE ALSO
VAX2CRAY(3F)

408 004– 2165– 002


VXLCTI ( 3F ) VXLCTI ( 3F )

NAME
VXLCTI – Converts Cray 64-bit logical numbers to VAX 32-bit logical numbers

SYNOPSIS
CALL VXLCTI(in, dest, isb, num, len, ier[,inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
VXLCTI converts Cray 64-bit logical numbers to VAX 32-bit logical numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
in Variable or array of any length and type logical, containing Cray logical numbers to convert.
dest Variable or array of type integer to contain the converted values.
isb Byte number at which to begin storing the converted results. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte position of
dest.
num Number of Cray integers to convert. Specify an integer variable, expression, or constant.
len Size of the VAX result. You must specify this as 4 (32-bit logical numbers).
ier A 0 is always returned (stored into) for this parameter. The parameter is required for
consistency with similar subroutines.
inc Memory increment for fetching the number to be converted. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.

NOTES
Instead of using the VXLCTI routine, use the newer CRAY2VAX routine, which is documented on the
VAX2CRAY man page. Select a type of 5.
VXLCTC(3F) is the inverse of this routine.

SEE ALSO
VAX2CRAY(3F)

004– 2165– 002 409


VXSCTC ( 3F ) VXSCTC ( 3F )

NAME
VXSCTC – Converts VAX 32-bit floating-point numbers to Cray 64-bit single-precision real numbers

SYNOPSIS
CALL VXSCTC(fpn, isb, dest, num [,inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
VXSCTC converts VAX 32-bit floating-point numbers to Cray 64-bit single-precision real numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
fpn Variable or array of any noncharacter type containing VAX 32-bit floating-point numbers to
convert.
isb Byte number at which to begin the conversion. Specify an integer variable, expression, or
constant. Bytes are numbered from 1, beginning at the leftmost byte position of fpn.
dest Variable or array of type real to contain the converted values.
num Number of VAX floating-point numbers to convert. Specify an integer variable, expression, or
constant.
inc Memory increment for storing the conversion results in dest. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.

NOTES
Instead of using the VXSCTC routine, use the newer VAX2CRAY routine. Select a type of 2. VXSCTI(3F)
is the inverse of this routine.
The resulting data structure is large enough to contain the whole number, so neither rounding nor truncation
is required.

SEE ALSO
VAX2CRAY(3F)

410 004– 2165– 002


VXSCTI ( 3F ) VXSCTI ( 3F )

NAME
VXSCTI – Converts Cray 64-bit single-precision, floating-point (real) numbers to VAX F format, 32-bit,
single-precision, floating-point numbers

SYNOPSIS
CALL VXSCTI(fpn, dest, isb, num, ier[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
VXSCTI converts Cray 64-bit single-precision, floating point (real) to VAX F format, 32-bit,
single-precision, floating point.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
fpn Variable or array of any length and type real, containing Cray 64-bit real numbers to convert.
dest Variable or array of type real to contain the converted values.
isb Byte number at which to begin storing the converted results. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte position of
dest.
num Number of Cray real numbers to convert. Specify an integer variable, expression, or constant.
ier Overflow indicator of type integer. The value is 0 if all Cray values convert to VAX values
without overflow. The value is nonzero if one or more Cray values overflowed in the
conversion.
inc Memory increment for fetching the number to be converted. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.
Numbers that produce an underflow when converted to VAX format are converted to 32 binary zeros.
Numbers that are in overflow on the Cray system are converted to a "reserved" floating-point representation,
with the sign bit set if negative. Numbers that are valid on the Cray system, but overflow on the VAX
system, are converted to the most positive possible number or the most negative possible number, depending
on the sign.
An error argument returns nonzero to indicate that one or more numbers converted produced an overflow
(Deferred implementation. At present you must supply the argument, which is always returned as 0.) No
such indication is given for underflow.

004– 2165– 002 411


VXSCTI ( 3F ) VXSCTI ( 3F )

NOTES
Instead of using the VXSCTI routine, use the newer CRAY2VAX routine, which is documented on the
VAX2CRAY man page. Select a type of 2.
VXSCTC(3F) is the inverse of this routine.
This routine rounds, rather than truncates, the result.

SEE ALSO
VAX2CRAY(3F)

412 004– 2165– 002


VXZCTC ( 3F ) VXZCTC ( 3F )

NAME
VXZCTC – Converts VAX 64-bit complex numbers to Cray 128-bit complex numbers

SYNOPSIS
CALL VXZCTC(dpn, isb, dest, num[, inc])

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
VXZCTC converts VAX 64-bit complex numbers to Cray 128-bit complex numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
dpn Variable or array of any noncharacter type and of any length containing complex numbers to
convert.
isb Byte number within dpn at which to begin the conversion. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte of dpn.
dest Variable or array of type complex to contain the converted values.
num Number of complex numbers to convert. Specify an integer variable, expression, or constant.
inc Memory increment for storing the conversion results in dest. This is an optional argument
specified as an integer variable, expression, or constant. Default value is 1.

NOTES
Instead of using the VXZCTC routine, use the newer VAX2CRAY routine. Select a type of 4. VXZCTI(3F)
is the inverse of this routine.
This routine truncates rather than rounds the result.

SEE ALSO
VAX2CRAY(3F)

004– 2165– 002 413


VXZCTI ( 3F ) VXZCTI ( 3F )

NAME
VXZCTI – Converts Cray 128-bit complex numbers to VAX 64-bit complex numbers

SYNOPSIS
CALL VXZCTI(fpn, dest, isb, num, ier[, inc])

IMPLEMENTATION
UNICOS systems

DESCRIPTION
VXZCTI converts Cray 128-bit complex numbers to VAX 64-bit complex numbers.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
fpn Variable or array of any length and of type complex, containing Cray complex numbers to
convert.
dest Variable or array of any noncharacter type to contain the converted values.
isb Byte number at which to begin storing the converted results. Specify an integer variable,
expression, or constant. Bytes are numbered from 1, beginning at the leftmost byte position of
dest.
num Number of Cray complex numbers to convert. Specify an integer variable, expression, or
constant.
ier Overflow indicator of type integer. The value is 0 if all Cray values convert to VAX values
without overflow. The value is nonzero if one or more Cray values overflowed in the
conversion.
inc Memory increment for fetching the number to be converted. This is an optional argument
specified as an integer variable, expression, or constant. The default value is 1.

Numbers that produce an underflow when converted to VAX format are converted to two words of 32 binary
zeros. Numbers that are in overflow on the Cray system are converted to a "reserved" floating-point
representation, with the sign bit set if negative. Numbers that are valid on the Cray system but overflow on
the VAX system are converted to the most positive possible number or the most negative possible number,
depending on the sign.
An error argument returns nonzero to indicate that one or more numbers converted produced an overflow.
(Deferred implementation. At present, you must supply the argument, which is always returned as 0.) No
such indication is given for underflow.

414 004– 2165– 002


VXZCTI ( 3F ) VXZCTI ( 3F )

NOTES
Instead of using the VXZCTI routine, use the newer CRAY2VAX routine, which is documented on the
VAX2CRAY(3F) man page. Select a type of 4.
VXZCTC(3F) is the inverse of this routine.
This routine rounds rather than truncates the result.

SEE ALSO
VAX2CRAY(3F)

004– 2165– 002 415


416 004– 2165– 002
INTRO_INTERFACE ( 3F ) INTRO_INTERFACE ( 3F )

NAME
INTRO_INTERFACE – Introduction to system interface routines

IMPLEMENTATION
See individual man pages for implementation details

DESCRIPTION
System interface routines are grouped into the following categories:
• Job control routines
• Floating-point interrupt routines
• Special-purpose interface routines
• Miscellaneous routines

JOB CONTROL ROUTINES


Job control routines perform functions relating to program termination, either causing a termination or
instructing the system on how to handle a termination. Control is not returned.
The ABORT routine requests abort with traceback. The EXIT routine exits from a Fortran program. The
ERREXIT routine requests an abort.

FLOATING-POINT INTERRUPT ROUTINES


Floating-point interrupt routines allow you to test, set, and clear the Floating-point Interrupt Mode flag.
Subroutine linkage is call-by-address.
The CLEARFI routine temporarily prohibits floating-point interrupts; the SETFI routine temporarily permits
floating-point interrupts; the SENSEFI routine determines if floating-point interrupts are permitted or
prohibited. These routines are documented on the CLEARFI man page. These routines are not available on
Cray T90 systems that support IEEE arithmetic.

SPECIAL-PURPOSE INTERFACE ROUTINES


The following routines are used for special-purpose interfaces:
• GETCWD: returns the current working directory.
• GETHOST: gets name of host mainframe.
• GETARG: returns a command-line argument (documented on the IARGC man page).
• GETOARG: gets command-line arguments.
• GETOARGC: gets command-line arguments.
• GETVARG: gets command-line arguments, allowing blanks or commas as delimiters.

004– 2165– 002 417


INTRO_INTERFACE ( 3F ) INTRO_INTERFACE ( 3F )

• GETVARGC: gets command-line arguments, allowing blanks or commas as delimeters.


• IARGC: returns the number of command-line arguments.
• ISHELL: executes a shell command.
• NLIMIT: sets or obtains resource limit values.
• REMARK: enters a message (preceded by a message prefix) in the stderr file.
• REMARK2: enters a message in the stderr file.
• REMARKF: enters a formatted message in the stderr file.
• UNAME: gets name of current operating system.

MISCELLANEOUS ROUTINES
The CLEARBT routine disables bidirectional memory transfers.
The SETBT routine enables bidirectional memory transfers.
The GETHOST routine returns name of host mainframe.
The SAMEFILE routine checks to see if two files have the same inode number.
The SENSEBT routine checks if bidirectional memory transfer is enabled or disabled.

418 004– 2165– 002


ABORT ( 3F ) ABORT ( 3F )

NAME
ABORT – Requests abort with traceback

SYNOPSIS
CALL ABORT[(msg)]

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems

DESCRIPTION
ABORT requests an abort with traceback and provides an optional message written to the stderr file and
creates a core dump.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on UNICOS, UNICOS/mk, or IRIX, all
arguments must be of default kind unless documented otherwise. On UNICOS and UNICOS/mk, default
kind is KIND=8 for integer, real, complex, and logical arguments; on IRIX, the default kind is KIND=4.
msg Optional message of type character for stderr file.

004– 2165– 002 419


CLEARBT ( 3F ) CLEARBT ( 3F )

NAME
CLEARBT, SETBT – Temporarily disables or enables bidirectional memory transfers

SYNOPSIS
CALL CLEARBT
CALL SETBT

IMPLEMENTATION
UNICOS systems

DESCRIPTION
CLEARBT temporarily disables bidirectional memory transfers and SETBT temporarily enables bidirectional
memory transfers.
These routines are local to a current process (such as a program). The system restores the most recent mode
setting at the start of the next process. No arguments are required or returned.

420 004– 2165– 002


CLEARFI ( 3F ) CLEARFI ( 3F )

NAME
CLEARFI, SENSEFI, SETFI – Modifies floating-point interrupt status

SYNOPSIS
INTEGER modefi
CALL CLEARFI
CALL SENSEFI(modefi)
CALL SETFI

IMPLEMENTATION
UNICOS systems (except Cray T90 systems that support IEEE arithmetic)

DESCRIPTION
These Fortran-callable routines let you modify the floating-point interrupt status.
SETFI sets the interrupt bit.
CLEARFI clears the interrupt bit.
SENSEFI returns the current interrupt status in modefi.
modefi Returns a 1 if floating-point interrupts are enabled; if floating-point interrupts are disabled, it
returns a 0.

NOTES
Under the UNICOS operating system, CLEARFI and SETFI are local to a current process. The system
restores the most recent mode setting at the start of the next process. No arguments or parameters are
required.

004– 2165– 002 421


ERREXIT ( 3F ) ERREXIT ( 3F )

NAME
ERREXIT – Requests abort

SYNOPSIS
CALL ERREXIT

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
ERREXIT calls the abort function and provides an error exit from a Fortran program.

422 004– 2165– 002


EXIT ( 3F ) EXIT ( 3F )

NAME
EXIT – Exits from a Fortran program

SYNOPSIS
UNICOS and UNICOS/mk systems:
CALL EXIT[(istat)]
IRIX systems:
CALL EXIT(istat)

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems

DESCRIPTION
On IRIX systems, the information on this man page is valid only for programs compiled with the MIPSpro 7
Fortran 90 compiler.
EXIT ends the execution of a Fortran program.
istat EXIT ends the execution of a Fortran program. On UNICOS/mk systems, it terminates
execution on the local processing element (PE). The integer status istat is optional on UNICOS
systems and is required on IRIX systems. The default exit status is 0.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on UNICOS, UNICOS/mk, or IRIX, all
arguments must be of default kind unless documented otherwise. On UNICOS and UNICOS/mk, default
kind is KIND=8 for integer, real, complex, and logical arguments; on IRIX, the default kind is KIND=4.

NOTES
UNICOS and UNICOS/mk only: The single parameter to EXIT is optional. Because EXIT is
predeclared, any explicit call to it can optionally include a parameter. However, if EXIT is passed as an
actual parameter corresponding to a dummy parameter that is a procedure, and if the corresponding dummy
parameter is then called, one of the following must be done:
• The dummy procedure parameter must be declared in an interface block as having an optional integer
parameter
• The call to the dummy procedure parameter (that is, the indirect call to EXIT) must include an actual
parameter corresponding to the optional one for EXIT.

004– 2165– 002 423


GETCWD ( 3F ) GETCWD ( 3F )

NAME
GETCWD – Returns the current working directory

SYNOPSIS
CHARACTER cwd*n
CALL GETCWD(cwd)
or
CHARACTER cwd*n
INTEGER GETCWD, i
i = GETCWD(cwd)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
GETCWD returns the current working directory of the process in a character string. It can be called as either
a subroutine or a function. PXFGETCWD(3F) provides similar functionality.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The arguments are as follows:
cwd Character variable to receive the current working directory. The cwd argument must be of type
character and must be at least 1 character larger than the current working directory. Extra characters
are set to blanks.
i Integer return value (when called as a function); i can have the following values:
-2 GETCWD called with no argument or with a non-character argument
-1 The getcwd(3C) request failed, probably because the cwd variable was not long enough to
contain the complete path name (cwd will be set to all blanks)
>0 Number of characters in the name of the current working directory

SEE ALSO
getcwd(3C) in the UNICOS System Libraries Reference Manual

424 004– 2165– 002


GETHOST ( 3F ) GETHOST ( 3F )

NAME
GETHOST – Returns name of host mainframe

SYNOPSIS
CHARACTER host*n
INTEGER GETHOST, i
...
i = GETHOST(host)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
GETHOST returns the name of the host mainframe in a character string. It can be called either as a
subroutine or a function.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
GETHOST has the following arguments:
host Variable of type character to receive the host name. It should be at least as large as the host name.
Extra characters will be set to blanks.
i Return value of type integer (when called as a function); i can have the following values:
-2 GETHOST was called with no argument or with an argument of non-character type.
-1 The gethostname(2) request failed. host will be set to all blanks.
>0 Number of characters in the name of the host.

SEE ALSO
hostname(1) in the UNICOS User Commands Reference Manual
gethostname(2) in the UNICOS System Calls Reference Manual

004– 2165– 002 425


GETOARG ( 3F ) GETOARG ( 3F )

NAME
GETOARG – Gets command-line arguments

SYNOPSIS
INTEGER GETOARG
iret=GETOARG(cbuf [,length])

IMPLEMENTATION
UNICOS systems (except Cray T90 series)

DESCRIPTION
GETOARG places the next command-line argument in cbuf. Each call to GETOARG selects the next
argument. The GETOARGC(3F) routine provides similar functionality and is available on UNICOS and
UNICOS/mk systems, including the Cray T90 series.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
cbuf Variable, array, or array element of any type to receive the argument. If cbuf is character, it is
blank-padded; otherwise, cbuf is null-padded.
length The number of words available in cbuf if cbuf is not a character variable.
iret The return value; iret can have the following values:
1 If successful
0 If there are no more command-line arguments

426 004– 2165– 002


GETOARGC ( 3F ) GETOARGC ( 3F )

NAME
GETOARGC – Gets command-line arguments

SYNOPSIS
INTEGER GETOARGC
CHARACTER cbuf*m
iret=GETOARGC(cbuf)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
GETOARGC places the next command-line argument in cbuf. Each call to GETOARGC selects the next
argument.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
cbuf Variable, array, or array element of type character to receive the argument. If the argument is
shorter than cbuf, it is blank padded.
iret The return value; iret can have the following values:
1 If successful
0 If there are no more command-line arguments

004– 2165– 002 427


GETVARG ( 3F ) GETVARG ( 3F )

NAME
GETVARG – Gets command-line arguments, allowing blanks or commas as delimiters

SYNOPSIS
INTEGER GETVARG
iret=GETVARG(cbuf [,length])

IMPLEMENTATION
UNICOS systems (except Cray T90 series)

DESCRIPTION
GETVARG places the next command-line argument in cbuf. Each call to GETVARG selects the next
argument. The GETVARGC(3F) routine provides similar functionality and is available on UNICOS and
UNICOS/mk systems, including the Cray T90 series.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
cbuf Variable, array, or array element of any type to receive the argument. If cbuf is character, it is
blank-padded. Otherwise, cbuf is null-padded.
length The number of words available in cbuf if cbuf is not a character variable.
iret Return value; iret can have the following values:
1 If successful
0 If there are no more command-line arguments

428 004– 2165– 002


GETVARGC ( 3F ) GETVARGC ( 3F )

NAME
GETVARGC – Gets command-line arguments, allowing blanks or commas as delimiters

SYNOPSIS
INTEGER GETVARGC
CHARACTER cbuf*m
iret=GETVARGC(cbuf)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
GETVARGC places the next command-line argument in cbuf. Each call to GETVARGC selects the next
argument. The PXFGETARG(3F) routine provides similar functionality.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
cbuf Variable, array, or array element of type character to receive the argument. If the argument is
shorter than cbuf, it is blank-filled.
iret Return value; iret can have the following values:
1 If successful
0 If there are no more command-line arguments

004– 2165– 002 429


IARGC ( 3F ) IARGC ( 3F )

NAME
IARGC, GETARG – Returns number of command-line arguments or the argument itself

SYNOPSIS
iargs= IARGC( )
INTEGER GETARG
ichars = GETARG(i,c)
ichars = GETARG(i,c,size)

IMPLEMENTATION
GETARG is available on UNICOS systems (except Cray T90 series)
IARGC is available on UNICOS and UNICOS/mk systems

DESCRIPTION
These routines return the ith command-line argument of the current process. In addition, PXFGETARG(3F)
provides similar functionality and is available on UNICOS and UNICOS/mk systems, including the
Cray T90 series.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following are valid arguments for this routine.
iargs An integer specifying the number of command-line arguments passed to the program.
ichars An integer specifying the number of nonnull characters in the string returned.
i Integer specifying the number of the argument to return.
c Character variable or integer array in which to return the command-line argument.
size If c is an array, an integer giving the number of elements in that array.
If a program is invoked with the following command line, IARGC returns 3:
foo arg1 arg2 arg 3

SEE ALSO
GETOPT(3) in the UNICOS System Libraries Reference Manual

430 004– 2165– 002


ISHELL ( 3F ) ISHELL ( 3F )

NAME
ISHELL – Executes a UNICOS shell command

SYNOPSIS
ISTAT = ISHELL(command)

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems

DESCRIPTION
On IRIX systems, this routine is in libffio.so which is linked by default when compiling programs with
the MIPSpro 7 Fortran 90 compiler or when compiling programs with the -craylibs option to the
MIPSpro F77 compiler.
ISHELL executes a UNICOS shell command. ISHELL has the following argument:
command Command to be given to the shell; can be of type character or some numeric type. If it is a
noncharacter type, the command should consist of packed characters terminated by a null byte.
On IRIX systems, this argument must be of type character.
ISHELL passes command to the shell sh(1) as input, as if command were entered at a terminal.

RETURN VALUES
ISHELL returns the termination status filled in by the waitpid(2) system call, which is used to wait for
the child shell process. Unless the command was interrupted by a signal, its exit status is contained in bits 8
through 15 (bit 0 being the least significant bit) of the value returned by ISHELL (see the waitpid(2) man
page for more information). However, if any errors occur in running the shell or collecting its exit status,
ISHELL returns a negative number; this number is the negative value of errno corresponding to the error.

EXAMPLES

WRITE( TPM NT, 500 ) DTV , XDT , VOL , XVO L, DSN , PDN , MBS V
CALL ISH ELL (TP MNT)
500 FORMAT (’t pmn t -l sl -F U -T -g ’,a 6,’ -x ’,a 6,
+ ’-v ’,a 6,’ =’, a6, ’ -P ’,a 8,’ -f ’,a , ’ -b ’,a )

SEE ALSO
pshell(1) in the UNICOS User Commands Reference Manual
system(3C) in the UNICOS System Libraries Reference Manual

004– 2165– 002 431


NLIMIT ( 3F ) NLIMIT ( 3F )

NAME
NLIMIT – Provides an interface to setting or obtaining resource limit values

SYNOPSIS
INTEGER id, rsarray(10), errstat
CALL NLIMIT(id, rsarray, errstat)
or
iret=NLIMIT(id, rsarray, errstat)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems, the default kind is KIND=8 for integer, real, complex, and
logical arguments.
This library interface provides a means to establish or view resource limit information from the kernel based
on the following arguments:
id The pid, sid, or uid corresponding to the rsarray(2) field. A 0 indicates the current pid, sid, or
uid.
rsarray An integer array that matches the resclim structure defined in
/usr/include/sys/resource.h. The array elements and their possible values are as
follows:
Array Element Values
rsarray(1) Specified resource. Valid options are as follows:
1 – CPU time limits (see CAUTIONS)
rsarray(2) Resource category. Valid options are as follows:
1 – Process
3 – Session
4 – User ID
6 – Session process
rsarray(3) Resource type. Valid options are as follows:
0 – Absolute limit
1 – Hard limit
2 – Soft limit

432 004– 2165– 002


NLIMIT ( 3F ) NLIMIT ( 3F )

rsarray(4) Resource action. Valid options are:


1 – Terminate
2 – Checkpoint and terminate
rsarray(5) Resource used. The accumulated resource used for the resource category. For
CPU time, this value is in seconds (see CAUTIONS).
rsarray(6) Resource limit value for the absolute limit type. Used for setting the absolute
resource limit value (super user only) or for returning the absolute resource
limit value.
rsarray(7) Resource limit value for the hard limit type. Used for setting the hard
resource limit value or for returning the hard resource limit value.
rsarray(8) Resource limit value for the soft limit type. Used for setting the soft resource
limit value or for returning the soft resource limit value.
rsarray(9) Reserved for future use.
rsarray(10) Reserved for future use.
errstat An integer that contains the error status as defined in /usr/include/sys/errno.h.
errstat is set if an error has occurred with either setting a limit or returning limit information.
Typical Use
The rsarray argument contains fields used to establish or view resource limits. NLIMIT calls the
nlimit(3C) routine to set up the resclim structure according to the rsarray passed to it. nlimit then
calls getlim(2) to obtain information about resource limit values or setlim(2) to change limit values.
Obtaining Information about Resource Limits
The rsarray elements rsarray(1) and rsarray(2) must be set in order to return limit values. Element
rsarray(1) represents the resource to be queried. Currently, only CPU resources are supported, so the value
of rsarray(1) must be 1.
Element rsarray(2) identifies the category of resource to be queried. rsarray(2) determines if the id
argument is a pid, sid, or a uid. An rsarray(2) value of 6 (session process) requires an sid. Acceptable
values are as follows:
Value Return Information
1 Process limits
3 Session limits
4 User limits
6 Default process limits for the session
If the call succeeds, NLIMIT fills in the missing information in elements rsarray(4) through rsarray(10).
This includes the following elements:
Array Return Information

004– 2165– 002 433


NLIMIT ( 3F ) NLIMIT ( 3F )

rsarray(4) Resource action. Returns a value of 1 for terminate or 2 for checkpoint and terminate.
This value determines whether, when a hard limit is reached, the process is checkpointed
before termination.
rsarray(5) Resource used. Returns the amount of resource currently accumulated at the time of the
call. For CPU time, this value is the amount of CPU seconds accumulated.
rsarray(6) Absolute resource limit. Returns the absolute resource limit for the specified resource. For
CPU time, this value is in seconds.
rsarray(7) Hard resource limit. Returns the hard resource limit for the specified resource. For CPU
time, this value is in seconds.
rsarray(8) Soft resource limit. Returns the soft resource limit for the specified resource. For CPU
time, this value is in seconds.
rsarray(9) Reserved for future use.
rsarray(10) Reserved for future use.

Setting Resource Limits


To set a limit value, all rsarray elements must be set to either a value or 0.
Element rsarray(1) represents the resource for which a limit is to be established. Currently, only CPU
resources are supported, so the value of rsarray(1) must be 1.
Element rsarray(2) identifies the category of resource to be set. rsarray(2) determines if the id argument is
a pid, sid, or uid. An rsarray(2) value of 6 (session process) requires an sid. Acceptable values are as
follows:
Value Limits to be Set
1 Process limits
3 Session limits
4 User limits
6 Default process limits for the session
Element rsarray(3) identifies the type of limit to be set. Acceptable values are as follows:
Value Limit Type to be Set
0 Absolute limit
1 Hard limit
2 Soft limit

434 004– 2165– 002


NLIMIT ( 3F ) NLIMIT ( 3F )

Element rsarray(4) determines whether or not the process is checkpointed before termination when a hard
limit is reached. By default, when a hard limit is reached, the process is terminated. For the core file to be
restartable, the environment variable TRACEBK should be set to 0 prior to running the application.
Acceptable values are as follows:
Value Determination
0 No change
1 Terminate
2 Checkpoint then terminate
In order to set rsarray(4), rsarray(3) must be set to limit type of hard (1).
Element rsarray(5), resource accumulated element, is not used when setting limits.
Based on the value in rsarray(3) (limit type), the corresponding rsarray(6) (absolute limit value), rsarray(7)
(hard limit value), or rsarray(8) (soft limit value) must be set. Only the super user can set absolute limits.
Only one limit value can be set with each NLIMIT call.
The NLIMIT library call fails and no information is updated in the rsarray array or no resource limits are
set if one or more of the following error conditions occur:
Error code Description
[EFAULT] The address specified for rptr was invalid.
[EINVAL] One of the arguments contains an invalid value.
[EPERM] The user ID of the requesting process is not that of a super user.
[EPERM] An attempt was made to change a limit on a system process; this is not allowed.
[ESRCH] No processes were found that matched the request.

RETURN VALUES
On successful completion, a value of 0 indicates that the call succeeded and either the rsarray array was
filled in with appropriate returned values or a new limit was set. An unsuccessful completion returns a value
of – 1 and errstat is set to indicate the error. See intro(2) for an explanation of error numbers.

CAUTIONS
The CPU time limit does not apply when running as root.

EXAMPLES
Following is sample Fortran code sequence that sets the current process CPU hard limit to 500 seconds and
the hard limit action to checkpoint and terminate.

004– 2165– 002 435


NLIMIT ( 3F ) NLIMIT ( 3F )

int eger id, rsa rr(10) , err

id =0
rsarr( 1) = 1
rsarr( 2) = 1
rsarr( 3) = 1
rsarr( 4) = 2
rsarr( 5) = 0
rsarr( 6) = 0
rsarr( 7) = 500
rsarr( 8) = 0
rsarr( 9) = 0
rsarr( 10) = 0

ire t=nlim it( id,rsa rr,err )


if (ir et .EQ. -1) the n
wri te (0,*)’ nlimit cal l fai led’
wri te (0,*)’ errno = ’,e rr
end if

SEE ALSO
nlimit(1) in the UNICOS User Commands Reference Manual, for an overview of resource limits
intro(2), getlim(2), setlim(2) in the UNICOS System Calls Reference Manual
nlimit(3C) in the UNICOS System Libraries Reference Manual

436 004– 2165– 002


REMARK ( 3F ) REMARK ( 3F )

NAME
REMARK, REMARK2 – Enters a message in the stderr file

SYNOPSIS
CALL REMARK(message)
CALL REMARK2(message)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
REMARK and REMARK2 send a message to the stderr file.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
message Character entity sent to the stderr file. The character entity must be of type character or a
string of characters terminated by a null byte.
Maximum message length: (REMARK): 71 characters; (REMARK2): 79 characters.

004– 2165– 002 437


REMARKF ( 3F ) REMARKF ( 3F )

NAME
REMARKF – Enters a formatted message in the stderr file

SYNOPSIS
CALL REMARKF(var, fvar, [ fvar2, . . . fvar13])

IMPLEMENTATION
UNICOS systems

DESCRIPTION
REMARKF enters a formatted message in the stderr file.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
var Variable containing the address of a format statement for ENCODE.
fvar Address of variable.
Up to 12 variables can be passed in arguments 2 through 13. The variables must be of type integer, real, or
logical, so that they each occupy only 1 word. The message is prefixed by ’UT009 - ’ unless you supply
a prefix. To supply the prefix, the characters ’b-b’ (b equals blank) must appear in columns 6 through 8 of
the formatted message.

CAUTIONS
Variables are passed without any data type information. Because of this, variables printed with the A data
edit descriptor print as integer Hollerith variables. Variables printed with the D edit descriptor print as a
single-precision variable. Variables printed with the G edit descriptor print as octal (typeless) variables.

438 004– 2165– 002


REMARKF ( 3F ) REMARKF ( 3F )

EXAMPLES
Sample Fortran calling sequences with user-supplied prefixes:
100 30 FOR MAT (’C A00 1 - ’, I4, ’ err ors ’)
ASS IGN 100 30 TO LAB EL
CAL L REM ARK F (LABEL , IER RCN T)

107 70 FOR MAT (’P D00 1 - ACC ESS ’, A8, A7, ’ ED= ’, I4, ’;’ )
ASS IGN 107 70 TO LAB EL
CAL L REM ARK F (LA BEL , DN( 1), DN( 2), ED)

Sample Fortran calling sequence without prefix:


105 50 FOR MAT (’L OOP EXE CUT ED ’, I4, ’ TIM ES’ )
ASS IGN 105 50 TO LAB EL
CAL L REM ARK F (LABEL , LOO PCN T)

004– 2165– 002 439


SAMEFILE ( 3F ) SAMEFILE ( 3F )

NAME
SAMEFILE – Checks to see whether two files have the same inode number

SYNOPSIS
LOGICAL SAMEFILE
i=SAMEFILE(path1, path2)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
SAMEFILE returns .TRUE. if two file names point to the same inode; otherwise, it returns .FALSE.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.

EXAMPLES
In this example, F1 and F2 represent the path names of files to be tested. The names must start at a word
boundary and be null terminated. On UNICOS/mk systems and Cray T90 series systems, a character
variable may not be used.
IF (SAMEF ILE(F1 ,F2 )) PRI NT* ,’f ile s are the sam e!’

440 004– 2165– 002


SENSEBT ( 3F ) SENSEBT ( 3F )

NAME
SENSEBT – Determines if bidirectional memory transfer is enabled or disabled

SYNOPSIS
CALL SENSEBT(mode)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
SENSEBT determines if bidirectional memory transfer is enabled or disabled.
mode Transfer mode:
=1 Bidirectional memory transfer is enabled
=0 Bidirectional memory transfer is disabled

004– 2165– 002 441


UNAME ( 3F ) UNAME ( 3F )

NAME
UNAME – Returns name of current operating system (Fortran interface to uname(2))

SYNOPSIS
The uname(2) system call can be called from Fortran as a function:
CHARACTER sys*n1, node*n2, rel*n3, ver*n4, mach*n5
INTEGER UNAME, i
i = UNAME(sys, node, rel, ver, mach)

IMPLEMENTATION
UNICOS systems (except Cray T90 series)

DESCRIPTION
UNAME returns information identifying the current operating system. It can be called as either a subroutine
or a function.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The arguments are as follows:
sys Character or integer variable to receive the name of the current operating system.
node Character or integer variable to receive the name by which this system is known on a
communications network.
rel Character or integer variable to receive the name of the operating system release.
ver Character or integer variable to receive the name of the operating system release version.
mach Character or integer variable to receive the name of the hardware on which this system is running.
i Return value, of type integer (when called as a function):
-2 UNAME called with too many parameters (the first 5 parameters remain)
-1 The uname(2) system call failed
0 UNAME called with no parameters
1-5 UNAME returned 1 to 5 values
The character variables receive as much of the selected field as will fit. If the field is longer it will be
truncated; if shorter, the character variable will be padded with blanks.

442 004– 2165– 002


UNAME ( 3F ) UNAME ( 3F )

The integer variables receive no more than the first 8 characters of the appropriate field, left-justified and
zero-filled.
The PXFUNAME(3F) routine provides similar functionality and is available on UNICOS and UNICOS/mk
systems.

NOTES
PXFUNAME(3F) provides similar functionality and is available on UNICOS and UNICOS/mk systems.

SEE ALSO
uname(2) in the UNICOS System Calls Reference Manual for a description of the content and length of the
various uname fields

004– 2165– 002 443


444 004– 2165– 002
INTRO_HEAP ( 3F ) INTRO_HEAP ( 3F )

NAME
INTRO_HEAP – Introduction to heap, table, and data segment management

IMPLEMENTATION
See individual man pages for implementation details

DESCRIPTION
The heap routines let you manage a block of memory (the heap) within your program area, manipulate
tables, and manage the secondary data segment (SDS). The management routines are divided into three
categories: heap management, table management, and SDS management.

HEAP MANAGEMENT ROUTINES


The heap management routines provide dynamic storage allocations by managing a block of memory, called
the heap, within your job area. Each job has its own heap. The functions of the heap management routines
include allocating a block of memory, returning a block of memory to the heap’s list of available space, and
changing the length of a block of memory. Heap management routines may also move a heap block to a
new location if there is no room to extend it, return part of the heap to the operating system, check the
integrity of the heap, and report heap statistics.
The heap management routines keep various statistics on the use of the heap. These statistics include values
used to tune heap parameters specified by the loader for your compiler and information used in debugging.
The following routines are used for heap management:
• HPALLOC(3F): allocates a block of memory from the heap
• HPCHECK(3F): checks the integrity of the heap
• HPCLMOVE(3F): extends a block or copies block contents into a larger block
• HPDEALLC(3F): returns a block of memory to the heap
• HPDUMP(3F): dumps the address and size of each heap block
• HPNEWLEN(3F): changes the size of an allocated heap block
• HPSHRINK(3F): returns memory from the heap to the operating system
• IHPLEN(3F): returns the length of a heap block
• IHPSTAT(3F): returns statistics about the heap
• IHPVALID(3F): returns validity of block address

004– 2165– 002 445


INTRO_HEAP ( 3F ) INTRO_HEAP ( 3F )

TABLE MANAGEMENT ROUTINES


The following list describes each Fortran-callable table management routine:
• TMADW: adds a word to a table
• TMAMU: reports table management operation statistics
• TMATS: allocates table space
• TMINIT: initializes table
• TMMSC: searches the table with a mask to locate a field within an entry
• TMMVE: moves memory
• TMPTC: processes table collisions
• TMPTS: presets table space
• TMSRC: searches the table with or without a mask to locate a field within an entry and an offset
• TMVS: searches a vector table for the search argument
The Fortran-callable versions of these routines use default BTAB and LTAB definitions from a common area
in the library.
TMINIT zeroes all elements of the LTAB table length vector. You must preset each element of BTAB to
contain the desired interspace value for the corresponding table (for example, s1 in the following example
determines the interspace value for table 1). Interspace values determine how many words are added to a
table when more room is needed for that table or for any table with a lower number.
INTEGE R BTA B(64), LTAB(6 4)
COMMON /TM / BTA B(6 4), LTA B(6 4)
DATA BTA B /s1 ,s2 ,s3,...,s 64/
.
.
CALL TMI NIT

After the call to TMINIT, BTAB should not be changed. LTAB is only used to pass new table lengths from
the user to the table manager.
You can use statements such as the following to access each table. In this example, TABLEi is accessed.
EQUIVA LEN CE (BT AB( i), PTRi)
INTEGER PTRi, TAB LEi (0: 0)
POINTE R (PT Ri, TABLEi)
.
.
TABLEi (subsc ript) = ...

446 004– 2165– 002


INTRO_HEAP ( 3F ) INTRO_HEAP ( 3F )

TM Common Block Name


The common block name TM is reserved for use by the Table Manager and must always contain 64 LTAB
words.
COM MON /TM / BTA B(6 4), LTAB(6 4)
The following program uses Cray pointers to access tables.
PROGRAM TES T
IMP LIC IT INT EGE R (A- Z)
COMMON /TM/ BTA B (64), LTAB (64)
COM MON /PT RS/ PTR 1, PTR 2, PTR 63
POI NTE R (PT R1, TAB 1 (1) )
POI NTE R (PT R2, TAB 2 (1) )
POINTER (PT R63 , TAB63 (1))
DATA BTAB/6 4*1 0/

C Ini tia lize tab le man ager

CAL L TMI NIT

C All oca te spa ce for fir st, second and las t tab le of 40,
C 40 and 60 wor ds

CALL TMATS ( 1, 40)


CALL TMATS ( 2, 40)
CALL TMATS (63 , 60)

C Define CRAY POI NTE RS

PTR1 = BTA B ( 1)
PTR2 = BTA B ( 2)
PTR63 = BTA B (63)

C Zero tables

DO I = 1, 40
TAB 1 (I) = 0
TAB 2 (I) = 0
TAB 63(I) = 0
ENDDO

DO I = 41, 60
TAB 63(I) = 0
ENDDO

004– 2165– 002 447


INTRO_HEAP ( 3F ) INTRO_HEAP ( 3F )

C Ass ign val ues and preset to eac h hal f of the first tab le.

DO I = 1, 10
TAB 1(I ) = I
END DO

CAL L TMP TS( PTR1 + 10, 10, 11)


CAL L TMP TS( PTR1 + 20, 0, 22)
CAL L TMP TS( PTR1 + 30, 1, 33)
CAL L TMP TS( PTR1 + 31, 9, 44)

C Mov e the fir st 20 wor ds of the fir st table to the fir st


C 20 wor ds of the sec ond tab le.

CAL L TMM VE (PTR1, PTR 2, 20)

C Pre set las t 20 ele men ts of the 63r d tab le.

CAL L TMP TS (PT R63 + 40, 20, 12)

C Mov e the las t 20 wor ds of the 63rd table to the las t


C 20 wor ds of the second tab le.

CAL L TMM VE (PT R63 + 40, PTR 2 + 20, 20)


END

SDS MANAGEMENT ROUTINES

The SDS management routines, SDSALLOC, SDSREALC, and SDSFREE, let you allocate, reallocate, and
deallocate blocks of the SDS. They manage units of 4096 bytes and are described on the SDSALLOC man
page.

448 004– 2165– 002


CRAYDUMP ( 3F ) CRAYDUMP ( 3F )

NAME
CRAYDUMP – Dump arrays of memory

SYNOPSIS
DIMENSION ARRAY(1000)
CALL CRAYDUMP(ARRAY(10), ARRAY(812), 101)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
CRAYDUMP is a Fortran-callable routine to dump arrays of memory. Four words of memory are displayed
per line of output. Each word is displayed in octal (hexadecimal on UNICOS/mk systems) and ASCII. No
line will exceed 132 characters in length.
The first and second arguments are the first and last words of memory to be dumped. If the last word
address is greater than the first word address, no memory is dumped. The third argument is the Fortran unit
number to which the dump is to be written. The unit should be 101 (stdout) or any unit which is (or can
be) opened for sequential, formatted output.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.

NOTES
On UNICOS systems, memory dumps are formatted in octal. On UNICOS/mk systems, memory dumps are
formatted in hexadecimal.
CAUTIONS
On UNICOS/mk systems, care should be taken such that only contiguous regions of memory (only memory
with a single array or common block) should be dumped.

004– 2165– 002 449


HPALLOC ( 3F ) HPALLOC ( 3F )

NAME
HPALLOC – Allocates a block of memory from the heap

SYNOPSIS
CALL HPALLOC(addr, length, errcode, abort)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
HPALLOC allocates a block of memory from the program’s heap that is greater than or equal to the size
requested. If the request cannot be satisfied from the free blocks currently in the heap, it will try to allocate
more memory from the system.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
addr First word address of the allocated block (output).
length Number of words of memory requested (input).
errcode Error code is 0 if no error was detected; otherwise, it is a negative integer code for the type of
error (output).
abort Abort code; nonzero requests abort on error; 0 requests an error code (input).
By using the Fortran POINTER mechanism in the following manner, you can use array A to refer to the
block allocated by HPALLOC.
POI NTER (addr, A(1 ))
Error conditions are as follows:
Error code Condition
-1 Length is not an integer greater than 0.
-2 No more memory is available from the system (checked if the request cannot be satisfied
from the available blocks on the heap).
-8 The memory arena has been truncated by a user’s sbreak(2) call with a negative value.

SEE ALSO
HPCHECK(3F), HPCLMOVE(3F), HPDEALLC(3F), HPDUMP(3F), HPNEWLEN(3F), HPSHRINK(3F)

450 004– 2165– 002


HPCHECK ( 3F ) HPCHECK ( 3F )

NAME
HPCHECK – Checks the integrity of the heap

SYNOPSIS
CALL HPCHECK(errcode)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION

HPCHECK checks the integrity of the heap. Each control word is examined to ensure that it was not
overwritten.
errcode The error code is 0 if no error was detected; otherwise, it is a negative integer code for the type
of error (output).
The error conditions are as follows:
Error code Condition
-7 Memory arena has been corrupted.

004– 2165– 002 451


HPCLMOVE ( 3F ) HPCLMOVE ( 3F )

NAME
HPCLMOVE – Extends a block or copies the contents of the block into a larger block

SYNOPSIS
CALL HPCLMOVE(addr, length, status, abort)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This routine extends a block if it is followed by a large enough free block or copies the contents of the
existing block to a larger block and returns a status code indicating that the block was moved. It can also
reduce the size of a block if the new length is less than the old length. In this case, HPCLMOVE has the
same effect as HPNEWLEN(3F).
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
addr On entry, first word address of the block to change; on exit, the new address of the block if it was
moved.
length Requested new total length (input).
status Status is 0 if the block was extended in place, 1 if it was moved, and a negative integer for the
type of error detected (output).
abort Abort code. Nonzero requests abort on error; 0 requests an error code (input). Error conditions are
as follows:
-1 Length is not an integer greater than 0.
-2 No more memory is available from the system (checked if the block cannot be
extended and the free space list does not include a large enough block).
-3 Address is outside the bounds of the heap.
-4 Block is already free.
-5 Address is not at the beginning of a block.

452 004– 2165– 002


HPDEALLC ( 3F ) HPDEALLC ( 3F )

NAME
HPDEALLC – Returns a block of memory to the list of available space (the heap)

SYNOPSIS
CALL HPDEALLC(addr, errcode, abort)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
HPDEALLC returns a block of memory to the list of available space (the heap).
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
addr First word address of the block to deallocate (input).
errcode Error code is 0 if no error was detected; otherwise, it is a negative integer code for the type of
error (output).
abort Abort code. Nonzero requests abort on error; 0 requests an error code (input).
Error conditions are as follows:
Error code Condition
-3 Address is outside the bounds of the heap.
-4 Block is already free.
-5 Address is not at the beginning of the block.

004– 2165– 002 453


HPDUMP ( 3F ) HPDUMP ( 3F )

NAME
HPDUMP – Dumps the address and size of each heap block

SYNOPSIS
CALL HPDUMP(code, dsname)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
HPDUMP dumps the address and size of each heap block.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
code Code for the type of dump requested, as follows:
Code Meaning
1 Dumps all heap blocks in storage order
dsname Name of the file to which the dump should be written; dsname may be in left-justified, Hollerith
form, or it may be a Fortran character variable.

454 004– 2165– 002


HPNEWLEN ( 3F ) HPNEWLEN ( 3F )

NAME
HPNEWLEN – Changes the size of an allocated heap block

SYNOPSIS
CALL HPNEWLEN(addr, length, status, abort)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This routine changes the size of an allocated heap block. If the new length is less than the allocated length,
the portion starting at addr + length is returned to the heap. If the new length is greater than the allocated
length, the block is extended when followed by a free block. A status is returned, indicating if the change
was successful.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
addr First word address of the block to change (input).
length Requested new total length of the block (input).
status Status is 0 if the change in length was successful, 1 if the block could not be extended in place,
and a negative integer for the type of error detected (output).
abort Abort code. Nonzero requests abort on error; 0 requests an error code (input).
Error conditions are as follows:
Error code Condition
-1 Length is not an integer greater than 0.
-3 Address is outside the bounds of the heap.
-4 Block is already free.
-5 Address is not at the beginning of the block.

004– 2165– 002 455


HPSHRINK ( 3F ) HPSHRINK ( 3F )

NAME
HPSHRINK – Returns memory from the heap to the operating system

SYNOPSIS
CALL HPSHRINK

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This is a Fortran interface to the _memfree memory manager routine. The unused portion of the heap is
returned to the operating system if the blocks closest to the break value are free.

SEE ALSO
utilities(3C) in UNICOS System Libraries Reference Manual for more information about _memfree
and ememmgr

456 004– 2165– 002


IHPLEN ( 3F ) IHPLEN ( 3F )

NAME
IHPLEN – Returns the length of a heap block

SYNOPSIS
length=IHPLEN(addr, errcode, abort)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
IHPLEN returns the length of a heap block.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
length Length of the block starting at addr (output).
addr First word address of the block (input).
errcode Error code is 0 if no error was detected; otherwise, it is a negative integer code for the type of
error (output).
abort Abort code. Nonzero requests abort on error; 0 requests an error code (input).
Error conditions are as follows:
Error code Condition
-3 Address is outside the bounds of the heap.
-4 Block is already free.
-5 Address is not at the beginning of the block.

004– 2165– 002 457


IHPVALID ( 3F ) IHPVALID ( 3F )

NAME
IHPVALID – Returns validity of block address

SYNOPSIS
ret=IHPVALID(addr)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
IHPVALID returns the validity of a block address.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
ret Return code.
=0 Block pointed to by addr is not a valid block in the heap.
≠0 Block pointed to by addr is a valid block in the heap.
addr First word address of the block (input).

458 004– 2165– 002


TMADW ( 3F ) TMADW ( 3F )

NAME
TMADW – Adds a word to a table

SYNOPSIS
index=TMADW(number, entry)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
TMADW adds a word to a table.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
index Zero-based index of the added word
number Table number
entry Entry for the table

004– 2165– 002 459


TMAMU ( 3F ) TMAMU ( 3F )

NAME
TMAMU – Reports table management operation statistics

SYNOPSIS
CALL TMAMU(len, tabnum, tabmov, tabmar, nword)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
TMAMU reports on table management operation statistics.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
This routine defines the following values:
len Allocated length of the tables
tabnum Number of tables used
tabmov Number of tables moved
tabmar Maximum mark of the tables in memory
nword Number of words moved

460 004– 2165– 002


TMATS ( 3F ) TMATS ( 3F )

NAME
TMATS – Allocates table space

SYNOPSIS
index=TMATS(number, incre)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
TMATS allocates table space.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
index Zero-based index of the new area in the table
number Table number
incre Table increment (number of words to be added to the size of the table)

004– 2165– 002 461


TMINIT ( 3F ) TMINIT ( 3F )

NAME
TMINIT – Initializes table descriptor vector and zeroes table length vector

SYNOPSIS
CALL TMINIT

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
TMINIT initializes the table manager, Table Base Address table (BTAB), and zeroes out all of the elements
of the Table Length table (LTAB).
The BTAB array should contain the desired interspace value for the corresponding array before calling
TMINIT. On exit, BTAB will contain the base address for the corresponding table.
Call TMINIT before accessing the table manager.

SEE ALSO
INTRO_HEAP(3F)

462 004– 2165– 002


TMMSC ( 3F ) TMMSC ( 3F )

NAME
TMMSC – Searches the table by using a mask to locate a specific field within an entry using an optional
offset

SYNOPSIS
index=TMMSC(tabnum, mask, sword, nword [,offset])

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This routine searches a table using a mask to locate a specific field.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
index Zero-based table index of the match, if found; – 1 returned if no match is found.
tabnum Table number.
mask Mask defining a field within a word.
sword Search word.
nword Number of words per entry group.
offset Offset into the table. No offset is used if this argument is not specified. Optional argument.

004– 2165– 002 463


TMMVE ( 3F ) TMMVE ( 3F )

NAME
TMMVE – Moves memory (words)

SYNOPSIS
CALL TMMVE(from, to, count)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This routine moves memory.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
from Address from which words are to be moved
to Address of the location to which words are to be moved
count Number of words to be moved

NOTES
The TMMVE routine expects indirect addresses to be passed for the from and to arguments. These can be
obtained by specifying Cray pointers, using the LOC function, or by using the TBAB table manager array
elements.

464 004– 2165– 002


TMPTC ( 3F ) TMPTC ( 3F )

NAME
TMPTC – Processes table collisions

SYNOPSIS
CALL TMPTC

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This routine checks all managed tables to ensure that the current size of the pad area is not less than zero
and is not greater than the specified pad. Any tables in violation of this are adjusted so that they have
proper interspace.

004– 2165– 002 465


TMPTS ( 3F ) TMPTS ( 3F )

NAME
TMPTS – Presets table space

SYNOPSIS
CALL TMPTS(start, len, preset)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This routine presets table space.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
start Starting address
len Length to preset
preset Preset value

NOTES
The TMPTS routine requires an indirect address for the start argument. An indirect address can be a Cray
pointer, a BTAB table array element, or the result of a LOC function.

466 004– 2165– 002


TMSRC ( 3F ) TMSRC ( 3F )

NAME
TMSRC – Searches the table by using optional mask to locate specific field within entry and offset

SYNOPSIS
index=TMSRC(tabnum, arg[, nword[, offset[, mask]]])

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This routine searches a table using an optional mask.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
index Zero-based table index of the match, if a match is found; – 1 returned if no match is found.
tabnum Table number to search.
arg Search argument or key.
nword Optional argument; number of words per entry. Default is 1.
offset Optional argument; offset into the entry group. Default is 0.
mask Optional argument; mask for field within entries. Default is a mask of all 1’s.

004– 2165– 002 467


TMVSC ( 3F ) TMVSC ( 3F )

NAME
TMVSC – Searches a vector table for the search argument

SYNOPSIS
index=TMVSC(tabnum, arg, nword)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This routine searches a vector table for a search argument.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
index Zero-based table index of the match, if a match is found; – 1 returned if no match is found.
tabnum Table number.
arg Search argument.
nword Number of words per entry group.

468 004– 2165– 002


INTRO_PROGAIDS ( 3F ) INTRO_PROGAIDS ( 3F )

NAME
INTRO_PROGAIDS – Introduction to programming aids

IMPLEMENTATION
See individual man pages for implementation details

DESCRIPTION
Programming aids consist of the following types of routines:
• Tracing and timing routines
• Watchpointing routines
• Traceback routines
• Symbolic dump routines
• Exchange package processing routines
• Signal routines
• Character functions
• Byte and bit manipulation routines
In addition to these routines, this section includes the reprieve(3F) man page, which describes the
traceback procedure after an error.

TRACING AND TIMING ROUTINES


Tracing and timing of user programs is enabled on the f90 command with the Flowtrace option (-ef).
When these options are specified, the Fortran compiler automatically places calls to the trace libraries at the
beginning and end of each routine. If default libraries are loaded, your program will be enabled for
Flowtracing. This trace library times individual routines. After your program completes normally, you may
execute the flowview command to view and study the timing results.
If you load a traced program with libperf.a by using f90 -lperf, this library will generate Perftrace,
instead of Flowtrace, data. This trace library times individual routines, but it does so using the Hardware
Performance Monitor (HPM), which is available only on UNICOS systems. The HPM provides such
performance statistics as megaflop ratings of each routine. After your program completes normally, you can
execute the perfview command to view and study the statistical timing results.
The Flowtrace library contains routines with names that start with the letters ZZZF0 and IZZF0. You
should avoid naming any routine in your program that starts with this prefix.
The Perftrace library contains routines with names that start with the letters ZZZP0 and IZZP0. You
should avoid these prefixes when naming routines in your program. You should also avoid naming a routine
SECOND in your program, if you are using either of the tracing tools.

004– 2165– 002 469


INTRO_PROGAIDS ( 3F ) INTRO_PROGAIDS ( 3F )

You can control individual routine event tracing by calling the library routine SETPLIMQ(3F). This routine
only provides meaningful results under Flowtrace. However, for compatibility, it is also available as a
dummy entry in Perftrace. You can time individual sections of your program by calling the FLOWMARK
routine, which is available under both Flowtrace and Perftrace.
WATCHPOINTING ROUTINES
As a debugging aid, you can control watchpointing of any variables or memory areas in your program.
Watchpointing is enabled on the f90 command with the Flowtrace option -ef. You must specify the
special watchpoint library libwatch.a when you load your program.
In addition, you must include calls to the watchpointing facility in your program, specifying which variables
are to be checked at every routine entry and exit. You should avoid beginning any routine names with the
letters WATCH when you use this facility.

TRACEBACK ROUTINES
The traceback routines list all subroutines active in the current calling sequence (using TRBK(3F)) and return
information for the current level of the calling sequence (with TRBKLVL(3F)). TRACEBK(3F) is also
available. It prints a traceback on stdout.
Traceback routines return unpredictable results when subroutine linkage does not use standard calling
sequences.

DUMP ROUTINES
The symbolic dump routines produce a symbolic dump of a running program. SYMDUMP(3F) is
recommended for use on the UNICOS operating system because it has an interface designed for the
UNICOS operating system.

EXCHANGE PACKAGE PROCESSING ROUTINES


The exchange package processing routine (XPFMT(3F)) provides a printable image of an exchange package,
which is a 16-word block of memory associated with a particular program. This routine is available on
UNICOS systems only.

SIGNAL ROUTINES
Signals are an asynchronous process control and interprocess communication mechanism in the UNICOS
operating system. As a control mechanism, signals can notify or terminate a process when certain hardware
conditions occur. For instance, if a process gets a floating-point error or operand range error, the kernel
sends that process a SIGFPE (floating-point exception) or SIGORE (operand range error), respectively. In
addition, users can send certain signals to their processes by pressing <CONTROL-C> or <CONTROL-\>,
which generate SIGINT and SIGQUIT, respectively.

470 004– 2165– 002


INTRO_PROGAIDS ( 3F ) INTRO_PROGAIDS ( 3F )

Each signal has a default action associated with it that normally terminates its process, with or without a
core dump. Processes may also choose to catch a signal; that is, jump to a user-defined signal handler
routine when the signal is sent to the process. A signal may also be ignored by a process, in which case the
delivery of the signal has no effect on the process.
See FSIGCTL(3F) for a list of the signals and a brief description of the meaning of each signal.
The SHUTDSAV routine sets up calling programs to be checkpointed on system shutdown.
The SIGOFF routine prevents receipt of all signals currently being caught. The SIGON routine allows
receipt of signals after a SIGOFF or within a signal handler.

CHARACTER FUNCTIONS
The following routines are used for character functions:
• CHAR: converts integer to character.
• ICHAR: converts character to integer.
• INDEX: determines index location of a character substring within a string.
• LEN: determines the length of a character string.
• LGE, LGT, LLE, LLT: compares strings lexically.

PACKING ROUTINES
The packing routines provide alternative ways to pack and unpack data into or out of Cray words. The
following routines are used for packing:
• P32: packs 32-bit words into Cray 64-bit words.
• U32: unpacks 32-bit words from Cray 64-bit words.
• P6460: packs 60-bit words into Cray 64-bit words.
• U6064: unpacks 60-bit words from Cray 64-bit words.
• PACK: compresses stored data.
• UNPACK: expands stored data.

BYTE AND BIT MANIPULATION ROUTINES


Byte and bit manipulation routines move bytes and bits between variables and arrays, compare bytes,
perform searches with a byte count as a search argument, and perform conversion on bytes.
The following routines are used for bit manipulation:
• PUTBYT: replaces a byte in a variable or an array with a specified value
• IGTBYT: extracts a byte from a variable
• MOV: moves bytes between variables or arrays

004– 2165– 002 471


INTRO_PROGAIDS ( 3F ) INTRO_PROGAIDS ( 3F )

• MOVBIT: moves bits between variables or arrays


• MVC: moves characters between memory areas
TIMING ROUTINES
Timing routines include time and date routines, which produce the time and/or date in specified forms. The
following are date and time routines:
• CLOCK: returns the current system clock time
• DATE: returns the current date
• JDATE: returns the current Julian date
• ICPUSED: gets CPU time in real-time clock values
• RTC, IRTC: returns real-time clock values
• SECOND: returns the elapsed CPU time (in seconds of real numbers) since the start of a program
• SECONDR: returns real-time clock values
• TIMEF: returns the elapsed wall-clock time since the initial call to TIMEF
• TREMAIN: returns the CPU time (in seconds of real numbers) remaining for the program

MISCELLANEOUS ROUTINES
The following routines are available on UNICOS systems only, with the exception of TRIMLEN(3F), which
is available on all UNICOS or UNICOS/mk systems.
• DTTS: converts ASCII date and time to time stamp
• MTTS: converts machine time to time stamp
• TRIMLEN: returns the length of a character argument without counting trailing blanks
• TSDT: converts time stamps to ASCII date and time strings
• TSMT: converts time stamps to real-time clock values
• UNITTS: returns time-stamp units in specified standard time units

OTHER ROUTINES
AUXSTAT specifies the number of reads and writes to secondary data segments (SDS) that have occurred
while accessing auxiliary array variables.
ICEIL returns the integer ceiling of a rational number.
LOC returns the memory address of a variable or an array.

472 004– 2165– 002


AUXSTAT ( 3F ) AUXSTAT ( 3F )

NAME
AUXSTAT – Gives the number of reads and writes to SDS that have occurred while accessing auxiliary array
variables

SYNOPSIS
CALL AUXSTAT( )

IMPLEMENTATION
UNICOS systems

DESCRIPTION
AUXSTAT prints to stderr the number of reads and writes to secondary data segments (SDS) that occurred
while accessing auxiliary array variables.

004– 2165– 002 473


BITVEC ( 3F ) BITVEC ( 3F )

NAME
BITVEC – Generates a bit mask corresponding to integer or real arrays according to a specified condition

SYNOPSIS
INTEGER BITVEC
INTEGER np, type, nbits, bits(*), npop, incv1, incv2
INTEGER v1(*), v2(*)
or
REAL v1(*), v2(*)
INTEGER s
or
REAL s
np = BITVEC(type, nbits, bits, npop, v1, incv1, s)
or
np = BITVEC(type, nbits, bits, npop, v1, incv1, v2, incv2)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
BITVEC efficiently creates a bit mask that results from a comparison of elements of one vector with those of
another vector or a scalar.
The resulting bit mask is padded with zeros to a word boundary.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following arguments are passed to BITVEC:
type Integer value, variable, or array element containing the zero-padded Hollerith-type code that
defines the type of vector comparison that will be used to generate the bit mask.
If type begins with V, a vector-to-vector compare is implied. If type begins with S, a vector-to-scalar
compare is implied.
The following values are valid for type:
type Value
’VFEQ’L v1.EQ.v2 FLOATING-POINT
’VFNE’L v1.NE.v2 FLOATING-POINT
’VFGT’L v1.GT.v2 FLOATING-POINT
’VFGE’L v1.GE.v2 FLOATING-POINT

474 004– 2165– 002


BITVEC ( 3F ) BITVEC ( 3F )

’VFLT’L v1.LT.v2 FLOATING-POINT


’VFLE’L v1.LE.v2 FLOATING-POINT
’VIEQ’L v1.EQ.v2 INTEGER
’VINE’L v1.NE.v2 INTEGER
’VIGT’L v1.GT.v2 INTEGER
’VIGE’L v1.GE.v2 INTEGER
’VILT’L v1.LT.v2 INTEGER
’VILE’L v1.LE.v2 INTEGER
’SFEQ’L v1.EQ.s FLOATING-POINT
’SFNE’L v1.NE.s FLOATING-POINT
’SFGT’L v1.GT.s FLOATING-POINT
’SFGE’L v1.GE.s FLOATING-POINT
’SFLT’L v1.LT.s FLOATING-POINT
’SFLE’L v1.LE.s FLOATING-POINT
’SIEQ’L v1.EQ.s INTEGER
’SINE’L v1.NE.s INTEGER
’SIGT’L v1.GT.s INTEGER
’SIGE’L v1.GE.s INTEGER
’SILT’L v1.LT.s INTEGER
’SILE’L v1.LE.s INTEGER
nbits Vector length. This defines the size of the input vectors in words and the output bit mask in
bits.
bits Output bit mask. Must be word-aligned and be of size (nbits+63)/64 words.
npop Output number of bits set in bit mask. This parameter is assigned – 1 if BITVEC was not called
with correct parameters.
v1 Real or integer array that contains the first vector.
inv1 Memory stride in words for array v1. This stride may be negative.
v2 REAL or INTEGER array that contains the second vector if doing a vector-to-vector compare.
inv1 Memory stride for array v2 in words. This stride may also be negative, and is used only if a
vector-to-vector compare is requested.
s REAL or INTEGER constant, variable, or array element containing the second vector if doing a
vector-to-scalar compare.

004– 2165– 002 475


BITVEC ( 3F ) BITVEC ( 3F )

RETURN VALUES
Equivalent to npop. The number of bits set in the bit mask, or – 1 if BITVEC was not called with correct
parameters.

476 004– 2165– 002


BITVECM ( 3F ) BITVECM ( 3F )

NAME
BITVECM – Generates a bit mask corresponding to masked integer arrays according to a specified condition

SYNOPSIS
INTEGER BITVECM
INTEGER np, type, nbits, bits(*), npop, incv1, incv2
INTEGER v1(*), v2(*)
or
INTEGER s
np = BITVECM(type, nbits, bits, npop, v1, incv1, mask1, shift1, s [, incv2, mask2, shift2])
or
np = BITVECM(type, nbits, bits, npop, v1, incv1, mask1, shift1, v2, incv2, mask2, shift2)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
BITVECM efficiently creates a bit mask that results from a comparison of elements of one vector with those
of another masked and shifted vector or a scalar.
The resulting bit mask is padded with zeros to a word boundary.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following arguments are passed to BITVECM:
type Integer value, variable, or array element containing the zero-padded Hollerith type code that
defines the type of vector comparison that will be used to generate the bit mask.
If type begins with V, a vector-to-vector compare is implied. If type begins with S, a vector-to-
scalar compare is implied.
The following values are valid for type:
type Value
’VIEQ’L v1.EQ.v2 INTEGER
’VINE’L v1.NE.v2 INTEGER
’VIGT’L v1.GT.v2 INTEGER
’VIGE’L v1.GE.v2 INTEGER
’VILT’L v1.LT.v2 INTEGER
’VILE’L v1.LE.v2 INTEGER

004– 2165– 002 477


BITVECM ( 3F ) BITVECM ( 3F )

’SIEQ’L v1.EQ.s INTEGER


’SINE’L v1.NE.s INTEGER
’SIGT’L v1.GT.s INTEGER
’SIGE’L v1.GE.s INTEGER
’SILT’L v1.LT.s INTEGER
’SILE’L v1.LE.s INTEGER
nbits Vector length. This defines the size of the input vectors in words and the output bit mask in
bits.
bits Output bit mask. Must be word-aligned and be of size (nbits+63)/64 words.
npop Output number of bits set in bit mask. This argument is assigned a value of – 1 if BITVECM
was not called with correct parameters.
v1 INTEGER array that contains the first vector.
incv1 Memory stride in words for array v1. This stride can be negative.
mask1 Mask used to perform a bitwise-OR on the elements of v1 after the shift.
shift1 Number of bits to right shift the elements of v1 before masking.
v2 INTEGER array that contains the second vector if doing a vector-to-vector compare.
s INTEGER constant, variable, or array element containing the second vector if doing a vector-to-
scalar compare.
incv2 Memory stride for array v2 in words. This stride can also be negative, and is used only if a
vector-to-vector compare is requested.
mask2 Mask used to perform a bitwise-OR on the elements of v2 or s after the shift.
shift2 Number of bits to right shift the elements of v2 or s before masking.

RETURN VALUES
Equivalent to npop. The number of bits set in the bit mask, or – 1 if BITVECM was not called with correct
parameters.

478 004– 2165– 002


BYT ( 3F ) BYT ( 3F )

NAME
PUTBYT, IGTBYT – Replaces a byte in a variable or an array

SYNOPSIS
value=PUTBYT(string, position, value)
byte=IGTBYT(string, position)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
PUTBYT replaces a specified byte in a variable or an array with a specified value. IGTBYT extracts a
specified byte from a variable or an array.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
string The address of a variable or array. The variable or array may be of any type, except character.
position The number of the byte to be replaced or extracted. This argument must be an integer ≥ 1. If
position is ≤ 0, no change is made to the destination string; value returned is – 1. For IGTBYT,
if position is ≥ 0, value is an integer between 0 and 255.
value The new value to be stored into the byte. This argument must be an integer with a value
between 0 and 255.
If PUTBYT is called as an integer function (having been properly declared in the user program), the value of
the function is the value of the byte stored.
The high-order 8 bits of the first word of the variable or array are called byte 1.
The value of the byte returned by IGTBYT is an integer value between 0 and 255.

004– 2165– 002 479


DTTS ( 3F ) DTTS ( 3F )

NAME
DTTS – Converts ASCII date and time to time stamp

SYNOPSIS
INTEGER dtts
ts=DTTS(date, time, ts)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
DTTS converts ASCII date and time to time stamp.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
ts Time stamp corresponding to date and time (type integer). On return, if ts=0, an incorrect
parameter was passed to DTTS. The routine returns a positive value for dates and times in the
proper format and between 01/01/73 00:00:01 and 12/31/99 23:59:59, inclusive.
date On entry, ASCII date in mm/dd/yy format. This may not be a Fortran character variable.
time On entry, ASCII time in hh:mm:ss format. This may not be a Fortran character variable.

NOTES
Time stamp routines are invalid for dates later than 1999.

480 004– 2165– 002


FSIGCTL ( 3F ) FSIGCTL ( 3F )

NAME
FSIGCTL – Specifies action on receipt of signal

SYNOPSIS
INTEGER FSIGCTL, oldact
CHARACTER*(*) action, sig
EXTERNAL func
oldact = FSIGCTL(action, sig, func)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
FSIGCTL is the Fortran-callable interface to the sigctl(2) system call.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
FSIGCTL lets you choose one of six ways to handle the receipt of a specific signal, as specified by the
following arguments:
oldact If fsigctl completes successfully, it returns the previous action for the specified signal;
otherwise – 1 is returned.
action Character string that determines the action taken on receipt of the signal. Valid character string
values for action are as follows:
’DUMPCORE’ When signal sig arrives, terminate the program and generate a core file (see
signal(2)).
’IGNORE’ Ignore signal sig.
’KILL’ When signal sig arrives, terminate the program.
’REGISTER’ When signal sig arrives, transfer control to subroutine func to handle the
signal, then return back to the point of interrupt.
’STOP’ When signal sig arrives, stop the program.
’CONTINUE’ When signal sig arrives, continue the program.
sig Character string that defines the signal to catch. Valid values are defined in the
<sys/signal.h> file; the strings are the same as the signal names (for example, ’SIGHUP’,
’SIGABRT’, and so on).

004– 2165– 002 481


FSIGCTL ( 3F ) FSIGCTL ( 3F )

func If action is ’REGISTER’, func is the user’s signal-handling routine; otherwise, func should be 0.
Usually, the name of the signal-handling routine must be declared as EXTERNAL, as in the
EXAMPLES section.

NOTES
On UNICOS systems (excluding the Cray T90 series), action and sig can be integer values instead of
character strings. Valid integer values for action are defined in <sys/signal.h> and on the sigctl(2)
man page. Valid integer values for sig are the signal numbers defined in signal(2).
To promote portability, it is recommended that the sigctl function be called if you want to pass integer
values for the action and sig arguments.

RETURN VALUES
FSIGCTL returns an integer value corresponding to the previous signal action for the specified signal. It
returns – 1 if an improper action or sig argument is given, or if any other errors occur.

EXAMPLES
A frequent use of FSIGCTL is to catch the shutdown signal, as shown in the following example:
EXTERN AL CHECKP T
CALL FSIGCT L(’ REGIST ER’ ,’SIGS HUTDOW N’,CHE CKPT)

CHECKPT is a user-supplied routine that tells the running program to write a checkpoint file at the next
possible time.

SEE ALSO
SIGOFF(3F)
sigctl(2), signal(2) in the UNICOS System Calls Reference Manual

482 004– 2165– 002


GETCALLERINFO ( 3F ) GETCALLERINFO ( 3F )

NAME
GETCALLERINFO – Returns the name and line number of the calling routine

SYNOPSIS
INTEGER ilen, lineno, ierror
CHARACTER*n, name
CALL GETCALLERINFO(name, ilen, lineno, ierror)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
The GETCALLERINFO subroutine returns the name of the subroutine and the line number from which the
current routine was called.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine:
ilen An integer variable that will receive the actual number of characters in the caller’s name
lineno An integer variable that will receive the line number of the calling subroutine
ierror An integer variable that will contain the exit status as defined in the EXIT STATUS section
name A variable of type CHARACTER that will receive the name of the calling subroutine

EXIT STATUS
Upon successful completion of this routine, ierror is set to 0. If any of the following conditions occur,
ierror is set to the corresponding value:
EINVAL An internal error prevented recovery of the caller information.
ETRUNC The caller’s name was longer than the length of the character variable provided by the user. As
much of the caller’s name as will fit is returned.

004– 2165– 002 483


GETCALLERINFO ( 3F ) GETCALLERINFO ( 3F )

EXAMPLES

PRO GRAM MAIN_P ROG RAM


CAL L SUB _ROUTI NE
END
SUB ROUTIN E SUB _RO UTI NE
CHA RACTER * 50, NAM E
CAL L GET CALLER INF O(N AME , ILE N, LIN ENO , IER ROR )
IF (IERRO R .EQ . 0) THE N
PRINT *,’Cal led fro m lin e ’, LIN ENO , ’ of ’, NAM E(1 :IL EN)
END IF
RET URN
END

Execution of this program results in the following output:


Called fro m lin e 2 of MAI N_P ROG RAM

484 004– 2165– 002


GETPMC ( 3F ) GETPMC ( 3F )

NAME
GETPMC, GETTMC, GETHMC – Returns 128-word output array describing machine characteristics

SYNOPSIS
INTEGER GETPMC
INTEGER PMCTABLE(128)
INTEGER PMTNAME
i = GETPMC(pmctable, pmtname)
CALL GETHMC(pmctable)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
GETPMC returns a 128– word output array that describes the machine characteristics of pmtname.
GETHMC returns a 128– word output array that describes the machine characteristics of the machine (CPU)
you are currently using.
If pmtname is HOST, then pmctable contains information about the machine (CPU) you are running on. If
pmtname is TARGET and if the TARGET environment variable is not set, pmctable will contain the
information provided by a target system call with the first parameter equal to MC_GET_TARGET.
If the TARGET environment variable is set, its form is the following:
TARGET=[cpuname]{,[charac]}
For example, the following are all valid TARGET environment variables:
TARGET =cray- ts
TARGET =cray- ts, iee e
TARGET =,mems ize =33 554 432

If the TARGET environment variable contains a cpuname, then pmctable will contain default information for
that machine, modified by any characteristics specified in the TARGET environment variable. If the TARGET
environment variable is set, but does not contain a machine name, or if the machine name is host, then
pmctable will contain information about the machine you are running on, modified by any characteristics
specified in the environment variable. See target(1) for more information about machine characteristics.
If pmtname is a valid machine name, then pmctable will contain default information about that machine.
When default information is returned, some of the fields in the target structure in <sys/target.h> may
not contain values.

004– 2165– 002 485


GETPMC ( 3F ) GETPMC ( 3F )

GETPMC returns 0 on error, – 1 on success.


The following is a list of valid arguments for this routine.
pmtname Input variable containing the primary machine name. The name must be left justified, and zero
terminated.
Valid values for pmtname include:
TARGET
HOST
CRAY-C 90
CRAY-T 3D
CRAY-T S
CRAY-T 3E
CRAY-J 90
CRAY-J SE

pmctable Output variable. The 128– word output array will contain the characteristics of the primary
machine type specified by pmtname. For a description of this array, see the target structure
defined in <sys/target.h>.
Both GETHMC and GETPMC are in libtarget.a. This library is not linked by default.

SEE ALSO
target(1), target(2)

486 004– 2165– 002


ICEIL ( 3F ) ICEIL ( 3F )

NAME
ICEIL – Returns integer ceiling of a rational number

SYNOPSIS
i=ICEIL(j, k)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
ICEIL is an integer function that returns the integer ceiling of a rational number formed by two integer
parameters.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
j The numerator of a rational number.
k The denominator of a rational number.
The value of function i is the smallest integer larger than or equal to j/k.

004– 2165– 002 487


ICPUSED ( 3F ) ICPUSED ( 3F )

NAME
ICPUSED – Gets task CPU time in real-time clock (RTC) ticks

SYNOPSIS
INTEGER itotalcp
itotalcp = ICPUSED( )

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
ICPUSED gets the user CPU time used by the calling task in real-time clock ticks.
The accuracy of ICPUSED is not affected by system interrupts.
This function is equivalent to the TSECND(3F) function except this returns the time in RTC ticks rather than
seconds; it returns the elapsed CPU time of the calling task.
For Cray T90 and Cray C90 series, CPU times returned by ICPUSED include wait-semaphore time. For all
other systems, CPU times returned by ICPUSED do not include wait-semaphore time.

SEE ALSO
cpused(3C) in the UNICOS System Libraries Reference Manual

488 004– 2165– 002


MOV ( 3F ) MOV ( 3F )

NAME
STRMOV, MOVBIT, MOVBITZ – Moves bytes or bits from one variable or array to another

SYNOPSIS
CALL STRMOV(src, isb, num, dest, idb)
CALL MOVBIT(src, isb, num, dest, idb)
CALL MOVBITZ(src, isb, num, dest, idb)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
STRMOV moves bytes from one variable or array to another. MOVBIT moves bits from one variable or array
to another.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
src Variable or array of any type except character, and of any length, containing the bytes or string
of bits to be moved.
isb Starting byte or bit in the src string. Specify an integer variable, expression, or constant greater
than 0. Bytes and bits are numbered from 1, beginning at the leftmost byte or bit position of
src. isb is one-based for STRMOV and MOVBIT and zero-based for MOVBITZ.
num An integer variable, expression, or constant that contains the number of bytes or bits to be
moved; it must be greater than 0.
dest Variable or array of any type except character, and of any length, that contains the starting byte
or bit to receive the data.
idb An integer variable, expression, or constant that contains the starting byte or bit to receive the
data; must be greater than 0. Bytes and bits are numbered from 1, beginning at the leftmost byte
or bit position of dest. idb is one-based for STRMOV and MOVBIT and zero-based for
MOVBITZ.

NOTES
These routines handle overlapping moves correctly.

004– 2165– 002 489


MOV ( 3F ) MOV ( 3F )

EXAMPLES

PRO GRAM TES T


INT EGER IBU FA( 3), IA( 3)
DAT A
+ IA/ 491856 866 475 613 494 8,
+ 493834 668 028 464 540 0,
+ 468855 566 164 743 181 6/
* MOVBIT 1: Mov e 129 bit s fro m off set 8 to off set 5
IBUFA= 0
CALL MOV BIT (IA (1) ,8, 129 ,IB UFA ,5)

* MOVBIT 2: Mov e 100 bit s fro m off set 35 to off set 10


DO 202 J=1 ,3
202 IBU FA( J)= 0
CALL MOV BIT (IA (1) ,35 ,10 0,I BUF A,1 0)
* STRMOV 1: Mov e 8 byt es fro m byt e 5 to byt e 1
IBUFA= 0
CALL STR MOV (IA (1) ,5, 8,I BUF A,1 )
* STRMOV 2: Mov e 8 byt es fro m off set 2 to off set 10
IBUFA= 0
CALL STR MOV (IA (1) ,2, 8,I BUF A,1 0)
END

The results:
MOVBIT 1:
IA= 042102 210220 221 202 204 4
042210 420220 500 610 403 0
040421 061042 021 104 421 0
IBUFA= 001 022102 202 212 022 044 2
022 104202 205 006 104 030 2
004 000000 000 000 000 000 0

MOVBIT 2:
IA= 042102 210220 221 202 204 4
042210 420220 500 610 403 0
040421 061042 021 104 421 0
IBUFA= 000 044240 441 104 221 042 0
044 120142 100 604 000 000 0
000 000000 000 000 000 000 0

490 004– 2165– 002


MOV ( 3F ) MOV ( 3F )

STRMOV 1:
IA= 042 102 210220221 202 2044
042 210 420220500 610 4030
040 421 061042021 104 4210
IBUFA= 011 050110221 044 210404 4
000 000000000 000 000000 0
000 000000000 000 000000 0

STRMOV 2:
IA= 042 102 210220221 202 2044
042 210 420220500 610 4030
040 421 061042021 104 4210
IBUFA= 000 000000000 000 000000 0
000 102210220 221 202204 4
042 000000000 000 000000 0

004– 2165– 002 491


MTTS ( 3F ) MTTS ( 3F )

NAME
MTTS – Converts machine time (real-time clock value) to time stamp

SYNOPSIS
INTEGER MTTS, ts, irtc, cptype, cpcycl
ts=MTTS(irtc [, cptype, cpcycl])

IMPLEMENTATION
UNICOS systems

DESCRIPTION
MTTS converts machine time (real-time clock value) to a time stamp.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
ts 64-bit integer result containing a time stamp in nanoseconds.
irtc 64-bit integer real-time clock value to be converted to a time stamp in nanoseconds.
cptype CPU type (not implemented under the UNICOS operating system). The CPU type is the host
machine.
cpcycl Integer specifying the CPU cycle time in picoseconds.
The integer function MTTS converts a real-time clock value irtc to a time stamp ts using cpcycl. If cpcycl is
not present, MTTS uses the clock cycle time for the system on which the executable is running.
The input ts and the result irtc may be larger than 48 bits.

NOTES
Time stamp routines are invalid for dates later than 1999.

SEE ALSO
dtts(3F), tsdt(3F), tsmt(3F), unitts(3F)

492 004– 2165– 002


MVC ( 3F ) MVC ( 3F )

NAME
MVC – Moves characters from one memory area to another

SYNOPSIS
CALL MVC(s1, j1, s2, j2, k)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
MVC moves characters from one memory area to another.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
s1 Word address of the source string.
j1 Byte offset from the source string word address of the first byte of the source string (the high-order
byte of the first word of the source string is byte 1).
s2 Word address of the destination string.
j2 Byte offset from the destination string word address of the first byte of the destination string (the
high-order byte of the first word of the destination string is byte 1).
k Number of bytes to be moved.
Source and destination strings can occur on any byte boundary. The move is performed 1 character at a
time, from left to right, so MVC is optimal only for certain types of overlapping moves.

EXAMPLES
To copy the first byte of an array throughout the array, invoke the routine as follows, where K is the length
of the array in bytes:
CALL MVC(AR RAY ,1, ARR AY,2,K -1)

004– 2165– 002 493


PACK ( 3F ) PACK ( 3F )

NAME
PACK – Compresses stored data

SYNOPSIS
CALL PACK(p, nbits, u, count)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
PACK takes partial word items and packs them into 64-bit words.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
p On exit, vector of packed data.
nbits Number of rightmost bits of data in each partial word; must be 1, 2, 4, 8, 16, or 32.
u Vector of partial words to be compressed.
count Number of partial word items to be compressed.
PACK takes the 1, 2, 4, 8, 16, or 32 rightmost bits of several partial words and concatenates them into 64-bit
words. The following equation gives the number of full words:

(count .nbits )
n =
64

n Number of resulting full words


count Number of partial words
nbits Number of rightmost bits of each partial word that contains useful data

494 004– 2165– 002


PACK ( 3F ) PACK ( 3F )

If count .nbits is not a multiple of 64, the final partial word items will be left-justified, zero-filled.

SEE ALSO
UNPACK(3F)

004– 2165– 002 495


P32 ( 3F ) P32 ( 3F )

NAME
P32, U32 – Packs or unpacks 32-bit words into or from Cray 64-bit words

SYNOPSIS
CALL P32(src, dest, num)
CALL U32(src, dest, num)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
P32 packs 32-bit words into Cray 64-bit words. U32 unpacks 32-bit words from Cray 64-bit words. The
PACK(3F) and UNPACK(3F) routines provide similar functionality.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
src For P32, a variable or array of any noncharacter type and of any length containing 32-bit words,
left-justified in a Cray 64-bit word. For U32, a variable or array of any type or length
containing 32-bit words as a continuous stream of data. Unpacking always starts with the
leftmost bit of src.
dest For P32, a destination array of any type to contain the packed 32-bit words as a continuous
stream of data. For U32, a destination array of any type to contain the unpacked 32-bit words,
left-justified and sign-filled in a Cray 64-bit word.
num Number of 32-bit words to pack or unpack. The routine reads this many elements of src or
generates this many elements of dest. Specify an integer variable, expression, or constant.

SEE ALSO
PACK(3F), UNPACK(3F)

496 004– 2165– 002


P6460 ( 3F ) P6460 ( 3F )

NAME
P6460, U6064 – Packs or unpacks 60-bit words into or from Cray 64-bit words

SYNOPSIS
CALL P6460(src, dest, isb, num [,stride])
CALL U6064(src, isb, dest, num [,stride])

IMPLEMENTATION
UNICOS systems

DESCRIPTION
P6460 packs 60-bit words into Cray 64-bit words. U6064 unpacks 60-bit words from Cray 64-bit words.
Arguments must be addressed in the same order in which they appear in the SYNOPSIS section.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following arguments are used with this routine:
src Variable or array of any noncharacter type and of any length containing 60-bit words,
left-justified in a Cray 64-bit word. For U6064, words are accepted as a continuous stream of
data.
dest For P6460, a destination array of any type to contain the packed 60-bit words as a continuous
stream of data. For U6064, a destination array of any type to contain the unpacked 60-bit
words, left-justified and sign-filled in a Cray 64-bit word.
isb Bit location that is the leftmost storage location for the 60-bit words. Bit position is counted
from the left to right, with the leftmost bit 0. Specify an integer variable, expression, or
constant.
num Number of 60-bit words to pack or unpack. The routine reads this many elements of src or
generates this many elements of dest. Specify an integer variable, expression, or constant.
stride Optional stride parameter for the dest array (U6064) or the src array (P6460). If not specified,
a stride of 1 is used.

004– 2165– 002 497


REPRIEVE ( 3F ) REPRIEVE ( 3F )

NAME
REPRIEVE – Describes error handling under the UNICOS and UNICOS/mk operating system

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
On UNICOS and UNICOS/mk systems, program errors (like floating-point errors, operand range errors, and
so on) can be handled by two mechanisms: core files or tracebacks. By default, all programs that use
Fortran I/O are loaded with the traceback code, and all other programs do not contain this code.
If the traceback code is loaded with a program, error conditions that would normally cause a fatal signal to
be sent are caught by a tracer routine. This tracer routine prints out the error condition and then gives a
traceback before aborting the program with a core dump. If the enhanced traceback mechanism is used (only
on UNICOS systems), the tracer routine prints out a more complete error status (including the P, A, S, VM,
and VL registers at the point of interrupt) and a traceback that includes routine arguments. It then flushes
buffers and ends execution of the program without a core dump (so no post-mortem debugging is available).
The following environment variables are available to change the characteristics of the traceback mechanism:
TRACEBK If set to 0, errors will cause a core dump but no traceback. If you intend to use a debugger to
debug your applications, or if you want to restart your core files, you should set this variable
to 0.
TRACEBK2 If set to nonzero (and TRACEBK is not set to 0), programs on UNICOS systems will use the
enhanced traceback mechanism.
The variables below are used to customize an enhanced traceback and are available only on UNICOS
systems if the TRACEBK2 variable is also set:
TRBKCORE If set to nonzero, it will give both a traceback and a core dump on encountering an error.
TRBKVEC If set to nonzero, the vector registers will be printed along with the other registers.
TRBKSIGS This variable can be used to alter the set of signal numbers that will cause a traceback to
occur. Its format is a list of numbers separated by commas; positive numbers in the list will
be added to the set of signal numbers, and negative numbers will be removed from the set of
signal numbers.

NOTES
The reprieve mechanism goes through all of the clean-up routines that would be run under abort(3C)
processing, including all of the routines registered by atabort(3C). Because all open files are flushed and
closed during this time, restarting a core file that is the result of reprieve processing will not work. For a
checkpoint/restart mechanism that is controllable by a signal, see SHUTDSAV(3F).

498 004– 2165– 002


REPRIEVE ( 3F ) REPRIEVE ( 3F )

EXAMPLES
Example 1: To get the enhanced traceback mechanism working for a C program, follow this example:
cc -c prog.c
seg ldr -D’har dre f=_ rep rin it’ pro g.o
env TRA CEBK2= 1 a.o ut

Example 2:
f90 prog.f
seg ldr pro g.o
a.o ut
<Trace back+c ore dum p pro duc ed>

env TRACEB K=0 a.o ut


<No traceb ack pro duc ed, jus t a cor e dum p>

TRACEB K2=1; exp ort TRACEB K2


<CRAY Y-MP sys tem s onl y, to get an enh anc ed tra ceb ack >

a.out
<Enhan ced sty le tra ceback , no cor e fil e pro duc ed>

env TRB KCORE= 1 a.o ut


<Gets a tra ceb ack and a cor e fil e>

env TRBKVE C=1 a.o ut


<Pr ints out vec tor reg ist ers wit h tra ceb ack >

env TRB KSIGS= 8,- 7 a.o ut


<Ad ds sig nal 8, rem ove s sig nal 7 fro m the set of
traceb ack sig nal s>

SEE ALSO
TRACEBK(3F) (the Fortran interface), signal(2) for a list of signals
abort(3C), SHUTDSAV(3F)

004– 2165– 002 499


SECOND ( 3F ) SECOND ( 3F )

NAME
SECOND – Returns elapsed CPU time

SYNOPSIS
All systems:
second=SECOND()
UNICOS systems:
CALL SECOND(second)

IMPLEMENTATION
UNICOS, UNICOS/mk and IRIX systems

DESCRIPTION
SECOND returns the elapsed user CPU time as a real number in seconds (a default REAL*4) since the start
of a program, including time accumulated by all processes in a multitasking program.
SECOND returns execution time only for the current program. For example, a script runs a 50-second
program 10 times. A SECOND call at the end of the 10th run (or 1st or 3rd or 7th) returns 50 seconds.
On UNICOS systems, SECOND is not appropriate for timing small timed regions. If the timed region is
fewer than 4000 clock periods (CPs) in duration, the variation in the accuracy of SECOND can be 10% or
more on one processor. On multiple processors, the variation can be on the order of 10,000 to 400,000 CPs.
The second argument is the result, or CPU time (in type real seconds) accumulated by all processes in a
program.

NOTES
On UNICOS systems, the initial call to SECOND may take longer than subsequent calls due to certain
initializations performed by the routine. If the cost of calling SECOND is important, ignore the initial call
when computing SECOND’s time. The calculation of OVERHEAD in the second example, following, serves
this purpose. On UNICOS systems, the CPU times gathered by SECOND include wait-semaphore time.

WARNINGS
If you are trying to time your entire program, and you are using Autotasking, the CPU time returned by
SECOND may not reflect all of the CPU time used by your program. This is due to the fact that slave CPUs
may be still active when your program terminates (for instance, with a STOP or END statement). Depending
on the number of active CPUs on your machine, the extra time needed to terminate the slaves may be
substantial compared with your program time. Thus, if you use SECOND to time your program, and you are
also using time(1) or ja(1), the time reported by these other utilities could be much higher than that
reported by SECOND.

500 004– 2165– 002


SECOND ( 3F ) SECOND ( 3F )

Because of the large variation on multiple processors, SECOND should be used cautiously in multitasked
routines. On IRIX systems, the presence of multitasking does not affect the accuracy of SECOND.

EXAMPLES
Example 1: This example calculates the CPU time used in DOWORK:
BEF ORE = SEC OND ( )
CAL L DOWORK ( )
AFT ER = SEC OND ( )
CPU TIM E = AFT ER - BEFORE

Example 2: If the CPU time is small enough that the overhead for calling SECOND may be significant, the
following example is more accurate:
T0 = SEC OND( )
OVE RHE AD = SEC OND( ) - T0
BEF ORE = SECOND ( )
CAL L DOW ORK( )
AFT ER = SECOND( )
CPU TIME = (AFTER - BEF ORE ) - OVE RHEAD

SEE ALSO
RTC(3I), SECONDR(3F), TIMEF(3F), TSECND(3F)
ja(1), time(1) in the UNICOS User Commands Reference Manual

004– 2165– 002 501


SECONDR ( 3F ) SECONDR ( 3F )

NAME
SECONDR – Returns elapsed wall-clock time in seconds

SYNOPSIS
All systems:
REAL (KIND=8) SECONDR
time=SECONDR( )
UNICOS systems:
CALL SECONDR(time)

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems

DESCRIPTION
On IRIX systems, this routine is in libffio.so which is linked by default when compiling programs with
the MIPSpro 7 Fortran 90 compiler or when compiling programs with the -craylibs option to the
MIPSpro F77 compiler.
SECONDR can be called several times during the execution of a program to determine the amount of elapsed
wall-clock time.
time is the real-time clock values in floating-point seconds. If the value of the real-time clock exceeds 48
bits, some accuracy may be lost during the conversion to float. The argument must be of type real with
KIND=8.
On UNICOS/mk systems, the real-time clocks on processing elements are not synchronized with each other.
Therefore, a SECONDR() value should not be compared to a previous SECONDR() taken on a different
processing element.
EXAMPLES
This example calculates the elapsed wall-clock time from the first call to SECONDR until the second call to
SECONDR.
BEFORE = SECOND R( )
CALL DOWORK ( )
AFT ER = SECOND R( )
WALTIM = AFTER - BEF ORE

SEE ALSO
RTC(3I), SECOND(3F), TIMEF(3F), TSECND(3F)

502 004– 2165– 002


SETPLIMQ ( 3F ) SETPLIMQ ( 3F )

NAME
SETPLIMQ – Initiates a detailed tracing of each call and return

SYNOPSIS
SETPLIMQ(lines)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
SETPLIMQ writes trace lines to stderr. Calling this routine only affects flowtracing. Perftrace contains
this routine name, but calling it has no effect.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
lines Integer specifying the number of traces to display. Passing a negative number gives
unpredictable results.

004– 2165– 002 503


SHUTDSAV ( 3F ) SHUTDSAV ( 3F )

NAME
SHUTDSAV – Sets up the calling program to be checkpointed on system shutdown

SYNOPSIS
CALL SHUTDSAV(path, flags)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
SHUTDSAV establishes a signal handler that catches the SIGSHUTDN signal, indicating that the system is
going to shut down soon. The signal handler, upon receipt of the SIGSHUTDN signal, checkpoints the
program using the chkpnt(2) system call, creating a restart file with the specified name.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
SHUTDSAV has the following arguments:
path Character string path name of the file to be created as the restart file. The path argument must
not refer to a file that already exists, since the chkpnt(2) system call that performs the actual
checkpoint work will not overwrite an existing file. If path does not designate an absolute path
name, then the restart file will be created relative to the current working directory of the calling
program at the time that the SIGSHUTDN signal is received. Finally, the directory in which the
restart file is to be created must be writable by the caller for the checkpoint to be successful.
flags Control options. Specify an integer variable or constant. If the least-significant bit of flags is 0,
the calling program will not checkpoint itself upon a system shutdown if it is running as part of
an Network Queuing System (NQS) batch job. This is important because, by default, NQS
checkpoints all of the jobs under its control upon a system shutdown, making any additional
checkpoint work by the program unnecessary. Alternatively, if the least-significant bit of flags is
set, the calling program will try to checkpoint itself, even when running as part of an NQS batch
job. In all other cases, the calling program will try to checkpoint itself upon the receipt of a
SIGSHUTDN signal. Finally, all bits other than the least-significant bit of flags are reserved for
future use, and they should be set to 0.

NOTES
Certain conditions must be satisfied for a process to be successfully checkpointed. See chkpnt(2) in the
UNICOS System Calls Reference Manual, for a discussion of the restrictions placed on a process that is to be
checkpointed.

504 004– 2165– 002


SHUTDSAV ( 3F ) SHUTDSAV ( 3F )

SEE ALSO
chkpnt(1), restart(1) in the UNICOS User Commands Reference Manual
chkpnt(2), restart(2), sigctl(2) in the UNICOS System Calls Reference Manual

004– 2165– 002 505


SIGOFF ( 3F ) SIGOFF ( 3F )

NAME
SIGOFF, SIGON – Controls receipt of signals

SYNOPSIS
INTEGER oldstat
CALL SIGOFF
CALL SIGON

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
SIGOFF and SIGON allow signals to be deferred without issuing a system call. SIGOFF prevents the
receipt of all signals that have a signal handler registered for them; however, all signals that terminate or
cause a core dump of the process will be delivered.
Use these routines for coding critical sequences. Both routines return the previous signal status; a nonzero
value means signals are deferred.
SIGON allows receipt of signals after a SIGOFF or within a signal handler.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.

EXAMPLES

INT EGER OLD STA T, SIG OFF , SIG ON


OLD STAT = SIG OFF ()
C < Critic al reg ion of cod e>
IF( OLDSTA T .EQ . 0) CAL L SIG ON

SEE ALSO
sigoff(3C) in the UNICOS System Libraries Reference Manual
signal(2), pause(2) in the UNICOS System Calls Reference Manual

506 004– 2165– 002


STOP_ALL ( 3F ) STOP_ALL ( 3F )

NAME
STOP_ALL – Stops all PEs in an application

SYNOPSIS
CHARACTER*n message
CALL STOP_ALL([message])
CALL STOP_ALL_DISABLE()
CALL STOP_ALL_ENABLE()

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
The STOP_ALL subroutine causes a program to run all cleanup routines (including flushing I/O buffers),
print out a message (saying where it was called from), and exit. If called from a single processing element
(PE), STOP_ALL causes all PEs in a multi-PE application to run their cleanup routines and exit, even if
called from a parallel region. This differs from the STOP intrinsic in that STOP causes all PEs to exit if
called from a master region, but will only cause the calling PE to exit if called from a parallel region.
Many library routines may not safely be interrupted by a STOP_ALL request from another PE; unexpected
results might occur if they are interrupted. The user can call STOP_ALL_DISABLE to block any
STOP_ALL requests on the calling PE; when STOP_ALL_ENABLE is called, any pending or new
STOP_ALL requests will be acted on.
The STOP_ALL function has the following optional argument:
message String to be printed as part of the STOP_ALL message line

RETURN VALUES
STOP_ALL returns no value.

SEE ALSO
exit(3C)

004– 2165– 002 507


SYMDEBUG ( 3F ) SYMDEBUG ( 3F )

NAME
SYMDEBUG – Produces a symbolic snapshot of a running process

SYNOPSIS
CALL SYMDEBUG(’param{,param}.’)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
SYMDEBUG is a library routine that produces the same sort of output as debug. SYMDEBUG is provided on
the UNICOS operating system primarily to ease migration of applications from COS; new code should use
SYMDUMP(3F), which is designed for use with the UNICOS operating system.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems, the default kind is KIND=8 for integer, real, complex, and
logical arguments.
This routine takes the following arguments:
param SYMDEBUG parameters. param may be entered in either uppercase or lowercase.
Some SYMDEBUG parameters allow you to specify a value along with the parameter. In these
cases, param=value substitutes for param. In param=value, in which value is a symbol, value is
case-sensitive.
SYMDEBUG uses the following parameters:
S=sfile Specifies the file containing the Debug Symbol tables. The default is a.out.
L=lfile Specifies the file to receive the listing output from the symbolic debug routine. By default,
SYMDEBUG output is written to stdout.
CALLS=n Number of routine levels to be looked at in a symbolic dump. For each known task,
SYMDEBUG traces back through the active subprograms the number of levels specified by n.
Routines for which no symbol table information is available are not counted for purposes of the
CALLS count. If this parameter is omitted, or if CALLS is specified without a value, the default
is 50.
SYMS=sym{:sym}
List of symbols to be dumped by SYMDEBUG. Up to 20 symbols (syms) can be specified, and
there is no limit on the length of the symbol names. Separate individual syms with a colon.
SYMS applies to all blocks dumped; by default, all symbols are dumped.
With regard to case, syms must be entered in exactly the way the symbol names appear in the
Debug Symbol table. Symbol names might not appear in the Debug Symbol table in the same
way they appear in your program. Fortran and Pascal always convert names to uppercase.

508 004– 2165– 002


SYMDEBUG ( 3F ) SYMDEBUG ( 3F )

NOTSYMS=nsym{:nsym}
List of symbols to skip. Up to 20 symbols (nsyms) can be specified, and there is no limit on the
length of the symbol names. Separate individual nsyms with a colon. The default skips no
symbols. This parameter takes precedence over the SYMS parameter.
With regard to case, nsyms must be entered in exactly the way the symbol names appear in the
Debug Symbol table. Symbol names might not appear in the Debug Symbol table in the same
way they appear in your program. Fortran and Pascal always convert names to uppercase.
MAXDIM=dim{:dim}
Maximum number of elements from each dimension of the arrays to be dumped. MAXDIM lets
you sample the contents of arrays without creating huge amounts of output. When MAXDIM is
specified, arrays are dumped in storage order (row, column for Pascal; column, row for Fortran).
MAXDIM applies to all blocks dumped. The default is MAXDIM=20:5:2:1:1:1:1. No more
than 7 dimensions can be specified.
BLOCKS=blk{:blk}
List of Fortran common blocks to be included from the symbolic dump. A maximum of 20
blocks can be specified. Separate the blks with colons. All symbols (qualified by the SYMS and
NOTSYMS parameters) in the named blocks are dumped. Default is no common blocks dumped;
if you specify BLOCKS without any blks, all common blocks declared in routines to be dumped
are included in the symbolic dump.
blk must be entered in uppercase.
NOTBLKS=nblk{:nblk}
List of Fortran common blocks to be excluded in the symbolic dump. A maximum of 20 blocks
can be specified. Separate the nblks with colons. This parameter is used in conjunction with
BLOCKS and takes precedence over the BLOCKS parameter.
nblk must be entered in uppercase.
RPTBLKS Repeat blocks; when this option is used, the contents of Fortran common blocks specified with
the BLOCKS and NOTBLKS parameters are displayed for each subroutine in which they are
declared. The default displays common blocks only once.
PAGES=np Page limit for the symbolic dump routine. Under the UNICOS operating system, SYMDEBUG
does not format output in pages. However, this parameter can still be used to regulate the
amount of output that SYMDEBUG generates. Each page is worth 45 lines of output from
SYMDEBUG. The default np is 70.

NOTES
Specify library libdb.a, which contains SYMDEBUG, on the -l option when you load your program. See
the examples on loading in the NOTES section of the SYMDUMP(3F) man page.

004– 2165– 002 509


SYMDEBUG ( 3F ) SYMDEBUG ( 3F )

EXAMPLES
The following are example calls from Fortran to SYMDEBUG:
CAL L SYM DEBUG( ’CA LLS =40 ,RP TBL KS. ’)

CAL L SYM DEBUG( ’BL OCK S=A A:B B:C C.’ )

SEE ALSO
SYMDUMP(3F)

510 004– 2165– 002


SYMDUMP ( 3F ) SYMDUMP ( 3F )

NAME
SYMDUMP – Produces a symbolic snapshot dump of a running program

SYNOPSIS
CALL SYMDUMP (’-b blklist -B -c calls -d dimlist -l lfile -r -s symfile -V -y symlist -Y’,
abort_flag)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
SYMDUMP is a library routine that produces the same sort of output as debug. It accepts C character
descriptors, Fortran Hollerith strings, and Pascal packed character arrays.
The method of calling library routines differs from language processor to language processor, but SYMDUMP
accepts the same arguments regardless of the language processor. The argument string, if provided, must be
enclosed in parentheses, and the options (excluding the Abort flag) must be enclosed in quotation marks.
When calling SYMDUMP from Fortran or Pascal, the quotation marks must be single; when calling from C,
the quotation marks must be double. All arguments are optional.
The options indicate the type and extent of information to be dumped by SYMDUMP. The options string is
passed to SYMDUMP in one of the following forms:
• As a character descriptor, produced by Fortran and C for defined character strings
• As an address of a null-terminated string, such as an integer, Hollerith, or Pascal packed character array
The argument string can contain a maximum of 4096 characters. All options are optional, and they may
appear in any order.
Unlike command lines, SYMDUMP option-arguments may not be grouped after one hyphen on the SYMDUMP
call. That is, SYMDUMP(’-V -r’) is permitted, but SYMDUMP(’-Vr’) is not permitted.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems, the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following are valid options and arguments:
-b blklist
-B These options control the displaying of Fortran common block symbols and may occur anywhere
in the option string in any order. The symbols to be displayed from any particular common
block depends on the use of the -Y and -y symlist options.

004– 2165– 002 511


SYMDUMP ( 3F ) SYMDUMP ( 3F )

If neither option is specified, no Fortran common blocks are included in the symbolic dump.
This is the default. If -B is specified, all Fortran common blocks are included in the symbolic
dump. If -b blklist is specified, only the Fortran common blocks named in blklist are included
in the symbolic dump. If both options are specified, all Fortran common blocks are included in
the symbolic dump, except those in blklist.
blklist may have up to 20 Fortran common blocks named. There is no limit on the length of a
common block name. The common blocks named in blklist must be separated by commas (for
example: -b c,d).
The common blocks named by blklist must be entered in uppercase letters.
-c calls An integer that specifies the number of routine levels to be displayed in the symbolic dump. For
each known task, SYMDUMP traces back through active routines the number of levels specified
by calls. Routines for which no symbol table information is available are not counted for
purposes of the routine level count. The default is 50.
-d dimlist A list of integers that specifies the maximum number of elements from each dimension of the
arrays to be dumped. SYMDUMP can dump array elements from up to seven dimensions. The
dimensions must be specified by integer values, and the values must be separated by commas
(for example: -d 4,6).
This option lets you sample the contents of an array without creating huge amounts of output.
dimlist applies to all blocks dumped, and the arrays are dumped in storage order. The default is
20,5,2,1,1,1,1.
-l lfile Names an output file. Specifying -l file directs SYMDUMP to write output to the specified file.
If you call SYMDUMP more than once, and you specify -l with the same file each time,
SYMDUMP output will be appended to the file each time. By default, SYMDUMP output is written
to stdout.
-r Repeat blocks. When this option is used, SYMDUMP displays the contents of Fortran common
blocks specified with -B and -b blklist for each subroutine in which they are declared. The
default displays common blocks only once.
-s symfile Names a file containing the Debug Symbol tables. There is no limit on the length of the symfile
file name, and it may include a path name to the desired file. segldr puts both the symbol
table information and the executable binary in the same file. By default, Debug Symbol tables
are written to a.out.
-V With -V specified, SYMDUMP generates SYMDUMP release statistics.
-y symlist
-Y These options control the displaying of symbols and may occur anywhere in the option string in
any order.
If neither option is specified, all symbols are displayed. This is the default. If only the -Y
option is specified, no symbols are displayed. If only the -y option is specified, all symbols
except those named in symlist are displayed. If both options are specified, only the symbols
named in symlist are displayed.

512 004– 2165– 002


SYMDUMP ( 3F ) SYMDUMP ( 3F )

The symlist variable may contain up to 20 named symbols, and there is no limit to the length of
the symbol names. The symbols named in symlist must be separated by commas (for example:
-y a, b).
Enter the symbols in the same case in which they appear in the symbol table. Names may not
always appear in the symbol table in the same way they appear in your program. Fortran and
Pascal always convert names to uppercase.
abort_flag An optional abort_flag variable indicates to SYMDUMP whether or not to abort if it finds an error
when parsing the SYMDUMP statement. An abort_flag with a value of 0 indicates no abort; an
abort_flag with a nonzero value indicates abort.
You cannot enter an abort_flag variable if you have not entered any options.
By default, SYMDUMP examines all options, reports errors found, and generates a dump based on
the options it could understand; the program does not abort.
Note that the abort_flag variable is not allowed when the option string is a Pascal variant array.

NOTES
Specify library libdb.a, which contains SYMDUMP, on the -l option when you load your program.
The following three examples show how to load programs that call SYMDUMP.
Example 1: If you are not expanding blank common and do not need to specify a segldr
HEAP directive on the segldr command line for any other reason, you do not need to specify a segldr
HEAP or STACK directive. The following example shows a segldr command line without HEAP or
STACK directives:
seg ldr -l db.a *.o

Example 2: If you are expanding blank common, you need to specify stack and heap sizes to segldr. The
following example shows a segldr command line that can be used if the program expands blank common.
seg ldr -l db. a -D "STACK =30 00+ 0;H EAP =10 000 +0" *.o

This example shows settings that should provide enough stack and heap space for SYMDUMP to run,
assuming that your program is an average large application that has as many as 1000 blocks. For
applications with more blocks, 6 to 7 words per block over 1000 should be added to the heap setting.
Optimal heap settings depend on the specific application.
If running the application causes SYMDUMP to exit with the following error message, the value on the HEAP
directive is too small:
HPA LLOC failed ; ret urn sta tus = i

004– 2165– 002 513


SYMDUMP ( 3F ) SYMDUMP ( 3F )

Example 3: If a segldr DYNAMIC directive is used, the stack and heap cannot expand, so a segldr
STACK or HEAP directive may also be needed. See the previous example for information about expanding
the stack and heap. To load the heap prior to blank common, use DYNAMIC=// on segldr’s -D option,
as shown in the following example:
segldr -l db. a -D "DYNAMIC= //" *.o

Both libdb.a and libp.a are required if ld(1) or cc(1) is used.

EXAMPLES
Example 1: The following example shows how to call SYMDUMP from a Fortran program when passing a
character descriptor:
cha rac ter*30 str ing
int ege r abt fl
.
.
str ing = ’-s test -B -b STR ING ’
abt fl = 1
.
.
C CHA RAC TER VAR IAB LE
cal l sym dum p (st ring, abt fl)
.
.
C CHA RACTER CONSTA NT
cal l sym dump (’-l outfil e -V’ )

Example 2: The following example shows how to call SYMDUMP from C:


ext ern void SYMDUMP( );

int abt_fl ag = 1;
char *strin g;

string = "-s a.o ut -V";


SYM DUMP (strin g, &abt_flag );

514 004– 2165– 002


SYMDUMP ( 3F ) SYMDUMP ( 3F )

Example 3: The following example shows how to call SYMDUMP from Pascal when passing a conformant
array:
typ e
str ing _ty pe = packed arr ay [1..30 ] of cha r;
var
abo rt_ fla g: boolea n;

pro ced ure symdum p (va r str ing : str ing _ty pe; var flag: boo lea n);
imp ort ed (SYMDU MP) ;

abo rt_ fla g := tru e;


str ing [1..20 ] := ’-s tes t -y STR ING -Y’ ;
str ing [21 ] := chr (0) ; (* mus t nul l ter min ate the str ing *)
sym dum p (strin g, abort_ fla g);

SEE ALSO
SYMDEBUG(3F)
For more information on segldr, see Segment Loader (SEGLDR) and ld Reference Manual.

004– 2165– 002 515


SYSCLOCK ( 3F ) SYSCLOCK ( 3F )

NAME
SYSCLOCK – Returns real-time clock value and number of wraps

SYNOPSIS
INTEGER ICOUNT, IWRAP
CALL SYSCLOCK (icount, iwrap)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
SYSCLOCK returns the same real-time clock count returned by the count argument to the Fortran 90
SYSTEM_CLOCK intrinsic subroutine.
On systems with default 32-bit integer data type, the real-time clock value for SYSTEM_CLOCK reaches
count_max and wraps around to 0 occasionally. The number of times that the clock has wrapped is returned
in iwrap. By using iwrap, you can reliably time intervals during which the clock may have wrapped one or
more times.
Use the count_rate argument on the SYSTEM_CLOCK intrinsic subroutine to determine the clock rate for
SYSCLOCK.
When using the CF90 compiler on UNICOS or UNICOS/mk system, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, default kind is KIND=8 for integer, real,
complex, and logical arguments.

RETURN VALUES
iwrap always returns 0 on 64-bit systems.

SEE ALSO
IRTC(3I), SYSTEM_CLOCK(3I), TIMEF(3F)

516 004– 2165– 002


TIMEF ( 3F ) TIMEF ( 3F )

NAME
TIMEF – Returns elapsed wall-clock time in milliseconds since the previous call to TIMEF

SYNOPSIS
REAL (KIND=8) TIMEF
timef=TIMEF()
UNICOS systems:
CALL TIMEF(timef)

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems

DESCRIPTION
On IRIX systems, this routine is in libffio.so which is linked by default when compiling programs with
the MIPSpro 7 Fortran 90 compiler or when compiling programs with the -craylibs option to the
MIPSpro F77 compiler.
TIMEF returns the elapsed wall-clock time since a call to TIMEF.
The following is a list of valid arguments for this routine.
timef Elapsed wall-clock time (a real number in milliseconds) since the initial call to TIMEF. This
argument must be of type real. The initial call to TIMEF returns 0.0.

NOTES
If TIMEF calculates a negative value for the elapsed wall-clock time, it resets the initial value of the clock to
the current value of the lock and returns 0.0.

004– 2165– 002 517


TRACEBK ( 3F ) TRACEBK ( 3F )

NAME
TRACEBK – Prints a traceback

SYNOPSIS
CALL TRACEBK
or
INTEGER idepth
CALL TRACEBK(idepth)
or INTEGER idepth
CHARACTER*n filenm
CALL TRACEBK(idepth, filenm)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
TRACEBK prints (on stdout) a traceback beginning with its caller and ending at "Start-up," or when idepth
is reached. The traceback includes the arguments and their values and some data about the run-time stack.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
TRACEBK has the following optional arguments:
idepth Integer expression containing trace depth; if no argument is used, or idepth is not in the range 3
to 50, 25 is used. idepth can have the following values:
<0 Trace depth equals 25
0 Print one line "Where am I" message
1 Print one line trace (caller’s name and line number)
2 Print "Where am I" and one line trace
>2 Trace depth (25 if above 50)
filenm Character variable containing the name of a file in which to write the traceback. idepth must be
present if filenm is present.
The optional filenm argument in the CALL to TRACEBK is a character variable containing the name of a file
in which TRACEBK() will write the traceback. filenm must not be open as a Fortran file when
TRACEBK() is called because the results are unpredictable. filenm may be read with standard Fortran I/O.

518 004– 2165– 002


TRACEBK ( 3F ) TRACEBK ( 3F )

MESSAGES
TRACEBK fails (with a message on stdout) if the trace data has been noticeably corrupted.

SEE ALSO
TRBK(3F) for information on listing the subroutines in a current calling sequence
REPRIEVE(3F) for a general description of reprieve processing, including descriptions of related
environment variables
STKSTAT(3C) in the UNICOS System Libraries Reference Manual

004– 2165– 002 519


TRBK ( 3F ) TRBK ( 3F )

NAME
TRBK – Lists all subroutines active in the current calling sequence

SYNOPSIS
CALL TRBK [(depth)]

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
TRBK prints a list of all subroutines that are active in the current calling sequence from the currently active
subprogram. It also identifies the address of the reference. The list is printed to stderr.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
depth Optional argument that selects the maximum traceback depth. If not specified, the default is the
value of the TRBKDPTH environment variable (if defined) or 25 if the variable is not defined.

SEE ALSO
REPRIEVE(3F) for a description of UNICOS error handling
TRACEBK(3F) for information about the ability to write traceback information to an alternate file

520 004– 2165– 002


TRBKLVL ( 3F ) TRBKLVL ( 3F )

NAME
TRBKLVL – Returns information on current level of calling sequence

SYNOPSIS
CALL TRBKLVL(trbktab, arglist, status, name, calladr, entpnt, seqnum, numarg)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
TRBKLVL returns information on the current level of the calling sequence.
The following is a list of valid arguments for this routine.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
trbktab Current level’s traceback table address; on exit, current level caller’s traceback table address.
Returns a 0 if the current level is a main-level routine.
arglist Current level’s argument list address; on exit, current level caller’s argument list address.
Returns a 0 if the current level is a main-level routine.
status status can have the following values:
<0 Error
=0 No error
>0 No error and the current level is the main level
name Current level’s name (ASCII, left-justified, blank-filled). This may not be a Fortran character
variable.
calladr Parcel address from which the call to the current level was made.
entpnt Parcel address of the current level’s entry point.
seqnum Line sequence number corresponding to the call address (0 indicates none).
numarg Number of arguments or registers passed to the current level.

EXAMPLES
Using TRBKLVL from a Fortran program requires knowledge of the values of the traceback table address and
argument list address. This information is usually kept in B registers by the Fortran system. To get the
necessary information, you must use the getb1 and getb2 functions. These should be declared as integer
externals.

004– 2165– 002 521


TRBKLVL ( 3F ) TRBKLVL ( 3F )

Example of use:
intege r get b1, getb2
int ege r trb ktab,argl ist ,st atu s,c all adr ,en tpn t
intege r seqnum
c
c Get traceb ack table add res ses for thi s
c rou tin e.
c
arg lis t=getb1()
trbkta b=g etb2()
c
c Callin g trb klv l wil l ret urn us the nam e
c and oth er inform ati on for thi s rou tin e.
c
cal l trb klv l(trbktab ,ar gli st, sta tus ,na me, cal lad r,
x entpnt ,se qnu m,n uma rg)
c
c At thi s point, ’tr bktab’ and ’argli st’ con tai n the se
c values for the routin e usi ng trb klv l. ’na me’ con tai ns
c the name of thi s rou tin e, and so on.
c
c Callin g trbklvl aga in wil l ret urn the inf orm ati on for
c the cal ler of thi s rou tin e.
c
cal l trb klv l(trbktab ,ar gli st, sta tus ,na me, cal lad r,
x entpnt ,se qnu m,n uma rg)
c
c At thi s point, ’tr bktab’ and ’argli st’ con tai n the se
c values for the caller . ’na me’ contai ns the nam e of
c the cal ling routine, and so on.
c
c If we call trbklv l aga in, wit h the sam e par ame ter s,
c the return ed values wil l the n con tai n inf orm ati on abo ut the
c cal ler ’s caller . We can con tin ue thi s rep eat ed pro ces s unt il
c we rea ch the top of the callin g tre e. At tha t poi nt, ’st atu s’
c wil l be a num ber gre ate r tha n zer o, and the use r sho uld sto p
c cal lin g trb klvl. Oth erwise , the use r wou ld loo p ind efi nit ely .

Note that the name returned is truncated to 8 characters if it is longer than 8 characters.

SEE ALSO
TRBK(3F)

522 004– 2165– 002


TREMAIN ( 3F ) TREMAIN ( 3F )

NAME
TREMAIN – Returns the CPU time (in seconds of type real) remaining for the program

SYNOPSIS
CALL TREMAIN(result)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
This routine returns the CPU time remaining for the program.
result The calculated CPU time remaining. Type real.

NOTES
The time remaining is the lesser of the CPU time remaining for the current program, and the CPU time
remaining for the current process.
TREMAIN returns 0 after the time limit is exceeded and returns a large number if no CPU time limits are in
effect.

004– 2165– 002 523


TRIMLEN ( 3F ) TRIMLEN ( 3F )

NAME
TRIMLEN – Returns the length of a character argument without counting trailing blanks

SYNOPSIS
INTEGER trimlen
intlen = TRIMLEN(string)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
TRIMLEN is an integer function that returns the length of a character argument without counting the trailing
blanks. The function must be declared as type integer in the calling routine. The string argument must be
of type character.
This function is intended for use as part of the substring notation. Examples 2 and 3 show the TRIMLEN
function used in this manner. The value of each of the parts of the substring notation must be as follows:
1 ≤ leftmostpos ≤ rightmostpos ≤ stringlength

leftmostpos is the leftmost character position in the substring, rightmostpos is the rightmost character position
in the substring, and stringlength is the declared length of the character entity. TRIMLEN returns a value of
1 for a string of all blanks.

EXAMPLES
Example 1: A program using the function TRIMLEN could do the following:
INT EGER TRIMLE N
CHARAC TER*80 STR ING
STRING = ’ ’
STRING (20:47 ) = ’TE ST TRI MLE N LEN GTH RET URN ED’
INTLEN = TRI MLE N(S TRI NG)
WRITE( 6,1) INT LEN , STR ING (1: INT LEN )
1 FORMAT (’ LEN GTH =’, I5, ’ STR ING =’, A,’ -DO NE’ )
PRINT 2,’123 456 789 012 345 678 901 234 567 890 123 456 789 012 345 678 90’
2 FORMAT (21X,A )
END

The output of the program is as follows:


LEN GTH= 47 STR ING = TES T TRI MLE N LEN GTH RET URN ED- DON E
123 456 789 012 345 678 901 234 567 890 123 456 789 012 345 678 90

524 004– 2165– 002


TRIMLEN ( 3F ) TRIMLEN ( 3F )

Example 2: This example produces a string with the character < written following the last nonblank
character of STRING:
WRI TE( 6,9 01) STRING (1: TRI MLE N(STRI NG) )
901 FOR MAT (’ The string is >’, A,’<’)

Example 3: In this example, although NEW may have trailing blanks, the character < is written after the last
nonblank character in STRING:
NEW = STR ING (1:TRI MLE N(S TRING) ) // ’< The end ’

004– 2165– 002 525


TSECND ( 3F ) TSECND ( 3F )

NAME
TSECND – Returns elapsed CPU time for a calling task or process

SYNOPSIS
second=TSECND()
CALL TSECND(second)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
On UNICOS systems, this routine returns the elapsed CPU time of a calling task since the start of that task.
On UNICOS/mk systems, this routine returns the elapsed CPU time of a calling process since the start of
that process.
When using the CF90 compiler on UNICOS or UNICOS/mk systems, all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, the default kind is KIND=8 for integer, real,
complex, and logical arguments.
This routine accepts the following argument:
second A real variable. second is the elapsed CPU time in seconds.
The initial call to TSECND may take longer than subsequent calls due to certain initializations performed by
the routine. If the cost of calling TSECND is important, ignore the initial call when computing TSECND’s
time.
TSECND only returns CPU time for the current task or process. It is your responsibility to determine which
task or process is running at the time the call is made. This call may not be useful in an Autotasking
environment, because the running user program does not know which task is actually executing the parallel
regions of code.
For Cray C90 series, CPU times returned by TSECND include wait-semaphore time. For all other systems,
CPU times returned by TSECND do not include wait-semaphore time. Contrast this with the SECOND(3F)
call.

526 004– 2165– 002


TSECND ( 3F ) TSECND ( 3F )

EXAMPLES
The following example calculates how much of the total execution time for a multitasked program is
accumulated by the calling process.
BEF ORE = SEC OND ( )
TBE FORE = TSE CND ( )
CALL DOWORK ( ) ! The sub rou tin e DOW ORK or
AFTER = SEC OND ( ) ! som eth ing it cal ls may be
TAF TER = TSE CND ( ) ! mul tit ask ed.
CPU = (AF TER - BEF ORE )
TCP U = (TAFTE R - TBE FORE)
MYPORT ION = TCP U/C PU

SEE ALSO
RTC(3I), SECOND(3F), SECONDR(3F)

004– 2165– 002 527


TSDT ( 3F ) TSDT ( 3F )

NAME
TSDT – Converts time stamps to ASCII date and time strings

SYNOPSIS
CALL TSDT(ts, date, hhmmss, ssss)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
TSDT converts time stamps to ASCII date and time.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
ts Time stamp on entry (type integer). This may not be Fortran character variable.
date Word to receive ASCII date in mm/dd/yy format. This may not be Fortran character variable.
hhmmss Word to receive ASCII time in hh:mm:ss format. This may not be Fortran character variable.
ssss Word to receive ASCII fractional seconds in .ssssnnn format

NOTES
Time stamp routines are invalid for dates later than 1999.

528 004– 2165– 002


TSMT ( 3F ) TSMT ( 3F )

NAME
TSMT – Converts time stamp to machine time (real-time clock value)

SYNOPSIS
INTEGER TSMT irtc, ts, cptype, cpcycl
irtc=TSMT(ts [, cptype, cpcycl])

IMPLEMENTATION
UNICOS systems

DESCRIPTION
TSMT converts a time stamp to machine time (real-time clock value).
The following are valid arguments for this routine.
irtc 64-bit integer result of the conversion of the specified time stamp to a real-time clock value.
ts 64-bit integer specifying a time stamp in nanoseconds to be converted to a real-time clock value.
cptype CPU type (not implemented under the UNICOS operating system). The CPU type is the host
machine.
cpcycl Integer specifying CPU cycle time in picoseconds.
The integer function TSMT converts time stamp ts specified in nanoseconds to a number of clock ticks using
cpcycl. If cpcycl is not present, TMST uses the clock cycle time for the system on which the executable is
running.
The input ts and the result irtc may be larger than 48 bits.

NOTES
Time stamp routines are invalid for dates later than 1999.

SEE ALSO
DTTS(3F), MTTS(3F), TSDT(3F), UNITTS(3F)

004– 2165– 002 529


UNITTS ( 3F ) UNITTS ( 3F )

NAME
UNITTS – Returns time-stamp units in specified standard-time units

SYNOPSIS
INTEGER UNITTS
ts=UNITTS(periods, units)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
UNITTS returns time-stamp units in specified standard-time units.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
ts Number of time-stamp units in periods and units (type integer).
periods Number of time-stamp units to be returned in standard-time units (that is, number of seconds,
minutes, and so on); type integer.
units Specification for the units in which periods is expressed. The following values are accepted:
’DAYS’, ’HOURS’, ’MINUTES’, ’SECONDS’, ’MSEC’ (milliseconds), ’USEC’
(microseconds), ’USEC100’ (100s of microseconds). UNITTS may be a character variable or
type integer. If it is type integer, the values must be left-justified, blank-filled Hollerith.

EXAMPLES

ts= UNITTS (2,’DA YS’ )

530 004– 2165– 002


UNPACK ( 3F ) UNPACK ( 3F )

NAME
UNPACK – Expands stored data

SYNOPSIS
CALL UNPACK(p, nbits, u, count[, sef])

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
UNPACK takes 64-bit words and extracts partial word items and places them right-justified into 64-bit words.
The items can be optionally sign-extended.
When using the CF90 compiler on UNICOS or UNICOS/mk systems all arguments must be of default kind
unless documented otherwise. On UNICOS and UNICOS/mk, default kind is KIND=8 for integer, real,
complex, and logical arguments.
The following is a list of valid arguments for this routine.
p Vector of full 64-bit words to be expanded.
nbits The number of rightmost bits of data in each partial word; must be 1, 2, 4, 8, 16, or 32.
u On exit, vector of unpacked data.
count Number of resulting partial words.
sef Optional sign extension flag. If .TRUE., items are sign-extended. If omitted or .FALSE., items
are not sign-extended.

SEE ALSO
PACK(3F)

004– 2165– 002 531


XPFMT ( 3F ) XPFMT ( 3F )

NAME
XPFMT – Produces a printable image of an exchange package

SYNOPSIS
CALL XPFMT(address, in, out, mode)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
XPFMT produces a printable image of an exchange package in a user-supplied buffer. A and S registers
appear in the buffer in both octal and character form; in the character form, the contents of the register are
copied unchanged to the printable buffer. The calling program is responsible for proper translation of
unprintable characters. Parcel addresses have a lowercase a, b, c, or d suffixed to the memory address.
When using the CF90 compiler on UNICOS systems, all arguments must be of default kind unless
documented otherwise. On UNICOS systems the default kind is KIND=8 for integer, real, complex, and
logical arguments.
The following is a list of valid arguments for this routine.
address The nominal location of the exchange package to be printed as the starting exchange package
address. The output buffer contains an 8-character field at the beginning of each line of the
exchange package to indicate a Cray Research address. The binary number in address is used
to fill these 8 characters of the first line of the exchange package in the output buffer and is
incremented to fill each succeeding line of the output buffer. This is not the address of the
16-word buffer containing the exchange package to be formatted.
in A 16-word integer array containing the binary representation of the exchange package.
out An integer array, dimensioned (8,0:23), into which the character representation of the exchange
package is stored. Line 0 is a ruler for debugging and is not usually printed.
The first word of each line is an address and need not always be printed.
mode An integer word indicating the mode in which the exchange package is to be printed. ’Y’L
forces the exchange package to be formatted as an exchange package; 0 means that the
subprogram is to use the exchange package contents to determine the machine type.

532 004– 2165– 002


XPFMT ( 3F ) XPFMT ( 3F )

EXAMPLES

SUBROU TIN E SUB 1(I NTX P,O UTX P)


INTEGE R INT XP( 16),OU TXP (8, 0:2 3), IAD DR, IMO DE
*
* add ress to use in out put arr ay
*
IADDR = 870 0
*
* let pro ces sor ded uce mac hin e typ e
*
IMODE = 0
*
* pass the inp ut exc han ge pac kag e to XPF MT and get the for mat ted
* ver sion to pri nt in OUT XP
*
CAL L XPF MT( IAD DR,INT XP, OUT XP, IMO DE)
*
* print the out put of the XPF MT rou tin e
*
PRINT 1,O UTX P
1 FORMAT (24 (1X ,8A 8/) )
END

004– 2165– 002 533


534 004– 2165– 002
INTRO_SYNC ( 3F ) INTRO_SYNC ( 3F )

NAME
INTRO_SYNC – Introduction to synchronization routines

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
Synchronization routines are used to synchronize processing elements (PE) within programs. This section
describes a set of synchronization primitives and timing routines that are available on UNICOS/mk systems.
For information about multitasking on systems other than UNICOS/mk systems, see the UNICOS System
Libraries Reference Manual.
Definitions
UNICOS/mk systems implement a special hardware barrier network to implement two types of barrier
synchronization operations: barriers and eurekas. A barrier is a point within a program where a task must
wait until all other tasks reach the barrier. A eureka is a point within a program where all tasks are
informed when one task has satisfied some condition. Eureka synchronization has several uses, including
database searches. Using eureka synchronization, a programmer can stop a database search as soon as any
task finds the data rather than waiting for all of the tasks to exhaust the search.
Two specific types of routines are used for event and barrier processing:
• Event routines: Event routines are used to record the state of a program’s execution and to communicate
that state to another task.
• Barrier routines: Barrier routines are used to synchronize the execution of all tasks. A task’s execution is
suspended at a barrier until all tasks have reached the barrier. The barrier routines use the UNICOS/mk
hardware barrier network. When adding a barrier to your program, be sure that all tasks will eventually
reach the barrier. If any of the tasks do not reach the barrier because of task-dependent conditions or
branches, the other tasks will wait at the barrier indefinitely or abort with a user deadlock error.

NOTES
UNICOS/mk synchonization routines are not generally thread-safe. When synchronization routines are used
in conjunction with pthreads, use pthreads locks around the calls.

SEE ALSO
UNICOS System Libraries Reference Manual
INTRO_SHMEM(3), SHMEM_CLEAR_EVENT(3), SHMEM_CLEAR_LOCK(3), SHMEM_SET_CODE(3),
SHMEM_SET_EVENT(3), SHMEM_TEST_EVENT(3), SHMEM_WAIT_EVENT.

004– 2165– 002 535


CLEAR_EVENT ( 3C ) CLEAR_EVENT ( 3C )

NAME
clear_event – Clears an event and returns control to the calling PE

SYNOPSIS
Fortran:
CALL CLEAR_EVENT
C:
void clear_event(void);

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
The clear_event function clears the eureka event and returns control to the calling processing element
(PE). The result of this is that PEs subsequently performing wait_event(3C) calls must wait. If a posted
eureka event is not cleared, the posted condition remains outstanding.
When the event routines are used, clear_event initializes the eureka barrier bit to the cleared state. All
PEs must call clear_event before any PE can test, wait, or post the eureka mode event. If any PEs fail
to call clear_event, the program’s behavior is undefined. Although all PEs must call clear_event
when using the event routines, PEs are not required to wait for the eureka event to be posted. However,
before another eureka activity can be started, all PEs must once again call clear_event to reinitialize the
eureka barrier bit.

536 004– 2165– 002


CLEAR_EVENT ( 3C ) CLEAR_EVENT ( 3C )

EXAMPLES
The following examples show the use of the clear_event function.
Example 1:
search _data( )
{
lon g fla g;

/*
* All PEs must cal l cle ar_ eve nt( ) to ini tia liz e
* the eur eka bar rie r.
*/

cle ar_ eve nt( );

/*
* The fir st pro ces sor to ret urn fro m sea rch wit h a
* ret urn val ue of 0, wil l pos t the eur eka eve nt.
*/

whi le ((f lag = sea rch ()) != -1) {

/*
* If the eve nt is pos ted , exi t the whi le loo p.
*/

if (te st_ event( )) {


fla g = -1;
bre ak;
}

/*
* If the sea rch is suc ces sfu l, pos t the eve nt.
*/

if (fl ag == 0) {
set _ev ent ();
bre ak;
}
}
}

004– 2165– 002 537


CLEAR_EVENT ( 3C ) CLEAR_EVENT ( 3C )

Example 2:
PRO GRA M MUL TI
C ...
CALL CLEAR_ EVE NT()
DO I=1 , MAX VAL
CAL L GIN K(R ESU LT,A(I ,1))
IF (RE SULT .EQ. SEARCH _VAL) THEN
CAL L SET _EVENT ();
GOT O 20
END IF
IF (TEST_EVE NT( )) GOT O 20
END DO
CAL L WAI T_E VENT()
20 CON TIN UE
C ...
END

SEE ALSO
set_event(3C), test_event(3C), wait_event(3C)

538 004– 2165– 002


SET_BARRIER ( 3C ) SET_BARRIER ( 3C )

NAME
set_barrier – Registers the arrival of a PE at a barrier

SYNOPSIS
Fortran:
CALL SET_BARRIER
C:
void set_barrier();

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
This routine registers the arrival of a PE at a barrier. It waits for the completion of previously issued local
and remote stores. See shmem_barrier_all(3) for more details.

NOTES
Processing elements (PE) can spend time waiting at a barrier. To spend PE time at a barrier productively,
you can create your own barrier mechanism using set_barrier (SET_BARRIER) and wait_barrier
(WAIT_BARRIER). set_barrier indicates that the calling PE has arrived at the barrier;
wait_barrier suspends execution of the calling PE until all of the other PEs have arrived at the barrier.
You can place code between the two calls that will execute while waiting for other PEs to arrive at the
barrier. In this way, a PE can continue to do useful work after notifying that it has reached the barrier.
When it completes the extra work, the PE calls wait_barrier and waits, if necessary, for the remaining
PEs to reach the barrier.

SEE ALSO
shmem_barrier_all(3), test_barrier(3C), wait_barrier(3C)

004– 2165– 002 539


SET_EVENT ( 3C ) SET_EVENT ( 3C )

NAME
set_event – Posts an event and returns control to the calling PE

SYNOPSIS
Fortran:
CALL SET_EVENT
C:
void set_event(void)

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
All Processing Elements (PEs) must clear an event before any tasks can test, wait for, or post the event. All
PEs do not have to wait for an event to be posted. However, all PEs must once again clear the event before
another activity can begin.
When using the CF90 compiler on UNICOS/mk systems all arguments must be of default kind unless
documented otherwise. On UNICOS/mk systems, default kind is KIND=8 for integer, real, complex, and
logical arguments.

EXAMPLES

PRO GRAM MUL TI


C ...
CAL L CLE AR_ EVE NT( )
DO I=1, MAX VAL
CALL GIN K(R ESU LT, A(I ,1) )
IF (RE SUL T .EQ . SEA RCH _VA L) THE N
CAL L SET _EV ENT ();
GOT O 20
END IF
IF (TE ST_ EVE NT( )) GOT O 20
END DO
CAL L WAI T_E VEN T()
20 CON TINUE
C ...
END

540 004– 2165– 002


SET_EVENT ( 3C ) SET_EVENT ( 3C )

SEE ALSO
clear_event(3C), INTRO_SYNC(3F), wait_event(3C)

004– 2165– 002 541


TEST_BARRIER ( 3C ) TEST_BARRIER ( 3C )

NAME
test_barrier – Tests a barrier to determine its state (set or cleared)

SYNOPSIS

Fortran:
LOGICAL TEST_BARRIER
return=TEST_BARRIER()
C:
long test_barrier()

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
This barrier routine checks to see if all PEs have arrived at the barrier.
return A logical .TRUE. if all processors have arrived and set the barrier. A logical .FALSE. if all
processors have not set the barrier.

SEE ALSO
intro_sync(3F), set_barrier(3C), wait_barrier(3C)

542 004– 2165– 002


TEST_EVENT ( 3C ) TEST_EVENT ( 3C )

NAME
test_event – Returns the state of an event, either posted or cleared

SYNOPSIS
Fortran:
LOGICAL TEST_EVENT
return=TEST_EVENT
C:
long test_event(void)

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
Eureka events are potentially useful to signal the end of a search or other parallel activity where a single
success should end the attempt by all PEs. In eureka mode, the hardware barrier network is used for event
communication. This implies that TEST_EVENT is returning the state of the eureka barrier bit.
When using the CF90 compiler on UNICOS/mk systems, all arguments must be of default kind unless
documented otherwise. On UNICOS/mk, the default kind is KIND=8 for integer, real, complex, and logical
arguments.
return A logical .TRUE. if the event is set, .FALSE. otherwise. The TEST_EVENT routine will return
.FALSE. if the SHARED event control variable is in the busy state. An event control variable
can be in the busy state if another PE is executing a call to other event routines at the same time
the call to test_event occurs.

NOTES
TEST_EVENT and return must be declared as type LOGICAL in the calling module.

SEE ALSO
clear_event(3C), set_event(3C), wait_event(3C)

004– 2165– 002 543


WAIT_BARRIER ( 3C ) WAIT_BARRIER ( 3C )

NAME
wait_barrier – Suspends PE execution until all PEs arrive at the barrier

SYNOPSIS

Fortran:
CALL WAIT_BARRIER()
C:
void wait_barrier()

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
Processing Elements (PEs) can spend time waiting at a barrier. To spend PE time at a barrier productively,
you can create your own barrier mechanism using SET_BARRIER and WAIT_BARRIER. SET_BARRIER
indicates that the calling PE has arrived at the barrier; WAIT_BARRIER suspends execution of the calling
PE until all of the other PEs have arrived at the barrier.
You can place code between the two calls that will execute while waiting for other PEs to arrive at the
barrier. In this way, a PE can continue to do useful work after notifying that it has reached the barrier.
When it completes the extra work, the PE calls WAIT_BARRIER and waits, if necessary, for the remaining
PEs to reach the barrier. WAIT_BARRIER suspends PE execution until all PEs arrive at the barrier.
If WAIT_BARRIER is called from outside of a parallel region, the user program will deadlock.
WAIT_BARRIER must be called from within a parallel region and all PEs must participate. The user can
guard against calling WAIT_BARRIER from outside of a parallel region with the use of the IN_PARALLEL
compiler intrinsic.

SEE ALSO
barrier(3C), set_barrier(3C), test_barrier(3C)

544 004– 2165– 002


WAIT_EVENT ( 3C ) WAIT_EVENT ( 3C )

NAME
wait_event – Delays the calling PE until the eureka event is posted

SYNOPSIS
Fortran:
CALL WAIT_EVENT
C:
void wait_event(void)

IMPLEMENTATION
UNICOS/mk systems

DESCRIPTION
wait_event suspends processing element (PE) execution at a cleared event until that event is posted by
set_event. wait_event does not change the state of the event. wait_event always uses the
hardware eureka mechanism for event communication. When the posting of one memory mode event is
required (a simple signal), call CLEAR_EVENT immediately after WAIT_EVENT to indicate that the posting
of the event was detected. All PEs do not have to wait for a eureka event to be posted. However, all PEs
must once again clear the event before another eureka activity can begin.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on UNICOS, UNICOS/mk, or IRIX, all
arguments must be of default kind unless documented otherwise. On UNICOS and UNICOS/mk, default
kind is KIND=8 for integer, real, complex, and logical arguments; on IRIX, the default kind is KIND=4.

EXAMPLES

PROGRA M MUL TI
C ...
CALL CLE AR_ EVE NT()
DO I=1 , MAX VAL
CAL L GIN K(R ESU LT, A(I ,1) )
IF (RE SUL T .EQ . SEA RCH _VA L) THE N
CAL L SET_EV ENT ();
GOT O 20
END IF
IF (TE ST_ EVENT( )) GOT O 20
ENDDO
CALL WAI T_E VEN T()
20 CONTIN UE
C ...
END

004– 2165– 002 545


WAIT_EVENT ( 3C ) WAIT_EVENT ( 3C )

SEE ALSO
clear_event(3C), set_event(3C), test_event(3C)

546 004– 2165– 002


INTRO_SORTSEARCH ( 3F ) INTRO_SORTSEARCH ( 3F )

NAME
INTRO_SORTSEARCH – Introduction to sorting and searching routines

IMPLEMENTATION
See individual man pages for implementation details

DESCRIPTION

The ISMAX routine runs on UNICOS and UNICOS/mk systems. The remainder of these sorting and
searching routines run only on UNICOS systems.
Sorting Routines
The following table contains the purpose, name, and entry of each sorting routine. The entry is the name of
the man page that contains documentation for the routine(s) listed.
Sorting routines:

Purpose Name Entry

Performs a distribution counting sort on the elements of an integer vector ISORTD ISORTD
Performs a Batcher’s Odd/Even Merge sort on the elements of a real or SSORTB SSORTB
integer general vector ISORTB
Performs an internal fixed-length record sort using radix sort algorithm ORDERS ORDERS

Searching Routines
The searching routines are grouped into maximum or minimum element search routines and vector search
routines.
Maximum or Minimum Element Search Routines
The maximum and minimum element search routines search a vector for the largest or smallest element and
return its index.
Note: The index location returned by each of these routines is in relation to the number of elements chosen
to be searched, rather than the total number of elements in the vector. For example, if you choose to search
every second element in a 15-element vector, 8 values will be searched and the index location of the target
returned will be the target’s position relative to the 8 searched values, not relative to the 15 total elements.
That is, the returned index is relative, not absolute.
The following table contains the purpose, name, and entry of each maximum or minimum element search
routine. The entry is the name of the man page containing documentation for the routine(s) listed.

004– 2165– 002 547


INTRO_SORTSEARCH ( 3F ) INTRO_SORTSEARCH ( 3F )

Purpose Name Entry

Searches for the maximum or minimum value in subfields of a vector INFLMAX INFLMAX
element INFLMIN
Searches an integer vector for the maximum or minimum value INTMAX INTMAX
INTMIN
Searches a vector for the first occurrence of the maximum or minimum ISAMAX ISAMAX
absolute value ICAMAX
ISAMIN
Searches a real vector for the first occurrence of the maximum or ISMAX ISMAX
minimum value ISMIN

Vector Search Routines


Vector search routines have one of the following functions:
• To return the number of leading occurrences of an object in a vector
• To search for an object in a vector

To return the number of leading occurrences of an object in a vector: These integer functions return the
number of occurrences of a given relation in a vector.
Note: The number of occurrences returned is relative to the number of elements chosen to be searched, not
the absolute number of elements in the vector.
IILZ returns the number of zero values in a vector before the first nonzero value.
ILLZ returns the number of leading elements of a vector that do not have the sign bit set.
ILSUM returns the number of .TRUE. values in a vector declared logical.

To search for an object in a vector: These routines return the index (or indices) of the element(s) found.
ISRCH functions search a vector for the first element (or element subfield) that has a specified logical
relationship to a target.
Note: As previously described for the Maximum or Minimum Element Search Routines, the index returned
by these functions and routines is relative, not absolute.
The WHEN routines search a vector for all elements (or element subfields) that have a specified logical
relationship to a target.
The CLUS routines search a vector for clusters of values that have a specified logical relationship to a target.

548 004– 2165– 002


INTRO_SORTSEARCH ( 3F ) INTRO_SORTSEARCH ( 3F )

The OSRCHI and OSRCHF routines search an ordered vector for the first element (or element subfield) that
has a specified logical relationship to a target.
The following table contains the purpose, name, and entry of each vector search routine. The entry is the
name of the man page containing documentation for the routine(s) listed.

Purpose Name Entry

Returns the number of leading occurrences of an object in a vector IILZ IILZ


ILLZ
ILSUM
Searches a vector for clusters of values equal or not equal to a target CLUSEQ CLUSEQ
CLUSNE
Searches a real vector for clusters of values that are less than, less than CLUSFLT CLUSFLT
or equal to, greater than, or greater than or equal to a target CLUSFLE
CLUSFGT
CLUSFGE
Searches an integer vector for clusters of values that are less than, less CLUSILT CLUSILT
than or equal to, greater than, or greater than or equal to a target CLUSILE
CLUSIGT
CLUSIGE
Searches a vector for the first element equal or not equal to a target ISRCHEQ ISRCHEQ
ISRCHNE
Searches a real vector for the first element that is less than, less than or ISRCHFLT ISRCHFLT
equal to, greater than, or greater than or equal to a real target ISRCHFLE
ISRCHFGT
ISRCHFGE
Searches an integer vector for the first element that is less than, less than ISRCHILT ISRCHILT
or equal to, greater than, or greater than or equal to an integer target ISRCHILE
ISRCHIGT
ISRCHIGE
Searches a vector for the first element whose subfield is equal or not ISRCHMEQ ISRCHMEQ
equal to a target ISRCHMNE
Searches a vector for the first element whose subfield is less than, less ISRCHMLT ISRCHMLT
than or equal to, greater than, or greater than or equal to a target ISRCHMLE
ISRCHMGT
ISRCHMGE
Searches an ordered vector for the first location that contains a target OSRCHI OSRCHI
OSRCHF

004– 2165– 002 549


INTRO_SORTSEARCH ( 3F ) INTRO_SORTSEARCH ( 3F )

Purpose Name Entry

Searches an ordered integer vector for the first element having a subfield OSRCHM OSRCHM
equal to an integer target
Searches a vector for all elements equal or not equal to a target WHENEQ WHENEQ
WHENNE
Searches a real vector for all elements that are less than, less than or WHENFLT WHENFLT
equal to, greater than, or greater than or equal to a real target WHENFLE
WHENFGT
WHENFGE
Searches an integer vector for all elements that are less than, less than or WHENILT WHENILT
equal to, greater than, or greater than or equal to an integer target WHENILE
WHENIGT
WHENIGE
Searches a vector for all elements whose subfields are equal or not equal WHENMEQ WHENMEQ
to a target WHENMNE
Searches a vector for all elements whose subfields are less than, less than WHENMLT WHENMLT
or equal to, greater than, or greater than or equal to a target WHENMLE
WHENMGT
WHENMGE

550 004– 2165– 002


CLUSEQ ( 3F ) CLUSEQ ( 3F )

NAME
CLUSEQ, CLUSNE – Searches a vector for clusters of values equal or not equal to a target

SYNOPSIS
CALL CLUSEQ (n, x, incx, target, index, nn)
CALL CLUSNE (n, x, incx, target, index, nn)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
CLUSEQ searches a real or integer vector for clusters of values equal to a real or integer target.
CLUSNE searches a real or integer vector for clusters of values not equal to a real or integer target.
The indices of the beginning and end of these clusters are returned in the array index. The number of
occurrences of these clusters is returned in nn.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
n Integer. (input)
Number of elements to be searched.
x Real or integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements (64-bit words) of the searched array.
target Real or integer. (input)
Value for which array is searched.
index Integer array of dimension (2, n). (output)
On exit, contains the indices in x at which each cluster starts and stops. The index of the first
element is 1.
nn Integer. (output)
Number of matches found.

004– 2165– 002 551


CLUSEQ ( 3F ) CLUSEQ ( 3F )

NOTES
Searching for the cluster allows vectorization. Before using these routines, users should know that the
logical search results in clusters of finds.
If the size of each cluster is 1, this routine operates the same as WHENEQ(3F).
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)

552 004– 2165– 002


CLUSFLT ( 3F ) CLUSFLT ( 3F )

NAME
CLUSFLT, CLUSFLE, CLUSFGT, CLUSFGE – Searches a real vector for clusters of values with a specified
logical relationship to a real target

SYNOPSIS
CALL CLUSFLT (n, x, incx, target, index, nn)
CALL CLUSFLE (n, x, incx, target, index, nn)
CALL CLUSFGT (n, x, incx, target, index, nn)
CALL CLUSFGE (n, x, incx, target, index, nn)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
CLUSFLT searches a real vector for clusters of values less than a real target.
CLUSFLE searches a real vector for clusters of values less than or equal to a real target.
CLUSFGT searches a real vector for clusters of values greater than a real target.
CLUSFGE searches a real vector for clusters of values greater than or equal to a real target.
The indices of the beginning and end of these clusters are returned in the array index. The number of
occurrences of these clusters is returned in nn.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
n Integer. (input)
Number of elements to be searched.
x Real array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
target Real. (input)
Value for which array is searched.
index Integer array of dimension (2, n). (output)
On exit, contains the indices in x where the cluster(s) starts and stops. The index of the first
element is 1.

004– 2165– 002 553


CLUSFLT ( 3F ) CLUSFLT ( 3F )

nn Integer. (output)
Number of matches found.

NOTES
Searching for the cluster allows vectorization. Before using these routines, you should know that the logical
search results in clusters of finds.
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)

554 004– 2165– 002


CLUSILT ( 3F ) CLUSILT ( 3F )

NAME
CLUSILT, CLUSILE, CLUSIGT, CLUSIGE – Searches an integer vector for clusters of values with a
specified logical relationship to an integer target

SYNOPSIS
CALL CLUSILT (n, x, incx, itarget, index, nn)
CALL CLUSILE (n, x, incx, itarget, index, nn)
CALL CLUSIGT (n, x, incx, itarget, index, nn)
CALL CLUSIGE (n, x, incx, itarget, index, nn)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
CLUSILT searches an integer vector for clusters of values less than an integer target.
CLUSILE searches an integer vector for clusters of values less than or equal to an integer target.
CLUSIGT searches an integer vector for clusters of values greater than an integer target.
CLUSIGE searches an integer vector for clusters of values greater than or equal to an integer target.
The indices of the beginning and end of these clusters are returned in the array index. The number of
occurrences of these clusters is returned in nn.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
n Integer. (input)
Number of elements to be searched.
x Integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
itarget Integer. (input)
Value for which the array is searched.
index Integer array of dimension (2, n). (output)
On exit, contains the indices in x where the cluster(s) starts and stops. The index of the first
element is 1.

004– 2165– 002 555


CLUSILT ( 3F ) CLUSILT ( 3F )

nn Integer. (output)
Number of matches found.

NOTES
Searching for the cluster allows vectorization. Before using these routines, you should know that the logical
search will result in clusters of finds.
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)

556 004– 2165– 002


IILZ ( 3F ) IILZ ( 3F )

NAME
IILZ, ILLZ, ILSUM – Returns number of leading occurrences of an object in a vector

SYNOPSIS
kount = IILZ (n, x, incx)
kount = ILLZ (n, x, incx)
kount = ILSUM (n, x, incx)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
IILZ returns the number of zero values in a vector before the first nonzero value. The vector can be of
type integer, real, or logical.
ILLZ returns the number of leading elements of a vector that do not have the sign bit set. The vector can
be of type integer, real, or logical.
ILSUM returns the number of .TRUE. values in a vector declared logical.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These functions have the following arguments:
kount Integer. (output)
Number of leading occurrences of an object in the vector.
n Integer. (input)
Number of vector elements to process.
x Integer, real, or logical array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of x.

NOTES
When scanning backward (incx < 0), both IILZ and ILLZ start at the end of the vector and move
backward, as follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)

004– 2165– 002 557


IILZ ( 3F ) IILZ ( 3F )

If x is of type logical, IILZ returns the number of FALSE values before encountering the first .TRUE.
value.

558 004– 2165– 002


INFLMAX ( 3F ) INFLMAX ( 3F )

NAME
INFLMAX, INFLMIN – Searches for the maximum or minimum value in subfields of a vector element

SYNOPSIS
index = INFLMAX (n, x, incx, mask, shift)
index = INFLMIN (n, x, incx, mask, shift)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
INFLMAX searches for the maximum value in subfields of a vector element.
INFLMIN searches for the minimum value in subfields of a vector element.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These functions have the following arguments:
index Integer. (output)
Index in x where maximum or minimum occurs. The index of the first element is 1.
n Integer. (input)
Number of elements to be searched; length of the array.
x Real, integer, or logical array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the table to be searched.
incx Integer. (input)
Increment between elements of x.
mask Integer. (input)
Right-justified mask used for masking the table vector.
shift Integer. (input)
Number of bits to right shift the table vector before masking.

NOTES
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)

004– 2165– 002 559


INFLMAX ( 3F ) INFLMAX ( 3F )

The desired element is at:


x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0

560 004– 2165– 002


INTMAX ( 3F ) INTMAX ( 3F )

NAME
INTMAX, INTMIN – Searches an integer vector for the maximum or minimum value

SYNOPSIS
index = INTMAX (n, x, incx)
index = INTMIN (n, x, incx)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
INTMAX searches an integer vector for the maximum value. INTMIN searches an integer vector for the
minimum value.
When using the CF90 compiler UNICOS or UNICOS/mk, all arguments must be of default kind unless
documented otherwise. On UNICOS and UNICOS/mk, default kind is KIND=8 for integer, real, complex,
and logical arguments.
These functions have the following arguments:
index Integer. (output)
Index in x where maximum or minimum occurs. The index of the first element is 1.
n Integer. (input)
Number of elements to be searched.
x Integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of x.

NOTES
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired element is at:
x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0

004– 2165– 002 561


ISAMAX ( 3F ) ISAMAX ( 3F )

NAME
ISAMAX, ICAMAX, ISAMIN – Searches a vector for the first occurrence of the maximum or minimum
absolute value

SYNOPSIS
index = ISAMAX (n, x, incx)
index = ICAMAX (n, x, incx)
index = ISAMIN (n, x, incx)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
ISAMAX searches a real vector for the first occurrence of the maximum absolute value.
ICAMAX searches a complex vector for the first occurrence of the maximum absolute value.
ISAMIN searches a real vector for the first occurrence of the minimum absolute value.
ISAMAX returns the first index i such that
 x i  = MAX  x j  : j = 1, . . ., n
where x j is an element of a real vector.
ICAMAX determines the first index i such that
 Real(x i )  +  Imag(x i )  = MAX(  Real(x j )  +  Imag(x j )  ): j = 1, . . ., n
where x j is an element of a complex vector.
ISAMIN returns the first index i such that
 x i  = MIN x j  : j = 1, . . ., n
where x j is an element of a real vector.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These integer functions have the following arguments:
index Integer. (output)
First index of maximum or minimum absolute value.
n Integer. (input)
Number of elements to process in the vector to be searched. If n ≤ 0, ISAMAX, ICAMAX, and
ISAMIN return 0.

562 004– 2165– 002


ISAMAX ( 3F ) ISAMAX ( 3F )

x ISAMAX, ISAMIN: Real array of dimension (n– 1) . incx +1.


 (input)
ICAMAX: Complex array of dimension (n– 1) . incx +1.
 (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of x.

NOTES
This subroutine executes on a single processor and uses private data only.
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The largest absolute value is:
ABS (x(1+(index– 1) . incx)) when incx > 0
ABS (x(1+(index– n) . incx)) when incx < 0

ISAMAX and ICAMAX are Level 1 Basic Linear Algebra Subprograms (Level 1 BLAS).

004– 2165– 002 563


ISMAX ( 3F ) ISMAX ( 3F )

NAME
ISMAX, ISMIN – Searches a real vector for the first occurrence of the maximum or minimum value

SYNOPSIS
index = ISMAX (n, x, incx)
index = ISMIN (n, x, incx)

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
ISMAX searches a real vector for the first occurrence of the maximum value; ISMIN searches a real vector
for the first occurrence of the minimum value.
ISMAX returns the first index i such that
x i = MAX x j for all j = 1,. . ., n
where x j is an element of a real vector.
ISMIN returns the first index i such that
x i = MIN x j for all j = 1,. . ., n
where x j is an element of a real vector.
When using the CF90 compiler on UNICOS or UNICOS/mk, all arguments must be of default kind unless
documented otherwise. On UNICOS and UNICOS/mk, default kind is KIND=8 for integer, real, complex,
and logical arguments.
These functions have the following arguments:
index Integer. (output)
First index of maximum or minimum value.
n Integer. (input)
Number of elements to process in the vector to be searched. If n ≤ 0, ISMAX and ISMIN return 0.
x Real array containing the vector to be searched. (input)
Array x of dimension 1+(n– 1) .  incx  .
incx Integer. (input)
Increment between elements of x.

564 004– 2165– 002


ISMAX ( 3F ) ISMAX ( 3F )

NOTES
This subroutine executes on a single processor and uses private data only.
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired value is at:
x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0

004– 2165– 002 565


ISORTD ( 3F ) ISORTD ( 3F )

NAME
ISORTD – Performs a distribution counting sort on the elements of an integer vector

SYNOPSIS
CALL ISORTD (ad, n, l, h, x, incx, index, incd, count)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
This routine performs an indexed sort on the elements of an integer vector in ascending or descending order.
An indexed sort returns the result in an index array, leaving the input vector unchanged. This sort is
applicable when all values fall into the range l ≤ x(i) ≤ h and h – l is small. When this is true, the ISORTD
algorithm is of O(n) complexity and does not entail the startup found in ORDERS.
The following calls illustrate the sorts provided by this routine.
CALL ISORTD(’A’, N, L, H, X, INCX, INDEX, INCD, COUNT) – Performs an indexed sort
in ascending order.
CALL ISORTD(’D’, N, L, H, X, INCX, INDEX, INCD, COUNT) – Performs an indexed sort
in descending order.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
This routine has the following arguments:
ad Character. (input)
Indicates whether to sort in ascending or descending order.
Valid values are ’a’, ’A’, ’d’, and ’D’. To signify ascending order, use ’a’ and ’A’ and to signify
descending order use ’d’ and ’D’. Only the first character is significant; therefore, to enhance clarity,
you may use ’ascending’ or ’descending’ as the value for ad, to enhance clarity.
n Integer. (input)
Number of elements to be sorted. n > 0.
l Integer. (input)
Lower bound on the values of the input array.
h Integer. (input)
Upper bound on the values of the input array.
x Integer array of dimension (n– 1) . incx+1. (input)
Array x contains the values to be sorted.
incx Integer. (input)
Increment between elements of the input array. incx > 0.

566 004– 2165– 002


ISORTD ( 3F ) ISORTD ( 3F )

index Integer array of dimension (n– 1) . incd+1. (output)


Array index holds the results of the sort.
On exit, x may be accessed in sorted order using index, as follows:
xsorted(k) = x(1+(index(1+(k– 1) . incd) – 1) . incx), for all k = 1, 2, . . ., n
incd Integer. (input)
Increment for the elements of index. incd > 0.
count Integer. (output (scratch))
Work array of dimension at least w = (h – l) used to count occurrences of values.

NOTES
Negative increments are never required because ad specifies ascending or descending order.
The increment in count is 1.
This sort is stable.

EXAMPLES
Suppose that you want to sort every third element of the array X into ascending order. The values of X
range from 61 to 1010 and consist of a small subset of these. You want these to go into column 4 of a
matrix of indices, MID. INCD=1, the increment between elements of a column in MID. The call is as
follows:
CAL L ISO RTD ( ’A’ , N, 61, 101 0, X, 3, MID ( 1,4 ), INCD, COUNT )

Following are two examples that show how to sort rows or columns of a matrix into the corresponding rows
or columns of an index matrix. After the sort is complete, you can access the matrix in sorted order through
the matrix MID. The examples in the code are sorting each row of a matrix into ascending order and then
sorting each column of a matrix into descending order.
Example 1: Row-by-row sort (ascending order):
PRO GRA M TIS ORTD1
*-- --- --------- --- --------- ------ ------ ------ ------ ------ ------ ------ --
* ..P arameters ..
INTEGE R ROW , COL , L, H
PARAME TER ( ROW =4, COL =5, L=1 , H=4 )

* ..Scal ar vars..
INT EGER I, J

* ..V ector var s..


INT EGER COUNT( L:H ), MID( ROW,CO L ), IA( ROW,CO L )

*-- --- --------- --- ------ ------ ------ ------ ------ ------ ------ ------ -----
* ..Begin execut ion ..

004– 2165– 002 567


ISORTD ( 3F ) ISORTD ( 3F )

* Ini tia liz e IA( ) wit h num bers betwee n L and H.


DO I = 1, ROW
DO J = 1, COL
IA( I,J ) = 1 + MOD ( I*J , H )
END DO
END DO

*-- --- --- --- --- --- --- --- --- --- --- ------ --- --- --- ------ --- --- --- ------ --
* Sort eac h row in asc end ing ord er.
DO I = 1, ROW
CAL L ISO RTD ( ’ASCEN DING’, COL , L, H, IA( I,1 ), ROW ,
& MID( I,1 ), ROW , COU NT )
END DO

*-- --- --- --- --- --- --- --- --- --- --- --- ------ --- --- ------ --- --- ------ --- --
* ..I /O. .
PRINT *, " ... IA( ) pri or to row -by-ro w sor t ... "
DO I = 1, ROW
WRI TE( 6,1 0 ) ( IA( I,J ), J=1 ,CO L )
END DO

PRI NT *, " ... IA( ) aft er row-by -ro w sor t ... "
DO I = 1, ROW
WRI TE( 6,1 0 ) ( IA( I,M ID( I,J ) ), J=1 ,CO L )
END DO

* ..F ormat Sta tem ent s..


10 FOR MAT ( 5X, 5( I5, 2X ) )
END

The results of program TISORTD1 are as follows:


... IA() pri or to row -by -row sort ...
2 3 4 1 2
3 1 3 1 3
4 3 2 1 4
1 1 1 1 1
... IA( ) aft er row -by -ro w sor t ...
1 2 2 3 4
1 1 3 3 3
1 2 3 4 4
1 1 1 1 1

568 004– 2165– 002


ISORTD ( 3F ) ISORTD ( 3F )

Example 2: Column-by-column sort (descending order):


PRO GRA M TIS ORTD2
*-- --- --- ------ --- ------ --- --- --- ------ --- --- --- ------ --- --- --- --- -----
* ..P ara meters..
INTEGE R ROW , COL , L, H
PAR AMETER ( ROW =5, COL =4, L=1, H=4 )

* ..S cal ar vars..


INTEGE R I, J

* ..V ect or vars..


INT EGER COUNT( L:H ), MID ( ROW ,COL ), IA( ROW ,COL )

*-- --- --- ------ --- ------ --- --- --- ------ --- --- --- ------ --- --- --- --- -----
* ..B egi n exe cut ion..

* Ini tializ e IA( ) wit h num ber s bet wee n L and H.


DO I = 1, ROW
DO J = 1, COL
IA( I,J ) = 1 + MOD( I*J, H )
END DO
END DO

*-- --- --- ------ --- ------ --- --- --- ------ --- --- --- ------ --- --- --- --- -----
* Sor t eac h col umn in des cen din g ord er.
DO J = 1, COL
CALL ISORTD( ’DE SCE NDI NG’ , ROW , L, H, IA( 1,J ), 1,
& MID ( 1,J ), 1, COU NT )
END DO

*-- --- --- ------ --- --------- --- --- ------ --- --- ------ --- --- --- --- --- --- --
* ..I /O. .
PRI NT *, " ... IA( ) pri or to col umn -by -co lumn sort ..."
DO I = 1, ROW
WRI TE( 6,1 0 ) ( IA( I,J ), J=1 ,CO L )
END DO

PRI NT *, " ... IA() after col umn -by-co lum n sor t ... "
DO I = 1, ROW
WRI TE( 6,1 0 ) ( IA( MID ( I,J ),J ), J=1,CO L )
END DO

* ..F orm at sta tem ents

004– 2165– 002 569


ISORTD ( 3F ) ISORTD ( 3F )

10 FOR MAT( 5X, 4( I5, 2X ) )


END

The results of program TISORTD2 are as follows:


... IA( ) pri or to column -by -co lum n sor t ...
2 3 4 1
3 1 3 1
4 3 2 1
1 1 1 1
2 3 4 1
... IA( ) after col umn -by -colum n sor t ...
4 3 4 1
3 3 4 1
2 3 3 1
2 1 2 1
1 1 1 1

570 004– 2165– 002


ISRCHEQ ( 3F ) ISRCHEQ ( 3F )

NAME
ISRCHEQ, ISRCHNE – Searches a vector for the first element equal or not equal to a target

SYNOPSIS
index = ISRCHEQ (n, x, incx, target)
index = ISRCHNE (n, x, incx, target)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
ISRCHEQ searches a real or integer vector for the first element that is equal to a real or integer target.
ISRCHNE searches a real or integer vector for the first element that is not equal to a real or integer target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These functions have the following arguments:
index Integer. (output)
Index of the first element equal or not equal to target. If target is not found, n+1 is returned. If
n ≤ 0, 0 is returned.
n Integer. (input)
Number of elements to be searched.
x Real or integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
target Real or integer. (input)
Value for which to search in the array.

004– 2165– 002 571


ISRCHEQ ( 3F ) ISRCHEQ ( 3F )

The Fortran equivalent code for ISRCHEQ is as follows:


FUN CTION ISRCHE Q(N ,X, INCX,T ARG ET)
INT EGER X(*), TARGET
J=1
ISR CHEQ=0
IF( N.LE.0 ) RET URN
IF( INCX.L T.0) J=1-(N -1) *IN CX
DO 100 I=1 ,N
IF( X(J).E Q.TARG ET) GO TO 200
J=J +INCX
100 CON TIN UE
200 ISRCHE Q=I
RETURN
END

Although used as integers internally, you can use real values of x and target, because ISRCHEQ and
ISRCHEQ are matching bit patterns.

NOTES
ISRCHEQ replaces the ISEARCH routine, but it has an entry point named ISEARCH as well as ISRCHEQ.
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired value is at:
x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0

572 004– 2165– 002


ISRCHFLT ( 3F ) ISRCHFLT ( 3F )

NAME
ISRCHFLT, ISRCHFLE, ISRCHFGT, ISRCHFGE – Searches a real vector for the first element with a
specified logical relationship to a real target

SYNOPSIS
index = ISRCHFLT (n, x, incx, ftarget)
index = ISRCHFLE (n, x, incx, ftarget)
index = ISRCHFGT (n, x, incx, ftarget)
index = ISRCHFGE (n, x, incx, ftarget)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
ISRCHFLT searches a real vector for the first element that is less than a real target.
ISRCHFLE searches a real vector for the first element that is less than or equal to a real target.
ISRCHFGT searches a real vector for the first element that is greater than a real target.
ISRCHFGE searches a real vector for the first element that is greater than or equal to a real target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These functions have the following arguments:
index Integer. (output)
Index of the first element with the specified logical relationship to ftarget. If ftarget is not found,
n+1 is returned. If n ≤ 0, 0 is returned.
n Integer. (input)
Number of elements to be searched.
x Real array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
ftarget Real. (input)
Value for which to search in the array.

004– 2165– 002 573


ISRCHFLT ( 3F ) ISRCHFLT ( 3F )

NOTES

When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired value is at:
x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0

574 004– 2165– 002


ISRCHILT ( 3F ) ISRCHILT ( 3F )

NAME
ISRCHILT, ISRCHILE, ISRCHIGT, ISRCHIGE – Searches an integer vector for the first element with a
specified logical relationship to an integer target

SYNOPSIS
index = ISRCHILT (n, x, incx, itarget)
index = ISRCHILE (n, x, incx, itarget)
index = ISRCHIGT (n, x, incx, itarget)
index = ISRCHIGE (n, x, incx, itarget)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
ISRCHILT searches an integer vector for the first element that is less than an integer target.
ISRCHILE searches an integer vector for the first element that is less than or equal to an integer target.
ISRCHIGT searches an integer vector for the first element that is greater than an integer target.
ISRCHIGE searches an integer vector for the first element that is greater than or equal to an integer target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These functions have the following arguments:
index Integer. (output)
Index of the first element with the specified logical relationship to itarget. If itarget is not found,
n+1 is returned. If n ≤ 0, 0 is returned.
n Integer. (input)
Number of elements to be searched.
x Integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
itarget Integer value searched for in the array. (input)

004– 2165– 002 575


ISRCHILT ( 3F ) ISRCHILT ( 3F )

NOTES

When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired value is at:
x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0

576 004– 2165– 002


ISRCHMEQ ( 3F ) ISRCHMEQ ( 3F )

NAME
ISRCHMEQ, ISRCHMNE – Searches a vector for the first element whose subfield is equal or not equal to a
target

SYNOPSIS
index = ISRCHMEQ (n, x, incx, itarget, mask, iright)
index = ISRCHMNE (n, x, incx, itarget, mask, iright)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
ISRCHMEQ searches a real or integer vector for the first element whose subfield is equal to a real or integer
target.
ISRCHMNE searches a real or integer vector for the first element whose subfield is not equal to a real or
integer target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These functions have the following arguments:
index Integer. (output)
Index of the first element whose subfield is equal or not equal to itarget. If itarget is not found,
n+1 is returned. If n ≤ 0, 0 is returned.
n Integer. (input)
Number of elements to be searched.
x Real or integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
itarget Integer. (input)
Value for which to search in the array.
mask Integer. (input)
Mask of 1’s (set bits) from the right. The number of set bits in mask is the number of bits in the
subfield, which is searched in each element of the input array.
iright Integer. (input)
Number of bits to shift each element of the input array to the right so as to right justify the
subfield searched.

004– 2165– 002 577


ISRCHMEQ ( 3F ) ISRCHMEQ ( 3F )

NOTES
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired value is at:
x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0

578 004– 2165– 002


ISRCHMLT ( 3F ) ISRCHMLT ( 3F )

NAME
ISRCHMLT, ISRCHMLE, ISRCHMGT, ISRCHMGE – Searches a vector for the first element whose subfield
has a specified logical relationship with a target

SYNOPSIS
index = ISRCHMLT (n, x, incx, itarget, mask, iright)
index = ISRCHMLE (n, x, incx, itarget, mask, iright)
index = ISRCHMGT (n, x, incx, itarget, mask, iright)
index = ISRCHMGE (n, x, incx, itarget, mask, iright)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
ISRCHMLT searches a real or integer vector for the first element whose subfield is less than a real or integer
target.
ISRCHMLE searches a real or integer vector for the first element whose subfield is less than or equal to a
real or integer target.
ISRCHMGT searches a real or integer vector for the first element whose subfield is greater than a real or
integer target.
ISRCHMGE searches a real or integer vector for the first element whose subfield is greater than or equal to a
real or integer target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These functions have the following arguments:
index Integer. (output)
Index of the first element whose subfield has the specified logical relationship with itarget. If
itarget is not found, n+1 is returned. If n ≤ 0, 0 is returned.
n Integer. (input)
Number of elements to be searched.
x Real or integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
itarget Integer. (input)
Value for which to search in the array.

004– 2165– 002 579


ISRCHMLT ( 3F ) ISRCHMLT ( 3F )

mask Integer. (input)


Mask of 1’s (set bits) from the right. The number of set bits in mask is the number of bits in the
subfield, which is searched in each element of the input array.
iright Integer. (input)
Number of bits to shift each element of the input array to the right so as to right justify the subfield
searched.

NOTES
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired value is at:
x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0

580 004– 2165– 002


ORDERS ( 3F ) ORDERS ( 3F )

NAME
ORDERS – Internal, fixed-length record-sorting routine optimized for UNICOS systems

SYNOPSIS
CALL ORDERS (mode, iwork, data, index, n[, ireclth, ikeylth, iradsiz])

IMPLEMENTATION
UNICOS systems

DESCRIPTION
ORDERS is an internal, fixed-length record sort routine. ORDERS uses the radix sort, which is more
commonly known as a bucket or pocket sort. For this type of sort, the length, in bytes, of the key, and the
length, in words, of the record, determines the number of passes made through all of the records. You can
perform the sort in O(n) operations, and it is stable.
For definitions of major terms used in this document, see the Glossary subsection of the NOTES section.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
This routine has the following arguments:
mode Integer. (input/output)
On input, mode describes the type of key and indicates an initial ordering of the records, as
follows:
0 Keys are positive integers or ASCII characters
63 63
1 Keys are treated as two’s complement (signed) integers over the range [– 2 , 2 – 1]
2 Keys are treated as floating-point numbers
10 Same as mode = 0, but the array index contains the initial ordering of the records
11 Same as mode = 1, but the array index contains the initial ordering of the records
12 Same as mode = 2, but the array index contains the initial ordering of the records
On output, if an error is encountered, ORDERS returns a value < 0 in mode; otherwise, mode
remains unchanged. The error values are as follows:
–1 Too few arguments (must be greater than 4)
–2 Too many arguments (must be less than 9)
–3 ireclth is not valid (must be > 0)
–4 Invalid ikeylth (must be in the range 0 < ikeylth ≤ 8 . ireclth)
–5 iradsiz is not valid (must be 1 or 2)
–6 ikeylth is not valid (must be > 0)
–7 n is not valid (must be > 0)
–8 mode input value is not valid (must be 0, 1, 2, 10, 11, or 12)
–9 ikeylth is not valid (must be 8 for real or integer sort)

004– 2165– 002 581


ORDERS ( 3F ) ORDERS ( 3F )

iwork Integer array of dimension 256 or 65,536. (workspace)


User-supplied working storage array. The length depends on iradsiz, as follows:
If iradsiz = 1, the length of iwork should be 256.
If iradsiz = 2, the length of iwork should be 65,536.
data Integer array of dimension (ireclth, n). (input)
data contains n records of length ireclth each.
index Integer array of dimension n. (output)
If mode = 10, 11, or 12, index contains an initial ordering of the records in the array data. Thus,
data( i,index( 1 ) ) is the ith word of the first record, and data( i,index( n ) ) is the ith word of the
last record. Each index( i ) should be in the closed interval ( 1 . . . n ) and unique with respect to
all other index( i ).
n Integer. (input)
Number of records to be sorted.
ireclth Integer. (input)
Optional argument. Length of each record in words. If specified, 1 ≤ ireclth. The default is 1.
ikeylth Integer. (input)
Optional argument. Length of each key as a number of 8-bit bytes. (8 bytes = 1 word.) If
specified, must be in the interval (1 ≤ ikeylth ≤ 8 . ireclth). If mode = 1, ikeylth must = 8. The
default is 8.
iradsiz Integer. (input)
Optional argument. Radix of the sort (the number of 8-bit bytes processed per pass). If specified,
must be 1 or 2. A radix-2 sort requires fewer passes through the record, but it uses more
workspace and has a higher overhead per pass. The default is 1.

NOTES
ORDERS has the option of processing 1 or 2 bytes of the key per pass through the records. This process
halves the number of passes through the record, but at the expense of increased working storage and
overhead per pass. ORDERS can sort on several keys within a record by using its multipass capability.
Large Radix Sorting
The number of times the key of each record is read from memory is proportional to ikeylth/iradsiz. Using
ORDERS with iradsiz = 2 halves this ratio, because 2 bytes instead of 1 are processed each time the key is
read. The disadvantage of halving the number of passes is that the user-supplied working storage array goes
from 256 words to 65,536 words and the initialization time of this work array is greater than for the
256-word array. From a performance standpoint, this favors a 1-byte pass for sorting smaller arrays up to
approximately 5000 records. For more than 5000 records, however, a 2-byte pass is faster.

582 004– 2165– 002


ORDERS ( 3F ) ORDERS ( 3F )

Multipass Sorting
Because the array index can define an ordering of the records, several calls can be made to ORDERS where
the order of the records is that of the previous call. mode = 10, 11, or 12 specifies that the array index
contains an ordering from a previous call to ORDERS. This specification allows sorting of text keys that
extend over more than 1 word or keys involving double-precision numbers. This algorithm performs the
radix sort over all keys. When using the multipass capability, sort the least-significant word first.
Glossary
This subsection contains definitions for some of the terms used in this man page.
Internal sort
An internal sort means that the sort can be performed entirely in core memory.
Record
A record is a generalized array element. The term record corresponds to the definition used in Pascal.
Record also corresponds to the term struct in C. From a C or Pascal programmer’s perspective, a struct
(record) is allowed to contain heterogeneous elements; it can be any mix of integer, real, logical, or character
data. It can even contain another struct (record).
This idea translates in limited fashion to Fortran. Although Fortran does not allow this general type of
storage scheme, you could envision each element of an array of real numbers as being a record.
Furthermore, if you are sorting a character array in which each element is 24 bytes wide, each 24-byte
element is also a record.
A fixed-length record means that the length of the record cannot vary. The programming construct that
allows the length of a data structure to vary is known as a union in C. Fixed-length records do not allow
this. The length of the record is always the same.
Key
Suppose a Pascal code contains the declaration of an array of records in which each record consists of an
integer and a real number. Each component of the record is called a key. If you wanted to sort this array
based on the values of the integers in each record, the sort is done on the integer key. For Fortran, a limited
notion of key applies. In this case, if you were sorting the character array consisting of 24-byte elements, a
sort could be done in which a key consists of the high-order 8 bytes. That is, the sort does not necessarily
have to apply to an entire element. Rather, the array can be sorted on the high-order 8 bytes of each array
element. For example, suppose that you are sorting an array of character strings in dictionary order and that
each string consists of 16 letters (bytes). If it were known that the last 8 letters (bytes) consists of the letters
xxxxxxxx, the sort need not proceed beyond the eighth letter of the element. Table 1 shows that you do
not have to look beyond the first 8 letters to sort these strings.

004– 2165– 002 583


ORDERS ( 3F ) ORDERS ( 3F )

Table 1: Example of sorting on keys


Uns ort ed | Sorted
=== === ====== ====== === ====== === === === ==
ccc cccaax xxxxxx x | bcc ccc abx xxx xxx x
ccc ccccbx xxx xxxx | bcc ccc gbxxxx xxxx
bcc cccgbx xxx xxx x | cccccc aax xxx xxx x
bcc cccabx xxx xxx x | ccc ccccbx xxxxxx x
====== ====== === ====== === === === ====== ==

Indexed sort
An indexed sort means that the original data is not disturbed. The indices in an index array are permuted
such that on completion of the sort, the data can be accessed in sorted order through this array. Because
ORDERS sorts the keys in increasing order, data( index(1)) will be the first word of the record with the
smallest key, data( index(2)) will be the first word of the record with the next smallest key, and so on. See
Table 2.
Table 2: Example of an indexed sort
Initia l Dat a Aft er Ind exed Sort

i x(i) ind ex(i) x(i nde x(i)) | i x(i) index( i) x(i nde x(i))
============ === ====== ====== === ====== === === === === === === === === === === ===
1 2 1 2 | 1 2 1 2
2 3 2 3 | 2 3 3 2
3 2 3 2 | 3 2 2 3
4 10 4 10 | 4 10 6 9
5 17 5 17 | 5 17 4 10
6 9 6 9 | 6 9 5 17
7 17 7 17 | 7 17 7 17
============ === ====== ====== === === ====== === === === === === === === === === ===

Multipass sorting
Sorting can be done in multiple passes. For example, suppose you wanted to sort a character array
consisting of 16 byte-wide elements. The sort could be done in two passes. The first pass could sort on the
low-order byte of each element. This byte could be thought of as a key. During the second pass, the sort is
done on the high-order byte (key).
Stable sort
A stable sort is one in which the original order of records with equal keys is not disturbed. This matters for
multipass sorting. In a multipass sort, elements are sorted whose previous byte is the same. For example,
suppose you have an array of 2-character strings to be sorted. Table 3 illustrates the progression of a
multipass sort of the character array. When complete, the array inx will contain the permuted indices.

584 004– 2165– 002


ORDERS ( 3F ) ORDERS ( 3F )

Table 3: Progression of a multipass sort


| Ini tia l Ord eri ng | Fir st Pass | Sec ond Pass
| | |
i cx( i) | inx(i) cx(inx(i) ) | inx(i) cx( inx(i) ) | inx(i) cx( inx (i))
=== === ========= === ====== === === === ====== === === === === === === === === ====
1 cb | 1 cb | 2 aa | 2 aa
2 aa | 2 aa | 4 xa | 3 ac
3 ac | 3 ac | 5 ba | 5 ba
4 xa | 4 xa | 6 ca | 7 bx
5 ba | 5 ba | 1 cb | 6 ca
6 ca | 6 ca | 3 ac | 1 cb
7 bx | 7 bx | 7 bx | 4 xa
=== === ========= === ========= === === === ====== === === === === === === === === =

Note the two stages of the sort. During the first stage or pass, the strings are arranged in dictionary order
based on the least significant letter only (in this case, a letter is a key); therefore, all of the strings ending
with an "a" come first, then those ending with a "b", and so forth. The most-significant byte is sorted on
during the second pass. This is called least significant digit first radix sorting.
Also notice how this data was moved around. During the first pass, the strings were rearranged so that if
originally the string "xa" preceded the string "ba", that ordering is preserved when moving the data. This is
what is meant by a stable sort.

EXAMPLES
This section contains examples of the following uses of ORDERS:
• Sorting an array of 20 floating-point numbers, using default values for ireclth, ikeylth, and iradsiz
• Sorting double-precision numbers

004– 2165– 002 585


ORDERS ( 3F ) ORDERS ( 3F )

Sorting an array of 20 floating-point numbers, using default values for ireclth, ikeylth, and iradsiz:
PRO GRA M TRO RD
IMP LIC IT NON E

* ..P ara met ers ..


INT EGE R LDI M, WKS PAC E
PAR AME TER ( LDI M=20 )
PAR AME TER ( WKS PAC E=6553 6 )

* ..V ari abl es. .


INT EGE R I, MOD E, IND EX( LDIM ), IWORK( WKSPAC E )
REA L VEC ( LDIM )

* ..D ata ini tia liz ati on..


DAT A MOD E / 2 / ! Sort floati ng poi nt number s
DAT A VEC / 55.,54 .,5 3., 52.,51 .,
& -1. ,-2.,- 3., -4. ,-5 .,
& 105 .,1 04. ,103., 102 .,1 01. ,
& -20 1., -20 2.,-20 3., -20 4., -205 /

* ..E xte rna l rou tines. .


EXT ERN AL ORD ERS

* ..B egi n Exe cut ion ..


PRI NT *, " ... VEC() pri or to sor t ..."
DO I = 1, LDI M
WRI TE( 6,1 0 ) VEC ( i )
END DO

CAL L ORD ERS ( MODE, IWO RK, VEC , IND EX, LDI M )

PRI NT *, " "


PRI NT *, " ... VEC () aft er sort ..."
DO I = 1, LDIM
WRI TE( 6,1 0 ) VEC ( IND EX( i ) )
END DO

10 FOR MAT ( 5X, F10 .3 )


STO P
END

586 004– 2165– 002


ORDERS ( 3F ) ORDERS ( 3F )

The results of program TRORD are as follows:


... VEC() prior to sor t ...
55. 000
54. 000
53. 000
52. 000
51. 000
-1. 000
-2. 000
-3. 000
-4. 000
-5. 000
105 .000
104 .000
103 .000
102 .000
101 .000
-201.0 00
-20 2.000
-20 3.000
-20 4.000
-20 5.000

... VEC() after sor t ...


-20 5.000
-20 4.000
-20 3.000
-20 2.000
-20 1.000
-5. 000
-4. 000
-3. 000
-2. 000
-1. 000
51. 000
52. 000
53. 000
54. 000
55. 000
101 .000
102 .000
103 .000
104 .000
105 .000

004– 2165– 002 587


ORDERS ( 3F ) ORDERS ( 3F )

Sorting Double-precision Numbers


This code example presents the sort of double-precision numbers. Double-precision numbers consist of 2
words per number. To sort them, you must use the multipass capability of ORDERS.
The data is equivalenced to an integer array so that for each pass the data can be treated as unsigned
integers. If the number is negative, the negative sign has to be carried temporarily to the low-order
component so that the direction of the sort will be consistent for both passes. This example uses random
numbers.
PROGRA M TDO RD
* ..Para met ers..
INT EGE R LDI M, WKS PACE
DOU BLE PRE CIS ION BOT , TOP
PAR AMETER ( LDI M=2 0 )
PAR AME TER ( WKS PAC E=256 )
PAR AMETER ( BOT =1. 0D-12 )
PARAME TER( TOP=2. 0D- 12 )

* ..V ariabl es. .


INT EGER I, MOD E, IND EX( LDI M ), IWORK( WKS PAC E )
INTEGE R IVE C( 2*L DIM )
DOU BLE PRECIS ION VEC ( LDI M )
EQUIVA LEN CE( VEC ,IV EC )

* ..E xte rna l rou tines..


EXT ERN AL ORD ERS

* ..D ata initia liz ation. .


DATA IRECLT H / 2 / ! Length of a rec ord . In thi s cas e, a
* ! rec ord is two CRI wor ds lon g.
* ! Len gth of a rec ord is in ter ms of
* ! CRI words.
DAT A IKE YLTH / 8 / ! Len gth of a key is 8 byt es.
DAT A IRA DSI Z / 1 / ! Do sor t 1 byt e at a tim e.

* ..S tat ement functi on. .


* Gen era te ran dom double pre cision num ber s bet wee n the val ue A
* and the value B not inc lud ing A or B.
DOU BLE PRE CIS ION A, B, DRAN
DRA N( A,B ) = ( B-A )*D BLE ( RAN F() ) + A

* ..B egin execut ion..

* Loa d VEC() wit h pos iti ve ran dom number s tha t dif fer onl y
* in the low-or der bits.

588 004– 2165– 002


ORDERS ( 3F ) ORDERS ( 3F )

DO I = 1, LDI M/2
VEC ( I ) = 1.0 D2 + DRA N( BOT ,TO P )
END DO

* Load VEC() wit h neg ati ve ran dom number s tha t dif fer onl y
* in the low -or der bit s.
DO I = LDI M/2 +1, LDI M-1
VEC( I ) = -1. 0D2 - DRA N( BOT ,TO P )
END DO

* Make sur e the re is a num ber and it’s negati ve ver sion in
* the arr ay.
VEC( LDIM ) = -VE C( 1 )

* Change the sec ond wor d to hav e the sam e sig n as the fir st
* word. Oth erwise, if the num ber is neg ative, the
* sort of the sec ond wor d wou ld be bac kwa rds .
DO I = 1, 2*L DIM, 2
IF( IVEC( I ) .LE . 0 ) IVE C( I+1 ) = -IV EC( I+1 )
END DO

* Sor t low -or der bit s, fir st.


* IVE C() had to be used becaus e the re is no way to access
* the low -or der bit s usi ng VEC ().
MODE = 1
CALL ORD ERS( MOD E, IWO RK, IVE C(2 ), INDEX, LDI M, IRE CLT H,
& IKE YLT H, IRA DSIZ )

* Res tor e sec ond wor d to ori ginal for m.


DO I = 1, 2*L DIM , 2
IVE C( I+1 )= ABS ( IVE C( I+1 ) )
END DO

* Sor t hig h-order bits.


MODE = 12
CAL L ORD ERS( MOD E, IWORK, VEC , IND EX, LDI M, IRE CLT H,
& IKE YLT H, IRA DSI Z )

* I/O
WRI TE( 6,1 0 )
DO I = 1, LDI M
WRITE( 6,3 0 ) VEC ( I ), IVE C(2 *I-1), IVE C(2 *I)
END DO

004– 2165– 002 589


ORDERS ( 3F ) ORDERS ( 3F )

PRINT *, " "


WRI TE( 6,20 )
DO I = 1, LDIM
J = IND EX( I)
WRI TE( 6,30 ) VEC ( J ), IVE C(2 *J-1), IVE C(2 *J)
END DO

10 FORMAT ( 4X, ".. .Value s in VEC () bef ore sor t.. .", 5X,
& "...Eq uivale nt hex val ues in IVE C() ... " )
20 FORMAT ( 4X, ".. .Value s in VEC () aft er sor t...", 6X,
& "...Eq uivale nt hex val ues in IVE C() ... " )
30 FORMAT ( D40.30 , 2X, Z16, 1X, Z16 )
END

The following output presents an array of random numbers that were generated. This array is sorted using
the multipass option. The result is then presented. Other than sign, the numbers differ from one another
only in the low-order bits. This is to show that, other than the sign of the numbers, the sort will really take
place based on these values.
...Values in VEC() before sort... ...Equivalent hex values in IVEC()...
0.100000000000001580113648579586E+03 4007C80000000003 00007986602A5AAD
0.100000000000001950512734980764E+03 4007C80000000004 00004A0A82782AC9
0.100000000000001786371425330602E+03 4007C80000000003 0000EDA34101DFE7
0.100000000000001297620264003728E+03 4007C80000000002 0000DA7EC9D47284
0.100000000000001453699900298492E+03 4007C80000000003 0000325C3C0AA41E
0.100000000000001006261941606187E+03 4007C80000000002 00003679A1040E89
0.100000000000001275736426383874E+03 4007C80000000002 0000CE2CFEB9DCBA
0.100000000000001305650943870477E+03 4007C80000000002 0000DF04219F5276
0.100000000000001689100710749872E+03 4007C80000000003 0000B6E1110D45E2
0.100000000000001382662238656297E+03 4007C80000000003 00000A5EA0E9EB86
-0.100000000000001132902705496380E+03 C007C80000000002 00007DC47C8993AF
-0.100000000000001831857903209073E+03 C007C80000000004 0000073E8BD6FD21
-0.100000000000001582979795830740E+03 C007C80000000003 00007B236E55C827
-0.100000000000001098625338337415E+03 C007C80000000002 00006A7898E5FDEB
-0.100000000000001276548455133567E+03 C007C80000000002 0000CEA2054C9046
-0.100000000000001620446027796948E+03 C007C80000000003 0000903AE251EF64
-0.100000000000001083502966833808E+03 C007C80000000002 000061F53BDD54E3
-0.100000000000001990377120595685E+03 C007C80000000004 0000607B92B524B0
-0.100000000000001979346943443064E+03 C007C80000000004 00005A45F4FF5F3C
-0.100000000000001580113648579586E+03 C007C80000000003 00007986602A5AAD

...Values in VEC() after sort... ...Equivalent hex values in IVEC()...


-0.100000000000001990377120595685E+03 C007C80000000004 0000607B92B524B0
-0.100000000000001979346943443064E+03 C007C80000000004 00005A45F4FF5F3C
-0.100000000000001831857903209073E+03 C007C80000000004 0000073E8BD6FD21
-0.100000000000001620446027796948E+03 C007C80000000003 0000903AE251EF64
-0.100000000000001582979795830740E+03 C007C80000000003 00007B236E55C827
-0.100000000000001580113648579586E+03 C007C80000000003 00007986602A5AAD
-0.100000000000001276548455133567E+03 C007C80000000002 0000CEA2054C9046
-0.100000000000001132902705496380E+03 C007C80000000002 00007DC47C8993AF

590 004– 2165– 002


ORDERS ( 3F ) ORDERS ( 3F )

-0.100000000000001098625338337415E+03 C007C80000000002 00006A7898E5FDEB


-0.100000000000001083502966833808E+03 C007C80000000002 000061F53BDD54E3
0.100000000000001006261941606187E+03 4007C80000000002 00003679A1040E89
0.100000000000001275736426383874E+03 4007C80000000002 0000CE2CFEB9DCBA
0.100000000000001297620264003728E+03 4007C80000000002 0000DA7EC9D47284
0.100000000000001305650943870477E+03 4007C80000000002 0000DF04219F5276
0.100000000000001382662238656297E+03 4007C80000000003 00000A5EA0E9EB86
0.100000000000001453699900298492E+03 4007C80000000003 0000325C3C0AA41E
0.100000000000001580113648579586E+03 4007C80000000003 00007986602A5AAD
0.100000000000001689100710749872E+03 4007C80000000003 0000B6E1110D45E2
0.100000000000001786371425330602E+03 4007C80000000003 0000EDA34101DFE7
0.100000000000001950512734980764E+03 4007C80000000004 00004A0A82782AC9

004– 2165– 002 591


OSRCHI ( 3F ) OSRCHI ( 3F )

NAME
OSRCHI, OSRCHF – Searches an ordered vector for the first location that contains a target

SYNOPSIS
CALL OSRCHI (n, x, incx, target, index, iwhere, inum)
CALL OSRCHF (n, x, incx, target, index, iwhere, inum)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
OSRCHI searches an ordered integer vector for the first location that contains an integer target.
OSRCHF searches an ordered real vector for the first location that contains a real target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
n Integer. (input)
Number of array elements to be searched.
x OSRCHI: Integer array of dimension (n– 1) .  incx  + 1. (input)
OSRCHF: Real array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
target OSRCHI: Integer. (input)
OSRCHF: Real. (input)
Value for which to search in the array.
index Integer. (output)
Index of the first element equal to target. If target is not found, index = n + 1. If n ≤ 0, index = 0
.
iwhere Integer. (output)
Index of the first element greater than or equal to target. If target is found, iwhere = index. If
target is greater than the last element of the array, iwhere = n + 1. If n ≤ 0, iwhere = 0.
inum Integer. (output)
Number of copies of target found in the array

592 004– 2165– 002


OSRCHI ( 3F ) OSRCHI ( 3F )

NOTES
Searching always begins at the lowest value in the ordered array. Even if the target is not found, the index
of the location that would contain the target is returned in iwhere. The total number of occurrences of the
target in the array (inum) can also be returned.
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
Thus, a positive increment indicates an ascending array, while a negative increment indicates a descending
array.
The index value is at:
x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0
The iwhere value is at:
x(1+(iwhere– 1) . incx) when incx > 0
x(1+(iwhere– n) . incx) when incx < 0

004– 2165– 002 593


OSRCHM ( 3F ) OSRCHM ( 3F )

NAME
OSRCHM – Searches an ordered integer vector for the first element whose subfield is equal to an integer
target

SYNOPSIS
CALL OSRCHM (n, x, incx, itarget, mask, iright, index, iwhere, inu)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
OSRCHM searches an ordered integer vector and returns the index of the first element for which the subfield
defined by mask and iright is equal to an integer target. For the search to be successful, the input vector
must be ordered by subfield, not by the whole integer.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
This routine has the following arguments:
n Integer. (input)
Number of array elements to be searched
x Integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the array to be searched.
itarget Integer. (input)
Value for which to search in the array.
mask Integer. (input)
Mask set from the right side of the field of interest in array x.
iright Integer. (input)
Amount to right-shift array x to position the field of interest at right side of word.
index Integer. (output)
Index of the first element whose subfield is equal to itarget. If itarget is not found, index = n + 1.
If n ≤ 0, index = 0.
iwhere Integer. (output)
Index of the first element whose subfield is greater than or equal to itarget. If itarget is found,
iwhere = index . If itarget is greater than the subfield of the last element in the array,
iwhere = n + 1. If n ≤ 0, iwhere = 0.

594 004– 2165– 002


OSRCHM ( 3F ) OSRCHM ( 3F )

inum Integer. (input and output)


If inum equals 0 on input, inum is still 0 on output. If inum does not equal 0 on input, inum is the
number of array elements whose subfields match itarget on output; that is, inum returns a value only
if requested and at least one target value is found in the array; otherwise, it will always be 0.

NOTES
Searching always begins at the lowest value in the ordered array. Even if the target is not found, the index
of the location that would contain the target is returned in iwhere. The total number of occurrences of the
target in the array (inum) can also be returned.
When scanning backward (incx < 0), this routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
Thus, a positive increment indicates an ascending array (with respect to the subfield), while a negative
increment indicates a descending array (with respect to the subfield).
The index value is at:
x(1+(index– 1) . incx) when incx > 0
x(1+(index– n) . incx) when incx < 0
The iwhere value is at:
x(1+(iwhere– 1) . incx) when incx > 0
x(1+(iwhere– n) . incx) when incx < 0

EXAMPLES
As an example of a vector that is ordered by the whole integer value, but not ordered by subfield, consider
the following Fortran program:
PAR AMETER (N=128 )
PAR AMETER (ITARG ET=20)
PAR AMETER (INCX= 1)
INT EGE R X(N ),XWHERE, INDEX, IWHERE ,INUM
C
C EAC H SUB FIE LD IS THE FIV E RIG HTM OST BIT S OF EACH INTEGE R
C ( SUBFIE LD( I) = MOD (X(I), 2** 5), FOR ALL I = 1, 2, ... , 128 )
C
PAR AMETER (MASK= (2**5) -1,IRI GHT=0)
C
C X IS AN ASCEND ING SEQ UENCE
C
PRINT*
PRINT*, ’X(i) = 127 *i, for all I = 1, 2, ... , 128 ’
PRINT*

004– 2165– 002 595


OSRCHM ( 3F ) OSRCHM ( 3F )

DO 10 I=1,12 8
X(I )=1 27* I
10 CON TINUE
C
C LIS T OF ALL LOC ATIONS WHERE SUB FIELD MATCHE S TAR GET
C
INU M=0
PRI NT* , ’LOCAT ION S WHERE MOD (X(i), 2** 5) = ’,I TAR GET
PRI NT*, ’(S UBFIEL D MAT CHE S TAR GET)’
DO I=1,12 8
IF (IAND( X(I),M ASK ).EQ.I TAR GET ) THE N
PRI NT* , ’i = ’,I , ’ X(’ ,I, ’) = ’, X(I )
INU M=INUM +1
ENDIF
END DO
PRINT*
PRINT*, ’NUMBE R OF SUC H LOC ATI ONS = ’,I NUM
PRINT*
C
C ATTEMP T TO FIN D TAR GET WIT H OSR CHM
C
CALL OSRCHM (N,X,I NCX ,ITARG ET, MAS K,I RIGHT, INDEX, IWHERE ,INUM)
XWH ERE=X( 1+(IWH ERE -1) *INCX)
PRI NT* , ’LOCAT ION S FOU ND BY OSR CHM WIT H INC X = ’, INC X
PRI NT* ,’ IND EX IWH ERE INU M XWHERE MOD (XWHER E,2**5 )’
PRI NT50, IND EX, IWHERE , INU M, XWH ERE, IAND(X WHERE, MASK)
50 FOR MAT(I7 ,4(I10 ))
END

596 004– 2165– 002


OSRCHM ( 3F ) OSRCHM ( 3F )

The output of this program is as follows:


X(i ) = 127 *i, for all i = 1, 2, ... , 128

LOC ATI ONS WHE RE MOD(X( i), 2**5) = 20


(SUBFI ELD MAT CHE S TAR GET )
i = 12 X(12) = 152 4
i = 44 X(44) = 558 8
i = 76 X(76) = 9652
i = 108 X(108) = 137 16

NUMBER OF SUCH LOCATIONS = 4

LOC ATIONS FOUND BY OSRCHM WIT H INC X = 1


IND EX IWH ERE INU M XWH ERE MOD (XW HER E,2 **5 )
129 1 0 127 31

004– 2165– 002 597


SSORTB ( 3F ) SSORTB ( 3F )

NAME
SSORTB, ISORTB – Performs Batcher’s Odd-Even Merge sort on the elements of a real or integer general
vector

SYNOPSIS
CALL SSORTB (ad, n, x, incx [, index, incd])
CALL ISORTB (ad, n, x, incx [, index, incd])

IMPLEMENTATION
UNICOS systems

DESCRIPTION
SSORTB sorts the elements of a real general vector.
ISORTB sorts the elements of an integer general vector.
These routines can perform an in-place or indexed sort in ascending or descending order.
An in-place sort returns the result by overwriting the input vector. An indexed sort returns the result in
another array, leaving the input vector unchanged. The in-place sort offers about 25% better performance.
The following calls illustrate the various sorts provided by these routines.
• CALL SSORTB(’A’, N, X, INCX) – Performs an in-place sort in ascending order.
• CALL ISORTB(’A’, N, X, INCX) – Performs an in-place sort in ascending order.
• CALL SSORTB(’D’, N, X, INCX) – Performs an in-place sort in descending order.
• CALL ISORTB(’D’, N, X, INCX) – Performs an in-place sort in descending order.
• CALL SSORTB(’A’, N, X, INCX, ID, INCD) – Performs an indexed sort in ascending order.
• CALL ISORTB(’A’, N, X, INCX, ID, INCD) – Performs an indexed sort in ascending order.
• CALL SSORTB(’D’, N, X, INCX, ID, INCD) – Performs an indexed sort in descending order.
• CALL ISORTB(’D’, N, X, INCX, ID, INCD) – Performs an indexed sort in descending order.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
ad Character. (input)
Indicates whether to sort in ascending or descending order.
Valid values are ’a’, ’A’, ’d’, and ’D’. Use ’a’ and ’A’ to signify ascending order, and use ’d’ and
’D’ to signify descending order. Because only the first character is significant, to enhance clarity,
you may use ’ascending’ or ’descending’ as the value for ad.

598 004– 2165– 002


SSORTB ( 3F ) SSORTB ( 3F )

n Integer. (input)
Number of elements to be sorted. n > 0.
x SSORTB: Real array of dimension (n– 1) . incx+1. (input and output)
ISORTB: Integer array of dimension (n– 1) . incx+1. (input and output)
Array x contains the values to be sorted. If you specify only four arguments, these routines perform
an in-place sort and use x for output.
incx Integer. (input)
Increment between elements of the array x. incx > 0.
index Integer array of dimension (n– 1) . incd+1. (output, optional)
If specified, array index holds the results of the indexed sort.
In this case, on exit, x may be accessed in sorted order by using index, as follows:
xsorted(k) = x(1 + (index(1 + (k– 1) . incd) – 1) . incx),
for all k = 1, 2, . . ., n
incd Integer. (input)
Increment for the elements of index. incd > 0.

NOTES
Negative increments are not required because ad specifies ascending or descending order.
These sorts are unstable. An unstable sort is one in which the indices of two elements whose values are the
same could be inverted in the sorted output. That is, if x(j) = x(k) for some j < k, and (at the end of the sort)
index(ij) = j and index(ik) = k for some ij and ik, it is possible that ij > ik .
For example, if x(6) = x(15) = 10, at the end of sorting, the subscript at which the array index takes on the
value 6 may be larger than the subscript at which index takes on the value 15.
If the number of arguments is 4, the routine performs an in-place sort. If the number of arguments is 6, the
routine performs an indexed sort.

EXAMPLES

In-place Sorting
Suppose you have a real array X, every other element of which to sort into descending order, then the call is
as follows:
CALL SSORTB( ’D’, N, X, 2 )

Indexed Sorting
Suppose you have a real array X, every third element of which to sort into ascending order without
destroying X, then an indexed sort is done, as follows:
CALL SSORTB( ’A’, N, X, 3, ID, INC D )

004– 2165– 002 599


SSORTB ( 3F ) SSORTB ( 3F )

The argument incd allows you extra flexibility in arranging the indexing. For instance, suppose you want to
sort row #2 of matrix A in descending order. Furthermore, suppose you want the result to be stored into the
corresponding row of a matrix of indices, I, with leading dimension LDI. The call is as follows:
CALL SSO RTB( ’D’, N, A( 2,1 ), LDA , I( 2,1 ), LDI )

The following program is an example of a row-by-row indexed sort of a 4-by-5 rectangular matrix into
ascending order. This example shows how to access the ordered version of A by using the index array, MID.
Following the program is its output. The output demonstrates the values to which SSORTB initializes MID.
It also presents the values in the unsorted matrix, A. It then presents the results of a call to SSORTB. First
the values in A are presented in sorted order; then the corresponding values in MID are output. That way
you can apply the final results in MID to the unsorted version of A and see how the indexed sort works. The
final values in MID are such that
A(i,MID(i,1)) ≤ A(i,MID(i,2)). . . ≤ A(i,MID(i,5)).
PROGRA M TSS ORT B
*----- --- --------- --- ------ ------ ------ ------ ------ ------ ------ ------ --
* ..P arameters ..
INTEGE R ROW , COL , MAX
PARAMETER ( ROW =4, COL=5, MAX =9 )

* ..Scalar var s..


INT EGER I, J

* ..V ector var s..


REA L A( ROW,CO L )
INT EGER MID( ROW,CO L )

*----- --- --------- --- --------- ------ ------ ------ ------ ------ ------ -----
* ..Begi n exe cut ion..

* Load A() wit h num ber s bet wee n 1. and max.


DO I = 1, ROW
DO J = 1, COL
A( I,J ) = 1. + REAL( MOD( I*J, MAX ) )
END DO
END DO

* Initializ e MID ()
DO I = 1, ROW
DO J = 1, COL
MID( I,J ) = J
END DO
END DO

600 004– 2165– 002


SSORTB ( 3F ) SSORTB ( 3F )

*-- --- --- --- --- --- --- --- --- ------ ------ ------ ------ --- --- --- ------ -----
PRI NT *, " ... Ind ice s in MID () pri or to ind exe d sor t ",
& "of eac h row of A() ... "
DO I = 1, ROW
WRI TE( 6,2 0 ) ( MID( I,J ), J=1 ,CO L )
END DO

PRI NT *, " ... A() pri or to row -by -ro w sor t ... "
DO I = 1, ROW
WRI TE( 6,1 0 ) ( A( I,J ), J=1,CO L )
END DO

*-- --- --- --- --- --- --- --- --- --- ------ ------ ------ ------ --- ------ --------
* Sor t eac h col umn in asc end ing ord er.
DO I = 1, ROW
CAL L SSO RTB ( ’AS CEN DING’, COL , A( I,1 ), ROW ,
& MID ( I,1 ), ROW )
END DO

*-- --- --- --- --- --- --- --- --- --- ------ ------ ------ ------ --- ------ --------
PRI NT *, " ... A() aft er row -by -ro w sor t ... "
DO I = 1, ROW
WRI TE( 6,1 0 ) ( A( I,M ID( I,J ) ), J=1 ,CO L )
END DO

PRI NT *, " ... Ind ice s in MID () aft er the ind exe d sort ",
& "of eac h row of A() ... "
DO I = 1, ROW
WRI TE( 6,2 0 ) ( MID( I,J ), J=1 ,CO L )
END DO

*-- --- --- --- --- --- --- --- --- ------ ------ ------ ------ --- --- --- ------ -----
* ..F orm at sta tem ent s..
10 FOR MAT ( 5X, 5( F5. 1, 2X ) )
20 FOR MAT ( 5X, 5( I5, 2X ) )
END

004– 2165– 002 601


SSORTB ( 3F ) SSORTB ( 3F )

The results of program TSSORTB are as follows:


... Indice s in MID() pri or to indexe d sor t of each row of A() ...
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
... A() prior to row-by-ro w sor t ...
2.0 3.0 4.0 5.0 6.0
3.0 5.0 7.0 9.0 2.0
4.0 7.0 1.0 4.0 7.0
5.0 9.0 4.0 8.0 3.0
... A() after row -by-row sort ...
2.0 3.0 4.0 5.0 6.0
2.0 3.0 5.0 7.0 9.0
1.0 4.0 4.0 7.0 7.0
3.0 4.0 5.0 8.0 9.0
... Indice s in MID () after the indexe d sor t of each row of A() ...
1 2 3 4 5
5 1 2 3 4
3 4 1 2 5
5 3 1 4 2

The following example illustrates the use of ISORTB to perform a column-by-column in-place sort of a
5-by-4 rectangular matrix into descending order.
PRO GRAM TISORTB
*-------- --- --- --------- --- ------ ------ ------ ------ ------ ------ ------ --
* ..P ara met ers..
INTEGE R ROW , COL , MAX
PAR AME TER( ROW=5, COL=4, MAX =9 )

* ..Scal ar var s..


INT EGE R I, J

* ..Vect or var s..


INTEGE R IA( ROW,CO L )

602 004– 2165– 002


SSORTB ( 3F ) SSORTB ( 3F )

*-- --- --- --- --- --- --- --- --- ------ ------ ------ ------ --- --- --- ------ --- --
* ..B egi n exe cut ion ..

* Ini tia liz e IA( ) wit h num ber s bet wee n 1 and max .
DO I = 1, ROW
DO J = 1, COL
IA( I,J ) = 1 + MOD( I*J, MAX )
END DO
END DO

*-- --- --- --- --- --- --- --- --- --- ------ ------ ------ ------ --- ------ --- --- --
PRI NT *, " ... IA( ) pri or to col umn -by-co lum n sor t ..."
DO I = 1, ROW
WRI TE( 6,1 0 ) ( IA( I,J ), J=1 ,CO L )
END DO

*-- --- --- --- --- --- --- --- --- --- ------ ------ ------ ------ --- ------ --- -----
* Per for m an in- pla ce sort on IA in des cendin g ord er on
* eac h col umn .
DO J = 1, COL
CAL L ISO RTB ( ’DE SCE NDI NG’ , ROW , IA( 1,J ), 1 )
END DO

*-- --- --- --- --- --- --- --- --- --- ------ ------ ------ ------ --- ------ --- --- --
PRI NT *, " ... IA( ) aft er col umn-by -colum n sor t ... "
DO I = 1, ROW
WRI TE( 6,1 0 ) ( IA( I,J ), J=1 ,CO L )
END DO

*-- --- --- --- --- --- --- --- --- ------ ------ ------ ------ --- --- --- ------ -----
* ..F orm at sta tem ent s..
10 FOR MAT ( 5X, 4( I5, 2X ) )
STO P
END

004– 2165– 002 603


SSORTB ( 3F ) SSORTB ( 3F )

The results of program TISORTB are as follows:


... IA( ) prior to column -by -co lum n sor t ...
2 3 4 5
3 5 7 9
4 7 1 4
5 9 4 8
6 2 7 3
... IA( ) aft er column -by -co lumn sort ...
6 9 7 9
5 7 7 8
4 5 4 5
3 3 4 4
2 2 1 3

604 004– 2165– 002


WHENEQ ( 3F ) WHENEQ ( 3F )

NAME
WHENEQ, WHENNE – Searches a vector for all elements equal or not equal to a target

SYNOPSIS
CALL WHENEQ (n, x, incx, target, index, nn)
CALL WHENNE (n, x, incx, target, index, nn)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
WHENEQ searches a real or integer vector for all elements equal to a real or integer target.
WHENNE searches a real or integer vector for all elements not equal to a real or integer target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
n Integer. (input)
Number of elements to be searched.
x Real or integer array of dimension (n– 1) .  incx  + 1. (input)
Array x containing the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
target Real or integer. (input)
Value for which to search in the array.
index Integer array of dimension n. (output)
Array index contains the indices in the array elements that match target.
nn Integer. (output)
Number of values put in the index array.

NOTES

When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)

004– 2165– 002 605


WHENEQ ( 3F ) WHENEQ ( 3F )

The desired values are at:


x(1+(index(k)– 1) . incx) when incx > 0
x(1+(index(k)– n) . incx) when incx < 0
for all k = 1, 2, . . ., nn .

606 004– 2165– 002


WHENFLT ( 3F ) WHENFLT ( 3F )

NAME
WHENFLT, WHENFLE, WHENFGT, WHENFGE – Searches a real vector for all elements with a specified
logical relationship to a real target

SYNOPSIS
CALL WHENFLT (n, x, incx, target, index, nn)
CALL WHENFLE (n, x, incx, target, index, nn)
CALL WHENFGT (n, x, incx, target, index, nn)
CALL WHENFGE (n, x, incx, target, index, nn)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
WHENFLT searches a real vector for all elements that are less than a real target.
WHENFLE searches a real vector for all elements that are less than or equal to a real target.
WHENFGT searches a real vector for all elements that are greater than a real target.
WHENFGE searches a real vector for all elements that are greater than or equal to a real target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
n Integer. (input)
Number of elements of the array to be searched.
x Real array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
target Real. (input)
Value for which array is searched.
index Integer array of dimension n. (output)
Array index contains the indices in the array elements that match target.
nn Integer. (output)
Number of values put in the index array.

004– 2165– 002 607


WHENFLT ( 3F ) WHENFLT ( 3F )

NOTES
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired values are at:
x(1+(index(k)– 1) . incx) when incx > 0
x(1+(index(k)– n) . incx) when incx < 0
for all k = 1, 2, . . ., nn.

608 004– 2165– 002


WHENILT ( 3F ) WHENILT ( 3F )

NAME
WHENILT, WHENILE, WHENIGT, WHENIGE – Searches an integer vector for all elements that have a
specified relationship to an integer target

SYNOPSIS
CALL WHENILT (n, x, incx, itarget, index, nn)
CALL WHENILE (n, x, incx, itarget, index, nn)
CALL WHENIGT (n, x, incx, itarget, index, nn)
CALL WHENIGE (n, x, incx, itarget, index, nn)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
WHENILT searches an integer vector for all elements that are less than an integer target.
WHENILE searches an integer vector for all elements that are less than or equal to an integer target.
WHENIGT searches an integer vector for all elements that are greater than an integer target.
WHENIGE searches an integer vector for all elements that are greater than or equal to an integer target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
n Integer. (input)
Number of elements in the array to be searched.
x Integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of the searched array.
itarget Integer. (input)
Value for which the array is searched.
index Integer array of dimension n. (output)
Array index contains the indices in the array elements that match target.
nn Integer. (output)
Number of values put in the index array.

004– 2165– 002 609


WHENILT ( 3F ) WHENILT ( 3F )

NOTES
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired values are at:
x(1+(index(k)– 1) . incx) when incx > 0
x(1+(index(k)– n) . incx) when incx < 0
for all k = 1, 2, . . ., nn.

610 004– 2165– 002


WHENMEQ ( 3F ) WHENMEQ ( 3F )

NAME
WHENMEQ, WHENMNE – Searches a vector for all elements whose subfields are equal or not equal to a target

SYNOPSIS
CALL WHENMEQ (n, x, incx, itarget, index, nn, mask, iright)
CALL WHENMNE (n, x, incx, itarget, index, nn, mask, iright)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
WHENMEQ searches a real or integer vector for all elements for which the subfield defined by mask and iright
is equal to an integer target.
WHENMNE searches a real or integer vector for all elements for which the subfield defined by mask and iright
is not equal to an integer target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
n Integer. (input)
Number of elements to be searched.
x Real or integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
itarget Integer. (input)
Value for which to search in the array.
index Integer array of dimension n. (output)
Array index contains the indices of the array elements whose subfield is equal or not equal to
itarget.
nn Integer. (output)
Number of values put in the index array.
mask Integer. (input)
Mask of 1’s (set bits) from the right. The number of set bits in mask is the number of bits in the
subfield, which is searched in each element of the input array.
iright Integer. (input)
Number of bits to shift each element of the input array to the right so as to right justify the
subfield searched.

004– 2165– 002 611


WHENMEQ ( 3F ) WHENMEQ ( 3F )

NOTES
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired values are at:
x(1+(index(k)– 1) . incx) when incx > 0
x(1+(index(k)– n) . incx) when incx < 0
for all k = 1, 2, . . ., nn.

612 004– 2165– 002


WHENMLT ( 3F ) WHENMLT ( 3F )

NAME
WHENMLT, WHENMLE, WHENMGT, WHENMGE – Searches a vector for all elements whose subfields have a
specified logical relationship with a target

SYNOPSIS
CALL WHENMLT (n, x, incx, itarget, index, nn, mask, iright)
CALL WHENMLE (n, x, incx, itarget, index, nn, mask, iright)
CALL WHENMGT (n, x, incx, itarget, index, nn, mask, iright)
CALL WHENMGE (n, x, incx, itarget, index, nn, mask, iright)

IMPLEMENTATION
UNICOS systems

DESCRIPTION
WHENMLT searches a real or integer vector for all elements for which the subfield defined by mask and iright
is less than an integer target.
WHENMLE searches a real or integer vector for all elements for which the subfield defined by mask and iright
is less than or equal to an integer target.
WHENMGT searches a real or integer vector for all elements for which the subfield defined by mask and iright
is greater than an integer target.
WHENMGE searches a real or integer vector for all elements for which the subfield defined by mask and iright
is greater than or equal to an integer target.
When using the CF90 compiler UNICOS systems, all arguments must be of default kind unless documented
otherwise. On UNICOS systems, default kind is KIND=8 for integer, real, complex, and logical arguments.
These routines have the following arguments:
n Integer. (input)
Number of elements to be searched.
x Real or integer array of dimension (n– 1) .  incx  + 1. (input)
Array x contains the vector to be searched.
itarget Integer. (input)
Value for which to search in the array.
index Integer array of dimension n. (output)
Array index contains the indices of the array elements whose subfield is equal or not equal to
itarget.
nn Integer. (output)
Number of values put in the index array.

004– 2165– 002 613


WHENMLT ( 3F ) WHENMLT ( 3F )

mask Integer. (input)


Mask of 1’s (set bits) from the right. The number of set bits in mask is the number of bits in the
subfield, which is searched in each element of the input array.
iright Integer. (input)
Number of bits to shift each element of the input array to the right so as to right justify the
subfield searched.

NOTES
When scanning backward (incx < 0), each routine starts at the end of the vector and moves backward, as
follows:
x(1– incx . (n– 1)), x(1– incx . (n– 2)), . . ., x(1)
The desired values are at:
x(1+(index(k)– 1) . incx) when incx > 0
x(1+(index(k)– n) . incx) when incx < 0
for all k = 1, 2, . . ., nn.

614 004– 2165– 002


CINTER ( 3F ) CINTER ( 3F )

NAME
cinter – Introduction to interfaces to C library routines

IMPLEMENTATION
UNICOS and UNICOS/mk systems

DESCRIPTION
This section contains descriptions of interfaces to C library routines.
A number of Fortran-callable interfaces to C library routines are available under the UNICOS operating
system. These routines give a Fortran programmer access to an extensive number of routines and system
calls found in the C library. The interfaces are simple routines that resolve calling sequence differences and
provide uppercase entry-point names. Argument lists and return values should match those of the
corresponding C routine, except where noted otherwise. Calling sequences for many of these Fortran
interfaces to C routines are documented on the corresponding C library man page. Except where otherwise
noted, data types should be handled as follows:
• C character data may be defined as a Fortran character data type for some of the C routines. See each
man page for a description of the routines that allow this. For the routines that do not accept Fortran
character data types as an argument, C character data should be defined as Fortran integers and terminated
by a null (0) byte. On UNICOS systems, Hollerith data handles this for 1– 7 characters in length.
• C pointers should be handled by Fortran integers.
• Other C data types are compatible with their Fortran counterparts.
When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on UNICOS, UNICOS/mk, or IRIX, all
arguments must be of default kind unless documented otherwise. On UNICOS and UNICOS/mk, default
kind is KIND=8 for integer, real, complex, and logical arguments; on IRIX, the default kind is KIND=4.
Interface routines should be coded as Fortran functions.
Example:
CHARAC TER *8 PAT H, IDA (10 )
INTEGE R FOP EN, FWR ITE
PATH=’ fil enm ’
C FOPEN ret urn s an int ege r
ISTREA M = FOP EN ( PAT H, ’w+ ’ )
IF ( IST REA M .EQ . 0 ) THE N
PRI NT *,’ FOP EN fai led ’
CAL L ABO RT

004– 2165– 002 615


CINTER ( 3F ) CINTER ( 3F )

END IF
DO 10 I=1 ,10
IDA(I) =’test cas e’
10 CON TINUE
N=8
J=FWRI TE ( IDA(1) , N, 10, IST REAM )
.
.
.
END

NOTES
The following set of interface routines is provided in the standard UNICOS libraries. See the appropriate
manual or the appropriate online man page for specific usage information.

Purpose Name Heading

Closes or flushes a stream fclose fclose


fflush fflush
Gets integer file descriptor associated with stream fileno ferror
Opens a stream fopen fopen
fdopen
freopen
Gets a string from a stream fgets gets
Puts a string on a stream fputs puts
Performs binary I/O fread fread
fwrite
Repositions a file pointer in a stream fseek fseek
ftell
Returns the current working directory getcwd getcwd
Returns value for environment name getenv* getenv
Gets option letter from argument vector getopt* getopt
Makes a unique file name mktemp mktemp
Changes or adds value to the environment putenv putenv
Suspends execution for a specified interval sleep sleep
Creates a name for a temporary file tempnam tempnam

616 004– 2165– 002


CINTER ( 3F ) CINTER ( 3F )

Purpose Name Heading

Creates a temporary file tmpfile tmpfile


Prints a traceback tracebk tracebk

* Not on UNICOS/mk systems or Cray T90 series.


For the Fortran syntax for the above routines, see the appropriate page in the UNICOS System Libraries
Reference Manual. For more information on Fortran I/O routines, see the Application Programmer’s I/O
Guide.
Many routines which are not supported on UNICOS/mk systems or Cray T90 series are supported as POSIX
1003.9 routines. See the INTRO_PXF(3F) man page for details.

Purpose Name Heading

Determines accessibility of a file access* access


Sets a process alarm clock alarm alarm
Changes working directory chdir* chdir
Changes mode of file chmod* chmod
Changes owner and group of a file chown* chown
Changes root directory chroot* chroot
Closes a file descriptor close close
Selects which processors may run the process cpselect*** cpselect
Creates a new file or rewrites an existing one creat* creat
Terminates a program and specifies status exit exit
Terminates all processes, not just the calling process newexit* exit
Controls open files fcntl fcntl
Creates a new process fork* fork
Gets effective group ID getegid getuid
Gets effective user ID geteuid getuid
Gets group ID getgid getgid
Gets process-group ID getpgrp getpid
Gets process ID getpid getpid
Gets parent process ID getppid getpid

004– 2165– 002 617


CINTER ( 3F ) CINTER ( 3F )

Purpose Name Heading

Returns process ID of multitasking group newgetpid*** getpid


Returns process ID of the multitasking group that created the newgetppid*** getpid
caller’s multitasking group.
Gets user ID getuid getuid
Allocates storage for a file ialloc ialloc
Controls device ioctl ioctl
Sends a signal to a process or a group of processes kill kill
Sets resource limits limit limit
Creates a link to a file link* link
Moves read/write file pointer lseek lseek
Makes a directory, or a special or regular file mknod* mknod
Changes priority of process nice nice
Changes priority of process nicem nice
Opens a file for reading or writing open* open
Suspends process until signal pause pause
Creates an interprocess channel pipe pipe
Locks process in memory plock*** plock
Traces processes ptrace*** ptrace
Performs asynchronous read from a file reada reada
Controls execution of processes resume resume
Changes data segment space allocation sbreak brk
sbrk
brk
Sets group ID setgid*** setuid
Sets process-group ID setpgrp setpgrp
Sets user ID setuid*** setuid
Provides signal control sigctl sigctl
Fortran interface to signal control fsigctl
Pascal interface to signal control psigctl*
Specifies what to do upon receipt of a signal signal signal

618 004– 2165– 002


CINTER ( 3F ) CINTER ( 3F )

Purpose Name Heading

Fortran interface to signal fsignal


Pascal interface to signal psignal
Manages the allocation and deallocation of the secondary data sdsalloc** sdsalloc
segment (SDS) sdsrealc**
sdsfree**
Changes size of secondary data segment (Fortran users should ssbreak**
use the new SDSALLOC routines instead of ssbreak. See
sdsalloc(3F).)
Reads, writes to secondary data segment ssread** ssread
sswrite
Gets file status stat* stat
Controls execution of processes suspend suspend
Flushes system buffers out of main memory sync sync
Gets time time time
Gets process and child process times times times
Truncates a file trunc trunc
Gets and sets user limits ulimit ulimit
Sets and gets file creation mark umask umask
Gets name of current operating system uname* uname
Removes directory entry unlink* unlink
Gets file system statistics ustat ustat
Sets file access and modification times utime* utime
Awaits completion of process wait* wait
Performs asynchronous write on a file writea writea

* Not available on UNICOS/mk systems or Cray T90 series.


** See sdsalloc(3F) for restrictions when using these routines on UNICOS/mk systems.
*** Not available on UNICOS/mk systems.
The argument lists of the uname(3) and time(3) routines differ from those of the corresponding C routines.
No arguments can be used with the Fortran call to time. See the man page in this manual for the correct
syntax when calling uname from Fortran.

004– 2165– 002 619


CINTER ( 3F ) CINTER ( 3F )

The third argument of Fortran routines ssread(2) and sswrite(3) specifies the number of words to be
read or written. This is different from the corresponding system call. See the WARNING section of the
SDSALLOC(3F) routine in this manual for cautions on using ssbreak(2) in Fortran programs.
For more information on Fortran I/O routines, see the Application Programmer’s I/O Guide.
General Usage Example
When a system call or library function has a pointer to a data structure as an argument, the corresponding
Fortran callable routine requires a pointer to a data entity at least as large as the structure. Any exception to
this requirement is documented in the specific man page.
Accessing the fields of a structure from Fortran may not be possible when the structure contains multiple
data types or when the structure uses a data type not recognized by Fortran.
For a few library routines and system calls, alternate Fortran callable entry points provide a simpler method
of accessing structures. These entry points being with the prefix pxf. See pxfintget(3F) for details.
An example of a call to the UTIME() system call from a Fortran program follows. The second argument to
UTIME is a pointer to a structure of type utimbuf. This structure is defined as follows:
struct uti mbuf {
tim e_t act ime ;
tim e_t mod tim e;
}

In the following example, the Fortran programmer uses an integer array to hold the structure. The first word
of the array contains the actime field; the second word contains the modtime field.
PRO GRAM UTIM
INT EGER TIME, UTIME
INT EGER UT(2)
I = TIME()
UT( 1) = I
UT( 2) = I
C Update the acc ess and modifi cat ion tim es of fil e ’my fil e’
C to the curren t tim e
I = UTI ME(’my file’, UT)
IF (I. EQ. -1) THE N
PRI NT *, ’UTIME FAI LED ’
ENDIF
END

620 004– 2165– 002


INDEX

60-bit integer to Cray Research 64-bit integer conversion ............................. int6064(3F)........................................................ 375
60-bit pack and unpack ................................................................................... p6460(3F) ............................................................ 497
60-bit single-precision to 64-bit single-precision conversion ......................... fp6064(3F) .......................................................... 359
64-bit complex conversion .............................................................................. vxzctc(3F) .......................................................... 413
64-bit D format to single-precision conversion .............................................. vxdctc(3F) .......................................................... 399
64-bit integer to 60-bit integer conversion ..................................................... int6460(3F)........................................................ 376
64-bit logical to VAX logical conversion ....................................................... vxlcti(3F) .......................................................... 409
64-bit single-precision conversion .................................................................. usscti(3F) .......................................................... 391
Abort job ......................................................................................................... errexit(3F)........................................................ 422
Abort job (with traceback) .............................................................................. abort(3F) ............................................................ 419
ABORT(3F) ...................................................................................................... abort(3F) ............................................................ 419
abort(3F) ...................................................................................................... abort(3F) ............................................................ 419
Absolute value ................................................................................................. isamax(3F) .......................................................... 562
Active subroutine list ...................................................................................... trbk(3F)............................................................... 520
Adds a word to a table ................................................................................... tmadw(3F) ............................................................ 459
Adjust heap block ........................................................................................... hpnewlen(3F) ..................................................... 455
Allocate memory from heap ........................................................................... hpalloc(3F)........................................................ 450
Allocated heap block change .......................................................................... hpnewlen(3F) ..................................................... 455
Allocates a block of memory from the heap .................................................. hpalloc(3F)........................................................ 450
Allocates table space ....................................................................................... tmats(3F) ............................................................ 461
Argument ......................................................................................................... iargc(3F) ............................................................ 430
Array byte or bit move ................................................................................... mov(3F) ................................................................. 489
Array byte replace ........................................................................................... byt(3F) ................................................................. 479
ASCDC(3F) ...................................................................................................... dsasc(3F) ............................................................ 355
ascdc(3F) ...................................................................................................... dsasc(3F) ............................................................ 355
ASCII conversion functions ............................................................................ intro_conversion(3F) .................................. 327
ASCII from binary conversion ........................................................................ b2oct(3F) ............................................................ 333
ASCII from time ............................................................................................. tsdt(3F)............................................................... 528
ASCII to EBCDIC conversion ........................................................................ uscctc(3F) .......................................................... 381
ASCII to integer conversion ........................................................................... chconv(3F) .......................................................... 338
ASCII to time-stamp conversion .................................................................... dtts(3F)............................................................... 480
Auxiliary array variables access ..................................................................... auxstat(3F)........................................................ 473
AUXSTAT(3F) ................................................................................................. auxstat(3F)........................................................ 473
auxstat(3F) ................................................................................................. auxstat(3F)........................................................ 473
B2OCT(3F) ...................................................................................................... b2oct(3F) ............................................................ 333
b2oct(3F) ...................................................................................................... b2oct(3F) ............................................................ 333
Barrier synchronization with tasks .................................................................. set_barrier(3C) .............................................. 539
Barrier synchronization with tasks .................................................................. wait_barrier(3C) ........................................... 544
Batcher’s odd-even merge sort ....................................................................... ssortb(3F) .......................................................... 598
Bidirectional memory transfer ........................................................................ sensebt(3F)........................................................ 441
Bidirectional memory transfer (enable/disable) .............................................. clearbt(3F)........................................................ 420
Binary to character conversion ....................................................................... b2oct(3F) ............................................................ 333
Binary to octal conversion .............................................................................. b2oct(3F) ............................................................ 333
Bit mask creation ............................................................................................ bitvec(3F) .......................................................... 474
Bit mask creation ............................................................................................ bitvecm(3F)........................................................ 477
Bit move .......................................................................................................... mov(3F) ................................................................. 489
BITVEC(3F) .................................................................................................... bitvec(3F) .......................................................... 474

004– 2165– 002 Index-1


bitvec(3F) .................................................................................................... bitvec(3F) .......................................................... 474
BITVECM(3F) ................................................................................................. bitvecm(3F)........................................................ 477
bitvecm(3F) ................................................................................................. bitvecm(3F)........................................................ 477
Block address validity ..................................................................................... ihpvalid(3F) ..................................................... 458
Block extend or copy ...................................................................................... hpclmove(3F) ..................................................... 452
Block length heap ........................................................................................... ihplen(3F) .......................................................... 457
Block of memory to heap ............................................................................... hpdeallc(3F) ..................................................... 453
byt(3F) ........................................................................................................... byt(3F) ................................................................. 479
Byte move ....................................................................................................... mov(3F) ................................................................. 489
Byte replacement ............................................................................................. byt(3F) ................................................................. 479
C snapshot dump ............................................................................................. symdump(3F)........................................................ 511
Calling sequence information ......................................................................... trbklvl(3F)........................................................ 521
Calling sequence list ....................................................................................... trbk(3F)............................................................... 520
CDC 60-bit integer conversion ....................................................................... int6064(3F)........................................................ 375
CDC 60-bit single-precision conversion ......................................................... fp6064(3F) .......................................................... 359
CDC display code characters (conversion) ..................................................... dsasc(3F) ............................................................ 355
CDC to ASCII character conversion .............................................................. dsasc(3F) ............................................................ 355
CDC to Cray conversion ................................................................................. cdc2cray(3F) ..................................................... 335
CDC2CRAY(3F) ............................................................................................... cdc2cray(3F) ..................................................... 335
cdc2cray(3F) ............................................................................................... cdc2cray(3F) ..................................................... 335
C/Fortran interface .......................................................................................... cinter(3F) .......................................................... 615
Change length of block ................................................................................... hpclmove(3F) ..................................................... 452
Changes the size of an allocated heap block .................................................. hpnewlen(3F) ..................................................... 455
Character conversion (CDC to ASCII) ........................................................... dsasc(3F) ............................................................ 355
Character conversion (IEEE floating-point to Cray) ...................................... cry2cri(3F)........................................................ 349
Character conversion (IEEE floating-point to Cray) ...................................... cry2mips(3F) ..................................................... 352
Character conversion (IEEE floating-point to MIPS) ..................................... ieg2mips(3F) ..................................................... 369
Character conversion (IEEE floating-point to MIPS) ..................................... vax2mips(3F) ..................................................... 396
Character conversion (IEEE to Cray) ............................................................. cri2cray(3F) ..................................................... 340
Character conversion (IEEE to Cray) ............................................................. cri2ibm(3F)........................................................ 343
Character conversion (IEEE to Cray) ............................................................. ieg2cray(3F) ..................................................... 363
Character conversion (IEEE to Cray) ............................................................. ieg2cri_77(3F) ................................................ 366
Character conversion (IEEE to Cray) ............................................................. ieu2cray(3F) ..................................................... 372
Character count without trailing blanks .......................................................... trimlen(3F)........................................................ 524
Character move ............................................................................................... mvc(3F) ................................................................. 493
CHCONV(3F) .................................................................................................... chconv(3F) .......................................................... 338
chconv(3F) .................................................................................................... chconv(3F) .......................................................... 338
Check heap ...................................................................................................... hpcheck(3F)........................................................ 451
Checkpoint program ........................................................................................ shutdsav(3F) ..................................................... 504
Checks the integrity of the heap ..................................................................... hpcheck(3F)........................................................ 451
Checks to see whether two files have the same inode number ...................... samefile(3F) ..................................................... 440
cinter(3F) .................................................................................................... cinter(3F) .......................................................... 615
Clear multitasking event ................................................................................. clear_event(3C) .............................................. 536
CLEARBT(3F) ................................................................................................. clearbt(3F)........................................................ 420
clearbt(3F) ................................................................................................. clearbt(3F)........................................................ 420
CLEAR_EVENT(3C) ....................................................................................... clear_event(3C) .............................................. 536
clear_event(3C) ....................................................................................... clear_event(3C) .............................................. 536
CLEARFI(3F) ................................................................................................. clearfi(3F)........................................................ 421
clearfi(3F) ................................................................................................. clearfi(3F)........................................................ 421
Clears an event and returns control to the calling PE .................................... clear_event(3C) .............................................. 536

Index-2 004– 2165– 002


CLUSEQ(3F) .................................................................................................... cluseq(3F) .......................................................... 551
cluseq(3F) .................................................................................................... cluseq(3F) .......................................................... 551
CLUSFGE(3F) ................................................................................................. clusflt(3F)........................................................ 553
clusfge(3F) ................................................................................................. clusflt(3F)........................................................ 553
CLUSFGT(3F) ................................................................................................. clusflt(3F)........................................................ 553
clusfgt(3F) ................................................................................................. clusflt(3F)........................................................ 553
CLUSFLE(3F) ................................................................................................. clusflt(3F)........................................................ 553
clusfle(3F) ................................................................................................. clusflt(3F)........................................................ 553
CLUSFLT(3F) ................................................................................................. clusflt(3F)........................................................ 553
clusflt(3F) ................................................................................................. clusflt(3F)........................................................ 553
CLUSIGE(3F) ................................................................................................. clusilt(3F)........................................................ 555
clusige(3F) ................................................................................................. clusilt(3F)........................................................ 555
CLUSIGT(3F) ................................................................................................. clusilt(3F)........................................................ 555
clusigt(3F) ................................................................................................. clusilt(3F)........................................................ 555
CLUSILE(3F) ................................................................................................. clusilt(3F)........................................................ 555
clusile(3F) ................................................................................................. clusilt(3F)........................................................ 555
CLUSILT(3F) ................................................................................................. clusilt(3F)........................................................ 555
clusilt(3F) ................................................................................................. clusilt(3F)........................................................ 555
CLUSNE(3F) .................................................................................................... cluseq(3F) .......................................................... 551
clusne(3F) .................................................................................................... cluseq(3F) .......................................................... 551
Cluster ............................................................................................................. cluseq(3F) .......................................................... 551
Cluster ............................................................................................................. clusflt(3F)........................................................ 553
Cluster ............................................................................................................. clusilt(3F)........................................................ 555
Cluster search .................................................................................................. cluseq(3F) .......................................................... 551
Cluster search .................................................................................................. clusflt(3F)........................................................ 553
Cluster search .................................................................................................. clusilt(3F)........................................................ 555
Command-line arguments ............................................................................... getoarg(3F)........................................................ 426
Command-line arguments ............................................................................... getoargc(3F) ..................................................... 427
Complex conversion from VAX ..................................................................... vxzctc(3F) .......................................................... 413
Complex conversion (IEEE to Cray) .............................................................. cri2cray(3F) ..................................................... 340
Complex conversion (IEEE to Cray) .............................................................. ieg2cray(3F) ..................................................... 363
Complex conversion (IEEE to Cray) .............................................................. ieg2cri_77(3F) ................................................ 366
Complex conversion (IEEE to Cray) .............................................................. ieu2cray(3F) ..................................................... 372
Compresses stored data ................................................................................... pack(3F)............................................................... 494
Compute integer ceiling .................................................................................. iceil(3F) ............................................................ 487
Controls receipt of signals .............................................................................. sigoff(3F) .......................................................... 506
Conversion of 64-bit integer to VAX integer ................................................. vxicti(3F) .......................................................... 406
Conversion (real) to VAX F ........................................................................... vxscti(3F) .......................................................... 411
Conversion routines ........................................................................................ intro_conversion(3F) .................................. 327
Conversion subprograms ................................................................................. intro_conversion(3F) .................................. 327
Conversion to VAX floating-point .................................................................. vxscti(3F) .......................................................... 411
Convert ASCII to integer ................................................................................ chconv(3F) .......................................................... 338
Convert between VAX and Cray .................................................................... vax2cray(3F) ..................................................... 393
Convert binary to octal ................................................................................... b2oct(3F) ............................................................ 333
Convert data to and from Cray ....................................................................... cri2cray(3F) ..................................................... 340
Convert data to and from Cray ....................................................................... cry2cri(3F)........................................................ 349
Convert data to and from Cray ....................................................................... cry2mips(3F) ..................................................... 352
Convert data to and from Cray ....................................................................... ieg2cray(3F) ..................................................... 363
Convert data to and from Cray ....................................................................... ieg2cri_77(3F) ................................................ 366
Convert data to and from Cray ....................................................................... ieu2cray(3F) ..................................................... 372

004– 2165– 002 Index-3


Convert data to and from IEEE generic and Cray IEEE ................................ cri2ieg(3F)........................................................ 346
Convert floating-point from VAX ................................................................... vxsctc(3F) .......................................................... 410
Convert time .................................................................................................... dtts(3F)............................................................... 480
Convert time to ASCII .................................................................................... tsdt(3F)............................................................... 528
Converts a Cray Research 64-bit integer to an IBM packed-decimal field ... usictp(3F) .......................................................... 387
Converts ASCII date and time to time stamp ................................................ dtts(3F)............................................................... 480
Converts between CDC 60-bit and Cray Research 64-bit numbers ............... fp6064(3F) .......................................................... 359
Converts between IBM INTEGER*2/INTEGER*4 and Cray Research
64-bit integer numbers .................................................................................... usictc(3F) .......................................................... 385
Converts between IBM LOGICAL*1/LOGICAL*4 and Cray Research
64-bit logical values ........................................................................................ uslctc(3F) .......................................................... 388
Converts CDC 60-bit integers to Cray Research 64-bit integers ................... int6064(3F)........................................................ 375
Converts CDC data to Cray Research format and vice versa ........................ cdc2cray(3F) ..................................................... 335
Converts CDC display code character to ASCII character and vice versa .... dsasc(3F) ............................................................ 355
Converts Cray 64-bit integers to VAX INTEGER*2 (16 bit) or
INTEGER*4 (32 bit) numbers ........................................................................ vxicti(3F) .......................................................... 406
Converts Cray 64-bit single-precision, floating-point numbers to IBM
64-bit double-precision numbers ..................................................................... usdcti(3F) .......................................................... 384
Converts Cray Research 128-bit complex numbers to VAX 64-bit
complex numbers ............................................................................................ vxzcti(3F) .......................................................... 414
Converts Cray Research 64-bit integers to CDC 60-bit integers ................... int6460(3F)........................................................ 376
Converts Cray Research 64-bit logical numbers to VAX 32-bit logical
numbers ........................................................................................................... vxlcti(3F) .......................................................... 409
Converts Cray Research 64-bit single-precision, floating-point numbers to
IBM 32-bit single-precision numbers ............................................................. usscti(3F) .......................................................... 391
Converts Cray Research 64-bit single-precision, floating-point (real)
numbers to VAX D-format, 64-bit, double-precision, floating-point
numbers ........................................................................................................... vxdcti(3F) .......................................................... 400
Converts Cray Research 64-bit single-precision, floating-point (real)
numbers to VAX F format, 32-bit, single-precision, floating-point
numbers ........................................................................................................... vxscti(3F) .......................................................... 411
Converts Cray Research 64-bit single-precision, floating-point (real)
numbers to VAX G-format, 64-bit, single-precision, floating-point
numbers ........................................................................................................... vxgcti(3F) .......................................................... 403
Converts Cray Research IEEE Fortran data types to IBM (360/370-style)
Fortran data types ............................................................................................ cri2ibm(3F)........................................................ 343
Converts DEC ULTRIX/generic little-endian 32-bit data to Cray
Research 64-bit data and vice versa ............................................................... ieu2cray(3F) ..................................................... 372
Converts decimal ASCII numerals to an integer value .................................. chconv(3F) .......................................................... 338
Converts EBCDIC character data to ASCII character data, and vice versa .. uscctc(3F) .......................................................... 381
Converts ETA/CYBER 205 data to Cray Research format and vice versa ... eta2cray(3F) ..................................................... 356
Converts Fortran data types between Cray floating-point and IEEE
floating-point systems ..................................................................................... cry2cri(3F)........................................................ 349
Converts Fortran data types between Cray Fortran data types and MIPS
IEEE Fortran data types .................................................................................. cry2mips(3F) ..................................................... 352
Converts Fortran data types between Cray IEEE and generic IEEE data
types ................................................................................................................ cri2ieg(3F)........................................................ 346
Converts generic IEEE data to MIPS IEEE data and vice versa ................... ieg2mips(3F) ..................................................... 369
Converts generic IEEE data to MIPS IEEE data and vice versa ................... vax2mips(3F) ..................................................... 396

Index-4 004– 2165– 002


Converts IBM 32-bit floating-point numbers to Cray Research 64-bit
single-precision numbers ................................................................................. ussctc(3F) .......................................................... 390
Converts IBM 64-bit floating-point numbers to Cray Research 64-bit,
single-precision numbers ................................................................................. usdctc(3F) .......................................................... 383
Converts IBM data to Cray Research format and vice versa ......................... ibm2cray(3F) ..................................................... 360
Converts IEEE 32-bit data to Cray Research IEEE 64-bit data and vice
versa ................................................................................................................ ieg2cri_77(3F) ................................................ 366
Converts IEEE/Generic 32-bit data to Cray Research 64-bit data and vice
versa ................................................................................................................ ieg2cray(3F) ..................................................... 363
Converts IEEE/MPP 64-bit data to Cray Research PVP 64-bit data and
vice versa ........................................................................................................ cri2cray(3F) ..................................................... 340
Converts machine time (real-time clock value) to time stamp ....................... mtts(3F)............................................................... 492
Converts NOS/VE data to Cray Research format and vice versa .................. nve2cray(3F) ..................................................... 377
Converts specified number of bytes of IBM packed-decimal field to
64-bit integer field ........................................................................................... uspctc(3F) .......................................................... 389
Converts time stamp to machine time (real-time clock value) ....................... tsmt(3F)............................................................... 529
Converts time stamps to ASCII date and time strings ................................... tsdt(3F)............................................................... 528
Converts trailing blanks to nulls and vice versa ............................................. rbn(3F) ................................................................. 380
Converts VAX 32-bit floating-point numbers to Cray Research 64-bit
single-precision real numbers ......................................................................... vxsctc(3F) .......................................................... 410
Converts VAX 32-bit logical numbers to Cray Research 64-bit logical
numbers ........................................................................................................... vxlctc(3F) .......................................................... 408
Converts VAX 64-bit complex numbers to Cray Research 128-bit
complex numbers ............................................................................................ vxzctc(3F) .......................................................... 413
Converts VAX 64-bit, D-format numbers to Cray Research 64-bit
single-precision numbers ................................................................................. vxdctc(3F) .......................................................... 399
Converts VAX 64-bit G-format numbers to Cray Research 64-bit
single-precision numbers ................................................................................. vxgctc(3F) .......................................................... 402
Converts VAX data to Cray Research format and vice versa ........................ vax2cray(3F) ..................................................... 393
Converts VAX INTEGER*2 (16 bits) or INTEGER*4 (32 bits) to Cray
Research 64-bit integers .................................................................................. vxictc(3F) .......................................................... 405
Copy block ...................................................................................................... hpclmove(3F) ..................................................... 452
Count arguments ............................................................................................. iargc(3F) ............................................................ 430
Counting sort ................................................................................................... isortd(3F) .......................................................... 566
CPU time elapsed ............................................................................................ second(3F) .......................................................... 500
CPU time in real-time clock ticks (Fortran) ................................................... icpused(3F)........................................................ 488
CPU time remaining ....................................................................................... tremain(3F)........................................................ 523
Cray 64-bit conversion (single-precision floating-point) ................................ usdcti(3F) .......................................................... 384
Cray 64-bit integer conversion (and IBM) ..................................................... usictc(3F) .......................................................... 385
Cray 64-bit integer to VAX integer conversion ............................................. vxicti(3F) .......................................................... 406
Cray 64-bit logical to VAX logical conversion .............................................. vxlcti(3F) .......................................................... 409
Cray 64-bit single-precision conversion ......................................................... fp6064(3F) .......................................................... 359
Cray 64-bit single-precision floating-point (conversion) ................................ vxgcti(3F) .......................................................... 403
Cray 64-bit single-precision to floating-point conversion .............................. vxdcti(3F) .......................................................... 400
Cray complex to VAX complex conversion ................................................... vxzcti(3F) .......................................................... 414
Cray IEEE to IBM conversion ........................................................................ cri2ibm(3F)........................................................ 343
Cray logical to LOGICAL*1 conversion ........................................................ uslctc(3F) .......................................................... 388
Cray logical to LOGICAL*4 conversion ........................................................ uslctc(3F) .......................................................... 388
Cray Research 64-bit integer conversion (and CDC) ..................................... int6460(3F)........................................................ 376
Cray to CDC conversion ................................................................................. cdc2cray(3F) ..................................................... 335

004– 2165– 002 Index-5


Cray to ETA/Cyber 205 conversion ............................................................... eta2cray(3F) ..................................................... 356
Cray to IBM conversion ................................................................................. ibm2cray(3F) ..................................................... 360
Cray to NOS/VE conversion ........................................................................... nve2cray(3F) ..................................................... 377
Cray to VAX conversion ................................................................................ vax2cray(3F) ..................................................... 393
Cray to VAX conversion (complex) ............................................................... vxzcti(3F) .......................................................... 414
Cray to VAX conversion (floating-point to VAX) ......................................... vxgcti(3F) .......................................................... 403
CRAY-2 environment variables ...................................................................... reprieve(3F) ..................................................... 498
CRAY2CDC(3F) ............................................................................................... cdc2cray(3F) ..................................................... 335
cray2cdc(3F) ............................................................................................... cdc2cray(3F) ..................................................... 335
CRAY2CRI(3F) ............................................................................................... cri2cray(3F) ..................................................... 340
cray2cri(3F) ............................................................................................... cri2cray(3F) ..................................................... 340
CRAY2ETA(3F) ............................................................................................... eta2cray(3F) ..................................................... 356
cray2eta(3F) ............................................................................................... eta2cray(3F) ..................................................... 356
CRAY2IBM(3F) ............................................................................................... ibm2cray(3F) ..................................................... 360
cray2ibm(3F) ............................................................................................... ibm2cray(3F) ..................................................... 360
CRAY2IEC(3F) ............................................................................................... cry2cri(3F)........................................................ 349
cray2iec(3F) ............................................................................................... cry2cri(3F)........................................................ 349
CRAY2IEG(3F) ............................................................................................... ieg2cray(3F) ..................................................... 363
cray2ieg(3F) ............................................................................................... ieg2cray(3F) ..................................................... 363
CRAY2IEU(3F) ............................................................................................... ieu2cray(3F) ..................................................... 372
cray2ieu(3F) ............................................................................................... ieu2cray(3F) ..................................................... 372
CRAY2NVE(3F) ............................................................................................... nve2cray(3F) ..................................................... 377
cray2nve(3F) ............................................................................................... nve2cray(3F) ..................................................... 377
CRAY2VAX(3F) ............................................................................................... vax2cray(3F) ..................................................... 393
cray2vax(3F) ............................................................................................... vax2cray(3F) ..................................................... 393
CRAYDUMP(3F) ............................................................................................... craydump(3F) ..................................................... 449
craydump(3F) ............................................................................................... craydump(3F) ..................................................... 449
CRI2CRAY(3F) ............................................................................................... cri2cray(3F) ..................................................... 340
cri2cray(3F) ............................................................................................... cri2cray(3F) ..................................................... 340
CRI2CRY(3F) ................................................................................................. cry2cri(3F)........................................................ 349
cri2cry(3F) ................................................................................................. cry2cri(3F)........................................................ 349
CRI2IBM(3F) ................................................................................................. cri2ibm(3F)........................................................ 343
cri2ibm(3F) ................................................................................................. cri2ibm(3F)........................................................ 343
CRI2IEG(3F) ................................................................................................. cri2ieg(3F)........................................................ 346
cri2ieg(3F) ................................................................................................. cri2ieg(3F)........................................................ 346
CRI2IEG_77(3F) .......................................................................................... ieg2cri_77(3F) ................................................ 366
cri2ieg_77(3F) .......................................................................................... ieg2cri_77(3F) ................................................ 366
CRY2CRI(3F) ................................................................................................. cry2cri(3F)........................................................ 349
cry2cri(3F) ................................................................................................. cry2cri(3F)........................................................ 349
CRY2MIPS(3F) ............................................................................................... cry2mips(3F) ..................................................... 352
cry2mips(3F) ............................................................................................... cry2mips(3F) ..................................................... 352
Current level of calling sequence ................................................................... trbklvl(3F)........................................................ 521
Current operating system ................................................................................ uname(3F) ............................................................ 442
Current working directory ............................................................................... getcwd(3F) .......................................................... 424
Data compression ............................................................................................ pack(3F)............................................................... 494
Data conversion (ASCII to EBCDIC) ............................................................ uscctc(3F) .......................................................... 381
Data conversion (IBM to Cray) ...................................................................... ibm2cray(3F) ..................................................... 360
Data conversion (IEEE to Cray) ..................................................................... cri2cray(3F) ..................................................... 340
Data conversion (IEEE to Cray) ..................................................................... ieg2cray(3F) ..................................................... 363
Data conversion (IEEE to Cray) ..................................................................... ieg2cri_77(3F) ................................................ 366

Index-6 004– 2165– 002


Data conversion (IEEE to Cray) ..................................................................... ieu2cray(3F) ..................................................... 372
Data unpacking ............................................................................................... unpack(3F) .......................................................... 531
Date conversion ............................................................................................... dtts(3F)............................................................... 480
Deallocate heap ............................................................................................... hpdeallc(3F) ..................................................... 453
debug(3F) ...................................................................................................... symdebug(3F) ..................................................... 508
Debugging ....................................................................................................... reprieve(3F) ..................................................... 498
DEBUG-like snapshot dump ........................................................................... symdump(3F)........................................................ 511
Decrease heap block ....................................................................................... hpnewlen(3F) ..................................................... 455
Delays the calling PE until the eureka event is posted .................................. wait_event(3C) ................................................ 545
Describes error handling under the UNICOS and UNICOS/mk operating
system .............................................................................................................. reprieve(3F) ..................................................... 498
Determines if bidirectional memory transfer is enabled or disabled .............. sensebt(3F)........................................................ 441
Directory of process ........................................................................................ getcwd(3F) .......................................................... 424
Disable bidirectional memory ......................................................................... clearbt(3F)........................................................ 420
disablfi(3F) ............................................................................................... clearfi(3F)........................................................ 421
Distribution counting sort ............................................................................... isortd(3F) .......................................................... 566
DSASC(3F) ...................................................................................................... dsasc(3F) ............................................................ 355
dsasc(3F) ...................................................................................................... dsasc(3F) ............................................................ 355
DTTS(3F) ........................................................................................................ dtts(3F)............................................................... 480
dtts(3F) ........................................................................................................ dtts(3F)............................................................... 480
Dump arrays of memory ................................................................................. craydump(3F) ..................................................... 449
Dump heap size and address ........................................................................... hpdump(3F) .......................................................... 454
Dump of running program .............................................................................. symdump(3F)........................................................ 511
Dump routines ................................................................................................. intro_progaids(3F) ....................................... 469
dump(3F) ........................................................................................................ symdump(3F)........................................................ 511
Dumps the address and size of each heap block ............................................ hpdump(3F) .......................................................... 454
EBCDIC to ASCII conversion ........................................................................ uscctc(3F) .......................................................... 381
Enable bidirectional memory transfers ........................................................... clearbt(3F)........................................................ 420
enablfi(3F) ................................................................................................. clearfi(3F)........................................................ 421
End Fortran program ....................................................................................... exit(3F)............................................................... 423
End job ............................................................................................................ abort(3F) ............................................................ 419
Enters a formatted message in the stderr file ............................................ remarkf(3F)........................................................ 438
Enters a message in the stderr file ............................................................. remark(3F) .......................................................... 437
Environment variables ..................................................................................... reprieve(3F) ..................................................... 498
ERREXIT(3F) ................................................................................................. errexit(3F)........................................................ 422
errexit(3F) ................................................................................................. errexit(3F)........................................................ 422
Error handling description .............................................................................. reprieve(3F) ..................................................... 498
ETA2CRAY(3F) ............................................................................................... eta2cray(3F) ..................................................... 356
eta2cray(3F) ............................................................................................... eta2cray(3F) ..................................................... 356
ETA/Cyber 205 to Cray conversion ............................................................... eta2cray(3F) ..................................................... 356
Event post ....................................................................................................... set_event(3C) .................................................. 540
Event routines (UNICOS/mk) ......................................................................... intro_sync(3F) ................................................ 535
Event test ......................................................................................................... test_event(3C) ................................................ 543
Events (clear multitasking) ............................................................................. clear_event(3C) .............................................. 536
Events (post multitasking) .............................................................................. set_event(3C) .................................................. 540
Exchange package listing ................................................................................ xpfmt(3F) ............................................................ 532
Exchange package processing routines ........................................................... intro_progaids(3F) ....................................... 469
Executes a UNICOS shell command .............................................................. ishell(3F) .......................................................... 431
Execution time (elapsed) in CPU ................................................................... second(3F) .......................................................... 500
Execution time for calling task (elapsed) in CPU .......................................... tsecnd(3F) .......................................................... 526

004– 2165– 002 Index-7


Exit job (error exit) ......................................................................................... errexit(3F)........................................................ 422
EXIT(3F) ........................................................................................................ exit(3F)............................................................... 423
exit(3F) ........................................................................................................ exit(3F)............................................................... 423
Exits from a Fortran program ......................................................................... exit(3F)............................................................... 423
Expands stored data ........................................................................................ unpack(3F) .......................................................... 531
Extend block ................................................................................................... hpclmove(3F) ..................................................... 452
Extends a block or copies the contents of the block into a larger block ....... hpclmove(3F) ..................................................... 452
Field finder ...................................................................................................... tmmsc(3F) ............................................................ 463
Files with same inode numbers ...................................................................... samefile(3F) ..................................................... 440
Find field ......................................................................................................... tmmsc(3F) ............................................................ 463
Find table field ................................................................................................ tmsrc(3F) ............................................................ 467
Fixed length record sort .................................................................................. orders(3F) .......................................................... 581
Floating point conversion ................................................................................ usdcti(3F) .......................................................... 384
Floating point to 32-bit single-precision ......................................................... usscti(3F) .......................................................... 391
Floating point to double-precision conversion ................................................ vxdcti(3F) .......................................................... 400
Floating-point conversion (IBM 32-bit) .......................................................... ussctc(3F) .......................................................... 390
Floating-point interrupt status ......................................................................... clearfi(3F)........................................................ 421
Floating-point to double-precision .................................................................. usdcti(3F) .......................................................... 384
Floating-point to single-precision conversion ................................................. usdctc(3F) .......................................................... 383
Floating-point to VAX F format single precision .......................................... vxscti(3F) .......................................................... 411
Floating-point to VAX G format single precision .......................................... vxgcti(3F) .......................................................... 403
Foreign data conversion routines .................................................................... intro_conversion(3F) .................................. 327
Fortran exit ...................................................................................................... exit(3F)............................................................... 423
Fortran floating-point interrupt status ............................................................. clearfi(3F)........................................................ 421
Fortran snapshot dump .................................................................................... symdump(3F)........................................................ 511
Fortran/C interface .......................................................................................... cinter(3F) .......................................................... 615
FP6064(3F) .................................................................................................... fp6064(3F) .......................................................... 359
fp6064(3F) .................................................................................................... fp6064(3F) .......................................................... 359
FP6460(3F) .................................................................................................... fp6064(3F) .......................................................... 359
fp6460(3F) .................................................................................................... fp6064(3F) .......................................................... 359
Free block links for heap ................................................................................ hpdump(3F) .......................................................... 454
FSIGCTL(3F) ................................................................................................. fsigctl(3F)........................................................ 481
fsigctl(3F) ................................................................................................. fsigctl(3F)........................................................ 481
Generates a bit mask corresponding to integer or real arrays according to
a specified condition ....................................................................................... bitvec(3F) .......................................................... 474
Generates a bit mask corresponding to masked integer arrays according
to a specified condition ................................................................................... bitvecm(3F)........................................................ 477
GETARG(3F) .................................................................................................... iargc(3F) ............................................................ 430
getarg(3F) .................................................................................................... iargc(3F) ............................................................ 430
GETCALLERINFO(3F) ................................................................................... getcallerinfo(3F) ......................................... 483
getcallerinfo(3F) ................................................................................... getcallerinfo(3F) ......................................... 483
GETCWD(3F) .................................................................................................... getcwd(3F) .......................................................... 424
getcwd(3F) .................................................................................................... getcwd(3F) .......................................................... 424
GETHMC(3F) .................................................................................................... getpmc(3F) .......................................................... 485
gethmc(3F) .................................................................................................... getpmc(3F) .......................................................... 485
GETHOST(3F) ................................................................................................. gethost(3F)........................................................ 425
gethost(3F) ................................................................................................. gethost(3F)........................................................ 425
GETOARG(3F) ................................................................................................. getoarg(3F)........................................................ 426
getoarg(3F) ................................................................................................. getoarg(3F)........................................................ 426
GETOARGC(3F) ............................................................................................... getoargc(3F) ..................................................... 427

Index-8 004– 2165– 002


getoargc(3F) ............................................................................................... getoargc(3F) ..................................................... 427
GETPMC(3F) .................................................................................................... getpmc(3F) .......................................................... 485
getpmc(3F) .................................................................................................... getpmc(3F) .......................................................... 485
Gets command-line arguments ........................................................................ getoarg(3F)........................................................ 426
Gets command-line arguments ........................................................................ getoargc(3F) ..................................................... 427
Gets command-line arguments, allowing blanks or commas as delimiters .... getvarg(3F)........................................................ 428
Gets command-line arguments, allowing blanks or commas as delimiters .... getvargc(3F) ..................................................... 429
Gets task CPU time in real-time clock (RTC) ticks ....................................... icpused(3F)........................................................ 488
GETTMC(3F) .................................................................................................... getpmc(3F) .......................................................... 485
gettmc(3F) .................................................................................................... getpmc(3F) .......................................................... 485
GETVARG(3F) ................................................................................................. getvarg(3F)........................................................ 428
getvarg(3F) ................................................................................................. getvarg(3F)........................................................ 428
GETVARGC(3F) ............................................................................................... getvargc(3F) ..................................................... 429
getvargc(3F) ............................................................................................... getvargc(3F) ..................................................... 429
Gives the number of reads and writes to SDS that have occurred while
accessing auxiliary array variables ................................................................. auxstat(3F)........................................................ 473
Halting all processing elements ...................................................................... stop_all(3F) ..................................................... 507
Hardware standard name ................................................................................. uname(3F) ............................................................ 442
Heap address ................................................................................................... hpdump(3F) .......................................................... 454
Heap allocation ............................................................................................... hpalloc(3F)........................................................ 450
Heap block (adjustment) ................................................................................. hpnewlen(3F) ..................................................... 455
Heap block length ........................................................................................... ihplen(3F) .......................................................... 457
Heap blocks dump .......................................................................................... hpdump(3F) .......................................................... 454
Heap deallocation ............................................................................................ hpdeallc(3F) ..................................................... 453
Heap information ............................................................................................ hpdump(3F) .......................................................... 454
Heap integrity check ....................................................................................... hpcheck(3F)........................................................ 451
Heap management ........................................................................................... intro_heap(3F) ................................................ 445
Heap size ......................................................................................................... hpdump(3F) .......................................................... 454
History trace buffer routines ........................................................................... intro_sync(3F) ................................................ 535
Host mainframe ............................................................................................... gethost(3F)........................................................ 425
HPALLOC(3F) ................................................................................................. hpalloc(3F)........................................................ 450
hpalloc(3F) ................................................................................................. hpalloc(3F)........................................................ 450
HPCHECK(3F) ................................................................................................. hpcheck(3F)........................................................ 451
hpcheck(3F) ................................................................................................. hpcheck(3F)........................................................ 451
HPCLMOVE(3F) ............................................................................................... hpclmove(3F) ..................................................... 452
hpclmove(3F) ............................................................................................... hpclmove(3F) ..................................................... 452
HPDEALLC(3F) ............................................................................................... hpdeallc(3F) ..................................................... 453
hpdeallc(3F) ............................................................................................... hpdeallc(3F) ..................................................... 453
HPDUMP(3F) .................................................................................................... hpdump(3F) .......................................................... 454
hpdump(3F) .................................................................................................... hpdump(3F) .......................................................... 454
HPNEWLEN(3F) ............................................................................................... hpnewlen(3F) ..................................................... 455
hpnewlen(3F) ............................................................................................... hpnewlen(3F) ..................................................... 455
HPSHRINK(3F) ............................................................................................... hpshrink(3F) ..................................................... 456
hpshrink(3F) ............................................................................................... hpshrink(3F) ..................................................... 456
IARGC(3F) ...................................................................................................... iargc(3F) ............................................................ 430
iargc(3F) ...................................................................................................... iargc(3F) ............................................................ 430
IBM 32-bit floating-point conversion ............................................................. ussctc(3F) .......................................................... 390
IBM 64-bit floating-point conversion ............................................................. usdctc(3F) .......................................................... 383
IBM packed-decimal conversion .................................................................... uspctc(3F) .......................................................... 389
IBM to Cray conversion ................................................................................. ibm2cray(3F) ..................................................... 360

004– 2165– 002 Index-9


IBM2CRAY(3F) ............................................................................................... ibm2cray(3F) ..................................................... 360
ibm2cray(3F) ............................................................................................... ibm2cray(3F) ..................................................... 360
IBM2CRI(3F) ................................................................................................. cri2ibm(3F)........................................................ 343
ibm2cri(3F) ................................................................................................. cri2ibm(3F)........................................................ 343
ICAMAX(3F) .................................................................................................... isamax(3F) .......................................................... 562
icamax(3F) .................................................................................................... isamax(3F) .......................................................... 562
ICEIL(3F) ...................................................................................................... iceil(3F) ............................................................ 487
iceil(3F) ...................................................................................................... iceil(3F) ............................................................ 487
ICPUSED(3F) ................................................................................................. icpused(3F)........................................................ 488
icpused(3F) ................................................................................................. icpused(3F)........................................................ 488
IEC2CRAY(3F) ............................................................................................... cry2cri(3F)........................................................ 349
iec2cray(3F) ............................................................................................... cry2cri(3F)........................................................ 349
IEEE conversion routines ................................................................................ intro_conversion(3F) .................................. 327
IEEE floating-point to Cray conversion .......................................................... cry2cri(3F)........................................................ 349
IEEE floating-point to Cray conversion .......................................................... cry2mips(3F) ..................................................... 352
IEEE to Cray conversion ................................................................................ cri2cray(3F) ..................................................... 340
IEEE to Cray conversion ................................................................................ ieg2cray(3F) ..................................................... 363
IEEE to Cray conversion ................................................................................ ieg2cri_77(3F) ................................................ 366
IEEE to Cray conversion ................................................................................ ieu2cray(3F) ..................................................... 372
IEG2CRAY(3F) ............................................................................................... ieg2cray(3F) ..................................................... 363
ieg2cray(3F) ............................................................................................... ieg2cray(3F) ..................................................... 363
IEG2CRI(3F) ................................................................................................. cri2ieg(3F)........................................................ 346
ieg2cri(3F) ................................................................................................. cri2ieg(3F)........................................................ 346
IEG2CRI_77(3F) .......................................................................................... ieg2cri_77(3F) ................................................ 366
ieg2cri_77(3F) .......................................................................................... ieg2cri_77(3F) ................................................ 366
IEG2MIPS(3F) ............................................................................................... ieg2mips(3F) ..................................................... 369
ieg2mips(3F) ............................................................................................... ieg2mips(3F) ..................................................... 369
IEU2CRAY(3F) ............................................................................................... ieu2cray(3F) ..................................................... 372
ieu2cray(3F) ............................................................................................... ieu2cray(3F) ..................................................... 372
IGTBYT(3F) .................................................................................................... byt(3F) ................................................................. 479
igtbyt(3F) .................................................................................................... byt(3F) ................................................................. 479
IHPLEN(3F) .................................................................................................... ihplen(3F) .......................................................... 457
ihplen(3F) .................................................................................................... ihplen(3F) .......................................................... 457
IHPVALID(3F) ............................................................................................... ihpvalid(3F) ..................................................... 458
ihpvalid(3F) ............................................................................................... ihpvalid(3F) ..................................................... 458
IILZ(3F) ........................................................................................................ iilz(3F)............................................................... 557
iilz(3F) ........................................................................................................ iilz(3F)............................................................... 557
ILLZ(3F) ........................................................................................................ iilz(3F)............................................................... 557
illz(3F) ........................................................................................................ iilz(3F)............................................................... 557
ILSUM(3F) ...................................................................................................... iilz(3F)............................................................... 557
ilsum(3F) ...................................................................................................... iilz(3F)............................................................... 557
Increase heap block ......................................................................................... hpnewlen(3F) ..................................................... 455
INFLMAX(3F) ................................................................................................. inflmax(3F)........................................................ 559
inflmax(3F) ................................................................................................. inflmax(3F)........................................................ 559
INFLMIN(3F) ................................................................................................. inflmax(3F)........................................................ 559
inflmin(3F) ................................................................................................. inflmax(3F)........................................................ 559
Initialize table .................................................................................................. tminit(3F) .......................................................... 462
Initializes table descriptor vector and zeroes table length vector ................... tminit(3F) .......................................................... 462
Initiates a detailed tracing of each call and return ......................................... setplimq(3F) ..................................................... 503
Inode numbers ................................................................................................. samefile(3F) ..................................................... 440

Index-10 004– 2165– 002


INT6064(3F) ................................................................................................. int6064(3F)........................................................ 375
int6064(3F) ................................................................................................. int6064(3F)........................................................ 375
INT6460(3F) ................................................................................................. int6460(3F)........................................................ 376
int6460(3F) ................................................................................................. int6460(3F)........................................................ 376
Integer ceiling value ........................................................................................ iceil(3F) ............................................................ 487
Integer conversion (IEEE floating-point to Cray) ........................................... cry2cri(3F)........................................................ 349
Integer conversion (IEEE floating-point to Cray) ........................................... cry2mips(3F) ..................................................... 352
Integer conversion (IEEE floating-point to MIPS) ......................................... ieg2mips(3F) ..................................................... 369
Integer conversion (IEEE floating-point to MIPS) ......................................... vax2mips(3F) ..................................................... 396
Integer conversion (IEEE to Cray) ................................................................. cri2cray(3F) ..................................................... 340
Integer conversion (IEEE to Cray) ................................................................. ieg2cray(3F) ..................................................... 363
Integer conversion (IEEE to Cray) ................................................................. ieg2cri_77(3F) ................................................ 366
Integer conversion (IEEE to Cray) ................................................................. ieu2cray(3F) ..................................................... 372
Integer from ASCII conversion ...................................................................... chconv(3F) .......................................................... 338
Integer to packed-decimal conversion ............................................................ usictp(3F) .......................................................... 387
INTEGER*2 to integer conversion ................................................................. usictc(3F) .......................................................... 385
INTEGER*4 to integer conversion ................................................................. usictc(3F) .......................................................... 385
Integrity of heap check ................................................................................... hpcheck(3F)........................................................ 451
Interface ........................................................................................................... cinter(3F) .......................................................... 615
Internal, fixed-length record-sorting routine optimized for Cray Research
systems ............................................................................................................ orders(3F) .......................................................... 581
Interrupt status for floating-point errors .......................................................... clearfi(3F)........................................................ 421
INTMAX(3F) .................................................................................................... intmax(3F) .......................................................... 561
intmax(3F) .................................................................................................... intmax(3F) .......................................................... 561
INTMIN(3F) .................................................................................................... intmax(3F) .......................................................... 561
intmin(3F) .................................................................................................... intmax(3F) .......................................................... 561
Intro ................................................................................................................. intro_interface(3F) ..................................... 417
intro3(3F) .................................................................................................... intro_conversion(3F) .................................. 327
intro4(3F) .................................................................................................... intro_heap(3F) ................................................ 445
intro7(3F) .................................................................................................... intro_progaids(3F) ....................................... 469
intro8(3F) .................................................................................................... intro_interface(3F) ..................................... 417
INTRO_CONVERSION(3F) ............................................................................ intro_conversion(3F) .................................. 327
intro_conversion(3F) ............................................................................ intro_conversion(3F) .................................. 327
Introduction to conversion routines ................................................................ intro_conversion(3F) .................................. 327
Introduction to heap, table, and data segment management ........................... intro_heap(3F) ................................................ 445
Introduction to interfaces to C library routines .............................................. cinter(3F) .......................................................... 615
Introduction to programming aids ................................................................... intro_progaids(3F) ....................................... 469
Introduction to sorting and searching routines ............................................... intro_sortsearch(3F) .................................. 547
Introduction to synchronization routines ......................................................... intro_sync(3F) ................................................ 535
Introduction to system interface routines ........................................................ intro_interface(3F) ..................................... 417
INTRO_HEAP(3F) .......................................................................................... intro_heap(3F) ................................................ 445
intro_heap(3F) .......................................................................................... intro_heap(3F) ................................................ 445
INTRO_INTERFACE(3F) .............................................................................. intro_interface(3F) ..................................... 417
intro_interface(3F) .............................................................................. intro_interface(3F) ..................................... 417
INTRO_PROGAIDS(3F) ................................................................................. intro_progaids(3F) ....................................... 469
intro_progaids(3F) ................................................................................. intro_progaids(3F) ....................................... 469
INTRO_SORTSEARCH(3F) ............................................................................ intro_sortsearch(3F) .................................. 547
intro_sortsearch(3F) ............................................................................ intro_sortsearch(3F) .................................. 547
INTRO_SYNC(3F) .......................................................................................... intro_sync(3F) ................................................ 535
intro_sync(3F) .......................................................................................... intro_sync(3F) ................................................ 535

004– 2165– 002 Index-11


ISAMAX(3F) .................................................................................................... isamax(3F) .......................................................... 562
isamax(3F) .................................................................................................... isamax(3F) .......................................................... 562
ISAMIN(3F) .................................................................................................... isamax(3F) .......................................................... 562
isamin(3F) .................................................................................................... isamax(3F) .......................................................... 562
ISHELL(3F) .................................................................................................... ishell(3F) .......................................................... 431
ishell(3F) .................................................................................................... ishell(3F) .......................................................... 431
ISMAX(3F) ...................................................................................................... ismax(3F) ............................................................ 564
ismax(3F) ...................................................................................................... ismax(3F) ............................................................ 564
ISMIN(3F) ...................................................................................................... ismax(3F) ............................................................ 564
ismin(3F) ...................................................................................................... ismax(3F) ............................................................ 564
ISORTB(3F) .................................................................................................... ssortb(3F) .......................................................... 598
isortb(3F) .................................................................................................... ssortb(3F) .......................................................... 598
ISORTD(3F) .................................................................................................... isortd(3F) .......................................................... 566
isortd(3F) .................................................................................................... isortd(3F) .......................................................... 566
ISRCHEQ(3F) ................................................................................................. isrcheq(3F)........................................................ 571
isrcheq(3F) ................................................................................................. isrcheq(3F)........................................................ 571
ISRCHFGE(3F) ............................................................................................... isrchflt(3F) ..................................................... 573
isrchfge(3F) ............................................................................................... isrchflt(3F) ..................................................... 573
ISRCHFGT(3F) ............................................................................................... isrchflt(3F) ..................................................... 573
isrchfgt(3F) ............................................................................................... isrchflt(3F) ..................................................... 573
ISRCHFLE(3F) ............................................................................................... isrchflt(3F) ..................................................... 573
isrchfle(3F) ............................................................................................... isrchflt(3F) ..................................................... 573
ISRCHFLT(3F) ............................................................................................... isrchflt(3F) ..................................................... 573
isrchflt(3F) ............................................................................................... isrchflt(3F) ..................................................... 573
ISRCHIGE(3F) ............................................................................................... isrchilt(3F) ..................................................... 575
isrchige(3F) ............................................................................................... isrchilt(3F) ..................................................... 575
ISRCHIGT(3F) ............................................................................................... isrchilt(3F) ..................................................... 575
isrchigt(3F) ............................................................................................... isrchilt(3F) ..................................................... 575
ISRCHILE(3F) ............................................................................................... isrchilt(3F) ..................................................... 575
isrchile(3F) ............................................................................................... isrchilt(3F) ..................................................... 575
ISRCHILT(3F) ............................................................................................... isrchilt(3F) ..................................................... 575
isrchilt(3F) ............................................................................................... isrchilt(3F) ..................................................... 575
ISRCHMEQ(3F) ............................................................................................... isrchmeq(3F) ..................................................... 577
isrchmeq(3F) ............................................................................................... isrchmeq(3F) ..................................................... 577
ISRCHMGE(3F) ............................................................................................... isrchmlt(3F) ..................................................... 579
isrchmge(3F) ............................................................................................... isrchmlt(3F) ..................................................... 579
ISRCHMGT(3F) ............................................................................................... isrchmlt(3F) ..................................................... 579
isrchmgt(3F) ............................................................................................... isrchmlt(3F) ..................................................... 579
ISRCHMLE(3F) ............................................................................................... isrchmlt(3F) ..................................................... 579
isrchmle(3F) ............................................................................................... isrchmlt(3F) ..................................................... 579
ISRCHMLT(3F) ............................................................................................... isrchmlt(3F) ..................................................... 579
isrchmlt(3F) ............................................................................................... isrchmlt(3F) ..................................................... 579
ISRCHMNE(3F) ............................................................................................... isrchmeq(3F) ..................................................... 577
isrchmne(3F) ............................................................................................... isrchmeq(3F) ..................................................... 577
ISRCHNE(3F) ................................................................................................. isrcheq(3F)........................................................ 571
isrchne(3F) ................................................................................................. isrcheq(3F)........................................................ 571
Large radix sorting .......................................................................................... orders(3F) .......................................................... 581
Leading elements in a vector .......................................................................... iilz(3F)............................................................... 557
Length of block change .................................................................................. hpclmove(3F) ..................................................... 452
Length of character argument ......................................................................... trimlen(3F)........................................................ 524

Index-12 004– 2165– 002


Length of heap block ...................................................................................... ihplen(3F) .......................................................... 457
List calling sequence ....................................................................................... trbk(3F)............................................................... 520
List exchange package .................................................................................... xpfmt(3F) ............................................................ 532
List subroutines ............................................................................................... trbk(3F)............................................................... 520
Lists all subroutines active in the current calling sequence ........................... trbk(3F)............................................................... 520
Locate table field ............................................................................................. tmsrc(3F) ............................................................ 467
Lock routines (UNICOS/mk) .......................................................................... intro_sync(3F) ................................................ 535
Logical conversion .......................................................................................... cri2cray(3F) ..................................................... 340
Logical conversion .......................................................................................... ieg2cray(3F) ..................................................... 363
Logical conversion .......................................................................................... ieg2cri_77(3F) ................................................ 366
Logical conversion .......................................................................................... ieu2cray(3F) ..................................................... 372
LOGICAL*1 to Cray logical conversion ........................................................ uslctc(3F) .......................................................... 388
LOGICAL*4 to Cray logical conversion ........................................................ uslctc(3F) .......................................................... 388
machine types .................................................................................................. getpmc(3F) .......................................................... 485
Management routines ...................................................................................... intro_heap(3F) ................................................ 445
Maximum ........................................................................................................ intro_sortsearch(3F) .................................. 547
Maximum absolute value in a vector .............................................................. isamax(3F) .......................................................... 562
Maximum value in a vector ............................................................................ inflmax(3F)........................................................ 559
Maximum value in a vector ............................................................................ intmax(3F) .......................................................... 561
Maximum value in a vector ............................................................................ ismax(3F) ............................................................ 564
Memory allocation (heap) ............................................................................... hpalloc(3F)........................................................ 450
Memory dump ................................................................................................. craydump(3F) ..................................................... 449
Memory interface ............................................................................................ hpshrink(3F) ..................................................... 456
Memory move ................................................................................................. tmmve(3F) ............................................................ 464
Memory table allocation ................................................................................. tmats(3F) ............................................................ 461
Memory to heap return ................................................................................... hpdeallc(3F) ..................................................... 453
Memory to operating system .......................................................................... hpshrink(3F) ..................................................... 456
Merge exchange sort ....................................................................................... ssortb(3F) .......................................................... 598
Merge sort ....................................................................................................... ssortb(3F) .......................................................... 598
Minimum ......................................................................................................... intro_sortsearch(3F) .................................. 547
Minimum absolute value in a vector .............................................................. isamax(3F) .......................................................... 562
Minimum value in a vector ............................................................................. inflmax(3F)........................................................ 559
Minimum value in a vector ............................................................................. intmax(3F) .......................................................... 561
Minimum value in a vector ............................................................................. ismax(3F) ............................................................ 564
MIPS2CRY(3F) ............................................................................................... cry2mips(3F) ..................................................... 352
mips2cry(3F) ............................................................................................... cry2mips(3F) ..................................................... 352
MIPS2IEG(3F) ............................................................................................... ieg2mips(3F) ..................................................... 369
MIPS2VAX(3F) ............................................................................................... vax2mips(3F) ..................................................... 396
Modifies floating-point interrupt status ........................................................... clearfi(3F)........................................................ 421
Modify heap block .......................................................................................... hpnewlen(3F) ..................................................... 455
mov(3F) ........................................................................................................... mov(3F) ................................................................. 489
MOVBIT(3F) .................................................................................................... mov(3F) ................................................................. 489
movbit(3F) .................................................................................................... mov(3F) ................................................................. 489
MOVBITZ(3F) ................................................................................................. mov(3F) ................................................................. 489
movbitz(3F) ................................................................................................. mov(3F) ................................................................. 489
Move block ..................................................................................................... hpclmove(3F) ..................................................... 452
Move bytes or bits .......................................................................................... mov(3F) ................................................................. 489
Move characters .............................................................................................. mvc(3F) ................................................................. 493
Move memory words ...................................................................................... tmmve(3F) ............................................................ 464
Moves bytes or bits from one variable or array to another ............................ mov(3F) ................................................................. 489

004– 2165– 002 Index-13


Moves characters from one memory area to another ..................................... mvc(3F) ................................................................. 493
Moves memory (words) .................................................................................. tmmve(3F) ............................................................ 464
MTTS(3F) ........................................................................................................ mtts(3F)............................................................... 492
mtts(3F) ........................................................................................................ mtts(3F)............................................................... 492
Multipass sorting ............................................................................................. orders(3F) .......................................................... 581
Multitasking (delay of calling task) ................................................................ wait_event(3C) ................................................ 545
Multitasking (event clear) ............................................................................... clear_event(3C) .............................................. 536
Multitasking event test .................................................................................... test_event(3C) ................................................ 543
Multitasking (posting events) .......................................................................... set_event(3C) .................................................. 540
Multitasking synchronizes task at barrier ....................................................... wait_barrier(3C) ........................................... 544
Multitasking test barrier .................................................................................. test_barrier(3C) ........................................... 542
MVC(3F) ........................................................................................................... mvc(3F) ................................................................. 493
mvc(3F) ........................................................................................................... mvc(3F) ................................................................. 493
Name ............................................................................................................... uname(3F) ............................................................ 442
NLIMIT(3F) .................................................................................................... nlimit(3F) .......................................................... 432
nlimit(3F) .................................................................................................... nlimit(3F) .......................................................... 432
NOS/VE to Cray conversion ........................................................................... nve2cray(3F) ..................................................... 377
Null to trailing blank conversion .................................................................... rbn(3F) ................................................................. 380
Number of arguments ..................................................................................... iargc(3F) ............................................................ 430
Numerals to integer conversion ...................................................................... chconv(3F) .......................................................... 338
Numeric conversion routines .......................................................................... intro_conversion(3F) .................................. 327
NVE2CRAY(3F) ............................................................................................... nve2cray(3F) ..................................................... 377
nve2cray(3F) ............................................................................................... nve2cray(3F) ..................................................... 377
Octal from binary conversion ......................................................................... b2oct(3F) ............................................................ 333
Operating system name ................................................................................... uname(3F) ............................................................ 442
Ordered vector search ..................................................................................... osrchi(3F) .......................................................... 592
Ordered vector search ..................................................................................... osrchm(3F) .......................................................... 594
ORDERS(3F) .................................................................................................... orders(3F) .......................................................... 581
orders(3F) .................................................................................................... orders(3F) .......................................................... 581
OSRCHF(3F) .................................................................................................... osrchi(3F) .......................................................... 592
osrchf(3F) .................................................................................................... osrchi(3F) .......................................................... 592
OSRCHI(3F) .................................................................................................... osrchi(3F) .......................................................... 592
osrchi(3F) .................................................................................................... osrchi(3F) .......................................................... 592
OSRCHM(3F) .................................................................................................... osrchm(3F) .......................................................... 594
osrchm(3F) .................................................................................................... osrchm(3F) .......................................................... 594
P32(3F) ........................................................................................................... p32(3F) ................................................................. 496
p32(3F) ........................................................................................................... p32(3F) ................................................................. 496
P6460(3F) ...................................................................................................... p6460(3F) ............................................................ 497
p6460(3F) ...................................................................................................... p6460(3F) ............................................................ 497
Pack 64 into 60 bits ........................................................................................ p6460(3F) ............................................................ 497
Pack data ......................................................................................................... pack(3F)............................................................... 494
Pack from 64 to 32 bits .................................................................................. p32(3F) ................................................................. 496
PACK(3F) ........................................................................................................ pack(3F)............................................................... 494
pack(3F) ........................................................................................................ pack(3F)............................................................... 494
Packed decimal conversion ............................................................................. uspctc(3F) .......................................................... 389
Packed decimal to integer conversion ............................................................ uspctc(3F) .......................................................... 389
Packs or unpacks 32-bit words into or from Cray 64-bit words .................... p32(3F) ................................................................. 496
Packs or unpacks 60-bit words into or from Cray 64-bit words .................... p6460(3F) ............................................................ 497
Pascal snapshot dump ..................................................................................... symdump(3F)........................................................ 511
Performs a distribution counting sort on the elements of an integer vector .. isortd(3F) .......................................................... 566

Index-14 004– 2165– 002


Performs Batcher’s Odd-Even Merge sort on the elements of a real or
integer general vector ...................................................................................... ssortb(3F) .......................................................... 598
Places an octal Hollerith representation of a Cray Research numeric value
into a specified part of an integer array .......................................................... b2oct(3F) ............................................................ 333
Posts an event and returns control to the calling PE ...................................... set_event(3C) .................................................. 540
Presets table space .......................................................................................... tmpts(3F) ............................................................ 466
primary machine types .................................................................................... getpmc(3F) .......................................................... 485
Print exchange package ................................................................................... xpfmt(3F) ............................................................ 532
Prints a traceback ............................................................................................ tracebk(3F)........................................................ 518
Processes table collisions ................................................................................ tmptc(3F) ............................................................ 465
Processing elements stop all ........................................................................... stop_all(3F) ..................................................... 507
Produce symbolic dump .................................................................................. symdebug(3F) ..................................................... 508
Produces a printable image of an exchange package ..................................... xpfmt(3F) ............................................................ 532
Produces a symbolic snapshot dump of a running program ........................... symdump(3F)........................................................ 511
Produces a symbolic snapshot of a running process ...................................... symdebug(3F) ..................................................... 508
Program exit .................................................................................................... exit(3F)............................................................... 423
Program recovery ............................................................................................ shutdsav(3F) ..................................................... 504
Program time in CPU ..................................................................................... tsecnd(3F) .......................................................... 526
Provides an interface to setting or obtaining resource limit values ............... nlimit(3F) .......................................................... 432
PUTBYT(3F) .................................................................................................... byt(3F) ................................................................. 479
putbyt(3F) .................................................................................................... byt(3F) ................................................................. 479
Quit program ................................................................................................... exit(3F)............................................................... 423
RBN(3F) ........................................................................................................... rbn(3F) ................................................................. 380
rbn(3F) ........................................................................................................... rbn(3F) ................................................................. 380
Read SDS count .............................................................................................. auxstat(3F)........................................................ 473
Real conversion from VAX 32-bit ................................................................. vxsctc(3F) .......................................................... 410
Real conversion VAX G to Cray .................................................................... vxgctc(3F) .......................................................... 402
Real-time clock ............................................................................................... secondr(3F)........................................................ 502
Real-time clock routine (Fortran) ................................................................... icpused(3F)........................................................ 488
Real-time clock value ..................................................................................... sysclock(3F) ..................................................... 516
Registers the arrival of a PE at a barrier ........................................................ set_barrier(3C) .............................................. 539
Release version ............................................................................................... uname(3F) ............................................................ 442
REMARK2(3F) ................................................................................................. remark(3F) .......................................................... 437
remark2(3F) ................................................................................................. remark(3F) .......................................................... 437
REMARK(3F) .................................................................................................... remark(3F) .......................................................... 437
remark(3F) .................................................................................................... remark(3F) .......................................................... 437
REMARKF(3F) ................................................................................................. remarkf(3F)........................................................ 438
remarkf(3F) ................................................................................................. remarkf(3F)........................................................ 438
Replace byte .................................................................................................... byt(3F) ................................................................. 479
Replaces a byte in a variable or an array ....................................................... byt(3F) ................................................................. 479
Report table statistics ...................................................................................... tmamu(3F) ............................................................ 460
Reports table management operation statistics ............................................... tmamu(3F) ............................................................ 460
REPRIEVE(3F) ............................................................................................... reprieve(3F) ..................................................... 498
reprieve(3F) ............................................................................................... reprieve(3F) ..................................................... 498
Requests abort ................................................................................................. errexit(3F)........................................................ 422
Requests abort with traceback ........................................................................ abort(3F) ............................................................ 419
Resource limits ................................................................................................ nlimit(3F) .......................................................... 432
Restart program ............................................................................................... shutdsav(3F) ..................................................... 504
restorfi(3F) ............................................................................................... clearfi(3F)........................................................ 421
Return memory to heap .................................................................................. hpdeallc(3F) ..................................................... 453

004– 2165– 002 Index-15


Return message to user and system ................................................................ remarkf(3F)........................................................ 438
Returns 128-word output array describing machine characteristics ............... getpmc(3F) .......................................................... 485
Returns a block of memory to the list of available space (the heap) ............ hpdeallc(3F) ..................................................... 453
returns caller name .......................................................................................... getcallerinfo(3F) ......................................... 483
Returns elapsed CPU time .............................................................................. second(3F) .......................................................... 500
Returns elapsed CPU time for a calling task or process ................................ tsecnd(3F) .......................................................... 526
Returns elapsed wall-clock time in milliseconds since the previous call
to TIMEF ........................................................................................................ timef(3F) ............................................................ 517
Returns elapsed wall-clock time in seconds ................................................... secondr(3F)........................................................ 502
Returns information on current level of calling sequence .............................. trbklvl(3F)........................................................ 521
Returns integer ceiling of a rational number .................................................. iceil(3F) ............................................................ 487
Returns memory from the heap to the operating system ................................ hpshrink(3F) ..................................................... 456
Returns name of current operating system (Fortran interface to
uname(2)) ....................................................................................................... uname(3F) ............................................................ 442
Returns name of host mainframe .................................................................... gethost(3F)........................................................ 425
Returns number of command-line arguments or the argument itself ............. iargc(3F) ............................................................ 430
Returns number of leading occurrences of an object in a vector ................... iilz(3F)............................................................... 557
Returns real-time clock value and number of wraps ...................................... sysclock(3F) ..................................................... 516
Returns the CPU time (in seconds of type real) remaining for the
program ........................................................................................................... tremain(3F)........................................................ 523
Returns the current working directory ............................................................ getcwd(3F) .......................................................... 424
Returns the length of a character argument without counting trailing
blanks .............................................................................................................. trimlen(3F)........................................................ 524
Returns the length of a heap block ................................................................. ihplen(3F) .......................................................... 457
Returns the name and line number of the calling routine .............................. getcallerinfo(3F) ......................................... 483
Returns the state of an event, either posted or cleared .................................. test_event(3C) ................................................ 543
Returns time-stamp units in specified standard-time units ............................. unitts(3F) .......................................................... 530
Returns validity of block address ................................................................... ihpvalid(3F) ..................................................... 458
RNB(3F) ........................................................................................................... rbn(3F) ................................................................. 380
rnb(3F) ........................................................................................................... rbn(3F) ................................................................. 380
SAMEFILE(3F) ............................................................................................... samefile(3F) ..................................................... 440
samefile(3F) ............................................................................................... samefile(3F) ..................................................... 440
SDS read and write count ............................................................................... auxstat(3F)........................................................ 473
Search table ..................................................................................................... tmmsc(3F) ............................................................ 463
Search vector table .......................................................................................... tmvsc(3F) ............................................................ 468
search(3F) .................................................................................................... intro_sortsearch(3F) .................................. 547
Searches a real vector for all elements with a specified logical
relationship to a real target ............................................................................. whenflt(3F)........................................................ 607
Searches a real vector for clusters of values with a specified logical
relationship to a real target ............................................................................. clusflt(3F)........................................................ 553
Searches a real vector for the first element with a specified logical
relationship to a real target ............................................................................. isrchflt(3F) ..................................................... 573
Searches a real vector for the first occurrence of the maximum or
minimum value ............................................................................................... ismax(3F) ............................................................ 564
Searches a vector for all elements equal or not equal to a target .................. wheneq(3F) .......................................................... 605
Searches a vector for all elements whose subfields are equal or not equal
to a target ........................................................................................................ whenmeq(3F)........................................................ 611
Searches a vector for all elements whose subfields have a specified
logical relationship with a target .................................................................... whenmlt(3F)........................................................ 613
Searches a vector for clusters of values equal or not equal to a target ......... cluseq(3F) .......................................................... 551

Index-16 004– 2165– 002


Searches a vector for the first element equal or not equal to a target ........... isrcheq(3F)........................................................ 571
Searches a vector for the first element whose subfield has a specified
logical relationship with a target .................................................................... isrchmlt(3F) ..................................................... 579
Searches a vector for the first element whose subfield is equal or not
equal to a target .............................................................................................. isrchmeq(3F) ..................................................... 577
Searches a vector for the first occurrence of the maximum or minimum
absolute value .................................................................................................. isamax(3F) .......................................................... 562
Searches a vector table for the search argument ............................................ tmvsc(3F) ............................................................ 468
Searches an integer vector for all elements that have a specified
relationship to an integer target ...................................................................... whenilt(3F)........................................................ 609
Searches an integer vector for clusters of values with a specified logical
relationship to an integer target ...................................................................... clusilt(3F)........................................................ 555
Searches an integer vector for the first element with a specified logical
relationship to an integer target ...................................................................... isrchilt(3F) ..................................................... 575
Searches an integer vector for the maximum or minimum value .................. intmax(3F) .......................................................... 561
Searches an ordered integer vector for the first element whose subfield is
equal to an integer target ................................................................................ osrchm(3F) .......................................................... 594
Searches an ordered vector for the first location that contains a target ......... osrchi(3F) .......................................................... 592
Searches for the maximum or minimum value in subfields of a vector
element ............................................................................................................ inflmax(3F)........................................................ 559
Searches the table by using a mask to locate a specific field within an
entry using an optional offset ......................................................................... tmmsc(3F) ............................................................ 463
Searches the table by using optional mask to locate specific field within
entry and offset ............................................................................................... tmsrc(3F) ............................................................ 467
SECOND(3F) .................................................................................................... second(3F) .......................................................... 500
second(3F) .................................................................................................... second(3F) .......................................................... 500
SECONDR(3F) ................................................................................................. secondr(3F)........................................................ 502
secondr(3F) ................................................................................................. secondr(3F)........................................................ 502
SENSEBT(3F) ................................................................................................. sensebt(3F)........................................................ 441
sensebt(3F) ................................................................................................. sensebt(3F)........................................................ 441
SENSEFI(3F) ................................................................................................. clearfi(3F)........................................................ 421
sensefi(3F) ................................................................................................. clearfi(3F)........................................................ 421
SET_BARRIER(3C) ....................................................................................... set_barrier(3C) .............................................. 539
set_barrier(3C) ....................................................................................... set_barrier(3C) .............................................. 539
SETBT(3F) ...................................................................................................... clearbt(3F)........................................................ 420
setbt(3F) ...................................................................................................... clearbt(3F)........................................................ 420
set_event(3C) ............................................................................................ set_event(3C) .................................................. 540
SETFI(3F) ...................................................................................................... clearfi(3F)........................................................ 421
setfi(3F) ...................................................................................................... clearfi(3F)........................................................ 421
SETPLIMQ(3F) ............................................................................................... setplimq(3F) ..................................................... 503
setplimq(3F) ............................................................................................... setplimq(3F) ..................................................... 503
Sets up the calling program to be checkpointed on system shutdown ........... shutdsav(3F) ..................................................... 504
Shell command (execute) ................................................................................ ishell(3F) .......................................................... 431
Shutdown of program ..................................................................................... shutdsav(3F) ..................................................... 504
SHUTDSAV(3F) ............................................................................................... shutdsav(3F) ..................................................... 504
shutdsav(3F) ............................................................................................... shutdsav(3F) ..................................................... 504
SIG environment variables .............................................................................. reprieve(3F) ..................................................... 498
Signal action (Fortran) .................................................................................... fsigctl(3F)........................................................ 481
Signal control (Fortran) ................................................................................... sigoff(3F) .......................................................... 506
Signal routines ................................................................................................. intro_progaids(3F) ....................................... 469

004– 2165– 002 Index-17


SIGOFF(3F) .................................................................................................... sigoff(3F) .......................................................... 506
sigoff(3F) .................................................................................................... sigoff(3F) .......................................................... 506
SIGON(3F) ...................................................................................................... sigoff(3F) .......................................................... 506
sigon(3F) ...................................................................................................... sigoff(3F) .......................................................... 506
Single-precision ............................................................................................... usdcti(3F) .......................................................... 384
Snapshot dump ................................................................................................ symdump(3F)........................................................ 511
Sort .................................................................................................................. intro_sortsearch(3F) .................................. 547
Sort .................................................................................................................. isortd(3F) .......................................................... 566
Sort .................................................................................................................. orders(3F) .......................................................... 581
Sort .................................................................................................................. ssortb(3F) .......................................................... 598
Space for table ................................................................................................ tmpts(3F) ............................................................ 466
Specifies action on receipt of signal ............................................................... fsigctl(3F)........................................................ 481
SSORTB(3F) .................................................................................................... ssortb(3F) .......................................................... 598
ssortb(3F) .................................................................................................... ssortb(3F) .......................................................... 598
Stamp time to ASCII ...................................................................................... tsdt(3F)............................................................... 528
Standard time .................................................................................................. unitts(3F) .......................................................... 530
Statistics table management ............................................................................ tmamu(3F) ............................................................ 460
Status of floating-point interrupts ................................................................... clearfi(3F)........................................................ 421
Stderr message from user ................................................................................ remarkf(3F)........................................................ 438
Stderr message (from user) ............................................................................. remark(3F) .......................................................... 437
Stop Fortran program ...................................................................................... exit(3F)............................................................... 423
STOP_ALL(3F) ............................................................................................... stop_all(3F) ..................................................... 507
stop_all(3F) ............................................................................................... stop_all(3F) ..................................................... 507
Stops all PEs in an application ....................................................................... stop_all(3F) ..................................................... 507
STRMOV(3F) .................................................................................................... mov(3F) ................................................................. 489
strmov(3F) .................................................................................................... mov(3F) ................................................................. 489
Subfield ........................................................................................................... inflmax(3F)........................................................ 559
Subfield ........................................................................................................... isrchmeq(3F) ..................................................... 577
Subfield ........................................................................................................... isrchmlt(3F) ..................................................... 579
Subfield ........................................................................................................... osrchm(3F) .......................................................... 594
Subfield ........................................................................................................... whenmeq(3F)........................................................ 611
Subfield ........................................................................................................... whenmlt(3F)........................................................ 613
Subroutine listing ............................................................................................ trbk(3F)............................................................... 520
Suspends PE execution until all PEs arrive at the barrier .............................. wait_barrier(3C) ........................................... 544
Symbolic dump program ................................................................................. symdebug(3F) ..................................................... 508
SYMDEBUG(3F) ............................................................................................... symdebug(3F) ..................................................... 508
symdebug(3F) ............................................................................................... symdebug(3F) ..................................................... 508
SYMDUMP(3F) ................................................................................................. symdump(3F)........................................................ 511
symdump(3F) ................................................................................................. symdump(3F)........................................................ 511
Synchronization (introduction) ........................................................................ intro_sync(3F) ................................................ 535
Synchronize multitasking ................................................................................ set_barrier(3C) .............................................. 539
Synchronize multitasking ................................................................................ wait_barrier(3C) ........................................... 544
SYSCLOCK(3F) ............................................................................................... sysclock(3F) ..................................................... 516
sysclock(3F) ............................................................................................... sysclock(3F) ..................................................... 516
System errors .................................................................................................. reprieve(3F) ..................................................... 498
System interface .............................................................................................. intro_interface(3F) ..................................... 417
Table (add word to) ........................................................................................ tmadw(3F) ............................................................ 459
Table Base Address ........................................................................................ tminit(3F) .......................................................... 462
Table descriptor vector ................................................................................... tminit(3F) .......................................................... 462
Table initialization .......................................................................................... tminit(3F) .......................................................... 462

Index-18 004– 2165– 002


Table Length Table ......................................................................................... tminit(3F) .......................................................... 462
Table management .......................................................................................... intro_heap(3F) ................................................ 445
Table management statistics ........................................................................... tmamu(3F) ............................................................ 460
Table search .................................................................................................... tmmsc(3F) ............................................................ 463
Table (search) .................................................................................................. tmsrc(3F) ............................................................ 467
Table search vector ......................................................................................... tmvsc(3F) ............................................................ 468
Table space ...................................................................................................... tmptc(3F) ............................................................ 465
Table space adjustmenets ................................................................................ tmptc(3F) ............................................................ 465
Table space allocation ..................................................................................... tmats(3F) ............................................................ 461
Table space collisions ..................................................................................... tmptc(3F) ............................................................ 465
Table space preset ........................................................................................... tmpts(3F) ............................................................ 466
task CPU time ................................................................................................. icpused(3F)........................................................ 488
Task (delay) .................................................................................................... wait_event(3C) ................................................ 545
Task routines (UNICOS/mk) .......................................................................... intro_sync(3F) ................................................ 535
Temporarily disables or enables bidirectional memory transfers ................... clearbt(3F)........................................................ 420
Terminate Fortran program ............................................................................. exit(3F)............................................................... 423
Test multitasking barrier ................................................................................. test_barrier(3C) ........................................... 542
Test multitasking event ................................................................................... test_event(3C) ................................................ 543
TEST_BARRIER(3C) ..................................................................................... test_barrier(3C) ........................................... 542
test_barrier(3C) ..................................................................................... test_barrier(3C) ........................................... 542
TEST_EVENT(3C) .......................................................................................... test_event(3C) ................................................ 543
test_event(3C) .......................................................................................... test_event(3C) ................................................ 543
Tests a barrier to determine its state (set or cleared) ..................................... test_barrier(3C) ........................................... 542
Time conversion .............................................................................................. dtts(3F)............................................................... 480
Time elapsed wall-clock ................................................................................. timef(3F) ............................................................ 517
Time in standard time ..................................................................................... unitts(3F) .......................................................... 530
Time limit ....................................................................................................... nlimit(3F) .......................................................... 432
Time to ASCII ................................................................................................ tsdt(3F)............................................................... 528
Time to time-stamp ......................................................................................... dtts(3F)............................................................... 480
TIMEF(3F) ...................................................................................................... timef(3F) ............................................................ 517
timef(3F) ...................................................................................................... timef(3F) ............................................................ 517
Time-stamp conversion ................................................................................... dtts(3F)............................................................... 480
Time-stamp units ............................................................................................. unitts(3F) .......................................................... 530
Timing routines ............................................................................................... timef(3F) ............................................................ 517
Timing routines ............................................................................................... tremain(3F)........................................................ 523
TMADW(3F) ...................................................................................................... tmadw(3F) ............................................................ 459
tmadw(3F) ...................................................................................................... tmadw(3F) ............................................................ 459
TMAMU(3F) ...................................................................................................... tmamu(3F) ............................................................ 460
tmamu(3F) ...................................................................................................... tmamu(3F) ............................................................ 460
TMATS(3F) ...................................................................................................... tmats(3F) ............................................................ 461
tmats(3F) ...................................................................................................... tmats(3F) ............................................................ 461
TMINIT(3F) .................................................................................................... tminit(3F) .......................................................... 462
tminit(3F) .................................................................................................... tminit(3F) .......................................................... 462
TMMSC(3F) ...................................................................................................... tmmsc(3F) ............................................................ 463
tmmsc(3F) ...................................................................................................... tmmsc(3F) ............................................................ 463
TMMVE(3F) ...................................................................................................... tmmve(3F) ............................................................ 464
tmmve(3F) ...................................................................................................... tmmve(3F) ............................................................ 464
TMPTC(3F) ...................................................................................................... tmptc(3F) ............................................................ 465
tmptc(3F) ...................................................................................................... tmptc(3F) ............................................................ 465
TMPTS(3F) ...................................................................................................... tmpts(3F) ............................................................ 466

004– 2165– 002 Index-19


tmpts(3F) ...................................................................................................... tmpts(3F) ............................................................ 466
TMSRC(3F) ...................................................................................................... tmsrc(3F) ............................................................ 467
tmsrc(3F) ...................................................................................................... tmsrc(3F) ............................................................ 467
TMVSC(3F) ...................................................................................................... tmvsc(3F) ............................................................ 468
tmvsc(3F) ...................................................................................................... tmvsc(3F) ............................................................ 468
Trace call ......................................................................................................... setplimq(3F) ..................................................... 503
Trace return ..................................................................................................... setplimq(3F) ..................................................... 503
Traceback level ............................................................................................... trbklvl(3F)........................................................ 521
Traceback print (Fortran) ................................................................................ tracebk(3F)........................................................ 518
Traceback routines .......................................................................................... intro_progaids(3F) ....................................... 469
TRACEBK variable ........................................................................................ reprieve(3F) ..................................................... 498
TRACEBK(3F) ................................................................................................. tracebk(3F)........................................................ 518
tracebk(3F) ................................................................................................. tracebk(3F)........................................................ 518
Tracing and timing routines ............................................................................ intro_progaids(3F) ....................................... 469
trackback ......................................................................................................... abort(3F) ............................................................ 419
Trailing blank to null conversion .................................................................... rbn(3F) ................................................................. 380
Trailing blanks not counted ............................................................................ trimlen(3F)........................................................ 524
Transfer bytes or bits ...................................................................................... mov(3F) ................................................................. 489
TRBK environment variables ......................................................................... reprieve(3F) ..................................................... 498
TRBK(3F) ........................................................................................................ trbk(3F)............................................................... 520
trbk(3F) ........................................................................................................ trbk(3F)............................................................... 520
TRBKLVL(3F) ................................................................................................. trbklvl(3F)........................................................ 521
trbklvl(3F) ................................................................................................. trbklvl(3F)........................................................ 521
TREMAIN(3F) ................................................................................................. tremain(3F)........................................................ 523
tremain(3F) ................................................................................................. tremain(3F)........................................................ 523
TRIMLEN(3F) ................................................................................................. trimlen(3F)........................................................ 524
trimlen(3F) ................................................................................................. trimlen(3F)........................................................ 524
TSDT(3F) ........................................................................................................ tsdt(3F)............................................................... 528
tsdt(3F) ........................................................................................................ tsdt(3F)............................................................... 528
TSECND(3F) .................................................................................................... tsecnd(3F) .......................................................... 526
tsecnd(3F) .................................................................................................... tsecnd(3F) .......................................................... 526
TSMT(3F) ........................................................................................................ tsmt(3F)............................................................... 529
tsmt(3F) ........................................................................................................ tsmt(3F)............................................................... 529
U32(3F) ........................................................................................................... p32(3F) ................................................................. 496
u32(3F) ........................................................................................................... p32(3F) ................................................................. 496
U6064(3F) ...................................................................................................... p6460(3F) ............................................................ 497
u6064(3F) ...................................................................................................... p6460(3F) ............................................................ 497
UNAME(3F) ...................................................................................................... uname(3F) ............................................................ 442
uname(3F) ...................................................................................................... uname(3F) ............................................................ 442
UNITTS(3F) .................................................................................................... unitts(3F) .......................................................... 530
unitts(3F) .................................................................................................... unitts(3F) .......................................................... 530
Unpack 60 into 64 bits ................................................................................... p6460(3F) ............................................................ 497
Unpack data .................................................................................................... unpack(3F) .......................................................... 531
Unpack from 32 to 64 bits .............................................................................. p32(3F) ................................................................. 496
UNPACK(3F) .................................................................................................... unpack(3F) .......................................................... 531
unpack(3F) .................................................................................................... unpack(3F) .......................................................... 531
USCCTC(3F) .................................................................................................... uscctc(3F) .......................................................... 381
uscctc(3F) .................................................................................................... uscctc(3F) .......................................................... 381
USCCTI(3F) .................................................................................................... uscctc(3F) .......................................................... 381
USDCTC(3F) .................................................................................................... usdctc(3F) .......................................................... 383

Index-20 004– 2165– 002


usdctc(3F) .................................................................................................... usdctc(3F) .......................................................... 383
USDCTI(3F) .................................................................................................... usdcti(3F) .......................................................... 384
usdcti(3F) .................................................................................................... usdcti(3F) .......................................................... 384
USICTC(3F) .................................................................................................... usictc(3F) .......................................................... 385
usictc(3F) .................................................................................................... usictc(3F) .......................................................... 385
USICTI(3F) .................................................................................................... usictc(3F) .......................................................... 385
usicti(3F) .................................................................................................... usictc(3F) .......................................................... 385
USICTP(3F) .................................................................................................... usictp(3F) .......................................................... 387
usictp(3F) .................................................................................................... usictp(3F) .......................................................... 387
USLCTC(3F) .................................................................................................... uslctc(3F) .......................................................... 388
uslctc(3F) .................................................................................................... uslctc(3F) .......................................................... 388
USLCTI(3F) .................................................................................................... uslctc(3F) .......................................................... 388
uslcti(3F) .................................................................................................... uslctc(3F) .......................................................... 388
USPCTC(3F) .................................................................................................... uspctc(3F) .......................................................... 389
uspctc(3F) .................................................................................................... uspctc(3F) .......................................................... 389
USSCTC(3F) .................................................................................................... ussctc(3F) .......................................................... 390
ussctc(3F) .................................................................................................... ussctc(3F) .......................................................... 390
USSCTI(3F) .................................................................................................... usscti(3F) .......................................................... 391
usscti(3F) .................................................................................................... usscti(3F) .......................................................... 391
Validity of block address ................................................................................ ihpvalid(3F) ..................................................... 458
Values in a subfield ........................................................................................ inflmax(3F)........................................................ 559
Values in a vector ........................................................................................... intmax(3F) .......................................................... 561
Variable bit or byte move ............................................................................... mov(3F) ................................................................. 489
Variable byte replace ...................................................................................... byt(3F) ................................................................. 479
VAX 32-bit floating-point to 64-bit single-precision ..................................... vxsctc(3F) .......................................................... 410
VAX 64-bit complex to Cray complex conversion ........................................ vxzctc(3F) .......................................................... 413
VAX 64-bit G format to single-precision conversion .................................... vxgctc(3F) .......................................................... 402
VAX conversion ............................................................................................. vxdctc(3F) .......................................................... 399
VAX integer to 64-bit integer conversion ...................................................... vxictc(3F) .......................................................... 405
VAX logical value to 64-bit logical value conversion ................................... vxlctc(3F) .......................................................... 408
VAX to Cray conversion ................................................................................ vax2cray(3F) ..................................................... 393
VAX2CRAY(3F) ............................................................................................... vax2cray(3F) ..................................................... 393
vax2cray(3F) ............................................................................................... vax2cray(3F) ..................................................... 393
VAX2MIPS(3F) ............................................................................................... vax2mips(3F) ..................................................... 396
vax2mips(3F) ............................................................................................... vax2mips(3F) ..................................................... 396
Vector search .................................................................................................. intro_sortsearch(3F) .................................. 547
Vector search .................................................................................................. cluseq(3F) .......................................................... 551
Vector search .................................................................................................. clusflt(3F)........................................................ 553
Vector search .................................................................................................. clusilt(3F)........................................................ 555
Vector search .................................................................................................. iilz(3F)............................................................... 557
Vector search .................................................................................................. isrcheq(3F)........................................................ 571
Vector search .................................................................................................. isrchflt(3F) ..................................................... 573
Vector search .................................................................................................. isrchilt(3F) ..................................................... 575
Vector search .................................................................................................. isrchmeq(3F) ..................................................... 577
Vector search .................................................................................................. isrchmlt(3F) ..................................................... 579
Vector search .................................................................................................. osrchi(3F) .......................................................... 592
Vector search .................................................................................................. osrchm(3F) .......................................................... 594
Vector search .................................................................................................. wheneq(3F) .......................................................... 605
Vector search .................................................................................................. whenflt(3F)........................................................ 607
Vector search .................................................................................................. whenilt(3F)........................................................ 609

004– 2165– 002 Index-21


Vector search .................................................................................................. whenmeq(3F)........................................................ 611
Vector search .................................................................................................. whenmlt(3F)........................................................ 613
Vector table search .......................................................................................... tmvsc(3F) ............................................................ 468
Vector-scalar comparison ................................................................................ bitvec(3F) .......................................................... 474
Vector-scalar comparison ................................................................................ bitvecm(3F)........................................................ 477
VXDCTC(3F) .................................................................................................... vxdctc(3F) .......................................................... 399
vxdctc(3F) .................................................................................................... vxdctc(3F) .......................................................... 399
VXDCTI(3F) .................................................................................................... vxdcti(3F) .......................................................... 400
vxdcti(3F) .................................................................................................... vxdcti(3F) .......................................................... 400
VXGCTC(3F) .................................................................................................... vxgctc(3F) .......................................................... 402
vxgctc(3F) .................................................................................................... vxgctc(3F) .......................................................... 402
VXGCTI(3F) .................................................................................................... vxgcti(3F) .......................................................... 403
vxgcti(3F) .................................................................................................... vxgcti(3F) .......................................................... 403
VXICTC(3F) .................................................................................................... vxictc(3F) .......................................................... 405
vxictc(3F) .................................................................................................... vxictc(3F) .......................................................... 405
VXICTI(3F) .................................................................................................... vxicti(3F) .......................................................... 406
vxicti(3F) .................................................................................................... vxicti(3F) .......................................................... 406
VXLCTC(3F) .................................................................................................... vxlctc(3F) .......................................................... 408
vxlctc(3F) .................................................................................................... vxlctc(3F) .......................................................... 408
VXLCTI(3F) .................................................................................................... vxlcti(3F) .......................................................... 409
vxlcti(3F) .................................................................................................... vxlcti(3F) .......................................................... 409
VXSCTC(3F) .................................................................................................... vxsctc(3F) .......................................................... 410
vxsctc(3F) .................................................................................................... vxsctc(3F) .......................................................... 410
VXSCTI(3F) .................................................................................................... vxscti(3F) .......................................................... 411
vxscti(3F) .................................................................................................... vxscti(3F) .......................................................... 411
VXZCTC(3F) .................................................................................................... vxzctc(3F) .......................................................... 413
vxzctc(3F) .................................................................................................... vxzctc(3F) .......................................................... 413
VXZCTI(3F) .................................................................................................... vxzcti(3F) .......................................................... 414
vxzcti(3F) .................................................................................................... vxzcti(3F) .......................................................... 414
WAIT_BARRIER(3C) ..................................................................................... wait_barrier(3C) ........................................... 544
wait_barrier(3C) ..................................................................................... wait_barrier(3C) ........................................... 544
WAIT_EVENT(3C) .......................................................................................... wait_event(3C) ................................................ 545
wait_event(3C) .......................................................................................... wait_event(3C) ................................................ 545
Wall-clock time function ................................................................................ timef(3F) ............................................................ 517
Watchpointing routines ................................................................................... intro_progaids(3F) ....................................... 469
WHENEQ(3F) .................................................................................................... wheneq(3F) .......................................................... 605
wheneq(3F) .................................................................................................... wheneq(3F) .......................................................... 605
WHENFGE(3F) ................................................................................................. whenflt(3F)........................................................ 607
whenfge(3F) ................................................................................................. whenflt(3F)........................................................ 607
WHENFGT(3F) ................................................................................................. whenflt(3F)........................................................ 607
whenfgt(3F) ................................................................................................. whenflt(3F)........................................................ 607
WHENFLE(3F) ................................................................................................. whenflt(3F)........................................................ 607
whenfle(3F) ................................................................................................. whenflt(3F)........................................................ 607
WHENFLT(3F) ................................................................................................. whenflt(3F)........................................................ 607
whenflt(3F) ................................................................................................. whenflt(3F)........................................................ 607
WHENIGE(3F) ................................................................................................. whenilt(3F)........................................................ 609
whenige(3F) ................................................................................................. whenilt(3F)........................................................ 609
WHENIGT(3F) ................................................................................................. whenilt(3F)........................................................ 609
whenigt(3F) ................................................................................................. whenilt(3F)........................................................ 609
WHENILE(3F) ................................................................................................. whenilt(3F)........................................................ 609

Index-22 004– 2165– 002


whenile(3F) ................................................................................................. whenilt(3F)........................................................ 609
WHENILT(3F) ................................................................................................. whenilt(3F)........................................................ 609
whenilt(3F) ................................................................................................. whenilt(3F)........................................................ 609
WHENMEQ(3F) ................................................................................................. whenmeq(3F)........................................................ 611
whenmeq(3F) ................................................................................................. whenmeq(3F)........................................................ 611
WHENMGE(3F) ................................................................................................. whenmlt(3F)........................................................ 613
whenmge(3F) ................................................................................................. whenmlt(3F)........................................................ 613
WHENMGT(3F) ................................................................................................. whenmlt(3F)........................................................ 613
whenmgt(3F) ................................................................................................. whenmlt(3F)........................................................ 613
WHENMLE(3F) ................................................................................................. whenmlt(3F)........................................................ 613
whenmle(3F) ................................................................................................. whenmlt(3F)........................................................ 613
WHENMLT(3F) ................................................................................................. whenmlt(3F)........................................................ 613
whenmlt(3F) ................................................................................................. whenmlt(3F)........................................................ 613
WHENMNE(3F) ................................................................................................. whenmeq(3F)........................................................ 611
whenmne(3F) ................................................................................................. whenmeq(3F)........................................................ 611
WHENNE(3F) .................................................................................................... wheneq(3F) .......................................................... 605
whenne(3F) .................................................................................................... wheneq(3F) .......................................................... 605
Word (add to table) ......................................................................................... tmadw(3F) ............................................................ 459
Word pack and unpack ................................................................................... p32(3F) ................................................................. 496
Words move .................................................................................................... tmmve(3F) ............................................................ 464
Write SDS count ............................................................................................. auxstat(3F)........................................................ 473
XPFMT(3F) ...................................................................................................... xpfmt(3F) ............................................................ 532
xpfmt(3F) ...................................................................................................... xpfmt(3F) ............................................................ 532

004– 2165– 002 Index-23

You might also like