You are on page 1of 434

Intrinsic Procedures Reference

Manual
004–2138–003
    !"#$ &%' ()*+,%-./-. 0'-.1&"2& 34567869*+:* -;<-.7=34>$?*A@8-B<-C6<?15D-.1E FA>4=+? 3G5-./
6-.34 *+*+-.1H@?>E*+;*7I@?>KJL *+*+-CM6-.34 // N?=8O ,9+ "
P NQ 2DR&SE#UTLSV%'R&W2D%'YX&2DRSZ%'Y,[\2D P R&,R TLS
] /-C1 56 ;*+'?D1& / ?+56<-D@?>E* !-B,0'-. 34-C!*\+5@?^Y-.*'*+$<-./*+ *+ U,W-;*8=Y7* _ F* -B% (!*+, FS,*+` 56W-a*b9#$%
cd " dd 9efg9!1&h7D F/ 34 ;\?D+56-;W/?! 56/-. F* -ab9#$%i'7\ 4* !-BSUjUS!S,jkRg7&T`#$W#Gb9#$%EW5&6 -934-C!*+W" ] A5@8 +!-.1L9 ()*+
<-./-.0'-.1`51&-.:* -aX6>8 (* P Jl,7='* - ]  *+-;1lO*+*+-./"'XD!*+9*+?9h 34A56=Y* 56<-. ,O E,9 +6 " mnnD#U3$! * -.*+<-
op JH> " Qq5!*+ Lr, -CJ'X#Gfnf;ses c "
#U56*+?*+ p ()'X6b?6X69>W6XD9>M#$1XD9>' ?=+* 6XD9>ut'eYQ o X6>?e/!XD%' =Y73$XD%'Yhv.wix9y<z7{\ 0'D[H/|' P @8O Q oo #U6<-C!*+ -9!OOS'
]$o R&%'X P] /2DR&%i ] TLYXDjU/|'e+Q o R#U61 ] TLYX6jkOh3 p <-H=+-.1&-. >E<-;(? /*+-.<-.1}*+1-C3E p 1}~&-.56/-!!kJL? p W*+*+ F ,
/ !18XDX6 6X6X&Ql2?8X6b?n6X6b2?'XDb2 d 'XDb2D8XDX&569C-C*Qq; *+-C!9!-!2I7? +'X6jk/!XD9>u#U! 34*+ g2&-;;*+-; X6>u# oo XD9>}X6n
XD9>}XD;nS!X6>EXDlXD3$6  (MW>'/*+-C3$X69>'S,?Y6X69>}R P XD9>M€/n!XD9>K€nW-9'X69> P  p !XD9>KTlU/'XD9>'h%'R&R P @899A
XD9>}/e+Q o XD9>EOOSe+2Dn!XD9>E/rH'XD9>K2Dn!X69>u2&sSXD9>K2&sR !XD9>?2O56*+? 'XD9>M|'e+Q o 6X69>u|QN/6X6>?e d !XDO Ql8X&rD2?
SU-. 0'-;9 !($* -D6Jl-.\"A"i" 6S,,56/+S,?Y0' -9J:R QNSU/6, (i%' ()[HR |'#$%iYjU/ATlS‚O-. -.8TL-;* JL? p SU  p #$99>)
TL-;* JL? p !56-C56 !(KR A0 <34-C!* TL-.* JL? p !56-C56 (B2&?76j P TLR 2?8%'k/OR& P SU%i!/Qƒ#$%O2DR ! ]$o R% P Tl{&
/>8/*+-C3„QN !*+-C!-k1}%'-934?*-62I-./*+ !(KR A0'<A3E-C* A2I 56/*+-.1 ] TLYXDjU/!9!1 ] Tl+XDjk,Ql#U| ;C-`*+1-934 p :?=8XD9>E%'-;W-;;CYA
P " P " XD" 'JH? >EJH!-.1L+5@8/ 1&  >4?=O  E,9+6 "
Y%' |†1}O E,9 <-H<-.(?W*+-;<-.1}*+91&-C34 p U9!1LO,'!1L* !-HO,'7(?u<-H*+91&-C34 p U7='O ,9 + !"
XDS,XF *+91&-C34 p 7='X6*+<?8SU*+B/>8/*+-C3E6 "SUR&X ]$P 2D%' |'Ar#U|'61`rDQq <-H*+91&-C34 p :?=!S, (i *+R&‡56 3E-C*
XD767;*+!"'R&%'n` ,a*+91&-C3E; p ?=8R Ql#K /! "R 2?#ˆ *+91&-C34 p 7='R2?#‰W>'/*+-C34+6 !"!Y~QŠ *+91&-C34 p 7=' !*+-. !*+ !
~ 56/ -;W‹QqY -.XD767;*+!"QN o ,a*+91&-C3E; p ?=?Qq o X63$56*+-.:W>'/*+-C34/" o 7/*+O 6*' ,`*+91&-C3E; p ?=?#$1&@8-H/>8/*+-C34+
" ] Tl |‚ \`<-;(? /*+-.<-.1}*+1-C3E p F* - ] ! *+-.1ƒ *+*+-.:1}?* -.D5!*+9 -; -C!/-.1ƒ-.Œ  56/ 0'-. >E* <56(l|,hj!6-CEXD3K6A>
P 34*+-.1&"|,hj!6-CE <-.(? /*+-.<-;1ƒ*+1-934 p ?=?|Uhj!!-9FXD3K6A> P *+1&"&|EN 1&JŽ/>8/*+-C31l* -D| 1-90' -`;C-a*+91&-C3E; p 7=2&-
j!6-C_,<56"
2&- ] TLYX6jku6-.*+ (K+>8/*+-C3 ,1-. 0'-.1ƒ=+<3 ] Tl |6‘g/>'W*+-93‰r6".2&- ] TLYX6jkH6-.9*+ (g+>8/*+-C3’ , /k@8/-.1l g6;*'_* -
bi56* 4~&-. p -. -C>_O7=Y* JL<-aSU /*+9 @?56*+ N“+~&OS,”A5!1&-.6 -C/-H=Y<3„2&-B%'-.(?-9*+,7='* - ]  0'-.9/ * >}?=!X6 =+? "
O*+" o -.*+-.• ~/ a 34(?-a569*+-.+>4?=8R TLR P /#‰1l !=+?~ >8*+-B/#$"iS, p 2&!<Jl-.: 34(?-a569*+-;>4?=?|U90'-.D~&-.<-C!(56-. #U 3E*+ "
Record of Revision

–\—&˜O™&š?›'œ ž—&™Ÿ&˜Oš)u¡š?›'œ
¢\£ ¤ ¥W¦§\¨_©&ªIªI«
¬E­;®<¯!® §\°I±² ­;® §\³ ® § ¯ £´,µ ®<¶g·,¸¹ ¦ºV¨§\³a§ ¸»¼® § ¹ ±<¦ · ¨ ¶ ³µ\¨_½ˆ°&³Wµ ¾ ®<¿!­ ° ­;À†­)¸ ¦³ ® §\¨ ¶l» µ ®<¹ µV° ­ ¨
¹ °I±<±<¨ · ° ¶g® §\³ ­® § ¶O®<¹?¶ °I§ ·® § ¹ ±<¦ · ¨ ¶ ºV°I§ZÁ° ¯ ¨ ¶gÂW¸!­ Ã!¸!­ ³ ­ °I§‚°I§ ·ÅÄÆ® §\³ ­® § ¶O®<¹}¶ ¦ ¿ Á ­)¸¯6­ °Iº ¶ £
¢\£ © Ç4¦ ¯ ¦ ¶ ³a©IªIªIÈ
É4Á · °I³W¨ · ³ ¸Z­ ¨Ê,¨ ¹ ³ ¹ µ\°I§ ¯ ¨ ¶ƒ® §Å³µ\¨_² ­)¸!¯!­ °IºVº ® § ¯‚Ë §\Ì ®<­)¸ §\ºV¨§\³ ¢D£ © ­ ¨±<¨° ¶ ¨6£,´,µ\¨
Á ­;® §\³W¨ · ³W¨Í8³ ¸ ³µ ®<¶ ºV°I§\¦°I± » ° ¶ ºV° · ¨_°IÌ6° ® ±<° ¿ ±<¨ ® §Å² ¸¶ ³Î ¹i­;® Á³HÏ £ Á ¶OÐaÂ/¸­ ºV°I³ ÂW¸­ ³µ ®<¶
­ ¨±<¨° ¶ ¨!£
¢\£ Ñ ¥W°I§\¦° ­;À ©IªIª&ª
É4Á · °I³W¨ · ³ ¸Z­ ¨Ê,¨ ¹ ³ ¹ µ\°I§ ¯ ¨ ¶ƒ® §Å³µ\¨_² ­)¸!¯!­ °IºVº ® § ¯‚Ë §\Ì ®<­)¸ §\ºV¨§\³ ¢D£ Ñ ­ ¨±<¨° ¶ ¨6£,´,µ\¨
Á ­;® §\³W¨ · ³W¨Í8³ ¸ ³µ ®<¶ ºV°I§\¦°I± » ° ¶ ºV° · ¨_°IÌ6° ® ±<° ¿ ±<¨ ® §Å² ¸¶ ³Î ¹i­;® Á³HÏ £ Á ¶OÐaÂ/¸­ ºV°I³ ÂW¸­ ³µ ®<¶
­ ¨±<¨° ¶ ¨!£
¤I¤I¢ ¥W¦± À ©IªIª&ª
´,µ ®<¶l­ ¨Ì ®<¶7®<¸ § ¶ ¦ÁÁ ¸­ ³ ¶ ³µ\¨_² ­)¸!¯!­ °IºVº ® § ¯‚Ë §\Ì ®<­)¸ §\ºV¨§\³`¢\£ ¢F°I§ · ³Wµ\¨_½ÓÒ/²Î8Á ­)¸ «D£ ¢
­ ¨±<¨° ¶ ¨ ¶ £,´,µ\¨_ºV°I³µ°IÁ:Á¨§ ·,® Í ¶ ¨ ¹ ³ ®<¸ § ¶ µ\°&ÌD¨ ¿ ¨¨§º ¸ Ì6¨ · ³ ¸ ³µ\¨_Ô!Õ ÖØ×.Ù6ÚWÖ Û ÕlÜ!ÖØÝAÞ;ß?Þ;à
á$â.×;Þã âKäMå!ÖØæI×£´,µ ®<¶l­ ¨Ì ®<¶O®<¸ § ®<¶ °IÌ6° ® ±<° ¿ ±<¨ ® §Å² ¸¶ ³Î ¹i­;® Á³HÏ £ Á ¶OÐaÂ/¸­ ºV°I³ £

004–2138–003 i
About This Manual

´,µ <® ¶ ºV°I§\¦°I± ·¸!¹ ¦ºV¨§\³ ¶ ³Wµ\¨ ® §\³ ­® § ¶O®<¹ Á ­)¸¹ ¨ · ¦ ­ ¨ ¶ƒÂ/¸­ ³µ\¨ ÂW¸ ±<± ¸!»N® § ¯V¹?¸ ºVÁ ® ±<¨ ­¶Iç
è ,´ µ\¨_½ÓÒ/²Î8Á ­)¸ « Ã!¸!­ ³ ­ °I§ÅªI¤ ¹i¸ ºVÁ ® ±<¨ ­éD» µ ®<¹ µ ®<¶L­ ¨±<¨° ¶ ¨ ·Ó»N® ³WµÅ³µ\¨½ˆÒW²Î'Á ­)¸
­ ¨±<¨° ¶ ¨ ¶ƒ¸ §Ò/êHÒ/ëìÁ±<°I³ ÂW¸!­ º ¶ £
è ´,µ\¨ ÄK­ ° ÀZÄ$ÄKííÓ¹?¸ ºVÁ ® ±<¨ ­é\» µ ®<¹ µ ®<¶}­ ¨±<¨° ¶ ¨ ·ˆ»N® ³WµZ³Wµ\¨_² ­)¸¯6­ °IºVº ® § ¯
Ë §\Ì ®<­)¸ §\ºV¨§\³ ­ ¨±<¨° ¶ ¨ ¶4¸ §‚É4îÒ ÄK¬ Î °I§ · É4îNÒ ÄK¬ Î,ï8ºVðVÁ:±<°I³ ÂW¸­ º ¶ £
è ´,µ\¨ ÄKà ªI¤ ¹i¸ ºVÁ ® ±<¨ ­éD» µ ®<¹ µ ®<¶L­ ¨±<¨° ¶ ¨ ·Ó»N® ³WµÅ³µ\¨² ­)¸¯!­ °&ºVº ® § ¯‚Ë §\Ì ®<­¸ §\ºV¨§\³
­ ¨±<¨° ¶ ¨ ¶ƒ¸ §É4îÒ ÄK¬ Îq°I§ · É4îÒ ÄK¬ Îï8ºVðÅÁ:±<°I³ ÂW¸­ º ¶ £
´,µ ®<¶}­ ¨Ì ®<¶7®<¸ § ¶ ¦ÁÁ ¸­ ³ ¶ ³µ\¨_½ÓÒ/²Î8Á ­)¸ «\£ ¢N°I§ · ³µ\¨_² ­)¸!¯!­ °IºVº ® § ¯Ë §\Ì ®<­)¸ §\ºV¨§\³a¢D£ ¢
­ ¨±<¨° ¶ ¨ ¶ £
´,µ ®<¶}®<¶ ° ­ ¨  ¨ ­ ¨§ ¹ ¨ºV°I§\¦°I± ÂW¸!­ °IÁÁ± ®<¹ °I³ ®<¸ §Å°I§ ·Ó¶OÀ!¶ ³W¨ºñÁ ­)¸!¯!­ °IºVºV¨ ­;¶ £kê`¨° · ¨ ­;¶
¶ µ ¸ ¦± · °I± ¶O¸ µ\°IÌ6¨F° »N¸­ ð ® § ¯ ð!§ ¸!» ±<¨ ·,¯ ¨ ¸Â ¨ ® ³Wµ\¨ ­ ³Wµ\¨_É}îNÒ Ä$¬ Î é É4îNÒ ÄK¬ Î,ï8ºVð é:¸­
ÒWê`ÒWë ¸ Á¨ ­ °I³ ® § ¯ ¶7À!¶ ³W¨ºò°I§ · ° »N¸­ ð ® § ¯ ð!§ ¸!» ±<¨ ·,¯ ¨ ¸! ³Wµ\¨ Ã!¸!­ ³ ­ °I§ ¸!­MÄ
Á ­)¸¯!­ °IºVº ® § ¯ ±<°I§ ¯ ¦° ¯ ¨6£

Related Publications
´,µ\¨ Â/¸ ±<± ¸»N® § ¯‚·,¸¹ ¦ºV¨§\³ ¶l¹?¸ §\³W° ® §ó° ·,·,® ³ ®<¸ §\°I± ® § Â/¸­ ºV°I³ ®<¸ §³µ\°I³HºV° ÀV¿ ¨Fµ\¨±<Á  ¦± ç
è Ô!×9ô\õ}×;Ù6ÚHÜ!ö?ß?æI×;ÞM÷/Ô!ø,äMÜ!ù4úHû`ß?Ù!æNüØæú`× ý7×;Þ×;Ù6Õ×aþŽß?Ù!å6ß?ü
è á$ÿ }ԉá$â.×;Þ Höiõ}õ4ß?Ù!æIâMú`× ý?×;Þ×;Ù!Õ ×BþŽßiÙ!å!ßiü
è äMå!ÖØæI×KÚWö ,ßiÞ.ß?üØüØ×;ü ×;ÕÚWöiÞ IüØÖYÕ ß?ÚWÖØö?Ù6â
è á$ÿ }ÔVÔ!àIâ;ÚW×;õŠÜ6ÖYÝÞ.ßiÞ.ÖØ×;âKú`× ý?×;Þ×;Ù!Õ ×BþŽßiÙ!å!ßiü
è á$ÿ }ÔVÔ!àIâ;ÚW×; õ `ß?üØüYâMúH× ý?×;Þ×;Ù!Õ ×BþŽß?Ù6å!ß?ü
´,µ\¨ Â/¸ ±<± ¸»N® § ¯ ºV°I§\¦°I± ¶ƒ·,¸¹ ¦ºV¨§\³B³Wµ\¨ Ä$­ ° À ¾ ®<¿!¶ Á ­)¸· ¦ ¹ ³£kÇ4±<±,ºV°I§ZÁ° ¯ ¨ ¶l® §‚³µ\¨ ¶ ¨
ºV°I§\¦°&± ¶ƒ¹ °I§ó°I± ¶O¸†¿ ¨Ì ® ¨ » ¨ ·Ó¸ §\± ® §\¨ ¿!À ¦ ¶O® § ¯ ³Wµ\¨ man ¹?¸ ºVºV°I§ · ç
è IüYÖØÕßiÚWÖØö?Ù ,Þöô\Þ;ß?õ4õ}×;Þã âgÜ6ÖYÝAÞ;ß?Þ;àNúH× ý?×.Þ)×;Ù!Õ ×BþŽß?Ù6å!ß?ü
è Ô!Õ ÖØ×.Ù6ÚWÖ Û ÕlÜ!ÖØÝAÞ;ß?Þ;àú`× ý?×;Þ×;Ù!Õ ×BþŽßiÙ!å!ßiü
ÒW§° ·,·,® ³ ®<¸ §³ ¸ ³µ\¨ ¶ ¨ ·,¸¹ ¦ºV¨§\³ ¶Oé:¶ ¨ÌD¨ ­ °I±UºV°I§\¦°I± ¶l·,¸!¹ ¦ºV¨§\³BÎ ƒÒ ¹i¸ ºVÁ ® ±<¨ ­;¶Iç
è `ö?õ4õ}ß?Ù6æIâMß?Ù!æNù4ÖYÞ)×.Õ ÚWÖ I×.âMúH× ý?×.Þ)×.Ù6Õ×`þŽß?Ù6å!ß?ü

004–2138–003 iii
Intrinsic Procedures Reference Manual

è !öiÞ.Ú/Þ.ßiÙVÜ6ß?Ùô\å!ß)ôD×KúH× ý?×;Þ×;Ù!Õ ×BþŽß?Ù6å!ß?üDö?üØå!õ4×


è !öiÞ.Ú/Þ.ßiÙVÜ6ß?Ùô\å!ß)ôD×KúH× ý?×;Þ×;Ù!Õ ×BþŽß?Ù6å!ß?ü Dö?üØå!õ4× 
è !öiÞ.Ú/Þ.ßiÙVÜ6ß?Ùô\å!ß)ôD×KúH× ý?×;Þ×;Ù!Õ ×BþŽß?Ù6å!ß?ü Dö?üØå!õ4× 
è HÞ;ß?à "!#$%$Åú`× ý?×;Þ×;Ù!Õ ×BþŽßiÙ!å!ßiü
þ ,'Ô ,Þ)ö ( !ö?Þ;ÚWÞ;ß?)Ù Hö?õ4õ4ß?Ù!æIâMß?Ù6æù4ÖØÞ×;ÕÚWÖ I×;âgú`× ý7×;Þ×;Ù6Õ×aþŽß?Ù!å6ß?ü
è &

Obtaining Publications
´,µ\¨Zá$â;×.Þ*,å!ÝAüØÖØÕßiÚWÖYöiÙ!â+`ß?ÚWß?üØöô · ¨ ¶O¹?­®<¿ ¨ ¶ ³µ\¨N°IÌ6° ® ±<° ¿!® ± ® ³ À °I§ ·Ó¹?¸ §\³¨§\³ ¸! °I±<±
É}îNÒ Ä$¬ Ά°I§ · É4îÒ ÄK¬ Îï8ºVðVµ\° ­)·,» ° ­ ¨N°&§ ·Ó¶O¸! ³ » ° ­ ¨ ·,¸!¹ ¦ºV¨§\³ ¶ ³Wµ\°&³`° ­ ¨
°IÌ6° ® ±<° ¿ ±<¨F³ ¸ ¹ ¦ ¶ ³ ¸ ºV¨ ­;¶ £ Ä ¦ ¶ ³ ¸ ºV¨ ­;¶L» µ ¸‚¶ ¦ ¿!¶O¹?­®<¿ ¨E³ ¸ ³Wµ\¨ Ä$­ ° À ÒW§ Â/¸­ º
Ï Ä êHÒ/§ ÂW¸­ º Ð Á ­)¸!¯!­ °&º ¹ °I§Å° ¹?¹ ¨ ¶O¶ ³µ ®<¶l® § ÂW¸!­ ºV°I³ ®<¸ § ¸ §‚³Wµ\¨ Ä êHÒ/§ ÂW¸!­ º ¶7À!¶ ³W¨º‰£
´ ¸V¸!­)· ¨ ­ ° ·¸!¹ ¦ºV¨§\³ é:¹ °I±<± í -© ,.I-© ,IÈ&-¢ .IªI¤I«D£UÎ ƒÒH¨ºVÁ± ¸À ¨¨ ¶ ºV° À ¶ ¨§ · ¨0/WºV° ® ±U³ ¸
orderdsk@sgi.com
£
Ä ¦ ¶ ³ ¸ ºV¨ ­¶ƒ» µ ¸ ¶ ¦ ¿!¶7¹?­;®<¿ ¨³ ¸ ³µ\¨ Ä ê`ÒW§ Â/¸­ ºñÁ ­)¸¯!­ °Iº ¹ °&§ ¸!­)· ¨ ­L¶O¸ ³ » ° ­ ¨ ­ ¨±<¨° ¶ ¨
Á° ¹ ð!° ¯ ¨ ¶ ¨±<¨ ¹ ³ ­)¸ § ®<¹ °I±<± ÀV¿!À ¦ ¶7® § ¯ ³µ\¨ Order Cray Software ¸ Á:³ ®<¸ §H£
Ä ¦ ¶ ³ ¸ ºV¨ ­¶ƒ¸ ¦³ ¶O®<· ¨ ¸ ³µ\¨NÉ}§ ® ³W¨ · Î'³°I³¨ ¶ °&§ ·ÓÄ °I§\° · ° ¶ µ ¸ ¦± ·ˆ¹?¸ §\³W° ¹ ³a³µ\¨ ®<­ ± ¸¹ °I±
¶ ¨ ­ Ì ®<¹ ¨ ¸­)¯ °I§ 2® 1 °I³ ®<¸ § ÂW¸!­g¸­)· ¨ ­;® § ¯ °I§ ·Ó·¸!¹ ¦ºV¨§\³°I³ ®<¸ § ® § ÂW¸­ ºV°&³ ®<¸ §H£

Conventions
´,µ\¨ / ¸ ±<± ¸»N® § ¯‚¹?¸ §\ÌD¨§\³ ®<¸ § ¶ ° ­ ¨¦ ¶ ¨ · ³µ ­)¸ ¦ ¯ µ ¸ ¦³ ³µ ®<¶l·,¸¹ ¦ºV¨§\³ ç
Ä ¸ § Ì ¨ § ³®¸ § ½ ¨ ° § ®§ ¯
´,µ ®<4¶ 3 Í8¨ · / ¶ Á° ¹ ¨ ÂW¸ §\³ · ¨§ ¸ ³¨ ¶ ± ® ³¨ ­ °I± ® ³¨º ¶L¶ ¦ ¹ µÅ° ¶
command ¹?¸ ºVºV°&§ ·,¶Oé53 ±<¨ ¶7é\­)¸ ¦³ ® §\¨ ¶Oé Á°I³µÅ§\°IºV¨ ¶7é:¶7®<¯ §\°I± ¶Oé
ºV¨ ¶O¶ ° ¯ ¨ ¶Oé °I§ · Á ­)¸!¯!­ °IºVº ® § ¯ ±<°I§ ¯ ¦° ¯ ¨ ¶ ³ ­ ¦ ¹ ³¦ ­ ¨ ¶ £
Iß?Þ;ÖYßiÝAüY× Ò/³°I± ®<¹ ³ À Á¨  ° ¹ ¨ · ¨§ ¸ ³W¨ ¶ Ì6° ­;® ° ¿ ±<¨F¨§\³ ­;® ¨ ¶ °&§ ·Ó»N¸!­)·,¶
¸­g¹?¸ § ¹ ¨Á³ ¶L¿ ¨ ® § ¯‚· ¨ 3 §\¨ · £

iv 004–2138–003
About This Manual

´,µ ®<¶l¿!¸ ± ·,é53 Í8¨ · / ¶ Á° ¹ ¨ Â/¸ §\³ · ¨§ ¸ ³¨ ¶ ± ® ³W¨ ­ °I± ® ³¨º ¶
user input
³µ\°I³H³Wµ\¨_¦ ¶ ¨ ­ ¨§\³¨ ­;¶l® § ® §\³¨ ­ ° ¹ ³ ® Ì6¨ ¶ ¨ ¶O¶7®<¸ § ¶ £
¬ ¦³WÁ¦³ ®<¶L¶ µ ¸» § ® §Å§ ¸ § ¿!¸ ± ·,é"3 ͋¨ · / ¶ Á° ¹ ¨ ÂW¸ §\³£

Man page sections


´,µ\¨¨§\³ ­;® ¨ ¶L® §Å³Wµ ®<¶l·¸!¹ ¦ºV¨§\³`° ­ ¨ ¿ ° ¶ ¨ ·‰¸ §Z° ¹?¸ ºVº ¸ § ÂW¸!­ ºV°I³£U´,µ\¨ Â/¸ ±<± ¸»N® § ¯ ± ®<¶ ³
¶ µ ¸»q¶ ³Wµ\¨ ¸­)· ¨ ­g¸! ¶ ¨ ¹ ³ ®<¸ § ¶g® §Å°I§¨§\³ ­;À °I§ ·Ó· ¨ ¶7¹?­;®<¿ ¨ ¶ ¨° ¹ µ ¶ ¨ ¹ ³ ®<¸ §H£,½ ¸!¶ ³H¨§\³ ­;® ¨ ¶
¹?¸ §\³W° ® § ¸ §\± À ° ¶ ¦ ¿!¶ ¨³ ¸! ³Wµ\¨ ¶ ¨ ¶ ¨ ¹ ³ ®<¸ § ¶ £
Î ¨ ¹ ³®¸ § µ ¨ ° · ®§ ¯ 6 ¨ ¶ ¹ ­ ®Á ³®¸ §
îNÇ}½ Ë Î8Á¨ ¹?2® 3 ¨ ¶ ³µ\¨_§\°IºV¨ ¸Â ³Wµ\¨_¨§\³ ­;À °I§ ·Ó¿!­;® ¨Ê À ¶ ³W°I³¨ ¶
® ³ ¶ƒÂ ¦§ ¹ ³ ®<¸ §H£
Î7`î ¬ ²Î8Ò/Î ² ­ ¨ ¶ ¨§\³ ¶ ³µ\¨ ¶OÀ §\³W°IÍ ¸! ³Wµ\¨¨§\³ ­À £
ÒW½ˆ²¾ Ë ½ Ë î´ÇK´,Ò ¬ î Ò · ¨§\³ 2® 3 ¨ ¶ ³µ\¨ ¶OÀ!¶ ³¨º ¶ ³ ¸V» µ ®<¹ µÅ³µ\¨_¨§\³ ­À °IÁÁ± ® ¨ ¶ £
Î8´Ç}î 6 Ç4ê 6 Î ² ­)¸ Ì ®<· ¨ ¶}® § Â/¸­ ºV°I³ ®<¸ §‚° ¿!¸ ¦³H³µ\¨NÁ ¸!­ ³W° ¿!® ± ® ³ À‚¸ °
¦³ ® ± ® ³ ÀV¸­g­)¸ ¦³ ® §\¨6£
6}Ë Î Ä êHÒ/²´,Ò ¬ î 6}®<¶O¹ ¦ ¶O¶ ¨ ¶ ³µ\¨_¨§\³ ­À‚® § · ¨³W° ® ±)£
î ¬ ´ËÎ ² ­ ¨ ¶ ¨§\³ ¶ƒ® ³¨º ¶ƒ¸! Á° ­ ³ ®<¹ ¦±<° ­M® ºVÁ ¸­ ³°I§ ¹ ¨6£
Ä Ç4É}´UÒ ¬ îNÎ 6 ¨ ¶O¹?­®<¿ ¨ ¶ ° ¹ ³ ®<¸ § ¶ ³µ\°I³ ¹ °I§ · ¨ ¶ ³ ­)¸ÀV· °I³° ¸!­
Á ­)¸· ¦ ¹ ¨¦§ · ¨ ¶O®<­ ¨ ·ˆ­ ¨ ¶ ¦±<³ ¶ £
8 Ç4êHîNÒW- î ƒÎ 6 ¨ ¶O¹?­®<¿ ¨ ¶ ° ¹ ³ ®<¸ § ¶ ³µ\°I³ ¹ °I§Åµ\° ­ º Á:¨ ¸ Á:±<¨ é
0¨ 96¦ ® Á:ºV¨§\³ é:¸­g¶OÀ!¶ ³¨º ¶O¸Â ³ » ° ­ ¨!£
Ë î :MÒ/ê ¬ îN½ Ë îN´ 6 ¨ ¶O¹?­®<¿ ¨ ¶ Á ­ ¨ · ¨ 3 §\¨ ·Ó¶ µ\¨±<±kÌ6° ­;® ° ¿ ±<¨ ¶ ³µ\°I³
:Ç}ê`ÒW< Ç ;,¾ Ë Î · ¨³¨ ­ º ® §\¨ ¶O¸ ºV¨ ¹ µ\° ­ ° ¹ ³W¨ ­®<¶ ³ ®<¹i¶l¸! ³µ\¨ ¶ µ\¨±<± ¸!­ ³µ\°I³
° Â9 ¨ ¹ ³a³Wµ\¨ ¿ ¨µ\°IÌ ®<¸­M¸!Âa¶7¸ ºV¨Á ­)¸¯!­ °Iº ¶Oé:¹?¸ ºVºV°I§ ·,¶Oé
¸­ ¦³ ® ± ® ³ ® ¨ ¶ £
ê Ë ´,É4êH= î :Ç}¾,É Ë Î 6 ¨ ¶O¹?­®<¿ ¨ ¶ Á ¸!¶O¶O®<¿ ±<¨ ­ ¨³W¦ ­ §óÌ6°I±<¦¨ ¶ ³Wµ\°I³ ® § ·,®<¹ °I³W¨N°
± ®<¿!­ ° ­À‚¸!­$¶OÀ6¶ ³¨º ¹ °I±<±U¨͋¨ ¹ ¦³W¨ ·Ó¶ ¦ ¹?¹ ¨ ¶7¶O ¦±<± À?é\¸­
®<· ¨§\³ 2® 3 ¨ ¶ ³µ\¨_¨ ­;­)¸­L¹?¸ § ·® ³ ®<¸ §¦§ · ¨ ­K» µ ®<¹ µ ® ³
 ° ® ±<¨ · £
Ë ëHÒ/´‰Î8´Ç$´,É4Î 6 ¨ ¶O¹?­®<¿ ¨ ¶ Á ¸!¶O¶O®<¿ ±<¨_¨Í ® ³ ¶ ³W°I³¦ ¶ Ì6°I±<¦¨ ¶ ³µ\°I³ ® § ·,®<¹ °I³W¨
» µ\¨³µ\¨ ­ ³Wµ\¨ ¹?¸ ºVºV°I§ ·¸!­ ¦³ ® ± ® ³ À ¨͋¨ ¹ ¦³W¨ ·
¶ ¦ ¹i¹ ¨ ¶O¶O ¦±<± À £
½ Ë Î8Î'Ç  Ë Î 6 ¨ ¶O¹?­®<¿ ¨ ¶ƒ® § Â/¸­ ºV°I³ ®<¸ §\°I± é\·,® ° ¯ § ¸¶ ³ ®<¹?é °I§ · ¨ ­;­)¸­
ºV¨ ¶O¶ ° ¯ ¨ ¶ ³µ\°I³HºV° À °IÁ:Á¨° ­ £Î8¨±  /W¨͋Á±<°I§\°I³ ¸!­;À
ºV¨ ¶O¶ ° ¯ ¨ ¶ ° ­ ¨F§ ¸ ³a± ®<¶ ³¨ · £
004–2138–003 v
Intrinsic Procedures Reference Manual

Ë êHê ¬ ê`Î 6}¸!¹ ¦ºV¨§D³ ¶ ¨ ­­)¸­L¹?¸· ¨ ¶ £UÇ}ÁÁ± ® ¨ ¶L¸ §\± À ³ ¸V¶OÀ6¶ ³¨º
¹ °I±<± ¶ £
Ã!¬ Uê ´,ê`Ç}î 6 ¨ ¶O¹?­®<¿ ¨ ¶ µ ¸!» ³ ¸ ¹ °&±<±U° ¶OÀ6¶ ³W¨º ¹ °I±<± ÂW­)¸ º Ã!¸!­ ³ ­ °I§H£
Ë ëH´ Ë îNÎ8Ò ¬ îNÎ Ç4Á:Á± ® ¨ ¶ƒ¸ §\± À ³ ¸Z¶OÀ!¶ ³W¨º ¹ °&±<± ¶ £
;,É ƒÎ Ò/§ ·®<¹ °&³W¨ ¶ ð!§ ¸!» § ¿ ¦ ¯!¶ °I§ ·Ó· ¨ 3¹i® ¨§ ¹i® ¨ ¶ £
Ë ëHÇ4½Ó²¾ Ë Î Î8µ ¸!»N¶ ¨͋°IºVÁ±<¨ ¶ƒ¸ ¦ ¶ ° ¯ ¨6£
à Ò/¾ Ë Î ¾ ®<¶ ³ 4¶ 3 ±<¨ ¶ ³µ\°I³B° ­ ¨¨ ® ³Wµ\¨ ­ Á:° ­ ³ ¸ ³µ\¨_¨§\³ ­ÀV¸!­ ° ­ ¨
­ ¨±<°&³W¨ · ³ ¸ ® ³ £
Î Ë,Ë Ç}¾,Î ¬ ¾ ®<¶ ³ ¶ ¨§\³ ­® ¨ ¶ °I§ · Á¦ ¿ ± ®<¹ °&³ ®<¸ § ¶ ³µ\°I³ ¹?¸ §\³W° ® § ­ ¨±<°I³W¨ ·
® § ÂW¸!­ ºV°I³ ®<¸ §H£

Reader Comments
Ò Â À!¸ ¦ˆµ\°&ÌD¨ ¹i¸ ºVºV¨§\³ ¶ ° ¿6¸ ¦³H³Wµ\¨_³¨ ¹ µ\§ ®<¹ °I±B° ¹?¹ ¦ ­ ° ¹iÀOé¹?¸ §\³¨§\³ éD¸!­M¸!­)¯ °I§ ®21 °I³ ®<¸ § ¸Â
³µ ®<¶4·¸!¹ ¦ºV¨§\³ é Á:±<¨° ¶ ¨F³W¨±<±U¦ ¶ £>;,¨ ¶ ¦ ­ ¨³ ¸V® § ¹ ±<¦ · ¨E³µ\¨N³ ® ³W±<¨F°&§ · Á° ­ ³a§\¦º ¿ ¨ ­M¸!Â
³µ\¨ ·¸!¹ ¦ºV¨§\³ »N® ³Wµ À!¸ ¦ ­M¹?¸ ºVºV¨§\³ ¶ £
7 ¸ ¦ ¹ °I§ ¹?¸ §\³° ¹ ³a¦ ¶}® §Å°I§ À‚¸ ³µ\¨ Â/¸ ±<± ¸»N® § ¯‚» ° À!¶Iç
è Î8¨§ · 0¨ /WºV° ® ±U³ ¸ ³µ\¨ ÂW¸ ±<± ¸»N® § ¯ ° ·,·,­ ¨ ¶O¶Iç
techpubs@sgi.com
è Î8¨§ · °  °I͞³ ¸ ³µ\¨°I³W³¨§\³ ®<¸ § ¸Â? ´‹¨ ¹ µ\§ ®<¹ °&±k²¦ ¿ ± ®<¹ °&³ ®<¸ § ¶A@ °I³ ,ç í © ,B.I¤NªI¢IѤIÈI¤I©\£
è É ¶ ¨E³Wµ\¨ à ¨¨ ·,¿ ° ¹ ð ¸ Á³ ®<¸ § ¸ §³µ\¨_´‹¨ ¹ µ\§ ®<¹ °I±U²¦ ¿ ± ®<¹ °I³ ®<¸ § ¶ ¾ ®<¿6­ ° ;­ À 8 ¸­ ± · 8 ®<· ¨
8 ¨ ¿ Á:° ¯ ¨ ç
http://techpubs.sgi.com
è Ä &° ±<±U³Wµ\¨_´8¨ ¹ µ\§ ®<¹ °&±k²¦ ¿ ± ®<¹ °&³ ®<¸ § ¶  ­)¸ ¦Á é ³µ ­)¸ ¦ ¯ µÅ³Wµ\¨´‹¨ ¹ µ\§ ®<¹ °I±UÇ ¶O¶O®<¶ ³W°I§ ¹ ¨
Ä ¨§\³W¨ ­é ¦ ¶O® § ¯‚¸ §\¨ ¸! ³Wµ\¨ ÂW¸ ±<± ¸!»N® § ¯ §\¦º ¿ ¨ ­;¶‹ç
Ã!¸!­ CÎ ƒÒHÒWê`ÒWë ¿ ° ¶ ¨ ·‰¸ Á¨ ­ °I³ ® § ¯ ¶7À!¶ ³W¨º ¶‹ç ©ÈI¤I¤ÈI¤I¤EDI΃Ò
Ã!¸!­ É4îNÒ ÄK¬ Î ¸­ É}îNÒ Ä$¬ Îï8ºVð ¿ ° ¶ ¨ ·ˆ¸ Á¨ ­ °I³ ® § ¯V¶OÀ!¶ ³¨º ¶ƒ¸­gÄK­ ° À ¬E­;®<¯!® §óÑI¤I¤I¤
¶OÀ6¶ ³¨º ¶Iç ©È&¤I¤Nª .I¤ÑI«IÑIªNÏW³ ¸ ±<± Â/­ ¨¨ ÂW­)¸ º ³µ\¨_É4§ ® ³¨ · Î8³°I³W¨ ¶ °I§ ·‰Ä °&§\° · ° ÐB¸!­
í © ,.I© ,IÈI-¢ .,&¤I¤
è Î8¨§ · ºV° ® ±,³ ¸ ³µ\¨ ÂW¸ ±<± ¸!»N® § ¯ ° ·,·,­ ¨ ¶7¶Iç
´I¨ ¹ µ\§ ®<¹ °&±k²¦ ¿ ± ®<¹ °&³ ®<¸ § ¶
Î ƒÒ
© ,I¤&¤qÇ}ºVÁµ ® ³Wµ\¨°I³ ­ ¨_²ð »NÀ £

vi 004–2138–003
About This Manual

½ ¸ ¦§\³° ® §F: ® ¨ »Lé\Ä °&± ®<Â/¸­ § ® °NªDI¤D&¢GI©I¢.I©


¨ Ì6°I±<¦¨ À!¸ ¦ ­g¹?¸ ºVºV¨§\³ ¶ °I§ ·Ó»N® ±<± ­ ¨ ¶ Á ¸ § · ³ ¸ ³Wµ\¨ºòÁ ­)¸ ºVÁ³± À £
8 

004–2138–003 vii
CONTENTS

ABS (see abs) ........................................................... Computes absolute value ............................................................................... 1


abs .............................................................................. Computes absolute value ............................................................................... 1
ACHAR (see char) .................................................... Performs conversion and positioning functions .......................................... 42
ACOS (see acos) ...................................................... Computes arc cosine (inverse cosine) ........................................................... 3
acos ........................................................................... Computes arc cosine (inverse cosine) ........................................................... 3
ACOSD (see acos) .................................................... Computes arc cosine (inverse cosine) ........................................................... 3
ADD_AND_FETCH (see sync) ................................. Fortran synchronization intrinsics for multiprocessing ............................. 337
ADJUSTL (see adjustl) ........................................ Adjusts a character string to the left ............................................................. 5
adjustl .................................................................... Adjusts a character string to the left ............................................................. 5
ADJUSTR (see adjustr) ........................................ Adjusts a character string to the right ........................................................... 7
adjustr .................................................................... Adjusts a character string to the right ........................................................... 7
AIMAG (see aimag) .................................................. Returns imaginary part of a complex number .............................................. 9
aimag ......................................................................... Returns imaginary part of a complex number .............................................. 9
AINT (see aint) ...................................................... Performs truncation to integer ..................................................................... 11
aint ........................................................................... Performs truncation to integer ..................................................................... 11
ALL (see all) ........................................................... Determines whether all values are true ....................................................... 13
all .............................................................................. Determines whether all values are true ....................................................... 13
ALLOCATED (see allocated) ............................... Returns the array allocation status .............................................................. 15
allocated ................................................................ Returns the array allocation status .............................................................. 15
ALOG (see log) ......................................................... Computes natural logarithm ...................................................................... 196
ALOG10 (see log10) ............................................... Computes common logarithm ................................................................... 193
AMAX0 (see max) ...................................................... Returns maximum values .......................................................................... 207
AMAX1 (see max) ...................................................... Returns maximum values .......................................................................... 207
AMIN0 (see min) ...................................................... Returns minimum values ........................................................................... 219
AMIN1 (see min) ...................................................... Returns minimum values ........................................................................... 219
AMOD (see mod) ......................................................... Computes remainder .................................................................................. 228
AND (see and) ........................................................... Computes logical product ............................................................................ 16
and .............................................................................. Computes logical product ............................................................................ 16
AND_AND_FETCH (see sync) ................................. Fortran synchronization intrinsics for multiprocessing ............................. 337
ANINT (see anint) .................................................. Finds nearest whole number ........................................................................ 18
anint ......................................................................... Finds nearest whole number ........................................................................ 18
ANY (see any) ........................................................... Determines whether any values are true ..................................................... 20
any .............................................................................. Determines whether any values are true ..................................................... 20
_argcount (see numarg) ...................................... Returns the number of arguments in a function or subprogram call ........ 247
ASIN (see asin) ...................................................... Computes arc sine (inverse sine) ................................................................ 22
asin ........................................................................... Computes arc sine (inverse sine) ................................................................ 22
ASIND (see asin) .................................................... Computes arc sine (inverse sine) ................................................................ 22
ASSOCIATED (see associated) .......................... Returns the pointer association status ......................................................... 24
associated ............................................................. Returns the pointer association status ......................................................... 24
ATAN (see atan) ...................................................... Computes arctangent (inverse tangent) for single argument ....................... 29
atan ........................................................................... Computes arctangent (inverse tangent) for single argument ....................... 29
ATAN2 (see atan2) .................................................. Computes arc tangent (inverse tangent) for two arguments ....................... 26
atan2 ......................................................................... Computes arc tangent (inverse tangent) for two arguments ....................... 26
ATAN2D (see atan2) ............................................... Computes arc tangent (inverse tangent) for two arguments ....................... 26
ATAND (see atan) .................................................... Computes arctangent (inverse tangent) for single argument ....................... 29
BITEST (see btest) ............................................... Tests a bit of an integer value ..................................................................... 39
BIT_SIZE (see bit_size) .................................... Returns the number of bits in an integer in the bit manipulation
model ........................................................................................................... 31

004– 2138– 003 ix


bit_size .................................................................. Returns the number of bits in an integer in the bit manipulation
model ........................................................................................................... 31
BJTEST (see btest) ............................................... Tests a bit of an integer value ..................................................................... 39
BKTEST (see btest) ............................................... Tests a bit of an integer value ..................................................................... 39
bmm .............................................................................. Performs bit matrix multiply operations ..................................................... 33
BTEST (see btest) .................................................. Tests a bit of an integer value ..................................................................... 39
btest ......................................................................... Tests a bit of an integer value ..................................................................... 39
CABS (see abs) ......................................................... Computes absolute value ............................................................................... 1
CCOS (see cos) ......................................................... Computes cosine .......................................................................................... 55
CDABS (see abs) ...................................................... Computes absolute value ............................................................................... 1
CDCOS (see cos) ...................................................... Computes cosine .......................................................................................... 55
CDEXP (see exp) ...................................................... Computes exponential function ................................................................. 104
CDLOG (see log) ...................................................... Computes natural logarithm ...................................................................... 196
CDSIN (see sin) ...................................................... Computes sine ........................................................................................... 323
CDSQRT (see sqrt) .................................................. Computes square root ................................................................................ 333
CEILING (see ceiling) ........................................ Returns the least integer greater than or equal to a .................................... 41
ceiling .................................................................... Returns the least integer greater than or equal to a .................................... 41
CEXP (see exp) ......................................................... Computes exponential function ................................................................. 104
CHAR (see char) ...................................................... Performs conversion and positioning functions .......................................... 42
char ........................................................................... Performs conversion and positioning functions .......................................... 42
CLEAR_IEEE_EXCEPTION
(see clear_ieee_exception) ............................. Clears floating-point exception indicator .................................................... 44
clear_ieee_exception ...................................... Clears floating-point exception indicator .................................................... 44
CLOC (see cloc) ...................................................... Obtains the Fortran Character Descriptor (FCD) of a character entity ...... 46
cloc ........................................................................... Obtains the Fortran Character Descriptor (FCD) of a character entity ...... 46
CLOCK (see clock) .................................................. Returns the current time .............................................................................. 47
clock ......................................................................... Returns the current time .............................................................................. 47
CLOG (see log) ......................................................... Computes natural logarithm ...................................................................... 196
CMPLX (see cmplx) .................................................. Converts to type complex ............................................................................ 48
cmplx ......................................................................... Converts to type complex ............................................................................ 48
cmr .............................................................................. Assures completion of memory references ................................................. 50
_cmr (see cmr) ......................................................... Assures completion of memory references ................................................. 50
COMPARE_AND_SWAP (see sync) .......................... Fortran synchronization intrinsics for multiprocessing ............................. 337
COMPL (see compl) .................................................. Computes complement ................................................................................ 51
compl ......................................................................... Computes complement ................................................................................ 51
CONJG (see conjg) .................................................. Computes conjugate of a complex number ................................................. 53
conjg ......................................................................... Computes conjugate of a complex number ................................................. 53
COS (see cos) ........................................................... Computes cosine .......................................................................................... 55
cos .............................................................................. Computes cosine .......................................................................................... 55
COSD (see cos) ......................................................... Computes cosine .......................................................................................... 55
COSH (see cosh) ...................................................... Computes hyperbolic cosine ........................................................................ 57
cosh ........................................................................... Computes hyperbolic cosine ........................................................................ 57
COT (see cot) ........................................................... Computes cotangent .................................................................................... 59
cot .............................................................................. Computes cotangent .................................................................................... 59
COTAN (see cot) ...................................................... Computes cotangent .................................................................................... 59
COUNT (see count) .................................................. Counts the number of true array elements .................................................. 61
count ......................................................................... Counts the number of true array elements .................................................. 61
CPU_TIME (see cpu_time) .................................... Returns the processor time .......................................................................... 63
cpu_time .................................................................. Returns the processor time .......................................................................... 63
CQABS (see abs) ...................................................... Computes absolute value ............................................................................... 1
CQCOS (see cos) ...................................................... Computes cosine .......................................................................................... 55

x 004– 2138– 003


CQCOTAN (see cot) .................................................. Computes cotangent .................................................................................... 59
CQEXP (see exp) ...................................................... Computes exponential function ................................................................. 104
CQLOG (see log) ...................................................... Computes natural logarithm ...................................................................... 196
CQSIN (see sin) ...................................................... Computes sine ........................................................................................... 323
CQSQRT (see sqrt) .................................................. Computes square root ................................................................................ 333
CSHIFT (see cshift) ............................................. Performs a circular shift on an array expression ........................................ 65
cshift ....................................................................... Performs a circular shift on an array expression ........................................ 65
CSIN (see sin) ......................................................... Computes sine ........................................................................................... 323
CSMG (see csmg) ...................................................... Performs a conditional scalar merge ........................................................... 67
csmg ........................................................................... Performs a conditional scalar merge ........................................................... 67
CSQRT (see sqrt) .................................................... Computes square root ................................................................................ 333
cvmg ........................................................................... Conditional vector merge functions ............................................................ 69
CVMGM (see cvmg) .................................................... Conditional vector merge functions ............................................................ 69
CVMGN (see cvmg) .................................................... Conditional vector merge functions ............................................................ 69
CVMGP (see cvmg) .................................................... Conditional vector merge functions ............................................................ 69
CVMGT (see cvmg) .................................................... Conditional vector merge functions ............................................................ 69
CVMGZ (see cvmg) .................................................... Conditional vector merge functions ............................................................ 69
DABS (see abs) ......................................................... Computes absolute value ............................................................................... 1
DACOS (see acos) .................................................... Computes arc cosine (inverse cosine) ........................................................... 3
DACOSD (see acos) .................................................. Computes arc cosine (inverse cosine) ........................................................... 3
DASIN (see asin) .................................................... Computes arc sine (inverse sine) ................................................................ 22
DASIND (see asin) .................................................. Computes arc sine (inverse sine) ................................................................ 22
DATAN (see atan) .................................................... Computes arctangent (inverse tangent) for single argument ....................... 29
DATAN2 (see atan2) ............................................... Computes arc tangent (inverse tangent) for two arguments ....................... 26
DATAN2D (see atan2) ............................................. Computes arc tangent (inverse tangent) for two arguments ....................... 26
DATAND (see atan) .................................................. Computes arctangent (inverse tangent) for single argument ....................... 29
DATE (see date) ...................................................... Returns the current date .............................................................................. 72
date ........................................................................... Returns the current date .............................................................................. 72
DATE_AND_TIME (see date_and_time) ............ Returns data on the real-time clock and date .............................................. 73
date_and_time ...................................................... Returns data on the real-time clock and date .............................................. 73
DBLE (see dble) ...................................................... Converts to double-precision real ................................................................ 76
dble ........................................................................... Converts to double-precision real ................................................................ 76
DCMPLX (see cmplx) ............................................... Converts to type complex ............................................................................ 48
DCONJG (see conjg) ............................................... Computes conjugate of a complex number ................................................. 53
DCOS (see cos) ......................................................... Computes cosine .......................................................................................... 55
DCOSD (see cos) ...................................................... Computes cosine .......................................................................................... 55
DCOSH (see cosh) .................................................... Computes hyperbolic cosine ........................................................................ 57
DCOT (see cot) ......................................................... Computes cotangent .................................................................................... 59
DCOTAN (see cot) .................................................... Computes cotangent .................................................................................... 59
DDIM (see dim) ......................................................... Computes positive difference of two numbers ............................................ 79
DEXP (see exp) ......................................................... Computes exponential function ................................................................. 104
DFLOAT (see real) .................................................. Converts to type real ................................................................................. 278
DFLOATI (see real) ............................................... Converts to type real ................................................................................. 278
DFLOATJ (see real) ............................................... Converts to type real ................................................................................. 278
DFLOATK (see real) ............................................... Converts to type real ................................................................................. 278
DIGITS (see digits) ............................................. Returns the number of significant digits ..................................................... 77
digits ....................................................................... Returns the number of significant digits ..................................................... 77
DIM (see dim) ........................................................... Computes positive difference of two numbers ............................................ 79
dim .............................................................................. Computes positive difference of two numbers ............................................ 79
DIMAG (see aimag) .................................................. Returns imaginary part of a complex number .............................................. 9
DINT (see aint) ...................................................... Performs truncation to integer ..................................................................... 11

004– 2138– 003 xi


DISABLE_IEEE_INTERRUPT
(see enable_ieee_interrupt) ........................... Enables or disables floating-point interrupt ................................................. 92
DLOG (see log) ......................................................... Computes natural logarithm ...................................................................... 196
DLOG10 (see log10) ............................................... Computes common logarithm ................................................................... 193
DMAX1 (see max) ...................................................... Returns maximum values .......................................................................... 207
DMIN1 (see min) ...................................................... Returns minimum values ........................................................................... 219
DMOD (see mod) ......................................................... Computes remainder .................................................................................. 228
DNINT (see anint) .................................................. Finds nearest whole number ........................................................................ 18
DOT_PRODUCT (see dot_product) ...................... Performs dot-product multiplication of numeric or logical vectors ............ 81
dot_product ........................................................... Performs dot-product multiplication of numeric or logical vectors ............ 81
DPROD (see dprod) .................................................. Computes double-precision or quad-precision product of two real
numbers ....................................................................................................... 83
dprod ......................................................................... Computes double-precision or quad-precision product of two real
numbers ....................................................................................................... 83
DREAL (see real) .................................................... Converts to type real ................................................................................. 278
DSHIFTL (see dshiftl) ........................................ Performs a double-object left shift .............................................................. 85
dshiftl .................................................................... Performs a double-object left shift .............................................................. 85
_dshiftl (see dshiftl) ...................................... Performs a double-object left shift .............................................................. 85
DSHIFTR (see dshiftr) ........................................ Performs a double-object right shift ............................................................ 87
dshiftr .................................................................... Performs a double-object right shift ............................................................ 87
_dshiftr (see dshiftr) ...................................... Performs a double-object right shift ............................................................ 87
DSIGN (see sign) .................................................... Transfers the sign of numbers ................................................................... 321
DSIN (see sin) ......................................................... Computes sine ........................................................................................... 323
DSIND (see sin) ...................................................... Computes sine ........................................................................................... 323
DSINH (see sinh) .................................................... Computes hyperbolic sine ......................................................................... 325
dsm .............................................................................. Query intrinsics for distributed arrays ......................................................... 89
DSM_CHUNKSIZE (see dsm) .................................... Query intrinsics for distributed arrays ......................................................... 89
DSM_DISTRIBUTION_BLOCK (see dsm) ............... Query intrinsics for distributed arrays ......................................................... 89
DSM_DISTRIBUTION_CYCLIC (see dsm) ............ Query intrinsics for distributed arrays ......................................................... 89
DSM_DISTRIBUTION_STAR (see dsm) ................. Query intrinsics for distributed arrays ......................................................... 89
DSM_ISDISTRIBUTED (see dsm) .......................... Query intrinsics for distributed arrays ......................................................... 89
DSM_ISRESHAPED (see dsm) ................................. Query intrinsics for distributed arrays ......................................................... 89
DSM_NUMCHUNKS (see dsm) .................................... Query intrinsics for distributed arrays ......................................................... 89
DSM_NUMTHREADS (see dsm) ................................. Query intrinsics for distributed arrays ......................................................... 89
DSM_REM_CHUNKSIZE (see dsm) .......................... Query intrinsics for distributed arrays ......................................................... 89
DSM_THIS_CHUNKSIZE (see dsm) ........................ Query intrinsics for distributed arrays ......................................................... 89
DSM_THIS_STARTINGINDEX (see dsm) ............... Query intrinsics for distributed arrays ......................................................... 89
DSM_THIS_THREADNUM (see dsm) ........................ Query intrinsics for distributed arrays ......................................................... 89
DSQRT (see sqrt) .................................................... Computes square root ................................................................................ 333
DTAN (see tan) ......................................................... Computes tangent ...................................................................................... 342
DTAND (see tan) ...................................................... Computes tangent ...................................................................................... 342
DTANH (see tanh) .................................................... Computes hyperbolic tangent .................................................................... 344
ENABLE_IEEE_INTERRUPT
(see enable_ieee_interrupt) ........................... Enables or disables floating-point interrupt ................................................. 92
enable_ieee_interrupt ................................... Enables or disables floating-point interrupt ................................................. 92
EOSHIFT (see eoshift) ........................................ Performs an end-off shift on an array expression ....................................... 95
eoshift .................................................................... Performs an end-off shift on an array expression ....................................... 95
EPSILON (see epsilon) ........................................ Returns r-1, where r is the smallest number greater than 1 in the
numeric model ............................................................................................. 97
epsilon .................................................................... Returns r-1, where r is the smallest number greater than 1 in the
numeric model ............................................................................................. 97

xii 004– 2138– 003


EQV (see eqv) ........................................................... Computes logical equivalence or difference ............................................... 99
eqv .............................................................................. Computes logical equivalence or difference ............................................... 99
ex ................................................................................ Performs a normal exit .............................................................................. 103
EXP (see exp) ........................................................... Computes exponential function ................................................................. 104
_EX (see ex) ............................................................. Performs a normal exit .............................................................................. 103
exp .............................................................................. Computes exponential function ................................................................. 104
EXPONENT (see exponent) .................................... Returns the exponent part of the argument when represented as a
numeric model number .............................................................................. 106
exponent .................................................................. Returns the exponent part of the argument when represented as a
numeric model number .............................................................................. 106
FCD (see fcd) ........................................................... Constructs a Cray character pointer in Fortran character Descriptor
(FCD) format ............................................................................................. 107
fcd .............................................................................. Constructs a Cray character pointer in Fortran character Descriptor
(FCD) format ............................................................................................. 107
FETCH_AND_ADD (see sync) ................................. Fortran synchronization intrinsics for multiprocessing ............................. 337
FETCH_AND_AND (see sync) ................................. Fortran synchronization intrinsics for multiprocessing ............................. 337
FETCH_AND_NAND (see sync) ............................... Fortran synchronization intrinsics for multiprocessing ............................. 337
FETCH_AND_OR (see sync) .................................... Fortran synchronization intrinsics for multiprocessing ............................. 337
FETCH_AND_SUB (see sync) ................................. Fortran synchronization intrinsics for multiprocessing ............................. 337
FETCH_AND_XOR (see sync) ................................. Fortran synchronization intrinsics for multiprocessing ............................. 337
FLOAT (see real) .................................................... Converts to type real ................................................................................. 278
FLOATI (see real) .................................................. Converts to type real ................................................................................. 278
FLOATJ (see real) .................................................. Converts to type real ................................................................................. 278
FLOATK (see real) .................................................. Converts to type real ................................................................................. 278
FLOOR (see floor) .................................................. Returns the greatest integer less than or equal to a .................................. 108
floor ......................................................................... Returns the greatest integer less than or equal to a .................................. 108
FRACTION (see fraction) .................................... Returns the fractional part of the numeric model representation of the
argument value .......................................................................................... 109
fraction .................................................................. Returns the fractional part of the numeric model representation of the
argument value .......................................................................................... 109
FREE (see malloc) .................................................. Allocates and deallocates main memory ................................................... 200
gbit ........................................................................... Returns the value of the nth bit (from the right) ...................................... 110
_gbit (see gbit) .................................................... Returns the value of the nth bit (from the right) ...................................... 110
_gbits (see gbit) .................................................. Returns the value of the nth bit (from the right) ...................................... 110
GET_IEEE_EXCEPTIONS
(see get_ieee_exceptions) ............................... Retrieves flags that represent the current floating-point exception
status .......................................................................................................... 112
get_ieee_exceptions ........................................ Retrieves flags that represent the current floating-point exception
status .......................................................................................................... 112
GET_IEEE_INTERRUPTS
(see get_ieee_interrupts) ............................... Retrieves flags that represent the current floating-point interrupt status .. 114
get_ieee_interrupts ........................................ Retrieves flags that represent the current floating-point interrupt status .. 114
GET_IEEE_ROUNDING_MODE
(see get_ieee_rounding_mode) ........................ Returns current floating-point rounding mode .......................................... 116
get_ieee_rounding_mode ................................. Returns current floating-point rounding mode .......................................... 116
GET_IEEE_STATUS (see get_ieee_status) ... Retrieves flags that represent the current floating-point status upon
entry to a procedure .................................................................................. 118
get_ieee_status .................................................. Retrieves flags that represent the current floating-point status upon
entry to a procedure .................................................................................. 118
GETPOS (see getpos) ............................................. Obtains a file position or returns a file to a previous position ................. 120
getpos ....................................................................... Obtains a file position or returns a file to a previous position ................. 120

004– 2138– 003 xiii


getvm ......................................................................... Returns contents of or sets vector mask register ...................................... 123
_getvm (see getvm) ............................................... Returns contents of or sets vector mask register ...................................... 123
HUGE (see huge) ...................................................... Returns the largest number in the integer or real numeric model ............ 124
huge ........................................................................... Returns the largest number in the integer or real numeric model ............ 124
IABS (see abs) ......................................................... Computes absolute value ............................................................................... 1
IACHAR (see char) .................................................. Performs conversion and positioning functions .......................................... 42
IAND (see iand) ...................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
iand ........................................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
IBCHNG (see ibchng) ............................................. Sets, clears, or reverses the value of a specified bit in an integer ............ 129
ibchng ....................................................................... Sets, clears, or reverses the value of a specified bit in an integer ............ 129
IBCLR (see ibchng) ............................................... Sets, clears, or reverses the value of a specified bit in an integer ............ 129
IBITS (see ibits) .................................................. Extracts a sequence of bits ........................................................................ 131
ibits ......................................................................... Extracts a sequence of bits ........................................................................ 131
IBSET (see ibchng) ............................................... Sets, clears, or reverses the value of a specified bit in an integer ............ 129
ICHAR (see char) .................................................... Performs conversion and positioning functions .......................................... 42
IDATE (see idate) .................................................. Returns date or time in numerical form .................................................... 133
idate ......................................................................... Returns date or time in numerical form .................................................... 133
IDIM (see dim) ......................................................... Computes positive difference of two numbers ............................................ 79
IDINT (see int) ...................................................... Converts to type integer ............................................................................ 158
IDNINT (see nint) .................................................. Converts to nearest integer ........................................................................ 241
IEEE_BINARY_SCALE
(see ieee_binary_scale) .................................... Returns y multiplied by 2**n .................................................................... 134
ieee_binary_scale ............................................. Returns y multiplied by 2**n .................................................................... 134
IEEE_CLASS (see ieee_class) .......................... Returns the class to which x belongs ........................................................ 136
ieee_class ............................................................. Returns the class to which x belongs ........................................................ 136
IEEE_COPY_SIGN (see ieee_copy_sign) ....... Returns x with the sign of y ...................................................................... 138
ieee_copy_sign .................................................... Returns x with the sign of y ...................................................................... 138
IEEE_EXPONENT (see ieee_exponent) ............ Returns the unbiased exponent of x .......................................................... 140
ieee_exponent ...................................................... Returns the unbiased exponent of x .......................................................... 140
IEEE_FINITE (see ieee_finite) ...................... Tests for x being greater than negative infinity and less than positive
infinity. ....................................................................................................... 143
ieee_finite ........................................................... Tests for x being greater than negative infinity and less than positive
infinity. ....................................................................................................... 143
IEEE_INT (see ieee_int) .................................... Converts x to an integral value ................................................................. 144
ieee_int .................................................................. Converts x to an integral value ................................................................. 144
IEEE_IS_NAN (see ieee_is_nan) ...................... Tests for x being a NaN ............................................................................ 146
ieee_is_nan ........................................................... Tests for x being a NaN ............................................................................ 146
IEEE_NEXT_AFTER (see ieee_next_after) ... Returns the next representable neighbor of x in the direction toward y ... 148
ieee_next_after .................................................. Returns the next representable neighbor of x in the direction toward y ... 148
IEEE_REAL (see ieee_real) ............................... Converts x to a real value ......................................................................... 150
ieee_real ................................................................ Converts x to a real value ......................................................................... 150
IEEE_REMAINDER (see ieee_remainder) ....... Returns the remainder of x divided by y ................................................... 152
ieee_remainder .................................................... Returns the remainder of x divided by y ................................................... 152
IEEE_UNORDERED (see ieee_unordered) ....... Tests for x or y being a NaN .................................................................... 154
ieee_unordered .................................................... Tests for x or y being a NaN .................................................................... 154
IEOR (see iand) ...................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
IFIX (see int) ......................................................... Converts to type integer ............................................................................ 158
IIABS (see abs) ...................................................... Computes absolute value ............................................................................... 1
IIAND (see iand) .................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
IIBCHNG (see ibchng) ........................................... Sets, clears, or reverses the value of a specified bit in an integer ............ 129
IIBCLR (see ibchng) ............................................. Sets, clears, or reverses the value of a specified bit in an integer ............ 129

xiv 004– 2138– 003


IIBITS (see ibits) ............................................... Extracts a sequence of bits ........................................................................ 131
IIBSET (see ibchng) ............................................. Sets, clears, or reverses the value of a specified bit in an integer ............ 129
IIDIM (see dim) ...................................................... Computes positive difference of two numbers ............................................ 79
IIDINT (see int) .................................................... Converts to type integer ............................................................................ 158
IIEOR (see iand) .................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
IIFIX (see int) ...................................................... Converts to type integer ............................................................................ 158
IINT (see int) ......................................................... Converts to type integer ............................................................................ 158
IIOR (see iand) ...................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
IIQINT (see int) .................................................... Converts to type integer ............................................................................ 158
IISHA (see isha) .................................................... Performs arithmetic shift on an integer ..................................................... 173
IISHC (see ishc) .................................................... Performs circular shift on an integer ......................................................... 174
IISHFT (see ishft) ............................................... Performs a logical shift ............................................................................. 175
IISHFTC (see ishftc) ........................................... Performs a circular shift of the rightmost bits .......................................... 177
IISHL (see ishl) .................................................... Performs logical shift with zero fill .......................................................... 179
IISIGN (see sign) .................................................. Transfers the sign of numbers ................................................................... 321
IMAG (see aimag) .................................................... Returns imaginary part of a complex number .............................................. 9
IMOD (see mod) ......................................................... Computes remainder .................................................................................. 228
INDEX (see index) .................................................. Determines the starting location of a character substring in a string ....... 156
index ......................................................................... Determines the starting location of a character substring in a string ....... 156
INOT (see not) ......................................................... Performs a logical complement ................................................................. 243
INT (see int) ........................................................... Converts to type integer ............................................................................ 158
int .............................................................................. Converts to type integer ............................................................................ 158
INT_MULT_UPPER (see int_mult_upper) ....... Multiplies integers and returns the uppermost bits ................................... 160
int_mult_upper .................................................... Multiplies integers and returns the uppermost bits ................................... 160
_int_mult_upper (see int_mult_upper) ..... Multiplies integers and returns the uppermost bits ................................... 160
INTRO_INTRIN (see intro_intrin) ................. Introduction to intrinsic procedures ........................................................... 162
intro_intrin ......................................................... Introduction to intrinsic procedures ........................................................... 162
IOR (see iand) ......................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
IQINT (see int) ...................................................... Converts to type integer ............................................................................ 158
IQNINT (see nint) .................................................. Converts to nearest integer ........................................................................ 241
IRTC (see rtc) ......................................................... Returns clock register contents .................................................................. 287
IRTC_RATE (see rtc) ............................................. Returns clock register contents .................................................................. 287
ISHA (see isha) ...................................................... Performs arithmetic shift on an integer ..................................................... 173
isha ........................................................................... Performs arithmetic shift on an integer ..................................................... 173
ISHC (see ishc) ...................................................... Performs circular shift on an integer ......................................................... 174
ishc ........................................................................... Performs circular shift on an integer ......................................................... 174
ISHFT (see ishft) .................................................. Performs a logical shift ............................................................................. 175
ishft ......................................................................... Performs a logical shift ............................................................................. 175
ISHFTC (see ishftc) ............................................. Performs a circular shift of the rightmost bits .......................................... 177
ishftc ....................................................................... Performs a circular shift of the rightmost bits .......................................... 177
ISHL (see ishl) ...................................................... Performs logical shift with zero fill .......................................................... 179
ishl ........................................................................... Performs logical shift with zero fill .......................................................... 179
ISIGN (see sign) .................................................... Transfers the sign of numbers ................................................................... 321
ISNAN (see ieee_is_nan) .................................... Tests for x being a NaN ............................................................................ 146
ITIME (see idate) .................................................. Returns date or time in numerical form .................................................... 133
JDATE (see date) .................................................... Returns the current date .............................................................................. 72
JIABS (see abs) ...................................................... Computes absolute value ............................................................................... 1
JIAND (see iand) .................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
JIBCHNG (see ibchng) ........................................... Sets, clears, or reverses the value of a specified bit in an integer ............ 129
JIBCLR (see ibchng) ............................................. Sets, clears, or reverses the value of a specified bit in an integer ............ 129
JIBITS (see ibits) ............................................... Extracts a sequence of bits ........................................................................ 131

004– 2138– 003 xv


JIBSET (see ibchng) ............................................. Sets, clears, or reverses the value of a specified bit in an integer ............ 129
JIDIM (see dim) ...................................................... Computes positive difference of two numbers ............................................ 79
JIDINT (see int) .................................................... Converts to type integer ............................................................................ 158
JIEOR (see iand) .................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
JIFIX (see int) ...................................................... Converts to type integer ............................................................................ 158
JINT (see int) ......................................................... Converts to type integer ............................................................................ 158
JIOR (see iand) ...................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
JIQINT (see int) .................................................... Converts to type integer ............................................................................ 158
JISHA (see isha) .................................................... Performs arithmetic shift on an integer ..................................................... 173
JISHC (see ishc) .................................................... Performs circular shift on an integer ......................................................... 174
JISHFT (see ishft) ............................................... Performs a logical shift ............................................................................. 175
JISHFTC (see ishftc) ........................................... Performs a circular shift of the rightmost bits .......................................... 177
JISHL (see ishl) .................................................... Performs logical shift with zero fill .......................................................... 179
JISIGN (see sign) .................................................. Transfers the sign of numbers ................................................................... 321
JMOD (see mod) ......................................................... Computes remainder .................................................................................. 228
JNOT (see not) ......................................................... Performs a logical complement ................................................................. 243
KIABS (see abs) ...................................................... Computes absolute value ............................................................................... 1
KIAND (see iand) .................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
KIBCHNG (see ibchng) ........................................... Sets, clears, or reverses the value of a specified bit in an integer ............ 129
KIBCLR (see ibchng) ............................................. Sets, clears, or reverses the value of a specified bit in an integer ............ 129
KIBITS (see ibits) ............................................... Extracts a sequence of bits ........................................................................ 131
KIBSET (see ibchng) ............................................. Sets, clears, or reverses the value of a specified bit in an integer ............ 129
KIDIM (see dim) ...................................................... Computes positive difference of two numbers ............................................ 79
KIDINT (see int) .................................................... Converts to type integer ............................................................................ 158
KIEOR (see iand) .................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
KIFIX (see int) ...................................................... Converts to type integer ............................................................................ 158
KIND (see kind) ...................................................... Returns the value of the kind type parameter of x ................................... 180
kind ........................................................................... Returns the value of the kind type parameter of x ................................... 180
KINT (see int) ......................................................... Converts to type integer ............................................................................ 158
KIOR (see iand) ...................................................... Performs a logical AND, an exclusive OR, or an inclusive OR ................. 126
KIQINT (see int) .................................................... Converts to type integer ............................................................................ 158
KISHA (see isha) .................................................... Performs arithmetic shift on an integer ..................................................... 173
KISHC (see ishc) .................................................... Performs circular shift on an integer ......................................................... 174
KISHFT (see ishft) ............................................... Performs a logical shift ............................................................................. 175
KISHFTC (see ishftc) ........................................... Performs a circular shift of the rightmost bits .......................................... 177
KISHL (see ishl) .................................................... Performs logical shift with zero fill .......................................................... 179
KISIGN (see sign) .................................................. Transfers the sign of numbers ................................................................... 321
KMOD (see mod) ......................................................... Computes remainder .................................................................................. 228
KNOT (see not) ......................................................... Performs a logical complement ................................................................. 243
LBOUND (see lbound) ............................................. Returns all the lower bounds or a specified lower bound of an array ...... 181
lbound ....................................................................... Returns all the lower bounds or a specified lower bound of an array ...... 181
LEADZ (see leadz) .................................................. Counts number of leading 0 bits ............................................................... 183
leadz ......................................................................... Counts number of leading 0 bits ............................................................... 183
_leadz (see leadz) ............................................... Counts number of leading 0 bits ............................................................... 183
LEN (see len) ........................................................... Determines the length of a character string .............................................. 185
len .............................................................................. Determines the length of a character string .............................................. 185
LENGTH (see length) ............................................. Returns the number of words transferred .................................................. 186
length ....................................................................... Returns the number of words transferred .................................................. 186
LEN_TRIM (see len_trim) .................................... Returns the length of the character argument without counting trailing
blank characters ......................................................................................... 188

xvi 004– 2138– 003


len_trim .................................................................. Returns the length of the character argument without counting trailing
blank characters ......................................................................................... 188
LGE (see lge) ........................................................... Compares strings lexically ........................................................................ 189
lge .............................................................................. Compares strings lexically ........................................................................ 189
LGT (see lge) ........................................................... Compares strings lexically ........................................................................ 189
LLE (see lge) ........................................................... Compares strings lexically ........................................................................ 189
LLT (see lge) ........................................................... Compares strings lexically ........................................................................ 189
LOC (see loc) ........................................................... Obtains the address of a variable .............................................................. 191
loc .............................................................................. Obtains the address of a variable .............................................................. 191
LOCK_RELEASE (see sync) .................................... Fortran synchronization intrinsics for multiprocessing ............................. 337
LOCK_TEST_AND_SET (see sync) ........................ Fortran synchronization intrinsics for multiprocessing ............................. 337
LOG (see log) ........................................................... Computes natural logarithm ...................................................................... 196
log .............................................................................. Computes natural logarithm ...................................................................... 196
LOG10 (see log10) .................................................. Computes common logarithm ................................................................... 193
log10 ......................................................................... Computes common logarithm ................................................................... 193
LOG2_IMAGES (see log2_images) ...................... Returns the base 2 logarithm of the number of executing images
truncated to an integer ............................................................................... 195
log2_images ........................................................... Returns the base 2 logarithm of the number of executing images
truncated to an integer ............................................................................... 195
LOGICAL (see logical) ........................................ Converts between kinds of logical ............................................................ 198
logical .................................................................... Converts between kinds of logical ............................................................ 198
LONG (see long) ...................................................... Returns integer (KIND=4) result ............................................................... 199
long ........................................................................... Returns integer (KIND=4) result ............................................................... 199
LSHIFT (see ishft) ............................................... Performs a logical shift ............................................................................. 175
MALLOC (see malloc) ............................................. Allocates and deallocates main memory ................................................... 200
malloc ....................................................................... Allocates and deallocates main memory ................................................... 200
MASK (see mask) ...................................................... Returns a bit mask ..................................................................................... 202
mask ........................................................................... Returns a bit mask ..................................................................................... 202
_mask (see mask) .................................................... Returns a bit mask ..................................................................................... 202
_maskl (see mask) .................................................. Returns a bit mask ..................................................................................... 202
_maskr (see mask) .................................................. Returns a bit mask ..................................................................................... 202
MATMUL (see matmul) ............................................. Performs matrix multiplication of numeric or logical matrices ................ 205
matmul ....................................................................... Performs matrix multiplication of numeric or logical matrices ................ 205
MAX (see max) ........................................................... Returns maximum values .......................................................................... 207
max .............................................................................. Returns maximum values .......................................................................... 207
MAX0 (see max) ......................................................... Returns maximum values .......................................................................... 207
MAX1 (see max) ......................................................... Returns maximum values .......................................................................... 207
MAXEXPONENT (see maxexponent) ...................... Returns the maximum exponent in the numeric model ............................ 209
maxexponent ........................................................... Returns the maximum exponent in the numeric model ............................ 209
MAXLOC (see maxloc) ............................................. Returns the location of a maximum value in an array ............................. 211
maxloc ....................................................................... Returns the location of a maximum value in an array ............................. 211
MAXVAL (see maxval) ............................................. Returns the maximum value in an array ................................................... 214
maxval ....................................................................... Returns the maximum value in an array ................................................... 214
M@CLR (see bmm) ...................................................... Performs bit matrix multiply operations ..................................................... 33
_mclr (see bmm) ...................................................... Performs bit matrix multiply operations ..................................................... 33
MEMORY_BARRIER (see memory_barrier) ....... Blocks subsequent memory load and store operations until all
previous loads and stores finish ................................................................ 216
memory_barrier .................................................... Blocks subsequent memory load and store operations until all
previous loads and stores finish ................................................................ 216
_memory_barrier (see memory_barrier) ..... Blocks subsequent memory load and store operations until all
previous loads and stores finish ................................................................ 216

004– 2138– 003 xvii


MERGE (see merge) .................................................. Chooses an alternative value according to the value of a mask ............... 217
merge ......................................................................... Chooses an alternative value according to the value of a mask ............... 217
MIN (see min) ........................................................... Returns minimum values ........................................................................... 219
min .............................................................................. Returns minimum values ........................................................................... 219
MIN0 (see min) ......................................................... Returns minimum values ........................................................................... 219
MIN1 (see min) ......................................................... Returns minimum values ........................................................................... 219
MINEXPONENT (see minexponent) ...................... Returns the minimum (most negative) exponent of a real number in
the numeric model ..................................................................................... 221
minexponent ........................................................... Returns the minimum (most negative) exponent of a real number in
the numeric model ..................................................................................... 221
MINLOC (see minloc) ............................................. Returns the location of a minimum value in an array .............................. 223
minloc ....................................................................... Returns the location of a minimum value in an array .............................. 223
MINVAL (see minval) ............................................. Returns the minimum value in an array .................................................... 226
minval ....................................................................... Returns the minimum value in an array .................................................... 226
M@LD (see bmm) ......................................................... Performs bit matrix multiply operations ..................................................... 33
_mld (see bmm) ......................................................... Performs bit matrix multiply operations ..................................................... 33
M@LDMX (see bmm) .................................................... Performs bit matrix multiply operations ..................................................... 33
_mldmx (see bmm) .................................................... Performs bit matrix multiply operations ..................................................... 33
M@MX (see bmm) ......................................................... Performs bit matrix multiply operations ..................................................... 33
_mmx (see bmm) ......................................................... Performs bit matrix multiply operations ..................................................... 33
MOD (see mod) ........................................................... Computes remainder .................................................................................. 228
mod .............................................................................. Computes remainder .................................................................................. 228
MODELS (see models) ............................................. Describes mathematical representation models for CF90 and MIPSpro
7 Fortran 90 compiler intrinsic procedures ............................................... 230
models ....................................................................... Describes mathematical representation models for CF90 and MIPSpro
7 Fortran 90 compiler intrinsic procedures ............................................... 230
MODULO (see modulo) ............................................. Modulo function ........................................................................................ 235
modulo ....................................................................... Modulo function ........................................................................................ 235
M@UL (see bmm) ......................................................... Performs bit matrix multiply operations ..................................................... 33
_mul (see bmm) ......................................................... Performs bit matrix multiply operations ..................................................... 33
MVBITS (see mvbits) ............................................. Copies a sequence of bits from one integer data object to another .......... 237
mvbits ....................................................................... Copies a sequence of bits from one integer data object to another .......... 237
MY_PE (see my_pe) .................................................. Returns the processing element (PE) number of the calling PE ............... 238
my_pe ......................................................................... Returns the processing element (PE) number of the calling PE ............... 238
_my_pe (see my_pe) ............................................... Returns the processing element (PE) number of the calling PE ............... 238
NAND_AND_FETCH (see sync) ............................... Fortran synchronization intrinsics for multiprocessing ............................. 337
NEAREST (see nearest) ........................................ Returns the nearest different machine representable number in a
given direction ........................................................................................... 240
nearest .................................................................... Returns the nearest different machine representable number in a
given direction ........................................................................................... 240
NEQV (see eqv) ......................................................... Computes logical equivalence or difference ............................................... 99
NINT (see nint) ...................................................... Converts to nearest integer ........................................................................ 241
nint ........................................................................... Converts to nearest integer ........................................................................ 241
NOT (see not) ........................................................... Performs a logical complement ................................................................. 243
not .............................................................................. Performs a logical complement ................................................................. 243
NULL (see null) ...................................................... Returns a disassociated pointer ................................................................. 245
null ........................................................................... Returns a disassociated pointer ................................................................. 245
NUMARG (see numarg) ............................................. Returns the number of arguments in a function or subprogram call ........ 247
numarg ....................................................................... Returns the number of arguments in a function or subprogram call ........ 247
_numargs (see numarg) ........................................ Returns the number of arguments in a function or subprogram call ........ 247
NUM_IMAGES (see num_images) .......................... Retrieves total number of images executing ............................................. 250

xviii 004– 2138– 003


num_images ............................................................. Retrieves total number of images executing ............................................. 250
NUM_PES (see num_pes) ........................................ Returns the number of processing elements (PEs) running in an
application ................................................................................................. 251
num_pes .................................................................... Returns the number of processing elements (PEs) running in an
application ................................................................................................. 251
_num_pes (see num_pes) ...................................... Returns the number of processing elements (PEs) running in an
application ................................................................................................. 251
OR (see or) ................................................................ Computes logical sum ............................................................................... 252
or ................................................................................ Computes logical sum ............................................................................... 252
OR_AND_FETCH (see sync) .................................... Fortran synchronization intrinsics for multiprocessing ............................. 337
PACK (see pack) ...................................................... Packs an array into an array of rank one under control of a mask .......... 254
pack ........................................................................... Packs an array into an array of rank one under control of a mask .......... 254
pbit ........................................................................... Returns the value of a data word .............................................................. 256
_pbit (see pbit) .................................................... Returns the value of a data word .............................................................. 256
_pbits (see pbit) .................................................. Returns the value of a data word .............................................................. 256
POPCNT (see popcnt) ............................................. Counts number of set bits ......................................................................... 258
popcnt ....................................................................... Counts number of set bits ......................................................................... 258
_popcnt (see popcnt) ........................................... Counts number of set bits ......................................................................... 258
POPPAR (see poppar) ............................................. Computes bit population parity ................................................................. 260
poppar ....................................................................... Computes bit population parity ................................................................. 260
_poppar (see poppar) ........................................... Computes bit population parity ................................................................. 260
PRECISION (see precision) ............................... Returns the decimal precision of a number in the real number model .... 262
precision ................................................................ Returns the decimal precision of a number in the real number model .... 262
PRESENT (see present) ........................................ Determines whether an optional argument is present ............................... 264
present .................................................................... Determines whether an optional argument is present ............................... 264
PRODUCT (see product) ........................................ Forms the product of array elements ........................................................ 265
product .................................................................... Forms the product of array elements ........................................................ 265
QABS (see abs) ......................................................... Computes absolute value ............................................................................... 1
QACOS (see acos) .................................................... Computes arc cosine (inverse cosine) ........................................................... 3
QACOSD (see acos) .................................................. Computes arc cosine (inverse cosine) ........................................................... 3
QASIN (see asin) .................................................... Computes arc sine (inverse sine) ................................................................ 22
QASIND (see asin) .................................................. Computes arc sine (inverse sine) ................................................................ 22
QATAN (see atan) .................................................... Computes arctangent (inverse tangent) for single argument ....................... 29
QATAN2 (see atan2) ............................................... Computes arc tangent (inverse tangent) for two arguments ....................... 26
QATAN2D (see atan2) ............................................. Computes arc tangent (inverse tangent) for two arguments ....................... 26
QATAND (see atan) .................................................. Computes arctangent (inverse tangent) for single argument ....................... 29
QCMPLX (see cmplx) ............................................... Converts to type complex ............................................................................ 48
QCONJG (see conjg) ............................................... Computes conjugate of a complex number ................................................. 53
QCOS (see cos) ......................................................... Computes cosine .......................................................................................... 55
QCOSD (see cos) ...................................................... Computes cosine .......................................................................................... 55
QCOSH (see cosh) .................................................... Computes hyperbolic cosine ........................................................................ 57
QCOT (see cot) ......................................................... Computes cotangent .................................................................................... 59
QDIM (see dim) ......................................................... Computes positive difference of two numbers ............................................ 79
QEXP (see exp) ......................................................... Computes exponential function ................................................................. 104
QFLOAT (see real) .................................................. Converts to type real ................................................................................. 278
QFLOATI (see real) ............................................... Converts to type real ................................................................................. 278
QFLOATJ (see real) ............................................... Converts to type real ................................................................................. 278
QFLOATK (see real) ............................................... Converts to type real ................................................................................. 278
QIMAG (see aimag) .................................................. Returns imaginary part of a complex number .............................................. 9
QINT (see aint) ...................................................... Performs truncation to integer ..................................................................... 11
QLOG (see log) ......................................................... Computes natural logarithm ...................................................................... 196

004– 2138– 003 xix


QLOG10 (see log10) ............................................... Computes common logarithm ................................................................... 193
QMAX1 (see max) ...................................................... Returns maximum values .......................................................................... 207
QMIN1 (see min) ...................................................... Returns minimum values ........................................................................... 219
QMOD (see mod) ......................................................... Computes remainder .................................................................................. 228
QNINT (see anint) .................................................. Finds nearest whole number ........................................................................ 18
QPROD (see dprod) .................................................. Computes double-precision or quad-precision product of two real
numbers ....................................................................................................... 83
QREAL (see real) .................................................... Converts to type real ................................................................................. 278
QSIGN (see sign) .................................................... Transfers the sign of numbers ................................................................... 321
QSIN (see sin) ......................................................... Computes sine ........................................................................................... 323
QSIND (see sin) ...................................................... Computes sine ........................................................................................... 323
QSINH (see sinh) .................................................... Computes hyperbolic sine ......................................................................... 325
QSQRT (see sqrt) .................................................... Computes square root ................................................................................ 333
QTAN (see tan) ......................................................... Computes tangent ...................................................................................... 342
QTAND (see tan) ...................................................... Computes tangent ...................................................................................... 342
QTANH (see tanh) .................................................... Computes hyperbolic tangent .................................................................... 344
RADIX (see radix) .................................................. Returns the base number from the real or integer number models .......... 267
radix ......................................................................... Returns the base number from the real or integer number models .......... 267
ran .............................................................................. Computes pseudo-random numbers ........................................................... 268
RANDOM_NUMBER (see random_number) ............ Returns pseudorandom numbers ................................................................ 272
random_number ...................................................... Returns pseudorandom numbers ................................................................ 272
RANDOM_SEED (see random_seed) ...................... Restarts or queries the pseudorandom number generator ......................... 273
random_seed ........................................................... Restarts or queries the pseudorandom number generator ......................... 273
RANF (see ran) ......................................................... Computes pseudo-random numbers ........................................................... 268
_ranf (see ran) ...................................................... Computes pseudo-random numbers ........................................................... 268
RANGE (see range) .................................................. Returns the decimal exponent range of a number according to the
real or integer model ................................................................................. 274
range ......................................................................... Returns the decimal exponent range of a number according to the
real or integer model ................................................................................. 274
RANGET (see ran) .................................................... Computes pseudo-random numbers ........................................................... 268
RANSET (see ran) .................................................... Computes pseudo-random numbers ........................................................... 268
readSB ....................................................................... Returns status register value ...................................................................... 276
_readSB (see readSB) ........................................... Returns status register value ...................................................................... 276
readSR ....................................................................... Returns status register value ...................................................................... 277
_readSR (see readSR) ........................................... Returns status register value ...................................................................... 277
_readST (see readSB) ........................................... Returns status register value ...................................................................... 276
REAL (see real) ...................................................... Converts to type real ................................................................................. 278
real ........................................................................... Converts to type real ................................................................................. 278
REM_IMAGES (see rem_images) .......................... Returns MOD(NUM_IMAGES(), 2**LOG2_IMAGES()) ................... 280
rem_images ............................................................. Returns MOD(NUM_IMAGES(), 2**LOG2_IMAGES()) ................... 280
REMOTE_WRITE_BARRIER
(see remote_write_barrier) ............................. Blocks processor until remote write operations have finished .................. 281
remote_write_barrier ...................................... Blocks processor until remote write operations have finished .................. 281
_remote_write_barrier
(see remote_write_barrier) ............................. Blocks processor until remote write operations have finished .................. 281
REPEAT (see repeat) ............................................. Concatenates several copies of a string .................................................... 282
repeat ....................................................................... Concatenates several copies of a string .................................................... 282
RESHAPE (see reshape) ........................................ Constructs an array of a specified shape ................................................... 283
reshape .................................................................... Constructs an array of a specified shape ................................................... 283
RRSPACING (see rrspacing) ............................... Returns the reciprocal of the relative spacing of numeric model
numbers near the argument value ............................................................. 285

xx 004– 2138– 003


rrspacing ................................................................ Returns the reciprocal of the relative spacing of numeric model
numbers near the argument value ............................................................. 285
RSHIFT (see ishft) ............................................... Performs a logical shift ............................................................................. 175
RTC (see rtc) ........................................................... Returns clock register contents .................................................................. 287
rtc .............................................................................. Returns clock register contents .................................................................. 287
_rtc (see rtc) ......................................................... Returns clock register contents .................................................................. 287
SCALE (see scale) .................................................. Returns (x)(b**i), where b is the base in the real number model
representation of x ..................................................................................... 289
scale ......................................................................... Returns (x)(b**i), where b is the base in the real number model
representation of x ..................................................................................... 289
SCAN (see scan) ...................................................... Scans a string for any one of the characters in a set of characters .......... 290
scan ........................................................................... Scans a string for any one of the characters in a set of characters .......... 290
SELECTED_INT_KIND
(see selected_int_kind) .................................... Returns an integer kind type parameter .................................................... 292
selected_int_kind ............................................. Returns an integer kind type parameter .................................................... 292
SELECTED_REAL_KIND
(see selected_real_kind) .................................. Returns the real kind type parameter ........................................................ 294
selected_real_kind .......................................... Returns the real kind type parameter ........................................................ 294
semclr ....................................................................... Performs operations on the semaphore ..................................................... 299
_semclr (see semclr) ........................................... Performs operations on the semaphore ..................................................... 299
_semget (see semclr) ........................................... Performs operations on the semaphore ..................................................... 299
_semput (see semclr) ........................................... Performs operations on the semaphore ..................................................... 299
_semset (see semclr) ........................................... Performs operations on the semaphore ..................................................... 299
_semts (see semclr) ............................................. Performs operations on the semaphore ..................................................... 299
SET_EXPONENT (see set_exponent) ................. Sets exponent part of a number ................................................................ 300
set_exponent ......................................................... Sets exponent part of a number ................................................................ 300
SET_IEEE_EXCEPTION
(see set_ieee_exception) .................................. Sets floating-point exception indicator ...................................................... 302
set_ieee_exception .......................................... Sets floating-point exception indicator ...................................................... 302
SET_IEEE_EXCEPTIONS
(see set_ieee_exceptions) ............................... Restores the caller’s floating-point status prior to exiting a procedure .... 304
set_ieee_exceptions ........................................ Restores the caller’s floating-point status prior to exiting a procedure .... 304
SET_IEEE_INTERRUPTS
(see set_ieee_interrupts) ............................... Restores floating-point interrupt status before exiting a procedure .......... 305
set_ieee_interrupts ........................................ Restores floating-point interrupt status before exiting a procedure .......... 305
SET_IEEE_ROUNDING_MODE
(see set_ieee_rounding_mode) ........................ Alters current floating-point rounding mode state and restores the
floating-point rounding mode before exiting a procedure ......................... 306
set_ieee_rounding_mode ................................. Alters current floating-point rounding mode state and restores the
floating-point rounding mode before exiting a procedure ......................... 306
SET_IEEE_STATUS (see set_ieee_status) ... Restores floating-point status ..................................................................... 309
set_ieee_status .................................................. Restores floating-point status ..................................................................... 309
SETPOS (see getpos) ............................................. Obtains a file position or returns a file to a previous position ................. 120
_setvm (see getvm) ............................................... Returns contents of or sets vector mask register ...................................... 123
SHAPE (see shape) .................................................. Returns the shape of an array or a scalar ................................................. 311
shape ......................................................................... Returns the shape of an array or a scalar ................................................. 311
SHIFT (see shift) .................................................. Performs a left circular shift ..................................................................... 312
shift ......................................................................... Performs a left circular shift ..................................................................... 312
SHIFTA (see shifta) ............................................. Performs an arithmetic shift ...................................................................... 314
shifta ....................................................................... Performs an arithmetic shift ...................................................................... 314
SHIFTL (see shiftl) ............................................. Performs a left shift with zero fill ............................................................. 316

004– 2138– 003 xxi


shiftl ....................................................................... Performs a left shift with zero fill ............................................................. 316
SHIFTR (see shiftr) ............................................. Performs a right shift with zero fill ........................................................... 318
shiftr ....................................................................... Performs a right shift with zero fill ........................................................... 318
SHORT (see short) .................................................. Returns integer (KIND=2) result ............................................................... 320
short ......................................................................... Returns integer (KIND=2) result ............................................................... 320
SIGN (see sign) ...................................................... Transfers the sign of numbers ................................................................... 321
sign ........................................................................... Transfers the sign of numbers ................................................................... 321
SIN (see sin) ........................................................... Computes sine ........................................................................................... 323
sin .............................................................................. Computes sine ........................................................................................... 323
SIND (see sin) ......................................................... Computes sine ........................................................................................... 323
SINH (see sinh) ...................................................... Computes hyperbolic sine ......................................................................... 325
sinh ........................................................................... Computes hyperbolic sine ......................................................................... 325
SIZE (see size) ...................................................... Returns the total number of elements in an array ..................................... 327
size ........................................................................... Returns the total number of elements in an array ..................................... 327
SIZEOF (see sizeof) ............................................. Returns bytes of storage ............................................................................ 328
sizeof ....................................................................... Returns bytes of storage ............................................................................ 328
SNGL (see real) ...................................................... Converts to type real ................................................................................. 278
SNGLQ (see real) .................................................... Converts to type real ................................................................................. 278
SPACING (see spacing) ........................................ Returns the absolute spacing of real model numbers near the
argument value .......................................................................................... 329
spacing .................................................................... Returns the absolute spacing of real model numbers near the
argument value .......................................................................................... 329
SPREAD (see spread) ............................................. Constructs an array from several copies of an argument .......................... 331
spread ....................................................................... Constructs an array from several copies of an argument .......................... 331
SQRT (see sqrt) ...................................................... Computes square root ................................................................................ 333
sqrt ........................................................................... Computes square root ................................................................................ 333
SUB_AND_FETCH (see sync) ................................. Fortran synchronization intrinsics for multiprocessing ............................. 337
SUM (see sum) ........................................................... Sums array elements .................................................................................. 335
sum .............................................................................. Sums array elements .................................................................................. 335
sync ........................................................................... Fortran synchronization intrinsics for multiprocessing ............................. 337
SYNCHRONIZE (see sync) ...................................... Fortran synchronization intrinsics for multiprocessing ............................. 337
SYNC_IMAGES (see sync_images) ...................... Synchronizes images ................................................................................. 340
sync_images ........................................................... Synchronizes images ................................................................................. 340
SYSTEM_CLOCK (see system_clock) ................. Returns integer data from a real-time clock .............................................. 341
system_clock ......................................................... Returns integer data from a real-time clock .............................................. 341
TAN (see tan) ........................................................... Computes tangent ...................................................................................... 342
tan .............................................................................. Computes tangent ...................................................................................... 342
TAND (see tan) ......................................................... Computes tangent ...................................................................................... 342
TANH (see tanh) ...................................................... Computes hyperbolic tangent .................................................................... 344
tanh ........................................................................... Computes hyperbolic tangent .................................................................... 344
TEST_IEEE_EXCEPTION
(see test_ieee_exception) ............................... Returns the state of a floating-point exception ......................................... 346
test_ieee_exception ........................................ Returns the state of a floating-point exception ......................................... 346
TEST_IEEE_INTERRUPT
(see test_ieee_interrupt) ............................... Returns the state of a floating-point interrupt ........................................... 348
test_ieee_interrupt ........................................ Returns the state of a floating-point interrupt ........................................... 348
THIS_IMAGE (see this_image) .......................... Retrieves an image number ....................................................................... 350
this_image ............................................................. Retrieves an image number ....................................................................... 350
TINY (see tiny) ...................................................... Returns the smallest positive value for a real argument ........................... 352
tiny ........................................................................... Returns the smallest positive value for a real argument ........................... 352

xxii 004– 2138– 003


TRANSFER (see transfer) .................................... Treats the first argument as if it is of the same type as the second
argument .................................................................................................... 354
transfer .................................................................. Treats the first argument as if it is of the same type as the second
argument .................................................................................................... 354
TRANSPOSE (see transpose) ............................... Transposes an array of rank two ............................................................... 356
transpose ................................................................ Transposes an array of rank two ............................................................... 356
TRIM (see trim) ...................................................... Returns the character argument with trailing blank characters
removed ..................................................................................................... 357
trim ........................................................................... Returns the character argument with trailing blank characters
removed ..................................................................................................... 357
UBOUND (see ubound) ............................................. Returns all the upper bounds of an array or a specified upper bound ...... 358
ubound ....................................................................... Returns all the upper bounds of an array or a specified upper bound ...... 358
UNIT (see unit) ...................................................... Returns the status of a BUFFER IN or BUFFER OUT statement ......... 359
unit ........................................................................... Returns the status of a BUFFER IN or BUFFER OUT statement ......... 359
UNPACK (see unpack) ............................................. Unpacks an array of rank one into an array under control of a mask ...... 361
unpack ....................................................................... Unpacks an array of rank one into an array under control of a mask ...... 361
VERIFY (see verify) ............................................. Verifies that a set of characters contains all characters in a string ........... 363
verify ....................................................................... Verifies that a set of characters contains all characters in a string ........... 363
WRITE_MEMORY_BARRIER
(see write_memory_barrier) ............................. Blocks processor until previous store operations have finished ................ 365
write_memory_barrier ...................................... Blocks processor until previous store operations have finished ................ 365
_write_memory_barrier
(see write_memory_barrier) ............................. Blocks processor until previous store operations have finished ................ 365
_writeSB (see readSB) ........................................ Returns status register value ...................................................................... 276
_writeST (see readSB) ........................................ Returns status register value ...................................................................... 276
XOR (see eqv) ........................................................... Computes logical equivalence or difference ............................................... 99
XOR_AND_FETCH, (see sync) ............................... Fortran synchronization intrinsics for multiprocessing ............................. 337

004– 2138– 003 xxiii


ABS ( 3I ) ABS ( 3I )

NAME
ABS, DABS, QABS, IABS, IIABS, JIABS, KIABS, CABS, CQABS, CDABS – Computes absolute value

SYNOPSIS
ABS ([A=]a)
DABS ([A=]a)
QABS ([A=]a)
IABS ([A=]a)
IIABS ([A=]a)
JIABS ([A=]a)
KIABS ([A=]a)
CABS ([A=]a)
CDABS ([A=]a)
CQABS ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QABS, IIABS, JIABS, KIABS, CQABS, CDABS

DESCRIPTION
ABS is the generic function name; the others are specifics. These are elemental intrinsic functions. They
accept the following arguments:
x Must be a numeric data type (real, complex, or integer) of any supported kind type. See the
RETURN VALUES section for more information on input data types and return values.
These functions evaluate as follows: y =  x  , except for CABS and CDABS, which evaluate the following:
2 2 1/2
y =  (x r + x i ) 

NOTES
The ABS, IABS, DABS, and CABS intrinsic function names can be passed as arguments; the others cannot.
On Cray T90 systems that support IEEE arithmetic, the following return values occur:
ABS(x):
• If  x = infinity, the result is infinity.
• If x = NaN, the result is NaN.

004– 2138– 003 1


ABS ( 3I ) ABS ( 3I )

CABS(x):
• If x or y = NaN, the result is NaN.
• If  x = infinity and y is not NaN, the result is infinity.
• If  y = infinity and x is not NaN, the result is infinity.
RETURN VALUES
ABS returns the absolute value of its argument. The data type of the result is the same as the data type of a
except that if input argument a is type complex, the result is type real.
DABS returns the double-precision absolute value of its double-precision argument.
QABS returns the quad-precision absolute value of its quad-precision argument.
IABS returns the integer absolute value of its integer argument.
IIABS returns the integer (KIND=2) absolute value of its integer (KIND=2) argument.
JIABS returns the integer (KIND=4) absolute value of its integer (KIND=4) argument.
KIABS returns the integer (KIND=8) absolute value of its integer (KIND=8) argument.
CABS returns the absolute value of its single-precision complex argument as a single-precision real number.
CDABS returns the absolute value of its complex double-precision argument as a double-precision real
number.
CQABS returns the absolute value of its complex quad-precision argument as a quad-precision real number.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

2 004– 2138– 003


ACOS ( 3I ) ACOS ( 3I )

NAME
ACOS, DACOS, QACOS, ACOSD, DACOSD, QACOSD – Computes arc cosine (inverse cosine)

SYNOPSIS
ACOS ([X=]x)
DACOS ([X=]x)
QACOS ([X=]x)
ACOSD ([X=]x)
DACOSD ([X=]x)
QACOSD ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QACOS, ACOSD, DACOSD, QACOSD

DESCRIPTION
ACOS, DACOS, and QACOS return the arc cosine in radians. ACOSD, DACOSD, and QACOSD return the arc
cosine in degrees. ACOS and ACOSD are generic function names; the others are specifics. These are
elemental intrinsic functions. These routines accept the following argument:
x Must be of type single precision, double precision, or quad precision. The type and kind type of
x is identical to the type and kind type of the return value. The absolute value of the arguments
for ACOS, DACOS, QACOS, ACOSD, DACOSD, and QACOSD must be ≤ 1. See the RETURN
VALUES section for information on input data types and return values.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
For ACOS, DACOS, and QACOS, the result is in radians and is in the range 0 ≤ result ≤ pi. The generic
form, ACOS, can be used for all real data types because it derives its type and kind type from that of its
argument.
For ACOSD, DACOSD, and QACOSD, the result is in degrees and is in the range 0 ≤ result ≤ 180. The
generic form, ACOSD, can be used for all real data types because it derives its type and kind type from that
of its argument.

004– 2138– 003 3


ACOS ( 3I ) ACOS ( 3I )

Vector versions of these intrinsics exist on some systems. Vector versions of ACOS and DACOS exist on
UNICOS and UNICOS/mk systems. On UNICOS/mk systems, the vector versions of these intrinsics are
used when -O vector3 or -O3 has been specified on the compiler command line. On UNICOS/mk
systems, the 64-bit intrinsic vectorizes; the 32-bit version does not. A vector version of the single-precision
and double-precision ACOS intrinsic exists on IRIX systems and is used when -O3 is specified on the
compiler command line.
These functions evaluate y = arccos(x).

NOTES
The ACOS and DACOS intrinsic function names can be passed as arguments; the others cannot.
On Cray T90 systems that support IEEE arithmetic, if  x > 1.0 or if x = NaN, the result is NaN.

RETURN VALUES
ACOS and ACOSD return the real arc cosine of their real arguments.
DACOS and DACOSD return the double-precision arc cosine of their double-precision arguments.
QACOS and QACOSD return the quad-precision arc cosine of their quad-precision arguments.

SEE ALSO
intro_intrin(3I)

4 004– 2138– 003


ADJUSTL ( 3I ) ADJUSTL ( 3I )

NAME
ADJUSTL – Adjusts a character string to the left

SYNOPSIS
ADJUSTL ([STRING=]string)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The ADJUSTL intrinsic function adjusts a character string to the left, removes leading blanks, and inserts
trailing blanks. It accepts the following argument:
string Must be of type character
ADJUSTL is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is type character with the same length as string.
The value of the result is the same as string, except that any leading blanks have been deleted and the same
number of trailing blanks have been inserted.

EXAMPLES
In the following examples, a carat (^) indicates a blank.
Example 1:
CHARAC TER*6 VAR
VAR = ADJUST L( ’^^ WOR D’ )
PRINT *,"VAR =’" , VAR ,"’"

This code segment produces the following output:


VAR=’W ORD^^’

004– 2138– 003 5


ADJUSTL ( 3I ) ADJUSTL ( 3I )

Example 2:
CHA RAC TER*29 STR ING
STRING = ’^^^TEST STR ING FOR ADJ UST L^^ ^’
WRI TE(6,1 ) ’>’ , STR ING , ’<’
WRI TE( 6,1) ’>’, ADJUST L(STRI NG), ’<’
1 FOR MAT (3A)
END

This code returns the following output:


>^^^TE ST STRING FOR ADJUST L^^ ^<
>TEST STRING FOR ADJUSTL^^ ^^^ ^<

6 004– 2138– 003


ADJUSTR ( 3I ) ADJUSTR ( 3I )

NAME
ADJUSTR – Adjusts a character string to the right

SYNOPSIS
ADJUSTR ([STRING=]string)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The ADJUSTR intrinsic function adjusts a character string to the right, removes trailing blanks, and inserts
leading blanks. It accepts the following argument:
string Must be of type character
ADJUSTR is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is type character with the same length as string.
The value of the result is the same as string except that any trailing blanks have been deleted and the same
number of leading blanks have been inserted.

EXAMPLES
In the following examples, a carat (^) indicates a blank.
Example 1:
VAR = ADJUST R( ’WO RD^ ^’ )
PRINT *,"VAR =’" , VAR ,"’ "
This code segment returns the following output:
VAR=’^ ^WORD’

004– 2138– 003 7


ADJUSTR ( 3I ) ADJUSTR ( 3I )

Example 2:
CHA RAC TER*29 STR ING
STRING = ’^^^TEST STR ING FOR ADJ UST R^^ ^’
WRI TE( 6,1) ’>’, STRING ,’<’
WRI TE(6,1 ) ’>’ , ADJ UST R(S TRI NG) , ’<’
1 FOR MAT(3A )
END

This code returns the following output:


>^^^TE ST STR ING FOR ADJ UST R^^^<
>^^ ^^^^TE ST STR ING FOR ADJ USTR<

8 004– 2138– 003


AIMAG ( 3I ) AIMAG ( 3I )

NAME
AIMAG, IMAG, DIMAG, QIMAG – Returns imaginary part of a complex number

SYNOPSIS
AIMAG ([Z=]z)
IMAG ([Z=]z)
DIMAG ([Z=]z)
QIMAG ([Z=]z)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: IMAG, DIMAG, QIMAG

DESCRIPTION
AIMAG, IMAG, DIMAG, and QIMAG return the imaginary part of a complex number. AIMAG is the generic
function name; the others are specifics. These are elemental intrinsic functions. IMAG is a nonstandard
intrinsic elemental function and is a synonym for AIMAG. These functions accept the following argument:
x Must be of type single-precision complex, double-precision complex, or quad-precision complex.
See the RETURN VALUES section for information on input data types and return values.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
These functions evaluate y = x i , where z = x r ,x i .

NOTES
The AIMAG intrinsic function name can be passed as an argument; the others cannot.

RETURN VALUES
AIMAG and IMAG return the imaginary part of their complex arguments.
DIMAG returns the double-precision imaginary part of its double-precision complex argument.

004– 2138– 003 9


AIMAG ( 3I ) AIMAG ( 3I )

QIMAG returns the quad-precision imaginary part of its quad-precision complex argument.

EXAMPLES
The following program gives the imaginary part of the complex number (1.0,2.0). After running the
program, RESULT = 2.0.
PROGRAM AIMTES T
REAL RESULT
RESULT =AI MAG( (1.0,2 .0) )
PRINT *, RES ULT
STOP
END

10 004– 2138– 003


AINT ( 3I ) AINT ( 3I )

NAME
AINT, DINT, QINT – Performs truncation to integer

SYNOPSIS
AINT ([A=]a[,[KIND=]kind])
DINT ([A=]a)
QINT ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QINT

DESCRIPTION
AINT is the generic function name; the others are specifics. These are elemental intrinsic functions. They
accept the following arguments:
a Specify a single-precision, double-precision, or quad-precision argument.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
kind An integer scalar value. Must be a kind type allowed for a. This argument is not accepted by
the MIPSpro Fortran 77 compiler.
These functions truncate the fractional parts of their arguments, and the fractional parts are lost (not
rounded).

NOTES
The AINT and DINT intrinsic function names can be passed as arguments; the other cannot.

RETURN VALUES
The return values are of type real and have a kind type as specified by the kind argument, if present. If kind
is unspecified, the kind type is that of a.

004– 2138– 003 11


AINT ( 3I ) AINT ( 3I )

AINT truncates the fractional part of its real argument.


DINT truncates the fractional part of its double-precision argument.
QINT truncates the fractional part of its quad-precision argument.

EXAMPLES
The following examples show the results of calling AINT with positive and negative arguments:
• AINT(3.4) yields 3.0.
• AINT(-3.4) yields -3.0.

12 004– 2138– 003


ALL ( 3I ) ALL ( 3I )

NAME
ALL – Determines whether all values are true

SYNOPSIS
ALL ([MASK=]mask [,[DIM=]dim])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The ALL intrinsic function determines whether all values are true in mask along dimension dim. It accepts
the following arguments:
mask Must be of type logical. It must not be a scalar.
dim Must be a scalar. It must be an integer value in the range 1 ≤ dim ≤ n, where n is the rank of
mask. The corresponding actual argument must not be an optional dummy argument.
ALL is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is type logical. It is a scalar result if dim is absent or if mask has rank one. Otherwise, the result
is an array of rank n– 1 and of shape (d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ), where (d 1 , d 2 , . . ., d n ) is the shape
of mask.
The result of ALL(mask) has the value TRUE if all the elements of mask are TRUE or if mask is a
zero-sized array. The result has the value FALSE if any element of mask is FALSE.
If mask has rank one, ALL(mask, dim) has a value equal to that of ALL(mask). Otherwise, the value of
element (s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ) of ALL(mask, dim) is equal to
ALL(mask (s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )).

EXAMPLES
Example 1: ALL((/.TRUE.,.FALSE.,.TRUE./)) yields .FALSE..
Example 2: ALL(array) yields .TRUE. when array is a zero-sized array.

004– 2138– 003 13


ALL ( 3I ) ALL ( 3I )

Example 3: Assume that B and C are arrays.


B is the following array:
 135
 246
C is the following array:
 035
 748
• ALL(B.NE.C) yields .FALSE..
• ALL(B.NE.C,DIM=1) yields [.TRUE.,.FALSE.,.FALSE.].
• ALL(B.NE.C,DIM=2) yields [.FALSE.,.FALSE.].
• ALL(B.NE.1) yields .FALSE. because there is one false element in the mask.
Example 4: Assume that array N is as follows:
 0123
 4567
 8901
In an array section reference, you can expect the following results:
• ALL((N(2:3,2:4).NE.0)) yields .FALSE..
• ALL((N(2:3,2:4).NE.0),DIM=1) yields [.TRUE.,.FALSE.,.TRUE.].
• ALL((N(2:3,2:4).NE.0),DIM=2) yields [.TRUE.,.FALSE.].

14 004– 2138– 003


ALLOCATED ( 3I ) ALLOCATED ( 3I )

NAME
ALLOCATED – Returns the array allocation status

SYNOPSIS
ALLOCATED ([ARRAY=]array)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The ALLOCATED intrinsic function indicates whether or not an allocatable array is currently allocated. It
accepts the following argument:
array Must be an allocatable array
ALLOCATED is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type, type parameter, and shape are default logical scalar. The result has the value .TRUE. if
array is currently allocated and has the value .FALSE. if array is not currently allocated.
The result is undefined if the allocation status of the array is undefined. See section 6 of the Fortran
Language Reference Manual, Volume 1, for information on the allocation of allocatable arrays.

SEE ALSO
Fortran Language Reference Manual, Volume 1

004– 2138– 003 15


AND ( 3I ) AND ( 3I )

NAME
AND – Computes logical product

SYNOPSIS
AND ([I=]i,[J=]j)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extension

DESCRIPTION
AND is an elemental function. It accepts the following arguments:
i Must be of type Boolean, integer, real, Cray pointer, or logical.
j Must be of type Boolean, integer, real, Cray pointer, or logical.

NOTES
AND is an outmoded routine. Refer to the Fortran Language Reference Manual, Volume 3, for information
about outmoded features and their preferred standard alternatives. The name of this intrinsic cannot be
passed as an argument.

CAUTIONS
Unexpected results can occur when Boolean functions are declared external and then used with logical
arguments. The external Boolean functions always treat their arguments as type Boolean and return a
Boolean result on UNICOS and UNICOS/mk systems. On IRIX systems, they return an integer result.

RETURN VALUES
When given two arguments of type logical, AND computes a logical product and returns a logical result.
When given two arguments of type Boolean, integer, real, or pointer, AND computes a bit-wise logical
product and returns a Boolean result (on UNICOS and UNICOS/mk systems) or an integer result (on IRIX
systems).

16 004– 2138– 003


AND ( 3I ) AND ( 3I )

The following tables show both the logical product and bit-wise logical product:

Logical Variable 1 Logical Variable 2 (Logical Variable 1) AND (Logical Variable 2)

T T T
T F F
F T F
F F F

Bit of Variable 1 Bit of Variable 2 (Bit of Variable 1) AND (Bit of Variable 2)

1 1 1
1 0 0
0 1 0
0 0 0

EXAMPLES
The following section of Fortran code shows the AND function used with two arguments of type logical:
LOG ICAL L1, L2, L3
...
L3 = AND(L1 ,L2 )

The following section of Fortran code shows the AND function used with two arguments of type integer.
The bit patterns of the arguments and result are also given. For clarity, only the rightmost 8 bits are shown.
INT EGER I1, I2, I3
I1 = 12
I2 = 10
...
I3 = AND(I1 ,I2 )
------ ------ --- --- --- --- --- --- - --- --- --- --- --- --- --- --- --- ----
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
------ ------ --- --- --- --- --- --- - --- --- --- --- --- --- --- --- --- ----
I1 I2

--- --- --- --- --- --- --- --- --- --- -
| 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
--- ------ --- --- --- --- --- --- --- -
I3

004– 2138– 003 17


ANINT ( 3I ) ANINT ( 3I )

NAME
ANINT, DNINT, QNINT – Finds nearest whole number

SYNOPSIS
ANINT ([A=]a [,[KIND=]kind])
DNINT ([A=]a)
QNINT ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QNINT

DESCRIPTION
ANINT is the generic function name; the others are specifics. These are elemental intrinsic functions. They
accept the following arguments:
a Must be type single-precision real, double-precision real, or quad-precision real. See the
RETURN VALUES section for information on input data types and return values.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
kind Must be a kind type allowed for a. This argument is not accepted by the MIPSpro Fortran 77
compiler.

NOTES
The ANINT and DNINT intrinsic function names can be passed as arguments; the other cannot.

RETURN VALUES
ANINT returns the real nearest whole number for its real argument, as follows:
• If a ≥ 0, the result is REAL(INT(a + 0.5)).
• If a < 0, the result is REAL(INT(a - 0.5)).

18 004– 2138– 003


ANINT ( 3I ) ANINT ( 3I )

DNINT returns the double-precision nearest whole number for its double-precision argument.
QNINT returns the quad-precision nearest whole number for its quad-precision argument.

EXAMPLES
The following examples show the results of calling ANINT with positive and negative arguments:
• ANINT(3.7) yields 4.0.
• ANINT(-3.7) yields -4.0.
SEE ALSO
AINT(3I)

004– 2138– 003 19


ANY ( 3I ) ANY ( 3I )

NAME
ANY – Determines whether any values are true

SYNOPSIS
ANY ([MASK=]mask [,[DIM=]dim])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The ANY intrinsic function determines whether any value is true in argument mask along dimension dim. It
accepts the following arguments:
mask Must be of type logical. It must not be a scalar.
dim Must be a scalar. It must be an integer value in the range 1 ≤ dim ≤ n, where n is the rank of
mask. The corresponding actual argument must not be an optional dummy argument.
ANY is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is type logical. It is a scalar result if dim is absent or if mask has rank one. Otherwise, the result
is an array of rank n– 1 and of shape (d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ), where (d 1 , d 2 , . . ., d n ) is the shape
of mask.
The result of ANY(mask) has the value TRUE if any element of mask is true. The result has the value
FALSE if no elements of mask are true or if mask is a zero-sized array.
If mask has rank one, ANY(mask,dim) has a value equal to that of ANY(mask). Otherwise, the value of
element (s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ) of ANY(mask,dim) is equal to
ANY(mask (s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )).

EXAMPLES
Example 1:
• ANY((/.TRUE.,.FALSE.,.TRUE./)) yields .TRUE..
• ANY(mask) yields .FALSE. when mask is a zero-sized array.

20 004– 2138– 003


ANY ( 3I ) ANY ( 3I )

Example 2: Assume that B and C are arrays as follows:


B is the following array:
 135
 246
C is the following array:
 035
 748
• ANY(B.NE.C) yields .TRUE..
• ANY(B.NE.C,DIM=1) yields [.TRUE.,.FALSE.,.TRUE.].
• ANY(B.NE.C,DIM=2) yields [.TRUE.,.TRUE.].
• ANY(C.EQ.1) yields [.FALSE.] because no elements of the mask are true.
Example 3: Assume that array N is as follows:
 0123
 4567
 8901
In an array section reference, you can expect the following results:
• ANY((N(2:3,2:4).NE.0)) yields [.TRUE.].
• ANY((N(2:3,2:4).NE.0),DIM=1) yields [.TRUE.,.TRUE.,.TRUE.].
• ANY((N(2:3,2:4).NE.0),DIM=2) yields [.TRUE.,.TRUE.].

004– 2138– 003 21


ASIN ( 3I ) ASIN ( 3I )

NAME
ASIN, DASIN, QASIN, ASIND, DASIND, QASIND – Computes arc sine (inverse sine)

SYNOPSIS
ASIN ([X=]x)
DASIN ([X=]x)
QASIN ([X=]x)
ASIND ([X=]x)
DASIND ([X=]x)
QASIND ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QASIN, ASIND, DASIND, QASIND

DESCRIPTION
ASIN, DASIN, and QASIN return the arc sine in radians. ASIND, DASIND, and QASIND return the arc
sine in degrees.
ASIN and ASIND are generic function names; the others are specifics. These are elemental intrinsic
functions. They accept the following argument:
x Must be type real. The type and kind type of x is identical to the type and kind type of the
return value. The absolute value of x must be ≤ 1. See the RETURN VALUES section for
information on input data types and return values.
Vector versions of these intrinsics exist on some systems. Vector versions of ASIN and DASIN exist on
UNICOS and UNICOS/mk systems. On UNICOS/mk systems, the vector versions of these intrinsics are
used when -O vector3 or -O3 have been specified on the compiler command line. On UNICOS/mk
systems, the 64-bit intrinsic vectorizes; the 32-bit version does not. A vector version of the single-precision
and double-precision ASIN intrinsic exists on IRIX systems and is used when -O3 is specified on the
compiler command line.
These functions evaluate y = arcsin(x).

22 004– 2138– 003


ASIN ( 3I ) ASIN ( 3I )

NOTES
The ASIN and DASIN intrinsic function names can be passed as arguments; the others cannot.
On Cray T90 systems that support IEEE arithmetic, if  x > 1.0 or x = NaN, ASIN(x) yields NaN.

RETURN VALUES
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.
For ASIN, DASIN, and QASIN, the result is in radians and is in the range -pi/2 ≤ result ≤ pi/2. For
ASIND, DASIND, and QASIND, the result is in degrees and is in the range -90 ≤ result ≤ 90.
ASIN and ASIND return the real arc sine of their real arguments.
DASIN and DASIND return the double-precision arc sine of their double-precision arguments.
QASIN and QASIND return the quad-precision arc sine of their quad-precision arguments.

004– 2138– 003 23


ASSOCIATED ( 3I ) ASSOCIATED ( 3I )

NAME
ASSOCIATED – Returns the pointer association status

SYNOPSIS
ASSOCIATED ([POINTER=]pointer [,[TARGET=]target])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The ASSOCIATED intrinsic function returns the association status of its pointer argument or indicates the
pointer is associated with the target. It accepts the following arguments:
pointer Must be a pointer and can be of any type. Its pointer association status must not be undefined.
target Must be a pointer or target. If it is a pointer, its pointer association status must not be
undefined.
ASSOCIATED is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is of type default logical.
If target is absent, the result is true if pointer is currently associated with a target and false if it is not.
If target is present and is a target, the result is true if pointer is currently associated with target and false if
it is not.
If target is present and is a pointer, the result is true if both pointer and target are currently associated with
the same target, and is false otherwise.
If either pointer or target is disassociated, the result is false.
If pointer and target are both dummy arguments, the result is undefined.

EXAMPLES
Example 1: ASSOCIATED(CURRENT,HEAD) yields true if CURRENT points to the target HEAD.

24 004– 2138– 003


ASSOCIATED ( 3I ) ASSOCIATED ( 3I )

Example 2: Consider the following statement:


A_P ART => A (:N)

After the preceding statement is executed, the statement ASSOCIATED(A_PART,A) yields true if N is
equal to UBOUND(A,DIM=1).
Example 3: After the execution of the following statements, ASSOCIATED(CUR,TOP) yields false:
NULLIFY(C UR) ; NUL LIFY(T OP)

004– 2138– 003 25


ATAN2 ( 3I ) ATAN2 ( 3I )

NAME
ATAN2, DATAN2, QATAN2, ATAN2D, DATAN2D, QATAN2D – Computes arc tangent (inverse tangent) for
two arguments

SYNOPSIS
ATAN2 ([Y=]y,[X=]x)
DATAN2 ([Y=]y,[X=]x)
QATAN2 ([Y=]y,[X=]x)
ATAN2D ([Y=]y,[X=]x)
DATAN2D ([Y=]y,[X=]x)
QATAN2D ([Y=]y,[X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QATAN2, ATAN2D, DATAN2D, QATAN2D

DESCRIPTION
ATAN2, DATAN2, and QATAN2 return the arc tangent, for two arguments, in radians. ATAN2D, DATAN2D,
and QATAN2D return the arc tangent, for two arguments, in degrees. These intrinsics accept the following
arguments:
y Must be type real. For DATAN2 and DATAN2D, must be of type double precision. For
QATAN2 and QATAN2D, must be of type quad precision. See the RETURN VALUES section
for information on input data types and return values.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
For ATAN2, DATAN2, and QATAN2, the following rules apply:
• If y is positive, the result is positive.
• If y is negative, the result is negative.
• If y is positive or negative zero, and if x is positive, the result is positive or negative zero.
• If y is positive or negative zero, and if x is negative, the result is positive or negative pi.
• If y is zero, x cannot also be zero.

26 004– 2138– 003


ATAN2 ( 3I ) ATAN2 ( 3I )

For ATAN2D, DATAN2D, and QATAN2D, the following rules apply:


• If y is positive, the result is positive.
• If y is negative, the result is negative.
• If y is zero, and if x is positive, the result is zero.
• If y is zero, and if x is negative, the result is 180.0.
• If y is zero, x cannot also be zero.
x Must be of type real. For DATAN2 and DATAN2D, must be of type double-precision. For
QATAN2 and QATAN2D, must be of type quad-precision. See the RETURN VALUES section
for information on input data types and return values.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
For ATAN2, DATAN2, and QATAN2, the following rules apply:
• If x is zero, y cannot also be zero.
• If x is zero, the value of the absolute value of the result is pi/2.
For ATAN2D, DATAN2D, and QATAN2D, the following rules apply:
• If x is zero, y cannot also be zero.
• If x is zero, the absolute value of the result is 90.0.
ATAN2 and ATAN2D are generic function names; the others are specifics. These are elemental intrinsic
functions.
Vector versions of ATAN2 and DATAN2 exist on UNICOS and UNICOS/mk systems. On UNICOS/mk
systems, the vector versions of these intrinsics are used when -O vector3 or -O3 are specified on the
compiler command line. On UNICOS/mk systems, the 64-bit intrinsic vectorizes; the 32-bit version does
not.
These functions evaluate y = arctan(y/x).
The result range, in radians, for ATAN2, DATAN2, and QATAN2 is -pi ≤ result ≤ pi.
The result range, in degrees, for ATAN2D, DATAN2D, and QATAN2D is -180 ≤ result ≤ 180.

NOTES
The ATAN2 and DATAN2 intrinsic function names can be passed as arguments; the others cannot.

004– 2138– 003 27


ATAN2 ( 3I ) ATAN2 ( 3I )

RETURN VALUES
ATAN2 and ATAN2D return the real arc tangent of the quotient of their real arguments.
DATAN2 and DATAN2D return the double-precision arc tangent of the quotient of their double-precision
arguments.
QATAN2 and QATAN2D return the quad-precision arc tangent of the quotient of their quad-precision
arguments.

28 004– 2138– 003


ATAN ( 3I ) ATAN ( 3I )

NAME
ATAN, DATAN, QATAN, ATAND, DATAND, QATAND – Computes arctangent (inverse tangent) for single
argument

SYNOPSIS
ATAN ([X=]x)
DATAN ([X=]x)
QATAN ([X=]x)
ATAND ([X=]x)
DATAND ([X=]x)
QATAND ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QATAN, ATAND, DATAND, QATAND

DESCRIPTION
ATAN, DATAN, and QATAN return the arc tangent in radians. ATAND, DATAND, and QATAND return the arc
tangent in degrees.
ATAN and ATAND are generic function names; the others are specifics. These are elemental intrinsic
functions. They accept the following argument:
x Must be type real. The type and kind type of x is identical to the type and kind type of the
return value. See the RETURN VALUES section for information on input data types and return
values.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
These functions evaluate y = arctan(x).
The result range for ATAN, DATAN, and QATAN is -pi/2 ≤ ATAN(x) ≤ pi/2.
The result range for ATAND, DATAND, and QATAND is -90 ≤ result ≤ 90.

004– 2138– 003 29


ATAN ( 3I ) ATAN ( 3I )

Vector versions of these intrinsics exist on some systems. Vector versions of ATAN and DATAN exist on
UNICOS and UNICOS/mk systems. On UNICOS/mk systems, the vector versions of these intrinsics are
used when -O vector3 or -O3 have been specified on the compiler command line. On UNICOS/mk
systems, the 64-bit intrinsic vectorizes; the 32-bit version does not. A vector version of the single-precision
and double-precision ATAN intrinsic exists on IRIX systems and is used when -O3 is specified on the
compiler command line.

NOTES
The ATAN and DATAN intrinsic function names can be passed as arguments; the others cannot.
On Cray T90 systems that support IEEE arithmetic, the following return values occur:
• ATAN(NaN) yields NaN.
• ATAN(infinity) yields pi/2.
• ATAN(-infinity) yields -pi/2.
RETURN VALUES
ATAN and ATAND return the real arc tangent of their real arguments.
DATAN and DATAND return the double-precision arc tangent of their double-precision arguments.
QATAN and QATAND return the quad-precision arc tangent of their quad-precision arguments.

30 004– 2138– 003


BIT_SIZE ( 3I ) BIT_SIZE ( 3I )

NAME
BIT_SIZE – Returns the number of bits in an integer in the bit manipulation model

SYNOPSIS
BIT_SIZE ([I=]i)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The BIT_SIZE intrinsic function returns the number of bits s as defined by the bit model. The bit model is
described in the MODELS(3I) man page. This intrinsic function accepts the following argument:
i Must be of type integer
BIT_SIZE is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a scalar integer with the same kind type parameter as i.
The result has the value of the number of bits s in the model integer defined in the DESCRIPTION section
of this man page.

EXAMPLES
The following code fragment is run on several systems:
INTEGE R(KIND =1) I1
INTEGE R(KIND =2) I2
INTEGE R(KIND =4) I4
INTEGE R(KIND =8) I8
INTEGE R ID
PRINT *,’BIT _SI ZE I1= ’,B IT_ SIZ E(I 1)
PRINT *,’BIT _SI ZE I2= ’,BIT_ SIZ E(I 2)
PRINT *,’BIT _SI ZE I4= ’,B IT_ SIZ E(I 4)
PRINT *,’BIT _SI ZE I8= ’,BIT_ SIZ E(I 8)
PRINT *,’BIT _SI ZE ID= ’,B IT_ SIZ E(I D)
END

004– 2138– 003 31


BIT_SIZE ( 3I ) BIT_SIZE ( 3I )

On IRIX systems the output is as follows:


BIT_SI ZE I1= 8
BIT_SI ZE I2= 16
BIT_SI ZE I4= 32
BIT_SI ZE I8= 64
BIT_SI ZE ID= 32

On UNICOS and UNICOS/mk systems, the output is as follows:


BIT_SI ZE I1= 8
BIT_SI ZE I2= 16
BIT_SI ZE I4= 32
BIT_SI ZE I8= 64
BIT_SI ZE ID= 64

SEE ALSO
MODELS(3I)

32 004– 2138– 003


BMM ( 3I ) BMM ( 3I )

NAME
_mclr, _mld, _mmx, _mldmx, _mul, M@CLR, M@LD, M@MX, M@LDMX, M@UL – Performs bit matrix
multiply operations

SYNOPSIS
C/C++:
#include <intrinsics.h>
void _mclr (void);
long _mld (long x2);
long _mmx (long x1);
long _mldmx (long x1, long x2);
long _mul (void);
Fortran:
M@CLR ()
M@LD ([X=]x)
M@LDMX ([X=]x, [Y=]y)
M@MX ([X=]x, [Y=]y])
M@UL ()

IMPLEMENTATION
UNICOS and UNICOS/mk systems
Cray C/C++, CF90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
The Bit Matrix Multiply (BMM) hardware functional unit is standard on all Cray T90 and CRAY SV1
systems. This hardware is available as an option on Cray C90 systems. It can be used to perform very fast
matrix multiply operations of two bit matrixes.
You can use the target(1) command to determine if your system has a BMM functional unit. For systems
without BMM functional units, these intrinsic functions are simulated; however, the presence of BMM
hardware enhances performance.

004– 2138– 003 33


BMM ( 3I ) BMM ( 3I )

Because the BMM intrinsic functions generally map directly onto the hardware, there are additional
restrictions placed on their use beyond language conventions, and some additional care must be taken when
writing code that uses them. Most BMM functions must be vectorized in order to generate correct code.
A vector version of this intrinsic exists on UNICOS and UNICOS/mk systems. On UNICOS/mk systems,
the vector version of this intrinsic is used when -h vector3 (C compiler) or -O vector3 or -O3
(Fortran compiler) has been specified on the compiler command line.
The following sections describe the individual routines in more detail for C/C++ and Fortran.

NOTES

C/C++
Operations on square bit matrices in which the number of elements is an integral of 64, can be performed
using the _mldmx instruction to do both the load and multiply. The _mld function allows loading the x2
argument separately for operations on nonsquare matrices of more than 64 elements. Arguments to the bit
matrix multiply functions must be of type long.
Because _mclr, _mld, _mmx, _mldmx, and _mul are intrinsic functions, no externally visible library
functions are available for them. The compiler generates inline code to produce the result.
The following is a summary of the BMM functions:
• _mld - Load transposed bit matrix
_mld loads the BMM functional unit with a matrix vector in transposed form. The function must appear
in an unconditional vector loop and be detectable by the compiler as a short loop. If this intrinsic
function appears in a conditionally vectorized loop or a nonvectorized loop, a fatal error will be issued.
The shortloop directive may be used to indicate a safe condition.
_mld returns a pseudo results, which should not be used because its contents are undetermined. If
multiple references to _mld are made within a single loop, different names must be used to receive the
pseudo result. This requirement forces optimization to consider earlier calls to _mld because the array
that appears to receive the pseudo result seems to have no uses until it is redefined.
• _mmx - Performs bit matrix multiply
_mmx performs the BMM of x1 times x2 transposed. The argument to _mmx is the x1 argument. The
matrix contained in the function unit from a previous _mld, _mmx, or _mldmx invocation is the x2
matrix that is used with x1 to form the result. _mmx may appear in a scalar context and, in that case,
may have a scalar argument.
• _mldmx - Combines the load and multiply functions
_mldmx combines the load and multiply functions. The second argument of _mldmx, x2, is loaded into
the bit matrix function unit prior to the multiply. Matrix x2 is then multiplied by matrix x1. This
intrinsic must appear in a vector loop, as shown in the following example:

34 004– 2138– 003


BMM ( 3I ) BMM ( 3I )

for (i= 0; i<6 4; i++ )


{
dummy[ i] = _ml d(b[i] );
}
for (i= 0; i<=512; i++)
{
c[i] = _ml dmx(a[ i], b[i]);
}

• _mul - Unloads the bit matrix function unit


_mul unloads the bit matrix function unit. It returns the transposed value of the previously loaded x2
vector. This function is performed by multiplying the unit’s contents by an identity matrix. This intrinsic
must appear in a vector short loop.
• _mclr - Clears BML bit
_mclr clears the bit matrix loaded (BML) bit of the CPU status register and exchange package. You
can reduce system overhead while the bit matrix portions of your code are inactive by declaring the bit
matrix multiply (BMM) functional unit memory empty. This permits the operating system to omit the
save and restore steps when switching the CPUs from user to user.
FORTRAN
The BMM intrinsic functions are transformational functions. The names of these intrinsics cannot be passed
as arguments.
They accept the following arguments:
x, y Array or scalar values that are left-justified, zero-filled, and up to 64 bits in width. In Fortran,
they should be INTEGER(KIND=8) values.
The following is a summary of BMM functions:
• M@LD – Load transposed bit matrix
M@LD loads the BMM functional unit with a matrix in transposed form. The function must appear in a
vector loop or in an array syntax statement of 64 or fewer iterations, or an error message is issued. The
SHORTLOOP compiler directive may be used to indicate a loop with between 1 and 64 iterations. See the
CF90 Commands and Directives Reference Manual for more information on the SHORTLOOP compiler
directive.
M@LD returns a pseudo result, which should not be used because its contents are undetermined.
Use of array syntax for M@LD, as shown in the following example, is preferred because most simple array
syntax vectorizes independently of the optimization level:
BMM_ST UFF (1:64) = M@L D( IA( 1:64) )

004– 2138– 003 35


BMM ( 3I ) BMM ( 3I )

• M@MX – Perform bit matrix multiply


M@MX performs the bit matrix multiply of its argument times the transpose of the argument previously
loaded into the BMM functional unit with a M@LD, M@LDMX, or a two-argument M@MX invocation. With
one argument, M@MX may appear in a scalar context. This intrinsic function can run at the maximum
vector length supported by the hardware.
The 2-argument form of M@MX is functionally identical to the M@LDMX intrinsic function. It abides by the
same rules and restrictions. Basically, the 2-argument form is equivalent to using M@LD followed by a
1-argument M@MX. Use of the 2-argument form of M@MX is discouraged; use M@LDMX instead.
Use of array syntax for M@MX is preferred. The following is a common example of performing a bit
matrix multiply:
BMM_ST UFF (1:64) = M@L D( IA( 1:6 4) ) ! Loa d BMM uni t tra nspose
IRESUL T(1 :512) = M@M X( IB( 1:5 12) ) ! Mul tiply times IB

• M@LDMX – Load bit matrix and multiply


M@LDMX combines the load and multiply functions and is functionally identical to the 2-argument form of
M@MX. It must appear in a vector loop or in an array syntax statement, or an error message is issued.
The second argument is loaded into the BMM functional unit, just as if M@LD was used, and is multiplied
by the first argument.
Because of the load into the BMM functional unit, loops containing this intrinsic function are run with a
maximum vector length of 64. The use of array syntax for M@LDMX, as shown in the following example,
is preferred:
IRESUL T(1 :512) = M@L DMX ( IB(1:5 12), IA(1:5 12) )

• M@UL – Unload bit matrix


M@UL unloads the BMM functional unit and returns the transpose of the vector initially loaded into it by
a M@LD or M@LDMX intrinsic. This is done by multiplying the unit’s contents by an identity matrix. This
intrinsic function must appear in a vectorizable loop or in an array syntax statement of 64 or fewer
iterations, or an error message is issued.
The use of array syntax for M@UL, as shown in the following example, is preferred:
ITRANS (1:64) = M@U L()

• M@CLR – Clear Bit Matrix Loaded (BML) bit


On systems with a BMM functional unit, M@CLR clears the exchange packets and the BML bit of the
CPU status register. This is useful for reducing system overhead when the bit matrix portion of a code is
inactive. If the BML bit is set, the operating system saves and restores the contents of the BMM
functional unit when switching from user to user. Clearing this bit with M@CLR when you no longer are
using the BMM functional unit allows the operating system to omit the save and restore steps. The value
returned by this intrinsic can be safely ignored. Example:
IT = M@C LR()

36 004– 2138– 003


BMM ( 3I ) BMM ( 3I )

CONVENTIONS
Because the BMM functional unit has a memory, you should be aware of the conventions needed to manage
it. The UNICOS operating system maintains the BMM functional unit’s memory when disconnecting and
connecting users from CPUs. The compiler does not guarantee that the data in the unit is maintained across
function or subroutine calls, although it generally is if no other functions or subroutines use the unit. To
preserve the contents of the BMM functional unit across function or subroutine calls, the only completely
safe method is to unload and save the contents with the _mul or M@UL intrinsic and restore the contents of
the functional units before an intrinsic is used.

EXAMPLES
C/C++ examples:
In the following examples, the b matrix is loaded into the function unit where it is stored in its transposed
form. That is, the rows and columns are exchanged: column 1 becomes row 1, column 2 becomes row 2,
and so on. Transposing the input operand b allows the result matrix c to be formed as the mod-2 inner
product of rows a with rows of b. This is done by ANDing the corresponding elements and using the result
of an EXCLUSIVE OR on all the resulting bits.
Example 1:
for (i= 0; i<6 4; i++ )
{
mat b[i] = _ml d(b [i] );
c[i] = _mm x(a [i] );
}

Example 2:
for (i= 0; i<6 4; i++ )
{
c[i] = _ml dmx (a[ i], b[i ]);
}

Fortran examples:
The array syntax used for the bit matrix operations in this example is simple enough to vectorize even with
optimization disabled.
This simple example demonstrates a bit matrix transposition. The bit matrix used is similar to the following,
but the one used is actually much larger:
111 1 100 0
011 1 to 110 0
001 1 111 0
000 1 111 1

004– 2138– 003 37


BMM ( 3I ) BMM ( 3I )

The program that uses the BMM routines is as follows:


PRO GRA M TRA NSPOSE
INT EGE R(KIND =8) IR(0:6 3)
INT EGE R(KIND =8) ITR ANS (0:63)
INT EGE R(KIND =8) JUN K(0 :63)

IR = ISH FT( -1_8, (/ ( I, I = 0,- 63, -1 ) /) )


PRI NT *, ’ Initia l dat a:’
PRI NT ’( B64 )’, IR

JUN K = M@L D( IR ) ! Loa d the bit matrix uni t tra nspose d


ITR ANS = M@U L() ! Unl oad the unit with transp osed data

PRI NT *, ’ After the tra nsposi tio n:’


PRI NT ’( B64 )’, ITR ANS
END

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.
CF90 Commands and Directives Reference Manual

38 004– 2138– 003


BTEST ( 3I ) BTEST ( 3I )

NAME
BTEST, BITEST, BJTEST, BKTEST – Tests a bit of an integer value

SYNOPSIS
BTEST ([I=]i, [POS=]pos)
BITEST ([I=]i, [POS=]pos)
BJTEST ([I=]i, [POS=]pos)
BKTEST ([I=]i, [POS=]pos)

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: BITEST, BJTEST, BKTEST

DESCRIPTION
The BTEST, BITEST, BJTEST, and BKTEST intrinsic functions test a bit of an integer value. They accept
the following arguments:
i Must be of type integer. For BITEST, it must be an integer (KIND=2) value. For BJTEST, it
must be an integer (KIND=4) value. For BKTEST, it must be an integer (KIND=8) value.
pos Must be of type integer. For BITEST, it must be an integer (KIND=2) value. For BJTEST, it
must be an integer (KIND=4) value. For BKTEST, it must be an integer (KIND=8) value. It
must be nonnegative and be less than BIT_SIZE(i).
BTEST, BITEST, BJTEST, and BKTEST are elemental functions. The names of these intrinsics cannot be
passed as arguments.

RETURN VALUES
BTEST returns type default logical. BITEST returns type logical (KIND=2). BJTEST returns type logical
(KIND=4). BKTEST returns type logical (KIND=8).
The result has the value TRUE if bit pos of i has the value 1. It has the value FALSE if bit pos of i has the
value 0. The bit model defines the interpretation of an integer value as a sequence of bits. This model is
described in the MODELS(3I) man page.

004– 2138– 003 39


BTEST ( 3I ) BTEST ( 3I )

EXAMPLES
Example 1: BTEST(8,3) yields TRUE.
Example 2: BTEST(8_SHORT,3) yields TRUE.
Example 3: Assume that A has the following value:
 12
 34
BTEST(A,2) yields:
 false false 
 false true 
BTEST(2,A) yields:
 true false 
 false false 

SEE ALSO
MODELS(3I)

40 004– 2138– 003


CEILING ( 3I ) CEILING ( 3I )

NAME
CEILING – Returns the least integer greater than or equal to a

SYNOPSIS
CEILING ([A=]a [,[KIND=]kind])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The CEILING intrinsic function returns the least integer greater than or equal to a. It accepts the following
arguments:
a Must be of type real
kind An integer scalar value. Must be a scalar integer initialization expression
CEILING is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
On UNICOS systems, both execution speed and the number of bits used in mathematical operations are
affected when compiling with f90 -O fastint, which is the default setting. For more information on
this, see the CF90 Commands and Directives Reference Manual.

RETURN VALUES
The result type is an integer. If kind is specified, the kind type parameter is that specified by kind. If kind is
not specified, the result is of type default integer. The result has a value equal to the least integer greater
than or equal to a. The result is undefined if the system cannot represent this value in the default integer
type.

EXAMPLES
CEILING(3.7) yields 4.
CEILING(-3.7) yields -3.

SEE ALSO
CF90 Commands and Directives Reference Manual

004– 2138– 003 41


CHAR ( 3I ) CHAR ( 3I )

NAME
CHAR, ACHAR, ICHAR, IACHAR – Performs conversion and positioning functions

SYNOPSIS
CHAR([I=]i, [KIND=]kind)
ACHAR([I=]i)
ICHAR([C=]c)
IACHAR ([C=]c)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran

DESCRIPTION
CHAR and ICHAR are inverse functions. CHAR converts an integer or Boolean argument to a character
specified by the ASCII collating sequence. ICHAR converts a character argument to an integer based on the
character position in the collating sequence. CHAR and ICHAR assign the appropriate type to Boolean
arguments without shifting or manipulating the bit patterns they represent. For example, CHAR(i) returns the
ith character in the collating sequence.
ACHAR returns the character in a specified position of the ASCII collating sequence. This intrinsic is not
accepted by the MIPSpro Fortran 77 compiler.
IACHAR returns the position of a character in the ASCII collating sequence. This intrinsic is not accepted
by the MIPSpro Fortran 77 compiler.
These intrinsic functions accept the following arguments:
i For CHAR and ICHAR, must be of type integer or Boolean. If of type integer, i must be in the
range 0 ≤ i ≤ 255.
For ACHAR, must be of type integer.
kind An integer scalar value. Must be a scalar integer initialization expression. This argument is not
accepted by the MIPSpro Fortran 77 compiler.
c Must be of type character and of length 1.

42 004– 2138– 003


CHAR ( 3I ) CHAR ( 3I )

These are elemental functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
CHAR returns a character of length one. If the kind parameter is present, the kind type parameter is that
specified by kind. Otherwise the kind type parameter is that of the default character type. The result is the
character in position i of the ASCII collating sequence associated with the specified kind type parameter.
ACHAR returns a character of length 1. If i has a value in the range 0 ≤ i ≤ 127, the result is the character in
position i of the ASCII collating sequence. ACHAR (IACHAR (c)) has the value c for any character c
capable of representation.
ICHAR returns a default integer value. For ICHAR, the result is the position c in the collating sequence
associated with the kind type parameter of c and is in the range 0 ≤ ICHAR(c) ≤ 255. For any characters C
and D capable of being represented, C .LE. D is true if and only if ICHAR (C) .LE. ICHAR(D) is
true and C .EQ. D is true if and only if ICHAR(C) .EQ. ICHAR(D) is true.
IACHAR returns a default integer value. If c is in the collating sequence defined by the codes specified in
ISO 646:1983 (International Reference Version), the result is the position of c in that sequence and satisfies
the inequality 0 ≤ IACHAR (c) ≤ 127. The results are consistent with the LGE, LGT, LLE, and LLT
lexical comparison functions. For example, if LLE(C,D) is true, IACHAR(C).LE.IACHAR(D) is true
when C and D are any two ASCII characters.

EXAMPLES
IACHAR(’X’) yields the value 88.
ACHAR(88) yields ’X’.

004– 2138– 003 43


CLEAR_IEEE_EXCEPTION ( 3I ) CLEAR_IEEE_EXCEPTION ( 3I )

NAME
CLEAR_IEEE_EXCEPTION – Clears floating-point exception indicator

SYNOPSIS
CLEAR_IEEE_EXCEPTION ([EXCEPTION=]exception)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The CLEAR_IEEE_EXCEPTION intrinsic subroutine clears the specified floating-point exception indicator.
It accepts the following argument:
exception Must be of type default integer. It is an INTENT(IN) argument. If exception is an
array, it must be 1-dimensional. The single argument in the scalar case, or each array
element in the array case, must be set to one of the values represented by the following
named constants:
• IEEE_XPTN_CRI_INVALID_OPND (accepted only on Cray T90 systems that support
IEEE floating-point arithmetic)
• IEEE_XPTN_INEXACT_RESULT
• IEEE_XPTN_UNDERFLOW
• IEEE_XPTN_OVERFLOW
• IEEE_XPTN_DIV_BY_ZERO
• IEEE_XPTN_INVALID_OPR
• IEEE_XPTN_ALL (all exceptions in this list)
The name of this intrinsic cannot be passed as an argument.

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN_IE EE_DEF INI TIO NS

44 004– 2138– 003


CLEAR_IEEE_EXCEPTION ( 3I ) CLEAR_IEEE_EXCEPTION ( 3I )

RETURN VALUES
The exception indicator specified by exception (or each element of exception) is cleared so it now indicates
that the exception has not occurred.

EXAMPLES

! Cle ar the divide by zer o bit .

CALL CLEAR_IEE E_E XCEPTI ON(IEE E_XPTN _DIV_B Y_ZERO )

! Per for m a vec tor ized floati ng poi nt div ide.

x(1:n) = y(1:n) / z(1 :n)

IF (TE ST_IEEE_E XCE PTION( IEEE_X PTN_DI V_BY_Z ERO) THEN

! Res et result since exc eption bit is set .

DO i = 1, n
x(i ) = CVM GN( 0.0, x, MASK)
END DO

END IF

SEE ALSO
GET_IEEE_EXCEPTIONS(3I), SET_IEEE_EXCEPTION(3I), TEST_IEEE_EXCEPTION(3I).

004– 2138– 003 45


CLOC ( 3I ) CLOC ( 3I )

NAME
CLOC – Obtains the Fortran Character Descriptor (FCD) of a character entity

SYNOPSIS
CLOC ([C=]c)

IMPLEMENTATION
UNICOS, UNICOS/mk systems
CF90

STANDARDS
Fortran extension

DESCRIPTION
The CLOC intrinsic function returns the FCD of a character entity. It accepts the following argument:
c Must be a variable of type character
The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The value returned is of type Cray character pointer.

46 004– 2138– 003


CLOCK ( 3I ) CLOCK ( 3I )

NAME
CLOCK – Returns the current time

SYNOPSIS
CLOCK ()

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
CLOCK obtains the current time, in ASCII hh:mm:ss format, from the real-time clock.
CLOCK accepts no arguments. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The data type of the return value depends on your platform. On UNICOS and UNICOS/mk systems, the
return value is of type Boolean. On IRIX systems, it is of type CHARACTER*8.

NOTES
The CLOCK intrinsic function is outmoded. Refer to the Fortran Language Reference Manual, Volume 3,
for information on outmoded features and their preferred standard alternatives.

004– 2138– 003 47


CMPLX ( 3I ) CMPLX ( 3I )

NAME
CMPLX, DCMPLX, QCMPLX – Converts to type complex

SYNOPSIS
CMPLX ([X=]x [,[Y=]y] [,[KIND=]kind])
DCMPLX ([X=]x [,[Y=]y])
QCMPLX ([X=]x [,[Y=]y])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: DCMPLX, QCMPLX

DESCRIPTION
CMPLX is a generic function name; the others are specifics. These are elemental intrinsic functions. These
functions convert x and (if specified) y into type complex. Their arguments are as follows:
x The real part of complex number. Must be type integer, Boolean, real, complex, double
precision, or quad precision. If x is of type complex, argument y cannot be specified.
See the RETURN VALUES section for more information on input data types and return values.
y The imaginary part of a number. Must be of the same type and kind type as x. If unspecified,
zero is assumed.
kind An integer scalar value. The kind type assigned to the result. Must be a valid kind type for
type complex on your platform. Kind types accepted differ from platform to platform, see
Fortran Language Reference Manual, Volume 1, for information on valid types and kind types
allowed.
This argument is not accepted by the MIPSpro Fortran 77 compiler.
Type conversion routines assign the appropriate type to Boolean arguments without shifting or manipulating
the bit patterns they represent.
The following cases represent the evaluation of CMPLX when using both arguments:
• CMPLX(I,J) yields FLOAT(I)+i*FLOAT(J).
• CMPLX(x,y) yields the complex value x+i*y.

48 004– 2138– 003


CMPLX ( 3I ) CMPLX ( 3I )

The following cases represent the evaluation of CMPLX when using the first argument:
• CMPLX(X) yields X+i*0.
• CMPLX(I) yields FLOAT(I)+i*0.
• If C is complex, CMPLX(C) yields C.
NOTES
The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
If the kind argument is specified, the kind type of the result is the same as the kind argument.
If the kind argument is not specified, the following return values are obtained:
• CMPLX returns a complex value.
• DCMPLX returns a double-complex value.
• QCMPLX returns a quad-complex value.

004– 2138– 003 49


CMR ( 3I ) CMR ( 3I )

NAME
_cmr – Assures completion of memory references

SYNOPSIS
#include <intrinsics.h>
void _cmr (void);

IMPLEMENTATION
UNICOS systems

STANDARDS
Cray C/C++ extension

DESCRIPTION
The _cmr function assures completion of all memory references within the current central processing unit
(CPU).

C/C++ NOTES
Because _cmr is an intrinsic function, no externally visible library function is available for it. The compiler
generates inline code to produce the result.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

50 004– 2138– 003


COMPL ( 3I ) COMPL ( 3I )

NAME
COMPL – Computes complement

SYNOPSIS
COMPL ([I=]i)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
The COMPL intrinsic function computes the complement of i. It accepts the following argument:
i A Boolean, integer, real, logical, or Cray pointer value.
COMPL is an elemental function. The name of this intrinsic cannot be passed as an argument.
The following tables show both the logical complement and the bit-wise logical complement:

Logical Variable COMPL (Logical Variable)

T F
F T

Bit of Variable COMPL (Bit of Variable)

1 0
0 1

NOTES
COMPL is outmoded. Refer to the Fortran Language Reference Manual, Volume 2, for information about
outmoded features and their preferred standard alternatives.

004– 2138– 003 51


COMPL ( 3I ) COMPL ( 3I )

CAUTIONS
Unexpected results can occur when Boolean functions are declared external and then used with logical
arguments. On UNICOS and UNICOS/mk systems, the external Boolean functions always treat their
arguments as type Boolean and return a Boolean result. On IRIX systems, the result is an integer.

RETURN VALUES
When given an argument of type logical, COMPL computes a logical complement and returns a logical result.
On UNICOS and UNICOS/mk systems, with an argument of type integer, real, Boolean, or Cray pointer,
COMPL computes a bit-wise logical complement and returns a Boolean result. No type conversion occurs.
On IRIX systems, with an argument of type integer, real, Boolean, or Cray Pointer, COMPL computes a
bit-wise logical complement and returns an integer result.

EXAMPLES
The following section of Fortran code shows the COMPL function used with an argument of type logical:
LOGICA L L1, L2
...
L2 = COM PL(L1)

The following section of Fortran code shows the COMPL function used with an argument of type integer.
The bit patterns of the argument and result are also given. For clarity, only the rightmost 8 bits are shown.
INTEGE R I1, I2
I1 = 240
...
I2 = COM PL(I1)

--- ------ --- --- --- --- --- --- --- -


| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
--- ------ --- --- --- --- --- --- --- -
I1

--- ------ --- --- --- --- --- --- --- -


| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
--- ------ --- --- --- --- --- --- --- -
I2

52 004– 2138– 003


CONJG ( 3I ) CONJG ( 3I )

NAME
CONJG, DCONJG, QCONJG – Computes conjugate of a complex number

SYNOPSIS
CONJG ([Z=]z])
DCONJG ([Z=]z])
QCONJG ([Z=]z])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: DCONJG, QCONJG

DESCRIPTION
CONJG, DCONJG, and QCONJG return the conjugate of a complex number. CONJG is the generic function
name; the others are specifics. These are elemental intrinsic functions. They accept the following argument:
z Must be type complex. See the RETURN VALUES section for information on input data types
and return values.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
This function evaluates y = z r – iz i .

NOTES
The CONJG intrinsic function name can be passed as an argument; the others cannot.

RETURN VALUES
CONJG returns the complex conjugate of a complex number.
DCONJG returns the double-precision complex conjugate of a double-complex number.
QCONJG returns the quad-precision complex conjugate of a quad-precision complex number.

004– 2138– 003 53


CONJG ( 3I ) CONJG ( 3I )

EXAMPLES
The following program gives RESULT=(3.0,-4.0):
PRO GRAM CONTES T
COM PLEX ARG, RES ULT
ARG =(3.0, 4.0)
RES ULT=CO NJG(AR G)
PRI NT *,R ESULT
STO P
END

54 004– 2138– 003


COS ( 3I ) COS ( 3I )

NAME
COS, DCOS, QCOS, CCOS, CDCOS, CQCOS, COSD, DCOSD, QCOSD – Computes cosine

SYNOPSIS
COS ([X=]x)
DCOS ([X=]x)
QCOS ([X=]x)
CCOS ([X=]x)
CDCOS ([X=]x)
CQCOS ([X=]x)
COSD ([X=]x)
DCOSD ([X=]x)
QCOSD ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk and IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QCOS, CDCOS, CQCOS, COSD, DCOSD, QCOSD

DESCRIPTION
These functions evaluate y = cos(x).
COS and COSD are the generic function names; the others are specifics. These are elemental intrinsic
functions. They accept the following argument:
x Must be of type real. For COS, DCOS, QCOS, CCOS, CDCOS, and CQCOS, the argument must
be in radians. It is treated as (modulo 2 * pi). For COSD, DCOSD, and QCOSD, the argument
must be in degrees and is treated as modulo 360.
See the RETURN VALUES section for more information on input data types and return values.
Vector versions of these intrinsics exist on some systems. Vector versions of the COS, DCOS, CCOS, and
CDCOS intrinsic functions exist on UNICOS and UNICOS/mk systems. On UNICOS/mk systems, the vector
versions of these intrinsics are used when -O vector3 or -O3 are specified on the compiler command
line. A vector version of the single-precision and double-precision COS intrinsic exists on IRIX systems and
is used when -O3 is specified on the compiler command line.

004– 2138– 003 55


COS ( 3I ) COS ( 3I )

NOTES
The COS, DCOS, CCOS intrinsic function names can be passed as arguments; the others cannot.
On UNICOS/mk systems and on UNICOS systems that support the IEEE standard for floating-point
25
arithmetic, COS(x) yields NaN if  x > 2 .
On UNICOS systems that do not support the IEEE standard for floating-point arithmetic, COS(x) yields 0 if
25
 x > 2 .
19
On IRIX systems, COS(x) yields NaN if  x > pi * 2 .
On all systems that support the IEEE standard for floating-point arithmetic, COS(x) yields NaN if x = NaN.

RETURN VALUES
COS and COSD return the single-precision cosine of their single-precision arguments.
DCOS and DCOSD return the double-precision cosine of their double-precision arguments.
QCOS and QCOSD return the quad-precision cosine of their quad-precision arguments.
CCOS returns the complex cosine of its complex argument.
CDCOS returns the complex double-precision cosine of its complex double-precision argument.
CQCOS returns the complex quad-precision cosine of its complex quad-precision argument.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

56 004– 2138– 003


COSH ( 3I ) COSH ( 3I )

NAME
COSH, DCOSH, QCOSH – Computes hyperbolic cosine

SYNOPSIS
COSH ([X=]x)
DCOSH ([X=]x)
QCOSH ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QCOSH

DESCRIPTION
COSH is the generic function name; the others are specifics. COSH, DCOSH, and QCOSH are elemental
intrinsic functions. These are elemental functions. They accept the following argument:
x Must be of type real. The type and kind type of x is identical to the type and kind type of the
return value. See the RETURN VALUES section for more information on input data types and
return values.
x –x
These functions evaluate y = cosh(x) = (e + e ) / 2.

NOTES
The COSH and DCOSH intrinsic function names can be passed as arguments; the other cannot.
On Cray T90 systems that support IEEE arithmetic, the following return values occur:
• If  x > 709.78, COSH(x) yields infinity.
• If x = NaN, COSH(x) yields NaN.
RETURN VALUES
COSH returns the single-precision real hyperbolic cosine of its single-precision real argument.
DCOSH returns the double-precision real hyperbolic cosine of its double-precision real argument.

004– 2138– 003 57


COSH ( 3I ) COSH ( 3I )

QCOSH returns the quad-precision real hyperbolic cosine of its quad-precision real argument.

58 004– 2138– 003


COT ( 3I ) COT ( 3I )

NAME
COT, COTAN, DCOT, DCOTAN, QCOT, CQCOTAN – Computes cotangent

SYNOPSIS
COT ([X=]x)
COTAN ([X=]x)
DCOT ([X=]x)
DCOTAN ([X=]x)
QCOT ([X=]x)
QCOTAN ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extensions

DESCRIPTION
COT is the generic function name; the others are specifics. They are elemental intrinsic functions. They
accept the following argument:
x Must be of type real. The type and kind type of x is identical to the type and kind type of the
return value. See the RETURN VALUES section for more information on input data types and
return values.
These functions evaluate y = COT(x).

NOTES
The COT and DCOT intrinsic function names can be passed as arguments; the others cannot.
On UNICOS/mk systems and on UNICOS systems that support the IEEE standard for floating-point
25
arithmetic, if  x > pi * 2 or if x = NaN, COT(x) yields NaN.
25
On UNICOS systems that do not support the IEEE standard for floating-point arithmetic, if  x > pi * 2 or
if x = 0, COT(x) yields 0.
19
On IRIX systems, if  x > pi * 2 or if x = NaN, COT(x) yields NaN.

004– 2138– 003 59


COT ( 3I ) COT ( 3I )

RETURN VALUES
COT and COTAN return the single-precision real cotangent of their single-precision real arguments.
DCOT and DCOTAN return the double-precision real cotangent of their double-precision real arguments.
QCOT and QCOTAN return the quad-precision real cotangent of their quad-precision real arguments.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

60 004– 2138– 003


COUNT ( 3I ) COUNT ( 3I )

NAME
COUNT – Counts the number of true array elements

SYNOPSIS
COUNT ([MASK=]mask [,[DIM=]dim])

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The COUNT intrinsic function counts the number of true array elements of argument mask along dimension
dim. It accepts the following arguments:
mask Must be of type logical. It must not be a scalar.
dim Must be a scalar. It is an integer with a value in the range 1 ≤ dim ≤ n, where n is the rank of
mask. The corresponding actual argument must not be an optional dummy argument.
COUNT is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is type integer. It is a scalar result if dim is absent or if mask has rank 1. Otherwise, the result is
an array of rank n– 1 and of shape (d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ), where (d 1 , d 2 , . . ., d n ) is the shape of
mask.
The result of COUNT(mask) has a value equal to the number of TRUE elements of mask or has the value 0
if mask is a zero-sized array.
If mask has rank 1, COUNT(mask, dim) has a value equal to that of COUNT(mask). Otherwise, the value
of element (s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ) of COUNT(mask, dim) is equal to
COUNT(MASK (s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )).

EXAMPLES
Example 1:
• COUNT((/.TRUE.,.FALSE.,.TRUE./)) yields 2.
• COUNT(mask) yields 0 when mask is a zero-sized array.

004– 2138– 003 61


COUNT ( 3I ) COUNT ( 3I )

Example 2: Assume that B is the following array:


 135
 246
C is the following array:
 035
 748
• COUNT(B.NE.C) yields 3.
• COUNT(B.NE.C,DIM=1) yields [2,0,1].
• COUNT(B.NE.C,DIM=2) yields [1,2].
• COUNT(C.EQ.1) yields 0 because there are no true elements in the mask.
Example 3: Assume that array N is as follows:
 0123
 4567
 8901
In an array section reference, you can expect the following results:
• COUNT((N(2:3,2:4).NE.0)) yields 5.
• COUNT((N(2:3,2:4).NE.0),DIM=1) yields [2,1,2].
• COUNT((N(2:3,2:4).NE.0),DIM=2) yields [3,2].

62 004– 2138– 003


CPU_TIME ( 3I ) CPU_TIME ( 3I )

NAME
CPU_TIME – Returns the processor time

SYNOPSIS
CPU_TIME ([TIME=]time)

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The CPU_TIME intrinsic subroutine returns the user time if successful. This intrinsic subroutine accepts the
following argument:
time Must be a scalar and of type real. It is an output argument. The type of the argument is not
restricted to any particular kind type.
The name of this intrinsic cannot be passed as an argument. The time returned by this intrinsic subroutine is
user time on all systems.
On UNICOS and UNICOS/mk systems, a call to CPU_TIME must be done once and before the first timing
loop to initialize the time structure. CPU_TIME includes time accumulated by all processors in a
multitasking program.

RETURN VALUES
CPU_TIME yields -1.0 if the time cannot be returned.

EXAMPLES
The following program uses the CPU_TIME intrinsic subroutine and was run on an IRIX system:

004– 2138– 003 63


CPU_TIME ( 3I ) CPU_TIME ( 3I )

PROGRAM CPU TIMETE ST


REAL RTIME(2)
CHARACTER (LE N=4 00) :: EXP RIG HT2
CHARACTER (LE N=8 00) :: EXP RIG HT
INTEGER :: J
CALL CPU _TIME( RTIME( 1))
IF (RTIME(1) .EQ . -1. 0) THE N
PRINT *,’CPU _TI ME NOT WOR KIN G, QUI T’
PRINT *,’ RTI ME(1) =’,RTI ME( 1)
STOP ’UNSUC CESSFU L’
ENDIF
CALL CPU _TIME( RTIME( 1))
DO J = 1, 400
EXPRIGHT2 (J: J) = " "
ENDDO
CALL CPU _TIME( RTIME( 2))
PRINT *,’ ELAPSE D CPU TIME TIME=’ ,RT IME(2) - RTI ME( 1)

CALL CPU_TI ME( RTIME( 1))


DO J = 1, 800
EXP RIG HT(J:J ) = " "
ENDDO
CALL CPU_TI ME( RTIME( 2))
PRINT *,’ELA PSE D CPU TIM E TIM E=’,RT IME (2) - RTIME( 1)
end

This program generated the following output:


ELAPSE D CPU TIME TIME= 1.1 099 968 11E -4
ELAPSE D CPU TIM E TIM E= 2.0 299945 03E -4

64 004– 2138– 003


CSHIFT ( 3I ) CSHIFT ( 3I )

NAME
CSHIFT – Performs a circular shift on an array expression

SYNOPSIS
CSHIFT ([ARRAY=]array, [SHIFT=]shift [, [DIM=]dim])

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The CSHIFT intrinsic function performs a circular shift on an array expression of rank 1 or performs
circular shifts on all the complete rank 1 sections along a given array expression of rank 2 or greater.
Elements shifted out at one end are shifted in at the other end. Different sections can be shifted by different
amounts and in different directions; positive for left shifts, negative for right shifts.
CSHIFT accepts the following arguments:
array Can be of any type. It must not be a scalar.
shift Must be integer. If array has rank 1, shift must be a scalar. Otherwise, shift must be scalar or
have rank n– 1 and have shape (d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ), where (d 1 , d 2 , . . ., d n ) is the
shape of array.
dim Must be a scalar. It is an integer with a value in the range 1 ≤ dim ≤ n, where n is the rank of
array. If dim is omitted, a value of 1 is assumed.
CSHIFT is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is an array of the same type, type parameters, and shape as array.
If array has rank 1, element i of the result is array(1 + modulo(i + shift - 1, size(array))).
If array has rank greater than 1, section (s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n ) of the result has a value equal
to CSHIFT(array (s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n ), sh, 1), where sh is shift or
shift(s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n )

004– 2138– 003 65


CSHIFT ( 3I ) CSHIFT ( 3I )

EXAMPLES
Example 1: If V is a rank 1 array [1,2,3,4,5,6], the effect of shifting V circularly to the left by two
positions is achieved by CSHIFT(V,SHIFT=2), which has the value [3,4,5,6,1,2]. Specifying
CSHIFT(V,SHIFT=-2) achieves a circular shift to the right by two positions and has the value
[5,6,1,2,3,4].
Example 2: The rows of an array of rank 2 can all be shifted by the same amount or by different amounts.
Assume M is the following array:
| 1 2 3 |
| 4 5 6 |
| 7 8 9 |

CSHIFT(M,SHIFT=-1,DIM=2) yields:
| 3 1 2 |
| 6 4 5 |
| 9 7 8 |

CSHIFT(M,SHIFT=(/-1,1,0),DIM=2) yields:
| 3 1 2 |
| 5 6 4 |
| 7 8 9 |

Example 3: N is the following array:


| 1 2 3 4 |
| 5 6 7 8 |
| 9 10 11 12 |

CSHIFT(N,SHIFT=-1,DIM=1) yields:
| 9 10 11 12 |
| 1 2 3 4 |
| 5 6 7 8 |

With an array section of multidimensional array N, CSHIFT(N(2:3,2:4),SHIFT=-1,DIM=1)) yields:


| 10 11 12 |
| 6 7 8 |

66 004– 2138– 003


CSMG ( 3I ) CSMG ( 3I )

NAME
CSMG – Performs a conditional scalar merge

SYNOPSIS
CSMG ([I=]i, [J=]j, [K=]k)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
The CSMG intrinsic function merges i and j, controlled by the bit mask in k. When a 1 bit appears in k, the
corresponding bit of i becomes the corresponding bit of the result. When a 0 bit appears in k, the
corresponding bit of j is taken. Therefore, CSMG(i, j, k) equals the following specification:
(i .AND. k) .OR . (j .AN D. .NO T. k)

The CSMG function accepts the following arguments:


i First item to be merged. Can be of Boolean, integer, real, or Cray pointer type. Must be the
same length as j and k.
j Second item to be merged. Can be of Boolean, integer, real, or Cray pointer type. Must be the
same length as i and k.
k Bit mask. Can be of Boolean, integer, real, or Cray pointer type. Must be the same length as i
and j.
CSMG is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
The CSMG intrinsic function is outmoded. Refer to the Fortran Language Reference Manual, Volume 3, for
information on outmoded features and their preferred standard alternatives.

RETURN VALUES
On UNICOS and UNICOS/mk systems, the return value is of type Boolean. On IRIX systems, the return
value is of type integer.

004– 2138– 003 67


CSMG ( 3I ) CSMG ( 3I )

EXAMPLES
Example 1: Specifying CSMG(i,j,MASK(64)) or CSMG(i,j,-1) yields i.
Example 2: CSMG(i,j,0) yields j.
Example 3: Specifying the conditional scalar merge
CSMG(’ABCDEFGH’H,’12345678’H,X’0000FFFFFF0000FF’) yields ’12CDE67H’H as the result.
Example 4: This example applies only to UNICOS systems.
INT EGER EXP ONE NT, EXP MAS K
PAR AMETER ( EXP MAS K = X’7 FFF 000 000 000 000 ’ )
C Sta tement fun cti on:
EXP ONENT( X) = SHI FTR (X .AN D. EXP MAS K, 48)
C Sta tement fun cti on:
DIV BY2(X) =
& CSM G( SHI FTL (EX PON ENT (X) -1, 48) ,
& X,
& EXP MAS K )

According to this example, a call to DIVBY2(-28.0) yields -14.0.

68 004– 2138– 003


CVMG ( 3I ) CVMG ( 3I )

NAME
CVMGM, CVMGN, CVMGP, CVMGT, CVMGZ – Conditional vector merge functions

SYNOPSIS
CVMGM ([I=]i, [J=]j, [K=]k)
CVMGN ([I=]i, [J=]j, [K=]k)
CVMGP ([I=]i, [J=]j, [K=]k)
CVMGT ([I=]i, [J=]j, [K=]k)
CVMGZ ([I=]i, [J=]j, [K=]k)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
At run time, k is tested. You can use the conditional vector merge (CVMG) functions when an IF statement
involving arrays prevents vectorization of a loop. The compiler can vectorize almost all such loops, but
these functions can be used in older codes. Scalar arguments can also be used with these functions.
CVMG functions cannot be passed as arguments. They are elemental functions.
These functions test for the following:
• CVMGM tests for minus (negative). i is returned if k < 0. j is returned if k ≥ 0.
• CVMGN tests for nonzero. i is returned if k ≠ 0. j is returned if k = 0.
• CVMGP tests for positive or zero. i is returned if k ≥ 0. j is returned if k < 0.
• CVMGT tests for true. i is returned if k is true. j is returned if k is false.
• CVMGZ tests for zero. i is returned if k = 0. j is returned if k ≠ 0
These functions accept the following arguments:
i Can be of type logical, Boolean, integer, real, or Cray pointer.
See the RETURN VALUES section of this man page for more information on how the type of i
affects the return value.

004– 2138– 003 69


CVMG ( 3I ) CVMG ( 3I )

j Can be of type logical, Boolean, integer, real, or Cray pointer.


See the RETURN VALUES section of this man page for more information on how the type of j
affects the return value.
k Can be of type logical, Boolean, integer, real, or Cray pointer.
See the RETURN VALUES section of this man page for more information on how the type of k
affects the return value.
If k satisfies the condition tested by the function (for example, in CVMGP, if k is positive), the first argument
(i) is returned as the function result. If k does not satisfy the condition tested by the function, j is returned
as the function result.
For operands other than type logical, the vector merge functions are not generic with respect to data typing.
They accept arithmetic values of different types but interpret them as Boolean type (that is, as bit patterns).
The returned function value is also Boolean. Therefore, the function reference
CVMGT(1.0,2.0,.TRUE.) is not type real, with a value of 1.0, but a Boolean value that acts the same
as 1.0 in a floating-point operation.
A problem can arise if you assume that the function reference is type real and use it in an expression or
assignment that causes automatic type conversion. For example, if you use the function reference in a
context where an integer is needed, the result is not valid because 1.0 and 1 have different bit patterns.
Because CVMG function values are Boolean, a binary operation involving two CVMG functions uses integer
arithmetic. This can produce unexpected results in assignments such as the following in which A, B, C, and
D are real:
X = CVMGT(A,B ,LO GIC1) + CVM GT(C,D ,LOCIC 2)
! Int eger arithm etic, invali d res ults

However, when used in an expression with another operand, a CVMG function value takes on the type of
the other operand, without any explicit type conversion. For example, the following expression uses real
arithmetic:
X = 1.0 + CVM GT( 2.0,3. 0,L EXP) ! Val id (ty pes agree)

The following suggestions explain how to prevent bugs when using these functions:
• Use only one CVMG function in a given expression. If you use more than one CVMG function in an
expression, use explicit type conversion. This does not generate any additional code. For example:
X = REAL(CVMG T(1 .0,2.0 ,LTEST )) + REAL(C VMGT(X ,Y,LTE ST2))

• Ensure that the assignment type matches the function argument. Example:
X = CVMGT(1.0 ,2. 0,LTES T) ! Valid
X = REAL(CVMG T(1 ,2,LTE ST)) ! Val id (us es exp licit type conver sion)
X = CVMGT(1,2 ,LT EST) ! Inv alid (type mismat ch)

• Never use mixed typing in the first two arguments of a CVMGT function. Example:

70 004– 2138– 003


CVMG ( 3I ) CVMG ( 3I )

CVM GT( 1,2 .0, LTE ST) ! DO NOT DO THI S

The names of these intrinsics cannot be passed as arguments.

NOTES
The CVMG intrinsic functions are outmoded. Refer to the Fortran Language Reference Manual, Volume 3,
for information on outmoded features and their preferred standard alternatives.

RETURN VALUES
For CVMGM, CVMGN, CVMGP, CVMGT, and CVMGZ, the return value is either type Boolean, logical, integer,
or real, depending on the type of i and j.
On UNICOS and UNICOS/mk systems, type logical is returned if i is of type logical; otherwise it is of type
Boolean.
On IRIX systems, if i and j are both of type real, the result type is also real. If i is of type logical, type
logical is returned. In all other cases, the return value is of type integer.

EXAMPLES
Consider the following code:
DO I = N,M
X(I ) = A(I )
IF (B( I) .GT. C(I)) X(I ) = D(I )
END DO

This could be rewritten as follows:


DO I = N,M
X(I ) = CVM GT(D(I ), A(I ), B(I ).G T.C (I) )
END DO

The following rewrite would also be valid:


DO I = N,M
X(I ) = CVM GP( D(I), A(I ), B(I) - C(I ))
END DO

004– 2138– 003 71


DATE ( 3I ) DATE ( 3I )

NAME
DATE, JDATE – Returns the current date

SYNOPSIS
DATE()
JDATE()

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
DATE and JDATE return the current date. DATE returns the current date in ASCII mm/dd/yy format.
JDATE returns the current Julian day-number facsimile in ASCII yyddd format, left-justified and blank-filled.
If called as intrinsic functions, DATE and JDATE do not accept any arguments. The names of these
intrinsics cannot be passed as arguments.

RETURN VALUES
When called as an intrinsic function, the data type of the return value depends on your platform. On
UNICOS and UNICOS/mk systems, it is of type Boolean. On IRIX systems, it is of type CHARACTER*8.

NOTES
The DATE and JDATE intrinsic functions are outmoded. Refer to the Fortran Language Reference Manual,
Volume 3, for information on outmoded features and their preferred standard alternatives.
For both DATE and JDATE, the year will become 0 in the year 2000.

72 004– 2138– 003


DATE_AND_TIME ( 3I ) DATE_AND_TIME ( 3I )

NAME
DATE_AND_TIME – Returns data on the real-time clock and date

SYNOPSIS
CALL DATE_AND_TIME ([[DATE=]date] [,[TIME=]time] [,[ZONE=]zone] [,[VALUES=]values])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The DATE_AND_TIME intrinsic subroutine returns data on the real-time clock and date. The time returned
is local but the difference between local time and Coordinated Universal Time (UTC) can be determined.
Note that UTC is also known as Greenwich Mean Time.
The DATE_AND_TIME intrinsic subroutine accepts the following arguments:
date Must be a scalar of type character. It must be at least 8 characters long to contain the complete
value. It is an output argument, and the leftmost 8 characters are set to a value of the form
CCYYMMDD, where CC is the century, YY is the year within the century, MM is the month
within the year, and DD is the day within the month. If there is no date available, date is set to
blanks.
time Must be a scalar of type character. It must be at least 10 characters long to contain the complete
value. It is an output argument, and the leftmost 10 characters are set to a value of the form
hhmmss.sss, where hh is the hour of the day, mm is the minutes of the hour, and ss.sss is
seconds and milliseconds of the minute. If there is no clock available, time is set to blanks.
zone Must be a scalar of type character. It must be at least 5 characters long to contain the complete
value. It is an output argument whose leftmost 5 characters are set to a value of the form
±hhmm, where hh and mm are the time difference with respect to UTC in hours and parts of an
hour expressed in minutes, respectively. If there is no clock available, zone is set to blanks.
values Must be of type default integer and of rank one. It is an output argument and must have at least
8 elements. The values returned in values are as follows:
Values Return Value
values(1) The year (that is, 1990), or -HUGE (0) if there is no date available
values(2) The month of the year (1-12), or -HUGE (0) if there is no date available
values(3) The day of the month (1-31), or -HUGE (0) if there is no date available

004– 2138– 003 73


DATE_AND_TIME ( 3I ) DATE_AND_TIME ( 3I )

values(4) The time difference, in minutes, with respect to UTC, or -HUGE (0) if this
information is not available
values(5) The hour of the day, in the range of 0 to 23, or -HUGE (0) if there is no clock
values(6) The minutes of the hour, in the range 0 to 59, or -HUGE (0) if there is no clock
values(7) The seconds of the minute, in the range 0 to 60, or -HUGE (0) if there is no
clock
values(8) The milliseconds of the second, in the range 0 to 999, or -HUGE (0) if there is
no clock.
DATE_AND_TIME is an intrinsic subroutine. The name of this intrinsic cannot be passed as an argument.

EXAMPLES
The following program uses the DATE_AND_TIME intrinsic subroutine:
INT EGE R dat e_time(8)
CHARACTER (LEN=1 0) big_ben(3 )
CAL L DAT E_A ND_TIME(b ig_ ben(1) , big _ben(2 ), big _ben(3 ), dat e_time )
PRINT *,’ date_t ime arr ay val ues:’
PRINT *,’ year=’ ,da te_time(1 )
PRINT *,’ mon th_of_yea r=’ ,da te_tim e(2)
PRINT *,’ day _of_month =’, dat e_time (3)
PRINT *,’tim e dif fer ence in minute s=’,da te_tim e(4)
PRINT *,’ hour of day =’, dat e_time (5)
PRINT *,’ min utes of hour=’ ,da te_ tim e(6 )
PRINT *,’ second s of min ute=’, date_t ime(7)
PRINT *,’mil liseco nds of sec ond =’, dat e_t ime (8)
PRINT *, ’DA TE=’,big_ ben (1)
PRINT *, ’TI ME= ’,big_ben (2)
PRINT *, ’ZONE= ’,b ig_ben(3)
END

When this program was run in Minnesota, USA, on June 1, 1994, at approximately 5:39 PM, on a UNICOS
system, it generated the following output:

74 004– 2138– 003


DATE_AND_TIME ( 3I ) DATE_AND_TIME ( 3I )

dat e_time array values :


yea r=1994
mon th_ of_year=6
day _of _month=1
tim e dif fer ence in minute s=3 60
hou r of day=17
min ute s of hour=39
sec ond s of minute=30
mil lis econds of sec ond=81 8
DAT E=1 9940601
TIM E=1 73930.818
ZON E=- 0600

When this program was run in Minnesota, USA, on May 2, 1997, at approximately 9:34 AM, on an IRIX
system, it generated the following output:
date_t ime arr ay values :
year=1 997
mon th_of_ yea r=5
day _of_mo nth =2
tim e differenc e in min ute s=3 00
hour of day =9
min utes of hou r=3 4
sec onds of min ute =39
mil liseco nds of sec ond =583
DAT E=1997 050 2
TIM E=0934 39. 583
ZON E=-050 0

004– 2138– 003 75


DBLE ( 3I ) DBLE ( 3I )

NAME
DBLE – Converts to double-precision real

SYNOPSIS
DBLE ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran

DESCRIPTION
This intrinsic function converts the specified type to double precision. This is an elemental intrinsic
functions. It accepts the following arguments:
a Must be type integer, real, or complex.
If a is of type complex, an approximation of the real part of a is returned. As much precision as
possible is retained.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.

NOTES
The name of this intrinsic function cannot be passed as arguments.

RETURN VALUES
DBLE returns the double-precision equivalent of its argument.

76 004– 2138– 003


DIGITS ( 3I ) DIGITS ( 3I )

NAME
DIGITS – Returns the number of significant digits

SYNOPSIS
DIGITS ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The DIGITS intrinsic function returns the number of significant digits in the model representing numbers of
the same type and kind type parameter as the argument. The number returned is the number of significant
radix digits (base 2 digits), not decimal digits. It accepts the following argument:
x Must be of type integer or real. It can be scalar or array valued.
DIGITS is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type is an integer scalar. The result has the value q if x is of type integer. It has the value p if x
is of type real. The values q and p are defined on the MODELS(3I) man page.

EXAMPLES
The following code fragment was run on several systems:
INTEGE R(KIND =1) i1
INTEGE R(KIND =2) i2
INTEGE R(KIND =4) i4
INTEGE R(KIND =8) i8
INTEGE R id
PRINT *,’DIG ITS i1= ’,D IGI TS( i1)
PRINT *,’DIG ITS i2= ’,D IGI TS( i2)
PRINT *,’DIG ITS i4= ’,D IGI TS( i4)
PRINT *,’DIG ITS i8= ’,DIGI TS( i8)
PRINT *,’DIG ITS id= ’,D IGI TS( id)
END

004– 2138– 003 77


DIGITS ( 3I ) DIGITS ( 3I )

IRIX systems generated the following results:


DIG ITS i1= 7
DIG ITS i2= 15
DIG ITS i4= 31
DIG ITS i8= 63
DIG ITS id= 31

UNICOS and UNICOS/mk systems generated the following results:


DIG ITS i1= 7
DIG ITS i2= 15
DIG ITS i4= 31
DIG ITS i8= 63
DIG ITS id= 63

SEE ALSO
MODELS(3I)

78 004– 2138– 003


DIM ( 3I ) DIM ( 3I )

NAME
DIM, DDIM, QDIM, IDIM, IIDIM, JIDIM, KIDIM – Computes positive difference of two numbers

SYNOPSIS
DIM ([X=]x,[Y=]y)
DDIM ([X=]x,[Y=]y)
QDIM ([X=]x,[Y=]y)
IDIM ([X=]x,[Y=]y)
IIDIM ([X=]x,[Y=]y)
JIDIM ([X=]x,[Y=]y)
KIDIM ([X=]x,[Y=]y)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QDIM, IIDIM, JIDIM, KIDIM

DESCRIPTION
DIM is the generic function name; the others are specifics. These are elemental intrinsic functions. They
accept the following arguments:
x Must be of type integer or real.
y Must be of the same type and kind type as x.
These functions solve for:
R = x 1 – x 2 , if x 1 > x 2
R = 0, if x 1 ≤ x 2

NOTES
The DIM, IDIM, and DDIM intrinsic funtion names can be passed as arguments; the others cannot.

RETURN VALUES
DIM evaluates two real numbers and subtracts them. The result is a real positive difference.

004– 2138– 003 79


DIM ( 3I ) DIM ( 3I )

DDIM evaluates two double-precision real numbers and subtracts them. The result is a double-precision real
positive difference.
QDIM evaluates two quad-precision real numbers and subtracts them. The result is a quad-precision real
positive difference.
IDIM evaluates two integers and subtracts them. The result is an integer positive difference.
IIDIM evaluates two integer (KIND=2) numbers and subtracts them. The result is an integer (KIND=2)
positive difference.
JIDIM evaluates two integer (KIND=4) numbers and subtracts them. The result is an integer (KIND=4)
positive difference.
KIDIM evaluates two integer (KIND=8) numbers and subtracts them. The result is an integer (KIND=8)
positive difference.

EXAMPLES
The following program shows the use of IDIM to compute the positive difference between the integers 77
and 10:
PRO GRAM DIMTES T
INT EGER A,B,C, D,E
A = 77
B = 10
C = IDIM(A ,B)
WRITE 1,A ,B,C
1 FORMAT (I2 ,’POSI TIV E DIFFER ENCE ’,I2,’ EQU ALS ’, I2)
D = IDI M(B,A)
WRITE 2,B ,A,D
2 FORMAT (I2 ,’POSI TIV E DIFFER ENCE ’,I2,’ EQU ALS ’,I2)
STOP
END

The example program gives the following output:


77 POSITIVE DIF FERENC E 10 EQUALS 67
10 POSITIVE DIF FERENC E 77 EQUALS 0

80 004– 2138– 003


DOT_PRODUCT ( 3I ) DOT_PRODUCT ( 3I )

NAME
DOT_PRODUCT – Performs dot-product multiplication of numeric or logical vectors

SYNOPSIS
DOT_PRODUCT ([VECTOR_A=]vector_a, [VECTOR_B=]vector_b)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The DOT_PRODUCT intrinsic function performs dot-product multiplication of numeric or logical vectors. It
accepts the following arguments:
vector_a Must be of numeric type (integer, real, or complex) or of logical type. It must be array valued
and of rank one.
vector_b Must be of numeric type if vector_a is of numeric type or of type logical if vector_a is of type
logical. It must be array valued and of rank one. It must be conformable to vector_a.
DOT_PRODUCT is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
If the arguments are of numeric type, the type and kind type parameter of the result are those of the
expression vector_a * vector_b, determined by the types of the arguments. If the arguments are of type
logical, the result is of type logical with the kind type parameter of the expression vector_a .AND.
vector_b.
The result is scalar.
If vector_a is of type integer or real, the result has the value
SUM(vector_a*vector_b). If the vectors have size zero, the result has the value 0.
If vector_a is of type complex, the result has the value
SUM(CONJG(vector_a)*vector_b). If the vectors have size zero, the result has the value 0.
If vector_a is of type logical, the result has the value
ANY(vector_a.AND.vector_b). If the vectors have size 0, the result has the value FALSE.

004– 2138– 003 81


DOT_PRODUCT ( 3I ) DOT_PRODUCT ( 3I )

EXAMPLES
DOT_PRODUCT((/1,2,3/),(/2,3,4/)) yields 20.

82 004– 2138– 003


DPROD ( 3I ) DPROD ( 3I )

NAME
DPROD, QPROD – Computes double-precision or quad-precision product of two real numbers

SYNOPSIS
DPROD ([X=]x,[Y=]y)
QPROD ([X=]x,[Y=]y)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QPROD

DESCRIPTION
DPROD returns the double-precision real product of its two real arguments. QPROD returns the
quad-precision real product of its two real arguments. These are elemental functions. They accept the
following arguments:
x Must be of type single-precision real or double-precision real. See the RETURN VALUES
section for information on input data types and return values.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
y Must be of the same type and kind type as x.
These functions evaluate y = x * y.

RETURN VALUES
DPROD returns the double-precision real product of two real arguments.
QPROD returns the quad-precision real product of two real arguments.

NOTES
The name of this intrinsic can be passed as an argument.

004– 2138– 003 83


DPROD ( 3I ) DPROD ( 3I )

EXAMPLES
The following program calls DPROD to compute the double-precision product of the two real numbers 5.0
and 6.0:
PRO GRAM DOUBT
REA L X,Y
DOUBLE PRE CISION Z
X=5.0
Y=6.0
Z=DPRO D(X,Y)
PRINT *, Z
STOP
END

The preceding program gives Z to be the double-precision number 30.0 (or in Fortran, 30.D0).

84 004– 2138– 003


DSHIFTL ( 3I ) DSHIFTL ( 3I )

NAME
_dshiftl, DSHIFTL – Performs a double-object left shift

SYNOPSIS
C/C++:
#include <intrinsics.h>
long _dshiftl (long i, long j, long k);
Fortran:
DSHIFTL ([I=]i, [J=]j, [K=]k)

IMPLEMENTATION
C/C++: UNICOS, UNICOS/mk
Fortran: UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
The _dshiftl and DSHIFTL functions perform a double-object left shift. They return a single object.
The result is derived from two arguments, i and j. The arguments are as follows:
i The upper bits of the double object. Must be of type integer.
j The lower bits of the double object. Must be of the same type and size as i.
k The number of bits to be shifted. Must be of type integer.
The _dshiftl and DSHIFTL functions return a value generated by a left double-shift of the leftmost k bits
of j into the rightmost k bits of i. If both the i and j arguments specify the same word in memory, a circular
shift occurs. The value of k must be in the range of 0 through 64 for _dshiftl.

NOTES

C/C++
Because _dshiftl is an intrinsic function, no externally visible library function is available for it. The
compiler generates inline code to produce the result.

004– 2138– 003 85


DSHIFTL ( 3I ) DSHIFTL ( 3I )

Fortran
On UNICOS systems, i and j are 64-bit objects. On UNICOS/mk systems, i and j can be 32- or 64-bit
objects. On IRIX systems, i and j can be 8-, 16-, 32-, or 64-bit objects.
When shifting 64-bit quantities, i makes up bits 64 through 127 of the double object. The function result is
the 64-bit string beginning with bit 64-k; that is, its leftmost bit is k bits from the double object’s left end.
The value of k must be 0 ≤ k ≤ 64.
When shifting 32-bit quantities, i makes up bits 32 through 63 of the double object. The function result is
the 32-bit string beginning with bit 32-k; that is, its leftmost bit is k bits from the double object’s left end.
The value of k must be 0 ≤ k ≤ 32.
When shifting 16-bit quantities, i makes up bits 16 through 31 of the double object. The function result is
the 16-bit string beginning with bit 16-k; that is, its leftmost bit is k bits from the double object’s left end.
The value of k must be 0 ≤ k ≤ 16.
When shifting 8-bit quantities, i makes up bits 8 through 15 of the double object. The function result is the
8-bit string beginning with bit 8-k; that is, its leftmost bit is k bits from the double object’s left end. The
value of k must be 0 ≤ k ≤ 8.
Arguments are not altered in their original storage unless the result represents the same address as either i or
j, as in the Fortran assignment M = DSHIFTL(M, N, 5).
For more information on storage units, see the Fortran Language Reference Manual, Volume 3.
DSHIFTL is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
_dshiftl returns a 64-bit integer result.
DSHIFTL returns a typeless result on UNICOS and UNICOS/mk systems and an integer result on IRIX
systems. The size of the result is the size of the arguments i and j.

EXAMPLES
Fortran: The following figure shows a shift of two 64-bit quantities:
|<-- Double quanti ty shi fts lef t by k bit s

127 i 64 63 j 0
|_____ ______ ______ ___ ___ ___ _|_ ___ ___ ___ ___ ___ ___ ___ ___ __|
|----- k-----| ------ --- -re sul t-- --- --- --- |

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.
Fortran Language Reference Manual, Volume 3

86 004– 2138– 003


DSHIFTR ( 3I ) DSHIFTR ( 3I )

NAME
_dshiftr, DSHIFTR – Performs a double-object right shift

SYNOPSIS
C/C++:
#include <intrinsics.h>
long _dshiftr (long i, long j, long k);
Fortran:
DSHIFTR ([I=]i, [J=]j, [K=]k)

IMPLEMENTATION
C/C++: UNICOS and UNICOS/mk systems
Fortran: UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
The _dshiftr and DSHIFTR functions perform a double-object right shift. They return a single object.
This result is derived from two arguments, i and j. The arguments are as follows:
i The upper bits of the double object. Must be of type integer.
j The lower bits of the double object. Must be of the same type and size as i.
k The number of bits to be shifted. Must be of type integer.
The _dshiftr and DSHIFTR functions return a value generated by a right double-shift of the rightmost k
bits of i into the leftmost k bits of j. If both the i and j arguments specify the same word in memory, a
circular shift occurs. The value of k must be in the range of 0 through 64 for _dshiftr.

NOTES

C/C++
Because _dshiftr is an intrinsic function, no externally visible library function is available for it. The
compiler generates inline code to produce the result.

004– 2138– 003 87


DSHIFTR ( 3I ) DSHIFTR ( 3I )

Fortran
On UNICOS systems, i and j are 64-bit objects. On UNICOS/mk systems, i and j can be 32- or 64-bit
objects. On IRIX systems, i and j can be 8-, 16-, 32-, or 64-bit objects.
When shifting 64-bit quantities, i makes up bits 64 through 127 of the double object. The function result is
the 64-bit string beginning with bit 64-k; that is, its rightmost bit is k bits from the double object’s right end.
The value of k must be 0 ≤ k ≤ 64.
When shifting 32-bit quantities, i makes up bits 32 through 63 of the double object. The function result is
the 32-bit string beginning with bit 32-k; that is, its rightmost bit is k bits from the double object’s right end.
The value of k must be 0 ≤ k ≤ 32.
When shifting 16-bit quantities, i makes up bits 16 through 31 of the double object. The function result is
the 16-bit string beginning with bit 16-k; that is, its rightmost bit is k bits from the double object’s right end.
The value of k must be 0 ≤ k ≤ 16.
When shifting 8-bit quantities, i makes up bits 8 through 15 of the double object. The function result is the
8-bit string beginning with bit 8-k; that is, its rightmost bit is k bits from the double object’s right end. The
value of k must be 0 ≤ k ≤ 8.
Arguments are not altered in their original storage unless the result represents the same address as either i or
j, as in the Fortran assignment M = DSHIFTR(M, N, 5).
For more information on storage units, see the Fortran Language Reference Manual, Volume 3.
DSHIFTR is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
_dshiftr returns a 64-bit integer result.
DSHIFTR returns a typeless result on UNICOS and UNICOS/mk systems and an integer result on IRIX
systems. The size of the result is the size of the arguments i and j.

EXAMPLES
The following figure shows a shift of two 64-bit quantities:
Double wor d shi fts rig ht by k bit s -->

127 i 64 63 j 0
|_____ ______ ______ ___ ___ ___ _|_ ___ ___ ___ ___ ___ ___ ___ ___ _|
|----- --- res ult --- --- --- -|- --- --- -k--- --- --|

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.
Fortran Language Reference Manual, Volume 3

88 004– 2138– 003


DSM ( 3I ) DSM ( 3I )

NAME
DSM_CHUNKSIZE, DSM_DISTRIBUTION_BLOCK, DSM_DISTRIBUTION_CYCLIC,
DSM_DISTRIBUTION_STAR, DSM_ISDISTRIBUTED, DSM_ISRESHAPED, DSM_NUMCHUNKS,
DSM_NUMTHREADS, DSM_REM_CHUNKSIZE, DSM_THIS_CHUNKSIZE, DSM_THIS_STARTINGINDEX,
DSM_THIS_THREADNUM – Query intrinsics for distributed arrays

SYNOPSIS
DSM_CHUNKSIZE ([ARRAY=]array, [DIM=]dim)
DSM_DISTRIBUTION_BLOCK ([ARRAY=]array, [DIM=]dim)
DSM_DISTRIBUTION_CYCLIC ([ARRAY=]array, [DIM=]dim)
DSM_DISTRIBUTION_STAR ([ARRAY=]array, [DIM=]dim)
DSM_ISDISTRIBUTED ([ARRAY=]array)
DSM_ISRESHAPED ([ARRAY=]array)
DSM_NUMCHUNKS ([ARRAY=]array, [DIM=]dim)
DSM_NUMTHREADS ([ARRAY=]array, [DIM=]dim)
DSM_REM_CHUNKSIZE ([ARRAY=]array, [DIM=]dim, [INDEX=]index)
DSM_THIS_CHUNKSIZE ([ARRAY=]array, [DIM=]dim, [INDEX=]index)
DSM_THIS_STARTINGINDEX ([ARRAY=]array, [DIM=]dim, [INDEX=]index)
DSM_THIS_THREADNUM ([ARRAY=]array, [DIM=]dim, [INDEX=]index)

IMPLEMENTATION
IRIX systems
MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extension

DESCRIPTION
You can use the Dynamic Shared Memory (DSM) functions to obtain information about an individual
dimension of a distributed array. All functions work with 64-bit integers.
The DSM functions are as follows:
Function Purpose
DSM_CHUNKSIZE Returns the chunk size (ignoring partial chunks) in the given dimension for each of
BLOCK, CYCLIC, and asterisk (*) distributions.
DSM_DISTRIBUTION_BLOCK
Returns 0 (FALSE) or 1 (TRUE) for a query on whether or not the specified
dimension has a BLOCK distribution.

004– 2138– 003 89


DSM ( 3I ) DSM ( 3I )

DSM_DISTRIBUTION_CYCLIC
Returns 0 (FALSE) or 1 (TRUE) for a query on whether or not the specified
dimension has a CYCLIC distribution.
DSM_DISTRIBUTION_STAR
Returns 0 (FALSE) or 1 (TRUE) for a query on whether or not the specified
dimension has an asterisk (*) distribution.
DSM_ISDISTRIBUTED
Returns 0 (FALSE) or 1 (TRUE) for a query on whether or not array is distributed
(regular or reshaped) or not.
DSM_ISRESHAPED Returns 0 (FALSE) or 1 (TRUE) for a query on whether or not array is reshaped or
not.
DSM_NUMCHUNKS Returns the number of chunks (including partial chunks) in the given dim for each
of BLOCK, CYCLIC, and asterisk (*) distributions.
DSM_NUMTHREADS Returns the number of threads in the specified dimension of a distributed array.
DSM_REM_CHUNKSIZE
Returns the remaining chunk size from index to the end of the current chunk,
inclusive of each end point. Essentially it is the distance from index to the end of
that contiguous block, inclusive.
DSM_THIS_CHUNKSIZE
Returns the chunk size for the chunk containing the specified index for each of
BLOCK, CYCLIC, and asterisk (*). This value may be different from
DSM_CHUNKSIZE due to edge effects that can lead to a partial chunk.
DSM_THIS_STARTINGINDEX
Returns the starting index value of the chunk containing the supplied index.
DSM_THIS_THREADNUM
Returns the thread number for the chunk containing the given index value for each
of BLOCK, CYCLIC, and asterisk (*) distributions.
These functions accept the following arguments:
array An array of any data type.
dim The array dimension for which you need information. The array dimensions are numbered
starting at 1. Must be of type integer.
index Must be of type integer.
The names of these intrinsics cannot be passed as arguments.

90 004– 2138– 003


DSM ( 3I ) DSM ( 3I )

RETURN VALUES
The return value is of type integer. If you are using the MIPSpro 7 Fortran 90 compiler, the value is
INTEGER(KIND=8).
These functions return -1 in case of an error. For DSM_THIS_STARTINGINDEX, however, -1 can be a
valid return value.

SEE ALSO
MIPSpro 7 Fortran 90 Commands and Directives Reference Manual
mp(3F)

004– 2138– 003 91


ENABLE_IEEE_INTERRUPT ( 3I ) ENABLE_IEEE_INTERRUPT ( 3I )

NAME
ENABLE_IEEE_INTERRUPT, DISABLE_IEEE_INTERRUPT – Enables or disables floating-point
interrupt

SYNOPSIS
ENABLE_IEEE_INTERRUPT ([INTERRUPT=]interrupt)
DISABLE_IEEE_INTERRUPT ([INTERRUPT=]interrupt)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The ENABLE_IEEE_INTERRUPT intrinsic subroutine enables the specified floating-point interrupt.
The DISABLE_IEEE_INTERRUPT intrinsic subroutine disables the specified floating-point interrupt.
They accept the following argument:
interrupt Must be of an integer type that occupies a full word. If interrupt is an array, it must be
1-dimensional. The single value in the scalar argument case, or each element in the array
argument case, must be set to one of the values represented by one of the following named
constants:
• IEEE_NTPT_CRI_INVALID_OPND (accepted only on Cray T90 systems that support
IEEE floating-point arithmetic)
• IEEE_NTPT_INEXACT_RESULT
• IEEE_NTPT_UNDERFLOW
• IEEE_NTPT_OVERFLOW
• IEEE_NTPT_DIV_BY_ZERO
• IEEE_NTPT_INVALID_OPR
• IEEE_NTPT_ALL (all interrupts in this list)

92 004– 2138– 003


ENABLE_IEEE_INTERRUPT ( 3I ) ENABLE_IEEE_INTERRUPT ( 3I )

The IEEE_INEXACT_RESULT and IEEE_UNDERFLOW interrupts should be disabled before the execution
of any I/O statement that involves conversion to prevent arithmetic exceptions during the execution of those
I/O statements.
The name of this intrinsic cannot be passed as an argument.

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN _IE EE_DEFINI TIO NS

On UNICOS/mk systems, you cannot use ENABLE_IEEE_INTERRUPT or DISABLE_IEEE_INTERRUPT


to set the following bits:
• IEEE_NTPT_INVALID_OPR
• IEEE_NTPT_DIV_BY_ZERO
• IEEE_NTPT_OVERFLOW
The hardware ignores attempts to set these bits.

CAUTIONS
Care should be taken before enabling interrupts on inexact results because inexact results are so prevalent.
In particular, inexact results will occur while performing operations which are not generally regarded as
floating-point operations. These include, but are not limited to, Fortran I/O statements, memory allocations
and DO loop iteration count computations.

RETURN VALUES
Upon return from ENABLE_IEEE_INTERRUPT, the interrupt, or each element of interrupt, is enabled. If
interrupt, or any element of interrupt, has the value IEEE_NTPT_ALL, all interrupts are enabled.
Upon return from DISABLE_IEEE_INTERRUPT, the interrupt, or each element of interrupt, is disabled. If
interrupt, or any element of interrupt, has the value IEEE_NTPT_ALL, all interrupts are disabled.

EXAMPLES
The following program can be run on UNICOS and IRIX systems:
SUBROU TIN E cal culate
USE FTN_IEEE_ DEF INITIO NS

INTEGE R int err upt_st atu s

! Save the cur rent floati ng poi nt int errupt sta tus.

CALL GET_IE EE_ INTERR UPTS(i nterru pt_sta tus)

004– 2138– 003 93


ENABLE_IEEE_INTERRUPT ( 3I ) ENABLE_IEEE_INTERRUPT ( 3I )

! Ena ble int err upt on div ide by zer o if it has n’t alread y bee n
! ena ble d.

IF (.N OT. TES T_I EEE _IN TER RUP T(I EEE _NT PT_ DIV _BY _ZE RO)) &
CAL L ENA BLE _IE EE_ INTERR UPT (IEEE_ NTPT_D IV_BY_ ZER O)

! Per for m a flo ati ng poi nt div ide .


! If z = 0, the pro gram error termin ates.

x = y / z

! Dis abl e int err upt on div ide by zer o.

CAL L DIS ABL E_I EEE _IN TER RUP T(I EEE _NT PT_ DIV _BY _ZERO) )

! If z = 0, q = Inf inity (qu ietly) .

q = y / z

! Res tor e the flo ating poi nt int errupt sta tus to wha t it was
! whe n thi s pro ced ure was cal led .

CAL L SET _IE EE_ INT ERRUPT S(i nterru pt_sta tus)

END SUB ROU TIN E

94 004– 2138– 003


EOSHIFT ( 3I ) EOSHIFT ( 3I )

NAME
EOSHIFT – Performs an end-off shift on an array expression

SYNOPSIS
EOSHIFT ([ARRAY=]array, [SHIFT=]shift [,[BOUNDARY=]boundary] [,[DIM=]dim])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The EOSHIFT intrinsic function performs an end-off shift on an array expression of rank one, or it performs
end-off shifts on all the complete rank one sections along a given array expression of rank two or greater.
Elements are shifted off at one end of a section and copies of a boundary value are shifted in at the other
end. Different sections can have different boundary values and can be shifted by different amounts and in
different directions; positive for left shifts, negative for right shifts.
EOSHIFT accepts the following arguments:
array May be of any type. It must not be scalar.
shift Must be integer. If array has rank one, shift must be a scalar. Otherwise, shift must be scalar
or have rank n– 1 and have shape (d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ), where (d 1 , d 2 , . . ., d n ) is
the shape of array.
boundary Must be of the same type and have the same type parameters as array. Must be scalar if array
has rank one; otherwise, it must be either scalar or of rank n– 1 and of shape
(d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ), The boundary argument can be omitted for the data types in
the following list. In these cases, the default value is the scalar value shown:
Type of array Default Value of boundary
Integer 0
Real 0.0
Complex (0.0,0.0)
Logical false
Character(len) len blanks

The boundary data type must be present for derived data types.

004– 2138– 003 95


EOSHIFT ( 3I ) EOSHIFT ( 3I )

dim Must be a scalar. Must be an integer value in the range 1 ≤ dim ≤ n, where n is the rank of
array. If dim is omitted, the default value is 1.
EOSHIFT is a transformational intrinsic function. The name of this intrinsic cannot be passed as an
argument.

RETURN VALUES
The result is an array of the same type, type parameters, and shape as array.
Element (s 1 , s 2 , . . ., s n ) of the result has the value array(s 1 , s 2 , . . ., s dim– 1 , s dim + sh, s dim+1 , . . ., s n ), where
sh is shift or shift(s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ), provided that the inequality
LBOUND(array,dim) ≤ s dim + sh ≤ UBOUND(array,dim) holds and is otherwise boundary or
boundary(s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ).

EXAMPLES
Example 1: If V is array [1,2,3,4,5,6], the effect of shifting V end-off to the left by three positions is
achieved by EOSHIFT(V,SHIFT=3), which yields [4,5,6,0,0,0]. Specifying
EOSHIFT(V,SHIFT=-2,BOUNDARY=99) achieves an end-off shift to the right by two positions with the
boundary value of 99 and yields [99,99,1,2,3,4].
Example 2: The rows of an array of rank two can all be shifted by the same amount or by different amounts
and the boundary elements can be the same or different. Assume that M is the following array:
| A B C |
| D E F |
| G H I |

EOSHIFT(M,SHIFT=-1,BOUNDARY=’*’,DIM=2) yields:
| * A B |
| * D E |
| * G H |

EOSHIFT(M,SHIFT=(/-1,1,0/),BOUNDARY=(/’*’,’/’,’?’/),DIM=2) yields:
| * A B |
| E F / |
| G H I |

Section EOSHIFT(M(2:3,2:3),SHIFT=-1,BOUNDARY=’*’,DIM=2) yields:


| * E |
| * H |

96 004– 2138– 003


EPSILON ( 3I ) EPSILON ( 3I )

NAME
EPSILON – Returns r-1, where r is the smallest number greater than 1 in the numeric model

SYNOPSIS
EPSILON ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The EPSILON intrinsic function returns a positive model number that is almost negligible compared to unity
in the model representing numbers of the same type and kind type parameter as the argument. It accepts the
following argument:
x Must be of type real. It can be scalar or array valued.
EPSILON is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
(1-p)
The result type is a scalar of the same type and kind type parameter as x. The result has the value b
where b and p are as defined in the model for real numbers representing numbers of the same type and kind
type parameter as x. For information on the real number model, see the MODELS(3I) man page.

EXAMPLES
The following code fragment was run on several systems:
REA L(KIND =4) r4
REA L(KIND =8) r8
REAL(K IND=16 ) r16
REAL rd
PRINT *,’EPS ILO N r4= ’,EPSI LON (r4 )
PRINT *,’EPS ILO N r8= ’,E PSI LON (r8 )
PRINT *,’EPS ILO N r16 =’,EPS ILO N(r 16)
PRINT *,’EPS ILO N rd= ’,E PSI LON (rd )
END

004– 2138– 003 97


EPSILON ( 3I ) EPSILON ( 3I )

The results of this test case on IRIX systems are as follows:


EPS ILO N r4= 1.1920 928 96E-7
EPS ILO N r8= 2.2204 460 492503130 8E- 16
EPS ILO N r16 = 1.2 325951644 078 309 459558 258 832 543534 8E- 32
EPS ILO N rd= 1.1920 928 96E-7

The results of this test case on Cray T90 systems that support IEEE floating-point arithmetic are as follows:
EPS ILO N r4= 1.1920 928 96E-7
EPS ILO N r8= 2.2204 460 492503130 8E- 16
EPS ILO N r16 = 1.9 259299443 872 358 530559 779 425 849273 2E- 34
EPS ILO N rd= 2.2204 460 492503130 8E- 16

The results of this test case on UNICOS systems, except for Cray T90 systems that support IEEE
floating-point arithmetic, are as follows:
EPS ILO N r4= 1.1 920 928955 078 12E -7
EPS ILO N r8= 1.4 210 854715 202 E-1 4
EPS ILO N r16= 5.0487 097 934144 755 546 350 628178 1E- 29
EPS ILO N rd= 1.4210854 715 202 E-14

The results of this test case on UNICOS/mk systems are as follows:


EPS ILO N r4= 1.1 92092896E -7
EPS ILO N r8= 2.2 204460492 503 130 8E- 16
EPS ILO N r16= 2.2204 460 492503 130 8E- 16
EPS ILO N rd= 2.2 204460492 503 130 8E- 16

SEE ALSO
MODELS(3I)

98 004– 2138– 003


EQV ( 3I ) EQV ( 3I )

NAME
EQV, NEQV, XOR – Computes logical equivalence or difference

SYNOPSIS
EQV ([I=]i,[J=]j)
NEQV ([I=]i,[J=]j)
XOR ([I=]i,[J=]j)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extensions

DESCRIPTION
EQV computes a logical equivalence. This function is not accepted by the MIPSpro Fortran 77 compiler.
NEQV and XOR are two names for the same routine. These functions compute a logical difference. NEQV is
not accepted by the MIPSpro Fortran 77 compiler.
These functions accept the following arguments:
i Must be of type Boolean, integer, real, logical, or Cray pointer.
j Must be of type Boolean, integer, real, logical, or Cray pointer. For EQV, j need not be the
same type as i, but j must be the same size as i.
These are elemental functions. The names of these intrinsics cannot be passed as arguments.

NOTES
These routines are outmoded. Refer to the Fortran Language Reference Manual, Volume 3, for information
about outmoded features and their preferred standard alternatives.

CAUTIONS
Unexpected results can occur when Boolean functions are declared external and then used with logical
arguments. The external Boolean functions always treat their arguments as type Boolean and return a
Boolean result on UNICOS and UNICOS/mk systems. On IRIX systems, they return an integer result.

004– 2138– 003 99


EQV ( 3I ) EQV ( 3I )

RETURN VALUES
EQV, when given two arguments of type Boolean, real, integer, or pointer, computes a bit-wise logical
equivalence and returns a Boolean (on UNICOS and UNICOS/mk systems) or integer (on IRIX systems)
result. When both i and j are of type logical, the result is of type logical. The following tables show both
the logical equivalence and bit-wise logical equivalence:

Logical Variable 1 Logical Variable 2 (Logical Variable 1) EQV (Logical Variable 2)

T T T
T F F
F T F
F F T

Bit of Variable 1 Bit of Variable 2 (Bit of Variable 1) EQV (Bit of Variable 2)

1 1 1
1 0 0
0 1 0
0 0 1

NEQV and XOR, when given two arguments of type logical, compute a logical difference and return a logical
result. When given two arguments of type Boolean, integer, real, or pointer, NEQV and XOR compute a
bit-wise logical difference and return a Boolean result. The following tables show both the logical difference
and bit-wise logical difference. NEQV is shown in the tables, but XOR produces identical results.

Logical Variable 1 Logical Variable 2 (Logical Variable 1) NEQV (Logical Variable 2)

T T F
T F T
F T T
F F F

Bit of Variable 1 Bit of Variable 2 (Bit of Variable 1) NEQV (Bit of Variable 2)

1 1 0
1 0 1
0 1 1
0 0 0

100 004– 2138– 003


EQV ( 3I ) EQV ( 3I )

EXAMPLES
Example 1. The following section of Fortran code shows the EQV function used with two arguments of type
logical:
LOG ICAL L1, L2, L3
...
L3 = EQV(L1 ,L2 )

Example 2. The following section of Fortran code shows the EQV function used with two arguments of type
integer. The bit patterns of the arguments and result are also given. For clarity, only the rightmost 8 bits
are shown.
INT EGER I1, I2, I3
I1 = 12
I2 = 10
...
I3 = EQV(I1 ,I2)

------ ------ --- --- --- --- --- --- - --- --- --- --- --- --- --- --- --- ----
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
------ ------ --- --- --- --- --- --- - --- --- --- --- --- --- --- --- --- ----
I1 I2

--- --- --- --- --- --- --- --- --- --- -
| 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 |
--- --- --- --- --- --- --- --- --- --- -
I3

Example 3. The following section of Fortran code shows the NEQV function used with two arguments of
type logical. XOR is used in the same manner and produces the same results.
LOG ICAL L1, L2, L3
...
L3 = NEQV(L 1,L 2)

Example 4. The following section of Fortran code shows the NEQV function used with two arguments of
type integer. XOR is used in the same manner and produces the same results. The bit patterns of the
arguments and results are also given. For clarity, only the rightmost 8 bits are shown.

004– 2138– 003 101


EQV ( 3I ) EQV ( 3I )

INTEGER I1, I2, I3


I1 = 12
I2 = 10
...
I3 = NEQ V(I1,I 2)
--------- --- ------ ------ --- ---- --- --- --- --- --- --- --- --- --- --- -
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
--------- --- ------ ------ --- --- - --- --- --- --- --- --- --- --- --- --- -
I1 I2

--- ------ --- --- ------ --- --- --- -


| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
--- ------ --- --- ------ --- --- --- -
I3

102 004– 2138– 003


EX ( 3I ) EX ( 3I )

NAME
_EX – Performs a normal exit

SYNOPSIS
#include <intrinsics.h>
UNICOS systems except Cray T90:
void _EX (void);
Cray T90:
void _EX (int n);

IMPLEMENTATION
UNICOS systems

STANDARDS
C/C++ extension

DESCRIPTION
The _EX function performs a normal exit to the address in the exit address register (EAn).
On all UNICOS and UNICOS/mk systems except Cray T90, _EX does not take an argument; n is assumed
to be zero. On the Cray T90, _EX accepts the following variable:
n An integer constant in the range of 0 through 4. If n is in the range of 5 through 7, the function
performs an exit to the exchange address register (XA).

NOTES
Because _EX is an intrinsic function, no externally visible library function is available for it. The compiler
generates inline code to produce the result.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 103


EXP ( 3I ) EXP ( 3I )

NAME
EXP, DEXP, QEXP, CEXP, CDEXP, CQEXP – Computes exponential function

SYNOPSIS
EXP ([X=]x)
DEXP ([X=]x)
QEXP ([X=]x)
CEXP ([X=]x)
CDEXP ([X=]x)
CQEXP ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QEXP, CDEXP, CQEXP

DESCRIPTION
EXP is the generic function name; the others are specifics. These are elemental intrinsic functions. They
accept the following argument:
x Must be of type real (for EXP, DEXP, and QEXP) or complex (for CEXP, CDEXP, and CQEXP).
The type and kind type of x is identical to the type and kind type of the return value. See the
RETURN VALUES section for information on input data types and return values.
Vector versions of these intrinsics exist on some systems. Vector versions of the EXP, DEXP, CEXP,
CDEXP, and CQEXP intrinsic functions exist on UNICOS and UNICOS/mk systems. On UNICOS/mk
systems, the vector versions of these intrinsics are used when -O vector3 or -O 3 are specified on the
compiler command line. A vector version of the single-precision and double-precision EXP intrinsic exists
on IRIX systems and is used when -O3 is specified on the compiler command line.
x
These functions evaluate y = e .

NOTES
The EXP, DEXP, and CEXP intrinsic function names can be passed as arguments; the others cannot.
On Cray T90 systems that support IEEE floating-point arithmetic, the following return values occur:
• If x < – 708.4, EXP(x) yields 0.
• If x > 709.78, EXP(x) yields infinity.

104 004– 2138– 003


EXP ( 3I ) EXP ( 3I )

• EXP(NaN) yields NaN.


RETURN VALUES
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.
x
EXP returns the single-precision real exponential function e of its real argument.
x
DEXP returns the double-precision real exponential function e of its double-precision real argument.
x
QEXP returns the quad-precision real exponential function e of its quad-precision real argument.
x
CEXP returns the single-precision complex exponential function e of its single-precision complex argument.
x
CDEXP returns the double-precision complex exponential function e of its double-precision complex
argument.
x
CQEXP returns the quad-precision complex exponential function e of its quad-precision complex argument.

004– 2138– 003 105


EXPONENT ( 3I ) EXPONENT ( 3I )

NAME
EXPONENT – Returns the exponent part of the argument when represented as a numeric model number

SYNOPSIS
EXPONENT ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The EXPONENT intrinsic function returns the exponent part of the argument when represented as a numeric
model number. It accepts the following argument:
x Must be of type real
EXPONENT is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type is default integer. The result has a value equal to the exponent, e, of the real number model
for the value of x, provided that x is nonzero and e is within the range for default integers. For more
information on the real number model, see the MODELS(3I) man page.
The result is undefined if the machine upon which the compiler is running cannot represent e in the default
integer type.

EXAMPLES
EXPONENT(1.0) yields 1.
EXPONENT(4.1) yields 3.
If X = 0, EXPONENT(X) yields 0.

SEE ALSO
MODELS(3I)

106 004– 2138– 003


FCD ( 3I ) FCD ( 3I )

NAME
FCD – Constructs a Cray character pointer in Fortran character Descriptor (FCD) format

SYNOPSIS
FCD ([I=]i, [J=]j)

IMPLEMENTATION
UNICOS, UNICOS/mk systems
CF90

STANDARDS
Fortran extension

DESCRIPTION
The FCD intrinsic function constructs a Cray character pointer in FCD format. This function accepts the
following arguments:
i Must be of type integer (KIND=8) or Cray pointer and represent the word address for the
pointee’s first character.
j Must be an integer (KIND=8) value that represents the pointee’s character length.
FCD is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The value returned is of type Cray pointer.

EXAMPLES
As the following example shows, you can add an offset even if the Cray character pointee does not start on a
word boundary.
CPT R = FCD(IA DRS , ILE N) + IOF FSE T

SEE ALSO
CLOC(3I)

004– 2138– 003 107


FLOOR ( 3I ) FLOOR ( 3I )

NAME
FLOOR – Returns the greatest integer less than or equal to a

SYNOPSIS
FLOOR ([A=]a [,[KIND=]kind])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The FLOOR intrinsic function returns the greatest integer less than or equal to a. It accepts the following
arguments:
a Must be of type real
kind An integer scalar value. Must be a scalar integer initialization expression
FLOOR is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is an integer. If kind is specified, the kind type parameter is that specified by kind. If kind is not
specified, the result is of type default integer. The result has value equal to the greatest integer less than or
equal to a. The result is undefined if the target machine cannot represent this value in the default integer
type.

EXAMPLES
FLOOR(3.7) yields 3.
FLOOR(-3.7) yields -4.

SEE ALSO
CF90 Commands and Directives Reference Manual

108 004– 2138– 003


FRACTION ( 3I ) FRACTION ( 3I )

NAME
FRACTION – Returns the fractional part of the numeric model representation of the argument value

SYNOPSIS
FRACTION ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The FRACTION intrinsic function returns the fractional part of the numeric model representation of the
argument value. It accepts the following argument:
x Must be of type real
FRACTION is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
-e
The result type and type parameter are that of x. The result has the value x multiplied by b , where b and e
are as defined in the real number system model. For more information on the real number system model,
see the MODELS(3I) man page.
If x has the value zero, the result has the value zero.

EXAMPLES
FRACTION(3.0) yields 0.75 for reals.

SEE ALSO
MODELS(3I)

004– 2138– 003 109


GBIT ( 3I ) GBIT ( 3I )

NAME
_gbit, _gbits – Returns the value of the nth bit (from the right)

SYNOPSIS
#include <intrinsics.h>
long _gbit (long x, long n);
long _gbits (long x, long m, long n);

IMPLEMENTATION
UNICOS, UNICOS/mk systems

STANDARDS
C/C++ extension

DESCRIPTION
The _gbit function returns the value of the nth bit (from the right) of data word x.
The _gbits function returns a value consisting of m bits extracted from x, starting at bit position n (from
the right and counting to the left); the returned bits are right-justified.
These functions accept the following variables:
x The data word from which the value is extracted.
m A value in the range of 0 through 63.
n A value in the range of 0 through 63.

NOTES
Because _gbit and _gbits are intrinsic functions, no externally visible library functions are available for
them. The compiler generates inline code to produce the result.

EXAMPLES
Program source:
main()
{
lon g x = 0x1 234 567 890 abc def ;

printf ("_gbi t(x , 19) = %lx \n" , _gb it( x, 19) );


printf ("_gbi ts( x, 8, 12) = %lx \n" , _gb its (x, 8, 12) );
}

110 004– 2138– 003


GBIT ( 3I ) GBIT ( 3I )

Execution output:
_gb it( x, 19) = 1
_gb its (x, 8, 12) = bc

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 111


GET_IEEE_EXCEPTIONS ( 3I ) GET_IEEE_EXCEPTIONS ( 3I )

NAME
GET_IEEE_EXCEPTIONS – Retrieves flags that represent the current floating-point exception status

SYNOPSIS
GET_IEEE_EXCEPTIONS ([STATUS=]status)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The GET_IEEE_EXCEPTIONS intrinsic subroutine is typically called upon entry to a procedure to obtain a
set of flags that represent the current floating-point exception status. It accepts the following argument:
status Must be scalar and of an integer type that occupies a full word. It is an INTENT(OUT)
argument.
The exceptions that are possible are as follows:
• IEEE_XPTN_CRI_INVALID_OPND (accepted only on Cray T90 systems that support IEEE floating-
point arithmetic)
• IEEE_XPTN_INEXACT_RESULT
• IEEE_XPTN_UNDERFLOW
• IEEE_XPTN_OVERFLOW
• IEEE_XPTN_DIV_BY_ZERO
• IEEE_XPTN_INVALID_OPR
• IEEE_XPTN_ALL (all exceptions in this list)
This subroutine increases program performance by capturing and then directly manipulating the status bits
with bit manipulation operations. This practice compromises portability, however.
The name of this intrinsic cannot be passed as an argument.

112 004– 2138– 003


GET_IEEE_EXCEPTIONS ( 3I ) GET_IEEE_EXCEPTIONS ( 3I )

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN _IEEE_ DEF INI TIO NS

RETURN VALUES
The value returned in status is the set of bits that represent the current floating-point exception state.
To determine the exceptions that have been raised, use TEST_IEEE_EXCEPTION(3I).

EXAMPLES
See the example on CLEAR_IEEE_EXCEPTION(3I).

SEE ALSO
CLEAR_IEEE_EXCEPTION(3I), SET_IEEE_EXCEPTION(3I), TEST_IEEE_EXCEPTION(3I)

004– 2138– 003 113


GET_IEEE_INTERRUPTS ( 3I ) GET_IEEE_INTERRUPTS ( 3I )

NAME
GET_IEEE_INTERRUPTS – Retrieves flags that represent the current floating-point interrupt status

SYNOPSIS
GET_IEEE_INTERRUPTS ([STATUS=]status)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The GET_IEEE_INTERRUPTS intrinsic subroutine is typically called upon entry to a procedure to obtain a
set of flags that represent the current floating-point interrupt status. It accepts the following argument:
status Must be scalar and of an integer type that occupies a full word. It is an INTENT(OUT)
argument.
For the names of all possible interrupts, see GET_IEEE_STATUS(3I).
This subroutine increases program performance by capturing and then directly manipulating the status bits
with bit manipulation operations. This practice compromises portability, however.
The name of this intrinsic cannot be passed as an argument.
Some of the bits of status are set to indicate the floating-point interrupts that are currently enabled or
currently disabled. The state of any given interrupt can be determined using TEST_IEEE_INTERRUPT(3I)
and can be altered using ENABLE_IEEE_INTERRUPT(3I) or DISABLE_IEEE_INTERRUPT(3I).

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN_IE EE_DEF INI TIO NS

114 004– 2138– 003


GET_IEEE_INTERRUPTS ( 3I ) GET_IEEE_INTERRUPTS ( 3I )

EXAMPLES
See the example on DISABLE_IEEE_INTERRUPT(3I).

SEE ALSO
DISABLE_IEEE_INTERRUPT(3I), ENABLE_IEEE_INTERRUPT(3I), GET_IEEE_STATUS(3I),
TEST_IEEE_INTERRUPT(3I)

004– 2138– 003 115


GET_IEEE_ROUNDING_MODE ( 3I ) GET_IEEE_ROUNDING_MODE ( 3I )

NAME
GET_IEEE_ROUNDING_MODE – Returns current floating-point rounding mode

SYNOPSIS
GET_IEEE_ROUNDING_MODE ([STATUS=]status)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The GET_IEEE_ROUNDING_MODE intrinsic subroutine is typically called upon entry to a procedure to
obtain the current floating-point rounding mode. It accepts the following argument:
status Must be scalar and of an integer type that occupies a full word. It is an INTENT(OUT)
argument.
This subroutine increases program performance by capturing and then directly manipulating the status bits
with bit manipulation operations. This practice compromises portability, however.
The name of this intrinsic cannot be passed as an argument.

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN_IE EE_DEF INI TIO NS

RETURN VALUES
status is set to one of the following values. These named constants indicate the possible floating-point
rounding modes.
• IEEE_RM_NEAREST
• IEEE_RM_POS_INFINITY
• IEEE_RM_ZERO
• IEEE_RM_NEG_INFINITY

116 004– 2138– 003


GET_IEEE_ROUNDING_MODE ( 3I ) GET_IEEE_ROUNDING_MODE ( 3I )

EXAMPLES
See the example on SET_IEEE_ROUNDING_MODE(3I).

SEE ALSO
SET_IEEE_ROUNDING_MODE(3I)

004– 2138– 003 117


GET_IEEE_STATUS ( 3I ) GET_IEEE_STATUS ( 3I )

NAME
GET_IEEE_STATUS – Retrieves flags that represent the current floating-point status upon entry to a
procedure

SYNOPSIS
GET_IEEE_STATUS ([STATUS=]status)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The GET_IEEE_STATUS intrinsic subroutine is typically used to obtain all flags that represent the current
floating-point status upon entry to a procedure. The value returned is often used as the argument to
SET_IEEE_STATUS(3I) to restore the IEEE status to what it was upon entry to the procedure.
GET_IEEE_STATUS accepts the following argument:
status Must be scalar and of an integer type that occupies a full word. For example, on IRIX systems,
its kind type parameter must be 4, and on UNICOS/mk systems, its kind type parameter must be
8. It is an INTENT(OUT) argument.
The IEEE exceptions are as follows:
• IEEE_XPTN_CRI_INVALID_OPND (accepted only on Cray T90 systems that support IEEE floating-
point arithmetic)
• IEEE_XPTN_INEXACT_RESULT
• IEEE_XPTN_UNDERFLOW
• IEEE_XPTN_OVERFLOW
• IEEE_XPTN_DIV_BY_ZERO
• IEEE_XPTN_INVALID_OPR
• IEEE_XPTN_ALL (all exceptions in this list)
The IEEE interrupts are as follows:
• IEEE_NTPT_CRI_INVALID_OPND (valid only on Cray T90 systems that support IEEE floating-point
arithmetic)

118 004– 2138– 003


GET_IEEE_STATUS ( 3I ) GET_IEEE_STATUS ( 3I )

• IEEE_NTPT_INEXACT_RESULT
• IEEE_NTPT_UNDERFLOW
• IEEE_NTPT_OVERFLOW
• IEEE_NTPT_DIV_BY_ZERO
• IEEE_NTPT_INVALID_OPR
• IEEE_NTPT_ALL
This subroutine increases program performance by capturing and then directly manipulating the status bits
with bit manipulation operations. This practice compromises portability, however.
The name of this intrinsic cannot be passed as an argument.

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN _IE EE_DEFINI TIO NS

RETURN VALUES
On Cray T90 systems that support IEEE floating-point arithmetic, the value of status is the content of SR0 (a
64-bit word).
On all other architectures, the value of status is a set of bits that represent the current floating-point state.
There is no requirement that the state is represented by the machine as a single word. That is, this procedure
may have to acquire the flags from several locations and combine them into a single word.

EXAMPLES
See example on SET_IEEE_STATUS(3I).

SEE ALSO
SET_IEEE_STATUS(3I)

004– 2138– 003 119


GETPOS ( 3I ) GETPOS ( 3I )

NAME
GETPOS, SETPOS – Obtains a file position or returns a file to a previous position

SYNOPSIS
For tape or disk files:
CALL GETPOS(i, len, pa [,stat])
CALL SETPOS(i, len, pa [,stat])
For disk files only:
CALL GETPOS(i, pv)
GETPOS ([I=]i) (intrinsic function syntax)
CALL SETPOS(i, pv)

IMPLEMENTATION
UNICOS, UNICOS/mk systems
CF90

STANDARDS
Fortran extension

DESCRIPTION
GETPOS and SETPOS are used in input/output (I/O) operations. GETPOS can be used as either an intrinsic
function or as a library routine. SETPOS can be used only as a library routine.
GETPOS returns the current position of the specified tape or mass storage file to the Fortran user. GETPOS
does not alter the file’s position, but it captures information that you can use later to recover the current
position.
As an intrinsic function, GETPOS obtains a file position and returns the current record number. In Fortran
95, it is an elemental function. The name of this intrinsic cannot be passed as an argument.
SETPOS changes the current position within a file. Unblocked files can be positioned to any word offset in
the file, with a position of 0 being the beginning of the file. For other files, SETPOS lets you return to the
position retained from the GETPOS request.
GETPOS and SETPOS can be used only on sequential files. They accept the following arguments:
i Unit number. Must be an integer or Boolean value in the range 1 ≤ i ≤ 299.
If i is an integer, i must be of KIND=8.

120 004– 2138– 003


GETPOS ( 3I ) GETPOS ( 3I )

len Length in Cray words of the position array. len can be an integer, variable, expression, or
constant. If i is an integer, i must be of KIND=8.
This parameter determines the maximum number of position values to return or process. For
SETPOS, this parameter allows for the addition of more information fields while ensuring that
existing codes continue to run. Possible values for len are as follows:
• 1 for disk files
• 2 for tape files
• 4 for files assigned with -F er90
• 6 for files assigned with -F cos,er90. For ER90 files, the information returned does not
include the Volume Serial Number (VSN) or partition information. Before issuing a
SETPOS, verify that the correct VSN and partition is in position.
pa and pv Position array or position value. On exit, pa contains the current position information. For
GETPOS, you should not modify this information. It should be retained to be passed on to
SETPOS. For SETPOS, pa contains the desired position information from the GETPOS call.
The format of the position information is as follows:
• For a disk file, 1 word that contains the current position.
• If the file is assigned as cos, u, sbin, syscall, mr, or sds through the -s or -F options
to the assign(1) command, a position value of – 1 is supported. A value of – 1 positions
the file at the end. If the file is not terminated by a physical endfile record, the file is
positioned just prior to a logical endfile record. Otherwise the file is positioned after all data
and endfile records. A value of – 2 positions the file just prior to the last endfile record. All
sequential files have a physical or logical endfile record as the last record of the file.
• For a tape file, 2 words; word 0 contains the volume serial number of the current tape reel,
and word 1 contains the block number before which the tape unit is positioned.
• For an ER90 file, the words returned contain device-specific information.
stat Return conditions. This can be either a zero or a nonzero value, which indicates the following:
• A zero value indicates that either the position information was obtained successfully
(GETPOS) or that the file was positioned successfully (SETPOS).
• A nonzero value indicates that an error or warning was encountered during the request.
To set the position of a disk file, the position can be anywhere within the file if the file is not blocked. If
the file is a COS blocked file, the position must be at a record boundary; that is, at the beginning-of-data
(BOD), following an end-of-record (EOR) or end-of-file (EOF), or before an end-of-data (EOD). A file
cannot be positioned beyond the current EOD.
GETPOS and SETPOS support the COS-blocked file format, but they do not support any other type of
blocked file format. On UNICOS systems, they support tape and ER90 formats.

004– 2138– 003 121


GETPOS ( 3I ) GETPOS ( 3I )

RETURN VALUES
When used as an intrinsic function, the return value of GETPOS is of type Boolean.
When referenced as an external subprogram, the return value of GETPOS is an INTEGER(KIND=8) value.

NOTES
For unblocked or pure data files, the position returned by GETPOS is the current word offset within the file.

SEE ALSO
GETTP(3F), SETTP(3F)
UNICOS File Formats and Special Files Reference Manual, for a description of the Fortran blocked file
structure, including examples of EOR, EOF, and EOD

122 004– 2138– 003


GETVM ( 3I ) GETVM ( 3I )

NAME
_getvm, _setvm – Returns contents of or sets vector mask register

SYNOPSIS
#include <intrinsics.h>
long _getvm (void);
void _setvm (long x);

IMPLEMENTATION
UNICOS systems

STANDARDS
C/C++ extension

DESCRIPTION
The _getvm function returns the contents of the vector mask register.
The _setvm function sets the vector mask register to the value in data word x.

NOTES
Because _getvm and _setvm are intrinsic functions, no externally visible library functions are available
for them. The compiler generates inline code to produce the result.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 123


HUGE ( 3I ) HUGE ( 3I )

NAME
HUGE – Returns the largest number in the integer or real numeric model

SYNOPSIS
HUGE ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The HUGE intrinsic function returns the largest number in the model representing numbers of the same type
and kind type parameter as the argument x. It accepts the following argument:
x Must be of type integer or real. It may be scalar or array valued.
HUGE is an inquiry function. The name of this intrinsic cannot be passed as an argument.

NOTES
On UNICOS systems, both execution speed and the number of bits used in mathematical operations are
affected when compiling with f90 -O fastint, which is the default setting. For more information, see
CF90 Commands and Directives Reference Manual.

RETURN VALUES
q
The result is a scalar value of the same type and kind type parameter as x. The result has the value r – 1 if
-p e sub max
x is of type integer and the value (1-b ) multiplied by b if x is of type real, where r, q, b, p, and
e max (represented as "e sub max" in the previous equation) are as defined in the real number model, which
represents numbers of the same type and kind type parameter as x. For more information on the real number
model, see the MODELS(3I) man page.

EXAMPLES
– 47 8189
On UNICOS systems, HUGE(X) has a value that approximates (1– 2 ) multiplied by 2 for real X.
On Cray T90 systems that support IEEE floating-point arithmetic, HUGE(X) has values that approximate the
following:
• (1-2 -24 ) multiplied by 2 128 for real (KIND=4) X
• (1-2 -53 ) multiplied by 2 1024 for real (KIND=8) X

124 004– 2138– 003


HUGE ( 3I ) HUGE ( 3I )

• (1-2 -113 ) multiplied by 2 16384 for real (KIND=16) X


On UNICOS/mk systems, HUGE(X) has values that approximate the following:
• (1-2 -24 ) multiplied by 2 128 for real (KIND=4) X
• (1-2 -53 ) multiplied by 2 1024 for real (KIND=8) X
On IRIX systems, HUGE(X) has values that approximate the following:
• (1-2 -24 ) multiplied by 2 128 for real (KIND=4) X
• (1-2 -53 ) multiplied by 2 1024 for real (KIND=8) X
• (1-2 -107 ) multiplied by 2 1023 for real (KIND=16) X
SEE ALSO
MODELS(3I)

004– 2138– 003 125


IAND ( 3I ) IAND ( 3I )

NAME
IAND, IIAND, JIAND, KIAND, IEOR, IIEOR, JIEOR, KIEOR, IOR, IIOR, JIOR, KIOR – Performs a
logical AND, an exclusive OR, or an inclusive OR

SYNOPSIS
IAND ([I=]i, [J=]j)
IIAND ([I=]i, [J=]j)
JIAND ([I=]i, [J=]j)
KIAND ([I=]i, [J=]j)
IEOR ([I=]i, [J=]j)
IIEOR ([I=]i, [J=]j)
JIEOR ([I=]i, [J=]j)
KIEOR ([I=]i, [J=]j)
IOR ([I=]i, [J=]j)
IIOR ([I=]i, [J=]j)
JIOR ([I=]i, [J=]j)
KIOR ([I=]i, [J=]j)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: IIAND, JIAND, KIAND, IIEOR, JIEOR, KIEOR, IIOR, JIOR, KIOR

DESCRIPTION
The IAND, IIAND, JIAND, and KIAND intrinsic functions perform a logical AND.
The IEOR, IIEOR, JIEOR, and KIEOR intrinsic functions perform an exclusive OR.
The IOR, IIOR, JIOR, and KIOR intrinsic functions perform an inclusive OR.
They accept the following arguments:

126 004– 2138– 003


IAND ( 3I ) IAND ( 3I )

i Must be of type integer.


For IIAND, must be of type integer (KIND=2). For JIAND, must be of type integer (KIND=4).
For KIAND, must be of type integer (KIND=8).
For IIEOR, must be of type integer (KIND=2). For JIEOR, must be of type integer (KIND=4).
For KIEOR, must be of type integer (KIND=8).
For IIOR, must be of type integer (KIND=2). For JIOR, must be of type integer (KIND=4).
For KIOR, must be of type integer (KIND=8).
j Must be of type integer with the same kind type parameter as i
These are elemental functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
The result type and type parameter are the same as i. On IRIX systems, the result can be affected by the -i
option on the f90(1) command line.
For IAND, IIAND, JIAND, and KIAND, the result has the value obtained by combining i and j bit-by-bit
according to the following truth table:

i j IAND (i, j)

1 1 1
1 0 0
0 1 0
0 0 0

For IEOR, IIEOR, JIEOR, and KIEOR, the result has the value obtained by combining i and j bit-by-bit
according to the following truth table:

i j IEOR (i, j)

1 1 0
1 0 1
0 1 1
0 0 0

For IOR, IIOR, JIOR, and KIOR, the result has the value obtained by combining i and j bit-by-bit
according to the following truth table:

004– 2138– 003 127


IAND ( 3I ) IAND ( 3I )

i j IOR (i, j)

1 1 1
1 0 1
0 1 1
0 0 0

The bit model defines the interpretation of an integer value as a sequence of bits. For more information on
the bit model, see the MODELS(3I) man page.

EXAMPLES
Example 1. IAND(1,3) yields 1.
Example 2. IEOR(1,3) yields 2.
Example 3. IOR (1,3) yields 3.

SEE ALSO
f90(1)
MODELS(3I)

128 004– 2138– 003


IBCHNG ( 3I ) IBCHNG ( 3I )

NAME
IBCHNG, IIBCHNG, JIBCHNG, KIBCHNG, IBCLR, IIBCLR, JIBCLR, KIBCLR, IBSET, IIBSET,
JIBSET, KIBSET – Sets, clears, or reverses the value of a specified bit in an integer

SYNOPSIS
IBCHNG ([I=]i, [POS=]pos)
IIBCHNG ([I=]i, [POS=]pos)
JIBCHNG ([I=]i, [POS=]pos)
KIBCHNG ([I=]i, [POS=]pos)
IBCLR ([I=]i, [POS=]pos)
IIBCLR ([I=]i, [POS=]pos)
JIBCLR ([I=]i, [POS=]pos)
KIBCLR ([I=]i, [POS=]pos)
IBSET ([I=]i, [POS=]pos)
IIBSET ([I=]i, [POS=]pos)
JIBSET ([I=]i, [POS=]pos)
KIBSET ([I=]i, [POS=]pos)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: IBCHNG, IIBCHNG, JIBCHNG, KIBCHNG, IIBCLR, JIBCLR, KIBCLR, IIBSET,
JIBSET, KIBSET

DESCRIPTION
The IBCHNG, IIBCHNG, JIBCHNG, and KIBCHNG intrinsic functions reverse the value of a specified bit in
an integer.
The IBCLR, IIBCLR, JIBCLR, and KIBCLR intrinsic functions clear one bit to zero.
The IBSET, IIBSET, JIBSET, and KIBSET intrinsic functions set one bit to 1.
They accept the following arguments:

004– 2138– 003 129


IBCHNG ( 3I ) IBCHNG ( 3I )

i Must of of type integer.


For IBCHNG, IIBCHNG, JIBCHNG, and KIBCHNG, i contains the bit to be reversed. For
IIBCHNG, must be of type integer (KIND=2). For JIBCHNG, must be of type integer
(KIND=4). For KIBCHNG, must be of type integer (KIND=8).
For IIBCLR, must be of type integer (KIND=2). For JIBCLR, must be of type integer
(KIND=4). For KIBCLR, must be of type integer (KIND=8).
For IIBSET, must be of type integer (KIND=2). For JIBSET, must be of type integer
(KIND=4). For KIBSET, must be of type integer (KIND=8).
pos Must be of type integer.
For IBCHNG, IIBCHNG, JIBCHNG, and KIBCHNG, i specifies the position of the bit to be
reversed. The rightmost (least significant) bit of i is in position 0.
For IBCLR, IIBCLR, JIBCLR, KIBCLR, IBSET, IIBSET, JIBSET, and KIBSET, pos must
be nonnegative and less than BIT_SIZE (i).
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
For IBCHNG, IIBCHNG, JIBCHNG, and KIBCHNG, the result type and type parameter are the same as i.
The result is equal to i, with the bit in position pos reversed.
For IBCLR, IIBCLR, JIBCLR, and KIBCLR, The result type and type parameter are the same as i. The
result has the value of the sequence of bits of i, except that bit pos of i is set to zero.
For IBSET, IIBSET, JIBSET, KIBSET, The result type and type parameter are the same as i. The result
has the value of the sequence of bits of i, except that bit pos of i is set to one.
The bit model defines the interpretation of an integer value as a sequence of bits. For more information on
the bit model, see the MODELS(3I) man page.

EXAMPLES
Example 1. IBCLR(14,1) yields 12.
Example 2. If V has the value [1,2,3,4], IBCLR(POS=V,I=31) yields [29,27,23,15].
Example 3. IBSET(12,1) yields 14.
Example 4. If V has the value [1,2,3,4], IBSET(POS=V,I=0) yields [2,4,8,16].

SEE ALSO
MODELS(3I)

130 004– 2138– 003


IBITS ( 3I ) IBITS ( 3I )

NAME
IBITS, IIBITS, JIBITS, KIBITS – Extracts a sequence of bits

SYNOPSIS
IBITS ([I=]i, [POS=]pos, [LEN=]len)
IIBITS ([I=]i, [POS=]pos, [LEN=]len)
JIBITS ([I=]i, [POS=]pos, [LEN=]len)
KIBITS ([I=]i, [POS=]pos, [LEN=]len)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: IIBITS, JIBITS, KIBITS

DESCRIPTION
The IBITS, IIBITS, JIBITS, and KIBITS intrinsic functions extract a sequence of bits. They accept the
following arguments:
i Must be of type integer. For IIBITS, must be of type integer (KIND=2). For JIBITS, must
be of type integer (KIND=4). For KIBITS, must be of type integer (KIND=8).
pos Must be of type integer. It must be nonnegative and pos + len must be less than or equal to
BIT_SIZE (i).
len Must be of type integer and nonnegative.
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
The result type and type parameter are the same as i. The result has the value of the sequence of len bits in
i beginning at bit pos right-adjusted and with all other bits zero.
The bit model defines the model for the interpretation of an integer value as a sequence of bits. For more
information on the bit model, see the MODELS(3I) man page.

004– 2138– 003 131


IBITS ( 3I ) IBITS ( 3I )

EXAMPLES
IBITS(14,1,3) yields 7. In this example, the bits are numbered from right to left, so they are extracted
from right to left.

SEE ALSO
MODELS(3I)

132 004– 2138– 003


IDATE ( 3I ) IDATE ( 3I )

NAME
IDATE, ITIME – Returns date or time in numerical form

SYNOPSIS
CF90 and MIPSpro 7 Fortran 90:
CALL IDATE ([I=]month, [J=]day, [K=]year)
MIPSpro 7 Fortran 77:
CALL ITIME iarray

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Extensions

DESCRIPTION
IDATE intrinsic subroutine returns the current date in the variables day, month, and year, in that order.
month is in the range 1-12; year is returned as the last two digits.
ITIME returns the current time in iarray, in hours, minutes, seconds, in that order.

SEE ALSO

004– 2138– 003 133


IEEE_BINARY_SCALE ( 3I ) IEEE_BINARY_SCALE ( 3I )

NAME
IEEE_BINARY_SCALE – Returns y multiplied by 2**n

SYNOPSIS
IEEE_BINARY_SCALE ([Y=]y, [N=]n)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
n
The IEEE_BINARY_SCALE intrinsic function returns y multiplied by the value 2 for integral values n
n
without computing 2 .
This function accepts the following arguments:
y Must be of type real.
n Must be of type integer. If y is scalar, n must be scalar. If y is an array, n can be a scalar or an
array of the same shape as x.
IEEE_BINARY_SCALE is an elemental function. The name of this intrinsic cannot be passed as an
argument.

RETURN VALUES
The return value is of the same type and type parameter as y. If y is an array, the result is an array of the
same shape as y.
n
If y is scalar, the result is a scalar that has the value of y multiplied by 2 .
If y is an array and n is scalar, the result is an array in which the value of each element is the product of y i
n
and the value 2 .
If y is an array and n is an array, the result is an array in which the value of each element is the product of
y i and the value 2**n i .

134 004– 2138– 003


IEEE_BINARY_SCALE ( 3I ) IEEE_BINARY_SCALE ( 3I )

EXAMPLES

REA L sma ll, big ger


... ! Com put e SMA LL.
big ger = IEE E_B INA RY_ SCA LE( sma ll, 2)

BIGGER is assigned the value SMALL * 2**2.

004– 2138– 003 135


IEEE_CLASS ( 3I ) IEEE_CLASS ( 3I )

NAME
IEEE_CLASS – Returns the class to which x belongs

SYNOPSIS
IEEE_CLASS ([X=]x)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
A floating-point number can be classified several ways, such as a quiet NaN, a signaling NaN, -0, +inf, etc.
The IEEE_CLASS intrinsic function returns a value that indicates the class to which x belongs.
This function accepts the following argument:
x Must be of type real.
IEEE_CLASS is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN_IE EE_DEF INI TIO NS

RETURN VALUES
The result type and type parameter is default integer. If x is an array, the result is an array of the same
shape as x.
The value returned has a value represented by one of the following named constants:

136 004– 2138– 003


IEEE_CLASS ( 3I ) IEEE_CLASS ( 3I )

IEEE_C LAS S_SIGN ALING_ NAN


IEE E_CLAS S_Q UIET_NAN
IEEE_C LAS S_NEG_ INFINI TY
IEE E_CLAS S_N EG_NOR M_NONZ ERO
IEE E_CLAS S_N EG_DENORM
IEE E_CLAS S_N EG_ZERO
IEE E_CLAS S_P OS_ZERO
IEE E_CLAS S_P OS_DENORM
IEE E_CLAS S_P OS_NOR M_NONZ ERO
IEEE_C LAS S_POS_ INFINI TY

EXAMPLES

REA L x
... ! Com put e X.
SEL ECT CASE (IEEE_ CLASS( x))
CAS E IEE E_CLASS_S IGN ALI NG_ NAN
... ! Do som ething .
CASE IEEE_C LAS S_QUIET_N AN
... ! Do som ething els e.
... ! Oth er cas es.
END SEL ECT

004– 2138– 003 137


IEEE_COPY_SIGN ( 3I ) IEEE_COPY_SIGN ( 3I )

NAME
IEEE_COPY_SIGN – Returns x with the sign of y

SYNOPSIS
IEEE_COPY_SIGN ([X=]x, [Y=]y)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The IEEE_COPY_SIGN intrinsic function returns x with the sign of y. For example,
ABS(x) = IEEE_COPY_SIGN(x, 1.0) even if x is a NaN.
The Fortran 95 standard SIGN(3I) intrinsic function produces the same result as IEEE_COPY_SIGN on
systems that support IEEE floating-point arithmetic.
This function accepts the following arguments:
x Must be of type real.
y Must be of type real. If x is a scalar, y must be a scalar. If x is an array, y can be scalar or an
array of the same shape as x.
IEEE_COPY_SIGN is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The return value is of the same type and type parameter as x. If x is an array, the result is an array of the
same shape as x.
If x is scalar, the result is a scalar that has the same value as x but with the sign of y.
If x is an array and y is scalar, the result is an array in which each element has the value of the
corresponding element of x and the sign of y.
If x is an array and y is an array, the result is an array in which each element has the value of x i but the sign
of y i .

138 004– 2138– 003


IEEE_COPY_SIGN ( 3I ) IEEE_COPY_SIGN ( 3I )

EXAMPLES
Example 1. Each element of x now has its original value but with the sign of each corresponding element of
y:
REA L x(1 0), y(1 0)
... ! Com put e X and Y.
x = IEE E_COPY _SI GN( x, y)

Example 2. The following PRINT statement is executed on a system that supports the IEEE standard for
floating-point arithmetic:
PRINT *, ’IE EE_ COP Y_S IGN (5. 0,- 0.0 )

The output of the preceding PRINT statement is -5.0.

SEE ALSO
SIGN(3I)

004– 2138– 003 139


IEEE_EXPONENT ( 3I ) IEEE_EXPONENT ( 3I )

NAME
IEEE_EXPONENT – Returns the unbiased exponent of x

SYNOPSIS
IEEE_EXPONENT ([X=]x[, [Y=]y])

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The IEEE_EXPONENT intrinsic function returns the unbiased exponent of x. This function corresponds to
the logb function described in the IEEE standard appendix of recommended functions.
The IEEE_EXPONENT function accepts the following arguments:
x Must be of type real. Can be a scalar or array value.
y Can be of type integer or real. Must be a scalar value.
IEEE_EXPONENT is an elemental function. The name of this intrinsic cannot be passed as an argument.

RESULT TYPE AND TYPE PARAMETER


If x is a scalar, the result is a scalar. If x is an array, the result is an array of the same shape as x.
If y is absent, the result is of type default integer.
If y is present and is of type integer, the result is of type integer and has the same kind type parameter value
as y.
If y is present and is of type real, the result is of type real and has the same kind type parameter value as y.

RETURN VALUES
The result is the value of the unbiased exponent of x.
If y is absent and x is +inf, -inf, or NaN, the result is HUGE(0). If x is 0.0, the result is -HUGE(0).
If y is present and of type integer and x is +inf, -inf, or NaN, the result is HUGE(y). If x is 0.0, the result
is -HUGE(y).

140 004– 2138– 003


IEEE_EXPONENT ( 3I ) IEEE_EXPONENT ( 3I )

If y is present and of type real, the value is an integral value in floating-point format. If x is a NaN, the
result is a NaN. If x is +inf or -inf, the result is +inf. If x is 0.0, the result is -inf and the division by zero
exception is raised.
When x is positive and finite, the expression IEEE_BINARY_SCALE(X,-IEEE_EXPONENT(X)) lies
strictly between 0 and 2; it is less than 1 only when x is denormalized.

EXAMPLES
Example 1.
REA L x
... ! Com put e X.
PRI NT *, "Unbia sed expone nt of X:", IEEE_E XPONEN T(x)

The PRINT statement prints the unbiased exponent of x as a default integer value as long as x is not one of
the exceptional values noted in the RETURN VALUES section.
Example 2. Program ieexp.f90 uses several intrinsic procedures:
REA L(8 ) X

PRINT *," TES T EXP ONE NT and IEEE_E XPONEN T of HUGE"


X = HUG E(1 .0_8)

! HUGE scaled to 0.x xx


PRI NT *," F90 EXPONE NT of x=",EX PONENT (x)

! HUGE scaled to x.x x


PRI NT *," Unbiased IEEE_E XPONEN T of x=",IE EE_EXP ONENT( x)

PRINT *," TES T EXP ONE NT and IEEE_E XPONEN T of TINY"


X = TIN Y(1 .0_8)

! TINY scaled to 0.x xx


PRI NT *," F90 EXPONE NT of x=",EX PONENT (x)

! TINY scaled to x.x x


PRI NT *," Unbiased IEEE_E XPONEN T of x=",IE EE_EXP ONENT( x)
END

The output from this program is as follows:

004– 2138– 003 141


IEEE_EXPONENT ( 3I ) IEEE_EXPONENT ( 3I )

TES T EXP ONE NT and IEE E_E XPONEN T of HUG E


F90 EXP ONE NT of x= 102 4
Unb ias ed IEE E_E XPO NENT of x= 102 3
TES T EXP ONE NT and IEE E_E XPONEN T of TIN Y
F90 EXP ONE NT of x= -10 21
Unb ias ed IEE E_E XPO NENT of x= -10 22

142 004– 2138– 003


IEEE_FINITE ( 3I ) IEEE_FINITE ( 3I )

NAME
IEEE_FINITE – Tests for x being greater than negative infinity and less than positive infinity.

SYNOPSIS
IEEE_FINITE ([X=]x)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The IEEE_FINITE intrinsic function returns the value TRUE if -inf < x < +inf. Otherwise, it returns the
value FALSE. IEEE_FINITE accepts the following argument:
x Must be of type real.
IEEE_FINITE is an elemental function. The name of this intrinsic cannot be passed as an argment.

RETURN VALUES
The result type and type parameter is default logical. If x is an array, the result is an array of the same
shape as x.

EXAMPLES

REA L x
... ! Com put e X.
IF (IE EE_FIN ITE (x) ) THE N
... ! Do som eth ing .
ELS E
... ! Do som eth ing els e.
END IF

004– 2138– 003 143


IEEE_INT ( 3I ) IEEE_INT ( 3I )

NAME
IEEE_INT – Converts x to an integral value

SYNOPSIS
IEEE_INT ([X=]x [, [Y=]y])

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The IEEE_INT intrinsic function converts x to an integral value according to the rounding mode currently
in effect. It accepts the following arguments:
x Must be of type real. It can be scalar or an array.
y If specified, must be scalar and of type integer or real.
IEEE_INT is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type and type parameters are as follows. If y is absent, the result type and type parameter is
default integer. If y is present, the result type and type parameter is the same type and type parameter as y.
If x is an array, the result is an array of the same shape as x. A conversion between a floating-point integral
value and an integer is exact unless an exception arises.
If y is absent, the result is a default integer rounded from x according to the rounding mode currently in
effect.
If y is present and is of type integer, the result is of type integer with the same kind type parameter value as
y and whose value is rounded from x according to the rounding mode currently in effect.
If y is present and is of type real, the result is of type real with the same kind type parameter value as y and
whose value is rounded from x according to the rounding mode currently in effect. If the rounding mode is
round-to-nearest and the difference between the unrounded value of x and the rounded result of IEEE_INT
is exacty one half, the result of IEEE_INT is even.

144 004– 2138– 003


IEEE_INT ( 3I ) IEEE_INT ( 3I )

The format of the result value is determined as follows:


• If x is scalar, the result is a scalar.
• If x is an array, the result is an array in which each element is the value of x i rounded to the type and
type parameter of y.

EXAMPLES

REA L x
...
PRI NT *, IEE E_INT(x, 1)
PRI NT *, IEEE_INT( x, 1.0 )

If x had the value 4.1, the result of the first invocation of IEEE_INT would be integer value 4 and the
second result would be the real value 4.0.

004– 2138– 003 145


IEEE_IS_NAN ( 3I ) IEEE_IS_NAN ( 3I )

NAME
IEEE_IS_NAN, ISNAN – Tests for x being a NaN

SYNOPSIS
IEEE_IS_NAN ([X=]x)
ISNAN ([X=]x)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extensions
IEEE Standard for Binary Floating-point Arithmetic
Extension to the IEEE Standard for Binary Floating-point Arithmetic: ISNAN

DESCRIPTION
The IEEE_IS_NAN and ISNAN intrinsic functions return the value TRUE if x is a NaN and return the value
FALSE otherwise. IEEE_IS_NAN and ISNAN are synonyms. These functions accept the following
argument:
x Must be of type real.
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.
IEEE_IS_NAN is accepted by the CF90 and MIPSpro 7 Fortran 90. ISNAN is accepted by the CF90,
MIPSpro 7 Fortran 90, and MIPSpro Fortran 77 compilers.

RETURN VALUES
The result type and type parameter are of type default logical. If x is an array, the result is an array of the
same shape as x.
The value returned has the value TRUE if x is a NaN and the value FALSE otherwise.

EXAMPLES

146 004– 2138– 003


IEEE_IS_NAN ( 3I ) IEEE_IS_NAN ( 3I )

REA L x
... ! Com pute X.
IF (IEEE_ IS_NAN (x) ) THE N
... ! Do som eth ing .
ELS E
... ! Do someth ing els e.
END IF

004– 2138– 003 147


IEEE_NEXT_AFTER ( 3I ) IEEE_NEXT_AFTER ( 3I )

NAME
IEEE_NEXT_AFTER – Returns the next representable neighbor of x in the direction toward y

SYNOPSIS
IEEE_NEXT_AFTER ([X=]x, [Y=]y)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The IEEE_NEXT_AFTER intrinsic function returns the next representable neighbor of x in the direction
toward y.
IEEE_NEXT_AFTER and the Fortran 95 intrinsic function NEAREST(3I) have a number of differences,
including the Fortran 95 restriction that argument s to NEAREST(3I) must not be zero.
IEEE_NEXT_AFTER accepts the following arguments:
x Must be of type real.
y Must be of type real. If x is scalar, y must be scalar. If x is an array, y can be scalar or an array
of the same shape as x.
IEEE_NEXT_AFTER is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type and type parameter is the same type and type parameter as x. If x is an array, the result is an
array of the same shape as x.
The following special cases can affect the result value:
• If x = y, the result is x without any exception being signaled.
• If either x or y is a quiet NaN, the result is one or the other of the input NaNs.
• Overflow is signaled when x is finite but IEEE_NEXT_AFTER(x, y) is infinite. Underflow is signaled
when IEEE_NEXT_AFTER(x, y) lies strictly between -2**E min and +2**E min . In both cases, the
inexact exception is signaled.

148 004– 2138– 003


IEEE_NEXT_AFTER ( 3I ) IEEE_NEXT_AFTER ( 3I )

The result values are produced from the following combinations of scalar and array arguments:
• If x is scalar, the result is a scalar.
• If x is an array and y is scalar, the result is an array in which each element is the nearest neighbor of x i in
the direction of y.
• If x is an array and y is an array, the result is an array in which each element is the nearest neighbor of x i
in the direction of y i .

EXAMPLES

REA L x, y
... ! Com put e X.
y = IEE E_N EXT _AF TER (x, 1.0 )

SEE ALSO
NEAREST(3I)

004– 2138– 003 149


IEEE_REAL ( 3I ) IEEE_REAL ( 3I )

NAME
IEEE_REAL – Converts x to a real value

SYNOPSIS
IEEE_REAL ([X=]x [, [Y=]y])

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The IEEE_REAL intrinsic function converts x to a real value according to the rounding mode currently in
effect. It accepts the following arguments:
x Can be of type real or integer. It can be scalar or an array.
y If specified, must be scalar and of type real.
IEEE_REAL is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type and type parameters are as follows. If y is absent, the result type and type parameter are
default real. If y is present, the result type and type parameter are the same type and type parameter as y. If
x is an array, the result is an array of the same shape as x.
If y is absent, the result is a default real rounded from x according to the rounding mode currently in effect.
When x is of type integer, this form of IEEE_REAL is useful for converting an integer value that has more
significant bits than the number of bits in the mantissa of the default real format or the format of y.
IEEE_REAL, in this case, rounds the integer according to the number of bits in the mantissa. For example,
suppose that on some machine an integer can hold 5 decimal digits, but the floating-point format of the same
size can only hold 4. The result of IEEE_REAL(10126) on this machine would be 1.013E+3 if the
current rounding mode is round-to-nearest. This form of IEEE_REAL is also useful when converting a
double precision y to (default) single precision and, in the process, rounding the fractional value in the
mantissa according to the rounding mode currently in effect.

150 004– 2138– 003


IEEE_REAL ( 3I ) IEEE_REAL ( 3I )

If y is present, the result is of type real with the same kind type parameter value as y and whose value is
rounded from x according to the rounding mode currently in effect. This form of IEEE_REAL has
essentially the same uses as those described in the previous paragraph, but it allows you to specify a result
type of something other than default real. For example, this form would be useful to convert quad precision
real to double precision (and rounding in the process) on IRIX systems.
If x is scalar, the result is scalar.
If x is an array, the result is an array in which each element is the value of x i rounded to the type and type
parameter of y.

EXAMPLES

! Ass ume that the fol low ing pro gram is com piled and execut ed on
! a 32-bit mac hine.
INT EGE R k
... ! X is fil led with a val ue tha t
... ! has more than 23 sig nifica nt bit s.
PRI NT *, IEE E_R EAL(k)

Variable k is converted to type default real and rounded to fit into 23 bits according to the rounding mode
currently in effect.

004– 2138– 003 151


IEEE_REMAINDER ( 3I ) IEEE_REMAINDER ( 3I )

NAME
IEEE_REMAINDER – Returns the remainder of x divided by y

SYNOPSIS
IEEE_REMAINDER ([X=]x, [Y=]y)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The IEEE_REMAINDER intrinsic function returns the remainder of the operation x divided by y. Note that
this function does not have precisely the same definition as either of the Fortran 90 intrinsic functions
MOD(3I) or MODULO(3I).
The IEEE_REMAINDER function accepts the following arguments:
x Must be of type real. It can be scalar or an array.
y Must be of type real. If x is scalar, y can be scalar or an array. If x is an array, y can be scalar
or an array of the same shape as x.
IEEE_REMAINDER is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The same type and kind type parameter as the argument of the largest precision and range. For example, if x
is type REAL(KIND=4) and y is type REAL(KIND=8), the result is of type REAL(KIND=8). If either x
or y is an array, the result is an array of the same shape as one of the array arguments.
The form of the result value is determined as follows:
• If x and y are both scalar, the result is a scalar.
• If x is an array and y is scalar, the result is an array in which each element is the remainder of x i divided
by y.
• If x is scalar and y is an array, the result is an array in which each element is the remainder of x divided
by y i .
• If x is an array and y is an array, the result is an array in which each element is the remainder of x i
divided by y i .

152 004– 2138– 003


IEEE_REMAINDER ( 3I ) IEEE_REMAINDER ( 3I )

EXAMPLES

REAL x, y, r
... ! Com put e X and Y.
r = IEE E_REMA IND ER( x, y)

IF (r /= 0.0 ) THE N
...
END IF

SEE ALSO
MOD(3I) MODULO(3I)

004– 2138– 003 153


IEEE_UNORDERED ( 3I ) IEEE_UNORDERED ( 3I )

NAME
IEEE_UNORDERED – Tests for x or y being a NaN

SYNOPSIS
IEEE_UNORDERED ([X=]x, [Y=]y)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The IEEE_UNORDERED intrinsic function tests for x or y being a NaN. It accepts the following arguments:
x Must be of type real. Can be a scalar or an array.
y Must be of type real. y must be conformable with x.
IEEE_UNORDERED is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type and type parameter are default logical. If either x or y is an array, the result is an array of
the same shape as one of the array arguments.
The return value is .TRUE. if either x or y is a NaN, otherwise the return value is .FALSE.. The
operation does not raise the Invalid Operation interrupt.
If x and y are both scalar, the result is a scalar.
If x is an array and y is scalar, the result is an array in which each element has the value .TRUE. or
.FALSE., depending on whether x i is unordered with y.
If x is scalar and y is an array, the result is an array in which each element has the value .TRUE. or
.FALSE., depending on whether x is unordered with y i .
If x is an array and y is an array, the result is an array in which each element has the value .TRUE. or
.FALSE., depending on whether x i is unordered with y i .

154 004– 2138– 003


IEEE_UNORDERED ( 3I ) IEEE_UNORDERED ( 3I )

EXAMPLES

REA L x,y
... ! Com put e X.
IF (IE EE_UNO RDE RED (x, y)) THE N
... ! Do som eth ing .
ELS E
... ! Do som eth ing els e.
END IF

004– 2138– 003 155


INDEX ( 3I ) INDEX ( 3I )

NAME
INDEX – Determines the starting location of a character substring in a string

SYNOPSIS
INDEX ([STRING=]string, [SUBSTRING=]substring [,[BACK=]back])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran

DESCRIPTION
The INDEX intrinsic function returns the starting position of a substring within a string from either the right
or left end of the string. It accepts the following arguments:
string Must be of type character.
substring Must be of type character.
back Must be of type logical. If omitted, a value of false is assumed. If present with a value of true,
the search begins at the end of string. This argument is not accepted by the MIPSpro Fortran 77
compiler.
INDEX is an elemental function. The name of this intrinsic can be passed as an argument.

NOTES
When the INDEX intrinsic function is passed as an actual argument, it must be called with only the first two
arguments in the routine that calls the passed-in function.

RETURN VALUES
The back argument can affect the return value as follows:
• If back is absent or is present with the value FALSE, the INDEX search is relative to the left end of
string. The result is the minimum positive value of i, as follows:

string ( i : i + LEN( substring ) - 1 ) = substring

If the length of substring is 0, a value of 1 is returned.

156 004– 2138– 003


INDEX ( 3I ) INDEX ( 3I )

• If back is present with the value TRUE, the INDEX search is relative to the right end of string. The
result is the maximum positive value of the following:

i ≤ LEN( string ) - LEN( substring ) + 1

In the preceding equation, substring is as follows:

string ( i : i + LEN( substring ) - 1 ) = substring

If the length of substring is 0, the value returned is as follows:

LEN( string ) + 1.

If substring occurs more than once in string, INDEX returns the index to the first occurrence.

The return value is 0 if substring is not located within string.

The return value is 0 if the length of string is less than the length of substring.

EXAMPLES
Example 1: INDEX(’FORTRAN’,’R’) yields 3.
Example 2: INDEX(’FORTRAN’,’R’,BACK=.TRUE.) yields 5.
Example 3: The following program returns the index I=10 for the substring SUPERCOMPUTER:
PRO GRAM INDEX1
CHA RAC TER*22 A
CHA RAC TER*13 B
A = ’CR AY T90 SUPERC OMP UTER’
B = ’SU PERCOMPUT ER’
I = IND EX(A,B)
PRINT *, I
STOP
END

004– 2138– 003 157


INT ( 3I ) INT ( 3I )

NAME
INT, IINT, JINT, KINT, IDINT, IIDINT, JIDINT, KIDINT, IQINT, IIQINT, JIQINT, KIQINT,
IFIX, IIFIX, JIFIX, KIFIX – Converts to type integer

SYNOPSIS
INT ([A=]a [,[KIND=]kind])
IINT ([A=]a)
JINT ([A=]a)
KINT ([A=]a)
IDINT ([A=]a)
IIDINT ([A=]a)
JIDINT ([A=]a)
KIDINT ([A=]a)
IQINT ([A=]a)
IIQINT ([A=]a)
JIQINT ([A=]a)
KIQINT ([A=]a)
IFIX ([A=]a)
IIFIX ([A=]a)
JIFIX ([A=]a)
KIFIX ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: IQINT, IINT, JINT, KINT, IIDINT, JIDINT, KIDINT, IIQINT, JIQINT,
KIQINT, IIFIX, JIFIX, KIFIX

DESCRIPTION
INT is the generic function name. These functions truncate the argument specified and return type integer.
These are elemental intrinsic functions. They accept the following arguments:

158 004– 2138– 003


INT ( 3I ) INT ( 3I )

a For INT, must be of type integer, real, or complex. For IINT, JINT, and KINT, must be
single precision real. For IDINT, IIDINT, JIDINT, and KIDINT, must be double precision
real. For IQINT, IIQINT, JIQINT, and KIQINT, must be quad precision real.
For IFIX, IIFIX, JIFIX, and KIFIX, must be of type real.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
kind An integer scalar value. The kind type to be used for the result. If not specified, the kind type
for default integer. This argument is not accepted by the MIPSpro Fortran 77 compiler.
These functions convert specified types to type integer by truncating toward 0 (the fraction is lost). Type
conversion routines assign the appropriate type to Boolean arguments without shifting or manipulating the bit
patterns they represent.

NOTES
The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
The return values are of type integer. The magnitude of the return value does not exceed the magnitude of
the argument. The sign of the return value is the same as the sign of a.
INT, IFIX, IDINT, and IQINT, return an integer.
IIFIX, IINT, IIDINT, and IIQINT return an integer (KIND=2).
JIFIX, JINT, JIDINT, and JIQINT return an integer (KIND=4).
KIFIX, KINT, KIDINT, and KIQINT returns an integer (KIND=8).

SEE ALSO
f90(1)

004– 2138– 003 159


INT_MULT_UPPER ( 3I ) INT_MULT_UPPER ( 3I )

NAME
_int_mult_upper, INT_MULT_UPPER – Multiplies integers and returns the uppermost bits

SYNOPSIS
C/C++:
#include <intrinsics.h>
unsigned long _int_mult_upper (long i, long j)
Fortran:
INT_MULT_UPPER ([I=]i, [J=]j)

IMPLEMENTATION
C/C++: UNICOS/mk systems and UNICOS systems with IEEE floating-point hardware
Fortran: UNICOS/mk systems, IRIX systems, and Cray T90 systems that support IEEE floating-point
arithmetic
Cray C/C++, CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension to the Fortran standard

DESCRIPTION
This intrinsic function takes advantage of a hardware instruction on IRIX systems, UNICOS/mk systems, on
Cray T90 systems that support IEEE floating-point arithmetic. On UNICOS and UNICOS/mk systems, this
hardware instruction multiplies two 64-bit integers, as if they were unsigned, and returns the upper (leftmost)
64 bits of the 128-bit unsigned result. On IRIX systems, this hardware instruction multiplies two 32-bit
integers, as if they were unsigned, and returns the upper (leftmost) 32 bits of the 64-bit unsigned result.

NOTES

C/C++
Because _int_mult_upper is an intrinsic function, no externally visible library function is available for
it. The compiler generates inline code to produce the result.
Fortran
INT_MULT_UPPER accepts the following arguments:
i On UNICOS/mk systems and on Cray T90 systems that support IEEE floating-point arithmetic, i must
be of type INTEGER(KIND=8). On IRIX systems, it can also be of type INTEGER(KIND=4). It
can be a scalar or an array.

160 004– 2138– 003


INT_MULT_UPPER ( 3I ) INT_MULT_UPPER ( 3I )

j On UNICOS/mk systems and on Cray T90 systems that support IEEE floating-point arithmetic, j must
be of type INTEGER(KIND=8). On IRIX systems, it can also be of type INTEGER(KIND=4). It
can be a scalar or an array. If it is an array, it must be of the same shape as i.
INT_MULT_UPPER is an elemental function. The name of this intrinsic cannot be passed as an argument.
If i and j are scalar, the result is a scalar.
If i is an array and j is scalar, the result is an array of the same shape as i in which each element is the
result of the product of i i and j as described previously.
If i is scalar and j is an array, the result is an array of the same shape as j and in which each element is the
result of the product of i and j i as described previously.
If both i and j are arrays, the result is an array of the same shape as i and in which each element is the result
of the product of i i and j i as described previously.

RETURN VALUES
On UNICOS/mk systems and on Cray T90 systems that support IEEE floating-point arithmetic,
INT_MULT_UPPER returns the upper (leftmost) 64 bits of the 128-bit result of the product of i and j.
On IRIX systems, INT_MULT_UPPER returns a 64-bit integer result if at least one of the arguments is a
64-bit integer; the 32-bit argument is converted to a 64-bit integer. If both i and j are INTEGER(KIND=4)
arguments, the result is the upper (leftmost) 32 bits of the 64-bit result of the product of i and j.

EXAMPLES
Fortran example:
! Assume the follow ing code is exe cuted on a CRAY T90 IEEE.

INT EGER ii( 128 ), jj, res ult (12 8)


... ! Com put e II and JJ
res ult = INT_MULT_ UPP ER( ii, jj)

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 161


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

NAME
INTRO_INTRIN – Introduction to intrinsic procedures

IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

DESCRIPTION
Intrinsic procedures are predefined procedures that are defined by the computer programming language.
They are invoked in the same way that other procedures are invoked.
The Fortran standard defines intrinsic procedures, and the CF90 and MIPSpro 7 Fortran 90 compilers support
all the intrinsics described in the Fortran 95 standard. The CF90 and MIPSpro 7 Fortran 90 compilers
support other intrinsics as extensions to the standard. The MIPSpro Fortran 77 compiler conforms to the
outmoded FORTRAN 77 standard; the intrinsics supported by this compiler are fewer in number than those
supported by the CF90 and MIPSpro 7 Fortran 90 compilers.
There are four classes of Fortran intrinsic procedures as defined by the Fortran 95 standard: inquiry
functions, elemental functions, transformational functions, and subroutines. Additional intrinsics provided
with the CF90 and MIPSpro 7 Fortran 90 compiler include intrinsics that support IEEE floating-point
arithmetic and other compiler extensions.
The CF90 and MIPSpro 7 Fortran 90 compilers evaluate intrinsic procedures in line or by calling external
code. Depending on your platform and your program, the following intrinsics can be evaluated in line:
• ABS
• ACHAR
• AIMAG
• AINT
• ALL
• AND
• ANINT
• ANY
• BIT_SIZE
• M@CLR, M@LD, M@MX, M@LDMX, M@UL (the BMM intrinsics)
• BTEST
• CEILING
• CHAR, ICHAR
• CLEAR_IEEE_EXCEPTION

162 004– 2138– 003


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

• CLOC
• CMPLX
• COMPL
• CONJG
• COUNT
• CSHIFT
• CSMG
• CVMGM, CVMGN, CVMGP, CVMGZ, CVMGT
• DBLE
• DIGITS
• DIM
• DISABLE_IEEE_INTERRUPT
• DOT_PRODUCT
• DPROD
• DSHIFTL
• DSHIFTR
• ENABLE_IEEE_INTERRUPT
• EOSHIFT
• EPSILON
• EQV
• EXPONENT
• FCD
• FLOOR
• FLOAT
• FRACTION
• GET_IEEE_EXCEPTIONS
• GET_IEEE_INTERRUPTS
• GET_IEEE_ROUNDING_MODE
• GET_IEEE_STATUS
• HUGE
• I24MULT

004– 2138– 003 163


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

• IACHAR
• IAND
• IBCLR
• IBITS
• IBSET
• IEEE_CLASS
• IEEE_COPY_SIGN
• IEEE_FINITE
• IEEE_INT
• IEEE_IS_NAN
• IEEE_REAL
• IEEE_UNORDERED
• IEOR
• INT
• INT_MULT_UPPER
• IOR
• ISHFT
• ISHFTC
• KIND
• LBOUND
• LEADZ
• LEN
• LGE, LGT, LLE, LLT
• LOC
• LOGICAL
• MASK
• MATMUL
• MAX
• MAXEXPONENT
• MAXLOC
• MAXVAL

164 004– 2138– 003


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

• MEMORY_BARRIER
• MERGE
• MIN
• MINEXPONENT
• MINVAL
• MOD, AMOD
• MODULO
• MVBITS
• MY_PE
• NEAREST
• NEQV, XOR
• NINT
• NOT
• NUMARG
• OR
• POPCNT
• POPPAR
• PRECISION
• PRESENT
• PRODUCT
• RADIX
• RANGE
• REAL
• REMOTE_WRITE_BARRIER
• RRSPACING
• RTC, IRTC
• SCALE
• SELECTED_INT_KIND
• SET_EXPONENT
• SET_IEEE_EXCEPTION
• SET_IEEE_EXCEPTIONS

004– 2138– 003 165


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

• SET_IEEE_INTERRUPTS
• SET_IEEE_ROUNDING_MODE
• SET_IEEE_STATUS
• SHAPE
• SHIFT
• SHIFTA
• SHIFTL
• SHIFTR
• SIGN
• SPACING
• SPREAD
• SUM
• SYSTEM_CLOCK
• TEST_IEEE_EXCEPTION
• TEST_IEEE_INTERRUPT
• TINY
• TRANSFER
• TRANSPOSE
• UBOUND
• WRITE_MEMORY_BARRIER
The CF90 compiler supports vector versions of some intrinsic procedures. Using one of these intrinsics
means that the presence of the intrinsic itself, in a loop, does not inhibit the loop’s ability to vectorize.
Vector versions of the following CF90 intrinsic procedures exist on UNICOS platforms:
• ABS
• ACOS, DACOS
• AIMAG
• AINT
• AND
• ANINT
• ASIN
• ATAN

166 004– 2138– 003


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

• ATAN2
• BIT_SIZE
• M@CLR, M@LD, M@MX, M@LDMX, and M@UL (the BMM intrinsics)
• BTEST
• CEILING
• CMPLX
• COMPL
• CONJG
• COS
• COSH, DCOSH
• COT, DCOT
• CSMG
• CVMGM, CVMGN, CVMGP, CVMGZ, CVMGT
• DBLE, DFLOAT
• DIGITS
• DIM
• DPROD
• DSHIFTL
• DSHIFTR
• EPSILON
• EQV
• EXP
• EXPONENT
• FLOOR
• FRACTION
• HUGE
• I24MULT
• IAND
• IBCLR
• IBITS
• IBSET

004– 2138– 003 167


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

• IEEE_CLASS
• IEEE_COPY_SIGN
• IEEE_FINITE
• IEEE_INT
• IEEE_IS_NAN
• IEEE_REAL
• IEEE_UNORDERED
• IEOR
• INT, IDINT, IFIX
• INT_MULT_UPPER
• IOR
• ISHFT
• ISHFTC
• KIND
• LEADZ
• LOG
• LOG10
• LOGICAL
• MASK
• MAX
• MAXEXPONENT
• MERGE
• MIN
• MINEXPONENT
• MOD
• MVBITS
• NEAREST
• NEQV, XOR
• NINT
• NOT
• OR

168 004– 2138– 003


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

• POPCNT
• POPPAR
• PRECISION
• PRESENT
• RADIX
• RANDOM_NUMBER
• RANF
• RANGE
• REAL
• RRSPACING
• SCALE
• SELECTED_INT_KIND
• SET_EXPONENT
• SHIFT
• SHIFTA
• SHIFTL
• SHIFTR
• SIGN
• SIN
• SINH
• SPACING
• SPREAD
• SQRT
• TAN
• TANH
• TINY
The CF90 compiler supports vector versions of some intrinsic procedures and library-based operators on
UNICOS/mk platforms, too. Using one of these intrinsics means that the presence of the intrinsic itself, in a
loop, does not inhibit the loop’s ability to vectorize. On UNICOS/mk platforms, you must specify
-O vector3 and -l mfastv on your f90(1) command line in order for the compiler to be able to use
vector versions of the following intrinsic procedures:
• COS, ACOS

004– 2138– 003 169


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

• COSS
• EXP
• LOG, LOG10
• M@LD, M@MX, M@LDMX, and M@UL (the BMM intrinsics)
• POPCNT
• RANF
• RTOR
• SIN, ASIN
• TAN, ATAN, ATAN2
• SQRT
The MIPSpro 7 Fortran 90 and the MIPSpro Fortran 77 compilers support both single-precision and
double-precision vector versions of certain intrinsic procedures when -O3 is specified on the compiler
command line. These intrinsics are as follows:
• COS, ACOS
• EXP
• LOG, LOG10
• SIN, ASIN
• SQRT
• TAN, ATAN
For details about the Fortran 95 intrinsics, see the man pages themselves and the Fortran Language
Reference Manual, Volume 2.
The C/C++ intrinsics either allow direct access to hardware instructions or result in the generation of inline
code to perform specialized functions. The intrinsic functions are processed completely by the compiler, and
no calls to external functions are generated. For details about the C intrinsic procedures, see the Cray
C/C++ Reference Manual.

MATH INTRINSICS
Many mathematical intrinsic procedures have both generic and specific forms. For example, ALOG, DLOG,
QLOG, CLOG, CDLOG, CQLOG, are logarithmic functions. ALOG is generic. The others are specific.
Generic function names cause the compiler to compile automatically the appropriate data type version of a
routine, based on the type of the input data. For example, a call to the generic function LOG with a type of
input data of complex compiles as CLOG.

170 004– 2138– 003


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

In general, real functions have no prefix. Integer functions are prefixed with I. Double-precision functions
are prefixed with D. Complex functions are prefixed with C. Double-precision complex functions are
prefixed with CD. For example, ABS, IABS, DABS, QABS, CABS, and CDABS all have prefixes that indicate
a data type. Functions with a type different from their arguments are noted. Real functions are usually the
same as the generic function name.
On UNICOS/mk systems, two precisions are provided for real data: 32-bit, or half-precision real, and 64-bit,
or single-precision real. The specific names for single precision real data provide a link to the 64-bit
intrinsic functions. To ensure a link to the 32-bit intrinsic functions, use the generic function names with
32-bit real arguments. For example, use LOG for any of the types of real data. Use ALOG for single
precision real arguments. Extended precision routines of math library routines are not provided on
UNICOS/mk systems.
UNICOS/mk systems have an additional library named libmfastv. It contains versions of selected math
intrinsics which can be faster than those in the default Math library. These alternate versions are not as
accurate as the default library, and in some cases there are argument restrictions, such as not allowing the
use of infinities. These alternate versions are generally faster for loops with 50 or more iterations. To use
libmfastv, use the -l mfastv option on the compiler’s command line to load the library file. You
must compile your code with the -O3 or -Ovector3 option for the Fortran compiler or use -h vector3
with the C compiler.
The math routines can be divided into the following general categories:
• General arithmetic functions. In the routine descriptions, complex arguments are represented as follows:
x = x r + ix i .
The real part of the complex number is x r .
The imaginary part of the complex number is x i .
Arguments and results are of the same type unless otherwise indicated.
Base values raised to a power and 64-bit integer division are called implicitly from Fortran.
• Exponential and logarithmic functions. Each function has variations for real, double precision, and
complex values except the common logarithm function, which addresses only real and double-precision
values. Complex arguments are represented as follows:
x = x r + ix i
The real part of the complex number is x r .
The imaginary part of the complex number is x i .
• Trigonometric functions. The trigonometric functions are based on the ANSI standard for Fortran, except
for the cotangent functions (COT or COTAN), which are extensions.
• Type conversion functions. Type conversion functions change the type of an argument. In the routine
description, complex arguments are represented as follows:
x = x r + ix i

004– 2138– 003 171


INTRO_INTRIN ( 3I ) INTRO_INTRIN ( 3I )

The real part of the complex number is x r .


The imaginary part of the complex number is x i .
Arguments and results are of the same type, unless indicated otherwise.
• Special functions. The special functions provide Fortran access to a number of Standard C functions on
UNICOS/mk and UNICOS systems.
• Extended-precision routines. The extended-precision routines perform double- and quad-precision
arithmetic.
• Boolean functions. The Boolean functions perform logical operations and bit manipulations. All Boolean
functions are extensions. These functions cannot be passed as arguments with CF90 on any system.

TERMINOLOGY
The Fortran intrinsic procedure man pages use the terms single precision, double precision, and
quad precision. These terms have different meanings depending on your operating system.
The meaning of the term single precision is as follows:
• On IRIX systems, REAL(KIND=4) and COMPLEX(KIND=4).
• On UNICOS and UNICOS/mk systems, REAL(KIND=8) and COMPLEX(KIND=8).
The meaning of the term double precision is as follows:
• On UNICOS/mk and IRIX systems, REAL(KIND=8) and COMPLEX(KIND=8).
• On UNICOS systems, REAL(KIND=16) and COMPLEX(KIND=16).
The meaning of the term quad precision is as follows:
• On UNICOS and IRIX systems, REAL(KIND=16) and COMPLEX(KIND=16).
• On UNICOS/mk systems, REAL(KIND=8) and COMPLEX(KIND=8).
SEE ALSO
INTRO_LIBM(3M), INTRO_SHMEM(3)
Cray C/C++ Reference Manual
Cray Standard C Reference Manual
CF90 Commands and Directives Reference Manual
Fortran Language Reference Manual, Volume 1
Fortran Language Reference Manual, Volume 2
Fortran Language Reference Manual, Volume 3

172 004– 2138– 003


ISHA ( 3I ) ISHA ( 3I )

NAME
ISHA, IISHA, JISHA, KISHA – Performs arithmetic shift on an integer

SYNOPSIS
ISHA ([I=]i, [SHIFT=]shift)
IISHA ([I=]i, [SHIFT=]shift)
JISHA ([I=]i, [SHIFT=]shift)
KISHA ([I=]i, [SHIFT=]shift)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extensions

DESCRIPTION
The ISHA, IISHA, JISHA, KISHA intrinsic functions perform an arithmetic shift of an integer, left or
right, by a specified number of bits. This function accepts the following arguments:
i Must be of type integer. For IISHA, must be of type integer (KIND=2). For JISHA, must be
of type integer (KIND=4). For KISHA, must be of type integer (KIND=8). This is the value to
be shifted.
shift Must be of type integer. This is the direction and distance of the shift.
Positive shifts are left, toward the most significant bit. Negative shifts are right, toward the least
significant bit. If shift is zero, no shift is performed.
These elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
The result type and type parameter are the same as i. The result is equal to i shifted arithmetically by shift
bits.
Bits shifted out, from the left or from the right, are lost. Zeros are shifted in for a left shift. The sign bit is
extended for a right shift.
The kind of the integer is important because the sign varies among integer representations. If you want to
shift a 1-byte or 2-byte argument, declare it as KIND=1 or KIND=2.

004– 2138– 003 173


ISHC ( 3I ) ISHC ( 3I )

NAME
ISHC, IISHC, JISHC, KISHC – Performs circular shift on an integer

SYNOPSIS
ISHC ([I=]i, [SHIFT=]shift)
IISHC ([I=]i, [SHIFT=]shift)
JISHC ([I=]i, [SHIFT=]shift)
KISHC ([I=]i, [SHIFT=]shift)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extensions

DESCRIPTION
The ISHC, IISHC, JISHC, KISHC intrinsic functions perform a circular shift on an integer. In this shift,
the intrinsic rotates the integer, left or right, by a specified number of bits. Bits shifted out of one end are
shifted in or the other end. No bits are lost. These functions accept the following arguments:
i Must be of type integer. For IISHC, must be of type integer (KIND=2). For JISHC, must be
of type integer (KIND=4). For KISHC, must be of type integer (KIND=8). This is the value to
be shifted.
shift Must be of type integer. This is the direction and distance of rotation.
Positive shifts are left, toward the most significant bit. Negative shifts are right, toward the least
significant bit. If shift is zero, no shift is performed.
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
The result type and type parameter are the same as i. The result is equal to i rotated by shift bits.
For an integer (KIND=4) argument, 32 bits are shifted. If you want to shift a 1-byte or 2-byte argument,
declare it as KIND=1 or KIND=2, respectively.

174 004– 2138– 003


ISHFT ( 3I ) ISHFT ( 3I )

NAME
ISHFT, IISHFT, JISHFT, KISHFT, LSHIFT, RSHIFT – Performs a logical shift

SYNOPSIS
ISHFT ([I=]i, [SHIFT=]shift)
IISHFT ([I=]i, [SHIFT=]shift)
JISHFT ([I=]i, [SHIFT=]shift)
KISHFT ([I=]i, [SHIFT=]shift)
LSHIFT ([I=]i, [SHIFT=]shift)
RSHIFT ([I=]i, [SHIFT=]shift)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: IISHFT, JISHFT, KISHFT, LSHIFT, RSHIFT

DESCRIPTION
The ISHFT, IISHFT, JISHFT, KISHFT, LSHIFT and RSHIFT intrinsic functions perform a logical shift.
They accept the following arguments:
i Must be of type integer. For IISHFT, must be of type integer (KIND=2). For JISHFT, must
be of type integer (KIND=4). For KISHFT, must be of type integer (KIND=8).
shift Must be of type integer. The absolute value of shift must be less than or equal to
BIT_SIZE(i).
ISHFT with a positive shift argument can also be specified as LSHIFT. ISHFT with a negative
shift argument can also be specified as RSHIFT with  shift .
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
The result type and type parameters are the same as i. On IRIX systems, the result can be affected by the
-i option on the f90(1) command line.
The result has the value obtained by shifting the bits of i by shift positions. If shift is positive, the shift is to
the left; if shift is negative, the shift is to the right; and if shift is zero, no shift is performed. Bits shifted
out from the left or from the right, as appropriate, are lost. Zeros are shifted in from the opposite end.

004– 2138– 003 175


ISHFT ( 3I ) ISHFT ( 3I )

LSHIFT and RSHIFT return the value of the first argument shifted left or right, respectively, the number of
times specified by the shift. Zeros are shifted in.
The bit model defines the interpretation of an integer value as a sequence of bits. For more information on
the bit model, see the MODELS(3I) man page.

EXAMPLES
ISHFT(3,1) yields 6.

SEE ALSO
f90(1)
MODELS(3I)

176 004– 2138– 003


ISHFTC ( 3I ) ISHFTC ( 3I )

NAME
ISHFTC, IISHFTC, JISHFTC, KISHFTC – Performs a circular shift of the rightmost bits

SYNOPSIS
ISHFTC ([I=]i, [SHIFT=]shift [,[SIZE=]size])
IISHFTC ([I=]i, [SHIFT=]shift [,[SIZE=]size])
JISHFTC ([I=]i, [SHIFT=]shift [,[SIZE=]size])
KISHFTC ([I=]i, [SHIFT=]shift [,[SIZE=]size])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: IISHFTC, JISHFTC, KISHFTC

DESCRIPTION
The ISHFTC, IISHFTC, JISHFTC, and KISHFTC intrinsic functions perform a circular shift of the
rightmost bits. They accept the following arguments:
i Must be of type integer. For IISHFTC, must be of type integer (KIND=2). For JISHFTC,
must be of type integer (KIND=4). For KISHFTC, must be of type integer (KIND=8).
shift Must be of type integer. The absolute value of shift must be less than or equal to size.
size Must be of type integer. The value of size must be positive and must not exceed
BIT_SIZE(i). If size is absent, it is as if it were present with the value of BIT_SIZE(i).
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
The result type and type parameter are the same as i. The result has the value obtained by shifting the size
rightmost bits of i circularly by shift positions. If shift is positive, the shift is to the left; if shift is negative,
the shift is to the right; and if shift is zero, no shift is performed. No bits are lost. The unshifted bits are
unaltered.
The bit model defines the interpretation of an integer value as a sequence of bits. For more information on
the model, see the MODELS(3I) man page.

004– 2138– 003 177


ISHFTC ( 3I ) ISHFTC ( 3I )

EXAMPLES
ISHFTC(3,2,3) yields 5.

SEE ALSO
MODELS(3I)

178 004– 2138– 003


ISHL ( 3I ) ISHL ( 3I )

NAME
ISHL, IISHL, JISHL, KISHL – Performs logical shift with zero fill

SYNOPSIS
ISHL ([I=]i, [SHIFT=]shift)
IISHL ([I=]i, [SHIFT=]shift)
JISHL ([I=]i, [SHIFT=]shift)
KISHL ([I=]i, [SHIFT=]shift)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extensions

DESCRIPTION
The ISHL, IISHL, JISHL, KISHL intrinsic functions perform a logical shift on an integer. In this shift,
the intrinsic shifts the integer, left or right, by a specified number of bits. Bits shifted out of one end are
lost, and zeros are filled in. These functions accept the following arguments:
i Must be of type integer. For IISHL, must be of type integer (KIND=2). For JISHL, must be
of type integer (KIND=4). For KISHL, must be of type integer (KIND=8). This is the value to
be shifted.
shift Must be of type integer. This is the direction and distance of the shift.
Positive shifts are left, toward the most significant bit. Negative shifts are right, toward the least
significant bit. If shift is zero, no shift is performed.
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
The result type and type parameter are the same as i. The result is equal to i logically shifted by shift bits.
Zeros are shifted in from the opposite end.
The integer kind determines the end that the bits are shifted out of. For an integer (KIND=4) argument, 32
bits are shifted. If you want to shift a 1-byte or 2-byte argument, declare it as KIND=1 or KIND=2.

004– 2138– 003 179


KIND ( 3I ) KIND ( 3I )

NAME
KIND – Returns the value of the kind type parameter of x

SYNOPSIS
KIND ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The KIND intrinsic function returns the value of the kind type parameter of x. It maps variable space into
kind values, and it accepts the following argument:
x May be of any intrinsic type
KIND is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a default integer scalar value and has a value equal to the kind type parameter value of x.

EXAMPLES
KIND(0.0) has the kind type parameter value of default real.

180 004– 2138– 003


LBOUND ( 3I ) LBOUND ( 3I )

NAME
LBOUND – Returns all the lower bounds or a specified lower bound of an array

SYNOPSIS
LBOUND ([ARRAY=]array [,[DIM=]dim])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The LBOUND intrinsic function returns all the lower bounds or a specified lower bound of an array. It
accepts the following arguments:
array May be of any type. It must not be scalar. It must not be a pointer that is disassociated or an
allocatable array that is not allocated.
dim Must be scalar and of type integer with a value in the range 1 ≤ dim ≤ n, where n is the rank of
array. The corresponding actual argument must not be an optional dummy argument.
LBOUND is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is of type default integer. It is scalar if dim is present; otherwise, the result is an array of rank 1
and size n, where n is the rank of array.
For an array section or for an array expression, other than a whole array or array structure component,
LBOUND (array, dim) has the value 1; otherwise, it has a value equal to the lower bound for subscript dim of
array if dimension dim of array does not have size 0 and has the value 1 if dimension dim has size 0.
LBOUND (array) has a value whose ith component is equal to LBOUND (array, i), for i = 1, 2, . . ., n, where
n is the rank of array.

EXAMPLES
Assume that A is declared by the following statement:
REA L A(2 :3, 7:1 0)

004– 2138– 003 181


LBOUND ( 3I ) LBOUND ( 3I )

The following are true:


• LBOUND(A) yields [2,7].
• LBOUND(A,DIM=2) yields 7.

182 004– 2138– 003


LEADZ ( 3I ) LEADZ ( 3I )

NAME
_leadz, LEADZ – Counts number of leading 0 bits

SYNOPSIS
C/C++
#include <intrinsics.h>
int _leadz (long i)
Fortran:
LEADZ ([I=]i)

IMPLEMENTATION
C/C++: UNICOS and UNICOS/mk systems
Fortran: UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
This intrinsic function counts the number of leading 0 bits in i.

NOTES

C/C++
Because _leadz is an intrinsic function, no externally visible library function is available for it. The
compiler generates inline code to produce the result.
Fortran
LEADZ accepts the following argument:
i A Boolean, integer, real, or Cray pointer value. i cannot be declared as REAL(KIND=16).
LEADZ is an elemental function. The name of this function cannot be passed as an argument.

FORTRAN RETURN VALUES


LEADZ returns a value of type default integer.

004– 2138– 003 183


LEADZ ( 3I ) LEADZ ( 3I )

EXAMPLES
The following section of Fortran code shows the LEADZ function used with an argument of type integer.
The bit pattern of the argument and the value of the result are also given. For simplicity, a 16-bit object is
used.
INTEGE R I1, I2
...
I2 = LEA DZ(I1)

--- ------ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
--- ------ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
I1

LEADZ returns 5 for the integer variable I2.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

184 004– 2138– 003


LEN ( 3I ) LEN ( 3I )

NAME
LEN – Determines the length of a character string

SYNOPSIS
LEN ([STRING=]string)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran

DESCRIPTION
The LEN intrinsic function takes Fortran character string arguments and returns an integer length. This
function accepts the following argument:
string Must be of type character. It can be scalar or array valued.
LEN is an inquiry function. The name of this intrinsic can be passed as an argument.

RETURN VALUES
The result type, type parameter, and shape are default integer scalar. The result has a value equal to the
number of characters in string if it is a scalar or in an element of string if it is array valued.

EXAMPLES
The following program returns the length of the character string I=37:
PROGRA M LEN TES T
I=LEN( ’|...+ ... .1. ... +.. ..2 ... .+. ... 3.. ..+ ..’ )
PRINT *,I
STOP
END

004– 2138– 003 185


LENGTH ( 3I ) LENGTH ( 3I )

NAME
LENGTH – Returns the number of words transferred

SYNOPSIS
LENGTH ([I=]i)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
LENGTH returns the length (in words) of a BUFFER IN or BUFFER OUT statement transfer. It accepts the
following argument:
i Must be a nonnegative integer or Boolean value. Represents a unit number.
If i is an integer, i must be of KIND=8 on UNICOS and UNICOS/mk systems, or of KIND=4
on IRIX systems.
LENGTH is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The value returned is of type default integer.
If the LENGTH function is called during the execution of asynchronous I/O with BUFFER IN or BUFFER
OUT, the execution sequence is delayed until the transfer is complete. LENGTH then returns the number of
words successfully transferred. On UNICOS and UNICOS/mk systems, the length is specified in Cray
words. On IRIX systems, the length is specified in the default word size.
Programs that transfer characters or data from a medium that supports partial-word I/O cannot detect partial-
word transfers. The return value is rounded up to a word count in these cases.
The return value is 0 under the following two conditions:
• An end-of-file or error occurs
• It is following a read or write of a zero-length record.
UNIT(3I) should be used prior to LENGTH to properly distinguish these previous two cases.

186 004– 2138– 003


LENGTH ( 3I ) LENGTH ( 3I )

EXAMPLES

PROGRA M PGM
DIMENS ION V(1 638 4)
10 BUF FER IN (32 ,-1 ) (V( 1), V(1 638 4))
X= UNIT(3 2)
K= LENGTH (32 )
IF (X .GE . 0.0 ) GOTO 14
11 DO 12 I=1 ,K, 1
12 IF (V(I) .EQ . ’KE Y’) GOT O 13
IF (X .EQ . -1. 0) GOTO 10
STO P
13 ...
...
14 CONTIN UE
END

SEE ALSO
UNIT(3I)

004– 2138– 003 187


LEN_TRIM ( 3I ) LEN_TRIM ( 3I )

NAME
LEN_TRIM – Returns the length of the character argument without counting trailing blank characters

SYNOPSIS
LEN_TRIM ([STRING=]string)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The LEN_TRIM intrinsic function returns the length of the character argument without counting trailing
blank characters. It accepts the following argument:
string Must be of type character
LEN_TRIM is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type is default integer. The result has a value equal to the number of characters remaining after
any trailing blanks in string are removed. If the argument contains no nonblank characters, the result is 0.

EXAMPLES
LEN_TRIM(’ A B ’) yields 4.
LEN_TRIM(’ ’) yields 0.

188 004– 2138– 003


LGE ( 3I ) LGE ( 3I )

NAME
LGE, LGT, LLE, LLT – Compares strings lexically

SYNOPSIS
LGE ([STRING_A=]string_a, [STRING_B=]string_b)
LGT ([STRING_A=]string_a, [STRING_B=]string_b)
LLE ([STRING_A=]string_a, [STRING_B=]string_b)
LLT ([STRING_A=]string_a, [STRING_B=]string_b)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran

DESCRIPTION
Each of these type logical functions takes two character string arguments and returns a logical value.
string_a and string_b are compared according to the ASCII collating sequence, and the resulting true or false
value is returned.
string_a and string_b Must be of type default character
The defining equation for each function is as follows:
• For LGE, logic = a 1 is greater than or equal to a 2
• For LGT, logic = a 1 is greater than a 2
• For LLE, logic = a 1 is less than or equal to a 2
• For LLT, logic = a 1 is less than a 2
LGE, LGT, LLE, and LLT are elemental functions. The names of these intrinsics cannot be passed as
arguments.

RETURN VALUES
If the strings are of unequal length, the comparison is made as if the shorter string were extended on the
right with blanks to the length of the longer string. The return value of each intrinsic is as follows:
• LGE. The result is true if the strings are equal or if string_a follows string_b in the ASCII collating
sequence; otherwise, the result is false. Note that the result is true if both string_a and string_b are of
equal length; this includes zero-length strings.

004– 2138– 003 189


LGE ( 3I ) LGE ( 3I )

• LGT. The result is true if string_a follows string_b in the ASCII collating sequence; otherwise, it is
false. The result is false if both string_a and string_b are of zero length.
• LLE. The result is true if the strings are equal or if string_a precedes string_b in the ASCII collating
sequence; otherwise, it is false. Note that the result is true if both string_a and string_b are of equal
length; this includes zero-length strings.
• LLT. The result is true if string_a precedes string_b in the ASCII collating sequence; otherwise, it is
false. The result is false if both string_a and string_b are of zero length.

NOTES
When using the CF90 or MIPSpro 7 Fortran 90 compilers, the return value is of type default logical.

190 004– 2138– 003


LOC ( 3I ) LOC ( 3I )

NAME
LOC – Obtains the address of a variable

SYNOPSIS
LOC ([I=]i)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extension

DESCRIPTION
LOC returns the address of a variable, constant, or array. It accepts the following arguments:
i The variable for which the address is being requested. Specify a variable of any data type.
LOC can be used to define a Cray pointer. Just like a variable in common storage, a Cray pointee, Cray
pointer, or the argument to LOC is stored in memory before a call to an external procedure and is read out of
memory at its next reference. The variable is also stored before a RETURN or END statement of a
subprogram.
The name of this intrinsic cannot be passed as an argument.

WARNINGS
LOC is often used to compute the difference of two addresses as an offset. The offset is then used to access
one of the arrays by overindexing the other array. UNICOS/mk systems, unlike UNICOS systems, have
several address spaces (called memory segments), and memory references with offsets outside of the segment
are not allowed. If the arrays are in different memory segments, the corresponding offset generates memory
references outside of the segment. These references cause run-time Translation Not Valid errors.

RETURN VALUES
On UNICOS systems, the address returned is a word address. On UNICOS/mk and IRIX systems, the
address returned is a byte address.
On UNICOS and UNICOS/mk systems, the value returned is of type Cray Pointer. On IRIX systems, the
address returned is of type integer. If the -64 compiler option is in effect, the value returned is a KIND=8
value; otherwise, the value returned is a KIND=4 value.

004– 2138– 003 191


LOC ( 3I ) LOC ( 3I )

EXAMPLES
Example 1: Consider the following code:
SUB ROUTIN E SUB (N)
COMMON POO L(1000 00)
INT EGER BLK(12 8), WOR D64
REA L A(1 000), B(N ), C(1 000 00- N-1 000 )
POI NTER(P BLK,BL K), (IA ,A) ,(I B,B ),( IC, C), (AD DRE SS, WOR D64 )
DAT A ADD RESS /64 /
PBL K = 0
IA = LOC (POOL)
IB = IA + 1000
IC = IB + N

In effect, WORD64 in this example refers to the contents of absolute address 64; BLK is an array occupying
the first 128 words of memory; A is an array of length 1000 located in blank common; B follows A and is of
length N; C follows B. A, B, and C are associated with POOL. Similarly, WORD64 is the same as BLK(65),
because BLK(1) is at address 0.
Example 2: Consider the following code:
POI NTER (P,B), (P, C)
REA L X,B ,C
P = LOC (X)
B = 1.0
C = 2.0
PRI NT *,B

Because B and C have the same Cray pointer, the assignment of 2.0 to C gives the same value to B;
therefore, B prints as 2.0 even though it was assigned 1.0.

192 004– 2138– 003


LOG10 ( 3I ) LOG10 ( 3I )

NAME
LOG10, ALOG10, DLOG10, QLOG10 – Computes common logarithm

SYNOPSIS
LOG10 ([X=]x)
ALOG10 ([X=]x)
DLOG10 ([X=]x)
QLOG10 ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QLOG10

DESCRIPTION
LOG10 is the generic function name; the others are specifics. These are elemental intrinsic functions. These
functions accept the following argument:
x Must be type single precision, double precision, or quad precision. See the RETURN VALUES
section for information on input data types and return values.
These functions evaluate y = log 10 (x).
Vector versions of these intrinsics exist on some systems. Vector versions of ALOG10 and DLOG10
intrinsics exist on UNICOS and UNICOS/mk systems. On UNICOS/mk systems, the vector version of these
intrinsics is used when -O vector3 or -O3 are specified on the compiler command line. On UNICOS/mk
systems, the 64-bit intrinsic vectorizes; the 32-bit version does not. A vector version of the single-precision
and double-precision LOG10 intrinsic exists on IRIX systems and is used when -O3 is specified on the
compiler command line.

NOTES
The ALOG10 and DLOG10 intrinsic function names can be passed as arguments; the others cannot.
On Cray T90 systems that support IEEE arithmetic, the following return values occur:
• ALOG10(0) yields -infinity.
• ALOG10(-0) yields NaN.
• If -infinity ≤ x < 0, ALOG10(x) yields NaN.
• ALOG10(infinity) yields infinity.

004– 2138– 003 193


LOG10 ( 3I ) LOG10 ( 3I )

RETURN VALUES
LOG10 returns the real logarithm of its argument. The generic function LOG10 becomes a call to ALOG10,
DLOG10, or QLOG10 depending on the data type and kind of its argument.
ALOG10 returns the real common logarithm of its real argument.
DLOG10 returns the double-precision common logarithm of its double-precision argument.
QLOG10 returns the quad-precision common logarithm of its quad-precision argument.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

194 004– 2138– 003


LOG2_IMAGES ( 3I ) LOG2_IMAGES ( 3I )

NAME
LOG2_IMAGES – Returns the base 2 logarithm of the number of executing images truncated to an integer

SYNOPSIS
LOG2_IMAGES()

IMPLEMENTATION
UNICOS/mk systems
CF90

STANDARDS
Fortran extension

DESCRIPTION
LOG2_IMAGES is an intrinsic procedure that returns the base 2 logarithm of the number of executing
images, truncated to an integer. It is an inquiry function.

RETURN VALUES
The LOG2_IMAGES intrinsic function returns a scalar value of type default integer.

SEE ALSO
CF90 Co-array Programming Manual

004– 2138– 003 195


LOG ( 3I ) LOG ( 3I )

NAME
LOG, ALOG, DLOG, QLOG, CLOG, CDLOG, CQLOG – Computes natural logarithm

SYNOPSIS
LOG ([X=]x)
ALOG ([X=]x)
DLOG ([X=]x)
QLOG ([X=]x)
CLOG ([X=]x)
CDLOG ([X=]x)
CQLOG ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QLOG, CDLOG, CQLOG

DESCRIPTION
LOG is the generic function name; the others are specifics. These are elemental intrinsic functions. They
accept the following argument:
x For ALOG, DLOG, and QLOG, x must be greater than zero and of type real. For CLOG, CDLOG,
and CQLOG, x must be of type complex and not equal to (0.,0.). The type and kind type of
x is identical to the type and kind type of the return value. See the RETURN VALUES section
for information on input data types and return values.
Vector versions of these intrinsics exist on some systems. Vector versions of ALOG, DLOG, CLOG, and
CDLOG exist on UNICOS and UNICOS/mk systems. On UNICOS/mk systems, the vector versions of these
intrinsics are used when -O vector3 or -O3 are specified on the compiler command line. A vector
version of the single-precision and double-precision LOG intrinsic exists on IRIX systems and is used when
-O3 is specified on the compiler command line.
These functions evaluate y = ln(x).
CDLOG is called implicitly by as a result of a generic ALOG call with a complex double-precision argument.

196 004– 2138– 003


LOG ( 3I ) LOG ( 3I )

NOTES
The ALOG, DLOG, and CLOG intrinsic function names can be passed as arguments; the others cannot.
On Cray T90 systems that support IEEE arithmetic, the following return values occur:
• ALOG(0) yields -infinity.
• ALOG(-0) yields NaN.
• If -infinity ≤ x < 0, ALOG(x) yields NaN.
• ALOG(infinity) yields infinity.

RETURN VALUES
The generic function LOG becomes a call to one of the other functions depending on the type of its
argument.
ALOG returns the real natural logarithm of its real argument.
DLOG returns the double-precision natural logarithm of its double-precision argument.
QLOG returns the quad-precision natural logarithm of its quad-precision argument.
CLOG returns the complex natural logarithm of its complex argument. Its argument cannot equal (0.,0.).
The range of the imaginary part is -pi < imaginary_part ≤ pi.
CDLOG returns the complex double-precision natural logarithm of its complex double-precision argument.
CQLOG returns the complex quad-precision natural logarithm of its complex quad-precision argument.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

004– 2138– 003 197


LOGICAL ( 3I ) LOGICAL ( 3I )

NAME
LOGICAL – Converts between kinds of logical

SYNOPSIS
LOGICAL ([L=]l [,[KIND=]kind])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The LOGICAL intrinsic function converts between kinds of logical. It accepts the following arguments:
l Must be of type logical
kind An integer scalar value. Must be a scalar integer initialization expression
LOGICAL is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type is logical. If kind is present, the kind type parameter is that specified by kind; otherwise, the
kind type parameter is that of default logical. The value is that of l.

EXAMPLES
LOGICAL(L.OR..NOT.L) yields TRUE and is of type default logical, regardless of the kind type
parameter of the logical variable L.

198 004– 2138– 003


LONG ( 3I ) LONG ( 3I )

NAME
LONG – Returns integer (KIND=4) result

SYNOPSIS
LONG ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
LONG returns an integer (KIND=4) result for a given argument. This intrinsic accepts the following
argument:
a Must be of type integer, real, or complex.
This is an elemental function. The name of this intrinsic cannot be passed an an argument.

RETURN VALUES
The return value is an integer (KIND=4).

SEE ALSO
SHORT(3I)

004– 2138– 003 199


MALLOC ( 3I ) MALLOC ( 3I )

NAME
MALLOC, FREE – Allocates and deallocates main memory

SYNOPSIS
MALLOC ([N=]nbytes)
CALL FREE ([P=]iptr)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extension

DESCRIPTION
MALLOC and FREE provide a simple general-purpose memory allocation package. MALLOC returns a
pointer to a block of at least nbytes bytes suitably aligned for any use. MALLOC returns the first contiguous
region of free space found in a circular search from the last block allocated or freed, coalescing adjacent free
blocks as it searches. It calls sbrk(2) to get more memory from the system when there is no suitable space
already free.
FREE is a pointer to a block previously allocated by MALLOC. After FREE is performed, this space is made
available for further allocation, but its contents are left undisturbed.
As intrinsics, these are elemental functions. They accept the following arguments:
nbytes The amount to be allocated.
iptr A pointer to the block of memory to be freed.

RETURN VALUES
Undefined results occur if the space assigned by MALLOC is overrun or if some random number is handed to
FREE.
MALLOC returns a NULL pointer if there is no available memory or if the area has been detectably corrupted
by storing outside the bounds of a block. When this happens the block pointed to by iptr can be destroyed.

NOTES
For most MIPSpro 7 Fortran 90 and CF90 applications, MALLOC and FREE can be replaced by the
ALLOOCATE and DEALLOCATE Fortran statements. The statements are simpler and portable.

200 004– 2138– 003


MALLOC ( 3I ) MALLOC ( 3I )

Search time increases when many objects have been allocated; that is, if a program allocates but never frees,
then each successive allocation takes longer.
IRIX systems can be configured with virtual swap space. This allows processes to allocate more virtual
memory than is actually available, allowing the use of sparse addressing, successful forks and subsequent
exec(2)s by programs larger than 1/2 the available virtual memory, and so forth. Thus programs using
MALLOC can get a successful return. Later, however the system may generate a SIGKILL signal if virtual
memory was overcommitted and processes attempt to actually use all of the overcommitted memory. If the
system has no virtual swap space configured, then processes are limited to using no more virtual memory
than the sum of physical memory and swap space. See the swap(1M) man page for more information.

SEE ALSO
swap(1M)
exec(2), sbrk(2)

004– 2138– 003 201


MASK ( 3I ) MASK ( 3I )

NAME
_mask, _maskl, _maskr, MASK – Returns a bit mask

SYNOPSIS
C/C++:
#include <intrinsics.h>
long _mask (long i);
long _maskl (long i);
long _maskr (long i);
Fortran:
MASK ([I=]i)

IMPLEMENTATION
C/C++: UNICOS and UNICOS/mk systems
Fortran: UNICOS, UNICOS/mk, and IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION

C++
The _mask function forms a mask of bits set to 1, left-justified or right-justified. If 0 ≤ i ≤ 63, a
left-justified mask of bits set to 1, i bits long, is formed. Otherwise, a right-justified mask of bits set to 1,
(128 – i) bits long, is formed. Value i must be in the range of 0 through 128.
The _maskl function returns a left-justified mask of i bits set to 1. Value i must be in the range of 0
through 64.
The _maskr function returns a right-justified mask of i bits set to 1. Value i must be in the range of 0
through 64.
Because these are intrinsic functions, no externally visible library functions are available for them. The
compiler generates inline code to produce the result.

202 004– 2138– 003


MASK ( 3I ) MASK ( 3I )

Fortran
The MASK function returns a bit mask of 1’s.
On UNICOS systems, the argument is a 64-bit integer.
On UNICOS/mk systems, the argument is a 32-bit or 64-bit integer.
On IRIX systems, the argument is an 8-bit, 16-bit, 32-bit, or 64-bit integer.
It accepts the following argument:
i In Fortran, this must be an integer argument, as follows:
• If i is an 8-bit object, i must be in the range 0 ≤ i ≤ 16.
• If i is a 16-bit object, i must be in the range 0 ≤ i ≤ 32.
• If i is a 32-bit object, i must be in the range 0 ≤ i ≤ 64.
• If i is a 64-bit object, i must be in the range 0 ≤ i ≤ 128.
MASK is an elemental function. The name of this function cannot be passed as an argument.
This is an outmoded routine. Refer to the Fortran Language Reference Manual, Volume 2, for information
about outmoded features and their preferred standard alternatives.

RETURN VALUES
In C/C++, the mask functions return a 64-bit object.
In Fortran, MASK returns a Boolean result on UNICOS and UNICOS/mk systems. It returns an integer result
on IRIX systems.
When i is a 64-bit object, the return values are of the following form:
• If i is in the range 0 ≤ i ≤ 64, a left-justified mask of i bits is returned.
• If i is in the range 65 ≤ i ≤ 128, a right-justified mask of (128 - i) bits is returned.
When i is a 32-bit object, the return values are of the following form:
• If i is in the range 0 ≤ i ≤ 32, a left-justified mask of i bits is returned.
• If i is in the range 33 ≤ i ≤ 64, a right-justified mask of (64 - i) bits is returned.
When i is a 16-bit object, the return values are of the following form:
• If i is in the range 0 ≤ i ≤ 16, a left-justified mask of i bits is returned.
• If i is in the range 17 ≤ i ≤ 32, a right-justified mask of (32 - i) bits is returned.
When i is a 8-bit object, the return values are of the following form:
• If i is in the range 0 ≤ i ≤ 8, a left-justified mask of i bits is returned.
• If i is in the range 7 ≤ i ≤ 16, a right-justified mask of (16 - i) bits is returned.

004– 2138– 003 203


MASK ( 3I ) MASK ( 3I )

EXAMPLES
Fortran: The following section of Fortran code shows the MASK function used with several different
arguments. The bit patterns of the results are given.
INTEGE R I1, I2, I3
...
I1 = MAS K(3)
I2 = MAS K(64)
I3 = MAS K(127)

--- ------ ------ --- --- --- --- --- --- --- --- --- --- --- --- --
| 1 | 1 | 1 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 |
--- ------ ------ --- --- --- --- --- --- --- --- --- --- --- --- --
I1

--- ------ ------ --- --- --- --- --- --- --- --- --- ---
| 1 | 1 | 1 | 1 | ... | 1 | 1 | 1 | 1 |
--- ------ ------ --- --- --- --- --- --- --- --- --- ---
I2

--- ------ ------ --- --- --- --- --- --- --- --- --- ---
| 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 1 |
--- ------ ------ --- --- --- --- --- --- --- --- --- ---
I3

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

204 004– 2138– 003


MATMUL ( 3I ) MATMUL ( 3I )

NAME
MATMUL – Performs matrix multiplication of numeric or logical matrices

SYNOPSIS
MATMUL ([MATRIX_A=]matrix_a, [MATRIX_B=]matrix_b)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MATMUL intrinsic function performs matrix multiplication operations on numeric or logical matrices. It
accepts the following arguments:
matrix_a Must be of numeric type (integer, real, or complex) or of logical type. It must be array valued
and of rank one or two.
matrix_b Must be of numeric type if matrix_a is of numeric type and of logical type if matrix_a is of
logical type. It must be array valued and of rank one or two. If matrix_a has rank one,
matrix_b must have rank two. If matrix_b has rank one, matrix_a must have rank two. The
size of the first (or only) dimension of matrix_b must equal the size of the last (or only)
dimension of matrix_a.
MATMUL is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type, type parameter, and shape are as follows. If the arguments are of numeric type, the type and
kind type parameter of the result are determined by the types of the arguments. If the arguments are of type
logical, the result is of type logical with the kind type parameter of the arguments. The shape of the result
depends on the shapes of the arguments, as follows:
• If matrix_a has shape (n, m) and matrix_b has shape (m, k), the result has shape (n, k).
• If matrix_a has shape (m) and matrix_b has shape (m, k), the result has shape (k).
• If matrix_a has shape (n, m) and matrix_b has shape (m), the result has shape (n).
Element (i, j) of the result has the value SUM(MATRIX_A(i,:)*MATRIX_B(:,j)) if the arguments are of
numeric type and has the value ANY(MATRIX_A(i,:).AND.MATRIX_B(:,j)) if the arguments are of
logical type.

004– 2138– 003 205


MATMUL ( 3I ) MATMUL ( 3I )

Element (j) of the result has the value SUM(MATRIX_A(:)*MATRIX_B(:,j)) if the arguments are of
numeric type and has the value ANY(MATRIX_A(:).AND.MATRIX_B(:,j)) if the arguments are of
logical type.
Element (i) of the result has the value SUM(MATRIX_A(i,:)*MATRIX_B(:)) if the arguments are of
numeric type and has the value ANY(MATRIX_A(i,:).AND.MATRIX_B(:)) if the arguments are of
logical type.

EXAMPLES
Let A and B be the following matrices:
 123
 234
and
 12
 23
 24
Let X and Y be vectors [1,2] and [1,2,3].
MATMUL(A,B) yields the matrix-matrix product AB, as follows:
 11 20 
 16 29 
MATMUL(X,A) yields the vector-matrix product XA with the value [5,8,11].
MATMUL(A,Y) yields the matrix-vector product AY with the value [14,20].

206 004– 2138– 003


MAX ( 3I ) MAX ( 3I )

NAME
MAX, MAX0, AMAX1, DMAX1, QMAX1, MAX1, AMAX0 – Returns maximum values

SYNOPSIS
MAX0 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
AMAX1 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
DMAX1 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
QMAX1 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
MAX1 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
AMAX0 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QMAX1

DESCRIPTION
The MAX, MAX0, AMAX1, DMAX1, QMAX1, MAX1, and AMAX0 intrinsic functions determine maximum
values. MAX is the generic name; the others are specifics. They accept the following arguments:
a1, a2, a3, . . .
The arguments must be all of type real or all of type integer. All arguments must have the same data
type.
The kind types of the arguments can differ. This is an extension to the Fortran standard.
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

NOTES
On UNICOS systems, both execution speed and the number of bits used in mathematical operations are
affected when compiling with f90 -O fastint, which is the default setting. For more information, see
CF90 Commands and Directives Reference Manual.

004– 2138– 003 207


MAX ( 3I ) MAX ( 3I )

RETURN VALUES
The value of the result is that of the largest argument.
MAX accepts type real or integer and returns a result with the same type and kind type as its arguments.
MAX0 accepts and returns type integer.
AMAX1 accepts and returns type single-precision real.
DMAX1 accepts and returns type double-precision real.
QMAX1 accepts and returns type quad-precision real.
MAX1 accepts type real and returns type default integer.
AMAX0 accepts type integer and returns type default real.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

EXAMPLES
MAX(-9.0,7.0,2.0) yields 7.0.

208 004– 2138– 003


MAXEXPONENT ( 3I ) MAXEXPONENT ( 3I )

NAME
MAXEXPONENT – Returns the maximum exponent in the numeric model

SYNOPSIS
MAXEXPONENT ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MAXEXPONENT intrinsic function returns the maximum exponent in the real number model. For more
information on the real number model, see the MODELS(3I) man page. It accepts the following argument:
x Must be of type real. It may be scalar or array valued.
MAXEXPONENT is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a default integer scalar. The result has the value e max , as defined in the model, which
represents numbers of the same type and kind type parameter as x.

EXAMPLES
On UNICOS systems, excluding Cray T90 systems that support IEEE floating-point arithmetic,
MAXEXPONENT(X) has the value 8189 for real X.
On IRIX systems, MAXEXPONENT(X) yields the following values:
• 128 for real X
• 128 for real (KIND=4) X
• 1024 for real (KIND=8) X
On UNICOS/mk systems, MAXEXPONENT(X) yields the following values:
• 1024 for real X
• 128 for real (KIND=4) X
• 1024 for real (KIND=8) X

004– 2138– 003 209


MAXEXPONENT ( 3I ) MAXEXPONENT ( 3I )

On Cray T90 systems that support IEEE floating-point arithmetic, MAXEXPONENT(X) yields the following
values:
• 1024 for real X
• 128 for real (KIND=4) X
• 1024 for real (KIND=8) X
• 16384 for real (KIND=16) X

SEE ALSO
MODELS(3I)

210 004– 2138– 003


MAXLOC ( 3I ) MAXLOC ( 3I )

NAME
MAXLOC – Returns the location of a maximum value in an array

SYNOPSIS
MAXLOC ([ARRAY=]array [,[DIM=]dim] [,[MASK=]mask])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MAXLOC intrinsic function returns the location of the first element of array having the maximum value
of the elements identified by mask. It accepts the following arguments:
array Must be of type integer or real. It must not be scalar.
dim Must be a scalar integer value in the range 1 ≤ dim ≤ n, where n is the rank of array. The
corresponding actual argument must not be an optional dummy argument.
mask Must be of type logical and must be conformable with array.
MAXLOC is a transformational function. The name of this intrinsic cannot be passed as an argument.

NOTES
On UNICOS systems, both execution speed and the number of bits used in mathematical operations are
affected when compiling with f90 -O fastint, which is the default setting. For more information, see
CF90 Commands and Directives Reference Manual.

RETURN VALUES
The result is an integer of type default integer, of rank one, with size equal to the rank of array.
The result of MAXLOC(array) is a rank one array whose element values are the values of the subscripts of
an element of array whose value equals the maximum value of all of the elements of array. The ith
subscript returned lies in the range 1 to e i , where e i is the extent of the ith dimension of array. If more than
one element has the maximum value, the element whose subscripts are returned is the first such element,
taken in array element order. If array has size 0, the value of the result is undefined.

004– 2138– 003 211


MAXLOC ( 3I ) MAXLOC ( 3I )

The result of MAXLOC(array,MASK=mask) is a rank one array whose element values are the values of the
subscripts of an element of array, corresponding to a true element of mask whose value equals the maximum
value of all such elements of array. The ith subscript returned lies in the range 1 to e i , where e i is the
extent of the ith dimension of array. If more than one such element has the maximum value, the element
whose subscripts are returned is the first such element taken in array element order. If there are no such
elements (that is, if array has size 0 or if every element of mask has the value false), the value of the result
is undefined.
If array has rank one, the result of MAXLOC(array, DIM=dim [, MASK=mask]) is a scalar with a value
that is the same as that of the first element of MAXLOC(array [, MASK=mask]). Otherwise, the value of
element (s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ) of the result is equal to
MAXLOC(array(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n ), DIM=1
[, MASK=mask(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )]).
An element of the result is undefined if the value cannot be represented as an integer.

EXAMPLES
Example 1: MAXLOC((/2,6,4,6/)) yields [2].
Example 2: Assume that array B is declared as follows:
INT EGER, DIMENS ION (4:7) :: B = (/ 8,6 ,3, 1/)

MAXLOC(B) yields [1].


Example 3: Assume that array A is as follows:
 0 –5 8 –3 
 3 4 –1 2 
 1 5 6 –4 
The following are true:
• MAXLOC(A) yields [1,3].
• MAXLOC(A,MASK=A.LT.6) yields [3,2].
Using array section references, the following are true:
• MAXLOC(A(2:3,2:4)) yields [2,2].
• MAXLOC(A(2:3,2:4),MASK=A(2:3,2:4).LT.6) yields [2,1].
Example 4: Assume that B is array [100,2,5,7,1,90,0,20,-1,80].
The following are true of this array:
• MAXLOC(B(10:1:-1)) yields [10].
• MAXLOC(B(10:1:-2)) yields [3].

212 004– 2138– 003


MAXLOC ( 3I ) MAXLOC ( 3I )

Example 5: MAXLOC((/5,-9,3/)DIM=1) yields 1.


Example 6: Assume that C is following array:
 1 3 -9 
 22 6
The following are true of this array:
• MAXLOC(C,DIM=1) yields [2,1,2].
• MAXLOC(C,DIM=2) yields [2,3].
• MAXLOC(C) yields [2,3].

004– 2138– 003 213


MAXVAL ( 3I ) MAXVAL ( 3I )

NAME
MAXVAL – Returns the maximum value in an array

SYNOPSIS
MAXVAL ([ARRAY=]array [,[DIM=]dim] [,[MASK=]mask])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MAXVAL intrinsic function can be used for array reduction. It returns the maximum value of the
elements of array along dimension dim corresponding to the true elements of mask. It accepts the following
arguments:
array Must be of type integer or real. It must not be scalar.
dim Must be a scalar integer value in the range 1 ≤ dim ≤ n, where n is the rank of array. The
corresponding actual argument must not be an optional dummy argument.
mask This optional argument must be of type logical and must be conformable with array.
MAXVAL is a transformational intrinsic function. The name of this intrinsic cannot be passed as an
argument.

NOTES
On UNICOS systems, both execution speed and the number of bits used in mathematical operations are
affected when compiling with f90 -O fastint, which is the default setting. For more information, see
CF90 Commands and Directives Reference Manual.

RETURN VALUES
The result is of the same type as array. It is scalar if dim is absent or array has rank one. Otherwise, the
result is an array of rank n– 1 and of shape (d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ), where (d 1 , d 2 , . . ., d n ) is the
shape of array.
The result of MAXVAL(array) has a value equal to the maximum value of all the elements of array or has
the value of the negative number of the largest magnitude supported for numbers of the data type of array if
array is a zero-sized array.

214 004– 2138– 003


MAXVAL ( 3I ) MAXVAL ( 3I )

The result of MAXVAL(array,MASK=mask) has a value equal to the maximum value of all the elements of
array corresponding to true elements of mask or has the value of the negative number of the largest
magnitude supported for numbers of the data type of array if there are no true elements.
If array has rank one, MAXVAL(array,dim[,mask]) has a value equal to that of
MAXVAL(array[,MASK=mask]). Otherwise, the value of element (s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ) of
MAXVAL(array,dim[,mask]) is equal to MAXVAL(array(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )
[, MASK=mask(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )]).
On UNICOS and UNICOS/mk systems, MAXVAL returns the value of -HUGE(array) for all zero-sized
arrays. On IRIX systems, MAXVAL returns the value of -INFINITY for real, zero-sized arrays. A request
for interpretation of the Fortran 95 standard may change one of these return values for a real array in a
future release.

EXAMPLES
Example 1: MAXVAL((/1,2,3/)) yields 3.
Example 2: Assume that C is array [10,-100,10]. Then MAXVAL(C,MASK=C.LT.0.0) finds the
maximum of the negative elements of C (which is -100) and MAXVAL(C,MASK=C.GT.10) returns a
negative number of the largest possible integer because there are no true elements using the mask.
Example 3: Assume that B is the following array:
 135
 246
The following are true:
• MAXVAL(B,DIM=1) yields [2,4,6].
• MAXVAL(B,DIM=2) yields [5,6].
• MAXVAL(B) yields 6.
Example 4: Assume that N is the following array:
 0123
 4567
 8901
The following are true:
• MAXVAL(N(2:3,2:4),MASK=N(2:3,2:4).NE.0) yields 9.
• MAXVAL(N(2:3,2:4),DIM=1,N(2:3,2:4).NE.0) yields [9,6,7].
• MAXVAL(N(2:3,2:4),DIM=2,N(2:3,2:4).NE.0) yields [7,9].

004– 2138– 003 215


MEMORY_BARRIER ( 3I ) MEMORY_BARRIER ( 3I )

NAME
_memory_barrier, MEMORY_BARRIER – Blocks subsequent memory load and store operations until all
previous loads and stores finish

SYNOPSIS
C/C++:
void _memory_barrier (void);
Fortran:
MEMORY_BARRIER ()

IMPLEMENTATION
UNICOS/mk systems
Cray C/C++, CF90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
This intrinsic guarantees that subsequent loads and stores do not access memory until after previous loads
and stores finish accessing memory.

NOTES

C/C++
Because _memory_barrier is an intrinsic function, no externally visible library function is available for
it. The compiler generates inline code to produce the result.
Fortran
The name of this intrinsic cannot be passed as an argument.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

216 004– 2138– 003


MERGE ( 3I ) MERGE ( 3I )

NAME
MERGE – Chooses an alternative value according to the value of a mask

SYNOPSIS
MERGE ([TSOURCE=]tsource, [FSOURCE=]fsource, [MASK=]mask)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MERGE intrinsic function can be used for array construction. It chooses an alternative value according
to the value of mask. This function accepts the following arguments:
tsource May be of any type
fsource Must be of the same type and type parameters as tsource
mask Must be of type logical
MERGE is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result has the same type and type parameters as tsource. The result is tsource if mask is true and
fsource otherwise.

EXAMPLES
Example 1: Assume that TSOURCE, FSOURCE, and MASK are arrays. Array TSOURCE is as follows:
 165
 246
Array FSOURCE is as follows:
 032
 748
Array MASK is as follows:

004– 2138– 003 217


MERGE ( 3I ) MERGE ( 3I )

 TFT
 FFT
Also assume that the letter T represents the value TRUE and the letter F represents the value FALSE. The
statement MERGE(TSOURCE,FSOURCE,MASK) generates the following:
 135
 746
Example 2: MERGE(1.0,0,0,K>0) yields [1.0] for K = 5.
Example 3: MERGE(1.0,0,0,K>0) yields [0.0] for K = -2.

218 004– 2138– 003


MIN ( 3I ) MIN ( 3I )

NAME
MIN, MIN0, AMIN1, DMIN1, QMIN1, MIN1, AMIN0 – Returns minimum values

SYNOPSIS
MIN0 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
AMIN1 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
DMIN1 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
QMIN1 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
MIN1 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )
AMIN0 ([A1=]a1, [A2=]a2 [,[A3=]a3] . . . )

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QMIN1

DESCRIPTION
The MIN, MIN0, AMIN1, DMIN1, QMIN1, MIN1, and AMIN0 intrinsic functions find minimum values.
MIN is the generic name; the others are specifics. They accept the following arguments:
a1, a2, a3, . . .
The arguments must be all of type real or all of type integer. All arguments must have the same
data type.
The kind types of the arguments can differ. This is an extension to the Fortran standard.
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

NOTES
On UNICOS systems, both execution speed and the number of bits used in mathematical operations are
affected when compiling with f90 -O fastint, which is the default setting. For more information, see
CF90 Commands and Directives Reference Manual.

RETURN VALUES
The value of the result is that of the smallest argument.

004– 2138– 003 219


MIN ( 3I ) MIN ( 3I )

MIN accepts type real or integer and returns a result with the same type and kind type as its arguments.
MIN0 accepts and returns type integer.
AMIN1 accepts and returns type single-precision real.
DMIN1 accepts and returns type double-precision real.
QMIN1 accepts and returns type quad-precision real.
MIN1 accepts type real and returns type default integer.
AMIN0 accepts type integer and returns type default real.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

EXAMPLES
MIN(-9.0,7.0,2.0) yields -9.0.

220 004– 2138– 003


MINEXPONENT ( 3I ) MINEXPONENT ( 3I )

NAME
MINEXPONENT – Returns the minimum (most negative) exponent of a real number in the numeric model

SYNOPSIS
MINEXPONENT ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MINEXPONENT intrinsic function returns the minimum (most negative) exponent of a real number in
the numeric model representing numbers of the same type and kind type parameter as the argument. The
real number model is defined in the MODELS(3I) man page. It accepts the following argument:
x Must be of type real. It can be scalar or array valued.
MINEXPONENT is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a default integer scalar. The result has the value e min as defined in the model, which represents
numbers of the same type and kind type parameter as x.

EXAMPLES
On UNICOS systems, except for Cray T90 systems that support IEEE floating-point arithmetic,
MINEXPONENT(X) has the value – 8188 for real X.
On IRIX systems, MINEXPONENT(X) has the following values:
• – 125 for real (KIND=4) X
• – 1021 for real (KIND=8) X
• – 967 for real (KIND=16) X
On Cray T90 systems that support IEEE floating-point arithmetic, MINEXPONENT(X) has the following
values:
• – 125 for real (KIND=4) X
• – 1021 for real (KIND=8) X
• – 16381 for real (KIND=16) X

004– 2138– 003 221


MINEXPONENT ( 3I ) MINEXPONENT ( 3I )

On UNICOS/mk systems, MINEXPONENT(X) has the following values:


• – 125 for real (KIND=4) X
• – 1021 for real (KIND=8) X
SEE ALSO
MODELS(3I)

222 004– 2138– 003


MINLOC ( 3I ) MINLOC ( 3I )

NAME
MINLOC – Returns the location of a minimum value in an array

SYNOPSIS
MINLOC ([ARRAY=]array [,[DIM=]dim] [,[MASK=]mask])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MINLOC intrinsic function can be used for array location. It returns the location of the first element of
array that has the minimum value of the elements identified by mask. It accepts the following arguments:
array Must be of type integer or real. It must not be scalar.
dim Must be a scalar integer value in the range 1 ≤ dim ≤ n, where n is the rank of array. The
corresponding actual argument must not be an optional dummy argument.
mask Must be of type logical and must be conformable with array.
MINLOC is a transformational function. The name of this intrinsic cannot be passed as an argument.

NOTES
On UNICOS systems, both execution speed and the number of bits used in mathematical operations are
affected when compiling with f90 -O fastint, which is the default setting. For more information, see
CF90 Commands and Directives Reference Manual.

RETURN VALUES
The result is an integer array of type default integer, of rank one, with size equal to the rank of array.
The result of MINLOC(array) is a rank-one array whose element values are the values of the subscripts of
an element of array whose value equals the minimum value of all of the elements of array. The ith
subscript returned lies in the range 1 to e i , where e i is the extent of the ith dimension of array. If more than
one element has the minimum value, the element whose subscripts are returned is the first such element,
taken in array element order. If array has size zero, the value of the result is undefined.

004– 2138– 003 223


MINLOC ( 3I ) MINLOC ( 3I )

The result of MINLOC(array,MASK=mask) is a rank-one array whose element values are the values of the
subscripts of an element of array, corresponding to a true element of mask whose value equals the minimum
value of all such elements of array. The ith subscript returned lies in the range 1 to e i , where e i is the
extent of the ith dimension of array. If more than one such element has the minimum value, the element
whose subscripts are returned is the first such element taken in array element order. If there are no such
elements (that is, if array has size zero or every element of mask has the value false), the value of the result
is undefined.
If array has rank one, the result of MINLOC(array, DIM=dim [, MASK=mask]) is a scalar with a value
that is the same as that of the first element of MINLOC(array [, MASK=mask]). Otherwise, the value of
element (s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ) of the result is equal to
MINLOC(array(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n ), DIM=1
[, MASK=mask(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )]).
An element of the result is undefined if the value cannot be represented as an integer.

EXAMPLES
Example 1: MINLOC((/4,3,6,3/)) yields [2].
Example 2: Assume that array B is declared as follows:
INT EGER, DIMENS ION (4:7) :: B = (/8 ,6, 3,1 /)

MINLOC(B) yields [4].


Example 3: Assume that array A is as follows:
 0 -5 8 -3 
 3 4 -1 2 
 1 5 6 -4 
The following are true:
• MINLOC(A) yields [1,2].
• MINLOC(A,MASK=A.GT.-4) yields [1,4].
Using array section references, the following are true:
• MINLOC(A(2:3,2:4)) yields [2,3].
• MINLOC(A(2:3,2:4),MASK=A(2:3,2:4).GT.-4) yields [1,2].
Example 4: Assume that B is array [100,2,5,7,1,90,0,20,-1,80].
The following are true:
• MINLOC(B(10:1:-1)) yields 2.
• MINLOC(B(10:1:-2)) yields 5.

224 004– 2138– 003


MINLOC ( 3I ) MINLOC ( 3I )

Example 5: MINLOC((/5,-9,3/),DIM=1) yields 2.


Example 6: Assume that C is the following array:
 1 3 -9 
 22 6
The following are true of this array:
• MINLOC(C,DIM=1) yields [1,2,1].
• MINLOC(C,DIM=2) yields [3,1].
• MINLOC(C) yields [3,1].

004– 2138– 003 225


MINVAL ( 3I ) MINVAL ( 3I )

NAME
MINVAL – Returns the minimum value in an array

SYNOPSIS
MINVAL ([ARRAY=]array [,[DIM=]dim] [,[MASK=]mask])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MINVAL intrinsic function can be used for array reduction. It returns the minimum value of the
elements of array along dimension dim corresponding to the true elements of mask. It accepts the following
arguments:
array Must be of type integer or real. It must not be scalar.
dim Must be a scalar integer value in the range 1 ≤ dim ≤ n, where n is the rank of array. The
corresponding actual argument must not be an optional dummy argument.
mask Must be of type logical and must be conformable with array.
MINVAL is a transformational intrinsic function. The name of this intrinsic cannot be passed as an
argument.

NOTES
On UNICOS systems, both execution speed and the number of bits used in mathematical operations are
affected when compiling with f90 -O fastint, which is the default setting. For more information, see
CF90 Commands and Directives Reference Manual.

RETURN VALUES
The result is of the same type as array. It is scalar if dim is absent or array has rank one. Otherwise, the
result is an array of rank n– 1 and of shape (d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ), where (d 1 , d 2 , . . ., d n ) is the
shape of array.
The result of MINVAL(array) has a value equal to the minimum value of all the elements of array or has
the value of the positive number of the largest magnitude supported for numbers of the data type of array if
array is a zero-sized array.

226 004– 2138– 003


MINVAL ( 3I ) MINVAL ( 3I )

The result of MINVAL(array,MASK=mask) has a value equal to the minimum value of all the elements of
array corresponding to true elements of mask or has the value of the positive number of the largest
magnitude supported for numbers of the data type of array if there are no true elements.
If array has rank one, MINVAL(array,dim[,mask]) has a value equal to that of
MINVAL(array[,MASK=mask]). Otherwise, the value of element (s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ) of
MINVAL(array,dim[,mask]) is equal to MINVAL(array(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n ),
[, MASK=mask(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )]).
On UNICOS and UNICOS/mk systems, MINVAL returns the value of +HUGE(array) for all zero-sized
arrays. On IRIX systems, MINVAL returns the value of +INFINITY for real, zero-sized arrays. A request
for interpretation of the Fortran 95 standard may change one of these return values for a real array in a
future release.

EXAMPLES
Example 1: MINVAL((/1,2,3/)) yields 1.
Example 2: Assume that C is array [10,-100,10]. MINVAL(C,MASK=C.LT.0) yields the minimum
of the negative elements of C, which is -100. MINVAL(C,MASK=C.GT.10) returns the largest possible
integer because there are no true elements using the mask.
Example 3: Assume that B is the following array:
 135
 246
The following are true:
• MINVAL(B,DIM=1) yields [1,3,5].
• MINVAL(B,DIM=2) yields [1,2].
• MINVAL(B) yields 1.
Example 4: Assume that N is the following array:
 0123
 4567
 8901
In an array section reference, the following are true:
• MINVAL(N(2:3,2:4),MASK=N(2:3,2:4).NE.0) yields 1.
• MINVAL(N(2:3,2:4),DIM=1,N(2:3,2:4).NE.0) yields [5,6,1].
• MINVAL(N(2:3,2:4),DIM=2,N(2:3,2:4).NE.0) yields [5,1].

004– 2138– 003 227


MOD ( 3I ) MOD ( 3I )

NAME
MOD, AMOD, DMOD, QMOD, IMOD, JMOD, KMOD – Computes remainder

SYNOPSIS
MOD ([A=]a,[P=]p)
AMOD ([A=]a,[P=]p)
DMOD ([A=]a,[P=]p)
QMOD ([A=]a,[P=]p)
IMOD ([A=]a,[P=]p)
JMOD ([A=]a,[P=]p)
KMOD ([A=]a,[P=]p)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: IMOD, JMOD, KMOD, QMOD

DESCRIPTION
These intrinsic functions compute the remainder of a / p. MOD is the generic function name; the others are
specifics. These are elemental intrinsic functions. They accept the following arguments:
a Must be of type integer or real.
p Must be of the same type and kind type as a. The result is undefined if p is zero.
These functions evaluate y = a - p * INT(a/p).

NOTES
The MOD, AMOD, and DMOD intrinsic function names can be passed as arguments; the others cannot.

RETURN VALUES
MOD returns the integer remainder of its integer arguments.
AMOD returns the single-precision real remainder of its single-precision real arguments.
DMOD returns the double-precision real remainder of its double-precision real arguments.

228 004– 2138– 003


MOD ( 3I ) MOD ( 3I )

QMOD returns the quad-precision real remainder of its quad-precision real arguments.
IMOD returns the integer (KIND=2) remainder of its integer (KIND=2) arguments.
JMOD returns the integer (KIND=4) remainder of its integer (KIND=4) arguments.
KMOD returns the integer (KIND=8) remainder of its integer (KIND=8) arguments.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

EXAMPLES
The following examples show the results of calling MOD with all possible combinations of positive and
negative integers:
• MOD(7,4) yields 3.
• MOD(-7,4) yields -3.
• MOD(7,-4) yields 3.
• MOD(-7,-4) yields -3.

004– 2138– 003 229


MODELS ( 3I ) MODELS ( 3I )

NAME
MODELS – Describes mathematical representation models for CF90 and MIPSpro 7 Fortran 90 compiler
intrinsic procedures

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION

The compilers implement the intrinsic procedures according to the representation models described in the
Fortran standard. The Fortran standard describes a bit model, an integer model, and a real number model.
For more information on these models, see the Fortran Language Reference Manual, Volume 2.
Bit model
The bit model interprets a nonnegative scalar data object of type integer as a sequence of binary digits (bits).
In the model, w k has a value of 0 or 1. A bit is defined to be a binary digit w located at position k of a
nonnegative integer scalar object, which is based on the following nonnegative integer model:
s −1
Σ
k
j= wk2
k =0
Object Definition
j The integer value.
s The number of bits in the model. The bits are numbered from right to left beginning with 0.
wk A bit is a binary digit, w, located at position k. Either 0 or 1.
For 64-bit integers, the values in the model are as follows:
Object Value
s 64
k 0 through 63
On UNICOS systems, a 46-bit integer is stored in a 64-bit storage container.
For 32-bit integers, the values are as follows:
Object Value
s 32
k 0 through 31

230 004– 2138– 003


MODELS ( 3I ) MODELS ( 3I )

You can use the BIT_SIZE intrinsic function to determine the value of s in the model.
The bit manipulation functions are based upon this bit model. The model deals only with nonnegative
integers interpreted through these functions and the MVBITS subroutine. It is not necessarily related to the
implementation of the integer data type. It also is independent of the binary, octal, and hexadecimal (BOZ)
constants described in the Fortran Language Reference Manual, Volume 1.
Integer model
The integer number system model is as follows:
q
i = s × Σ wkr
k-1

k =1
This equation assumes the following definitions:
Object Definition
i The integer value.
s The sign. Either +1 or – 1.
r The radix. An integer greater than 1.
q The number of digits. An integer greater than 0.
wk The kth digit. An integer 0 ≤ w k < r.
For 64-bit integers, the values in the model are as follows:
Object Value
r 2
q 63
k An integer 1 ≤ k ≤ 63, and the sign bit
For 32-bit integers on UNICOS/mk and IRIX systems, the values in the model are as follows:
Object Value
r 2
q 31
k An integer 1 ≤ k ≤ 31, and the sign bit
For 8-bit integers on IRIX systems, the values in the model are as follows:
Object Value
r 2
q 7
k An integer 1 ≤ k ≤ 7, and the sign bit

004– 2138– 003 231


MODELS ( 3I ) MODELS ( 3I )

For 16-bit integers on IRIX systems, the values in the model are as follows:
Object Value
r 2
q 15
k An integer 1 ≤ k ≤ 15, and the sign bit
The values shown for the integer number system model can be retrieved through the DIGITS, RANGE, and
RADIX numeric inquiry intrinsic functions. The DIGITS function returns the number of significant digits
(q) for an integer in the model, and the RANGE function returns the decimal number of significant digits.
The RADIX function returns the base of the model (r).
The HUGE numeric inquiry intrinsic function returns the largest positive number in the integer number
system model.
Real model
The real number system model is as follows:
x=0
or
p

Σ
e -k
x=s×b × fkb
k =1
This equation assumes the following definitions:
Object Definition
x The real value.
s The sign. Either +1 or – 1.
b The base (real radix). An integer greater than 1.
e An integer between some minimum and maximum value.
p The number of mantissa digits. An integer greater than 1.
fk The kth digit. An integer 1 ≤ f k < b. f 1 can be 0 only if all f k are 0.
For 128-bit real numbers on UNICOS systems, the values in the model are as follows:
Object Value
b 2
e max 8189
e min – 8188
p 95
k An integer 1 ≤ k ≤ 95

232 004– 2138– 003


MODELS ( 3I ) MODELS ( 3I )

For 128-bit real numbers on IRIX systems systems, the values in the model are as follows:
Object Value
b 2
e max 1023
e min – 967
p 107
k An integer 1 ≤ k ≤ 107
For 128-bit real numbers on Cray T90 systems that support IEEE floating-point arithmetic, the values in the
model are as follows:
Object Value
b 2
e max 16384
e min – 16381
p 113
k An integer 1 ≤ k ≤ 113
For 64-bit real numbers on UNICOS systems, the values in the model are as follows:
Object Value
b 2
e max 8189
e min – 8188
p 47
k An integer 1 ≤ k ≤ 47
For 64-bit real numbers on IRIX systems, on Cray T90 systems that support IEEE floating-point arithmetic,
and on UNICOS/mk systems, the values in the model are as follows:
Object Value
b 2
e max 1024
e min – 1021
p 53
k An integer 1 ≤ k ≤ 53

004– 2138– 003 233


MODELS ( 3I ) MODELS ( 3I )

For 32-bit real numbers on UNICOS/mk and IRIX systems, the values in the model are as follows:
Object Value
b 2
e max 128
e min – 125
p 24
k An integer 1 ≤ k ≤ 24
The values shown for the real number system model can be retrieved through the RADIX, MAXEXPONENT,
MINEXPONENT, DIGITS, PRECISION, and RANGE numeric inquiry intrinsic functions.
The HUGE and TINY numeric inquiry intrinsic functions return the largest and the smallest positive number
in the real number system model. The EPSILON function returns a positive real number that is epsilon =
1– p
b .

NOTES
On UNICOS systems, both execution speed and the number of bits used in mathematical operations are
affected when compiling with f90 -O fastint, which is the default setting. For more information, see
CF90 Commands and Directives Reference Manual.

234 004– 2138– 003


MODULO ( 3I ) MODULO ( 3I )

NAME
MODULO – Modulo function

SYNOPSIS
MODULO ([A=]a, [P=]p)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MODULO function returns the remainder of a divided by p using modulo math. The result always has
the sign of the modulo base, p.
This function accepts the following arguments:
a Must be of type integer or real
p Must be of the same type and kind type parameter as a
MODULO is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type and type parameter are the same as a.
When a is of type integer, if p is not equal to zero, MODULO (a, p) has the value r such that a = q × p + r,
where q is an integer. The inequality 0 ≤ r < p holds if p > 0, and p < r ≤ 0 holds if p < 0. If p = 0, the
result is 0.
When a is of type real, if p is not equal to zero, the value of the result is a - FLOOR (a / p) * p. The result
can be a NaN when that value is available.

EXAMPLES
Example 1. MODULO(8,5) yields 3.
Example 2. MODULO(-8,5) yields 2.
Example 3. MODULO(8,-5) yields -2.

004– 2138– 003 235


MODULO ( 3I ) MODULO ( 3I )

Example 4. MODULO(-8,-5) yields -3.

236 004– 2138– 003


MVBITS ( 3I ) MVBITS ( 3I )

NAME
MVBITS – Copies a sequence of bits from one integer data object to another

SYNOPSIS
CALL MVBITS ([FROM=]from, [FROMPOS=]frompos, [LEN=]len, [TO=]to, [TOPOS=]topos)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The MVBITS intrinsic subroutine copies a sequence of bits from one integer data object to another. It
accepts the following arguments:
from Must be of type integer. It is an INTENT (IN) argument.
frompos Must be of type integer and nonnegative. It is an INTENT (IN) argument. frompos + len
must be less than or equal to BIT_SIZE (from). The bit model defines the interpretation of an
integer value as a sequence of bits. For more information on the bit model see the MODELS(3I)
man page.
len Must be of type integer and nonnegative. It is an INTENT (IN) argument.
to Must be a variable of type integer with the same kind type parameter value as from and may be
the same variable as from. It is an INTENT (INOUT) argument. to is set by copying the
sequence of bits of length len, starting at position frompos of from to position topos of to. No
other bits of to are altered. On return, the len bits of to starting at topos are equal to the value
that the len bits of from starting at frompos had on entry.
topos Must be of type integer and nonnegative. It is an INTENT (IN) argument. topos + len must
be less than or equal to BIT_SIZE (to).
MVBITS is an elemental subroutine. The name of this intrinsic cannot be passed as an argument.

EXAMPLES
If TO has the initial value 6, the value of TO after the statement CALL MVBITS(7, 2, 2, TO, 0) is
5.

SEE ALSO
MODELS(3I)

004– 2138– 003 237


MY_PE ( 3I ) MY_PE ( 3I )

NAME
_my_pe, MY_PE – Returns the processing element (PE) number of the calling PE

SYNOPSIS
C/C++:
#include <intrinsics.h>
int _my_pe (void);
Fortran on UNICOS and IRIX systems:
I= MY_PE ()
Fortran on UNICOS/mk systems:
INTRINSIC MY_PE
I= MY_PE ()

IMPLEMENTATION
C/C++: UNICOS/mk systems
Fortran: UNICOS, UNICOS/mk, IRIX systems
Cray C/C++, CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
This function returns the processing element (PE) number of the calling PE. It accepts no arguments. The
result is an integer between 0 and npes - 1, where npes is the total number of PEs executing the current
program.

NOTES

C/C++
Because _my_pe is an intrinsic function, no externally visible library function is available for it. The
compiler generates inline code to produce the result.
Fortran
Whether this function is intrinsic depends on your platform, as follows:
• On UNICOS and IRIX systems, it is supported as part of the Message Passing Toolkit, and it is supported
as an external function.

238 004– 2138– 003


MY_PE ( 3I ) MY_PE ( 3I )

• On UNICOS/mk systems, it is supported as an intrinsic function.


MY_PE is an inquiry function. The name of this intrinsic cannot be passed as an argument.
On UNICOS/mk systems, MY_PE returns the same value as sysconf(_SC_CRAY_VPE). See the
sysconf(2) man page for more information on this system call.

SEE ALSO
sysconf(2)
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 239


NEAREST ( 3I ) NEAREST ( 3I )

NAME
NEAREST – Returns the nearest different machine representable number in a given direction

SYNOPSIS
NEAREST ([X=]x, [S=]s)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The NEAREST intrinsic function returns the nearest different machine representable number in a given
direction. It accepts the following arguments:
x Must be of type real
s Must be of type real and not equal to zero
NEAREST is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type and type parameter are the same as x. The result has a value equal to the machine
representable number distinct from x and nearest to it in the direction of the infinity with the same sign as s.

NOTES
On Cray T90 systems that support IEEE arithmetic, this intrinsic vectorizes inline for 64-bit operands and
calls to scalar-only library routines for 128-bit operands.

EXAMPLES
-46
NEAREST(3.0,2.0) yields 3 + 2 on UNICOS systems according to the real number system model.
-22
NEAREST(3.0,2.0) yields 3 + 2 on UNICOS/mk and IRIX systems, according to the real number
system model.
For more information on the real number model, see the MODELS(3I) man page.

SEE ALSO
MODELS(3I)

240 004– 2138– 003


NINT ( 3I ) NINT ( 3I )

NAME
NINT, IDNINT, IQNINT – Converts to nearest integer

SYNOPSIS
NINT ([A=]a [,[KIND=]kind])
IDNINT ([A=]a)
IQNINT ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: IQNINT

DESCRIPTION
NINT is the generic function name; the others are specifics. These are elemental intrinsic functions. They
accept the following arguments:
a Must be type real. See the RETURN VALUES section for information on input data types and
return values.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
kind An integer scalar value. Must be a kind type allowed for a. This argument is not accepted by
the MIPSpro Fortran 77 compiler.
These functions find the nearest integer for real numbers, using these equations:
• If a ≥ 0, y = INT(a+.5).
• If a < 0, y = INT(a-.5).
NOTES
The NINT and IDNINT intrinsic function names can be passed as arguments; the other cannot.

004– 2138– 003 241


NINT ( 3I ) NINT ( 3I )

RETURN VALUES
NINT returns the nearest integer for its real argument.
IDNINT returns the nearest integer for its double-precision argument.
IQNINT returns the nearest integer for its quad-precision argument.

242 004– 2138– 003


NOT ( 3I ) NOT ( 3I )

NAME
NOT, INOT, JNOT, KNOT – Performs a logical complement

SYNOPSIS
NOT ([I=]i)
INOT ([I=]i)
JNOT ([I=]i)
KNOT ([I=]i)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: INOT, JNOT, KNOT

DESCRIPTION
The NOT, INOT, JNOT, and KNOT intrinsic functions perform a logical complement. They accept the
following argument:
i Must be of type integer. For INOT, must be of type integer (KIND=2). For JNOT, must be of
type integer (KIND=4). For KNOT, must be of type integer (KIND=8).
These are elemental intrinsic functions. The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
The result type and type parameter are the same as i. On IRIX systems, the result can be affected by the -i
option on the f90(1) command line.
The result has the value obtained by complementing i bit-by-bit according to the following truth table:

i NOT(i)

1 0
0 1

The bit model defines the interpretation of an integer value as a sequence of bits. For more information on
the bit model, see the MODELS(3I) man page.

004– 2138– 003 243


NOT ( 3I ) NOT ( 3I )

EXAMPLES
If I is represented by the string of bits 01010101, NOT(I) has the binary value 10101010.

SEE ALSO
f90(1)
MODELS(3I)

244 004– 2138– 003


NULL ( 3I ) NULL ( 3I )

NAME
NULL – Returns a disassociated pointer

SYNOPSIS
NULL ([[MOLD=]mold])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The NULL intrinsic function returns a disassociated pointer. It accepts the following argument:
mold A pointer of any type. This is an optional argument. Its pointer association status can be
undefined, disassociated, or associated. If its status is associated, the target need not be defined
with a value.
mold must be specified when a reference to NULL appears as an actual argument in a reference
to a generic procedure if the type, type parameters, or rank is required to resolve the generic
reference.
This is a transformational function.

RETURN VALUES
NULL returns a disassociated pointer. The pointer has no shape, but it does have rank.
If mold is specified, the return value has the same characteristics as mold.
If mold is not specified, the data type, type parameters, and rank of the result are determined by the pointer
that becomes associated with the result, as follows:
Appearance of NULL: Result type, type parameters, rank:
Right side of a pointer assignment Pointer on the left side
Initialization for an object in a declaration The object
Default initialization for a component The component
In a structure constructor The corresponding component
As an actual argument The corresponding dummy argument
In a DATA statement The corresponding pointer object

004– 2138– 003 245


NULL ( 3I ) NULL ( 3I )

EXAMPLES

INT ERFACE GEN


SUBROU TINE S1 (J, PI)
INT EGER J
INT EGER, POI NTE R :: PI
END SUB ROUTIN E S1
SUBROU TINE S2 (K, PR)
INT EGER K
REA L, POI NTE R :: PR
END SUB ROUTIN E S2
END INTERF ACE
REA L, POI NTER :: REA L_P TR
CAL L GEN (7, NUL L (RE AL_ PTR ) ) ! INV OKE S2

246 004– 2138– 003


NUMARG ( 3I ) NUMARG ( 3I )

NAME
_numargs, _argcount, NUMARG – Returns the number of arguments in a function or subprogram call

SYNOPSIS
C/C++:
#include <intrinsics.h>
int _numargs (void);
int _argcount (void);
Fortran:
NUMARG ()

IMPLEMENTATION
C/C++:
_numargs is available on UNICOS and UNICOS/mk systems
_argcount is available on Cray T90 and UNICOS/mk systems only
Fortran: UNICOS and UNICOS/mk systems
Cray C++, CF90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION

C/C++
The _argcount function returns the number of arguments explicitly passed by the user to the function in
which the call appears excluding any "hidden" arguments added by the compiler. The _numargs function
returns the total number of words in the argument list passed to the function in which the call appears
including any "hidden" arguments added by the compiler. "Hidden" arguments include the this pointer for
member functions in C++ and the aggregrate return value pointer used for functions returning class,
struct, or union.
If either of these intrinsic functions are called from within an inline function, the return value is undefined.
For this reason, these intrinsic functions should never be called from within a file compiled with an
automatic inlining level greater than 0.

004– 2138– 003 247


NUMARG ( 3I ) NUMARG ( 3I )

Fortran
This intrinsic function returns the number of arguments in a subprogram call. It accepts no arguments.
The name of this intrinsic cannot be passed as an argument.

NOTES

C/C++
Because these are intrinsic functions, no externally visible library functions are available for them. The
compiler generates inline code to produce the result.
Fortran
In Fortran, the NUMARG intrinsic function is outmoded. Refer to the Fortran Language Reference Manual,
Volume 3, for information on outmoded features and their preferred standard alternatives.

FORTRAN RETURN VALUES


The value returned is of type default integer.

EXAMPLES
C/C++: The following example demonstrates the use of the _argcount and _numargs intrinsic
functions:
Program source:
#include <stdio .h>

struct st { int mem [10]; } ss;

voi d f(i nt a, ...)


{
printf(" number of arg ume nts pas sed to f = %d\ n", _ar gco unt ()) ;
printf(" number of wor ds in arg ume nt lis t pas sed to f = %d\ n", _nu mar gs());
}

main()
{
f(10, ss) ;
}

Execution output:
number of argume nts pas sed to f = 2
number of words in arg ume nt lis t pas sed to f = 11

248 004– 2138– 003


NUMARG ( 3I ) NUMARG ( 3I )

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 249


NUM_IMAGES ( 3I ) NUM_IMAGES ( 3I )

NAME
NUM_IMAGES – Retrieves total number of images executing

SYNOPSIS
NUM_IMAGES()

IMPLEMENTATION
UNICOS/mk systems
CF90

STANDARDS
Fortran extension

DESCRIPTION
NUM_IMAGES is an intrinsic procedure that retrieves the total number of images that are executing. It is an
inquiry function.

RETURN VALUES
The NUM_IMAGES intrinsic function returns a scalar value of type default integer.

SEE ALSO
CF90 Co-array Programming Manual

250 004– 2138– 003


NUM_PES ( 3I ) NUM_PES ( 3I )

NAME
_num_pes, NUM_PES – Returns the number of processing elements (PEs) running in an application

SYNOPSIS
C or C++:
#include <intrinsics.h>
int _num_pes (void);
Fortran:
I = NUM_PES()

IMPLEMENTATION
C/C++: UNICOS and UNICOS/mk
Fortran: UNICOS, UNICOS/mk, and IRIX systems
Cray C/C++, CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
The num_pes function returns the number of PEs running in an application.

C/C++ NOTES
The _num_pes intrinsic function is evaluated at run-time and cannot be used in constant expressions.
Because _num_pes is an intrinsic function, no externally visible library function is available for it. The
compiler generates inline code to produce the result.

SEE ALSO
intro_shmem(3), my_pe(3I), start_pes(3)
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.
Message Passing Toolkit: PVM Programmer’s Manual
Message Passing Toolkit: MPI Programmer’s Manual

004– 2138– 003 251


OR ( 3I ) OR ( 3I )

NAME
OR – Computes logical sum

SYNOPSIS
OR ([I=]i,[J=]j)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extension

DESCRIPTION
OR is an elemental function. It accepts the following arguments:
i Must be of type Boolean, integer, real, Cray pointer, or logical.
j Must be of type Boolean, integer, real, Cray pointer, or logical.

NOTES
This is an outmoded routine. Refer to the Fortran Language Reference Manual, Volume 3, for information
about outmoded features and their preferred standard alternatives.
The name of this intrinsic cannot be passed as an argument.

CAUTIONS
Unexpected results can occur when Boolean functions are declared external and then used with logical
arguments. The external Boolean functions always treat their arguments as type Boolean and return a
Boolean result on UNICOS and UNICOS/mk systems. On IRIX systems, they return an integer result.

RETURN VALUES
When given two arguments of type logical, OR computes a logical sum and returns a logical result.
When given two arguments of type integer, real, Boolean, or pointer, OR computes a bit-wise logical sum
and returns a Boolean result. No type conversion occurs.
The following tables show both the logical sum and bit-wise logical sum:

252 004– 2138– 003


OR ( 3I ) OR ( 3I )

Logical Variable 1 Logical Variable 2 (Logical Variable 1) OR (Logical Variable 2)

T T T
T F T
F T T
F F F

Bit of Variable 1 Bit of Variable 2 (Bit of Variable 1) OR (Bit of Variable 2)

1 1 1
1 0 1
0 1 1
0 0 0

EXAMPLES
The following section of Fortran code shows the OR function used with two arguments of type logical:
LOG ICAL L1, L2, L3
...
L3 = OR(L1, L2)

The following section of Fortran code shows the OR function used with two arguments of type integer. The
bit patterns of the arguments and result are also shown. For clarity, only the rightmost 8 bits are shown.
INT EGER I1, I2, I3
I1 = 12
I2 = 10
...
I3 = OR(I1, I2)

------ ------ --- --- --- --- --- --- - --- --- --- --- --- --- --- --- --- ----
| 0 | | | | | | | | | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
------ ------ --- --- --- --- --- --- - --- --- --- --- --- --- --- --- --- ----
I1 I2

--- --- ------ --- --- --- --- --- --- -


| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
--- --- --- --- --- --- --- --- --- --- -
I3

004– 2138– 003 253


PACK ( 3I ) PACK ( 3I )

NAME
PACK – Packs an array into an array of rank one under control of a mask

SYNOPSIS
PACK ([ARRAY=]array, [MASK=]mask [,[VECTOR=]vector])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The PACK intrinsic function packs an array into an array of rank one under control of a mask. It can be
used for array construction. It accepts the following arguments:
array Can be of any type. It must not be scalar.
mask Must be of type logical and must be conformable with array.
vector Must be of the same type as array and must have rank one. vector must have at least as many
elements as there are true elements in mask. If mask is scalar with the value true, vector must
have at least as many elements as there are in array.
PACK is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is an array of rank one of the same type as array. If vector is present, the result size is that of
vector; otherwise, the result size is the number t of true elements in mask unless mask is scalar with the
value true in which case the result size is the size of array.
Element i of the result is the element of array that corresponds to the ith true element of mask, taking
elements in array element order, for i=1, 2, . . ., t. If vector is present and has size n>t, element i of the
result has the value vector(i), for i=t+1, . . ., n.

EXAMPLES
Example 1: Assume that N = (/1,-1,3/). The following are true:
• PACK(N,MASK=N.LT.0) yields (/-1/).
• PACK(N,MASK=.TRUE.) yields (/1,-1,3/).

254 004– 2138– 003


PACK ( 3I ) PACK ( 3I )

Example 2: Assume array M is as follows:


 000
 900
 007
The nonzero elements of array M can be gathered by the PACK function. The following are the results:
• PACK(M,MASK=M.NE.0) yields (/9,7/).
• PACK(M,MASK=M.NE.0,VECTOR=(/2,4,6,8,10,12/)) yields (/9,7,6,8,10,12/).

004– 2138– 003 255


PBIT ( 3I ) PBIT ( 3I )

NAME
_pbit, _pbits – Returns the value of a data word

SYNOPSIS
#include <intrinsics.h>
long _pbit (long x, long n, long y);
long _pbits (long x, long m, long n, long y);

IMPLEMENTATION
UNICOS, UNICOS/mk systems
Cray C/C++

STANDARDS
C/C++ extension

DESCRIPTION
The _pbit function returns the value consisting of x with its nth bit (from the right) set to the rightmost bit
of data word y.
The _pbits function returns the value consisting of x with m bits changed, starting at bit n (from the right
and counting to the left), to equal the rightmost m bits of y.
These functions accept the following variables:
x The data word from which the value is extracted.
m A value in the range of 0 through 63.
n A value in the range of 0 through 63.

NOTES
Because these are intrinsic functions, no externally visible library functions are available for them. The
compiler generates inline code to produce the result.

EXAMPLES
Program source:
main()
{
lon g x = 0;
lon g y = 0x0 123 456 789 abc def ;

printf ("_pbi t(x , 10, y) = %lx \n" , _pb it( x, 10, y)) ;

256 004– 2138– 003


PBIT ( 3I ) PBIT ( 3I )

pri ntf ("_ pbi ts( x, 12, 32, y) = %lx \n", _pbits (x, 12, 32, y)) ;
}

Execution output:
_pb it( x, 10, y) = 400
_pb its (x, 12, 32, y) = def 000 000 00

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 257


POPCNT ( 3I ) POPCNT ( 3I )

NAME
_popcnt, POPCNT – Counts number of set bits

SYNOPSIS
C/C++:
#include <intrinsics.h>
int _popcnt (long i);
Fortran:
POPCNT ([I=]i)

IMPLEMENTATION
C/C++: UNICOS and UNICOS/mk systems
Fortran: UNICOS, UNICOS/mk, IRIX systems
Cray C/C++, CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION

C/C++
The _popcnt function returns the number of bits set to 1 (the population count) in argument i.
Fortran
This intrinsic function counts the number of bits set in the argument. It accepts the following argument:
i A Boolean, integer, real, or Cray pointer value. i cannot be declared as REAL(KIND=16).
POPCNT is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
A vector version of the POPCNT intrinsic function exists on UNICOS and UNICOS/mk systems. On
UNICOS/mk systems, the vector version of this intrinsic is used when -O vector3 or -O 3 are specified
on the compiler command line.
C/C++
Because _popcnt is an intrinsic function, no externally visible library function is available for it. The
compiler generates inline code to produce the result.

258 004– 2138– 003


POPCNT ( 3I ) POPCNT ( 3I )

Fortran
The bit representation of the logical data type is not consistent among UNICOS and UNICOS/mk systems.
For further details, see your compiler’s reference manuals.

FORTRAN RETURN VALUES


POPCNT returns a value of type integer.

EXAMPLES
Fortran: The following section of Fortran code shows the POPCNT function used with an argument of type
integer. The bit pattern of the argument and the value of the result are also given. For simplicity, a 16-bit
object is used.
INT EGE R I1, I2
...
I2 = POP CNT (I1)

--- --- ------ --- --- ------ ------ ------ ------ ------ ------ ------ ---
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
--- --- ------ --- ------ ------ ------ ------ ------ ------ ------ ------
I1

The POPCNT function returns the value 6 to the integer variable I2.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 259


POPPAR ( 3I ) POPPAR ( 3I )

NAME
_poppar, POPPAR – Computes bit population parity

SYNOPSIS
C/C++:
#include <intrinsics.h>
int _poppar (long i);
Fortran:
POPPAR ([I=]i)

IMPLEMENTATION
C/C++: UNICOS and UNICOS/mk systems
Fortran: UNICOS, UNICOS/mk, IRIX systems
Cray C/C++, CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION

C/C++
The _poppar function returns 0 if the argument i has an even number of bits that are set to 1. This is the
parity of the population count for argument i.
Fortran
This intrinsic function computes the bit population parity and returns an integer value. It accepts the
following argument:
i A Boolean, integer, real, or Cray pointer value. i cannot be declared as REAL(KIND=16).
POPPAR is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
The bit representation of the logical data type is not consistent among UNICOS and UNICOS/mk systems.
For further details, see your compiler’s reference manuals.

260 004– 2138– 003


POPPAR ( 3I ) POPPAR ( 3I )

C/C++
Because _poppar is an intrinsic function, no externally visible library function is available for it. The
compiler generates inline code to produce the result.

FORTRAN RETURN VALUES


In Fortran, POPPAR returns the value 0 if an even number of bits in i are set. It returns the value 1 if an
odd number of bits are set in i.
The return value is of type integer.

EXAMPLES
The following section of Fortran code shows the POPPAR function used with an argument of type integer.
The bit pattern of the argument and the value of the result are also given. For simplicity, a 16-bit object is
used.
INTEGER I1, I2
...
I2 = POPPAR(I1 )

--- --- ------ --- --- ------ ------ ------ ------ ------ ------ ------ ---
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
--- --- ------ --- ------ ------ ------ ------ ------ ------ ------ ------
I1

The POPPAR function returns the value 0 to the integer variable I2.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 261


PRECISION ( 3I ) PRECISION ( 3I )

NAME
PRECISION – Returns the decimal precision of a number in the real number model

SYNOPSIS
PRECISION ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The PRECISION intrinsic function returns the decimal precision of a number in the real number model.
The real number model is described in the MODELS(3I) man page. This function accepts the following
argument:
x Must be of type real or complex. It may be scalar or array valued.
PRECISION is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a default integer scalar. The result has the value INT((p– 1)*LOG10(b))+k, where b and p are
as defined in the model and where k is 1 if b is an integral power of 10 and 0 otherwise.

EXAMPLES
On UNICOS systems, except for Cray T90 systems that support IEEE floating-point arithmetic,
PRECISION(X) yields 13 for REAL(KIND=8).
On Cray T90 systems that support IEEE floating-point arithmetic, PRECISION(X) yields the following
values:
• 6 for REAL(KIND=4) X
• 15 for REAL(KIND=8) X
• 33 for REAL(KIND=16) X
On IRIX systems, PRECISION(X) yields the following values:
• 6 for REAL(KIND=4) X
• 15 for REAL(KIND=8) X
• 31 for REAL(KIND=16) X

262 004– 2138– 003


PRECISION ( 3I ) PRECISION ( 3I )

On UNICOS/mk systems, PRECISION(X) has the following values:


• 6 for REAL(KIND=4) X
• 15 for REAL(KIND=8) X
SEE ALSO
MODELS(3I)

004– 2138– 003 263


PRESENT ( 3I ) PRESENT ( 3I )

NAME
PRESENT – Determines whether an optional argument is present

SYNOPSIS
PRESENT ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The PRESENT intrinsic function determines whether an optional dummy argument is present. It accepts the
following argument:
a Must be an optional dummy argument of the procedure in which the PRESENT function
reference appears
PRESENT is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type is a default logical scalar. The result has the value TRUE if a is present and otherwise has
the value FALSE.

264 004– 2138– 003


PRODUCT ( 3I ) PRODUCT ( 3I )

NAME
PRODUCT – Forms the product of array elements

SYNOPSIS
PRODUCT ([ARRAY=]array [,[DIM=]dim] [,[MASK=]mask])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The PRODUCT intrinsic function forms the product of all the elements of array along dimension dim
corresponding to the true elements of mask. It accepts the following arguments:
array Must be of type integer, real, or complex. It must not be scalar.
dim Must be scalar and of type integer with a value in the range 1 ≤ dim ≤ n, where n is the rank of
array. The corresponding actual argument must not be an optional dummy argument.
mask Must be of type logical and must be conformable with array.
PRODUCT is a transformational intrinsic function. The name of this intrinsic cannot be passed as an
argument.

RETURN VALUES
The result has the same type and type parameter as array. The result is scalar if dim is absent or array has
rank one; otherwise, the result is an array of rank n– 1 of shape (d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ), where
(d 1 , d 2 , . . ., d n ) is the shape of array.
The result of PRODUCT(array) has a value equal to the product of all the elements of array or has the
value 1 if array has size 0.
The result of PRODUCT(array,MASK=mask) has a value equal to the product of the elements of array
corresponding to the true elements of mask or has the value 1 if there are no true elements.
If array has rank one, PRODUCT(array,dim[,mask]) has a value equal to that of
PRODUCT(array[,MASK=mask]). Otherwise, the value of element (s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ) of
PRODUCT(array,dim[,mask]) is equal to PRODUCT(array (s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n ))
[, MASK=mask (s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )]).

004– 2138– 003 265


PRODUCT ( 3I ) PRODUCT ( 3I )

EXAMPLES
Example 1: PRODUCT((/1,2,3/)) yields 6.
Example 2: PRODUCT(C,MASK=C.GT.0.0) yields the product of the positive elements of C.
Example 3: Assume that B is the following array:
 135
 246
PRODUCT(B,DIM=1) yields (/2,12,30/).
PRODUCT(B,DIM=2) yields (/15,48/).

266 004– 2138– 003


RADIX ( 3I ) RADIX ( 3I )

NAME
RADIX – Returns the base number from the real or integer number models

SYNOPSIS
RADIX ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The RADIX intrinsic function returns the base number of the model (either real or integer) that represents
numbers of the same type and kind type parameter as the argument specified. For more information on the
real number model and the integer number model, see the MODELS(3I) man page. It accepts the following
argument:
x Must be of type integer or real. It may be scalar or array valued.
RADIX is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a default integer scalar. The result has the value r if x is of type integer and the value b if x is
of type real, where r and b are as defined in the model.

EXAMPLES
RADIX(x) yields 2 for any x.

SEE ALSO
MODELS(3I)

004– 2138– 003 267


RAN ( 3I ) RAN ( 3I )

NAME
_ranf, RANF, RANGET, RANSET – Computes pseudo-random numbers

SYNOPSIS
C/C++:
#include <intrinsics.h>
double _ranf(void);
Fortran:
RANF()
RANGET ([I=]i)
RANSET ([K=]k)
Fortran on UNICOS/mk systems only:
RANSET ([K=]k [, [J=]j])

IMPLEMENTATION
C/C++: UNICOS and UNICOS/mk systems
Fortran: UNICOS, UNICOS/mk, IRIX systems
Cray C/C++, CF90, MIPSpro 7 Fortran 90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
The _ranf and RAND functions return a pseudo-random floating-point number in the range of 0.0 < x < 1.0.
The RANGET intrinsic procedure returns a seed from the random number seed table.
The RANSET function establishes a seed in the random number seed table.

NOTES

C/C++
Because _ranf is an intrinsic function, no externally visible library function is available for it.

268 004– 2138– 003


RAN ( 3I ) RAN ( 3I )

Fortran
RANF obtains the first or next in a series of pseudo-random numbers. Parenthesis are required, that is:
var = RANF(). If an argument is supplied, it is ignored.
The RANGET intrinsic function obtains a seed. It can be called as a function or a subroutine; it is
recommended that this routine be used as a function because it is not considered intrinsic when called as a
subroutine. RANGET has an optional integer argument. If present, the argument is set to the seed. The
argument for RANGET is as follows:
i An integer of default kind (KIND=8). If present, RANGET returns the seed in i.
On UNICOS and UNICOS/mk systems, the RANSET intrinsic function establishes a seed by using the lower
48 bits of the argument. The result type is typeless. If no argument or a zero argument is supplied, the seed
is reset to an initial default value. When the seed of the random number generator is reset, RANSET does
not store the supplied argument as the first value in the buffer of the random number seeds. If an argument
is supplied, the lower 48 bits are used as the random-number seed. The rightmost bit is always set to 1.
The RANSET arguments are as follows:
k An optional integer, real, or Boolean argument of default kind (KIND=8) The range of argument k is
 k  < inf, where inf is as follows:
• On UNICOS systems, infinity is approximately 10 2450 .
• On UNICOS/mk and IRIX systems, infinity is approximately 10 308 .
j An optional integer argument that, if specified, is used as a count for skipping the first section of
sequential random numbers. You can use this to create a complete sequence of random numbers while
running on many PEs by breaking up the sequence into subsequences and using RANSET() to get each
subsequence started in the correct location.
The names of these intrinsics cannot be passed as arguments.
The RANF Algorithm
In Fortran on Cray C90 systems, the random number generation algorithm uses the following two equations:
• S(n+1) = M1*S(n) mod 2**48
• S(n+64) = M64*S(n) mod 2**48
Each S(i) is the ith seed.
The first equation is used to generate the first 128 random numbers and store them in a table if a call to
RANSET() was done. Otherwise, the table contains the first 128 random numbers from the default seed.
The second equation is used because it vectorizes.
The default seed is S(0) = 1274321477413155 (octal).
The operations M1*S(n) and M64*S(n) are done as integer multiplications in such a way to preserve the
lower 48 bits. It is the lower 48 bits that make the next random number seed and are used in the return
value.

004– 2138– 003 269


RAN ( 3I ) RAN ( 3I )

The return value (random number) is the newly generated seed with an exponent of 40000 (octal) added.
This is normalized before exit.
The multiplier M1 is 1207264271730565 (octal) and is related to M64 by the following expression:
M64 = lower 48 bits of M1**64 = 7027423346125401 (octal).
For example, the following Fortran program, when compiled with the f90 -i 64 option on a Cray C90
system, is the equivalent of the RANF function:
cc
c THI S IS A FOR TRA N VER SIO N OF RAN F() FUN CTI ON
cc
REA L FUN CTI ON RAN F()
REA L NOR M
INT EGE R MHI ,MLO,E XPO,SE ED,SEE DHI,SE EDL O
DAT A SEE D/1 274321477 413155 B/
SAV E SEE D

MHI = 120 726 42B


MLO = 717 305 65B

EXP O = SHI FTL (40 000 B,4 8)

SEE DHI = SHIFTR (AND(S HIFTL( 777777 77B ,24 ),S EED),2 4)
SEE DLO = AND (77 777 777 B,S EED )

SEE D = AND (77777 777777 77777B ,SEEDL O*M LO+


1 SHI FTL (SE EDL O*M HI+ SEE DHI *ML O,2 4))

RAN F=N ORM (OR (EX PO, SEE D), 0.0 )


RET URN
END
cc
c THI S IS HER E TO NORMAL IZE THE FLO ATI NG POI NT RES ULT
cc
REA L FUN CTI ON NOR M(X,Y)
REA L X,Y
NOR M = X+Y
RET URN
END

On IRIX systems, RANF uses a 64-bit linear congruential generator with a default seed of
1274321477413155 (octal).

270 004– 2138– 003


RAN ( 3I ) RAN ( 3I )

The RANF Repeat Period


In Fortran, the period of RANF() is 2**46. If you need to insure that two random number ranges do not
overlap, you can determine this empirically by generating the two sets of numbers and comparing them
against one another, and also against themselves, for an overlap. It should be noted, however, that when
using RANSET to set the random number seed, the algorithm used always rounds up even-numbered seeds to
the nearest odd-numbered seed (that is, the right most bit is always set to one). Some adjacent pairs of seeds
will generate exactly the same set of random numbers. For example, seeds 4 and 5 will generate the same
set of random numbers.
RANF and Multitasking
In Fortran, the random number generator uses static memory storage for the random number seed table, so
the RANF, RANSET, and RANGET functions must be protected (locked) when called from a multitasked
program.
RANF generates a set of random numbers such that each random number depends on the previous random
number for its value. Thus, depending on the order in which the tasks calling RANF execute, a different set
of random numbers will be returned to each task. It cannot be guaranteed that each task will get a distinct
and reproducible set of random number values.

RETURN VALUES
_ranf and RANF return a 64-bit floating-point number in the range 0.0 < x < 1.0.
RANGET returns a 64-bit integer result.
RANSET returns a 64-bit typeless result.

EXAMPLES
The following examples are written in Fortran:
DO 10 I=1 ,10
10 RAN DOM(I) =RA NF()

iseed=RA NGET(ivalue)

dummy=RA NSE T(ivalue)

SEE ALSO
RANDOM_NUMBER(3I), RANDOM_SEED(3I)
rand(3C) in the UNICOS System Libraries Reference Manual
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 271


RANDOM_NUMBER ( 3I ) RANDOM_NUMBER ( 3I )

NAME
RANDOM_NUMBER – Returns pseudorandom numbers

SYNOPSIS
CALL RANDOM_NUMBER ([HARVEST=]harvest)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The RANDOM_NUMBER intrinsic subroutine returns one pseudorandom number or an array of pseudorandom
numbers from the uniform distribution over the range 0 ≤ x < 1. It accepts the following argument:
harvest Must be of type real. It is an output argument. It may be a scalar or an array variable. It is set
to contain pseudorandom numbers from the uniform distribution in the interval 0 ≤ x < 1.
On UNICOS and UNICOS/mk systems, harvest is 64 bits. On IRIX systems, harvest is 32 bits.
The name of this intrinsic cannot be passed as an argument.

EXAMPLES

REA L X, Y(10,1 0)
! Initia lize X wit h a pse udo ran dom num ber
CAL L RAN DOM_NU MBE R(H ARV EST =X)
CAL L RAN DOM_NU MBE R(Y )
! X and Y contai n uni for mly dis tri but ed ran dom num ber s

SEE ALSO
RANDOM_SEED(3I), RANF(3I)

272 004– 2138– 003


RANDOM_SEED ( 3I ) RANDOM_SEED ( 3I )

NAME
RANDOM_SEED – Restarts or queries the pseudorandom number generator

SYNOPSIS
CALL RANDOM_SEED ([[SIZE=]size] [,[PUT=]put] [,[GET=]get])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The RANDOM_SEED intrinsic subroutine restarts or queries the pseudorandom number generator used by
RANDOM_NUMBER. It accepts the following arguments (note that there must be exactly one argument or no
arguments present):
size Must be scalar and of type integer. It is an output argument. It is set to the number N of
integers that the processor uses to hold the value of the seed.
put Must be an integer array of rank one and size ≥ N. It is an input argument. It is used to set the
seed value.
get Must be an integer array of rank one and size ≥ N. It is an output argument. It is set to the
current value of the seed.
The name of this intrinsic cannot be passed as an argument.

EXAMPLES

CALL RANDOM _SE ED ! ini tiz ati on of see d


CALL RANDOM _SE ED( SIZ E = K) ! Set s K = N
CALL RANDOM _SE ED( PUT = SEE DAR RAY (1: K)) ! Set use r see d
CALL RANDOM _SE ED( GET = OLD SEE D(1 :K) ) ! Get cur ren t see d

SEE ALSO
RANDOM_NUMBER(3I)

004– 2138– 003 273


RANGE ( 3I ) RANGE ( 3I )

NAME
RANGE – Returns the decimal exponent range of a number according to the real or integer model

SYNOPSIS
RANGE ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The RANGE intrinsic function returns the decimal exponent range in the model representing integer or real
numbers with the same kind type parameter as the argument. For information on integer number model or
the real number model, see the MODELS(3I) man page. It accepts the following argument:
x Must be of type integer, real, or complex. It may be scalar or array valued.
RANGE is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a default integer scalar.
For an integer argument, the result has the value INT(LOG10(huge)), where huge is the largest positive
integer in the model representing integer numbers with same kind type parameter as x.
For a real or complex argument, the result has the value INT(MIN(LOG10(huge),-LOG10(tiny))),
where huge and tiny are the largest and smallest positive numbers in the model representing real numbers
with the same value for the kind type parameter as x.

EXAMPLES
On UNICOS systems, except for Cray T90 systems that support IEEE floating-point arithmetic, RANGE(x)
yields the value 2465 for real x.
On IRIX systems, RANGE(x) yields the following values:
• 37 for real (KIND=4) x
• 307 for real (KIND=8) x
• 291 for real (KIND=16) x

274 004– 2138– 003


RANGE ( 3I ) RANGE ( 3I )

On UNICOS/mk systems, RANGE(x) yields the following values:


• 37 for real (KIND=4) x
• 307 for real (KIND=8) x
On Cray T90 systems that support IEEE floating-point arithmetic, RANGE(X) yields the following values:
• 37 for real (KIND=4) x
• 307 for real (KIND=8) x
• 4931 for real (KIND=16) x
SEE ALSO
MODELS(3I)

004– 2138– 003 275


READSB ( 3I ) READSB ( 3I )

NAME
_readSB, _readST, _writeSB, _writeST – Returns status register value

SYNOPSIS
#include <intrinsics.h>
int _readSB (long n);
long _readST (long n);
void _writeSB (long n, long x);
void _writeST (long n, long x);

IMPLEMENTATION
UNICOS systems
Cray C/C++

STANDARDS
C/C++ extension

DESCRIPTION
The _readSB function returns the value of shared-B register n.
The _readST function returns the value of shared-T register n.
The _writeSB function writes the value of data word x to shared-B register n.
The _writeST function writes the value of data word x to shared-T register n.
These functions accept the following arguments:
n Value n must be a constant in the range 0 through 7.
x x is a data word.

NOTES
Because these are intrinsic functions, no externally visible library functions are available for them. The
compiler generates inline code to produce the result.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

276 004– 2138– 003


READSR ( 3I ) READSR ( 3I )

NAME
_readSR – Returns status register value

SYNOPSIS
#include <intrinsics.h>
long _readSR (0);

IMPLEMENTATION
UNICOS systems
Cray C/C++

STANDARDS
C/C++ extension

DESCRIPTION
The _readSR function returns the value of status register 0. The only argument allowed is the constant
value 0.

NOTES
Because _readSR is an intrinsic function, no externally visible library function is available for it. The
compiler generates inline code to produce the result.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 277


REAL ( 3I ) REAL ( 3I )

NAME
REAL, DREAL, QREAL, FLOAT, FLOATI, FLOATJ, FLOATK, DFLOAT, DFLOATI, DFLOATJ, DFLOATK,
QFLOAT, QFLOATI, QFLOATJ, QFLOATK, SNGL, SNGLQ – Converts to type real

SYNOPSIS
REAL ([A=]a [,[KIND=]kind])
DREAL ([A=]a)
QREAL ([A=]a)
FLOAT ([A=]a)
FLOATI ([A=]a)
FLOATJ ([A=]a)
FLOATK ([A=]a)
DFLOAT ([A=]a)
DFLOATI ([A=]a)
DFLOATJ ([A=]a)
DFLOATK ([A=]a)
QFLOAT ([A=]a)
QFLOATI ([A=]a)
QFLOATJ ([A=]a)
QFLOATK ([A=]a)
SNGL ([A=]a)
SNGLQ ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: DREAL, QREAL, FLOAT, FLOATI, FLOATJ, FLOATK, DFLOAT, DFLOATI,
DFLOATJ, DFLOATK, QFLOAT, QFLOATI, QFLOATJ, QFLOATK, SNGLQ

DESCRIPTION
These intrinsic functions convert specified types to type real. These are elemental intrinsic functions. They
accept the following arguments:

278 004– 2138– 003


REAL ( 3I ) REAL ( 3I )

a For REAL, DREAL, and QREAL, must be type complex, integer, or real. For FLOAT, DFLOAT,
and QFLOAT, must be type integer. For FLOATI, DFLOATI, and QFLOATI, must be type
integer (KIND=2). For FLOATJ, DFLOATJ, and QFLOATJ, must be type integer (KIND=4).
For FLOATK, DFLOATK, and QFLOATK, must be type integer (KIND=8). For SNGL, must be
type double-precision real. For SNGLQ, must be type quad-precision real.
If a is of type complex, an approximation of the real part of a is returned.
The terms single precision, double precision, and quad precision differ depending on your
platform. For platform-specific information, see the TERMINOLOGY section of the
INTRO_INTRIN(3I) man page.
kind An integer scalar value. The kind type to be used for the result. If not specified, the kind type
for default real is used for integer and real arguments. If kind is not present and the argument is
complex, the result has the same kind type as the argument. This argument is not accepted by
the MIPSpro Fortran 77 compiler.
Type conversion routines assign the appropriate type to Boolean arguments without shifting or manipulating
the bit patterns they represent.

NOTES
The names of these intrinsics cannot be passed as arguments.

RETURN VALUES
If a is of type integer or real and kind is specified, the kind type parameter is that specified by kind. If a is
of type integer or real and kind is not specified, the kind type parameter is of type default real.
If a is of type complex and kind is specified, the kind type parameter is that specified by kind. If a if of
type complex and kind is not specified, the kind type parameter is the kind type parameter of a.
REAL returns default real.
DREAL, DFLOAT, DFLOATI, DFLOATJ, and DFLOATK, return double-precision real.
QREAL, QFLOAT, QFLOATI, QFLOATJ, QFLOATK, return quad-precision real.
FLOAT, FLOATI, FLOATJ, FLOATK, SNGL, and SNGLQ return single-precision real.

004– 2138– 003 279


REM_IMAGES ( 3I ) REM_IMAGES ( 3I )

NAME
REM_IMAGES – Returns MOD(NUM_IMAGES(), 2**LOG2_IMAGES())

SYNOPSIS
REM_IMAGES()

IMPLEMENTATION
UNICOS/mk systems
CF90

STANDARDS
Fortran extension

DESCRIPTION
REM_IMAGES is an intrinsic procedure that returns MOD(NUM_IMAGES(),2**LOG2_IMAGES()). It is
an inquiry function.

RETURN VALUES
The REM_IMAGES intrinsic function returns a scalar value of type default integer.

SEE ALSO
CF90 Co-array Programming Manual

280 004– 2138– 003


REMOTE_WRITE_BARRIER ( 3I ) REMOTE_WRITE_BARRIER ( 3I )

NAME
_remote_write_barrier, REMOTE_WRITE_BARRIER – Blocks processor until remote write
operations have finished

SYNOPSIS
C/C++:
#include <intrinsics.h>
void _remote_write_barrier (void);
Fortran:
REMOTE_WRITE_BARRIER ()

IMPLEMENTATION
UNICOS/mk systems
Cray C/C++, CF90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
This intrinsic blocks the processor until all outstanding remote write request packets have been processed.

NOTES

C/C++
Because _remote_write_barrier is an intrinsic function, no externally visible library function is
available for it. The compiler generates inline code to produce the result.
Fortran
The name of this intrinsic cannot be passed as an argument.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 281


REPEAT ( 3I ) REPEAT ( 3I )

NAME
REPEAT – Concatenates several copies of a string

SYNOPSIS
REPEAT ([STRING=]string, [NCOPIES=]ncopies)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The REPEAT intrinsic function concatenates several copies of a string. It returns the specified number of
concatenated copies of the input string as the result. If the number of copies is zero, the result is a string of
zero length.
REPEAT accepts the following arguments:
string Must be a scalar and of type character.
ncopies Must be either 0 or a positive integer. Must also be a scalar.
REPEAT is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a scalar entity of type character with a length of ncopies times the length of string. The value
of the result is the concatenation of ncopies of string.
If ncopies is zero, the result is a string of zero length.

EXAMPLES
In the following program, a literal with a trailing blank is repeated.
CHARAC TER*14 CHV AR
CHV AR = REPEAT (’S TRI NG ’,2 )
PRI NT ’(3 A)’, ’>’ , CHV AR, ’<’
END

The output of the program is:


>ST RING STRING <

282 004– 2138– 003


RESHAPE ( 3I ) RESHAPE ( 3I )

NAME
RESHAPE – Constructs an array of a specified shape

SYNOPSIS
RESHAPE ([SOURCE=]source, [SHAPE=]shape [,[PAD=]pad] [,[ORDER=]order])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The RESHAPE intrinsic function constructs an array of a specified shape from the elements of a given array.
It accepts the following arguments:
source May be of any type. It must be array valued. If pad is absent or of size zero, the size of source
must be greater than or equal to PRODUCT(shape). The size of the result is the product of the
values of the elements of shape.
shape Must be an integer, of rank one, and of constant size. Its size must be positive and less than 8.
It must not have an element whose value is negative.
pad Must be of the same type as source. It must be array valued.
order Must be of type integer. It must have the same shape as shape, and its value must be a
permutation of (1,2,. . .,n), where n is the size of shape. If absent, the default order is (1,2,. . .,n).
RESHAPE is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The type of the result is the same type as source. The result is an array of shape shape, that is,
SHAPE(RESHAPE(source,shape,pad,order)) is equal to shape.
The elements of the result, taken in permuted subscript order order(1), . . ., order(n), are those of source in
normal array element order followed, if necessary, by those of pad in array element order, followed, if
necessary, by additional copies of pad in array element order.

004– 2138– 003 283


RESHAPE ( 3I ) RESHAPE ( 3I )

EXAMPLES
Example 1: RESHAPE((/1,2,3,4,5,6/),(/2,3/)) yields the following:
 135
 246
Example 2: RESHAPE((/1,2,3,4,5,6,7,8,9/),(/3,4/),(/0,0/)) yields the following:
 1470
 2580
 3690
Example 3: RESHAPE((/1,2,3,4,5,6/),(/2,4/),(/0,0/),(/2,1/)) yields the following:
 1234
 5600

284 004– 2138– 003


RRSPACING ( 3I ) RRSPACING ( 3I )

NAME
RRSPACING – Returns the reciprocal of the relative spacing of numeric model numbers near the argument
value

SYNOPSIS
RRSPACING ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The RRSPACING intrinsic function returns the reciprocal of the relative spacing of the numeric real model
numbers near the argument value. For more information on the real number model, see the MODELS(3I)
man page. It accepts the following argument:
x Must be of type real.
RRSPACING is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
This routine is implemented on Cray T90 systems that support IEEE arithmetic by calls to scalar– only
library routines.

RETURN VALUES
The result type and type parameter are the same as x. The result has the value ( (x)(b**-e)  ) (b**p) where
b, e, and p are defined in the real number model.

EXAMPLES
The following code was run on several systems:

004– 2138– 003 285


RRSPACING ( 3I ) RRSPACING ( 3I )

REAL(KIND =4) R4
REAL(KIND =8) R8
REAL(KIND=16 ) R16
REAL RD
R4=-3.0_4
R8=-3.0_8
R16=-3.0_ 16
RD=-3.0
PRINT *,’ RRSPAC ING R4=’,RRSP ACI NG(R4)
PRINT *,’RRS PAC ING R8= ’,R RSP ACING( R8)
PRINT *,’RRS PAC ING R16 =’, RRS PACING (R1 6)
PRINT *,’ RRSPAC ING RD=’,R RSP ACI NG( RD)
END

On IRIX systems, the results were as follows:


RRSPAC ING R4= 125 829 12.
RRSPACING R8= 675539 944 105 5744.
RRSPACING R16 = 1.2 169445 762 191 002254 368 350 077 160 96E +32
RRSPAC ING RD= 125 829 12.

On a UNICOS/mk system, the results were as follows:


RRSPAC ING R4= 125 829 12.
RRSPACING R8= 675539 944 105 5744.
RRSPAC ING RD= 675 539944 105 5744.

On a Cray T90 system that supports IEEE floating-point arithmetic, the results were as follows:
RRSPACING R4= 125829 12.
RRSPAC ING R8= 675 539944 105 574 4.
RRSPAC ING R16 = 7.7 884 452878022 414 427957 444938 30144E +33
RRSPAC ING RD= 675539 944105 574 4.

SEE ALSO
MODELS(3I)

286 004– 2138– 003


RTC ( 3I ) RTC ( 3I )

NAME
_rtc, RTC, IRTC, IRTC_RATE – Returns clock register contents

SYNOPSIS
C/C++:
long long _rtc (void);
CF90 and MIPSpro 7 Fortran 90:
RTC ()
IRTC ()
MIPSpro Fortran 77:
IRTC_RATE()

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
Cray C/C++, CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
The _rtc, RTC, and IRTC intrinsic functions return a real-time clock value. The value is expressed as the
number of clock ticks. The IRTC_RATE function returns the clock rate of the IRTC and RTC functions.

NOTES

C/C++
Because _rtc is an intrinsic function, no externally visible library function is available for it. The compiler
generates inline code to produce the result.
Fortran
The names of these intrinsics cannot be passed as arguments.
When RTC is called as a subroutine, it accepts the following argument:
time The real-time clock value is returned as a REAL(KIND=8) value.
When IRTC is called as a subroutine, it accepts the following argument:
itime The real-time clock value is returned as an INTEGER(KIND=8) value.

004– 2138– 003 287


RTC ( 3I ) RTC ( 3I )

The RTC intrinsic function is outmoded. For information on outmoded features and their preferred standard
alternatives, see the Fortran Language Reference Manual, Volume 3.
The use of RTC is not recommended on UNICOS or IRIX systems. See the standard SYSTEM_CLOCK(3I)
intrinsic subroutine for the preferred alternative.

FORTRAN RETURN VALUES


RTC returns a 64-bit real value. IRTC returns a 64-bit integer value.
When using CF90 on a UNICOS system, RTC returns the low-order 46 bits of the clock register as a
REAL(KIND=8) value. IRTC returns the current content of the clock register as an INTEGER(KIND=8)
value. The result of IRTC may exceed 2**(46)-1 and must not be used in multiplication, division, or
conversion to real unless the value is typed as a 64-bit integer in the CF90 program or -O nofastint is
specified on the f90(1) command line. Addition and subtraction are unaffected.
On IRIX systems, RTC returns the low-order 52 bits of the system clock expressed as a REAL(KIND=8)
value. IRTC returns the system clock as an INTEGER(KIND=8) value. IRTC_RATE returns the number
of IRTC and RTC clock ticks per second in an INTEGER(KIND=8) value. IRTC is the fastest
nonwrapping clock.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.
f90(1), SECOND(3F), SYSCLOCK(3F), SYSTEM_CLOCK(3I), TSECND(3F)

288 004– 2138– 003


SCALE ( 3I ) SCALE ( 3I )

NAME
SCALE – Returns (x)(b**i), where b is the base in the real number model representation of x

SYNOPSIS
SCALE ([X=]x, [I=]i)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
i
The SCALE intrinsic function returns (x)(b ), where b is the base in the real number model representation of
x. For more information on the real number model, see the MODELS(3I) man page. It accepts the following
arguments:
x Must be of type real
i Must be of type integer
SCALE is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
This routine is implemented on Cray T90 systems that support IEEE arithmetic by calls to scalar– only
library routines.

RETURN VALUES
i
The result type and type parameter are the same as x. The result has the value (x)(b ), where b is defined in
the model for real numbers representing values of x, provided that this result is within range. Argument i
should be within the range of MINEXPONENT(x) ≤ i ≤ MAXEXPONENT(x). If i is outside this range, the
results are unpredictable.

EXAMPLES
SCALE(3.0,2) yields 12.0 for reals.

SEE ALSO
MODELS(3I)

004– 2138– 003 289


SCAN ( 3I ) SCAN ( 3I )

NAME
SCAN – Scans a string for any one of the characters in a set of characters

SYNOPSIS
SCAN ([STRING=]string, [SET=]set [,[BACK=]back])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SCAN intrinsic function scans a string for any one of the characters in a set of characters. It accepts the
following arguments:
string Must be of type character.
set Must be of type character.
back Must be of type logical. If back is omitted, a value of false is assumed.
SCAN is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
SCAN returns the character position of the first character in string that matches any characters in set. The
result is a default integer.
If back is absent or present with value false and if string contains at least one character that is in set, the
value of the result is the position of the leftmost character of string that is in set.
If back is present with the value true, and if string contains at least one character that is in set, the value of
the result is the position of the rightmost character of string that is in set.
SCAN returns zero if no character in string is in set, or if the length of string is zero.

EXAMPLES
Example 1: The statement SCAN(’FORTRAN’,’TR’) yields 3.
Example 2: The statement SCAN(’FORTRAN’,’TR’,BACK=.TRUE.) yields 5.

290 004– 2138– 003


SCAN ( 3I ) SCAN ( 3I )

Example 3: The statement SCAN(’FORTRAN’,’BCD’) yields 0.

004– 2138– 003 291


SELECTED_INT_KIND ( 3I ) SELECTED_INT_KIND ( 3I )

NAME
SELECTED_INT_KIND – Returns an integer kind type parameter

SYNOPSIS
SELECTED_INT_KIND ([R=]r)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SELECTED_INT_KIND intrinsic function returns the kind type parameter of an integer data type that
r r
represents all integer values n with -10 < n < 10 . It accepts the following argument:
r Must be scalar and of type integer.
SELECTED_INT_KIND is a transformational function. The name of this intrinsic cannot be passed as an
argument.

RETURN VALUES
This intrinsic function returns the integer kind type parameter corresponding to the decimal exponent range
specified by its argument. The result is a default integer scalar. The result has a value equal to the value of
r
the kind type parameter of an integer data type that represents all values in the range of values – 10 < n <
r
10 , or if no such kind type parameter exists, the result is – 1. If more than one kind type parameter meets
the criteria, the value returned is the one with the smallest decimal exponent range, unless there are several
such values, in which case the smallest of these kind values is returned.

EXAMPLES
The SELECTED_INT_KIND intrinsic function generates the following results:
• SELECTED_INT_KIND(4) yields 2.
• SELECTED_INT_KIND(8) yields 4.
• SELECTED_INT_KIND(13) yields 8.
• SELECTED_INT_KIND(18) yields 8.
• SELECTED_INT_KIND(19) yields -1.

292 004– 2138– 003


SELECTED_INT_KIND ( 3I ) SELECTED_INT_KIND ( 3I )

For information on the integer number model, see the MODELS(3I) man page.

SEE ALSO
MODELS(3I)

004– 2138– 003 293


SELECTED_REAL_KIND ( 3I ) SELECTED_REAL_KIND ( 3I )

NAME
SELECTED_REAL_KIND – Returns the real kind type parameter

SYNOPSIS
SELECTED_REAL_KIND ([[P=]p] [,[R=]r])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SELECTED_REAL_KIND intrinsic function returns the real kind type parameter of a real data type with
decimal precision of at least p digits and a decimal exponent range of at least r. At least one argument must
be present, and the arguments are as follows:
p Must be scalar and of type integer.
r Must be scalar and of type integer.
SELECTED_REAL_KIND is a transformational function. The name of this intrinsic cannot be passed as an
argument.

RETURN VALUES
This intrinsic function returns the real kind type parameter corresponding to the decimal precision and
exponent range specified by its arguments. The result is a default integer scalar. The result has a value
equal to a value of the kind type parameter of a real data type with decimal precision, as returned by the
function PRECISION, of at least p digits and a decimal exponent range, as returned by the function RANGE,
of at least r, or if no such kind type parameter exists, the result is -1 if the precision is not available, -2 if
the exponent range is not available, and -3 if neither is available. If more than one kind type parameter
value meets the criteria, the value returned is the one with the smallest decimal precision, unless there are
several such values, in which case the smallest of these kind values is returned.

294 004– 2138– 003


SELECTED_REAL_KIND ( 3I ) SELECTED_REAL_KIND ( 3I )

EXAMPLES
On UNICOS and UNICOS/mk systems, the following program is run:
PARAME TER (NP =9, NR= 9)
INTEGE R P(N P), R(N R), A(N R), B(N P)
DAT A P /-1,0, 1,6 ,7, 13, 14, 28, 29/
DAT A R /-1,0, 1,3 7,3 8,3 07, 308 ,24 65, 246 6/
WRITE (6,FMT =’( ’’ (P, R)| ’’, 10I 5)’ ) R
WRITE( 6,FMT= ’(" --- ------ --- --- --- --- --- --- --- --- --- --- --- --- -")’)
DO I=1 ,NP
DO J=1,NR
A(J )=SELE CTE D_R EAL _KI ND( P(I ),R (J) )
END DO
WRI TE (6, FMT =’( I6, ’’| ’’, 10I 5)’ ) P(I ),( A(K ),K =1, NR)
END DO

WRITE( 6,FMT= ’(/ /)’ )


WRITE (6,FMT =’( ’’ (P) | (R= NUL L)’ ’,1 0I5 )’)
WRITE( 6,FMT= ’(" --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -") ’)
DO I=1 ,NP
B(I )=SELE CTE D_R EAL_KI ND( P=P (I) )
END DO
WRITE (6,FMT =’( I6, ’’| ’’, I5) ’) (P( K), B(K ),K =1, NP)

WRITE( 6,FMT= ’(/ /)’ )


WRITE (6,FMT =’( ’’ (P= NUL L)| (R) ’’, 10I 5)’ ) R
WRITE( 6,FMT= ’(" --- ------ --- --- --- --- --- --- --- --- --- --- --- --- -")’)
DO J=1 ,NR
A(J )=SELE CTE D_R EAL _KI ND( R=R (J) )
END DO
WRITE (6,FMT =’( I9, ’’| ’’, 10I 5)’ ) 0,( A(K ),K =1, NR)

STOP
END

On IRIX systems, the following program is run:

004– 2138– 003 295


SELECTED_REAL_KIND ( 3I ) SELECTED_REAL_KIND ( 3I )

PAR AMETER (NP =9,NR= 9)


INT EGE R P(N P),R(N R),A(N R)
* TES T CAS E FOR IRI X
DAT A P /-1,0, 1,6 ,7,15, 16, 31, 32/
DATA R /-1,0,1,3 7,3 8,2 91,292 ,30 7,3 08/
WRITE (6, FMT =’(’’ (P,R)| ’’, 10I5)’ ) R
WRI TE(6,FMT= ’(" ------ --- ------ --- --- --- ------ ------ ------ ----",
+ "-- ------ --- --- --- ------ ")’ )
DO I=1 ,NP
DO J=1 ,NR
A(J )=SELECTE D_R EAL _KIND( P(I ),R (J) )
END DO
WRITE (6, FMT=’( I6,’’| ’’, 10I5)’ ) P(I ),( A(K ),K =1, NR)
END DO

WRITE( 6,F MT=’(/ /)’)


WRI TE (6,FMT =’( ’’ (P) | (R= NULL)’ ’,1 0I5)’)
WRI TE(6,FMT= ’(" ------ --- --- ------ --- ------ ------ ------ ------ -")’)
DO I=1,NP
A(I)=SELE CTE D_REAL_KI ND( P=P (I) )
END DO
WRITE (6, FMT =’(I6, ’’|’’, I5) ’) (P(K), A(K ),K=1, NP)

WRITE(6,F MT= ’(//)’ )


WRITE (6, FMT =’(’’ (P=NUL L)| (R) ’’, 10I 5)’ ) R
WRI TE(6,FMT= ’(" ------ --- --- ------ --- ------ ------ ------ ------ -",
+ "-- --------- --- --- --- ------ --- -") ’)
DO J=1 ,NR
A(J )=SELECTE D_R EAL _KI ND(R=R (J) )
END DO
WRITE (6, FMT=’( I9,’’| ’’,10I 5)’ ) 0,( A(K),K =1,NR)

STOP
END

The following tables show the results obtained from the preceding programs.
Return values on IRIX systems:

296 004– 2138– 003


SELECTED_REAL_KIND ( 3I ) SELECTED_REAL_KIND ( 3I )

(p,r) | -1 0 1 37 38 291 292 307 308


--- ------ --- --------- --- --- --- --- --- --- --- --- --- --- --- --- --- ------
-1 | 4 4 4 4 8 8 8 8 -2
0 | 4 4 4 4 8 8 8 8 -2
1 | 4 4 4 4 8 8 8 8 -2
6 | 4 4 4 4 8 8 8 8 -2
7 | 8 8 8 8 8 8 8 8 -2
15 | 8 8 8 8 8 8 8 8 -2
16 | 16 16 16 16 16 -2 -2 -2 -2
31 | 16 16 16 16 16 -2 -2 -2 -2
32 | -1 -1 -1 -1 -1 -1 -1 -1 -3

(p) | (r=NU LL)


--- --- --------- -
-1 | 4
0 | 4
1 | 4
6 | 4
7 | 8
15 | 8
16 | 16
31 | 16
32 | -1

(p=NU LL) | (r) -1 0 1 37 38 291 292 307 308


--- ------ --- --------- --- --- --- --- --- --- --- --- --- --- --- --- --
0 | 4 4 4 4 8 8 8 8 -2

Return values on Cray T90 (IEEE) systems:


(p,r) | -1 0 1 37 38 307 308 493 1 493 2
--- ------ --- --------- --- --- --- --- --- --- --- --- --- --- -
-1 | 4 4 4 4 8 8 16 16 -2
0 | 4 4 4 4 8 8 16 16 -2
1 | 4 4 4 4 8 8 16 16 -2
6 | 4 4 4 4 8 8 16 16 -2
7 | 8 8 8 8 8 8 16 16 -2
15 | 8 8 8 8 8 8 16 16 -2
16 | 16 16 16 16 16 16 16 16 -2
33 | 16 16 16 16 16 16 16 16 -2
34 | -1 -1 -1 -1 -1 -1 -1 -1 -3

004– 2138– 003 297


SELECTED_REAL_KIND ( 3I ) SELECTED_REAL_KIND ( 3I )

(p) | (r=NULL)
--- --- --- -------
-1 | 4
0 | 4
1 | 4
6 | 4
7 | 8
15 | 8
16 | 16
33 | 16
34 | -1

(p=NULL) | (r) -1 0 1 37 38 307 308 4931 4932


--- --- --- --------- --- ------ ------ ------ ------ ------ ------ --
0 | 4 4 4 4 8 8 16 16 -2

SEE ALSO
MODELS(3I)

298 004– 2138– 003


SEMCLR ( 3I ) SEMCLR ( 3I )

NAME
_semclr, _semget, _semput, _semset, _semts – Performs operations on the semaphore

SYNOPSIS
#include <intrinsics.h>
void _semclr (long n);
long _semget (void);
void _semput (long x);
void _semset (long n);
void _semts (long n);

IMPLEMENTATION
UNICOS systems
Cray C/C++

STANDARDS
C/C++ extension

DESCRIPTION
The _semclr function clears semaphore n.
The _semget function returns the value of the entire semaphore mask.
The _semput function stores the bit pattern in data word x into the semaphore mask (SM) register.
The _semset function sets semaphore n.
The _semts function performs a test-and-set operation on the semaphore n.
These functions accept the following variables:
x Data word.
n Value n must be a constant in the range 0 through 31.

NOTES
Because these are intrinsic functions, no externally visible library functions are available for them. The
compiler generates inline code to produce the result.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 299


SET_EXPONENT ( 3I ) SET_EXPONENT ( 3I )

NAME
SET_EXPONENT – Sets exponent part of a number

SYNOPSIS
SET_EXPONENT ([X=]x, [I=]i)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SET_EXPONENT intrinsic function sets the exponent part of a number. It returns the numeric model
number whose fractional part is the fractional part of the real number model representation of x and whose
exponent part is i. For more information on the real number model, see the MODELS(3I) man page. It
accepts the following arguments:
x Must be of type real.
i Must be of type integer.
SET_EXPONENT is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
This routine is implemented on Cray T90 systems that support IEEE arithmetic by calls to scalar– only
library routines.

RETURN VALUES
i-e
The result type and type parameter are the same as x. The result has the value (x)(b ), where b and e are
defined in the model, provided that this result is within range. Argument i should be within the range of
MINEXPONENT(x) ≤ i ≤ MAXEXPONENT(x). If i is outside this range, the results are unpredictable. If x
has value 0, the result has value 0.

EXAMPLES
SET_EXPONENT(3.0,1) yields 1.5.

300 004– 2138– 003


SET_EXPONENT ( 3I ) SET_EXPONENT ( 3I )

SEE ALSO
MODELS(3I)
Fortran Language Reference Manual, Volume 2

004– 2138– 003 301


SET_IEEE_EXCEPTION ( 3I ) SET_IEEE_EXCEPTION ( 3I )

NAME
SET_IEEE_EXCEPTION – Sets floating-point exception indicator

SYNOPSIS
SET_IEEE_EXCEPTION ([EXCEPTION=]exception)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The SET_IEEE_EXCEPTION intrinsic subroutine sets the specified floating-point exception indicator. It
accepts the following argument:
exception Must be of an integer type that occupies a full word. It is an INTENT(IN) argument. If
exception is an array, it must be 1-dimensional. The single argument in the scalar case, or
each array element in the array case, must be set to one of the values represented by the
following named constants:
• IEEE_XPTN_CRI_INVALID_OPND (valid on Cray T90 systems only)
• IEEE_XPTN_INEXACT_RESULT
• IEEE_XPTN_UNDERFLOW
• IEEE_XPTN_OVERFLOW
• IEEE_XPTN_DIV_BY_ZERO
• IEEE_XPTN_INVALID_OPR
• IEEE_XPTN_ALL (all exceptions in this list)
The exception indicator specified by exception (or each element of exception) is set so it indicates that the
exception has occurred.
Using this subroutine to set an exception indicator does not cause the exception to be raised.
SET_IEEE_EXCEPTION is an elemental subroutine. The name of this intrinsic cannot be passed as an
argument.

302 004– 2138– 003


SET_IEEE_EXCEPTION ( 3I ) SET_IEEE_EXCEPTION ( 3I )

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN _IEEE_ DEF INI TIO NS

EXAMPLES
The following example sets the divide by zero exception indicator so that the next time
TEST_IEEE_EXCEPTION tests the indicator, it will indicate the exception has occurred:
CALL SET_IE EE_ EXC EPT ION (IE EE_ XPT N_D IV_ BY_ ZER O)

SEE ALSO
CLEAR_IEEE_EXCEPTION(3I), GET_IEEE_EXCEPTIONS(3I), TEST_IEEE_EXCEPTION(3I)

004– 2138– 003 303


SET_IEEE_EXCEPTIONS ( 3I ) SET_IEEE_EXCEPTIONS ( 3I )

NAME
SET_IEEE_EXCEPTIONS – Restores the caller’s floating-point status prior to exiting a procedure

SYNOPSIS
SET_IEEE_EXCEPTIONS ([STATUS=]status)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The SET_IEEE_EXCEPTIONS intrinsic subroutine restores the caller’s floating-point status just before
exiting a procedure. It accepts the following argument:
status Must be scalar and of an integer type that occupies a full word. It is an INTENT(IN)
argument.
On Cray T90 systems that support IEEE floating-point arithmetic, the bits in status that represent exception
flags are stored into the appropriate bits of SR0. On other architectures, the flags are stored into the
appropriate flag bits of memory word(s)/register(s) that record the floating-point state.
The value of status is assumed to have been set by GET_IEEE_STATUS(3I).
The name of this intrinsic cannot be passed as an argument.

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN_IE EE_DEF INI TIO NS

EXAMPLES
See the example on CLEAR_IEEE_EXCEPTION(3I).

SEE ALSO
CLEAR_IEEE_EXCEPTION(3I), GET_IEEE_STATUS(3I)

304 004– 2138– 003


SET_IEEE_INTERRUPTS ( 3I ) SET_IEEE_INTERRUPTS ( 3I )

NAME
SET_IEEE_INTERRUPTS – Restores floating-point interrupt status before exiting a procedure

SYNOPSIS
SET_IEEE_INTERRUPTS ([STATUS=]status)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The SET_IEEE_INTERRUPTS intrinsic subroutine is typically used to restore the caller’s floating-point
interrupt status just before exiting a procedure. It accepts the following argument:
status Must be scalar and of an integer type that occupies a full word. It is an INTENT(IN)
argument.
On Cray T90 systems, the bits in status that represent interrupt flags are stored into the appropriate bits of
SR0. On other architectures, the flags are stored into the appropriate flag bits of memory word(s)/register(s)
that record the floating-point interrupt state.
The contents of status are assumed to have been set by an invocation of GET_IEEE_INTERRUPTS(3I).
The name of this intrinsic cannot be passed as an argument.

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN _IEEE_ DEF INI TIO NS

EXAMPLES
See the example on DISABLE_IEEE_INTERRUPT(3I).

SEE ALSO
DISABLE_IEEE_INTERRUPT(3I), GET_IEEE_INTERRUPTS(3I)

004– 2138– 003 305


SET_IEEE_ROUNDING_MODE ( 3I ) SET_IEEE_ROUNDING_MODE ( 3I )

NAME
SET_IEEE_ROUNDING_MODE – Alters current floating-point rounding mode state and restores the
floating-point rounding mode before exiting a procedure

SYNOPSIS
SET_IEEE_ROUNDING_MODE ([ROUNDING_MODE=]rounding_mode)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The SET_IEEE_ROUNDING_MODE intrinsic subroutine is typically used to alter the current floating-point
rounding mode state and to restore the caller’s floating-point rounding mode just before exiting a procedure.
It accepts the following argument:
rounding_mode
Must be scalar and of an integer type that occupies a full word. It is an INTENT(IN)
argument.
The floating-point rounding mode is set to the rounding mode indicated by rounding_mode.
rounding_mode must have one of the values represented by the following named constants:
• IEEE_RM_NEAREST
• IEEE_RM_POS_INFINITY
• IEEE_RM_ZERO
• IEEE_RM_NEG_INFINITY
rounding_mode is assumed to have been set through an invocation of
GET_IEEE_ROUNDING_MODE(3I).
The IEEE_REAL(3I) and IEEE_INT(3I) functions are the only routines supplied by Silicon Graphics that
examine the setting of the rounding mode on Cray T90 systems that support IEEE arithmetic, UNICOS/mk
systems, and IRIX systems.

306 004– 2138– 003


SET_IEEE_ROUNDING_MODE ( 3I ) SET_IEEE_ROUNDING_MODE ( 3I )

The name of this intrinsic cannot be passed as an argument.

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN _IE EE_ DEFINITIO NS

EXAMPLES

! Ass ume the follow ing cod e is exe cut ing on a mac hin e whe re def ault
! int ege r occupies a ful l wor d.

INT EGE R sav e_r ounding_m ode

! Sav e the cur rent rou nding mod e the n cha nge the rou nding mode
! to rou nd to pos itive inf ini ty.

CAL L GET _IE EE_ ROUNDING_ MOD E(s ave_ro und ing _mode)
CAL L SET _IE EE_ROUNDI NG_ MOD E(IEEE _RM _PO S_I NFINIT Y)

! Cal cul ate the upper bou nd on sum.

DO i = 1, n
xup (i) = y(i ) + z(i )
END DO

! Res et to round to neg ati ve inf ini ty mod e.

CAL L SET _IE EE_ROUNDI NG_ MOD E(IEEE _RM _NE G_I NFINIT Y)

! Cal cul ate low er bound on sum .

DO i = 1, n
xdn (i) = y(i ) + z(i )
END DO

! Res tor e ori ginal rou ndi ng mode and ret urn to the cal ler.

CAL L SET _IE EE_ROU NDI NG_ MODE(s ave _ro und ing_mo de)

004– 2138– 003 307


SET_IEEE_ROUNDING_MODE ( 3I ) SET_IEEE_ROUNDING_MODE ( 3I )

SEE ALSO
GET_IEEE_ROUNDING_MODE(3I)

308 004– 2138– 003


SET_IEEE_STATUS ( 3I ) SET_IEEE_STATUS ( 3I )

NAME
SET_IEEE_STATUS – Restores floating-point status

SYNOPSIS
SET_IEEE_STATUS ([STATUS=]status)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The SET_IEEE_STATUS intrinsic subroutine is typically used to restore the caller’s floating-point status
just before exiting a procedure. It accepts the following argument:
status Must be scalar and of an integer type that occupies a full word. It is an INTENT(IN)
argument.
On Cray T90 systems that support IEEE floating-point arithemetic, its value (contained in a
64-bit word) is stored into SR0. On other architectures, the flags are stored into the appropriate
flag bits of the word(s) or register(s) that record the floating-point state.
The value in status is assumed to have been produced through an invocation of
GET_IEEE_STATUS(3I).
The name of this intrinsic cannot be passed as an argument.

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN _IEEE_ DEF INI TIO NS

There are 6 bits, called the IEEE Floating Point Exception Status Bits or the sticky bits, that indicate whether
any one of 6 possible exceptions has occurred (the 5 exceptions specified by the IEEE floating-point standard
and a Silicon Graphics extension). The user program begins with these bits cleared to zero. The occurrence
of any of the exceptions will set the corresponding bit. Only the user can clear these bits.

004– 2138– 003 309


SET_IEEE_STATUS ( 3I ) SET_IEEE_STATUS ( 3I )

EXAMPLES

! Assume this exa mpl e dem ons tra tes cod e for an IRI X sys tem
! where defaul t int ege r typ e occ upi es a ful l wor d.

SUB ROUTIN E CAL CUL ATE


USE FTN_IE EE_DEF INI TIO NS
INT EGER IEEE_S TAT US
... ! Onl y stm ts her e tha t can ’t cha nge the
! flo ati ng poi nt sta tus .
CAL L GET _IEEE_ STA TUS (IE EE_ STA TUS )
... ! Bod y of the pro ced ure .
CAL L SET _IEEE_ STA TUS (IE EE_ STA TUS )
END SUBROU TINE

GET_IEEE_STATUS(3I) is called upon entry to the example’s procedure CALCULATE to capture the
current floating-point status. If procedure CALCULATE changes the floating-point status, the original
floating-point status can be reset before exiting from CALCULATE by calling SET_IEEE_STATUS.

SEE ALSO
GET_IEEE_STATUS(3I)

310 004– 2138– 003


SHAPE ( 3I ) SHAPE ( 3I )

NAME
SHAPE – Returns the shape of an array or a scalar

SYNOPSIS
SHAPE ([SOURCE=]source)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SHAPE intrinsic function returns the shape of an array or a scalar. It accepts the following argument:
source May be of any type. It can be array valued or scalar. It must not be a pointer that is
disassociated or an allocatable array that is not allocated. It must not be an assumed-size array.
SHAPE is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a default integer array of rank 1 whose size is equal to the rank of source. The value of the
result is the shape of source.

EXAMPLES
SHAPE(A(2:5,-1:1)) yields (/4,3/).
SHAPE(3) yields a zero-sized, rank-one array.

004– 2138– 003 311


SHIFT ( 3I ) SHIFT ( 3I )

NAME
SHIFT – Performs a left circular shift

SYNOPSIS
SHIFT ([I=]i,[J=]j)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
SHIFT performs a left circular shift of i by j bits. It accepts the following arguments:
i The value to be shifted. i can be of type Boolean, integer, real, or Cray pointer.
j The number of bits to shift the value. Must be of type integer or Boolean. j must be within the
range 0 ≤ j ≤size, where size is the size, in bits, of i. That is, if i is a 64-bit object, j must be
within the range 0 ≤ j ≤ 64.
For values of j outside these ranges, SHIFT returns an undefined result.
On UNICOS systems, an object is 64 bits. On UNICOS/mk systems, an object is 32 bits or 64 bits. On
IRIX systems, an object is 8 bits, 16 bits, 32 bits, or 64 bits.
SHIFT is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
This is an outmoded routine. Refer to the Fortran Language Reference Manual, Volume 2, for information
about outmoded features and their preferred standard alternatives.
The bit representation of the logical data type is not consistent among UNICOS and UNICOS/mk systems.
For further details, see your compiler’s reference manuals.

RETURN VALUES
SHIFT returns a value of type Boolean on UNICOS and UNICOS/mk systems. It returns an integer result
on IRIX systems.

312 004– 2138– 003


SHIFT ( 3I ) SHIFT ( 3I )

EXAMPLES
The following section of Fortran code shows the SHIFT function used in the case where i is of type integer.
For simplicity, a 16-bit object is used. The bit pattern of i and the bit pattern of the result are also given.
INT EGER I1, I2, I3
...
I2 = 5
I3 = SHIFT( I1, I2)

------ --- --- --- ------ --- --- --- --- --- --- --- --- --- --- --- --- ------
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
------ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
I1 (i)

------ --- --- --- ------ --- --- --- --- --- --- --- --- --- --- --- --- ------
| 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 |
------ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
I3 (re sul t)

SEE ALSO
SHIFTL(3I)

004– 2138– 003 313


SHIFTA ( 3I ) SHIFTA ( 3I )

NAME
SHIFTA – Performs an arithmetic shift

SYNOPSIS
SHIFTA ([I=]i, [J=]j)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
The SHIFTA intrinsic function performs a right shift with sign extension fill of the object i by j. Its
arguments are as follows:
i The value to be shifted. Must be of type Boolean, integer, real, or Cray pointer.
j The number of bits to shift the value. Must be of type integer or Boolean. j must be within the
range 0 ≤ j ≤ size, where size is the size, in bits, of i. That is, if i is a 64-bit object, j must be
within the range 0 ≤ j ≤ 64.
For values of j outside these ranges, SHIFTA returns an undefined result.
On UNICOS systems, an object is 64 bits. On UNICOS/mk systems, an object is 32 bits or 64 bits. On
IRIX systems, an object is 8 bits, 16 bits, 32 bits, or 64 bits.
SHIFTA is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
The bit representation of the logical data type is not consistent among UNICOS and UNICOS/mk systems.
For further details, see the Fortran Language Reference Manual, Volume 3.

RETURN VALUES
SHIFTA returns a value of type Boolean on UNICOS and UNICOS/mk systems. It returns an integer result
on IRIX systems.

314 004– 2138– 003


SHIFTA ( 3I ) SHIFTA ( 3I )

EXAMPLES
The following section of Fortran code shows the SHIFTA function used in the case where i is of type
integer. The bit pattern of i and the bit pattern of the result are shown. For clarity, a 16-bit value is used
rather than a 64-bit value.
INT EGER I1, I2, I3
...
I2 = 5
I3 = SHIFTA (I1 ,I2 )

---------------------------------------------------------------
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
---------------------------------------------------------------
I1 (i)

---------------------------------------------------------------
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
---------------------------------------------------------------
I3 (result)

004– 2138– 003 315


SHIFTL ( 3I ) SHIFTL ( 3I )

NAME
SHIFTL – Performs a left shift with zero fill

SYNOPSIS
SHIFTL ([I=]i,[J=]j)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
The SHIFTL intrinsic function performs a left shift with zero fill of i by j bits. It accepts the following
arguments:
i The value to be shifted. i can be of type Boolean, integer, real, or Cray pointer.
j The number of bits to shift the value. Must be of type integer or Boolean. j must be within the
range 0 ≤ j ≤size, where size is the size, in bits, of i. That is, if i is a 64-bit object, j must be
within the range 0 ≤ j ≤ 64.
On UNICOS systems, an object is 64 bits. On UNICOS/mk systems, an object is 32 bits or 64 bits. On
IRIX systems, an object is 8 bits, 16 bits, 32 bits, or 64 bits.
SHIFTL is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
This is an outmoded routine. Refer to the Fortran Language Reference Manual, Volume 2, for information
about outmoded features and their preferred standard alternatives.
The bit representation of the logical data type is not consistent among UNICOS and UNICOS/mk systems.
For further details, see your compiler’s reference manuals.

RETURN VALUES
SHIFTL returns a value of type Boolean on UNICOS and UNICOS/mk systems. It returns an integer result
on IRIX systems.

316 004– 2138– 003


SHIFTL ( 3I ) SHIFTL ( 3I )

EXAMPLES
The following section of Fortran code shows the SHIFTL function used in the case where i is of type
integer. The bit pattern of i and the bit pattern of the result are also given. For simplicity, a 16-bit object is
used.
INT EGER I1, I2, I3
...
I2 = 5
I3 = SHIFTL (I1 ,I2 )

------ --- --- --- ------ --- --- --- --- --- --- --- --- --- --- --- --- ------
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
------ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
I1 (i)

------ --- --- --- ------ --- --- --- --- --- --- --- --- --- --- --- --- ------
| 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
------ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
I3 (re sul t)

004– 2138– 003 317


SHIFTR ( 3I ) SHIFTR ( 3I )

NAME
SHIFTR – Performs a right shift with zero fill

SYNOPSIS
SHIFTR ([I=]i,[J=]j)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
The SHIFTR intrinsic function performs a right shift with zero fill of the i by j bits. It accepts the following
arguments:
i The value to be shifted. i can be of type Boolean, integer, real, or Cray pointer.
j The number of bits to shift the value. Must be of type integer or Boolean. j must be within the
range 0 ≤ j ≤size, where size is the size, in bits, of i. That is, if i is a 64-bit object, j must be
within the range 0 ≤ j ≤ 64.
On UNICOS systems, an object is 64 bits. On UNICOS/mk systems, an object is 32 bits or 64 bits. On
IRIX systems, an object is 8 bits, 16 bits, 32 bits, or 64 bits.
SHIFTR is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
This is an outmoded routine. Refer to the Fortran Language Reference Manual, Volume 2, for information
about outmoded features and their preferred standard alternatives.
The bit representation of the logical data type is not consistent among UNICOS and UNICOS/mk systems.
For further details, see your compiler’s reference manuals.

RETURN VALUES
SHIFTR returns a value of type Boolean on UNICOS and UNICOS/mk systems. It returns an integer result
on IRIX systems.

318 004– 2138– 003


SHIFTR ( 3I ) SHIFTR ( 3I )

EXAMPLES
The following section of Fortran code shows the SHIFTR function used in the case where i is of type
integer. The bit pattern of i and the bit pattern of the result are also given. For simplicity, a 16-bit object is
used.
INT EGER I1, I2, I3
...
I2 = 5
I3 = SHIFTR (I1 ,I2 )

------ --- --- --- ------ --- --- --- --- --- --- --- --- --- --- --- --- ------
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
------ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
I1 (i)

------ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
------ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
I3 (re sul t)

004– 2138– 003 319


SHORT ( 3I ) SHORT ( 3I )

NAME
SHORT – Returns integer (KIND=2) result

SYNOPSIS
SHORT ([A=]a)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
SHORT returns an integer (KIND=2) result for a given argument. This intrinsic accepts the following
argument:
a Must be of type integer, real, or complex.
This is an elemental function. The name of this intrinsic cannot be passed an an argument.

RETURN VALUES
The return value is an integer (KIND=2).

SEE ALSO
LONG(3I)

320 004– 2138– 003


SIGN ( 3I ) SIGN ( 3I )

NAME
SIGN, DSIGN, QSIGN, ISIGN, IISIGN, JISIGN, KISIGN – Transfers the sign of numbers

SYNOPSIS
SIGN ([A=]a,[B=]b)
DSIGN ([A=]a,[B=]b)
QSIGN ([A=]a,[B=]b)
ISIGN ([A=]a,[B=]b)
IISIGN ([A=]a,[B=]b)
JISIGN ([A=]a,[B=]b)
KISIGN ([A=]a,[B=]b)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: ISIGN, IISIGN, JISIGN, KISIGN, DSIGN, QSIGN

DESCRIPTION
These intrinsics transfer the sign of b to a. SIGN is the generic function name; the others are specifics.
These are elemental intrinsic functions. They accept the following arguments:
a Must be of type integer or real. If a is zero, the result is zero for SIGN, ISIGN, DSIGN, and
QSIGN.
b Must be of the same type and kind type as a.
These functions evaluate one of the following equations, depending on the sign of the number:
y =  a , if b ≥ 0
or
y = –  a , if b < 0
SIGN transfers the sign from one real number to another.
ISIGN transfers the sign from one integer (KIND=2 or KIND=4) to another.
IISIGN transfers the sign from one integer (KIND=2) to another.

004– 2138– 003 321


SIGN ( 3I ) SIGN ( 3I )

JISIGN transfers the sign from one integer (KIND=4) to another.


KISIGN transfer the sign from one integer (KIND=8) to another.
DSIGN transfers the sign from one double-precision real number to another.
QSIGN transfers the sign from one quad-precision real number to another.
The SIGN, ISIGN, and DSIGN intrinsic function names can be passed as arguments; the other cannot.

EXAMPLES
The SIGN intrinsic function yields differing values depending on your platform, as follows:
• On UNICOS/mk and UNICOS systems that support IEEE floating-point arithmetic, SIGN(-1.0,-.0)
yields -1.0.
• On UNICOS systems that do not support IEEE floating-point arithmetic, SIGN(-1.0,-.0) yields 1.0.
• On IRIX systems, SIGN(-1.0,-.0) yields 1.0.
• On IRIX systems, if the program is compiled with the -LANG:IEEE_minus_zero=ON option,
SIGN(-1.0,-.0) yields -1.0.

322 004– 2138– 003


SIN ( 3I ) SIN ( 3I )

NAME
SIN, DSIN, QSIN, CSIN, CDSIN, CQSIN, SIND, DSIND, QSIND – Computes sine

SYNOPSIS
SIN ([X=]x)
DSIN ([X=]x)
QSIN ([X=]x)
CSIN ([X=]x)
CDSIN ([X=]x)
CQSIN ([X=]x)
SIND ([X=]x)
DSIND ([X=]x)
QSIND ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QSIN, CDSIN, CQSIN, SIND, DSIND, QSIND

DESCRIPTION
These functions evaluate y = sin(x).
SIN and SIND are the generic function names; the others are specifics. These are elemental intrinsic
functions. They accept the following argument:
x Must be of type real or complex. For SIN, DSIN, QSIN, CSIN, CDSIN, and CQSIN, x must
be specified in radians and is treated as modulo 2 * pi. For SIND, DSIND, and QSIND, x must
be specified in degrees and is treated as modulo 360.
Vector versions of these intrinsics exist on some systems. Vector versions of the SIN, DSIN, CSIN, and
CDSIN intrinsics exist on UNICOS and UNICOS/mk systems. On UNICOS/mk systems, the vector versions
of these intrinsics are used when -O vector3 or -O3 are specified on the compiler command line. A
vector version of the single-precision and double-precision SIN intrinsic exists on IRIX systems and is used
when -O3 is specified on the compiler command line.

004– 2138– 003 323


SIN ( 3I ) SIN ( 3I )

NOTES
The SIN, DSIN, and CSIN intrinsic function names can be passed as arguments; the others cannot.
Return values differ, depending on your platform, as follows:
• On UNICOS and UNICOS/mk systems that support the IEEE standard for floating-point arithmetic,
25
SIN(x) yields NaN if  x > 2 .
• On UNICOS systems that do not support the IEEE standard for floating-point arithmetic, SIN(x) yields
25
0 if  x > 2 .
• On IRIX systems, SIN(x) yields NaN if  x > 2 19 .
On all systems that support the IEEE standard for floating-point arithmetic, SIN(NaN) yields NaN.

RETURN VALUES
SIN returns the real sine of its real arguments.
DSIN returns the double-precision real sine of its double-precision real argument.
QSIN return the quad-precision real sine of its quad-precision real argument.
CSIN returns the complex sine of its complex argument.
CDSIN returns the double-precision complex sine of its double-precision complex argument.
CQSIN returns the quad-precision complex sine of its quad-precision complex argument.
SIND returns the single-precision real sine of its single-precision real argument.
DSIND returns the double-precision real sine of its double-precision real argument.
QSIND returns the quad-precision real sine of its quad-precision real argument.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

324 004– 2138– 003


SINH ( 3I ) SINH ( 3I )

NAME
SINH, DSINH, QSINH – Computes hyperbolic sine

SYNOPSIS
SINH ([X=]x)
DSINH ([X=]x)
QSINH ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QSINH

DESCRIPTION
These are elemental intrinsic functions. SINH is the generic function name. These functions accept the
following argument:
x Must be of type real. See the RETURN VALUES section for information on input data types
and return values.
x –x
These functions evaluate y = sinh(x) = (e – e ) / 2.

NOTES
The names of these intrinsics can be passed as arguments.

RETURN VALUES
SINH returns the real hyperbolic sine of its real argument.
DSINH returns the double-precision real hyperbolic sine of its double-precision real argument.
QSINH returns the quad-precision real hyperbolic sine of its quad-precision real argument.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

004– 2138– 003 325


SINH ( 3I ) SINH ( 3I )

EXAMPLES
On Cray T90 systems that support IEEE arithmetic, the following return values occur:
• If x > 709.78, SINH(x) yields infinity.
• If x < -709.78, SINH(x) yields -infinity.
• SINH(NaN) yields NaN.

326 004– 2138– 003


SIZE ( 3I ) SIZE ( 3I )

NAME
SIZE – Returns the total number of elements in an array

SYNOPSIS
SIZE ([ARRAY=]array [,[DIM=]dim])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SIZE intrinsic function returns the extent of an array along a specified dimension or the total number of
elements in the array. It accepts the following arguments:
array May be of any type. It must not be scalar. It must not be a pointer that is disassociated or an
allocatable array that is not allocated. If array is an assumed-size array, dim must be present
with a value less than the rank of array.
dim Must be scalar and of type integer with a value in the range 1 ≤ dim ≤ n, where n is the rank of
array.
SIZE is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a default integer scalar. The result has a value equal to the extent of dimension dim of array
or, if dim is absent, the total number of elements of array.

EXAMPLES
SIZE(A(2:5,-1:1),DIM=2) yields 3.
SIZE(A(2:5,-1:1)) yields 12.

004– 2138– 003 327


SIZEOF ( 3I ) SIZEOF ( 3I )

NAME
SIZEOF – Returns bytes of storage

SYNOPSIS
SIZEOF ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran extension

DESCRIPTION
The SIZEOF inquiry function returns the number of bytes of storage used by x. This function accepts the
following argument:
x A scalar or array of type character, complex, integer, logical, or real. Cannot be an assumed-size
array.
The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type and type parameter are of type default integer.

328 004– 2138– 003


SPACING ( 3I ) SPACING ( 3I )

NAME
SPACING – Returns the absolute spacing of real model numbers near the argument value

SYNOPSIS
SPACING ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SPACING intrinsic function returns the absolute spacing of real model numbers near the argument
value. It accepts the following argument:
x Must be of type real
SPACING is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
This routine is implemented on Cray T90 systems that support IEEE arithmetic by calls to scalar– only
library routines.

RETURN VALUES
e– p
The result type and type parameter are the same as x. The result has the value b , where b, e, and p are as
defined in the real number model, provided this result is within range. If not, the result is the same as that
of TINY (x). For more information on the real number model, see the MODELS(3I) man page.

EXAMPLES
Example 1: Cray C90 systems yield the following values:
• SPACING(3.0) yields 2.8421709430404E-14.
• SPACING(3.0_4) yields 2.384185791015625E-7.
• SPACING(3.0_8) yields 2.8421709430404E-14.
• SPACING(3.0_16) yields 1.009741958682895E-28.

004– 2138– 003 329


SPACING ( 3I ) SPACING ( 3I )

The first is default type real, and the others are defined.
Example 2: IRIX systems yield the following values:
• SPACING(3.0) yields 2.384185791E-7.
• SPACING(3.0_4) yields 2.384185791E-7.
• SPACING(3.0_8) yields 4.44089209850062616E-16.
• SPACING(3.0_16) yields 2.46519032881566189191165176650870697E-32.
The first is default type real, and the others are defined.
Example 3: UNICOS/mk systems yield the following values:
• SPACING(3.0) yields 4.44089209850062616E-16.
• SPACING(3.0_4) yields 2.384185791015625E-7.
• SPACING(3.0_8) yields 4.44089209850062616E-16.
• SPACING(3.0_16) yields 4.44089209850062616E-16.
Example 4: Cray T90 systems that support IEEE floating-point yield the following values:
• SPACING(3.0) yields 4.44089209850062616E-16.
• SPACING(3.0_4) yields 4.44089209850062616E-16.
• SPACING(3.0_8) yields 4.44089209850062616E-16.
• SPACING(3.0_16) yields 3.85185988877447171E-34.
Note that there is no KIND=4 value and that default is KIND=8.

SEE ALSO
MODELS(3I)

330 004– 2138– 003


SPREAD ( 3I ) SPREAD ( 3I )

NAME
SPREAD – Constructs an array from several copies of an argument

SYNOPSIS
SPREAD ([SOURCE=]source, [DIM=]dim, [NCOPIES=]ncopies)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SPREAD intrinsic function constructs an array from several copies of an argument. This intrinsic
function can be used for array construction. It replicates an array by adding a dimension. It broadcasts
several copies of source along a specified dimension and thus forms an array of rank one greater. SPREAD
accepts the following arguments:
source May be of any type. It may be scalar or array valued. The rank of source must be less than 7.
dim Must be scalar and an integer with value in the range of 1 ≤ dim ≤ n + 1, where n is the rank of
source.
ncopies Must be scalar and an integer.
SPREAD is a transformational intrinsic function. The name of this intrinsic cannot be passed as an
argument.

RETURN VALUES
The result is an array of the same type as source and of rank n+1, where n is the rank of source.
If source is scalar, the shape of the result is MAX(ncopies,0). If source is array valued with shape
(d 1 , d 2 , . . ., d n ), the shape of the result is (d 1 , d 2 , . . ., d dim– 1 , MAX(ncopies, 0), d dim , . . ., d n ).
If source is scalar, each element of the result has a value equal to source.
If source is array valued, the element of the result with subscripts (r 1 , r 2 , . . ., r n+1 ) has the value
source(r 1 , r 2 , . . ., r dim– 1 , r dim+1 , . . ., r n+1 )).

004– 2138– 003 331


SPREAD ( 3I ) SPREAD ( 3I )

EXAMPLES
Example 1: Assume that ISCALR is the scalar value of 8. The following statements are then true:
• SPREAD(ISCALR,DIM=1,NCOPIES=0) yields a zero-sized array.
• SPREAD(ISCALR,DIM=1,NCOPIES=2) yields (/8,8/).
Example 2: Assume that A is the array [2,3,4]. The following statements are then true:
• SPREAD(A,DIM=1,NCOPIES=0) yields a zero-sized array.
• SPREAD(A,DIM=1,NCOPIES=3) yields:
 234
 234
 234
• SPREAD(A,DIM=2,NCOPIES=3) yields:
 222
 333
 444

332 004– 2138– 003


SQRT ( 3I ) SQRT ( 3I )

NAME
SQRT, DSQRT, QSQRT, CSQRT, CDSQRT, CQSQRT – Computes square root

SYNOPSIS
SQRT ([X=]x)
DSQRT ([X=]x)
QSQRT ([X=]x)
CSQRT ([X=]x)
CDSQRT ([X=]x)
CQSQRT ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extensions: QSQRT, CDSQRT, CQSQRT

DESCRIPTION
The SQRT, DSQRT, QSQRT, CSQRT, CDSQRT, and CQSQRT intrinsic functions compute the square root of
their arguments.
1/2
These functions evaluate y = x .
SQRT is the generic function name; the others are specifics. These are elemental intrinsic functions. They
accept the following argument:
x Must be of type real or complex. If i is of type real, it must be greater than or equal to zero.
Vector versions of these intrinsics exist on some systems. Vector versions of the SQRT, DSQRT, CSQRT,
and CDSQRT intrinsics exist on UNICOS and UNICOS/mk systems. On UNICOS/mk systems, the vector
versions of these intrinsics are used when -O vector3 or -O3 are specified on the compiler command
line. A vector version of the single-precision and double-precision SQRT intrinsic exists on IRIX systems
and is used when -O3 is specified on the compiler command line.

NOTES
The SQRT, DSQRT, and CSQRT intrinsic function names can be passed as arguments; the others cannot.
On Cray T90 systems that support IEEE arithmetic, the following return values occur:
• SQRT(0) yields 0.
• SQRT(-0) yields -0.

004– 2138– 003 333


SQRT ( 3I ) SQRT ( 3I )

• If x < 0, SQRT(x) yields NaN.


• SQRT(NaN) yields NaN.
• SQRT(infinity) yields infinity.
RETURN VALUES
SQRT returns the real square root of its real argument.
DSQRT returns the double-precision square root of its double-precision argument.
QSQRT returns the quad-precision square root of its quad-precision argument.
CSQRT returns the complex square root of its complex argument.
CDSQRT returns the double-precision complex square root of its double-precision complex argument.
CQSQRT returns the double-precision complex square root of its quad-precision complex argument.

334 004– 2138– 003


SUM ( 3I ) SUM ( 3I )

NAME
SUM – Sums array elements

SYNOPSIS
SUM ([ARRAY=]array [,[DIM=]dim] [,[MASK=]mask])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SUM intrinsic function sums all the elements of array along dimension dim that correspond to the true
elements of mask. It accepts the following arguments:
array Must be of type integer, real, or complex. It must not be scalar.
dim Must be scalar and of type integer with a value in the range 1 ≤ dim ≤ n, where n is the rank of
array. The corresponding actual argument must not be an optional dummy argument.
mask Must be of type logical and must be conformable with array.
SUM is a transformational intrinsic function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is of the same type and kind type parameter as array. It is scalar if dim is absent or if array has
rank one; otherwise, the result is an array of rank n– 1 and of shape (d 1 , d 2 , . . ., d dim– 1 , d dim+1 , . . ., d n ),
where (d 1 , d 2 , . . ., d n ) is the shape of array.
The result of SUM(array) has a value equal to the sum of all the elements of array. If array has size 0, it
has the value 0.
The result of SUM(array,MASK=mask) has a value equal to the sum of the elements of array corresponding
to the true elements of mask. It has the value 0 if there are no true elements.
If array has rank one, SUM(array,dim[,mask]) has a value equal to that of SUM(array[,MASK=mask]).
Otherwise, the value of element (s 1 , s 2 , . . ., s dim– 1 , s dim+1 , . . ., s n ) of SUM(array,dim[,mask]) is equal to
SUM(array(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n ) [, MASK=mask(s 1 , s 2 , . . ., s dim– 1 , : , s dim+1 , . . ., s n )]).

004– 2138– 003 335


SUM ( 3I ) SUM ( 3I )

EXAMPLES
Example 1: SUM((/1,2,3/)) yields 6.
Example 2: SUM(C,MASK=C.GT.0.0) yields the arithmetic sum of the positive elements of C.
Example 3: Assume that B is the following array:
 135
 246
In this case, the following are true:
• SUM(B,DIM=1) yields (/3,7,11/).
• SUM(B,DIM=2) yields (/9,12/).

336 004– 2138– 003


SYNC ( 3I ) SYNC ( 3I )

NAME
LOCK_RELEASE, SYNCHRONIZE, AND_AND_FETCH, ADD_AND_FETCH, COMPARE_AND_SWAP,
FETCH_AND_ADD, FETCH_AND_AND, FETCH_AND_NAND, FETCH_AND_OR, FETCH_AND_SUB,
FETCH_AND_XOR, LOCK_TEST_AND_SET, NAND_AND_FETCH, OR_AND_FETCH, SUB_AND_FETCH,
XOR_AND_FETCH, – Fortran synchronization intrinsics for multiprocessing

SYNOPSIS
CALL LOCK_RELEASE ([I=]i)
CALL SYNCHRONIZE
ADD_AND_FETCH ([I=]i, [J=]j)
AND_AND_FETCH ([I=]i, [J=]j)
COMPARE_AND_SWAP ([I=]i, [J=]j, [K=]k)
FETCH_AND_ADD ([I=]i, [J=]j)
FETCH_AND_AND ([I=]i, [J=]j)
FETCH_AND_NAND ([I=]i, [J=]j)
FETCH_AND_OR ([I=]i, [J=]j)
FETCH_AND_SUB ([I=]i, [J=]j)
FETCH_AND_XOR ([I=]i, [J=]j)
LOCK_TEST_AND_SET ([I=]i, [J=]j)
NAND_AND_FETCH ([I=]i, [J=]j)
OR_AND_FETCH ([I=]i, [J=]j)
SUB_AND_FETCH ([I=]i, [J=]j)
XOR_AND_FETCH ([I=i, [J=]j)

IMPLEMENTATION
IRIX systems
MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
The synchronization intrinsics provide a variety of synchronization operations. LOCK_RELEASE and
SYNCHRONIZE are intrinsic subroutines; all the others are elemental intrinsic functions. These intrinsics
accept the following arguments:
i An integer. i must be KIND=4 or KIND=8.
j An integer. j must be the same kind type as i.
k An integer. k must be the same kind type as i and j.

004– 2138– 003 337


SYNC ( 3I ) SYNC ( 3I )

The memory barrier intrinsics perform either an acquire barrier, release barrier, or full barrier operation. The
operation type and the intrinsics that accomplish that type of task are as follows:
Type Description
Acquire barrier Prevents the movement of memory references to visible data from after the intrinsic
(in program order) to before the intrinsic. This behavior is desirable for lock-acquire
operations.
Acquire barrier operations can be accomplished by using the
LOCK_TEST_AND_SET intrinsic subroutine. This subroutine atomically stores the
value of the second argument into the first argument. It returns the old value of the
first argument.
Release barrier Prevents the movement of memory references to visible data from before the
intrinsic (in program order) to after the intrinsic. This behavior is desirable for
lock-release operations.
Release barrier operations can be accomplished by using the LOCK_RELEASE
intrinsic subroutine. This subroutine sets its argument to zero.
Full barrier Prevents the movement of memory references to visible data past the intrinsic in
either direction. These act as both an acquire and a release barrier. A barrier only
restricts the movement of memory references to visible data across the intrinsic
operation. Between synchronization operations (or in their absence), memory
references to visible data can be freely reordered, subject to the usual
data-dependence constraints.
Full barrier operations are divided into the following groups:
• Atomic FETCH_AND_op operations. The FETCH_AND_ADD,
FETCH_AND_AND, FETCH_AND_NAND, FETCH_AND_OR, FETCH_AND_SUB,
and FETCH_AND_XOR intrinsic functions perform the operation with the second
argument on the first argument. They return the old value of the first argument.
• Atomic op_AND_FETCH operations. The ADD_AND_FETCH,
AND_AND_FETCH, NAND_AND_FETCH, OR_AND_FETCH, SUB_AND_FETCH,
and XOR_AND_FETCH intrinsic functions perform the operation with the second
argument on the first argument. They return the new value of the second
argument.
• Atomic COMPARE_AND_SWAP operation. The COMPARE_AND_SWAP intrinsic
function compares the value of the first argument to the value of the second. If
they are equal, the value of the third argument is stored into the first and the
return value is TRUE. Otherwise, the return value is FALSE.
• Atomic SYNCHRONIZE operation. This is performed with the SYNCHRONIZE
intrinsic subroutine.

338 004– 2138– 003


SYNC ( 3I ) SYNC ( 3I )

RETURN VALUES
The COMPARE_AND_SWAP intrinsic function returns TRUE or FALSE. All other intrinsic functions return
a value of type integer. The integer values returned are of the same kind type as the arguments provided.

NOTES
Each intrinsic possesses two key properties:
• The operation performed is guaranteed to be atomic. This is typically achieved by implementing the
operation using a sequence of load-linked/store-conditional instructions in a loop.
• Associated with each intrinsic are certain memory barrier properties that restrict the movement of memory
references to visible data across the intrinsic operation (by either the compiler or the processor).
A visible memory reference is a reference to a data object potentially accessible by another thread executing
in the same shared address space. A visible data object can be one of the following:
• C/C++ global data
• Fortran COMMON data
• VOLATILE data
• Static data (either file-scope or function-scope)
• Data accessible through function parameters
• AUTOMATIC data (local-scope) that has had its address taken and assigned to some object that is visible
(recursively).

CAUTIONS
Conditional execution of a synchronization intrinsic, such as within an IF or WHILE block, does not prevent
the movement of memory references to visible data past the overall IF or WHILE construct.

004– 2138– 003 339


SYNC_IMAGES ( 3I ) SYNC_IMAGES ( 3I )

NAME
SYNC_IMAGES – Synchronizes images

SYNOPSIS
SYNC_IMAGES([[IMAGE=]image])

IMPLEMENTATION
UNICOS/mk systems
CF90

STANDARDS
Fortran extension

DESCRIPTION
SYNC_IMAGES is an intrinsic procedure that synchronizes images. It is an intrinsic subroutine.
SYNC_IMAGES accepts the following argument:
image A scalar integer or an integer array. The behavior of SYNC_IMAGES differs, as follows,
depending on whether image is specified and whether it is a scalar or an array:
• If image is absent, the image waits for all other images to call SYNC_IMAGES with no
argument.
• If image is a scalar and the invoking image has index i, the invoking image waits for the
image with index image to execute a SYNC_IMAGES call with a scalar argument with value
i. After both calls are made, execution proceeds. If image is i, the call has no effect. If
image has a value that is less than 1 or greater than NUM_IMAGES(3I), the behavior is
undefined.
• If image is an array, the invoking image has index i and array image contains the value i, the
invoking image waits for those images whose values are contained in array image to execute
a SYNC_IMAGES call with an array argument that contains the value i. Any values in array
images that are outside the range 1 through NUM_IMAGES are ignored. If image does not
contain the value i, the behavior is undefined.

SEE ALSO
CF90 Co-array Programming Manual

340 004– 2138– 003


SYSTEM_CLOCK ( 3I ) SYSTEM_CLOCK ( 3I )

NAME
SYSTEM_CLOCK – Returns integer data from a real-time clock

SYNOPSIS
CALL SYSTEM_CLOCK ([[COUNT=]count] [,[COUNT_RATE=]count_rate]
[,[COUNT_MAX=count_max])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The SYSTEM_CLOCK intrinsic subroutine returns information gathered from the real-time clock.
SYSTEM_CLOCK accepts the following arguments:
count Must be type default integer. If count is present, it is set to a machine-specific value based on
the current value of the machine’s clock. If there is no clock, it is set to – HUGE(0). The
machine-specific value is incremented by one for each clock count until the value count_max is
reached; it is reset to 0 at the next count. If there is a clock, it lies in the range 0 to count_max.
count_rate Must be type default integer. If count_rate is present, it is set to the number of clock counts per
second. If there is no clock, it is set to 0.
count_max Must be type default integer. If count_max is present, it is set to the maximum value that count
can have. If there is no clock, it is set to 0.
The arguments to SYSTEM_CLOCK cannot be declared with a nondefault kind type.
The name of this intrinsic cannot be passed as an argument.
Hardware counter values from the syssgi(2) system call are used on IRIX systems. The real-time clock is
used on UNICOS and UNICOS/mk systems.
Due to the hardware characteristics of UNICOS systems, the values returned in count and count_max are
64-bit values on these systems.

SEE ALSO
SYSCLOCK(3F)
gettimeofday(2) in the UNICOS System Calls Reference Manual

004– 2138– 003 341


TAN ( 3I ) TAN ( 3I )

NAME
TAN, DTAN, QTAN, TAND, DTAND, QTAND – Computes tangent

SYNOPSIS
TAN ([X=]x)
DTAN ([X=]x)
QTAN ([X=]x)
TAND ([X=]x)
DTAND ([X=]x)
QTAND ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QTAN, TAND, DTAND, QTAND

DESCRIPTION
These functions evaluate y = tan(x). They are elemental intrinsic functions. They accept the following
argument:
x Must be of type real. For TAN, DTAN, and QTAN, x must be specified in radians and is treated
as modulo 2 * pi. For TAND, DTAND, and QTAND, x must be specified in degrees and is treated
as modulo 360.
TAN and TAND are generic function names; the rest are specifics.
A vector version of the single-precision and double-precision TAN intrinsic exists on IRIX systems and is
used when -O3 is specified on the compiler command line.

NOTES
The TAN and DTAN intrinsic function names can be passed as arguments; the others cannot.
On UNICOS and UNICOS/mk systems that support the IEEE standard for floating-point arithmetic, TAN(x)
25
yields NaN if  x > pi * 2 .
On UNICOS systems that do not support the IEEE standard for floating-point arithmetic, TAN(x) yields 0 if
25
 x > pi * 2 .

342 004– 2138– 003


TAN ( 3I ) TAN ( 3I )

19
On IRIX systems, TAN(x) yields NaN if  x > pi * 2 .
On all systems that support the IEEE standard for floating-point arithmetic, TAN(NaN) yields NaN.

RETURN VALUES
TAN and TAND return the real tangent of their real argument.
DTAN and DTAND return the double-precision real tangent of their double-precision real argument.
QTAN and QTAND return the quad-precision real tangent of their quad-precision real argument.
The terms single precision, double precision, and quad precision differ depending on your platform. For
platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page.

004– 2138– 003 343


TANH ( 3I ) TANH ( 3I )

NAME
TANH, DTANH, QTANH – Computes hyperbolic tangent

SYNOPSIS
TANH ([X=]x)
DTANH ([X=]x)
QTANH ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77

STANDARDS
Fortran
Fortran extension: QTANH

DESCRIPTION
The TANH, DTANH, and QTANH intrinsic functions compute the hyperbolic tangent of x. These functions
evaluate y = tanh(x). They are elemental functions. They accept the following argument:
x Must be of type real. The type and kind type of x is identical to the type and kind type of the
return value. See the RETURN VALUES section for information on input data types and return
values.
TANH is the generic function name; the others are specifics.

NOTES
The TANH and DTANH intrinsic function names can be passed as arguments; the other cannot.
On Cray T90 systems that support IEEE arithmetic, the following return values occur:
• If x > 19.1, TANH(x) yields 1.0.
• If x < – 19.1, TANH(x) yields -1.0.
• TANH(NaN) yields NaN.
RETURN VALUES
TANH returns the real hyperbolic tangent of its real argument.

344 004– 2138– 003


TANH ( 3I ) TANH ( 3I )

DTANH returns the double-precision real hyperbolic tangent of its double-precision argument.
QTANH returns the quad-precision real hyperbolic tangent of its quad-precision argument.

004– 2138– 003 345


TEST_IEEE_EXCEPTION ( 3I ) TEST_IEEE_EXCEPTION ( 3I )

NAME
TEST_IEEE_EXCEPTION – Returns the state of a floating-point exception

SYNOPSIS
TEST_IEEE_EXCEPTION ([EXCEPTION=]exception)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The TEST_IEEE_EXCEPTION intrinsic function returns the state of a specified floating-point exception. It
accepts the following argument:
exception Must be of an integer type that occupies a full word. If exception is an array, it must be
1-dimensional. The single value, in the scalar argument case, or each element, in the array
argument case, must be set to one of the values represented by the following named
constants:
• IEEE_XPTN_CRI_INVALID_OPND (valid only on Cray T90 systems that support
IEEE floating-point arithmetic)
• IEEE_XPTN_INEXACT_RESULT
• IEEE_XPTN_UNDERFLOW
• IEEE_XPTN_OVERFLOW
• IEEE_XPTN_DIV_BY_ZERO
• IEEE_XPTN_INVALID_OPR
• IEEE_XPTN_ALL (all exceptions in this list)
TEST_IEEE_EXCEPTION is an elemental function. The name of this intrinsic cannot be passed as an
argument.

346 004– 2138– 003


TEST_IEEE_EXCEPTION ( 3I ) TEST_IEEE_EXCEPTION ( 3I )

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN _IEEE_ DEF INI TIO NS

RETURN VALUES
The result type and type parameter is default logical. If exception is an array, the result is an array of the
same size.
If exception is scalar, the result is a default logical scalar that has the value TRUE if the specified
floating-point exception has occurred. It has the value FALSE if the specified floating-point exception has
not occurred.
If exception is an array, the result is a default logical 1-dimensional array of the same size as exception in
which an element has the value TRUE if the exception specified by the corresponding element of exception
has occurred. It has the value FALSE if the exception specified by the corresponding element of exception
has not occurred.

EXAMPLES
See the example on CLEAR_IEEE_EXCEPTION(3I).

SEE ALSO
CLEAR_IEEE_EXCEPTION(3I), GET_IEEE_EXCEPTIONS(3I), SET_IEEE_EXCEPTION(3I)

004– 2138– 003 347


TEST_IEEE_INTERRUPT ( 3I ) TEST_IEEE_INTERRUPT ( 3I )

NAME
TEST_IEEE_INTERRUPT – Returns the state of a floating-point interrupt

SYNOPSIS
TEST_IEEE_INTERRUPT ([INTERRUPT=]interrupt)

IMPLEMENTATION
UNICOS/mk, IRIX systems, Cray T90 systems that support IEEE floating-point arithmetic
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension
IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION
The TEST_IEEE_INTERRUPT intrinsic function returns the state of a specified floating-point interrupt. It
accepts the following argument:
interrupt Must be of an integer type that occupies a full word. If interrupt is an array, it must be
1-dimensional. The single value in the scalar argument case, or each element in the array
argument case, must be set to one of the values represented by the following named
constants:
• IEEE_NTPT_CRI_INVALID_OPND (valid only on Cray T90 systems that support
IEEE floating-point arithmetic)
• IEEE_NTPT_INEXACT_RESULT
• IEEE_NTPT_UNDERFLOW
• IEEE_NTPT_OVERFLOW
• IEEE_NTPT_DIV_BY_ZERO
• IEEE_NTPT_INVALID_OPR
• IEEE_NTPT_ALL (all interrupts in this list)
Note that the values represented by these named constants are different from the
similarly-named named constants listed on TEST_IEEE_EXCEPTION(3I).
TEST_IEEE_INTERRUPT is an elemental function. The name of this intrinsic cannot be passed as an
argument.

348 004– 2138– 003


TEST_IEEE_INTERRUPT ( 3I ) TEST_IEEE_INTERRUPT ( 3I )

NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include
the following statement in your program:
USE FTN _IEEE_ DEF INI TIO NS

RETURN VALUES
The result type and type parameter are default logical. If interrupt is an array, the result is an array of the
same size.
If interrupt is scalar, the result has the value .TRUE. if the specified floating-point interrupt is enabled. It
has the value .FALSE. if the specified floating-point interrupt is disabled. If interrupt has the value
.IEEE_NTPT_ALL., the result has the value .TRUE. if all interrupts are enabled; otherwise its value is
.FALSE..
If interrupt is an array, each element of the result has the value .TRUE. if the interrupt specified by the
corresponding element of interrupt is enabled. It has the value .FALSE. if the interrupt specified by the
corresponding element of interrupt is disabled. If an element of interrupt has the value
.IEEE_NTPT_ALL., the corresponding element of the result has the value .TRUE. if all interrupts are
enabled; otherwise its value is .FALSE..

EXAMPLES
See the example on DISABLE_IEEE_INTERRUPT(3I).

SEE ALSO
DISABLE_IEEE_INTERRUPT(3I)

004– 2138– 003 349


THIS_IMAGE ( 3I ) THIS_IMAGE ( 3I )

NAME
THIS_IMAGE – Retrieves an image number

SYNOPSIS
THIS_IMAGE([[ARRAY=]array[,[DIM=]dim]])

IMPLEMENTATION
UNICOS/mk systems
CF90

STANDARDS
Fortran extension

DESCRIPTION
THIS_IMAGE is an intrinsic procedure that allows an image to retrieve its own image number. It returns
the index of, or co-subscripts related to, the invoking image. It is an inquiry function. THIS_IMAGE
accepts the following arguments:
array The name of a co-array.
dim An integer value.

RETURN VALUES
The results differ, as follows, depending on the optional arguments specified:
• If array is absent, the result is a default integer scalar with a value equal to the index of the invoking
image.
• If array is present with a co-rank of one and dim is absent, the result is a default integer scalar with a
value equal to the co-subscript of the elements of array that reside on the invoking image.
• If array is present with a co-rank greater than one and dim is absent, the result is a rank one default
integer array of a size equal to the co-rank of array. Element k of the result has a value equal to the
co-subscript k of the elements of array that reside on the invoking image.
• If array and dim are present, the result is a default integer scalar with value equal to co-subscript dim of
the elements of array that reside on the invoking image.

EXAMPLES
Assume that the following declaration exists in a program:
REA L :: A(100) [8, 4]

350 004– 2138– 003


THIS_IMAGE ( 3I ) THIS_IMAGE ( 3I )

The following table lists various THIS_IMAGE calls and the values they return on images 3 and 13:
Cal l Ima ge 3 Image 13
---- --- ---- --- --- --
THIS_IMAG E() 3 13
THIS_I MAGE(A ) (/ 3, 1 /) (/ 5, 2 /)
THIS_I MAG E(A ,1) 3 5
THIS_I MAG E(A ,2) 1 2

SEE ALSO
CF90 Co-array Programming Manual

004– 2138– 003 351


TINY ( 3I ) TINY ( 3I )

NAME
TINY – Returns the smallest positive value for a real argument

SYNOPSIS
TINY ([X=]x)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The TINY intrinsic function returns the smallest positive number in the real number model that represents
number of the same type and kind type parameter as the argument. For more information on the real
number model, see the MODELS(3I) man page. It accepts the following argument:
x Must be of type real. It may be scalar or array valued.
TINY is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
e sub min-1
The result is a scalar with the same type and kind type parameter as x. The result has the value b ,
where b and e min (represented as "e sub min" in the previous equation) are as defined in the real number
model, which represents numbers of the same type and kind type parameter as x.

EXAMPLES
-8188
On UNICOS systems, TINY(X) has a value that approximates 2 for real X.
On Cray T90 systems that support IEEE arithmetic, TINY(X) has values that approximate the following:
• 2 -125 for real (KIND=4) X
• 2 -1021 for real (KIND=8) X
• 2 -16381 for real (KIND=16) X
On UNICOS/mk systems, TINY(X) has values that approximate the following:
• 2 -125 for real (KIND=4) X
• 2 -1021 for real (KIND=8) X

352 004– 2138– 003


TINY ( 3I ) TINY ( 3I )

On IRIX systems, TINY(X) has values that approximate the following:


• 2 -125 for real (KIND=4) X
• 2 -1021 for real (KIND=8) X
• 2 -967 for real (KIND=16) X
SEE ALSO
MODELS(3I)

004– 2138– 003 353


TRANSFER ( 3I ) TRANSFER ( 3I )

NAME
TRANSFER – Treats the first argument as if it is of the same type as the second argument

SYNOPSIS
TRANSFER ([SOURCE=]source, [MOLD=]mold [,[SIZE=]size])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The TRANSFER intrinsic function returns a result with the physical representation identical to that of source
but interpreted with the type and kind of mold. If mold is character, the result has the same character length
declared for mold. It accepts the following arguments:
source Can be of any type. It can be scalar or array valued.
mold Can be of any type. It can be scalar or array valued. This intrinsic function should not be used
if mold is a derived type with a pointer component; the result of this depends on your
implementation.
size Must be scalar and an integer.
TRANSFER is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result has the same type as mold.
If mold is scalar and size is not present, the result is a scalar.
If mold is array valued and size is not present, the result is an array of rank one. The size of the array is as
small as possible such that its physical representation is not shorter than that of source.
If size is present, the result is an array of rank one with an extent of size.
If the physical representation of the function result is the same length as source, the result is the entire
representation of source. If the physical representation of the function result is longer than source, the result
is the entire representation of source and the remainder of the result is undefined. If the physical
representation of the function result is shorter than source, the result is the leading part of source. If source
and mold are scalar entities and the size of mold is at least as long as source, the result must be the value of
source. For example, if source is an array and mold is a rank one array, E is the value of the following:

354 004– 2138– 003


TRANSFER ( 3I ) TRANSFER ( 3I )

TRA NSF ER( TRA NSF ER(E, D), E, SIZ E(E ))

EXAMPLES
Example 1: TRANSFER(’abc’,’d’) yields a.
Example 2: Assume that A is the following real array: (/1.1,2.2,3.3/).
TRANSFER(A,(/(0.0,0.0)/)) yields a complex 1-dimensional array with one element: (1.1,2.2).
TRANSFER(A,(/(0.0,0.0)/),1) yields a complex rank one array with one element: (1.1,2.2).

004– 2138– 003 355


TRANSPOSE ( 3I ) TRANSPOSE ( 3I )

NAME
TRANSPOSE – Transposes an array of rank two

SYNOPSIS
TRANSPOSE ([MATRIX=]matrix)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The TRANSPOSE intrinsic function transposes a two-dimensional array. It accepts the following argument:
matrix May be of any type and must have rank two
TRANSPOSE is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is an array of the same type and type parameters as matrix, with rank two, and shape (n, m),
where (m, n) is the shape of matrix. Element (i, j) of the result has the value matrix(j,i), where
i = 1, 2, . . ., n and j = 1, 2, . . ., m.

EXAMPLES
Assume that array A is as follows:
 123
 456
 789
TRANSPOSE(A) yields the following value:
 147
 258
 369

356 004– 2138– 003


TRIM ( 3I ) TRIM ( 3I )

NAME
TRIM – Returns the character argument with trailing blank characters removed

SYNOPSIS
TRIM ([STRING=]string)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The TRIM intrinsic function removes trailing blank characters from its character argument. If the input
string contains trailing blank characters, it returns the string without the trailing blanks. If the string contains
only blanks, it returns a zero-length string. It accepts the following argument:
string Must be of type character and be a scalar
TRIM is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is a scalar entity of type character with a length that is the length of string without any trailing
blank characters. The value of the result is the same as string except that any trailing blanks have been
removed. If string contains only blank characters, the result is a string of 0 length.

EXAMPLES
Consider the following example of a TRIM function reference. In this example, the carat (^) represents a
blank:
CHVAR = TRI M( ’^W ^O^ R^D ^^’ )
PRINT *,"CHV AR= ’", CHV AR, "’"

This reference returns the following result:


CHVAR= ’^W^O^ R^D ’

004– 2138– 003 357


UBOUND ( 3I ) UBOUND ( 3I )

NAME
UBOUND – Returns all the upper bounds of an array or a specified upper bound

SYNOPSIS
UBOUND ([ARRAY=] array [,[DIM=]dim])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The UBOUND intrinsic function returns all the upper bounds of an array or returns a specified upper bound.
It accepts the following arguments:
array Can be of any type. It must not be scalar. It must not be a pointer that is disassociated or an
allocatable array that is not allocated. If array is an assumed-size array, dim must be present
with a value less than the rank of array.
dim Must be scalar and of type integer with a value in the range 1 ≤ dim ≤ n, where n is the rank of
array. The corresponding actual argument must not be an optional dummy argument.
UBOUND is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result type is default integer. It is scalar if dim is present; otherwise, the result is an array of rank one
and size n, where n is the rank of array.
For an array section or for an array expression, other than a whole array or array structure component,
UBOUND(array,dim) has a value equal to the number of elements in the given dimension. It has a value
equal to the upper bound for subscript dim of array if dimension dim of array does not have size zero; it has
the value zero if dimension dim has size zero.
UBOUND(array) has a value whose ith component is equal to UBOUND(array,i), for i = 1, 2, . . ., n, where
n is the rank of array.

EXAMPLES
Assume that A is declared by the statement REAL A(2:3, 7:10). In this case, the following are true:
• UBOUND(A) yields (/3,10/).
• UBOUND(A,DIM=2) yields 10.

358 004– 2138– 003


UNIT ( 3I ) UNIT ( 3I )

NAME
UNIT – Returns the status of a BUFFER IN or BUFFER OUT statement

SYNOPSIS
UNIT ([I=]i)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran extension

DESCRIPTION
After execution of asynchronous I/O with a BUFFER IN or BUFFER OUT statement, the execution
sequence continues concurrently with the data transfer. If UNIT is called in this execution sequence, the
sequence is delayed until the transfer is complete. After the BUFFER IN operation, use UNIT or
LENGTH(3I) before using memory locations where the data is stored. UNIT accepts the following argument:
i Must be an integer or Boolean value. Represents a unit number.
UNIT is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES
On UNICOS and UNICOS/mk systems, UNIT can be called as either an external subprogram or as an
intrinsic procedure.
On IRIX systems, the BUFFER IN and BUFFER OUT statements are used for synchronous I/O.
Asynchronous I/O is not available through BUFFER I/O on IRIX systems.

RETURN VALUES
When the transfer is complete, UNIT returns a value of type real. The value is of type REAL(KIND=8) on
UNICOS and UNICOS/mk systems; it is of type REAL(KIND=4) on IRIX systems. The returned value has
one of the following meanings:
Value Meaning
– 2.0 A partial-record read terminated after delivering the requested number of words or characters,
but more data remains in the record. This status can be received only after a BUFFER IN in
partial record mode.
– 1.0 Operation was completed (indicates one of the following):
• A full- or partial-record BUFFER OUT operation completed.

004– 2138– 003 359


UNIT ( 3I ) UNIT ( 3I )

• A full-record BUFFER IN completed, transferring as much of the record as would fit in the
space provided.
• A partial-record BUFFER IN completed, transferring as much data as was left in the record
(no more data remains in the record).
• UNIT was called for an unconnected unit or for a unit on which no BUFFER IN or
BUFFER OUT operations have been performed.
0.0 An end-of-file was encountered on the previous BUFFER IN operation. No data was
transferred.
1.0 A partially recovered error occurred on the previous BUFFER IN operation. Use the LENGTH
function to determine how much data was transferred.
2.0 An unrecovered error occurred on the last BUFFER IN or BUFFER OUT operation.

EXAMPLES

PRO GRAM TESTUN IT


DIMENS ION M(200, 5)
BUFFER IN( 32,0) (M( 1,1),M(20 0,5 ))
IF (UN IT( 32) .EQ . -1. 0) THE N
DO J = 1,5
DO I = 1,200
M(I,J) = M(I ,J) *2
END DO
END DO
BUF FER OUT (22,0) (M( 1,1 ),M(20 0,5))
IF (UN IT(22) .NE. -1.0) CAL L ABO RT
ELSE
CAL L ABO RT
ENDIF
END

SEE ALSO
LENGTH(3I)

360 004– 2138– 003


UNPACK ( 3I ) UNPACK ( 3I )

NAME
UNPACK – Unpacks an array of rank one into an array under control of a mask

SYNOPSIS
UNPACK ([VECTOR=]vector, [MASK=]mask, [FIELD=]field)

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The UNPACK intrinsic function unpacks an array of rank one into an array under control of mask. It accepts
the following arguments:
vector Can be of any type. It must have rank one. Its size must be at least t where t is the number of
true elements in mask.
mask Must be of type logical and array valued.
field Must be of the same type as vector, and must be conformable with mask.
UNPACK is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is an array of the same type as vector and the same shape as mask.
The element of the result that corresponds to the ith true element of mask, in array element order, has the
value vector(i) for i=1, 2, . . ., t where t is the number of true values in mask. Each other element has the
value equal to field if field is scalar or to the corresponding element of field if it is an array.

EXAMPLES
This example uses UNPACK to scatter specific values to specific positions in an array.
Assume that M is the following array:
 100
 010
 001

004– 2138– 003 361


UNPACK ( 3I ) UNPACK ( 3I )

Assume that V is the array [1,2,3].


Assume that Q is the following logical mask:
 FTF
 TFF
 FFT
In logical mask Q, T represents true and F represents false, so UNPACK(V,MASK=Q,FIELD=M) yields the
following value:
 120
 110
 003
UNPACK(V,MASK=Q,FIELD=0) yields the following value:
 020
 100
 003

362 004– 2138– 003


VERIFY ( 3I ) VERIFY ( 3I )

NAME
VERIFY – Verifies that a set of characters contains all characters in a string

SYNOPSIS
VERIFY ([STRING=]string, [SET=]set [,[BACK=]back])

IMPLEMENTATION
UNICOS, UNICOS/mk, IRIX systems
CF90, MIPSpro 7 Fortran 90

STANDARDS
Fortran

DESCRIPTION
The VERIFY intrinsic function verifies that a set of characters contains all characters in a string by
identifying the first character position in a string of characters that does not appear in a given set of
characters. VERIFY accepts the following arguments:
string Must be of type character variable.
set Must be of type character variable, expression, or constant.
back Must be of type logical. If back is omitted, a value of false is assumed.
VERIFY is an elemental function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES
The result is an integer.
If back is absent or is present with a value FALSE and string contains at least one character that is not in
set, the value of the result is the position of the leftmost character of string that is not in set.
If back is present with a value TRUE and if string contains at least one character that is not in set, the value
of the result is the position of the rightmost character of string that is not in set.
VERIFY returns 0 if each character in string is in set, or if the length of string is 0.

EXAMPLES
VERIFY(’ABBA’,’A’) yields 2.
VERIFY(’ABBA’,’A’,BACK=.TRUE.) yields 3.

004– 2138– 003 363


VERIFY ( 3I ) VERIFY ( 3I )

VERIFY(’ABBA’,’AB’) yields 0.

364 004– 2138– 003


WRITE_MEMORY_BARRIER ( 3I ) WRITE_MEMORY_BARRIER ( 3I )

NAME
_write_memory_barrier, WRITE_MEMORY_BARRIER – Blocks processor until previous store
operations have finished

SYNOPSIS
C/C++:
#include <intrinsics.h>
void _write_memory_barrier (void);
Fortran:
WRITE_MEMORY_BARRIER ()

IMPLEMENTATION
UNICOS/mk systems
Cray C/C++, CF90

STANDARDS
C/C++ extension
Fortran extension

DESCRIPTION
This intrinsic guarantees that all preceding store instructions have completed modifying memory before any
subsequent loads or stores reference memory.

NOTES

C/C++
Because _write_memory_barrier is an intrinsic function, no externally visible library function is
available for it. The compiler generates inline code to produce the result.
Fortran
The name of this intrinsic cannot be passed as an argument.

SEE ALSO
A complete list of C/C++ intrinsic functions available on UNICOS and UNICOS/mk systems is in the Cray
C/C++ Reference Manual.

004– 2138– 003 365


INDEX

ABS(3I) ............................................................................................................ abs(3I) ...................................................................... 1


abs(3I) ............................................................................................................ abs(3I) ...................................................................... 1
Absolute value ................................................................................................. abs(3I) ...................................................................... 1
ACHAR(3I) ....................................................................................................... char(3I) ................................................................. 42
achar(3I) ....................................................................................................... char(3I) ................................................................. 42
ACOS(3I) ......................................................................................................... acos(3I) ................................................................... 3
acos(3I) ......................................................................................................... acos(3I) ................................................................... 3
ACOSD(3I) ....................................................................................................... acos(3I) ................................................................... 3
acosd(3I) ....................................................................................................... acos(3I) ................................................................... 3
ADD_AND_FETCH(3I) .................................................................................... sync(3I) ............................................................... 337
add_and_fetch(3I) .................................................................................... sync(3I) ............................................................... 337
ADJUSTL(3I) .................................................................................................. adjustl(3I) ............................................................ 5
adjustl(3I) .................................................................................................. adjustl(3I) ............................................................ 5
ADJUSTR(3I) .................................................................................................. adjustr(3I) ............................................................ 7
adjustr(3I) .................................................................................................. adjustr(3I) ............................................................ 7
Adjusts a character string to the left ............................................................... adjustl(3I) ............................................................ 5
Adjusts a character string to the right ............................................................ adjustr(3I) ............................................................ 7
AIMAG(3I) ....................................................................................................... aimag(3I) ................................................................. 9
aimag(3I) ....................................................................................................... aimag(3I) ................................................................. 9
AINT(3I) ......................................................................................................... aint(3I) ................................................................. 11
aint(3I) ......................................................................................................... aint(3I) ................................................................. 11
ALL(3I) ............................................................................................................ all(3I) .................................................................... 13
all(3I) ............................................................................................................ all(3I) .................................................................... 13
ALLOCATED(3I) ............................................................................................. allocated(3I) ...................................................... 15
allocated(3I) ............................................................................................. allocated(3I) ...................................................... 15
Allocates and deallocates main memory ......................................................... malloc(3I) ........................................................... 200
ALOG10(3I) .................................................................................................... log10(3I) ............................................................. 193
alog10(3I) .................................................................................................... log10(3I) ............................................................. 193
ALOG(3I) ......................................................................................................... log(3I) .................................................................. 196
alog(3I) ......................................................................................................... log(3I) .................................................................. 196
Alters current floating-point rounding mode state and restores the
floating-point rounding mode before exiting a procedure .............................. set_ieee_rounding_mode(3I) ..................... 306
AMAX0(3I) ....................................................................................................... max(3I) .................................................................. 207
amax0(3I) ....................................................................................................... max(3I) .................................................................. 207
AMAX1(3I) ....................................................................................................... max(3I) .................................................................. 207
amax1(3I) ....................................................................................................... max(3I) .................................................................. 207
AMIN0(3I) ....................................................................................................... min(3I) .................................................................. 219
amin0(3I) ....................................................................................................... min(3I) .................................................................. 219
AMIN1(3I) ....................................................................................................... min(3I) .................................................................. 219
amin1(3I) ....................................................................................................... min(3I) .................................................................. 219
AMOD(3I) ......................................................................................................... mod(3I) .................................................................. 228
amod(3I) ......................................................................................................... mod(3I) .................................................................. 228
AND(3I) ............................................................................................................ and(3I) .................................................................... 16
and(3I) ............................................................................................................ and(3I) .................................................................... 16
AND_AND_FETCH(3I) .................................................................................... sync(3I) ............................................................... 337
and_and_fetch(3I) .................................................................................... sync(3I) ............................................................... 337
ANINT(3I) ....................................................................................................... anint(3I) ............................................................... 18

004– 2138– 003 Index-1


anint(3I) ....................................................................................................... anint(3I) ............................................................... 18
ANY(3I) ............................................................................................................ any(3I) .................................................................... 20
any(3I) ............................................................................................................ any(3I) .................................................................... 20
application ....................................................................................................... num_pes(3I) ........................................................ 251
Arccosine ......................................................................................................... acos(3I) ................................................................... 3
Arcsine ............................................................................................................ asin(3I) ................................................................. 22
Arctangent ....................................................................................................... atan2(3I) ............................................................... 26
Arctangent ....................................................................................................... atan(3I) ................................................................. 29
argcount(3I) ................................................................................................ numarg(3I) ........................................................... 247
_argcount(3I) ............................................................................................. numarg(3I) ........................................................... 247
ASIN(3I) ......................................................................................................... asin(3I) ................................................................. 22
asin(3I) ......................................................................................................... asin(3I) ................................................................. 22
ASIND(3I) ....................................................................................................... asin(3I) ................................................................. 22
asind(3I) ....................................................................................................... asin(3I) ................................................................. 22
ASSOCIATED(3I) ........................................................................................... associated(3I) ................................................... 24
associated(3I) ........................................................................................... associated(3I) ................................................... 24
Assures completion of memory references ..................................................... cmr(3I) .................................................................... 50
ATAN2(3I) ....................................................................................................... atan2(3I) ............................................................... 26
atan2(3I) ....................................................................................................... atan2(3I) ............................................................... 26
ATAN2D(3I) .................................................................................................... atan2(3I) ............................................................... 26
atan2d(3I) .................................................................................................... atan2(3I) ............................................................... 26
ATAN(3I) ......................................................................................................... atan(3I) ................................................................. 29
atan(3I) ......................................................................................................... atan(3I) ................................................................. 29
ATAND(3I) ....................................................................................................... atan(3I) ................................................................. 29
atand(3I) ....................................................................................................... atan(3I) ................................................................. 29
atomic .............................................................................................................. sync(3I) ............................................................... 337
barrier .............................................................................................................. sync(3I) ............................................................... 337
Bit mask .......................................................................................................... mask(3I) ............................................................... 202
Bit population parity ....................................................................................... poppar(3I) ........................................................... 260
Bit shift ........................................................................................................... shiftl(3I) ........................................................... 316
Bit shift ........................................................................................................... shiftr(3I) ........................................................... 318
BITEST(3I) .................................................................................................... btest(3I) ............................................................... 39
bitest(3I) .................................................................................................... btest(3I) ............................................................... 39
bitmatrix .......................................................................................................... bmm(3I) .................................................................... 33
bit-matrix ......................................................................................................... bmm(3I) .................................................................... 33
BIT_SIZE(3I) ................................................................................................ bit_size(3I) ........................................................ 31
bit_size(3I) ................................................................................................ bit_size(3I) ........................................................ 31
BJTEST(3I) .................................................................................................... btest(3I) ............................................................... 39
bjtest(3I) .................................................................................................... btest(3I) ............................................................... 39
BKTEST(3I) .................................................................................................... btest(3I) ............................................................... 39
bktest(3I) .................................................................................................... btest(3I) ............................................................... 39
Blocks processor until previous store operations have finished ..................... write_memory_barrier(3I) .......................... 365
Blocks processor until remote write operations have finished ....................... remote_write_barrier(3I) .......................... 281
Blocks subsequent memory load and store operations until all previous
loads and stores finish ..................................................................................... memory_barrier(3I) ........................................ 216
BMM ............................................................................................................... bmm(3I) .................................................................... 33
BMM(3I) ............................................................................................................ bmm(3I) .................................................................... 33
bmm(3I) ............................................................................................................ bmm(3I) .................................................................... 33
Boolean ........................................................................................................... and(3I) .................................................................... 16
Boolean ........................................................................................................... leadz(3I) ............................................................. 183

Index-2 004– 2138– 003


Boolean ........................................................................................................... mask(3I) ............................................................... 202
Boolean ........................................................................................................... or(3I) .................................................................... 252
Boolean ........................................................................................................... popcnt(3I) ........................................................... 258
Boolean ........................................................................................................... poppar(3I) ........................................................... 260
Boolean ........................................................................................................... shift(3I) ............................................................. 312
Boolean ........................................................................................................... shiftl(3I) ........................................................... 316
Boolean ........................................................................................................... shiftr(3I) ........................................................... 318
Boolean ........................................................................................................... compl(3I) ............................................................... 51
Boolean ........................................................................................................... eqv(3I) .................................................................... 99
BTEST(3I) ....................................................................................................... btest(3I) ............................................................... 39
btest(3I) ....................................................................................................... btest(3I) ............................................................... 39
BUFFER IN/BUFFER OUT operation completion ...................................... unit(3I) ............................................................... 359
BUFFER IN/BUFFER OUT transfer length ................................................. length(3I) ........................................................... 186
C ...................................................................................................................... numarg(3I) ........................................................... 247
C ...................................................................................................................... popcnt(3I) ........................................................... 258
C++ ................................................................................................................. numarg(3I) ........................................................... 247
C++ ................................................................................................................. popcnt(3I) ........................................................... 258
C++ ................................................................................................................. bmm(3I) .................................................................... 33
C compiler ....................................................................................................... dshiftl(3I) .......................................................... 85
C compiler ....................................................................................................... dshiftr(3I) .......................................................... 87
C++ compiler .................................................................................................. bmm(3I) .................................................................... 33
C++ compiler .................................................................................................. dshiftl(3I) .......................................................... 85
C++ compiler .................................................................................................. dshiftr(3I) .......................................................... 87
C intrinsic ........................................................................................................ num_pes(3I) ........................................................ 251
C intrinsic ........................................................................................................ poppar(3I) ........................................................... 260
C intrinsic ........................................................................................................ ran(3I) .................................................................. 268
C intrinsic ........................................................................................................ bmm(3I) .................................................................... 33
C intrinsics ...................................................................................................... int_mult_upper(3I) ........................................ 160
C intrinsics ...................................................................................................... memory_barrier(3I) ........................................ 216
C intrinsics ...................................................................................................... my_pe(3I) ............................................................. 238
C intrinsics ...................................................................................................... remote_write_barrier(3I) .......................... 281
C intrinsics ...................................................................................................... rtc(3I) .................................................................. 287
C intrinsics ...................................................................................................... semclr(3I) ........................................................... 299
C intrinsics ...................................................................................................... write_memory_barrier(3I) .......................... 365
C++ intrinsic ................................................................................................... ex(3I) .................................................................... 103
C++ intrinsic ................................................................................................... gbit(3I) ............................................................... 110
C++ intrinsic ................................................................................................... getvm(3I) ............................................................. 123
C++ intrinsic ................................................................................................... mask(3I) ............................................................... 202
C++ intrinsic ................................................................................................... num_pes(3I) ........................................................ 251
C++ intrinsic ................................................................................................... pbit(3I) ............................................................... 256
C++ intrinsic ................................................................................................... poppar(3I) ........................................................... 260
C++ intrinsic ................................................................................................... ran(3I) .................................................................. 268
C++ intrinsic ................................................................................................... cmr(3I) .................................................................... 50
C intrinsic function ......................................................................................... ex(3I) .................................................................... 103
C intrinsic function ......................................................................................... gbit(3I) ............................................................... 110
C intrinsic function ......................................................................................... getvm(3I) ............................................................. 123
C intrinsic function ......................................................................................... mask(3I) ............................................................... 202
C intrinsic function ......................................................................................... pbit(3I) ............................................................... 256
C intrinsic function ......................................................................................... readSB(3I) ........................................................... 276
C intrinsic function ......................................................................................... readSR(3I) ........................................................... 277

004– 2138– 003 Index-3


C intrinsic function ......................................................................................... cmr(3I) .................................................................... 50
C++ intrinsics .................................................................................................. int_mult_upper(3I) ........................................ 160
C++ intrinsics .................................................................................................. memory_barrier(3I) ........................................ 216
C++ intrinsics .................................................................................................. my_pe(3I) ............................................................. 238
C++ intrinsics .................................................................................................. readSB(3I) ........................................................... 276
C++ intrinsics .................................................................................................. readSR(3I) ........................................................... 277
C++ intrinsics .................................................................................................. remote_write_barrier(3I) .......................... 281
C++ intrinsics .................................................................................................. rtc(3I) .................................................................. 287
C++ intrinsics .................................................................................................. semclr(3I) ........................................................... 299
C++ intrinsics .................................................................................................. write_memory_barrier(3I) .......................... 365
CABS(3I) ......................................................................................................... abs(3I) ...................................................................... 1
cabs(3I) ......................................................................................................... abs(3I) ...................................................................... 1
CCOS(3I) ......................................................................................................... cos(3I) .................................................................... 55
ccos(3I) ......................................................................................................... cos(3I) .................................................................... 55
CDABS(3I) ....................................................................................................... abs(3I) ...................................................................... 1
cdabs(3I) ....................................................................................................... abs(3I) ...................................................................... 1
CDCOS(3I) ....................................................................................................... cos(3I) .................................................................... 55
cdcos(3I) ....................................................................................................... cos(3I) .................................................................... 55
CDEXP(3I) ....................................................................................................... exp(3I) .................................................................. 104
cdexp(3I) ....................................................................................................... exp(3I) .................................................................. 104
CDLOG(3I) ....................................................................................................... log(3I) .................................................................. 196
cdlog(3I) ....................................................................................................... log(3I) .................................................................. 196
CDSIN(3I) ....................................................................................................... sin(3I) .................................................................. 323
cdsin(3I) ....................................................................................................... sin(3I) .................................................................. 323
CDSQRT(3I) .................................................................................................... sqrt(3I) ............................................................... 333
CEILING(3I) .................................................................................................. ceiling(3I) .......................................................... 41
ceiling(3I) .................................................................................................. ceiling(3I) .......................................................... 41
CEXP(3I) ......................................................................................................... exp(3I) .................................................................. 104
cexp(3I) ......................................................................................................... exp(3I) .................................................................. 104
CF90 ................................................................................................................ exponent(3I) ...................................................... 106
CF90 ................................................................................................................ fcd(3I) .................................................................. 107
CF90 ................................................................................................................ floor(3I) ............................................................. 108
CF90 ................................................................................................................ fraction(3I) ...................................................... 109
CF90 ................................................................................................................ get_ieee_exceptions(3I) ............................ 112
CF90 ................................................................................................................ get_ieee_interrupts(3I) ............................ 114
CF90 ................................................................................................................ get_ieee_rounding_mode(3I) ..................... 116
CF90 ................................................................................................................ get_ieee_status(3I)...................................... 118
CF90 ................................................................................................................ getpos(3I) ........................................................... 120
CF90 ................................................................................................................ huge(3I) ............................................................... 124
CF90 ................................................................................................................ iand(3I) ............................................................... 126
CF90 ................................................................................................................ ibchng(3I) ........................................................... 129
CF90 ................................................................................................................ all(3I) .................................................................... 13
CF90 ................................................................................................................ ibits(3I) ............................................................. 131
CF90 ................................................................................................................ ieee_binary_scale(3I) ................................. 134
CF90 ................................................................................................................ ieee_class(3I) ................................................. 136
CF90 ................................................................................................................ ieee_copy_sign(3I) ........................................ 138
CF90 ................................................................................................................ ieee_exponent(3I) .......................................... 140
CF90 ................................................................................................................ ieee_finite(3I) ............................................... 143
CF90 ................................................................................................................ ieee_int(3I) ...................................................... 144
CF90 ................................................................................................................ ieee_is_nan(3I) ............................................... 146

Index-4 004– 2138– 003


CF90 ................................................................................................................ ieee_next_after(3I)...................................... 148
CF90 ................................................................................................................ allocated(3I) ...................................................... 15
CF90 ................................................................................................................ ieee_real(3I) .................................................... 150
CF90 ................................................................................................................ ieee_remainder(3I) ........................................ 152
CF90 ................................................................................................................ ieee_unordered(3I) ........................................ 154
CF90 ................................................................................................................ index(3I) ............................................................. 156
CF90 ................................................................................................................ int_mult_upper(3I) ........................................ 160
CF90 ................................................................................................................ isha(3I) ............................................................... 173
CF90 ................................................................................................................ ishc(3I) ............................................................... 174
CF90 ................................................................................................................ ishft(3I) ............................................................. 175
CF90 ................................................................................................................ ishftc(3I) ........................................................... 177
CF90 ................................................................................................................ ishl(3I) ............................................................... 179
CF90 ................................................................................................................ kind(3I) ............................................................... 180
CF90 ................................................................................................................ lbound(3I) ........................................................... 181
CF90 ................................................................................................................ length(3I) ........................................................... 186
CF90 ................................................................................................................ len_trim(3I) ...................................................... 188
CF90 ................................................................................................................ loc(3I) .................................................................. 191
CF90 ................................................................................................................ log2_images(3I) ............................................... 195
CF90 ................................................................................................................ logical(3I) ........................................................ 198
CF90 ................................................................................................................ long(3I) ............................................................... 199
CF90 ................................................................................................................ any(3I) .................................................................... 20
CF90 ................................................................................................................ matmul(3I) ........................................................... 205
CF90 ................................................................................................................ max(3I) .................................................................. 207
CF90 ................................................................................................................ maxexponent(3I) ............................................... 209
CF90 ................................................................................................................ maxloc(3I) ........................................................... 211
CF90 ................................................................................................................ maxval(3I) ........................................................... 214
CF90 ................................................................................................................ memory_barrier(3I) ........................................ 216
CF90 ................................................................................................................ merge(3I) ............................................................. 217
CF90 ................................................................................................................ min(3I) .................................................................. 219
CF90 ................................................................................................................ minexponent(3I) ............................................... 221
CF90 ................................................................................................................ minloc(3I) ........................................................... 223
CF90 ................................................................................................................ minval(3I) ........................................................... 226
CF90 ................................................................................................................ models(3I) ........................................................... 230
CF90 ................................................................................................................ modulo(3I) ........................................................... 235
CF90 ................................................................................................................ mvbits(3I) ........................................................... 237
CF90 ................................................................................................................ my_pe(3I) ............................................................. 238
CF90 ................................................................................................................ associated(3I) ................................................... 24
CF90 ................................................................................................................ nearest(3I) ........................................................ 240
CF90 ................................................................................................................ not(3I) .................................................................. 243
CF90 ................................................................................................................ null(3I) ............................................................... 245
CF90 ................................................................................................................ numarg(3I) ........................................................... 247
CF90 ................................................................................................................ num_images(3I) ................................................. 250
CF90 ................................................................................................................ pack(3I) ............................................................... 254
CF90 ................................................................................................................ precision(3I) .................................................... 262
CF90 ................................................................................................................ present(3I) ........................................................ 264
CF90 ................................................................................................................ product(3I) ........................................................ 265
CF90 ................................................................................................................ radix(3I) ............................................................. 267
CF90 ................................................................................................................ random_number(3I) .......................................... 272
CF90 ................................................................................................................ random_seed(3I) ............................................... 273
CF90 ................................................................................................................ range(3I) ............................................................. 274

004– 2138– 003 Index-5


CF90 ................................................................................................................ rem_images(3I) ................................................. 280
CF90 ................................................................................................................ remote_write_barrier(3I) .......................... 281
CF90 ................................................................................................................ repeat(3I) ........................................................... 282
CF90 ................................................................................................................ reshape(3I) ........................................................ 283
CF90 ................................................................................................................ rrspacing(3I) .................................................... 285
CF90 ................................................................................................................ rtc(3I) .................................................................. 287
CF90 ................................................................................................................ scale(3I) ............................................................. 289
CF90 ................................................................................................................ scan(3I) ............................................................... 290
CF90 ................................................................................................................ selected_int_kind(3I) ................................. 292
CF90 ................................................................................................................ selected_real_kind(3I)............................... 294
CF90 ................................................................................................................ set_exponent(3I) ............................................. 300
CF90 ................................................................................................................ set_ieee_exception(3I)............................... 302
CF90 ................................................................................................................ set_ieee_exceptions(3I) ............................ 304
CF90 ................................................................................................................ set_ieee_interrupts(3I) ............................ 305
CF90 ................................................................................................................ set_ieee_rounding_mode(3I) ..................... 306
CF90 ................................................................................................................ set_ieee_status(3I)...................................... 309
CF90 ................................................................................................................ bit_size(3I) ........................................................ 31
CF90 ................................................................................................................ shape(3I) ............................................................. 311
CF90 ................................................................................................................ shifta(3I) ........................................................... 314
CF90 ................................................................................................................ short(3I) ............................................................. 320
CF90 ................................................................................................................ size(3I) ............................................................... 327
CF90 ................................................................................................................ sizeof(3I) ........................................................... 328
CF90 ................................................................................................................ spacing(3I) ........................................................ 329
CF90 ................................................................................................................ bmm(3I) .................................................................... 33
CF90 ................................................................................................................ spread(3I) ........................................................... 331
CF90 ................................................................................................................ sum(3I) .................................................................. 335
CF90 ................................................................................................................ sync_images(3I) ............................................... 340
CF90 ................................................................................................................ system_clock(3I) ............................................. 341
CF90 ................................................................................................................ test_ieee_exception(3I) ............................ 346
CF90 ................................................................................................................ test_ieee_interrupt(3I) ............................ 348
CF90 ................................................................................................................ this_image(3I) ................................................. 350
CF90 ................................................................................................................ tiny(3I) ............................................................... 352
CF90 ................................................................................................................ transfer(3I) ...................................................... 354
CF90 ................................................................................................................ transpose(3I) .................................................... 356
CF90 ................................................................................................................ trim(3I) ............................................................... 357
CF90 ................................................................................................................ ubound(3I) ........................................................... 358
CF90 ................................................................................................................ unit(3I) ............................................................... 359
CF90 ................................................................................................................ unpack(3I) ........................................................... 361
CF90 ................................................................................................................ verify(3I) ........................................................... 363
CF90 ................................................................................................................ write_memory_barrier(3I) .......................... 365
CF90 ................................................................................................................ btest(3I) ............................................................... 39
CF90 ................................................................................................................ ceiling(3I) .......................................................... 41
CF90 ................................................................................................................ clear_ieee_exception(3I) ............................ 44
CF90 ................................................................................................................ cloc(3I) ................................................................. 46
CF90 ................................................................................................................ clock(3I) ............................................................... 47
CF90 ................................................................................................................ adjustl(3I) ............................................................ 5
CF90 ................................................................................................................ count(3I) ............................................................... 61
CF90 ................................................................................................................ cpu_time(3I) ........................................................ 63
CF90 ................................................................................................................ cshift(3I) ............................................................. 65
CF90 ................................................................................................................ csmg(3I) ................................................................. 67

Index-6 004– 2138– 003


CF90 ................................................................................................................ cvmg(3I) ................................................................. 69
CF90 ................................................................................................................ adjustr(3I) ............................................................ 7
CF90 ................................................................................................................ date(3I) ................................................................. 72
CF90 ................................................................................................................ date_and_time(3I) ............................................ 73
CF90 ................................................................................................................ digits(3I) ............................................................. 77
CF90 ................................................................................................................ dot_product(3I) ................................................. 81
CF90 ................................................................................................................ dshiftl(3I) .......................................................... 85
CF90 ................................................................................................................ dshiftr(3I) .......................................................... 87
CF90 ................................................................................................................ dsm(3I) .................................................................... 89
CF90 ................................................................................................................ enable_ieee_interrupt(3I) ......................... 92
CF90 ................................................................................................................ eoshift(3I) .......................................................... 95
CF90 ................................................................................................................ epsilon(3I) .......................................................... 97
CHAR(3I) ......................................................................................................... char(3I) ................................................................. 42
char(3I) ......................................................................................................... char(3I) ................................................................. 42
Character conversion (integer to character) .................................................... char(3I) ................................................................. 42
Character string length .................................................................................... len(3I) .................................................................. 185
Chooses an alternative value according to the value of a mask .................... merge(3I) ............................................................. 217
Circular shift ................................................................................................... shift(3I) ............................................................. 312
ckibits(3I) .................................................................................................. ibits(3I) ............................................................. 131
CLEAR_IEEE_EXCEPTION(3I) .................................................................... clear_ieee_exception(3I) ............................ 44
clear_ieee_exception(3I) .................................................................... clear_ieee_exception(3I) ............................ 44
Clears floating-point exception indicator ........................................................ clear_ieee_exception(3I) ............................ 44
CLOC(3I) ......................................................................................................... cloc(3I) ................................................................. 46
cloc(3I) ......................................................................................................... cloc(3I) ................................................................. 46
Clock (real time value) ................................................................................... rtc(3I) .................................................................. 287
Clock register (real time) ................................................................................ rtc(3I) .................................................................. 287
Clock system ................................................................................................... clock(3I) ............................................................... 47
CLOCK(3I) ....................................................................................................... clock(3I) ............................................................... 47
clock(3I) ....................................................................................................... clock(3I) ............................................................... 47
clock_test_and_set(3I) ........................................................................ sync(3I) ............................................................... 337
CLOG(3I) ......................................................................................................... log(3I) .................................................................. 196
clog(3I) ......................................................................................................... log(3I) .................................................................. 196
CMPLX(3I) ....................................................................................................... cmplx(3I) ............................................................... 48
cmplx(3I) ....................................................................................................... cmplx(3I) ............................................................... 48
cmr(3I) ............................................................................................................ cmr(3I) .................................................................... 50
_cmr(3I) ......................................................................................................... cmr(3I) .................................................................... 50
COARRAY ..................................................................................................... log2_images(3I) ............................................... 195
COARRAY ..................................................................................................... num_images(3I) ................................................. 250
COARRAY ..................................................................................................... rem_images(3I) ................................................. 280
COARRAY ..................................................................................................... sync_images(3I) ............................................... 340
COARRAY ..................................................................................................... this_image(3I) ................................................. 350
Coarray ............................................................................................................ log2_images(3I) ............................................... 195
Coarray ............................................................................................................ num_images(3I) ................................................. 250
Coarray ............................................................................................................ rem_images(3I) ................................................. 280
Coarray ............................................................................................................ sync_images(3I) ............................................... 340
Coarray ............................................................................................................ this_image(3I) ................................................. 350
coarray ............................................................................................................. log2_images(3I) ............................................... 195
coarray ............................................................................................................. num_images(3I) ................................................. 250
coarray ............................................................................................................. rem_images(3I) ................................................. 280
coarray ............................................................................................................. sync_images(3I) ............................................... 340

004– 2138– 003 Index-7


coarray ............................................................................................................. this_image(3I) ................................................. 350
Co-Array ......................................................................................................... log2_images(3I) ............................................... 195
Co-array ........................................................................................................... num_images(3I) ................................................. 250
Co-array ........................................................................................................... rem_images(3I) ................................................. 280
Co-array ........................................................................................................... sync_images(3I) ............................................... 340
Co-array ........................................................................................................... this_image(3I) ................................................. 350
co-array ........................................................................................................... log2_images(3I) ............................................... 195
co-array ........................................................................................................... num_images(3I) ................................................. 250
co-array ........................................................................................................... rem_images(3I) ................................................. 280
co-array ........................................................................................................... sync_images(3I) ............................................... 340
co-array ........................................................................................................... this_image(3I) ................................................. 350
Common logarithm ......................................................................................... log10(3I) ............................................................. 193
COMPARE_AND_SWAP(3I) ............................................................................. sync(3I) ............................................................... 337
compare_and_swap(3I) ............................................................................. sync(3I) ............................................................... 337
Compares strings lexically .............................................................................. lge(3I) .................................................................. 189
Compiler .......................................................................................................... exponent(3I) ...................................................... 106
Compiler .......................................................................................................... fcd(3I) .................................................................. 107
Compiler .......................................................................................................... floor(3I) ............................................................. 108
Compiler .......................................................................................................... fraction(3I) ...................................................... 109
Compiler .......................................................................................................... get_ieee_exceptions(3I) ............................ 112
Compiler .......................................................................................................... get_ieee_interrupts(3I) ............................ 114
Compiler .......................................................................................................... get_ieee_rounding_mode(3I) ..................... 116
Compiler .......................................................................................................... get_ieee_status(3I)...................................... 118
Compiler .......................................................................................................... getpos(3I) ........................................................... 120
Compiler .......................................................................................................... huge(3I) ............................................................... 124
Compiler .......................................................................................................... iand(3I) ............................................................... 126
Compiler .......................................................................................................... ibchng(3I) ........................................................... 129
Compiler .......................................................................................................... all(3I) .................................................................... 13
Compiler .......................................................................................................... ibits(3I) ............................................................. 131
Compiler .......................................................................................................... ieee_binary_scale(3I) ................................. 134
Compiler .......................................................................................................... ieee_class(3I) ................................................. 136
Compiler .......................................................................................................... ieee_copy_sign(3I) ........................................ 138
Compiler .......................................................................................................... ieee_exponent(3I) .......................................... 140
Compiler .......................................................................................................... ieee_finite(3I) ............................................... 143
Compiler .......................................................................................................... ieee_int(3I) ...................................................... 144
Compiler .......................................................................................................... ieee_is_nan(3I) ............................................... 146
Compiler .......................................................................................................... ieee_next_after(3I)...................................... 148
Compiler .......................................................................................................... allocated(3I) ...................................................... 15
Compiler .......................................................................................................... ieee_real(3I) .................................................... 150
Compiler .......................................................................................................... ieee_remainder(3I) ........................................ 152
Compiler .......................................................................................................... ieee_unordered(3I) ........................................ 154
Compiler .......................................................................................................... index(3I) ............................................................. 156
Compiler .......................................................................................................... int_mult_upper(3I) ........................................ 160
Compiler .......................................................................................................... isha(3I) ............................................................... 173
Compiler .......................................................................................................... ishc(3I) ............................................................... 174
Compiler .......................................................................................................... ishft(3I) ............................................................. 175
Compiler .......................................................................................................... ishftc(3I) ........................................................... 177
Compiler .......................................................................................................... ishl(3I) ............................................................... 179
Compiler .......................................................................................................... kind(3I) ............................................................... 180
Compiler .......................................................................................................... lbound(3I) ........................................................... 181

Index-8 004– 2138– 003


Compiler .......................................................................................................... length(3I) ........................................................... 186
Compiler .......................................................................................................... len_trim(3I) ...................................................... 188
Compiler .......................................................................................................... loc(3I) .................................................................. 191
Compiler .......................................................................................................... log2_images(3I) ............................................... 195
Compiler .......................................................................................................... logical(3I) ........................................................ 198
Compiler .......................................................................................................... long(3I) ............................................................... 199
Compiler .......................................................................................................... any(3I) .................................................................... 20
Compiler .......................................................................................................... matmul(3I) ........................................................... 205
Compiler .......................................................................................................... max(3I) .................................................................. 207
Compiler .......................................................................................................... maxexponent(3I) ............................................... 209
Compiler .......................................................................................................... maxloc(3I) ........................................................... 211
Compiler .......................................................................................................... maxval(3I) ........................................................... 214
Compiler .......................................................................................................... memory_barrier(3I) ........................................ 216
Compiler .......................................................................................................... merge(3I) ............................................................. 217
Compiler .......................................................................................................... min(3I) .................................................................. 219
Compiler .......................................................................................................... minexponent(3I) ............................................... 221
Compiler .......................................................................................................... minloc(3I) ........................................................... 223
Compiler .......................................................................................................... minval(3I) ........................................................... 226
Compiler .......................................................................................................... modulo(3I) ........................................................... 235
Compiler .......................................................................................................... mvbits(3I) ........................................................... 237
Compiler .......................................................................................................... my_pe(3I) ............................................................. 238
Compiler .......................................................................................................... associated(3I) ................................................... 24
Compiler .......................................................................................................... nearest(3I) ........................................................ 240
Compiler .......................................................................................................... not(3I) .................................................................. 243
Compiler .......................................................................................................... null(3I) ............................................................... 245
Compiler .......................................................................................................... numarg(3I) ........................................................... 247
Compiler .......................................................................................................... num_images(3I) ................................................. 250
Compiler .......................................................................................................... pack(3I) ............................................................... 254
Compiler .......................................................................................................... precision(3I) .................................................... 262
Compiler .......................................................................................................... present(3I) ........................................................ 264
Compiler .......................................................................................................... product(3I) ........................................................ 265
Compiler .......................................................................................................... radix(3I) ............................................................. 267
Compiler .......................................................................................................... random_number(3I) .......................................... 272
Compiler .......................................................................................................... random_seed(3I) ............................................... 273
Compiler .......................................................................................................... range(3I) ............................................................. 274
Compiler .......................................................................................................... rem_images(3I) ................................................. 280
Compiler .......................................................................................................... remote_write_barrier(3I) .......................... 281
Compiler .......................................................................................................... repeat(3I) ........................................................... 282
Compiler .......................................................................................................... reshape(3I) ........................................................ 283
Compiler .......................................................................................................... rrspacing(3I) .................................................... 285
Compiler .......................................................................................................... rtc(3I) .................................................................. 287
Compiler .......................................................................................................... scale(3I) ............................................................. 289
Compiler .......................................................................................................... scan(3I) ............................................................... 290
Compiler .......................................................................................................... selected_int_kind(3I) ................................. 292
Compiler .......................................................................................................... selected_real_kind(3I)............................... 294
Compiler .......................................................................................................... set_exponent(3I) ............................................. 300
Compiler .......................................................................................................... set_ieee_exception(3I)............................... 302
Compiler .......................................................................................................... set_ieee_exceptions(3I) ............................ 304
Compiler .......................................................................................................... set_ieee_interrupts(3I) ............................ 305
Compiler .......................................................................................................... set_ieee_rounding_mode(3I) ..................... 306

004– 2138– 003 Index-9


Compiler .......................................................................................................... set_ieee_status(3I)...................................... 309
Compiler .......................................................................................................... bit_size(3I) ........................................................ 31
Compiler .......................................................................................................... shape(3I) ............................................................. 311
Compiler .......................................................................................................... shifta(3I) ........................................................... 314
Compiler .......................................................................................................... short(3I) ............................................................. 320
Compiler .......................................................................................................... size(3I) ............................................................... 327
Compiler .......................................................................................................... sizeof(3I) ........................................................... 328
Compiler .......................................................................................................... spacing(3I) ........................................................ 329
Compiler .......................................................................................................... bmm(3I) .................................................................... 33
Compiler .......................................................................................................... spread(3I) ........................................................... 331
Compiler .......................................................................................................... sum(3I) .................................................................. 335
Compiler .......................................................................................................... sync_images(3I) ............................................... 340
Compiler .......................................................................................................... system_clock(3I) ............................................. 341
Compiler .......................................................................................................... test_ieee_exception(3I) ............................ 346
Compiler .......................................................................................................... test_ieee_interrupt(3I) ............................ 348
Compiler .......................................................................................................... this_image(3I) ................................................. 350
Compiler .......................................................................................................... tiny(3I) ............................................................... 352
Compiler .......................................................................................................... transfer(3I) ...................................................... 354
Compiler .......................................................................................................... transpose(3I) .................................................... 356
Compiler .......................................................................................................... trim(3I) ............................................................... 357
Compiler .......................................................................................................... ubound(3I) ........................................................... 358
Compiler .......................................................................................................... unpack(3I) ........................................................... 361
Compiler .......................................................................................................... verify(3I) ........................................................... 363
Compiler .......................................................................................................... write_memory_barrier(3I) .......................... 365
Compiler .......................................................................................................... btest(3I) ............................................................... 39
Compiler .......................................................................................................... ceiling(3I) .......................................................... 41
Compiler .......................................................................................................... clear_ieee_exception(3I) ............................ 44
Compiler .......................................................................................................... cloc(3I) ................................................................. 46
Compiler .......................................................................................................... clock(3I) ............................................................... 47
Compiler .......................................................................................................... adjustl(3I) ............................................................ 5
Compiler .......................................................................................................... count(3I) ............................................................... 61
Compiler .......................................................................................................... cpu_time(3I) ........................................................ 63
Compiler .......................................................................................................... cshift(3I) ............................................................. 65
Compiler .......................................................................................................... csmg(3I) ................................................................. 67
Compiler .......................................................................................................... cvmg(3I) ................................................................. 69
Compiler .......................................................................................................... adjustr(3I) ............................................................ 7
Compiler .......................................................................................................... date(3I) ................................................................. 72
Compiler .......................................................................................................... date_and_time(3I) ............................................ 73
Compiler .......................................................................................................... digits(3I) ............................................................. 77
Compiler .......................................................................................................... dot_product(3I) ................................................. 81
Compiler .......................................................................................................... dshiftl(3I) .......................................................... 85
Compiler .......................................................................................................... dshiftr(3I) .......................................................... 87
Compiler .......................................................................................................... dsm(3I) .................................................................... 89
Compiler .......................................................................................................... enable_ieee_interrupt(3I) ......................... 92
Compiler .......................................................................................................... eoshift(3I) .......................................................... 95
Compiler .......................................................................................................... epsilon(3I) .......................................................... 97
compiler ........................................................................................................... ex(3I) .................................................................... 103
compiler ........................................................................................................... gbit(3I) ............................................................... 110
compiler ........................................................................................................... getvm(3I) ............................................................. 123
compiler ........................................................................................................... log2_images(3I) ............................................... 195

Index-10 004– 2138– 003


compiler ........................................................................................................... num_images(3I) ................................................. 250
compiler ........................................................................................................... rem_images(3I) ................................................. 280
compiler ........................................................................................................... bmm(3I) .................................................................... 33
compiler ........................................................................................................... sync_images(3I) ............................................... 340
compiler ........................................................................................................... this_image(3I) ................................................. 350
COMPL(3I) ....................................................................................................... compl(3I) ............................................................... 51
compl(3I) ....................................................................................................... compl(3I) ............................................................... 51
Complement logical ........................................................................................ compl(3I) ............................................................... 51
Complex number computation ........................................................................ aimag(3I) ................................................................. 9
Compute arctangent for single argument ........................................................ atan(3I) ................................................................. 29
Compute arctangent for two arguments .......................................................... atan2(3I) ............................................................... 26
Compute conjugate .......................................................................................... conjg(3I) ............................................................... 53
Computes absolute value ................................................................................ abs(3I) ...................................................................... 1
Computes arc cosine (inverse cosine) ............................................................. acos(3I) ................................................................... 3
Computes arc sine (inverse sine) .................................................................... asin(3I) ................................................................. 22
Computes arc tangent (inverse tangent) for two arguments ........................... atan2(3I) ............................................................... 26
Computes arctangent (inverse tangent) for single argument .......................... atan(3I) ................................................................. 29
Computes bit population parity ....................................................................... poppar(3I) ........................................................... 260
Computes common logarithm ......................................................................... log10(3I) ............................................................. 193
Computes complement .................................................................................... compl(3I) ............................................................... 51
Computes conjugate of a complex number .................................................... conjg(3I) ............................................................... 53
Computes cosine ............................................................................................. cos(3I) .................................................................... 55
Computes cotangent ........................................................................................ cot(3I) .................................................................... 59
Computes double-precision or quad-precision product of two real
numbers ........................................................................................................... dprod(3I) ............................................................... 83
Computes exponential function ....................................................................... exp(3I) .................................................................. 104
Computes hyperbolic cosine ........................................................................... cosh(3I) ................................................................. 57
Computes hyperbolic sine ............................................................................... sinh(3I) ............................................................... 325
Computes hyperbolic tangent .......................................................................... tanh(3I) ............................................................... 344
Computes logical equivalence or difference ................................................... eqv(3I) .................................................................... 99
Computes logical product ............................................................................... and(3I) .................................................................... 16
Computes logical sum ..................................................................................... or(3I) .................................................................... 252
Computes natural logarithm ............................................................................ log(3I) .................................................................. 196
Computes positive difference of two numbers ............................................... dim(3I) .................................................................... 79
Computes pseudo-random numbers ................................................................ ran(3I) .................................................................. 268
Computes remainder ....................................................................................... mod(3I) .................................................................. 228
Computes sine ................................................................................................. sin(3I) .................................................................. 323
Computes square root ..................................................................................... sqrt(3I) ............................................................... 333
Computes tangent ............................................................................................ tan(3I) .................................................................. 342
Concatenates several copies of a string .......................................................... repeat(3I) ........................................................... 282
Conditional vector merge functions ................................................................ cvmg(3I) ................................................................. 69
CONJG(3I) ....................................................................................................... conjg(3I) ............................................................... 53
conjg(3I) ....................................................................................................... conjg(3I) ............................................................... 53
Conjugate ........................................................................................................ conjg(3I) ............................................................... 53
Conjugate of complex number ........................................................................ conjg(3I) ............................................................... 53
Constructs a Cray character pointer in Fortran character Descriptor (FCD)
format .............................................................................................................. fcd(3I) .................................................................. 107
Constructs an array from several copies of an argument ............................... spread(3I) ........................................................... 331
Constructs an array of a specified shape ........................................................ reshape(3I) ........................................................ 283
Convert to double precision ............................................................................ dble(3I) ................................................................. 76

004– 2138– 003 Index-11


Convert to integer ........................................................................................... int(3I) .................................................................. 158
Convert to real ................................................................................................ real(3I) ............................................................... 278
Converts between kinds of logical .................................................................. logical(3I) ........................................................ 198
Converts to double-precision real ................................................................... dble(3I) ................................................................. 76
Converts to nearest integer ............................................................................. nint(3I) ............................................................... 241
Converts to type complex ............................................................................... cmplx(3I) ............................................................... 48
Converts to type integer .................................................................................. int(3I) .................................................................. 158
Converts to type real ....................................................................................... real(3I) ............................................................... 278
Converts x to a real value ............................................................................... ieee_real(3I) .................................................... 150
Converts x to an integral value ....................................................................... ieee_int(3I) ...................................................... 144
Copies a sequence of bits from one integer data object to another ............... mvbits(3I) ........................................................... 237
COS(3I) ............................................................................................................ cos(3I) .................................................................... 55
cos(3I) ............................................................................................................ cos(3I) .................................................................... 55
COSD(3I) ......................................................................................................... cos(3I) .................................................................... 55
cosd(3I) ......................................................................................................... cos(3I) .................................................................... 55
COSH(3I) ......................................................................................................... cosh(3I) ................................................................. 57
cosh(3I) ......................................................................................................... cosh(3I) ................................................................. 57
Cosine .............................................................................................................. cos(3I) .................................................................... 55
Cosine (hyberbolic) ......................................................................................... cosh(3I) ................................................................. 57
COT(3I) ............................................................................................................ cot(3I) .................................................................... 59
cot(3I) ............................................................................................................ cot(3I) .................................................................... 59
COTAN(3I) ....................................................................................................... cot(3I) .................................................................... 59
cotan(3I) ....................................................................................................... cot(3I) .................................................................... 59
Cotangent ........................................................................................................ cot(3I) .................................................................... 59
Count 1 bits ..................................................................................................... popcnt(3I) ........................................................... 258
Count leading zero bits ................................................................................... leadz(3I) ............................................................. 183
COUNT(3I) ....................................................................................................... count(3I) ............................................................... 61
count(3I) ....................................................................................................... count(3I) ............................................................... 61
Counts number of leading 0 bits .................................................................... leadz(3I) ............................................................. 183
Counts number of set bits ............................................................................... popcnt(3I) ........................................................... 258
Counts the number of true array elements ..................................................... count(3I) ............................................................... 61
CPU_TIME(3I) ................................................................................................ cpu_time(3I) ........................................................ 63
cpu_time(3I) ................................................................................................ cpu_time(3I) ........................................................ 63
CQABS(3I) ....................................................................................................... abs(3I) ...................................................................... 1
cqabs(3I) ....................................................................................................... abs(3I) ...................................................................... 1
CQCOS(3I) ....................................................................................................... cos(3I) .................................................................... 55
cqcos(3I) ....................................................................................................... cos(3I) .................................................................... 55
CQCOTAN(3I) .................................................................................................. cot(3I) .................................................................... 59
CQEXP(3I) ....................................................................................................... exp(3I) .................................................................. 104
cqexp(3I) ....................................................................................................... exp(3I) .................................................................. 104
CQLOG(3I) ....................................................................................................... log(3I) .................................................................. 196
cqlog(3I) ....................................................................................................... log(3I) .................................................................. 196
CQSIN(3I) ....................................................................................................... sin(3I) .................................................................. 323
cqsin(3I) ....................................................................................................... sin(3I) .................................................................. 323
CQSQRT(3I) .................................................................................................... sqrt(3I) ............................................................... 333
CSHIFT(3I) .................................................................................................... cshift(3I) ............................................................. 65
cshift(3I) .................................................................................................... cshift(3I) ............................................................. 65
CSIN(3I) ......................................................................................................... sin(3I) .................................................................. 323
csin(3I) ......................................................................................................... sin(3I) .................................................................. 323
CSMG(3I) ......................................................................................................... csmg(3I) ................................................................. 67

Index-12 004– 2138– 003


csmg(3I) ......................................................................................................... csmg(3I) ................................................................. 67
CSQRT(3I) ....................................................................................................... sqrt(3I) ............................................................... 333
Current system time ........................................................................................ clock(3I) ............................................................... 47
cvmg(3I) ......................................................................................................... cvmg(3I) ................................................................. 69
CVMGM(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
cvmgm(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
CVMGN(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
cvmgn(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
CVMGP(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
cvmgp(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
CVMGT(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
cvmgt(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
CVMGZ(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
cvmgz(3I) ....................................................................................................... cvmg(3I) ................................................................. 69
DABS(3I) ......................................................................................................... abs(3I) ...................................................................... 1
dabs(3I) ......................................................................................................... abs(3I) ...................................................................... 1
DACOS(3I) ....................................................................................................... acos(3I) ................................................................... 3
dacos(3I) ....................................................................................................... acos(3I) ................................................................... 3
DACOSD(3I) .................................................................................................... acos(3I) ................................................................... 3
dacosd(3I) .................................................................................................... acos(3I) ................................................................... 3
DASIN(3I) ....................................................................................................... asin(3I) ................................................................. 22
dasin(3I) ....................................................................................................... asin(3I) ................................................................. 22
DASIND(3I) .................................................................................................... asin(3I) ................................................................. 22
dasind(3I) .................................................................................................... asin(3I) ................................................................. 22
Data conversion (integer to character) ............................................................ char(3I) ................................................................. 42
data word ......................................................................................................... gbit(3I) ............................................................... 110
data word ......................................................................................................... pbit(3I) ............................................................... 256
data word ......................................................................................................... cmr(3I) .................................................................... 50
DATAN2(3I) .................................................................................................... atan2(3I) ............................................................... 26
datan2(3I) .................................................................................................... atan2(3I) ............................................................... 26
DATAN2D(3I) .................................................................................................. atan2(3I) ............................................................... 26
datan2d(3I) .................................................................................................. atan2(3I) ............................................................... 26
DATAN(3I) ....................................................................................................... atan(3I) ................................................................. 29
datan(3I) ....................................................................................................... atan(3I) ................................................................. 29
DATAND(3I) .................................................................................................... atan(3I) ................................................................. 29
datand(3I) .................................................................................................... atan(3I) ................................................................. 29
DATE(3I) ......................................................................................................... date(3I) ................................................................. 72
date(3I) ......................................................................................................... date(3I) ................................................................. 72
DATE_AND_TIME(3I) .................................................................................... date_and_time(3I) ............................................ 73
date_and_time(3I) .................................................................................... date_and_time(3I) ............................................ 73
DBLE(3I) ......................................................................................................... dble(3I) ................................................................. 76
dble(3I) ......................................................................................................... dble(3I) ................................................................. 76
DCMPLX(3I) .................................................................................................... cmplx(3I) ............................................................... 48
dcmplx(3I) .................................................................................................... cmplx(3I) ............................................................... 48
DCONJG(3I) .................................................................................................... conjg(3I) ............................................................... 53
DCOS(3I) ......................................................................................................... cos(3I) .................................................................... 55
dcos(3I) ......................................................................................................... cos(3I) .................................................................... 55
DCOSD(3I) ....................................................................................................... cos(3I) .................................................................... 55
dcosd(3I) ....................................................................................................... cos(3I) .................................................................... 55
DCOSH(3I) ....................................................................................................... cosh(3I) ................................................................. 57

004– 2138– 003 Index-13


dcosh(3I) ....................................................................................................... cosh(3I) ................................................................. 57
DCOT(3I) ......................................................................................................... cot(3I) .................................................................... 59
dcot(3I) ......................................................................................................... cot(3I) .................................................................... 59
DCOTAN(3I) .................................................................................................... cot(3I) .................................................................... 59
dcotan(3I) .................................................................................................... cot(3I) .................................................................... 59
DDIM(3I) ......................................................................................................... dim(3I) .................................................................... 79
ddim(3I) ......................................................................................................... dim(3I) .................................................................... 79
Describes mathematical representation models for CF90 and MIPSpro 7
Fortran 90 compiler intrinsic procedures ........................................................ models(3I) ........................................................... 230
Determines the length of a character string .................................................... len(3I) .................................................................. 185
Determines the starting location of a character substring in a string ............. index(3I) ............................................................. 156
Determines whether all values are true .......................................................... all(3I) .................................................................... 13
Determines whether an optional argument is present ..................................... present(3I) ........................................................ 264
Determines whether any values are true ......................................................... any(3I) .................................................................... 20
DEXP(3I) ......................................................................................................... exp(3I) .................................................................. 104
dexp(3I) ......................................................................................................... exp(3I) .................................................................. 104
DFLOAT(3I) .................................................................................................... real(3I) ............................................................... 278
dfloat(3I) .................................................................................................... real(3I) ............................................................... 278
DFLOATI(3I) .................................................................................................. real(3I) ............................................................... 278
dfloati(3I) .................................................................................................. real(3I) ............................................................... 278
DFLOATJ(3I) .................................................................................................. real(3I) ............................................................... 278
dfloatj(3I) .................................................................................................. real(3I) ............................................................... 278
DFLOATK(3I) .................................................................................................. real(3I) ............................................................... 278
dfloatk(3I) .................................................................................................. real(3I) ............................................................... 278
Difference of two numbers (positive) ............................................................. dim(3I) .................................................................... 79
DIGITS(3I) .................................................................................................... digits(3I) ............................................................. 77
digits(3I) .................................................................................................... digits(3I) ............................................................. 77
DIM(3I) ............................................................................................................ dim(3I) .................................................................... 79
dim(3I) ............................................................................................................ dim(3I) .................................................................... 79
DIMAG(3I) ....................................................................................................... aimag(3I) ................................................................. 9
dimag(3I) ....................................................................................................... aimag(3I) ................................................................. 9
DINT(3I) ......................................................................................................... aint(3I) ................................................................. 11
dint(3I) ......................................................................................................... aint(3I) ................................................................. 11
DISABLE_IEEE_INTERRUPT(3I) ............................................................... enable_ieee_interrupt(3I) ......................... 92
disable_ieee_interrupt(3I) ............................................................... enable_ieee_interrupt(3I) ......................... 92
Disk file positioning ........................................................................................ getpos(3I) ........................................................... 120
DLOG10(3I) .................................................................................................... log10(3I) ............................................................. 193
dlog10(3I) .................................................................................................... log10(3I) ............................................................. 193
DLOG(3I) ......................................................................................................... log(3I) .................................................................. 196
dlog(3I) ......................................................................................................... log(3I) .................................................................. 196
DMAX1(3I) ....................................................................................................... max(3I) .................................................................. 207
dmax1(3I) ....................................................................................................... max(3I) .................................................................. 207
DMIN1(3I) ....................................................................................................... min(3I) .................................................................. 219
dmin1(3I) ....................................................................................................... min(3I) .................................................................. 219
DMOD(3I) ......................................................................................................... mod(3I) .................................................................. 228
dmod(3I) ......................................................................................................... mod(3I) .................................................................. 228
DNINT(3I) ....................................................................................................... anint(3I) ............................................................... 18
dnint(3I) ....................................................................................................... anint(3I) ............................................................... 18
DOT_PRODUCT(3I) ......................................................................................... dot_product(3I) ................................................. 81
dot_product(3I) ......................................................................................... dot_product(3I) ................................................. 81

Index-14 004– 2138– 003


Double precision ............................................................................................. dble(3I) ................................................................. 76
Double precision ............................................................................................. dprod(3I) ............................................................... 83
Double precision product ................................................................................ dprod(3I) ............................................................... 83
Double precision product (real numbers) ....................................................... dprod(3I) ............................................................... 83
Double-precision ............................................................................................. dble(3I) ................................................................. 76
Double-precision ............................................................................................. dprod(3I) ............................................................... 83
Double-precision product ................................................................................ dprod(3I) ............................................................... 83
Double-precision product (real numbers) ....................................................... dprod(3I) ............................................................... 83
Double-precision truncation ............................................................................ aint(3I) ................................................................. 11
DPROD(3I) ....................................................................................................... dprod(3I) ............................................................... 83
dprod(3I) ....................................................................................................... dprod(3I) ............................................................... 83
DREAL(3I) ....................................................................................................... real(3I) ............................................................... 278
dreal(3I) ....................................................................................................... real(3I) ............................................................... 278
DSHIFTL(3I) .................................................................................................. dshiftl(3I) .......................................................... 85
dshiftl(3I) .................................................................................................. dshiftl(3I) .......................................................... 85
_dshiftl(3I) ................................................................................................ dshiftl(3I) .......................................................... 85
DSHIFTR(3I) .................................................................................................. dshiftr(3I) .......................................................... 87
dshiftr(3I) .................................................................................................. dshiftr(3I) .......................................................... 87
_dshiftr(3I) ................................................................................................ dshiftr(3I) .......................................................... 87
DSIGN(3I) ....................................................................................................... sign(3I) ............................................................... 321
dsign(3I) ....................................................................................................... sign(3I) ............................................................... 321
DSIN(3I) ......................................................................................................... sin(3I) .................................................................. 323
dsin(3I) ......................................................................................................... sin(3I) .................................................................. 323
DSIND(3I) ....................................................................................................... sin(3I) .................................................................. 323
dsind(3I) ....................................................................................................... sin(3I) .................................................................. 323
DSINH(3I) ....................................................................................................... sinh(3I) ............................................................... 325
dsm(3I) ............................................................................................................ dsm(3I) .................................................................... 89
DSM_CHUNKSIZE(3I) .................................................................................... dsm(3I) .................................................................... 89
dsm_chunksize(3I) .................................................................................... dsm(3I) .................................................................... 89
DSM_DISTRIBUTION_BLOCK(3I) ............................................................... dsm(3I) .................................................................... 89
dsm_distribution_block(3I) ............................................................... dsm(3I) .................................................................... 89
DSM_DISTRIBUTION_CYCLIC(3I) ............................................................. dsm(3I) .................................................................... 89
dsm_distribution_cyclic(3I) ............................................................. dsm(3I) .................................................................... 89
DSM_DISTRIBUTION_STAR(3I) ................................................................. dsm(3I) .................................................................... 89
dsm_distribution_star(3I) ................................................................. dsm(3I) .................................................................... 89
DSM_ISDISTRIBUTED(3I) ........................................................................... dsm(3I) .................................................................... 89
dsm_isdistributed(3I) ........................................................................... dsm(3I) .................................................................... 89
DSM_ISRESHAPED(3I) .................................................................................. dsm(3I) .................................................................... 89
dsm_isreshaped(3I) .................................................................................. dsm(3I) .................................................................... 89
DSM_NUMCHUNKS(3I) .................................................................................... dsm(3I) .................................................................... 89
dsm_numchunks(3I) .................................................................................... dsm(3I) .................................................................... 89
DSM_NUMTHREADS(3I) .................................................................................. dsm(3I) .................................................................... 89
dsm_numthreads(3I) .................................................................................. dsm(3I) .................................................................... 89
DSM_REM_CHUNKSIZE(3I) ........................................................................... dsm(3I) .................................................................... 89
dsm_rem_chunksize(3I) ........................................................................... dsm(3I) .................................................................... 89
DSM_THIS_CHUNKSIZE(3I) ........................................................................ dsm(3I) .................................................................... 89
dsm_this_chunksize(3I) ........................................................................ dsm(3I) .................................................................... 89
DSM_THIS_STARTINGINDEX(3I) ............................................................... dsm(3I) .................................................................... 89
dsm_this_startingindex(3I) ............................................................... dsm(3I) .................................................................... 89
DSM_THIS_THREADNUM(3I) ........................................................................ dsm(3I) .................................................................... 89

004– 2138– 003 Index-15


dsm_this_threadnum(3I) ........................................................................ dsm(3I) .................................................................... 89
DSQRT(3I) ....................................................................................................... sqrt(3I) ............................................................... 333
DTAN(3I) ......................................................................................................... tan(3I) .................................................................. 342
dtan(3I) ......................................................................................................... tan(3I) .................................................................. 342
DTAND(3I) ....................................................................................................... tan(3I) .................................................................. 342
dtand(3I) ....................................................................................................... tan(3I) .................................................................. 342
DTANH(3I) ....................................................................................................... tanh(3I) ............................................................... 344
ENABLE_IEEE_INTERRUPT(3I) ................................................................. enable_ieee_interrupt(3I) ......................... 92
enable_ieee_interrupt(3I) ................................................................. enable_ieee_interrupt(3I) ......................... 92
Enables or disables floating-point interrupt .................................................... enable_ieee_interrupt(3I) ......................... 92
EOSHIFT(3I) .................................................................................................. eoshift(3I) .......................................................... 95
eoshift(3I) .................................................................................................. eoshift(3I) .......................................................... 95
EPSILON(3I) .................................................................................................. epsilon(3I) .......................................................... 97
epsilon(3I) .................................................................................................. epsilon(3I) .......................................................... 97
Equivalence ..................................................................................................... eqv(3I) .................................................................... 99
Equivalence (logical) ....................................................................................... eqv(3I) .................................................................... 99
EQV(3I) ............................................................................................................ eqv(3I) .................................................................... 99
eqv(3I) ............................................................................................................ eqv(3I) .................................................................... 99
ex(3I) .............................................................................................................. ex(3I) .................................................................... 103
_EX(3I) ............................................................................................................ ex(3I) .................................................................... 103
exit ................................................................................................................... ex(3I) .................................................................... 103
exit ................................................................................................................... getvm(3I) ............................................................. 123
EXP(3I) ............................................................................................................ exp(3I) .................................................................. 104
exp(3I) ............................................................................................................ exp(3I) .................................................................. 104
EXPONENT(3I) ................................................................................................ exponent(3I) ...................................................... 106
exponent(3I) ................................................................................................ exponent(3I) ...................................................... 106
Exponential function ....................................................................................... exp(3I) .................................................................. 104
Extracts a sequence of bits ............................................................................. ibits(3I) ............................................................. 131
FCD(3I) ............................................................................................................ fcd(3I) .................................................................. 107
fcd(3I) ............................................................................................................ fcd(3I) .................................................................. 107
FETCH_AND_ADD(3I) .................................................................................... sync(3I) ............................................................... 337
fetch_and_add(3I) .................................................................................... sync(3I) ............................................................... 337
FETCH_AND_AND(3I) .................................................................................... sync(3I) ............................................................... 337
fetch_and_and(3I) .................................................................................... sync(3I) ............................................................... 337
FETCH_AND_NAND(3I) .................................................................................. sync(3I) ............................................................... 337
fetch_and_nand(3I) .................................................................................. sync(3I) ............................................................... 337
FETCH_AND_OR(3I) ...................................................................................... sync(3I) ............................................................... 337
fetch_and_or(3I) ...................................................................................... sync(3I) ............................................................... 337
FETCH_AND_SUB(3I) .................................................................................... sync(3I) ............................................................... 337
fetch_and_sub(3I) .................................................................................... sync(3I) ............................................................... 337
FETCH_AND_XOR(3I) .................................................................................... sync(3I) ............................................................... 337
fetch_and_xor(3I) .................................................................................... sync(3I) ............................................................... 337
File position .................................................................................................... getpos(3I) ........................................................... 120
Finds nearest whole number ........................................................................... anint(3I) ............................................................... 18
FLOAT(3I) ....................................................................................................... real(3I) ............................................................... 278
float(3I) ....................................................................................................... real(3I) ............................................................... 278
FLOATI(3I) .................................................................................................... real(3I) ............................................................... 278
floati(3I) .................................................................................................... real(3I) ............................................................... 278
FLOATJ(3I) .................................................................................................... real(3I) ............................................................... 278
floatj(3I) .................................................................................................... real(3I) ............................................................... 278

Index-16 004– 2138– 003


FLOATK(3I) .................................................................................................... real(3I) ............................................................... 278
floatk(3I) .................................................................................................... real(3I) ............................................................... 278
FLOOR(3I) ....................................................................................................... floor(3I) ............................................................. 108
floor(3I) ....................................................................................................... floor(3I) ............................................................. 108
fntrinsic ........................................................................................................... cmr(3I) .................................................................... 50
Forms the product of array elements .............................................................. product(3I) ........................................................ 265
FORTRAN ...................................................................................................... sync(3I) ............................................................... 337
Fortran ............................................................................................................. exponent(3I) ...................................................... 106
Fortran ............................................................................................................. fcd(3I) .................................................................. 107
Fortran ............................................................................................................. floor(3I) ............................................................. 108
Fortran ............................................................................................................. fraction(3I) ...................................................... 109
Fortran ............................................................................................................. get_ieee_exceptions(3I) ............................ 112
Fortran ............................................................................................................. get_ieee_interrupts(3I) ............................ 114
Fortran ............................................................................................................. get_ieee_rounding_mode(3I) ..................... 116
Fortran ............................................................................................................. get_ieee_status(3I)...................................... 118
Fortran ............................................................................................................. getpos(3I) ........................................................... 120
Fortran ............................................................................................................. huge(3I) ............................................................... 124
Fortran ............................................................................................................. iand(3I) ............................................................... 126
Fortran ............................................................................................................. ibchng(3I) ........................................................... 129
Fortran ............................................................................................................. all(3I) .................................................................... 13
Fortran ............................................................................................................. ibits(3I) ............................................................. 131
Fortran ............................................................................................................. ieee_binary_scale(3I) ................................. 134
Fortran ............................................................................................................. ieee_class(3I) ................................................. 136
Fortran ............................................................................................................. ieee_copy_sign(3I) ........................................ 138
Fortran ............................................................................................................. ieee_exponent(3I) .......................................... 140
Fortran ............................................................................................................. ieee_finite(3I) ............................................... 143
Fortran ............................................................................................................. ieee_int(3I) ...................................................... 144
Fortran ............................................................................................................. ieee_is_nan(3I) ............................................... 146
Fortran ............................................................................................................. ieee_next_after(3I)...................................... 148
Fortran ............................................................................................................. allocated(3I) ...................................................... 15
Fortran ............................................................................................................. ieee_real(3I) .................................................... 150
Fortran ............................................................................................................. ieee_remainder(3I) ........................................ 152
Fortran ............................................................................................................. ieee_unordered(3I) ........................................ 154
Fortran ............................................................................................................. index(3I) ............................................................. 156
Fortran ............................................................................................................. int_mult_upper(3I) ........................................ 160
Fortran ............................................................................................................. isha(3I) ............................................................... 173
Fortran ............................................................................................................. ishc(3I) ............................................................... 174
Fortran ............................................................................................................. ishft(3I) ............................................................. 175
Fortran ............................................................................................................. ishftc(3I) ........................................................... 177
Fortran ............................................................................................................. ishl(3I) ............................................................... 179
Fortran ............................................................................................................. kind(3I) ............................................................... 180
Fortran ............................................................................................................. lbound(3I) ........................................................... 181
Fortran ............................................................................................................. length(3I) ........................................................... 186
Fortran ............................................................................................................. len_trim(3I) ...................................................... 188
Fortran ............................................................................................................. loc(3I) .................................................................. 191
Fortran ............................................................................................................. log2_images(3I) ............................................... 195
Fortran ............................................................................................................. logical(3I) ........................................................ 198
Fortran ............................................................................................................. long(3I) ............................................................... 199
Fortran ............................................................................................................. any(3I) .................................................................... 20
Fortran ............................................................................................................. malloc(3I) ........................................................... 200

004– 2138– 003 Index-17


Fortran ............................................................................................................. matmul(3I) ........................................................... 205
Fortran ............................................................................................................. max(3I) .................................................................. 207
Fortran ............................................................................................................. maxexponent(3I) ............................................... 209
Fortran ............................................................................................................. maxloc(3I) ........................................................... 211
Fortran ............................................................................................................. maxval(3I) ........................................................... 214
Fortran ............................................................................................................. memory_barrier(3I) ........................................ 216
Fortran ............................................................................................................. merge(3I) ............................................................. 217
Fortran ............................................................................................................. min(3I) .................................................................. 219
Fortran ............................................................................................................. minexponent(3I) ............................................... 221
Fortran ............................................................................................................. minloc(3I) ........................................................... 223
Fortran ............................................................................................................. minval(3I) ........................................................... 226
Fortran ............................................................................................................. modulo(3I) ........................................................... 235
Fortran ............................................................................................................. mvbits(3I) ........................................................... 237
Fortran ............................................................................................................. my_pe(3I) ............................................................. 238
Fortran ............................................................................................................. associated(3I) ................................................... 24
Fortran ............................................................................................................. nearest(3I) ........................................................ 240
Fortran ............................................................................................................. not(3I) .................................................................. 243
Fortran ............................................................................................................. null(3I) ............................................................... 245
Fortran ............................................................................................................. numarg(3I) ........................................................... 247
Fortran ............................................................................................................. num_images(3I) ................................................. 250
Fortran ............................................................................................................. pack(3I) ............................................................... 254
Fortran ............................................................................................................. precision(3I) .................................................... 262
Fortran ............................................................................................................. present(3I) ........................................................ 264
Fortran ............................................................................................................. product(3I) ........................................................ 265
Fortran ............................................................................................................. radix(3I) ............................................................. 267
Fortran ............................................................................................................. random_number(3I) .......................................... 272
Fortran ............................................................................................................. random_seed(3I) ............................................... 273
Fortran ............................................................................................................. range(3I) ............................................................. 274
Fortran ............................................................................................................. rem_images(3I) ................................................. 280
Fortran ............................................................................................................. remote_write_barrier(3I) .......................... 281
Fortran ............................................................................................................. repeat(3I) ........................................................... 282
Fortran ............................................................................................................. reshape(3I) ........................................................ 283
Fortran ............................................................................................................. rrspacing(3I) .................................................... 285
Fortran ............................................................................................................. rtc(3I) .................................................................. 287
Fortran ............................................................................................................. scale(3I) ............................................................. 289
Fortran ............................................................................................................. scan(3I) ............................................................... 290
Fortran ............................................................................................................. selected_int_kind(3I) ................................. 292
Fortran ............................................................................................................. selected_real_kind(3I)............................... 294
Fortran ............................................................................................................. set_exponent(3I) ............................................. 300
Fortran ............................................................................................................. set_ieee_exception(3I)............................... 302
Fortran ............................................................................................................. set_ieee_exceptions(3I) ............................ 304
Fortran ............................................................................................................. set_ieee_interrupts(3I) ............................ 305
Fortran ............................................................................................................. set_ieee_rounding_mode(3I) ..................... 306
Fortran ............................................................................................................. set_ieee_status(3I)...................................... 309
Fortran ............................................................................................................. bit_size(3I) ........................................................ 31
Fortran ............................................................................................................. shape(3I) ............................................................. 311
Fortran ............................................................................................................. shifta(3I) ........................................................... 314
Fortran ............................................................................................................. short(3I) ............................................................. 320
Fortran ............................................................................................................. size(3I) ............................................................... 327
Fortran ............................................................................................................. sizeof(3I) ........................................................... 328

Index-18 004– 2138– 003


Fortran ............................................................................................................. spacing(3I) ........................................................ 329
Fortran ............................................................................................................. bmm(3I) .................................................................... 33
Fortran ............................................................................................................. spread(3I) ........................................................... 331
Fortran ............................................................................................................. sum(3I) .................................................................. 335
Fortran ............................................................................................................. sync(3I) ............................................................... 337
Fortran ............................................................................................................. sync_images(3I) ............................................... 340
Fortran ............................................................................................................. system_clock(3I) ............................................. 341
Fortran ............................................................................................................. test_ieee_exception(3I) ............................ 346
Fortran ............................................................................................................. test_ieee_interrupt(3I) ............................ 348
Fortran ............................................................................................................. this_image(3I) ................................................. 350
Fortran ............................................................................................................. tiny(3I) ............................................................... 352
Fortran ............................................................................................................. transfer(3I) ...................................................... 354
Fortran ............................................................................................................. transpose(3I) .................................................... 356
Fortran ............................................................................................................. trim(3I) ............................................................... 357
Fortran ............................................................................................................. ubound(3I) ........................................................... 358
Fortran ............................................................................................................. unpack(3I) ........................................................... 361
Fortran ............................................................................................................. verify(3I) ........................................................... 363
Fortran ............................................................................................................. write_memory_barrier(3I) .......................... 365
Fortran ............................................................................................................. btest(3I) ............................................................... 39
Fortran ............................................................................................................. ceiling(3I) .......................................................... 41
Fortran ............................................................................................................. clear_ieee_exception(3I) ............................ 44
Fortran ............................................................................................................. cloc(3I) ................................................................. 46
Fortran ............................................................................................................. clock(3I) ............................................................... 47
Fortran ............................................................................................................. adjustl(3I) ............................................................ 5
Fortran ............................................................................................................. count(3I) ............................................................... 61
Fortran ............................................................................................................. cpu_time(3I) ........................................................ 63
Fortran ............................................................................................................. cshift(3I) ............................................................. 65
Fortran ............................................................................................................. csmg(3I) ................................................................. 67
Fortran ............................................................................................................. cvmg(3I) ................................................................. 69
Fortran ............................................................................................................. adjustr(3I) ............................................................ 7
Fortran ............................................................................................................. date(3I) ................................................................. 72
Fortran ............................................................................................................. date_and_time(3I) ............................................ 73
Fortran ............................................................................................................. digits(3I) ............................................................. 77
Fortran ............................................................................................................. dot_product(3I) ................................................. 81
Fortran ............................................................................................................. dshiftl(3I) .......................................................... 85
Fortran ............................................................................................................. dshiftr(3I) .......................................................... 87
Fortran ............................................................................................................. dsm(3I) .................................................................... 89
Fortran ............................................................................................................. enable_ieee_interrupt(3I) ......................... 92
Fortran ............................................................................................................. eoshift(3I) .......................................................... 95
Fortran ............................................................................................................. epsilon(3I) .......................................................... 97
FORTRAN 77 ................................................................................................. malloc(3I) ........................................................... 200
Fortran 77 ........................................................................................................ malloc(3I) ........................................................... 200
Fortran 90 ........................................................................................................ malloc(3I) ........................................................... 200
Fortran 90 ........................................................................................................ dsm(3I) .................................................................... 89
Fortran 95 ........................................................................................................ exponent(3I) ...................................................... 106
Fortran 95 ........................................................................................................ fcd(3I) .................................................................. 107
Fortran 95 ........................................................................................................ floor(3I) ............................................................. 108
Fortran 95 ........................................................................................................ fraction(3I) ...................................................... 109
Fortran 95 ........................................................................................................ get_ieee_exceptions(3I) ............................ 112
Fortran 95 ........................................................................................................ get_ieee_interrupts(3I) ............................ 114

004– 2138– 003 Index-19


Fortran 95 ........................................................................................................ get_ieee_rounding_mode(3I) ..................... 116
Fortran 95 ........................................................................................................ get_ieee_status(3I)...................................... 118
Fortran 95 ........................................................................................................ getpos(3I) ........................................................... 120
Fortran 95 ........................................................................................................ huge(3I) ............................................................... 124
Fortran 95 ........................................................................................................ iand(3I) ............................................................... 126
Fortran 95 ........................................................................................................ ibchng(3I) ........................................................... 129
Fortran 95 ........................................................................................................ all(3I) .................................................................... 13
Fortran 95 ........................................................................................................ ibits(3I) ............................................................. 131
Fortran 95 ........................................................................................................ ieee_binary_scale(3I) ................................. 134
Fortran 95 ........................................................................................................ ieee_class(3I) ................................................. 136
Fortran 95 ........................................................................................................ ieee_copy_sign(3I) ........................................ 138
Fortran 95 ........................................................................................................ ieee_exponent(3I) .......................................... 140
Fortran 95 ........................................................................................................ ieee_finite(3I) ............................................... 143
Fortran 95 ........................................................................................................ ieee_int(3I) ...................................................... 144
Fortran 95 ........................................................................................................ ieee_is_nan(3I) ............................................... 146
Fortran 95 ........................................................................................................ ieee_next_after(3I)...................................... 148
Fortran 95 ........................................................................................................ allocated(3I) ...................................................... 15
Fortran 95 ........................................................................................................ ieee_real(3I) .................................................... 150
Fortran 95 ........................................................................................................ ieee_remainder(3I) ........................................ 152
Fortran 95 ........................................................................................................ ieee_unordered(3I) ........................................ 154
Fortran 95 ........................................................................................................ index(3I) ............................................................. 156
Fortran 95 ........................................................................................................ int_mult_upper(3I) ........................................ 160
Fortran 95 ........................................................................................................ isha(3I) ............................................................... 173
Fortran 95 ........................................................................................................ ishc(3I) ............................................................... 174
Fortran 95 ........................................................................................................ ishft(3I) ............................................................. 175
Fortran 95 ........................................................................................................ ishftc(3I) ........................................................... 177
Fortran 95 ........................................................................................................ ishl(3I) ............................................................... 179
Fortran 95 ........................................................................................................ kind(3I) ............................................................... 180
Fortran 95 ........................................................................................................ lbound(3I) ........................................................... 181
Fortran 95 ........................................................................................................ length(3I) ........................................................... 186
Fortran 95 ........................................................................................................ len_trim(3I) ...................................................... 188
Fortran 95 ........................................................................................................ loc(3I) .................................................................. 191
Fortran 95 ........................................................................................................ log2_images(3I) ............................................... 195
Fortran 95 ........................................................................................................ logical(3I) ........................................................ 198
Fortran 95 ........................................................................................................ long(3I) ............................................................... 199
Fortran 95 ........................................................................................................ any(3I) .................................................................... 20
Fortran 95 ........................................................................................................ malloc(3I) ........................................................... 200
Fortran 95 ........................................................................................................ matmul(3I) ........................................................... 205
Fortran 95 ........................................................................................................ max(3I) .................................................................. 207
Fortran 95 ........................................................................................................ maxexponent(3I) ............................................... 209
Fortran 95 ........................................................................................................ maxloc(3I) ........................................................... 211
Fortran 95 ........................................................................................................ maxval(3I) ........................................................... 214
Fortran 95 ........................................................................................................ memory_barrier(3I) ........................................ 216
Fortran 95 ........................................................................................................ merge(3I) ............................................................. 217
Fortran 95 ........................................................................................................ min(3I) .................................................................. 219
Fortran 95 ........................................................................................................ minexponent(3I) ............................................... 221
Fortran 95 ........................................................................................................ minloc(3I) ........................................................... 223
Fortran 95 ........................................................................................................ minval(3I) ........................................................... 226
Fortran 95 ........................................................................................................ modulo(3I) ........................................................... 235
Fortran 95 ........................................................................................................ mvbits(3I) ........................................................... 237

Index-20 004– 2138– 003


Fortran 95 ........................................................................................................ my_pe(3I) ............................................................. 238
Fortran 95 ........................................................................................................ associated(3I) ................................................... 24
Fortran 95 ........................................................................................................ nearest(3I) ........................................................ 240
Fortran 95 ........................................................................................................ not(3I) .................................................................. 243
Fortran 95 ........................................................................................................ null(3I) ............................................................... 245
Fortran 95 ........................................................................................................ numarg(3I) ........................................................... 247
Fortran 95 ........................................................................................................ num_images(3I) ................................................. 250
Fortran 95 ........................................................................................................ pack(3I) ............................................................... 254
Fortran 95 ........................................................................................................ precision(3I) .................................................... 262
Fortran 95 ........................................................................................................ present(3I) ........................................................ 264
Fortran 95 ........................................................................................................ product(3I) ........................................................ 265
Fortran 95 ........................................................................................................ radix(3I) ............................................................. 267
Fortran 95 ........................................................................................................ random_number(3I) .......................................... 272
Fortran 95 ........................................................................................................ random_seed(3I) ............................................... 273
Fortran 95 ........................................................................................................ range(3I) ............................................................. 274
Fortran 95 ........................................................................................................ rem_images(3I) ................................................. 280
Fortran 95 ........................................................................................................ remote_write_barrier(3I) .......................... 281
Fortran 95 ........................................................................................................ repeat(3I) ........................................................... 282
Fortran 95 ........................................................................................................ reshape(3I) ........................................................ 283
Fortran 95 ........................................................................................................ rrspacing(3I) .................................................... 285
Fortran 95 ........................................................................................................ rtc(3I) .................................................................. 287
Fortran 95 ........................................................................................................ scale(3I) ............................................................. 289
Fortran 95 ........................................................................................................ scan(3I) ............................................................... 290
Fortran 95 ........................................................................................................ selected_int_kind(3I) ................................. 292
Fortran 95 ........................................................................................................ selected_real_kind(3I)............................... 294
Fortran 95 ........................................................................................................ set_exponent(3I) ............................................. 300
Fortran 95 ........................................................................................................ set_ieee_exception(3I)............................... 302
Fortran 95 ........................................................................................................ set_ieee_exceptions(3I) ............................ 304
Fortran 95 ........................................................................................................ set_ieee_interrupts(3I) ............................ 305
Fortran 95 ........................................................................................................ set_ieee_rounding_mode(3I) ..................... 306
Fortran 95 ........................................................................................................ set_ieee_status(3I)...................................... 309
Fortran 95 ........................................................................................................ bit_size(3I) ........................................................ 31
Fortran 95 ........................................................................................................ shape(3I) ............................................................. 311
Fortran 95 ........................................................................................................ shifta(3I) ........................................................... 314
Fortran 95 ........................................................................................................ short(3I) ............................................................. 320
Fortran 95 ........................................................................................................ size(3I) ............................................................... 327
Fortran 95 ........................................................................................................ sizeof(3I) ........................................................... 328
Fortran 95 ........................................................................................................ spacing(3I) ........................................................ 329
Fortran 95 ........................................................................................................ bmm(3I) .................................................................... 33
Fortran 95 ........................................................................................................ spread(3I) ........................................................... 331
Fortran 95 ........................................................................................................ sum(3I) .................................................................. 335
Fortran 95 ........................................................................................................ sync_images(3I) ............................................... 340
Fortran 95 ........................................................................................................ system_clock(3I) ............................................. 341
Fortran 95 ........................................................................................................ test_ieee_exception(3I) ............................ 346
Fortran 95 ........................................................................................................ test_ieee_interrupt(3I) ............................ 348
Fortran 95 ........................................................................................................ this_image(3I) ................................................. 350
Fortran 95 ........................................................................................................ tiny(3I) ............................................................... 352
Fortran 95 ........................................................................................................ transfer(3I) ...................................................... 354
Fortran 95 ........................................................................................................ transpose(3I) .................................................... 356
Fortran 95 ........................................................................................................ trim(3I) ............................................................... 357

004– 2138– 003 Index-21


Fortran 95 ........................................................................................................ ubound(3I) ........................................................... 358
Fortran 95 ........................................................................................................ unit(3I) ............................................................... 359
Fortran 95 ........................................................................................................ unpack(3I) ........................................................... 361
Fortran 95 ........................................................................................................ verify(3I) ........................................................... 363
Fortran 95 ........................................................................................................ write_memory_barrier(3I) .......................... 365
Fortran 95 ........................................................................................................ btest(3I) ............................................................... 39
Fortran 95 ........................................................................................................ ceiling(3I) .......................................................... 41
Fortran 95 ........................................................................................................ clear_ieee_exception(3I) ............................ 44
Fortran 95 ........................................................................................................ cloc(3I) ................................................................. 46
Fortran 95 ........................................................................................................ clock(3I) ............................................................... 47
Fortran 95 ........................................................................................................ adjustl(3I) ............................................................ 5
Fortran 95 ........................................................................................................ count(3I) ............................................................... 61
Fortran 95 ........................................................................................................ cpu_time(3I) ........................................................ 63
Fortran 95 ........................................................................................................ cshift(3I) ............................................................. 65
Fortran 95 ........................................................................................................ csmg(3I) ................................................................. 67
Fortran 95 ........................................................................................................ cvmg(3I) ................................................................. 69
Fortran 95 ........................................................................................................ adjustr(3I) ............................................................ 7
Fortran 95 ........................................................................................................ date(3I) ................................................................. 72
Fortran 95 ........................................................................................................ date_and_time(3I) ............................................ 73
Fortran 95 ........................................................................................................ digits(3I) ............................................................. 77
Fortran 95 ........................................................................................................ dot_product(3I) ................................................. 81
Fortran 95 ........................................................................................................ dshiftl(3I) .......................................................... 85
Fortran 95 ........................................................................................................ dshiftr(3I) .......................................................... 87
Fortran 95 ........................................................................................................ enable_ieee_interrupt(3I) ......................... 92
Fortran 95 ........................................................................................................ eoshift(3I) .......................................................... 95
Fortran 95 ........................................................................................................ epsilon(3I) .......................................................... 97
Fortran character string length ........................................................................ len(3I) .................................................................. 185
Fortran intrinsic ............................................................................................... abs(3I) ...................................................................... 1
Fortran intrinsic ............................................................................................... exp(3I) .................................................................. 104
Fortran intrinsic ............................................................................................... aint(3I) ................................................................. 11
Fortran intrinsic ............................................................................................... int(3I) .................................................................. 158
Fortran intrinsic ............................................................................................... and(3I) .................................................................... 16
Fortran intrinsic ............................................................................................... anint(3I) ............................................................... 18
Fortran intrinsic ............................................................................................... leadz(3I) ............................................................. 183
Fortran intrinsic ............................................................................................... log10(3I) ............................................................. 193
Fortran intrinsic ............................................................................................... log(3I) .................................................................. 196
Fortran intrinsic ............................................................................................... mask(3I) ............................................................... 202
Fortran intrinsic ............................................................................................... asin(3I) ................................................................. 22
Fortran intrinsic ............................................................................................... mod(3I) .................................................................. 228
Fortran intrinsic ............................................................................................... nint(3I) ............................................................... 241
Fortran intrinsic ............................................................................................... or(3I) .................................................................... 252
Fortran intrinsic ............................................................................................... popcnt(3I) ........................................................... 258
Fortran intrinsic ............................................................................................... atan2(3I) ............................................................... 26
Fortran intrinsic ............................................................................................... poppar(3I) ........................................................... 260
Fortran intrinsic ............................................................................................... ran(3I) .................................................................. 268
Fortran intrinsic ............................................................................................... real(3I) ............................................................... 278
Fortran intrinsic ............................................................................................... atan(3I) ................................................................. 29
Fortran intrinsic ............................................................................................... acos(3I) ................................................................... 3
Fortran intrinsic ............................................................................................... shift(3I) ............................................................. 312
Fortran intrinsic ............................................................................................... shiftl(3I) ........................................................... 316

Index-22 004– 2138– 003


Fortran intrinsic ............................................................................................... shiftr(3I) ........................................................... 318
Fortran intrinsic ............................................................................................... sign(3I) ............................................................... 321
Fortran intrinsic ............................................................................................... sin(3I) .................................................................. 323
Fortran intrinsic ............................................................................................... sinh(3I) ............................................................... 325
Fortran intrinsic ............................................................................................... sqrt(3I) ............................................................... 333
Fortran intrinsic ............................................................................................... tan(3I) .................................................................. 342
Fortran intrinsic ............................................................................................... tanh(3I) ............................................................... 344
Fortran intrinsic ............................................................................................... cmplx(3I) ............................................................... 48
Fortran intrinsic ............................................................................................... compl(3I) ............................................................... 51
Fortran intrinsic ............................................................................................... conjg(3I) ............................................................... 53
Fortran intrinsic ............................................................................................... cos(3I) .................................................................... 55
Fortran intrinsic ............................................................................................... cosh(3I) ................................................................. 57
Fortran intrinsic ............................................................................................... cot(3I) .................................................................... 59
Fortran intrinsic ............................................................................................... dim(3I) .................................................................... 79
Fortran intrinsic ............................................................................................... dprod(3I) ............................................................... 83
Fortran intrinsic ............................................................................................... aimag(3I) ................................................................. 9
Fortran intrinsic ............................................................................................... eqv(3I) .................................................................... 99
Fortran intrinsic function ................................................................................ abs(3I) ...................................................................... 1
Fortran intrinsic function ................................................................................ exp(3I) .................................................................. 104
Fortran intrinsic function ................................................................................ aint(3I) ................................................................. 11
Fortran intrinsic function ................................................................................ int(3I) .................................................................. 158
Fortran intrinsic function ................................................................................ and(3I) .................................................................... 16
Fortran intrinsic function ................................................................................ anint(3I) ............................................................... 18
Fortran intrinsic function ................................................................................ leadz(3I) ............................................................. 183
Fortran intrinsic function ................................................................................ log10(3I) ............................................................. 193
Fortran intrinsic function ................................................................................ log(3I) .................................................................. 196
Fortran intrinsic function ................................................................................ mask(3I) ............................................................... 202
Fortran intrinsic function ................................................................................ asin(3I) ................................................................. 22
Fortran intrinsic function ................................................................................ mod(3I) .................................................................. 228
Fortran intrinsic function ................................................................................ nint(3I) ............................................................... 241
Fortran intrinsic function ................................................................................ or(3I) .................................................................... 252
Fortran intrinsic function ................................................................................ popcnt(3I) ........................................................... 258
Fortran intrinsic function ................................................................................ atan2(3I) ............................................................... 26
Fortran intrinsic function ................................................................................ poppar(3I) ........................................................... 260
Fortran intrinsic function ................................................................................ ran(3I) .................................................................. 268
Fortran intrinsic function ................................................................................ real(3I) ............................................................... 278
Fortran intrinsic function ................................................................................ atan(3I) ................................................................. 29
Fortran intrinsic function ................................................................................ acos(3I) ................................................................... 3
Fortran intrinsic function ................................................................................ shift(3I) ............................................................. 312
Fortran intrinsic function ................................................................................ shiftl(3I) ........................................................... 316
Fortran intrinsic function ................................................................................ shiftr(3I) ........................................................... 318
Fortran intrinsic function ................................................................................ sign(3I) ............................................................... 321
Fortran intrinsic function ................................................................................ sin(3I) .................................................................. 323
Fortran intrinsic function ................................................................................ sinh(3I) ............................................................... 325
Fortran intrinsic function ................................................................................ sqrt(3I) ............................................................... 333
Fortran intrinsic function ................................................................................ tan(3I) .................................................................. 342
Fortran intrinsic function ................................................................................ tanh(3I) ............................................................... 344
Fortran intrinsic function ................................................................................ cmplx(3I) ............................................................... 48
Fortran intrinsic function ................................................................................ compl(3I) ............................................................... 51
Fortran intrinsic function ................................................................................ conjg(3I) ............................................................... 53

004– 2138– 003 Index-23


Fortran intrinsic function ................................................................................ cos(3I) .................................................................... 55
Fortran intrinsic function ................................................................................ cosh(3I) ................................................................. 57
Fortran intrinsic function ................................................................................ cot(3I) .................................................................... 59
Fortran intrinsic function ................................................................................ dim(3I) .................................................................... 79
Fortran intrinsic function ................................................................................ dprod(3I) ............................................................... 83
Fortran intrinsic function ................................................................................ aimag(3I) ................................................................. 9
Fortran intrinsic function ................................................................................ eqv(3I) .................................................................... 99
Fortran synchronization intrinsics for multiprocessing ................................... sync(3I) ............................................................... 337
FRACTION(3I) ................................................................................................ fraction(3I) ...................................................... 109
fraction(3I) ................................................................................................ fraction(3I) ...................................................... 109
FREE(3I) ......................................................................................................... malloc(3I) ........................................................... 200
free(3I) ......................................................................................................... malloc(3I) ........................................................... 200
function ........................................................................................................... ex(3I) .................................................................... 103
function ........................................................................................................... gbit(3I) ............................................................... 110
function ........................................................................................................... getvm(3I) ............................................................. 123
function ........................................................................................................... num_pes(3I) ........................................................ 251
function ........................................................................................................... pbit(3I) ............................................................... 256
function ........................................................................................................... readSR(3I) ........................................................... 277
function ........................................................................................................... semclr(3I) ........................................................... 299
function ........................................................................................................... cmr(3I) .................................................................... 50
functions .......................................................................................................... readSB(3I) ........................................................... 276
gbit(3I) ......................................................................................................... gbit(3I) ............................................................... 110
_gbit(3I) ....................................................................................................... gbit(3I) ............................................................... 110
gbits(3I) ....................................................................................................... gbit(3I) ............................................................... 110
_gbits(3I) .................................................................................................... gbit(3I) ............................................................... 110
GET_IEEE_EXCEPTIONS(3I) ...................................................................... get_ieee_exceptions(3I) ............................ 112
get_ieee_exceptions(3I) ...................................................................... get_ieee_exceptions(3I) ............................ 112
GET_IEEE_INTERRUPTS(3I) ...................................................................... get_ieee_interrupts(3I) ............................ 114
get_ieee_interrupts(3I) ...................................................................... get_ieee_interrupts(3I) ............................ 114
GET_IEEE_ROUNDING_MODE(3I) ............................................................... get_ieee_rounding_mode(3I) ..................... 116
get_ieee_rounding_mode(3I) ............................................................... get_ieee_rounding_mode(3I) ..................... 116
GET_IEEE_STATUS(3I) ............................................................................... get_ieee_status(3I)...................................... 118
get_ieee_status(3I) ............................................................................... get_ieee_status(3I)...................................... 118
GETPOS(3I) .................................................................................................... getpos(3I) ........................................................... 120
getpos(3I) .................................................................................................... getpos(3I) ........................................................... 120
getvm(3I) ....................................................................................................... getvm(3I) ............................................................. 123
_getvm(3I) .................................................................................................... getvm(3I) ............................................................. 123
HUGE(3I) ......................................................................................................... huge(3I) ............................................................... 124
huge(3I) ......................................................................................................... huge(3I) ............................................................... 124
Hyberbolic cosine ............................................................................................ cosh(3I) ................................................................. 57
Hyperbolic sine ............................................................................................... sinh(3I) ............................................................... 325
Hyperbolic tangent .......................................................................................... tanh(3I) ............................................................... 344
IABS(3I) ......................................................................................................... abs(3I) ...................................................................... 1
iabs(3I) ......................................................................................................... abs(3I) ...................................................................... 1
IACHAR(3I) .................................................................................................... char(3I) ................................................................. 42
iachar(3I) .................................................................................................... char(3I) ................................................................. 42
IAND(3I) ......................................................................................................... iand(3I) ............................................................... 126
iand(3I) ......................................................................................................... iand(3I) ............................................................... 126
IBCHNG(3I) .................................................................................................... ibchng(3I) ........................................................... 129
ibchng(3I) .................................................................................................... ibchng(3I) ........................................................... 129

Index-24 004– 2138– 003


IBCLR(3I) ....................................................................................................... ibchng(3I) ........................................................... 129
ibclr(3I) ....................................................................................................... ibchng(3I) ........................................................... 129
IBITS(3I) ....................................................................................................... ibits(3I) ............................................................. 131
ibits(3I) ....................................................................................................... ibits(3I) ............................................................. 131
IBSET(3I) ....................................................................................................... ibchng(3I) ........................................................... 129
ibset(3I) ....................................................................................................... ibchng(3I) ........................................................... 129
ICHAR(3I) ....................................................................................................... char(3I) ................................................................. 42
ichar(3I) ....................................................................................................... char(3I) ................................................................. 42
IDATE(3I) ....................................................................................................... idate(3I) ............................................................. 133
idate(3I) ....................................................................................................... idate(3I) ............................................................. 133
IDIM(3I) ......................................................................................................... dim(3I) .................................................................... 79
idim(3I) ......................................................................................................... dim(3I) .................................................................... 79
IDINT(3I) ....................................................................................................... int(3I) .................................................................. 158
idint(3I) ....................................................................................................... int(3I) .................................................................. 158
IDNINT(3I) .................................................................................................... nint(3I) ............................................................... 241
idnint(3I) .................................................................................................... nint(3I) ............................................................... 241
IEEE_BINARY_SCALE(3I) ........................................................................... ieee_binary_scale(3I) ................................. 134
ieee_binary_scale(3I) ........................................................................... ieee_binary_scale(3I) ................................. 134
IEEE_CLASS(3I) ........................................................................................... ieee_class(3I) ................................................. 136
ieee_class(3I) ........................................................................................... ieee_class(3I) ................................................. 136
IEEE_COPY_SIGN(3I) .................................................................................. ieee_copy_sign(3I) ........................................ 138
ieee_copy_sign(3I) .................................................................................. ieee_copy_sign(3I) ........................................ 138
IEEE_EXPONENT(3I) .................................................................................... ieee_exponent(3I) .......................................... 140
ieee_exponent(3I) .................................................................................... ieee_exponent(3I) .......................................... 140
IEEE_FINITE(3I) ......................................................................................... ieee_finite(3I) ............................................... 143
ieee_finite(3I) ......................................................................................... ieee_finite(3I) ............................................... 143
IEEE_INT(3I) ................................................................................................ ieee_int(3I) ...................................................... 144
ieee_int(3I) ................................................................................................ ieee_int(3I) ...................................................... 144
IEEE_IS_NAN(3I) ......................................................................................... ieee_is_nan(3I) ............................................... 146
ieee_is_nan(3I) ......................................................................................... ieee_is_nan(3I) ............................................... 146
IEEE_NEXT_AFTER(3I) ............................................................................... ieee_next_after(3I)...................................... 148
ieee_next_after(3I) ............................................................................... ieee_next_after(3I)...................................... 148
IEEE_REAL(3I) ............................................................................................. ieee_real(3I) .................................................... 150
ieee_real(3I) ............................................................................................. ieee_real(3I) .................................................... 150
IEEE_REMAINDER(3I) .................................................................................. ieee_remainder(3I) ........................................ 152
ieee_remainder(3I) .................................................................................. ieee_remainder(3I) ........................................ 152
IEEE_UNORDERED(3I) .................................................................................. ieee_unordered(3I) ........................................ 154
ieee_unordered(3I) .................................................................................. ieee_unordered(3I) ........................................ 154
IEOR(3I) ......................................................................................................... iand(3I) ............................................................... 126
ieor(3I) ......................................................................................................... iand(3I) ............................................................... 126
IFIX(3I) ......................................................................................................... int(3I) .................................................................. 158
ifix(3I) ......................................................................................................... int(3I) .................................................................. 158
IIABS(3I) ....................................................................................................... abs(3I) ...................................................................... 1
iiabs(3I) ....................................................................................................... abs(3I) ...................................................................... 1
IIAND(3I) ....................................................................................................... iand(3I) ............................................................... 126
iiand(3I) ....................................................................................................... iand(3I) ............................................................... 126
IIBCHNG(3I) .................................................................................................. ibchng(3I) ........................................................... 129
iibchng(3I) .................................................................................................. ibchng(3I) ........................................................... 129
IIBCLR(3I) .................................................................................................... ibchng(3I) ........................................................... 129
iibclr(3I) .................................................................................................... ibchng(3I) ........................................................... 129

004– 2138– 003 Index-25


IIBITS(3I) .................................................................................................... ibits(3I) ............................................................. 131
iibits(3I) .................................................................................................... ibits(3I) ............................................................. 131
IIBSET(3I) .................................................................................................... ibchng(3I) ........................................................... 129
iibset(3I) .................................................................................................... ibchng(3I) ........................................................... 129
IIDIM(3I) ....................................................................................................... dim(3I) .................................................................... 79
iidim(3I) ....................................................................................................... dim(3I) .................................................................... 79
IIDINT(3I) .................................................................................................... int(3I) .................................................................. 158
iidint(3I) .................................................................................................... int(3I) .................................................................. 158
IIEOR(3I) ....................................................................................................... iand(3I) ............................................................... 126
iieor(3I) ....................................................................................................... iand(3I) ............................................................... 126
IIFIX(3I) ....................................................................................................... int(3I) .................................................................. 158
iifix(3I) ....................................................................................................... int(3I) .................................................................. 158
IINT(3I) ......................................................................................................... int(3I) .................................................................. 158
iint(3I) ......................................................................................................... int(3I) .................................................................. 158
IIOR(3I) ......................................................................................................... iand(3I) ............................................................... 126
iior(3I) ......................................................................................................... iand(3I) ............................................................... 126
IIQINT(3I) .................................................................................................... int(3I) .................................................................. 158
iiqint(3I) .................................................................................................... int(3I) .................................................................. 158
IISHA(3I) ....................................................................................................... isha(3I) ............................................................... 173
iisha(3I) ....................................................................................................... isha(3I) ............................................................... 173
IISHC(3I) ....................................................................................................... ishc(3I) ............................................................... 174
iishc(3I) ....................................................................................................... ishc(3I) ............................................................... 174
IISHFT(3I) .................................................................................................... ishft(3I) ............................................................. 175
iishft(3I) .................................................................................................... ishft(3I) ............................................................. 175
IISHFTC(3I) .................................................................................................. ishftc(3I) ........................................................... 177
IISHL(3I) ....................................................................................................... ishl(3I) ............................................................... 179
iishl(3I) ....................................................................................................... ishl(3I) ............................................................... 179
IISIGN(3I) .................................................................................................... sign(3I) ............................................................... 321
iisign(3I) .................................................................................................... sign(3I) ............................................................... 321
IMAG(3I) ......................................................................................................... aimag(3I) ................................................................. 9
imag(3I) ......................................................................................................... aimag(3I) ................................................................. 9
image ............................................................................................................... log2_images(3I) ............................................... 195
image ............................................................................................................... num_images(3I) ................................................. 250
image ............................................................................................................... rem_images(3I) ................................................. 280
image ............................................................................................................... sync_images(3I) ............................................... 340
image ............................................................................................................... this_image(3I) ................................................. 350
images ............................................................................................................. log2_images(3I) ............................................... 195
images ............................................................................................................. num_images(3I) ................................................. 250
images ............................................................................................................. rem_images(3I) ................................................. 280
images ............................................................................................................. sync_images(3I) ............................................... 340
images ............................................................................................................. this_image(3I) ................................................. 350
Imaginary ........................................................................................................ aimag(3I) ................................................................. 9
Imaginary portion of complex number ........................................................... aimag(3I) ................................................................. 9
IMOD(3I) ......................................................................................................... mod(3I) .................................................................. 228
imod(3I) ......................................................................................................... mod(3I) .................................................................. 228
INDEX(3I) ....................................................................................................... index(3I) ............................................................. 156
index(3I) ....................................................................................................... index(3I) ............................................................. 156
In-line function ................................................................................................ len(3I) .................................................................. 185
INOT(3I) ......................................................................................................... not(3I) .................................................................. 243
inot(3I) ......................................................................................................... not(3I) .................................................................. 243

Index-26 004– 2138– 003


INT(3I) ............................................................................................................ int(3I) .................................................................. 158
int(3I) ............................................................................................................ int(3I) .................................................................. 158
Integer ............................................................................................................. int(3I) .................................................................. 158
Integer conversion (integer to character) ........................................................ char(3I) ................................................................. 42
INT_MULT_UPPER(3I) .................................................................................. int_mult_upper(3I) ........................................ 160
int_mult_upper(3I) .................................................................................. int_mult_upper(3I) ........................................ 160
_int_mult_upper(3I) ............................................................................... int_mult_upper(3I) ........................................ 160
Intrinsic ........................................................................................................... abs(3I) ...................................................................... 1
Intrinsic ........................................................................................................... exp(3I) .................................................................. 104
Intrinsic ........................................................................................................... exponent(3I) ...................................................... 106
Intrinsic ........................................................................................................... fcd(3I) .................................................................. 107
Intrinsic ........................................................................................................... floor(3I) ............................................................. 108
Intrinsic ........................................................................................................... fraction(3I) ...................................................... 109
Intrinsic ........................................................................................................... aint(3I) ................................................................. 11
Intrinsic ........................................................................................................... get_ieee_exceptions(3I) ............................ 112
Intrinsic ........................................................................................................... get_ieee_interrupts(3I) ............................ 114
Intrinsic ........................................................................................................... get_ieee_rounding_mode(3I) ..................... 116
Intrinsic ........................................................................................................... get_ieee_status(3I)...................................... 118
Intrinsic ........................................................................................................... getpos(3I) ........................................................... 120
Intrinsic ........................................................................................................... huge(3I) ............................................................... 124
Intrinsic ........................................................................................................... iand(3I) ............................................................... 126
Intrinsic ........................................................................................................... ibchng(3I) ........................................................... 129
Intrinsic ........................................................................................................... all(3I) .................................................................... 13
Intrinsic ........................................................................................................... ibits(3I) ............................................................. 131
Intrinsic ........................................................................................................... ieee_binary_scale(3I) ................................. 134
Intrinsic ........................................................................................................... ieee_class(3I) ................................................. 136
Intrinsic ........................................................................................................... ieee_copy_sign(3I) ........................................ 138
Intrinsic ........................................................................................................... ieee_exponent(3I) .......................................... 140
Intrinsic ........................................................................................................... ieee_finite(3I) ............................................... 143
Intrinsic ........................................................................................................... ieee_int(3I) ...................................................... 144
Intrinsic ........................................................................................................... ieee_is_nan(3I) ............................................... 146
Intrinsic ........................................................................................................... ieee_next_after(3I)...................................... 148
Intrinsic ........................................................................................................... allocated(3I) ...................................................... 15
Intrinsic ........................................................................................................... ieee_real(3I) .................................................... 150
Intrinsic ........................................................................................................... ieee_remainder(3I) ........................................ 152
Intrinsic ........................................................................................................... ieee_unordered(3I) ........................................ 154
Intrinsic ........................................................................................................... index(3I) ............................................................. 156
Intrinsic ........................................................................................................... int(3I) .................................................................. 158
Intrinsic ........................................................................................................... and(3I) .................................................................... 16
Intrinsic ........................................................................................................... int_mult_upper(3I) ........................................ 160
Intrinsic ........................................................................................................... isha(3I) ............................................................... 173
Intrinsic ........................................................................................................... ishc(3I) ............................................................... 174
Intrinsic ........................................................................................................... ishft(3I) ............................................................. 175
Intrinsic ........................................................................................................... ishftc(3I) ........................................................... 177
Intrinsic ........................................................................................................... ishl(3I) ............................................................... 179
Intrinsic ........................................................................................................... anint(3I) ............................................................... 18
Intrinsic ........................................................................................................... kind(3I) ............................................................... 180
Intrinsic ........................................................................................................... lbound(3I) ........................................................... 181
Intrinsic ........................................................................................................... leadz(3I) ............................................................. 183
Intrinsic ........................................................................................................... length(3I) ........................................................... 186

004– 2138– 003 Index-27


Intrinsic ........................................................................................................... len_trim(3I) ...................................................... 188
Intrinsic ........................................................................................................... loc(3I) .................................................................. 191
Intrinsic ........................................................................................................... log10(3I) ............................................................. 193
Intrinsic ........................................................................................................... log2_images(3I) ............................................... 195
Intrinsic ........................................................................................................... log(3I) .................................................................. 196
Intrinsic ........................................................................................................... logical(3I) ........................................................ 198
Intrinsic ........................................................................................................... long(3I) ............................................................... 199
Intrinsic ........................................................................................................... any(3I) .................................................................... 20
Intrinsic ........................................................................................................... mask(3I) ............................................................... 202
Intrinsic ........................................................................................................... matmul(3I) ........................................................... 205
Intrinsic ........................................................................................................... max(3I) .................................................................. 207
Intrinsic ........................................................................................................... maxexponent(3I) ............................................... 209
Intrinsic ........................................................................................................... maxloc(3I) ........................................................... 211
Intrinsic ........................................................................................................... maxval(3I) ........................................................... 214
Intrinsic ........................................................................................................... memory_barrier(3I) ........................................ 216
Intrinsic ........................................................................................................... merge(3I) ............................................................. 217
Intrinsic ........................................................................................................... min(3I) .................................................................. 219
Intrinsic ........................................................................................................... asin(3I) ................................................................. 22
Intrinsic ........................................................................................................... minexponent(3I) ............................................... 221
Intrinsic ........................................................................................................... minloc(3I) ........................................................... 223
Intrinsic ........................................................................................................... minval(3I) ........................................................... 226
Intrinsic ........................................................................................................... mod(3I) .................................................................. 228
Intrinsic ........................................................................................................... modulo(3I) ........................................................... 235
Intrinsic ........................................................................................................... mvbits(3I) ........................................................... 237
Intrinsic ........................................................................................................... my_pe(3I) ............................................................. 238
Intrinsic ........................................................................................................... associated(3I) ................................................... 24
Intrinsic ........................................................................................................... nearest(3I) ........................................................ 240
Intrinsic ........................................................................................................... nint(3I) ............................................................... 241
Intrinsic ........................................................................................................... not(3I) .................................................................. 243
Intrinsic ........................................................................................................... null(3I) ............................................................... 245
Intrinsic ........................................................................................................... numarg(3I) ........................................................... 247
Intrinsic ........................................................................................................... num_images(3I) ................................................. 250
Intrinsic ........................................................................................................... or(3I) .................................................................... 252
Intrinsic ........................................................................................................... pack(3I) ............................................................... 254
Intrinsic ........................................................................................................... popcnt(3I) ........................................................... 258
Intrinsic ........................................................................................................... atan2(3I) ............................................................... 26
Intrinsic ........................................................................................................... poppar(3I) ........................................................... 260
Intrinsic ........................................................................................................... precision(3I) .................................................... 262
Intrinsic ........................................................................................................... present(3I) ........................................................ 264
Intrinsic ........................................................................................................... product(3I) ........................................................ 265
Intrinsic ........................................................................................................... radix(3I) ............................................................. 267
Intrinsic ........................................................................................................... ran(3I) .................................................................. 268
Intrinsic ........................................................................................................... random_number(3I) .......................................... 272
Intrinsic ........................................................................................................... random_seed(3I) ............................................... 273
Intrinsic ........................................................................................................... range(3I) ............................................................. 274
Intrinsic ........................................................................................................... real(3I) ............................................................... 278
Intrinsic ........................................................................................................... rem_images(3I) ................................................. 280
Intrinsic ........................................................................................................... remote_write_barrier(3I) .......................... 281
Intrinsic ........................................................................................................... repeat(3I) ........................................................... 282
Intrinsic ........................................................................................................... reshape(3I) ........................................................ 283

Index-28 004– 2138– 003


Intrinsic ........................................................................................................... rrspacing(3I) .................................................... 285
Intrinsic ........................................................................................................... rtc(3I) .................................................................. 287
Intrinsic ........................................................................................................... scale(3I) ............................................................. 289
Intrinsic ........................................................................................................... atan(3I) ................................................................. 29
Intrinsic ........................................................................................................... scan(3I) ............................................................... 290
Intrinsic ........................................................................................................... selected_int_kind(3I) ................................. 292
Intrinsic ........................................................................................................... selected_real_kind(3I)............................... 294
Intrinsic ........................................................................................................... acos(3I) ................................................................... 3
Intrinsic ........................................................................................................... set_exponent(3I) ............................................. 300
Intrinsic ........................................................................................................... set_ieee_exception(3I)............................... 302
Intrinsic ........................................................................................................... set_ieee_exceptions(3I) ............................ 304
Intrinsic ........................................................................................................... set_ieee_interrupts(3I) ............................ 305
Intrinsic ........................................................................................................... set_ieee_rounding_mode(3I) ..................... 306
Intrinsic ........................................................................................................... set_ieee_status(3I)...................................... 309
Intrinsic ........................................................................................................... bit_size(3I) ........................................................ 31
Intrinsic ........................................................................................................... shape(3I) ............................................................. 311
Intrinsic ........................................................................................................... shift(3I) ............................................................. 312
Intrinsic ........................................................................................................... shifta(3I) ........................................................... 314
Intrinsic ........................................................................................................... shiftl(3I) ........................................................... 316
Intrinsic ........................................................................................................... shiftr(3I) ........................................................... 318
Intrinsic ........................................................................................................... short(3I) ............................................................. 320
Intrinsic ........................................................................................................... sign(3I) ............................................................... 321
Intrinsic ........................................................................................................... sin(3I) .................................................................. 323
Intrinsic ........................................................................................................... sinh(3I) ............................................................... 325
Intrinsic ........................................................................................................... size(3I) ............................................................... 327
Intrinsic ........................................................................................................... sizeof(3I) ........................................................... 328
Intrinsic ........................................................................................................... spacing(3I) ........................................................ 329
Intrinsic ........................................................................................................... bmm(3I) .................................................................... 33
Intrinsic ........................................................................................................... spread(3I) ........................................................... 331
Intrinsic ........................................................................................................... sqrt(3I) ............................................................... 333
Intrinsic ........................................................................................................... sum(3I) .................................................................. 335
Intrinsic ........................................................................................................... sync_images(3I) ............................................... 340
Intrinsic ........................................................................................................... system_clock(3I) ............................................. 341
Intrinsic ........................................................................................................... tan(3I) .................................................................. 342
Intrinsic ........................................................................................................... tanh(3I) ............................................................... 344
Intrinsic ........................................................................................................... test_ieee_exception(3I) ............................ 346
Intrinsic ........................................................................................................... test_ieee_interrupt(3I) ............................ 348
Intrinsic ........................................................................................................... this_image(3I) ................................................. 350
Intrinsic ........................................................................................................... tiny(3I) ............................................................... 352
Intrinsic ........................................................................................................... transfer(3I) ...................................................... 354
Intrinsic ........................................................................................................... transpose(3I) .................................................... 356
Intrinsic ........................................................................................................... trim(3I) ............................................................... 357
Intrinsic ........................................................................................................... ubound(3I) ........................................................... 358
Intrinsic ........................................................................................................... unpack(3I) ........................................................... 361
Intrinsic ........................................................................................................... verify(3I) ........................................................... 363
Intrinsic ........................................................................................................... write_memory_barrier(3I) .......................... 365
Intrinsic ........................................................................................................... btest(3I) ............................................................... 39
Intrinsic ........................................................................................................... ceiling(3I) .......................................................... 41
Intrinsic ........................................................................................................... clear_ieee_exception(3I) ............................ 44
Intrinsic ........................................................................................................... cloc(3I) ................................................................. 46

004– 2138– 003 Index-29


Intrinsic ........................................................................................................... clock(3I) ............................................................... 47
Intrinsic ........................................................................................................... cmplx(3I) ............................................................... 48
Intrinsic ........................................................................................................... adjustl(3I) ............................................................ 5
Intrinsic ........................................................................................................... compl(3I) ............................................................... 51
Intrinsic ........................................................................................................... conjg(3I) ............................................................... 53
Intrinsic ........................................................................................................... cos(3I) .................................................................... 55
Intrinsic ........................................................................................................... cosh(3I) ................................................................. 57
Intrinsic ........................................................................................................... cot(3I) .................................................................... 59
Intrinsic ........................................................................................................... count(3I) ............................................................... 61
Intrinsic ........................................................................................................... cpu_time(3I) ........................................................ 63
Intrinsic ........................................................................................................... cshift(3I) ............................................................. 65
Intrinsic ........................................................................................................... csmg(3I) ................................................................. 67
Intrinsic ........................................................................................................... cvmg(3I) ................................................................. 69
Intrinsic ........................................................................................................... adjustr(3I) ............................................................ 7
Intrinsic ........................................................................................................... date_and_time(3I) ............................................ 73
Intrinsic ........................................................................................................... digits(3I) ............................................................. 77
Intrinsic ........................................................................................................... dim(3I) .................................................................... 79
Intrinsic ........................................................................................................... dot_product(3I) ................................................. 81
Intrinsic ........................................................................................................... dprod(3I) ............................................................... 83
Intrinsic ........................................................................................................... dshiftl(3I) .......................................................... 85
Intrinsic ........................................................................................................... dshiftr(3I) .......................................................... 87
Intrinsic ........................................................................................................... dsm(3I) .................................................................... 89
Intrinsic ........................................................................................................... aimag(3I) ................................................................. 9
Intrinsic ........................................................................................................... enable_ieee_interrupt(3I) ......................... 92
Intrinsic ........................................................................................................... eoshift(3I) .......................................................... 95
Intrinsic ........................................................................................................... epsilon(3I) .......................................................... 97
Intrinsic ........................................................................................................... eqv(3I) .................................................................... 99
intrinsic ............................................................................................................ ex(3I) .................................................................... 103
intrinsic ............................................................................................................ gbit(3I) ............................................................... 110
intrinsic ............................................................................................................ getvm(3I) ............................................................. 123
intrinsic ............................................................................................................ log2_images(3I) ............................................... 195
intrinsic ............................................................................................................ malloc(3I) ........................................................... 200
intrinsic ............................................................................................................ num_images(3I) ................................................. 250
intrinsic ............................................................................................................ pbit(3I) ............................................................... 256
intrinsic ............................................................................................................ readSR(3I) ........................................................... 277
intrinsic ............................................................................................................ rem_images(3I) ................................................. 280
intrinsic ............................................................................................................ bmm(3I) .................................................................... 33
intrinsic ............................................................................................................ sync_images(3I) ............................................... 340
intrinsic ............................................................................................................ this_image(3I) ................................................. 350
intrinsic ............................................................................................................ unit(3I) ............................................................... 359
intrinsic ............................................................................................................ date(3I) ................................................................. 72
intrinsic function ............................................................................................. models(3I) ........................................................... 230
intrinsic function ............................................................................................. num_pes(3I) ........................................................ 251
intrinsic procedure ........................................................................................... models(3I) ........................................................... 230
Intrinsic procedures ......................................................................................... intro_intrin(3I) ............................................. 162
intrinsics .......................................................................................................... readSB(3I) ........................................................... 276
intrinsics .......................................................................................................... semclr(3I) ........................................................... 299
intrinsics(3I) ........................................................................................... intro_intrin(3I) ............................................. 162
Introduction to intrinsic procedures ................................................................ intro_intrin(3I) ............................................. 162
INTRO_INTRIN(3I) ...................................................................................... intro_intrin(3I) ............................................. 162

Index-30 004– 2138– 003


intro_intrin(3I) ...................................................................................... intro_intrin(3I) ............................................. 162
IOR(3I) ............................................................................................................ iand(3I) ............................................................... 126
ior(3I) ............................................................................................................ iand(3I) ............................................................... 126
IQINT(3I) ....................................................................................................... int(3I) .................................................................. 158
iqint(3I) ....................................................................................................... int(3I) .................................................................. 158
IQNINT(3I) .................................................................................................... nint(3I) ............................................................... 241
iqnint(3I) .................................................................................................... nint(3I) ............................................................... 241
IRTC(3I) ......................................................................................................... rtc(3I) .................................................................. 287
irtc(3I) ......................................................................................................... rtc(3I) .................................................................. 287
IRTC_RATE(3I) ............................................................................................. rtc(3I) .................................................................. 287
irtc_rate(3I) ............................................................................................. rtc(3I) .................................................................. 287
ISHA(3I) ......................................................................................................... isha(3I) ............................................................... 173
isha(3I) ......................................................................................................... isha(3I) ............................................................... 173
ISHC(3I) ......................................................................................................... ishc(3I) ............................................................... 174
ishc(3I) ......................................................................................................... ishc(3I) ............................................................... 174
ISHFT(3I) ....................................................................................................... ishft(3I) ............................................................. 175
ishft(3I) ....................................................................................................... ishft(3I) ............................................................. 175
ISHFTC(3I) .................................................................................................... ishftc(3I) ........................................................... 177
ishftc(3I) .................................................................................................... ishftc(3I) ........................................................... 177
ISHL(3I) ......................................................................................................... ishl(3I) ............................................................... 179
ishl(3I) ......................................................................................................... ishl(3I) ............................................................... 179
ISIGN(3I) ....................................................................................................... sign(3I) ............................................................... 321
isign(3I) ....................................................................................................... sign(3I) ............................................................... 321
ISNAN(3I) ....................................................................................................... ieee_is_nan(3I) ............................................... 146
isnan(3I) ....................................................................................................... ieee_is_nan(3I) ............................................... 146
ITIME(3I) ....................................................................................................... idate(3I) ............................................................. 133
itime(3I) ....................................................................................................... idate(3I) ............................................................. 133
JDATE(3I) ....................................................................................................... date(3I) ................................................................. 72
jdate(3I) ....................................................................................................... date(3I) ................................................................. 72
JIABS(3I) ....................................................................................................... abs(3I) ...................................................................... 1
jiabs(3I) ....................................................................................................... abs(3I) ...................................................................... 1
JIAND(3I) ....................................................................................................... iand(3I) ............................................................... 126
jiand(3I) ....................................................................................................... iand(3I) ............................................................... 126
JIBCHNG(3I) .................................................................................................. ibchng(3I) ........................................................... 129
jibchng(3I) .................................................................................................. ibchng(3I) ........................................................... 129
JIBCLR(3I) .................................................................................................... ibchng(3I) ........................................................... 129
jibclr(3I) .................................................................................................... ibchng(3I) ........................................................... 129
JIBITS(3I) .................................................................................................... ibits(3I) ............................................................. 131
jibits(3I) .................................................................................................... ibits(3I) ............................................................. 131
JIBSET(3I) .................................................................................................... ibchng(3I) ........................................................... 129
jibset(3I) .................................................................................................... ibchng(3I) ........................................................... 129
JIDIM(3I) ....................................................................................................... dim(3I) .................................................................... 79
jidim(3I) ....................................................................................................... dim(3I) .................................................................... 79
JIDINT(3I) .................................................................................................... int(3I) .................................................................. 158
jidint(3I) .................................................................................................... int(3I) .................................................................. 158
JIEOR(3I) ....................................................................................................... iand(3I) ............................................................... 126
jieor(3I) ....................................................................................................... iand(3I) ............................................................... 126
JIFIX(3I) ....................................................................................................... int(3I) .................................................................. 158
jifix(3I) ....................................................................................................... int(3I) .................................................................. 158
JINT(3I) ......................................................................................................... int(3I) .................................................................. 158

004– 2138– 003 Index-31


jint(3I) ......................................................................................................... int(3I) .................................................................. 158
JIOR(3I) ......................................................................................................... iand(3I) ............................................................... 126
jior(3I) ......................................................................................................... iand(3I) ............................................................... 126
JIQINT(3I) .................................................................................................... int(3I) .................................................................. 158
jiqint(3I) .................................................................................................... int(3I) .................................................................. 158
JISHA(3I) ....................................................................................................... isha(3I) ............................................................... 173
jisha(3I) ....................................................................................................... isha(3I) ............................................................... 173
JISHC(3I) ....................................................................................................... ishc(3I) ............................................................... 174
jishc(3I) ....................................................................................................... ishc(3I) ............................................................... 174
JISHFT(3I) .................................................................................................... ishft(3I) ............................................................. 175
jishft(3I) .................................................................................................... ishft(3I) ............................................................. 175
JISHFTC(3I) .................................................................................................. ishftc(3I) ........................................................... 177
JISHL(3I) ....................................................................................................... ishl(3I) ............................................................... 179
jishl(3I) ....................................................................................................... ishl(3I) ............................................................... 179
JISIGN(3I) .................................................................................................... sign(3I) ............................................................... 321
jisign(3I) .................................................................................................... sign(3I) ............................................................... 321
JMOD(3I) ......................................................................................................... mod(3I) .................................................................. 228
jmod(3I) ......................................................................................................... mod(3I) .................................................................. 228
JNOT(3I) ......................................................................................................... not(3I) .................................................................. 243
jnot(3I) ......................................................................................................... not(3I) .................................................................. 243
KIABS(3I) ....................................................................................................... abs(3I) ...................................................................... 1
kiabs(3I) ....................................................................................................... abs(3I) ...................................................................... 1
KIAND(3I) ....................................................................................................... iand(3I) ............................................................... 126
kiand(3I) ....................................................................................................... iand(3I) ............................................................... 126
KIBCHNG(3I) .................................................................................................. ibchng(3I) ........................................................... 129
kibchng(3I) .................................................................................................. ibchng(3I) ........................................................... 129
KIBCLR(3I) .................................................................................................... ibchng(3I) ........................................................... 129
kibclr(3I) .................................................................................................... ibchng(3I) ........................................................... 129
KIBITS(3I) .................................................................................................... ibits(3I) ............................................................. 131
KIBSET(3I) .................................................................................................... ibchng(3I) ........................................................... 129
kibset(3I) .................................................................................................... ibchng(3I) ........................................................... 129
KIDIM(3I) ....................................................................................................... dim(3I) .................................................................... 79
kidim(3I) ....................................................................................................... dim(3I) .................................................................... 79
KIDINT(3I) .................................................................................................... int(3I) .................................................................. 158
kidint(3I) .................................................................................................... int(3I) .................................................................. 158
KIEOR(3I) ....................................................................................................... iand(3I) ............................................................... 126
kieor(3I) ....................................................................................................... iand(3I) ............................................................... 126
KIFIX(3I) ....................................................................................................... int(3I) .................................................................. 158
kifix(3I) ....................................................................................................... int(3I) .................................................................. 158
KIND(3I) ......................................................................................................... kind(3I) ............................................................... 180
kind(3I) ......................................................................................................... kind(3I) ............................................................... 180
KINT(3I) ......................................................................................................... int(3I) .................................................................. 158
kint(3I) ......................................................................................................... int(3I) .................................................................. 158
KIOR(3I) ......................................................................................................... iand(3I) ............................................................... 126
kior(3I) ......................................................................................................... iand(3I) ............................................................... 126
KIQINT(3I) .................................................................................................... int(3I) .................................................................. 158
kiqint(3I) .................................................................................................... int(3I) .................................................................. 158
KISHA(3I) ....................................................................................................... isha(3I) ............................................................... 173
kisha(3I) ....................................................................................................... isha(3I) ............................................................... 173
KISHC(3I) ....................................................................................................... ishc(3I) ............................................................... 174

Index-32 004– 2138– 003


kishc(3I) ....................................................................................................... ishc(3I) ............................................................... 174
KISHFT(3I) .................................................................................................... ishft(3I) ............................................................. 175
kishft(3I) .................................................................................................... ishft(3I) ............................................................. 175
KISHFTC(3I) .................................................................................................. ishftc(3I) ........................................................... 177
KISHL(3I) ....................................................................................................... ishl(3I) ............................................................... 179
kishl(3I) ....................................................................................................... ishl(3I) ............................................................... 179
KISIGN(3I) .................................................................................................... sign(3I) ............................................................... 321
kisign(3I) .................................................................................................... sign(3I) ............................................................... 321
KMOD(3I) ......................................................................................................... mod(3I) .................................................................. 228
kmod(3I) ......................................................................................................... mod(3I) .................................................................. 228
KNOT(3I) ......................................................................................................... not(3I) .................................................................. 243
knot(3I) ......................................................................................................... not(3I) .................................................................. 243
LBOUND(3I) .................................................................................................... lbound(3I) ........................................................... 181
lbound(3I) .................................................................................................... lbound(3I) ........................................................... 181
Leading zero bit count .................................................................................... leadz(3I) ............................................................. 183
LEADZ(3I) ....................................................................................................... leadz(3I) ............................................................. 183
leadz(3I) ....................................................................................................... leadz(3I) ............................................................. 183
_leadz(3I) .................................................................................................... leadz(3I) ............................................................. 183
Left circular shift ............................................................................................ shift(3I) ............................................................. 312
Left shift .......................................................................................................... shiftl(3I) ........................................................... 316
LEN(3I) ............................................................................................................ len(3I) .................................................................. 185
len(3I) ............................................................................................................ len(3I) .................................................................. 185
Length of transfer for BUFFER IN/BUFFER OUT ..................................... length(3I) ........................................................... 186
LENGTH(3I) .................................................................................................... length(3I) ........................................................... 186
length(3I) .................................................................................................... length(3I) ........................................................... 186
LEN_TRIM(3I) ................................................................................................ len_trim(3I) ...................................................... 188
len_trim(3I) ................................................................................................ len_trim(3I) ...................................................... 188
Lexical comparison ......................................................................................... lge(3I) .................................................................. 189
LGE(3I) ............................................................................................................ lge(3I) .................................................................. 189
lge(3I) ............................................................................................................ lge(3I) .................................................................. 189
LGT(3I) ............................................................................................................ lge(3I) .................................................................. 189
lgt(3I) ............................................................................................................ lge(3I) .................................................................. 189
Libm intro ....................................................................................................... intro_intrin(3I) ............................................. 162
Libm introduction ............................................................................................ intro_intrin(3I) ............................................. 162
LLE(3I) ............................................................................................................ lge(3I) .................................................................. 189
lle(3I) ............................................................................................................ lge(3I) .................................................................. 189
LLT(3I) ............................................................................................................ lge(3I) .................................................................. 189
llt(3I) ............................................................................................................ lge(3I) .................................................................. 189
LOC(3I) ............................................................................................................ loc(3I) .................................................................. 191
loc(3I) ............................................................................................................ loc(3I) .................................................................. 191
Locate memory address .................................................................................. loc(3I) .................................................................. 191
LOCK_RELEASE(3I) ...................................................................................... sync(3I) ............................................................... 337
lock_release(3I) ...................................................................................... sync(3I) ............................................................... 337
LOCK_TEST_AND_SET(3I) ........................................................................... sync(3I) ............................................................... 337
LOG10(3I) ....................................................................................................... log10(3I) ............................................................. 193
log10(3I) ....................................................................................................... log10(3I) ............................................................. 193
LOG2_IMAGES(3I) ......................................................................................... log2_images(3I) ............................................... 195
log2_images(3I) ......................................................................................... log2_images(3I) ............................................... 195
LOG(3I) ............................................................................................................ log(3I) .................................................................. 196
log(3I) ............................................................................................................ log(3I) .................................................................. 196

004– 2138– 003 Index-33


Logical complement ........................................................................................ compl(3I) ............................................................... 51
Logical equivalence ........................................................................................ eqv(3I) .................................................................... 99
Logical product ............................................................................................... and(3I) .................................................................... 16
Logical sum ..................................................................................................... or(3I) .................................................................... 252
LOGICAL(3I) .................................................................................................. logical(3I) ........................................................ 198
logical(3I) .................................................................................................. logical(3I) ........................................................ 198
LONG(3I) ......................................................................................................... long(3I) ............................................................... 199
long(3I) ......................................................................................................... long(3I) ............................................................... 199
LSHIFT(3I) .................................................................................................... ishft(3I) ............................................................. 175
lshift(3I) .................................................................................................... ishft(3I) ............................................................. 175
MALLOC(3I) .................................................................................................... malloc(3I) ........................................................... 200
malloc(3I) .................................................................................................... malloc(3I) ........................................................... 200
MASK(3I) ......................................................................................................... mask(3I) ............................................................... 202
mask(3I) ......................................................................................................... mask(3I) ............................................................... 202
_mask(3I) ....................................................................................................... mask(3I) ............................................................... 202
_maskl(3I) .................................................................................................... mask(3I) ............................................................... 202
_maskr(3I) .................................................................................................... mask(3I) ............................................................... 202
Math ................................................................................................................ intro_intrin(3I) ............................................. 162
Math library .................................................................................................... intro_intrin(3I) ............................................. 162
Math library introduction ................................................................................ intro_intrin(3I) ............................................. 162
Mathlib intro ................................................................................................... intro_intrin(3I) ............................................. 162
Mathlib introduction ........................................................................................ intro_intrin(3I) ............................................. 162
MATMUL(3I) .................................................................................................... matmul(3I) ........................................................... 205
matmul(3I) .................................................................................................... matmul(3I) ........................................................... 205
matrix .............................................................................................................. bmm(3I) .................................................................... 33
MAX0(3I) ......................................................................................................... max(3I) .................................................................. 207
max0(3I) ......................................................................................................... max(3I) .................................................................. 207
MAX1(3I) ......................................................................................................... max(3I) .................................................................. 207
max1(3I) ......................................................................................................... max(3I) .................................................................. 207
MAX(3I) ............................................................................................................ max(3I) .................................................................. 207
max(3I) ............................................................................................................ max(3I) .................................................................. 207
MAXEXPONENT(3I) ......................................................................................... maxexponent(3I) ............................................... 209
maxexponent(3I) ......................................................................................... maxexponent(3I) ............................................... 209
MAXLOC(3I) .................................................................................................... maxloc(3I) ........................................................... 211
maxloc(3I) .................................................................................................... maxloc(3I) ........................................................... 211
MAXVAL(3I) .................................................................................................... maxval(3I) ........................................................... 214
maxval(3I) .................................................................................................... maxval(3I) ........................................................... 214
mclr(3I) ......................................................................................................... bmm(3I) .................................................................... 33
M@CLR(3I) ....................................................................................................... bmm(3I) .................................................................... 33
_mclr(3I) ....................................................................................................... bmm(3I) .................................................................... 33
m@clr(3I) ....................................................................................................... bmm(3I) .................................................................... 33
Memory address .............................................................................................. loc(3I) .................................................................. 191
MEMORY_BARRIER(3I) .................................................................................. memory_barrier(3I) ........................................ 216
memory_barrier(3I) .................................................................................. memory_barrier(3I) ........................................ 216
_memory_barrier(3I) ............................................................................... memory_barrier(3I) ........................................ 216
MERGE(3I) ....................................................................................................... merge(3I) ............................................................. 217
merge(3I) ....................................................................................................... merge(3I) ............................................................. 217
MIN0(3I) ......................................................................................................... min(3I) .................................................................. 219
min0(3I) ......................................................................................................... min(3I) .................................................................. 219
MIN1(3I) ......................................................................................................... min(3I) .................................................................. 219

Index-34 004– 2138– 003


min1(3I) ......................................................................................................... min(3I) .................................................................. 219
MIN(3I) ............................................................................................................ min(3I) .................................................................. 219
min(3I) ............................................................................................................ min(3I) .................................................................. 219
MINEXPONENT(3I) ......................................................................................... minexponent(3I) ............................................... 221
minexponent(3I) ......................................................................................... minexponent(3I) ............................................... 221
MINLOC(3I) .................................................................................................... minloc(3I) ........................................................... 223
minloc(3I) .................................................................................................... minloc(3I) ........................................................... 223
MINVAL(3I) .................................................................................................... minval(3I) ........................................................... 226
minval(3I) .................................................................................................... minval(3I) ........................................................... 226
mld(3I) ............................................................................................................ bmm(3I) .................................................................... 33
M@LD(3I) ......................................................................................................... bmm(3I) .................................................................... 33
_mld(3I) ......................................................................................................... bmm(3I) .................................................................... 33
m@ld(3I) ......................................................................................................... bmm(3I) .................................................................... 33
mldmx(3I) ....................................................................................................... bmm(3I) .................................................................... 33
M@LDMX(3I) .................................................................................................... bmm(3I) .................................................................... 33
_mldmx(3I) .................................................................................................... bmm(3I) .................................................................... 33
m@ldmx(3I) .................................................................................................... bmm(3I) .................................................................... 33
mmx(3I) ............................................................................................................ bmm(3I) .................................................................... 33
M@MX(3I) ......................................................................................................... bmm(3I) .................................................................... 33
_mmx(3I) ......................................................................................................... bmm(3I) .................................................................... 33
m@mx(3I) ......................................................................................................... bmm(3I) .................................................................... 33
MOD(3I) ............................................................................................................ mod(3I) .................................................................. 228
mod(3I) ............................................................................................................ mod(3I) .................................................................. 228
MODELS(3I) .................................................................................................... models(3I) ........................................................... 230
models(3I) .................................................................................................... models(3I) ........................................................... 230
Modulo function .............................................................................................. modulo(3I) ........................................................... 235
MODULO(3I) .................................................................................................... modulo(3I) ........................................................... 235
modulo(3I) .................................................................................................... modulo(3I) ........................................................... 235
MPP ................................................................................................................. remote_write_barrier(3I) .......................... 281
MPP ................................................................................................................. write_memory_barrier(3I) .......................... 365
mul(3I) ............................................................................................................ bmm(3I) .................................................................... 33
M@UL(3I) ......................................................................................................... bmm(3I) .................................................................... 33
_mul(3I) ......................................................................................................... bmm(3I) .................................................................... 33
m@ul(3I) ......................................................................................................... bmm(3I) .................................................................... 33
Multiplies integers and returns the uppermost bits ......................................... int_mult_upper(3I) ........................................ 160
MVBITS(3I) .................................................................................................... mvbits(3I) ........................................................... 237
mvbits(3I) .................................................................................................... mvbits(3I) ........................................................... 237
MY_PE(3I) ....................................................................................................... my_pe(3I) ............................................................. 238
my_pe(3I) ....................................................................................................... my_pe(3I) ............................................................. 238
_my_pe(3I) .................................................................................................... my_pe(3I) ............................................................. 238
NAND_AND_FETCH(3I) .................................................................................. sync(3I) ............................................................... 337
nand_and_fetch(3I) .................................................................................. sync(3I) ............................................................... 337
Natural logarithm ............................................................................................ log(3I) .................................................................. 196
Nearest integer ................................................................................................ nint(3I) ............................................................... 241
Nearest integer search ..................................................................................... nint(3I) ............................................................... 241
Nearest number search .................................................................................... anint(3I) ............................................................... 18
Nearest whole number .................................................................................... anint(3I) ............................................................... 18
NEAREST(3I) .................................................................................................. nearest(3I) ........................................................ 240
nearest(3I) .................................................................................................. nearest(3I) ........................................................ 240
NEQV(3I) ......................................................................................................... eqv(3I) .................................................................... 99

004– 2138– 003 Index-35


neqv(3I) ......................................................................................................... eqv(3I) .................................................................... 99
NINT(3I) ......................................................................................................... nint(3I) ............................................................... 241
nint(3I) ......................................................................................................... nint(3I) ............................................................... 241
normal exit ...................................................................................................... ex(3I) .................................................................... 103
normal exit ...................................................................................................... getvm(3I) ............................................................. 123
NOT(3I) ............................................................................................................ not(3I) .................................................................. 243
not(3I) ............................................................................................................ not(3I) .................................................................. 243
NULL(3I) ......................................................................................................... null(3I) ............................................................... 245
null(3I) ......................................................................................................... null(3I) ............................................................... 245
NUMARG(3I) .................................................................................................... numarg(3I) ........................................................... 247
numarg(3I) .................................................................................................... numarg(3I) ........................................................... 247
numargs(3I) .................................................................................................. numarg(3I) ........................................................... 247
_numargs(3I) ................................................................................................ numarg(3I) ........................................................... 247
NUM_IMAGES(3I) ........................................................................................... num_images(3I) ................................................. 250
num_images(3I) ........................................................................................... num_images(3I) ................................................. 250
NUM_PES(3I) .................................................................................................. num_pes(3I) ........................................................ 251
num_pes(3I) .................................................................................................. num_pes(3I) ........................................................ 251
_num_pes(3I) ................................................................................................ num_pes(3I) ........................................................ 251
Obtains a file position or returns a file to a previous position ....................... getpos(3I) ........................................................... 120
Obtains the address of a variable .................................................................... loc(3I) .................................................................. 191
Obtains the Fortran Character Descriptor (FCD) of a character entity .......... cloc(3I) ................................................................. 46
One bits count ................................................................................................. popcnt(3I) ........................................................... 258
OR(3I) .............................................................................................................. or(3I) .................................................................... 252
or(3I) .............................................................................................................. or(3I) .................................................................... 252
OR_AND_FETCH(3I) ...................................................................................... sync(3I) ............................................................... 337
or_and_fetch(3I) ...................................................................................... sync(3I) ............................................................... 337
PACK(3I) ......................................................................................................... pack(3I) ............................................................... 254
pack(3I) ......................................................................................................... pack(3I) ............................................................... 254
Packs an array into an array of rank one under control of a mask ................ pack(3I) ............................................................... 254
Parity bit population ........................................................................................ poppar(3I) ........................................................... 260
pbit(3I) ......................................................................................................... pbit(3I) ............................................................... 256
_pbit(3I) ....................................................................................................... pbit(3I) ............................................................... 256
pbits(3I) ....................................................................................................... pbit(3I) ............................................................... 256
_pbits(3I) .................................................................................................... pbit(3I) ............................................................... 256
PE .................................................................................................................... num_pes(3I) ........................................................ 251
Performs a circular shift of the rightmost bits ................................................ ishftc(3I) ........................................................... 177
Performs a circular shift on an array expression ............................................ cshift(3I) ............................................................. 65
Performs a conditional scalar merge ............................................................... csmg(3I) ................................................................. 67
Performs a double-object left shift ................................................................. dshiftl(3I) .......................................................... 85
Performs a double-object right shift ............................................................... dshiftr(3I) .......................................................... 87
Performs a left circular shift ........................................................................... shift(3I) ............................................................. 312
Performs a left shift with zero fill .................................................................. shiftl(3I) ........................................................... 316
Performs a logical AND, an exclusive OR, or an inclusive OR ....................... iand(3I) ............................................................... 126
Performs a logical complement ...................................................................... not(3I) .................................................................. 243
Performs a logical shift ................................................................................... ishft(3I) ............................................................. 175
Performs a normal exit ................................................................................... ex(3I) .................................................................... 103
Performs a right shift with zero fill ................................................................ shiftr(3I) ........................................................... 318
Performs an arithmetic shift ............................................................................ shifta(3I) ........................................................... 314
Performs an end-off shift on an array expression .......................................... eoshift(3I) .......................................................... 95
Performs arithmetic shift on an integer .......................................................... isha(3I) ............................................................... 173

Index-36 004– 2138– 003


Performs bit matrix multiply operations ......................................................... bmm(3I) .................................................................... 33
Performs circular shift on an integer .............................................................. ishc(3I) ............................................................... 174
Performs conversion and positioning functions .............................................. char(3I) ................................................................. 42
Performs dot-product multiplication of numeric or logical vectors ............... dot_product(3I) ................................................. 81
Performs logical shift with zero fill ................................................................ ishl(3I) ............................................................... 179
Performs matrix multiplication of numeric or logical matrices ...................... matmul(3I) ........................................................... 205
Performs operations on the semaphore ........................................................... semclr(3I) ........................................................... 299
Performs truncation to integer ........................................................................ aint(3I) ................................................................. 11
POPCNT(3I) .................................................................................................... popcnt(3I) ........................................................... 258
popcnt(3I) .................................................................................................... popcnt(3I) ........................................................... 258
_popcnt(3I) .................................................................................................. popcnt(3I) ........................................................... 258
POPPAR(3I) .................................................................................................... poppar(3I) ........................................................... 260
poppar(3I) .................................................................................................... poppar(3I) ........................................................... 260
_poppar(3I) .................................................................................................. poppar(3I) ........................................................... 260
Population count ............................................................................................. popcnt(3I) ........................................................... 258
Population parity ............................................................................................. poppar(3I) ........................................................... 260
Position (return to) .......................................................................................... getpos(3I) ........................................................... 120
Positive difference ........................................................................................... dim(3I) .................................................................... 79
PRECISION(3I) ............................................................................................. precision(3I) .................................................... 262
precision(3I) ............................................................................................. precision(3I) .................................................... 262
PRESENT(3I) .................................................................................................. present(3I) ........................................................ 264
present(3I) .................................................................................................. present(3I) ........................................................ 264
processing elements ........................................................................................ num_pes(3I) ........................................................ 251
Product logical ................................................................................................ and(3I) .................................................................... 16
PRODUCT(3I) .................................................................................................. product(3I) ........................................................ 265
product(3I) .................................................................................................. product(3I) ........................................................ 265
Pseudo-random number ................................................................................... ran(3I) .................................................................. 268
QABS(3I) ......................................................................................................... abs(3I) ...................................................................... 1
qabs(3I) ......................................................................................................... abs(3I) ...................................................................... 1
QACOS(3I) ....................................................................................................... acos(3I) ................................................................... 3
qacos(3I) ....................................................................................................... acos(3I) ................................................................... 3
QACOSD(3I) .................................................................................................... acos(3I) ................................................................... 3
qacosd(3I) .................................................................................................... acos(3I) ................................................................... 3
QASIN(3I) ....................................................................................................... asin(3I) ................................................................. 22
qasin(3I) ....................................................................................................... asin(3I) ................................................................. 22
QASIND(3I) .................................................................................................... asin(3I) ................................................................. 22
qasind(3I) .................................................................................................... asin(3I) ................................................................. 22
QATAN2(3I) .................................................................................................... atan2(3I) ............................................................... 26
qatan2(3I) .................................................................................................... atan2(3I) ............................................................... 26
QATAN2D(3I) .................................................................................................. atan2(3I) ............................................................... 26
qatan2d(3I) .................................................................................................. atan2(3I) ............................................................... 26
QATAN(3I) ....................................................................................................... atan(3I) ................................................................. 29
qatan(3I) ....................................................................................................... atan(3I) ................................................................. 29
QATAND(3I) .................................................................................................... atan(3I) ................................................................. 29
qatand(3I) .................................................................................................... atan(3I) ................................................................. 29
QCMPLX(3I) .................................................................................................... cmplx(3I) ............................................................... 48
qcmplx(3I) .................................................................................................... cmplx(3I) ............................................................... 48
QCONJG(3I) .................................................................................................... conjg(3I) ............................................................... 53
QCOS(3I) ......................................................................................................... cos(3I) .................................................................... 55
qcos(3I) ......................................................................................................... cos(3I) .................................................................... 55

004– 2138– 003 Index-37


QCOSD(3I) ....................................................................................................... cos(3I) .................................................................... 55
qcosd(3I) ....................................................................................................... cos(3I) .................................................................... 55
QCOSH(3I) ....................................................................................................... cosh(3I) ................................................................. 57
qcosh(3I) ....................................................................................................... cosh(3I) ................................................................. 57
QCOT(3I) ......................................................................................................... cot(3I) .................................................................... 59
qcot(3I) ......................................................................................................... cot(3I) .................................................................... 59
qcotan(3I) .................................................................................................... cot(3I) .................................................................... 59
QDIM(3I) ......................................................................................................... dim(3I) .................................................................... 79
qdim(3I) ......................................................................................................... dim(3I) .................................................................... 79
QEXP(3I) ......................................................................................................... exp(3I) .................................................................. 104
qexp(3I) ......................................................................................................... exp(3I) .................................................................. 104
QFLOAT(3I) .................................................................................................... real(3I) ............................................................... 278
qfloat(3I) .................................................................................................... real(3I) ............................................................... 278
QFLOATI(3I) .................................................................................................. real(3I) ............................................................... 278
qfloati(3I) .................................................................................................. real(3I) ............................................................... 278
QFLOATJ(3I) .................................................................................................. real(3I) ............................................................... 278
qfloatj(3I) .................................................................................................. real(3I) ............................................................... 278
QFLOATK(3I) .................................................................................................. real(3I) ............................................................... 278
qfloatk(3I) .................................................................................................. real(3I) ............................................................... 278
QIMAG(3I) ....................................................................................................... aimag(3I) ................................................................. 9
qimag(3I) ....................................................................................................... aimag(3I) ................................................................. 9
QINT(3I) ......................................................................................................... aint(3I) ................................................................. 11
qint(3I) ......................................................................................................... aint(3I) ................................................................. 11
QLOG10(3I) .................................................................................................... log10(3I) ............................................................. 193
qlog10(3I) .................................................................................................... log10(3I) ............................................................. 193
QLOG(3I) ......................................................................................................... log(3I) .................................................................. 196
qlog(3I) ......................................................................................................... log(3I) .................................................................. 196
QMAX1(3I) ....................................................................................................... max(3I) .................................................................. 207
qmax1(3I) ....................................................................................................... max(3I) .................................................................. 207
QMIN1(3I) ....................................................................................................... min(3I) .................................................................. 219
qmin1(3I) ....................................................................................................... min(3I) .................................................................. 219
QMOD(3I) ......................................................................................................... mod(3I) .................................................................. 228
qmod(3I) ......................................................................................................... mod(3I) .................................................................. 228
QNINT(3I) ....................................................................................................... anint(3I) ............................................................... 18
qnint(3I) ....................................................................................................... anint(3I) ............................................................... 18
QPROD(3I) ....................................................................................................... dprod(3I) ............................................................... 83
qprod(3I) ....................................................................................................... dprod(3I) ............................................................... 83
QREAL(3I) ....................................................................................................... real(3I) ............................................................... 278
qreal(3I) ....................................................................................................... real(3I) ............................................................... 278
QSIGN(3I) ....................................................................................................... sign(3I) ............................................................... 321
qsign(3I) ....................................................................................................... sign(3I) ............................................................... 321
QSIN(3I) ......................................................................................................... sin(3I) .................................................................. 323
qsin(3I) ......................................................................................................... sin(3I) .................................................................. 323
QSIND(3I) ....................................................................................................... sin(3I) .................................................................. 323
qsind(3I) ....................................................................................................... sin(3I) .................................................................. 323
QSINH(3I) ....................................................................................................... sinh(3I) ............................................................... 325
QSQRT(3I) ....................................................................................................... sqrt(3I) ............................................................... 333
QTAN(3I) ......................................................................................................... tan(3I) .................................................................. 342
qtan(3I) ......................................................................................................... tan(3I) .................................................................. 342
QTAND(3I) ....................................................................................................... tan(3I) .................................................................. 342

Index-38 004– 2138– 003


qtand(3I) ....................................................................................................... tan(3I) .................................................................. 342
QTANH(3I) ....................................................................................................... tanh(3I) ............................................................... 344
Query intrinsics for distributed arrays ............................................................ dsm(3I) .................................................................... 89
RADIX(3I) ....................................................................................................... radix(3I) ............................................................. 267
radix(3I) ....................................................................................................... radix(3I) ............................................................. 267
ran(3I) ............................................................................................................ ran(3I) .................................................................. 268
RANDOM_NUMBER(3I) .................................................................................... random_number(3I) .......................................... 272
random_number(3I) .................................................................................... random_number(3I) .......................................... 272
RANDOM_SEED(3I) ......................................................................................... random_seed(3I) ............................................... 273
random_seed(3I) ......................................................................................... random_seed(3I) ............................................... 273
RANF(3I) ......................................................................................................... ran(3I) .................................................................. 268
ranf(3I) ......................................................................................................... ran(3I) .................................................................. 268
_ranf(3I) ....................................................................................................... ran(3I) .................................................................. 268
RANGE(3I) ....................................................................................................... range(3I) ............................................................. 274
range(3I) ....................................................................................................... range(3I) ............................................................. 274
RANGET(3I) .................................................................................................... ran(3I) .................................................................. 268
ranget(3I) .................................................................................................... ran(3I) .................................................................. 268
RANSET(3I) .................................................................................................... ran(3I) .................................................................. 268
ranset(3I) .................................................................................................... ran(3I) .................................................................. 268
readSB(3I) .................................................................................................... readSB(3I) ........................................................... 276
readsb(3I) .................................................................................................... readSB(3I) ........................................................... 276
_readSB(3I) .................................................................................................. readSB(3I) ........................................................... 276
readSR(3I) .................................................................................................... readSR(3I) ........................................................... 277
readsr(3I) .................................................................................................... readSR(3I) ........................................................... 277
_readSR(3I) .................................................................................................. readSR(3I) ........................................................... 277
_readsr(3I) .................................................................................................. readSR(3I) ........................................................... 277
readST(3I) .................................................................................................... readSB(3I) ........................................................... 276
readst(3I) .................................................................................................... readSB(3I) ........................................................... 276
_readST(3I) .................................................................................................. readSB(3I) ........................................................... 276
_readst(3I) .................................................................................................. readSB(3I) ........................................................... 276
Real truncation ................................................................................................ aint(3I) ................................................................. 11
REAL(3I) ......................................................................................................... real(3I) ............................................................... 278
real(3I) ......................................................................................................... real(3I) ............................................................... 278
register ............................................................................................................. readSB(3I) ........................................................... 276
register ............................................................................................................. readSR(3I) ........................................................... 277
Remainder ....................................................................................................... mod(3I) .................................................................. 228
REM_IMAGES(3I) ........................................................................................... rem_images(3I) ................................................. 280
rem_images(3I) ........................................................................................... rem_images(3I) ................................................. 280
REMOTE_WRITE_BARRIER(3I) .................................................................... remote_write_barrier(3I) .......................... 281
remote_write_barrier(3I) .................................................................... remote_write_barrier(3I) .......................... 281
_remote_write_barrier(3I) ................................................................. remote_write_barrier(3I) .......................... 281
REPEAT(3I) .................................................................................................... repeat(3I) ........................................................... 282
repeat(3I) .................................................................................................... repeat(3I) ........................................................... 282
RESHAPE(3I) .................................................................................................. reshape(3I) ........................................................ 283
reshape(3I) .................................................................................................. reshape(3I) ........................................................ 283
Restarts or queries the pseudorandom number generator ............................... random_seed(3I) ............................................... 273
Restores floating-point interrupt status before exiting a procedure ................ set_ieee_interrupts(3I) ............................ 305
Restores floating-point status .......................................................................... set_ieee_status(3I)...................................... 309
Restores the caller’s floating-point status prior to exiting a procedure .......... set_ieee_exceptions(3I) ............................ 304
Retrieve seed ................................................................................................... ran(3I) .................................................................. 268

004– 2138– 003 Index-39


Retrieves an image number ............................................................................. this_image(3I) ................................................. 350
Retrieves flags that represent the current floating-point exception status ...... get_ieee_exceptions(3I) ............................ 112
Retrieves flags that represent the current floating-point interrupt status ........ get_ieee_interrupts(3I) ............................ 114
Retrieves flags that represent the current floating-point status upon entry
to a procedure ................................................................................................. get_ieee_status(3I)...................................... 118
Retrieves total number of images executing ................................................... num_images(3I) ................................................. 250
Return bit mask ............................................................................................... mask(3I) ............................................................... 202
Return location of variable in memory ........................................................... loc(3I) .................................................................. 191
Return value (clock) ........................................................................................ rtc(3I) .................................................................. 287
Returns a bit mask .......................................................................................... mask(3I) ............................................................... 202
Returns a disassociated pointer ....................................................................... null(3I) ............................................................... 245
Returns all the lower bounds or a specified lower bound of an array ........... lbound(3I) ........................................................... 181
Returns all the upper bounds of an array or a specified upper bound ........... ubound(3I) ........................................................... 358
Returns an integer kind type parameter .......................................................... selected_int_kind(3I) ................................. 292
Returns bytes of storage .................................................................................. sizeof(3I) ........................................................... 328
Returns clock register contents ....................................................................... rtc(3I) .................................................................. 287
Returns contents of or sets vector mask register ............................................ getvm(3I) ............................................................. 123
Returns current floating-point rounding mode ................................................ get_ieee_rounding_mode(3I) ..................... 116
Returns data on the real-time clock and date ................................................. date_and_time(3I) ............................................ 73
Returns date or time in numerical form ......................................................... idate(3I) ............................................................. 133
Returns imaginary part of a complex number ................................................ aimag(3I) ................................................................. 9
Returns integer data from a real-time clock ................................................... system_clock(3I) ............................................. 341
Returns integer (KIND=2) result .................................................................... short(3I) ............................................................. 320
Returns integer (KIND=4) result .................................................................... long(3I) ............................................................... 199
Returns maximum values ................................................................................ max(3I) .................................................................. 207
Returns minimum values ................................................................................ min(3I) .................................................................. 219
Returns MOD(NUM_IMAGES(), 2**LOG2_IMAGES()) ......................... rem_images(3I) ................................................. 280
Returns pseudorandom numbers ..................................................................... random_number(3I) .......................................... 272
Returns r-1, where r is the smallest number greater than 1 in the numeric
model ............................................................................................................... epsilon(3I) .......................................................... 97
Returns status register value ........................................................................... readSB(3I) ........................................................... 276
Returns status register value ........................................................................... readSR(3I) ........................................................... 277
Returns the absolute spacing of real model numbers near the argument
value ................................................................................................................ spacing(3I) ........................................................ 329
Returns the array allocation status .................................................................. allocated(3I) ...................................................... 15
Returns the base 2 logarithm of the number of executing images
truncated to an integer .................................................................................... log2_images(3I) ............................................... 195
Returns the base number from the real or integer number models ................ radix(3I) ............................................................. 267
Returns the character argument with trailing blank characters removed ....... trim(3I) ............................................................... 357
Returns the class to which x belongs .............................................................. ieee_class(3I) ................................................. 136
Returns the current date .................................................................................. date(3I) ................................................................. 72
Returns the current time .................................................................................. clock(3I) ............................................................... 47
Returns the decimal exponent range of a number according to the real or
integer model .................................................................................................. range(3I) ............................................................. 274
Returns the decimal precision of a number in the real number model .......... precision(3I) .................................................... 262
Returns the exponent part of the argument when represented as a numeric
model number ................................................................................................. exponent(3I) ...................................................... 106
Returns the fractional part of the numeric model representation of the
argument value ................................................................................................ fraction(3I) ...................................................... 109
Returns the greatest integer less than or equal to a ....................................... floor(3I) ............................................................. 108

Index-40 004– 2138– 003


Returns the largest number in the integer or real numeric model .................. huge(3I) ............................................................... 124
Returns the least integer greater than or equal to a ....................................... ceiling(3I) .......................................................... 41
Returns the length of the character argument without counting trailing
blank characters ............................................................................................... len_trim(3I) ...................................................... 188
Returns the location of a maximum value in an array ................................... maxloc(3I) ........................................................... 211
Returns the location of a minimum value in an array .................................... minloc(3I) ........................................................... 223
Returns the maximum exponent in the numeric model .................................. maxexponent(3I) ............................................... 209
Returns the maximum value in an array ......................................................... maxval(3I) ........................................................... 214
Returns the minimum (most negative) exponent of a real number in the
numeric model ................................................................................................. minexponent(3I) ............................................... 221
Returns the minimum value in an array ......................................................... minval(3I) ........................................................... 226
Returns the nearest different machine representable number in a given
direction ........................................................................................................... nearest(3I) ........................................................ 240
Returns the next representable neighbor of x in the direction toward y ........ ieee_next_after(3I)...................................... 148
Returns the number of arguments in a function or subprogram call ............. numarg(3I) ........................................................... 247
Returns the number of bits in an integer in the bit manipulation model ....... bit_size(3I) ........................................................ 31
Returns the number of processing elements (PEs) running in an
application ....................................................................................................... num_pes(3I) ........................................................ 251
Returns the number of significant digits ......................................................... digits(3I) ............................................................. 77
Returns the number of words transferred ....................................................... length(3I) ........................................................... 186
Returns the pointer association status ............................................................. associated(3I) ................................................... 24
Returns the processing element (PE) number of the calling PE .................... my_pe(3I) ............................................................. 238
Returns the processor time .............................................................................. cpu_time(3I) ........................................................ 63
Returns the real kind type parameter .............................................................. selected_real_kind(3I)............................... 294
Returns the reciprocal of the relative spacing of numeric model numbers
near the argument value .................................................................................. rrspacing(3I) .................................................... 285
Returns the remainder of x divided by y ........................................................ ieee_remainder(3I) ........................................ 152
Returns the shape of an array or a scalar ....................................................... shape(3I) ............................................................. 311
Returns the smallest positive value for a real argument ................................ tiny(3I) ............................................................... 352
Returns the state of a floating-point exception ............................................... test_ieee_exception(3I) ............................ 346
Returns the state of a floating-point interrupt ................................................. test_ieee_interrupt(3I) ............................ 348
Returns the status of a BUFFER IN or BUFFER OUT statement .............. unit(3I) ............................................................... 359
Returns the total number of elements in an array .......................................... size(3I) ............................................................... 327
Returns the unbiased exponent of x ................................................................ ieee_exponent(3I) .......................................... 140
Returns the value of a data word .................................................................... pbit(3I) ............................................................... 256
Returns the value of the kind type parameter of x ......................................... kind(3I) ............................................................... 180
Returns the value of the nth bit (from the right) ............................................ gbit(3I) ............................................................... 110
Returns x with the sign of y ........................................................................... ieee_copy_sign(3I) ........................................ 138
Returns (x)(b**i), where b is the base in the real number model
representation of x ........................................................................................... scale(3I) ............................................................. 289
Returns y multiplied by 2**n ......................................................................... ieee_binary_scale(3I) ................................. 134
Right shift ....................................................................................................... shiftr(3I) ........................................................... 318
RRSPACING(3I) ............................................................................................. rrspacing(3I) .................................................... 285
rrspacing(3I) ............................................................................................. rrspacing(3I) .................................................... 285
RSHIFT(3I) .................................................................................................... ishft(3I) ............................................................. 175
rshift(3I) .................................................................................................... ishft(3I) ............................................................. 175
RTC(3I) ............................................................................................................ rtc(3I) .................................................................. 287
rtc(3I) ............................................................................................................ rtc(3I) .................................................................. 287
_rtc(3I) ......................................................................................................... rtc(3I) .................................................................. 287
SCALE(3I) ....................................................................................................... scale(3I) ............................................................. 289

004– 2138– 003 Index-41


scale(3I) ....................................................................................................... scale(3I) ............................................................. 289
SCAN(3I) ......................................................................................................... scan(3I) ............................................................... 290
scan(3I) ......................................................................................................... scan(3I) ............................................................... 290
Scans a string for any one of the characters in a set of characters ................ scan(3I) ............................................................... 290
SELECTED_INT_KIND(3I) ........................................................................... selected_int_kind(3I) ................................. 292
selected_int_kind(3I) ........................................................................... selected_int_kind(3I) ................................. 292
SELECTED_REAL_KIND(3I) ........................................................................ selected_real_kind(3I)............................... 294
selected_real_kind(3I) ........................................................................ selected_real_kind(3I)............................... 294
semaphore ....................................................................................................... semclr(3I) ........................................................... 299
semaphore mask .............................................................................................. semclr(3I) ........................................................... 299
semclr(3I) .................................................................................................... semclr(3I) ........................................................... 299
_semclr(3I) .................................................................................................. semclr(3I) ........................................................... 299
semget(3I) .................................................................................................... semclr(3I) ........................................................... 299
_semget(3I) .................................................................................................. semclr(3I) ........................................................... 299
semput(3I) .................................................................................................... semclr(3I) ........................................................... 299
_semput(3I) .................................................................................................. semclr(3I) ........................................................... 299
semset(3I) .................................................................................................... semclr(3I) ........................................................... 299
_semset(3I) .................................................................................................. semclr(3I) ........................................................... 299
semts(3I) ....................................................................................................... semclr(3I) ........................................................... 299
_semts(3I) .................................................................................................... semclr(3I) ........................................................... 299
Set seed ........................................................................................................... ran(3I) .................................................................. 268
SET_EXPONENT(3I) ...................................................................................... set_exponent(3I) ............................................. 300
set_exponent(3I) ...................................................................................... set_exponent(3I) ............................................. 300
SET_IEEE_EXCEPTION(3I) ........................................................................ set_ieee_exception(3I)............................... 302
set_ieee_exception(3I) ........................................................................ set_ieee_exception(3I)............................... 302
SET_IEEE_EXCEPTIONS(3I) ...................................................................... set_ieee_exceptions(3I) ............................ 304
set_ieee_exceptions(3I) ...................................................................... set_ieee_exceptions(3I) ............................ 304
SET_IEEE_INTERRUPTS(3I) ...................................................................... set_ieee_interrupts(3I) ............................ 305
set_ieee_interrupts(3I) ...................................................................... set_ieee_interrupts(3I) ............................ 305
SET_IEEE_ROUNDING_MODE(3I) ............................................................... set_ieee_rounding_mode(3I) ..................... 306
set_ieee_rounding_mode(3I) ............................................................... set_ieee_rounding_mode(3I) ..................... 306
SET_IEEE_STATUS(3I) ............................................................................... set_ieee_status(3I)...................................... 309
set_ieee_status(3I) ............................................................................... set_ieee_status(3I)...................................... 309
SETPOS(3I) .................................................................................................... getpos(3I) ........................................................... 120
setpos(3I) .................................................................................................... getpos(3I) ........................................................... 120
Sets, clears, or reverses the value of a specified bit in an integer ................. ibchng(3I) ........................................................... 129
Sets exponent part of a number ...................................................................... set_exponent(3I) ............................................. 300
Sets floating-point exception indicator ............................................................ set_ieee_exception(3I)............................... 302
setvm(3I) ....................................................................................................... getvm(3I) ............................................................. 123
_setvm(3I) .................................................................................................... getvm(3I) ............................................................. 123
SHAPE(3I) ....................................................................................................... shape(3I) ............................................................. 311
shape(3I) ....................................................................................................... shape(3I) ............................................................. 311
shared-B register ............................................................................................. readSB(3I) ........................................................... 276
shared-T register ............................................................................................. readSB(3I) ........................................................... 276
Shift circular .................................................................................................... shift(3I) ............................................................. 312
Shift left .......................................................................................................... shiftl(3I) ........................................................... 316
Shift right ........................................................................................................ shiftr(3I) ........................................................... 318
SHIFT(3I) ....................................................................................................... shift(3I) ............................................................. 312
shift(3I) ....................................................................................................... shift(3I) ............................................................. 312
SHIFTA(3I) .................................................................................................... shifta(3I) ........................................................... 314

Index-42 004– 2138– 003


shifta(3I) .................................................................................................... shifta(3I) ........................................................... 314
SHIFTL(3I) .................................................................................................... shiftl(3I) ........................................................... 316
shiftl(3I) .................................................................................................... shiftl(3I) ........................................................... 316
SHIFTR(3I) .................................................................................................... shiftr(3I) ........................................................... 318
shiftr(3I) .................................................................................................... shiftr(3I) ........................................................... 318
SHORT(3I) ....................................................................................................... short(3I) ............................................................. 320
short(3I) ....................................................................................................... short(3I) ............................................................. 320
Sign ................................................................................................................. sign(3I) ............................................................... 321
Sign transfer .................................................................................................... sign(3I) ............................................................... 321
SIGN(3I) ......................................................................................................... sign(3I) ............................................................... 321
sign(3I) ......................................................................................................... sign(3I) ............................................................... 321
SIN(3I) ............................................................................................................ sin(3I) .................................................................. 323
sin(3I) ............................................................................................................ sin(3I) .................................................................. 323
SIND(3I) ......................................................................................................... sin(3I) .................................................................. 323
sind(3I) ......................................................................................................... sin(3I) .................................................................. 323
Sine ................................................................................................................. sin(3I) .................................................................. 323
Sine (hyperbolic) ............................................................................................. sinh(3I) ............................................................... 325
SINH(3I) ......................................................................................................... sinh(3I) ............................................................... 325
sinh(3I) ......................................................................................................... sinh(3I) ............................................................... 325
SIZE(3I) ......................................................................................................... size(3I) ............................................................... 327
size(3I) ......................................................................................................... size(3I) ............................................................... 327
SIZEOF(3I) .................................................................................................... sizeof(3I) ........................................................... 328
sizeof(3I) .................................................................................................... sizeof(3I) ........................................................... 328
SNGL(3I) ......................................................................................................... real(3I) ............................................................... 278
sngl(3I) ......................................................................................................... real(3I) ............................................................... 278
SNGLQ(3I) ....................................................................................................... real(3I) ............................................................... 278
snglq(3I) ....................................................................................................... real(3I) ............................................................... 278
SPACING(3I) .................................................................................................. spacing(3I) ........................................................ 329
spacing(3I) .................................................................................................. spacing(3I) ........................................................ 329
SPREAD(3I) .................................................................................................... spread(3I) ........................................................... 331
spread(3I) .................................................................................................... spread(3I) ........................................................... 331
SQRT(3I) ......................................................................................................... sqrt(3I) ............................................................... 333
sqrt(3I) ......................................................................................................... sqrt(3I) ............................................................... 333
Square root ...................................................................................................... sqrt(3I) ............................................................... 333
status register value ......................................................................................... readSB(3I) ........................................................... 276
status register value ......................................................................................... readSR(3I) ........................................................... 277
strcmp .............................................................................................................. lge(3I) .................................................................. 189
String comparison ........................................................................................... lge(3I) .................................................................. 189
SUB_AND_FETCH(3I) .................................................................................... sync(3I) ............................................................... 337
sub_and_fetch(3I) .................................................................................... sync(3I) ............................................................... 337
Sum (logical) ................................................................................................... or(3I) .................................................................... 252
SUM(3I) ............................................................................................................ sum(3I) .................................................................. 335
sum(3I) ............................................................................................................ sum(3I) .................................................................. 335
Sums array elements ....................................................................................... sum(3I) .................................................................. 335
sync(3I) ......................................................................................................... sync(3I) ............................................................... 337
synchronization ............................................................................................... sync(3I) ............................................................... 337
SYNCHRONIZE(3I) ......................................................................................... sync(3I) ............................................................... 337
synchronize(3I) ......................................................................................... sync(3I) ............................................................... 337
Synchronizes images ....................................................................................... sync_images(3I) ............................................... 340
SYNC_IMAGES(3I) ......................................................................................... sync_images(3I) ............................................... 340

004– 2138– 003 Index-43


sync_images(3I) ......................................................................................... sync_images(3I) ............................................... 340
System clock time ........................................................................................... clock(3I) ............................................................... 47
SYSTEM_CLOCK(3I) ...................................................................................... system_clock(3I) ............................................. 341
system_clock(3I) ...................................................................................... system_clock(3I) ............................................. 341
T3E .................................................................................................................. memory_barrier(3I) ........................................ 216
T3E .................................................................................................................. remote_write_barrier(3I) .......................... 281
T3E .................................................................................................................. write_memory_barrier(3I) .......................... 365
TAN(3I) ............................................................................................................ tan(3I) .................................................................. 342
tan(3I) ............................................................................................................ tan(3I) .................................................................. 342
TAND(3I) ......................................................................................................... tan(3I) .................................................................. 342
tand(3I) ......................................................................................................... tan(3I) .................................................................. 342
Tangent ............................................................................................................ tan(3I) .................................................................. 342
Tangent (hyperbolic) ....................................................................................... tanh(3I) ............................................................... 344
TANH(3I) ......................................................................................................... tanh(3I) ............................................................... 344
tanh(3I) ......................................................................................................... tanh(3I) ............................................................... 344
Tape file positioning ....................................................................................... getpos(3I) ........................................................... 120
test-and-set ...................................................................................................... semclr(3I) ........................................................... 299
TEST_IEEE_EXCEPTION(3I) ...................................................................... test_ieee_exception(3I) ............................ 346
test_ieee_exception(3I) ...................................................................... test_ieee_exception(3I) ............................ 346
TEST_IEEE_INTERRUPT(3I) ...................................................................... test_ieee_interrupt(3I) ............................ 348
test_ieee_interrupt(3I) ...................................................................... test_ieee_interrupt(3I) ............................ 348
Tests a bit of an integer value ........................................................................ btest(3I) ............................................................... 39
Tests for x being a NaN .................................................................................. ieee_is_nan(3I) ............................................... 146
Tests for x being greater than negative infinity and less than positive
infinity. ............................................................................................................ ieee_finite(3I) ............................................... 143
Tests for x or y being a NaN .......................................................................... ieee_unordered(3I) ........................................ 154
THIS_IMAGE(3I) ........................................................................................... this_image(3I) ................................................. 350
this_image(3I) ........................................................................................... this_image(3I) ................................................. 350
TINY(3I) ......................................................................................................... tiny(3I) ............................................................... 352
tiny(3I) ......................................................................................................... tiny(3I) ............................................................... 352
TRANSFER(3I) ................................................................................................ transfer(3I) ...................................................... 354
transfer(3I) ................................................................................................ transfer(3I) ...................................................... 354
Transfers the sign of numbers ........................................................................ sign(3I) ............................................................... 321
TRANSPOSE(3I) ............................................................................................. transpose(3I) .................................................... 356
transpose(3I) ............................................................................................. transpose(3I) .................................................... 356
Transposes an array of rank two .................................................................... transpose(3I) .................................................... 356
Treats the first argument as if it is of the same type as the second
argument .......................................................................................................... transfer(3I) ...................................................... 354
TRIM(3I) ......................................................................................................... trim(3I) ............................................................... 357
trim(3I) ......................................................................................................... trim(3I) ............................................................... 357
Truncation ....................................................................................................... aint(3I) ................................................................. 11
Type ................................................................................................................ cmplx(3I) ............................................................... 48
Type conversion .............................................................................................. int(3I) .................................................................. 158
Type conversion .............................................................................................. real(3I) ............................................................... 278
Type conversion .............................................................................................. cmplx(3I) ............................................................... 48
Type conversion .............................................................................................. dble(3I) ................................................................. 76
Type converter ................................................................................................ int(3I) .................................................................. 158
Type converter ................................................................................................ real(3I) ............................................................... 278
Type converter ................................................................................................ dble(3I) ................................................................. 76
Type converter (complex) ............................................................................... cmplx(3I) ............................................................... 48

Index-44 004– 2138– 003


UBOUND(3I) .................................................................................................... ubound(3I) ........................................................... 358
ubound(3I) .................................................................................................... ubound(3I) ........................................................... 358
UNIT(3I) ......................................................................................................... unit(3I) ............................................................... 359
unit(3I) ......................................................................................................... unit(3I) ............................................................... 359
UNPACK(3I) .................................................................................................... unpack(3I) ........................................................... 361
unpack(3I) .................................................................................................... unpack(3I) ........................................................... 361
Unpacks an array of rank one into an array under control of a mask ........... unpack(3I) ........................................................... 361
Verifies that a set of characters contains all characters in a string ................ verify(3I) ........................................................... 363
VERIFY(3I) .................................................................................................... verify(3I) ........................................................... 363
verify(3I) .................................................................................................... verify(3I) ........................................................... 363
Wait for BUFFER IN/BUFFER OUT operation ........................................... unit(3I) ............................................................... 359
Word shift ....................................................................................................... shiftl(3I) ........................................................... 316
Word shift ....................................................................................................... shiftr(3I) ........................................................... 318
WRITE_MEMORY_BARRIER(3I) .................................................................... write_memory_barrier(3I) .......................... 365
write_memory_barrier(3I) .................................................................... write_memory_barrier(3I) .......................... 365
_write_memory_barrier(3I) ................................................................. write_memory_barrier(3I) .......................... 365
writeSB(3I) .................................................................................................. readSB(3I) ........................................................... 276
writesb(3I) .................................................................................................. readSB(3I) ........................................................... 276
_writeSB(3I) ................................................................................................ readSB(3I) ........................................................... 276
writeST(3I) .................................................................................................. readSB(3I) ........................................................... 276
writest(3I) .................................................................................................. readSB(3I) ........................................................... 276
_writeST(3I) ................................................................................................ readSB(3I) ........................................................... 276
_writest(3I) ................................................................................................ readSB(3I) ........................................................... 276
XOR(3I) ............................................................................................................ eqv(3I) .................................................................... 99
xor(3I) ............................................................................................................ eqv(3I) .................................................................... 99
xor_and_fetch(3I) .................................................................................... sync(3I) ............................................................... 337
XOR_AND_FETCH,(3I) .................................................................................. sync(3I) ............................................................... 337
Zero bits count ................................................................................................ leadz(3I) ............................................................. 183
Zero fill on right shift ..................................................................................... shiftr(3I) ........................................................... 318
Zero fill shift ................................................................................................... shiftl(3I) ........................................................... 316

004– 2138– 003 Index-45

You might also like