home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / cray / 313 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  3.6 KB

  1. Xref: sparky comp.unix.cray:313 comp.sys.misc:974 comp.sys.sgi:16582
  2. Newsgroups: comp.unix.cray,comp.sys.misc,comp.sys.sgi
  3. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!ugle.unit.no!termo.unit.no!bgitv
  4. From: bgitv@termo.unit.no (Baard Grimsmo)
  5. Subject: Re: Cray to IEEE, IEEE to Cray
  6. Message-ID: <1992Nov18.080656.21529@ugle.unit.no>
  7. Keywords: ieee unformatted Cray SGI Sun
  8. Sender: news@ugle.unit.no (NetNews Administrator)
  9. Organization: SINTEF, The Norwegian Institute of Technology
  10. References: <haberman.722017708@msi.umn.edu> <1992Nov17.233222.26999@draco.macsch.com>
  11. Date: Wed, 18 Nov 92 08:06:56 GMT
  12. Lines: 74
  13.  
  14. In article <1992Nov17.233222.26999@draco.macsch.com> dnl@convex.is.macsch.com (David Lombard) writes:
  15. >In article <haberman.722017708@msi.umn.edu> haberman@s23.msi.umn.edu (Joe Habermann) writes:
  16. >>Is there a tool for converting a file containing unformatted 64-bit 
  17. >>Cray floating point numbers into 32-bit IEEE floats and vice versa?
  18. >>
  19. >>I see that Unicos has a few routines for doing this (IEG2CRAY and
  20. >>CRAY2IEG) but I want the code so that I can compile it for various 
  21. >>machines.   
  22. >
  23. >The intent is that the Cray handles the conversions to/from other
  24. >numerical/character formats.  If you're programming in Fortran, you
  25. >can do the conversions on-the-fly using normal READ and WRITE statements,
  26. >see (man assign).
  27. >
  28. >Regards,
  29. >DNL
  30.  
  31. You could also consult "man asgcmd"
  32.  
  33. Here is the text I have written in my print-file:
  34. c +++ When runned on the Cray, the asgcmd command allows the user to
  35. c +++ assign necessary file characteristics to the given output file.
  36. c +++
  37. c +++ The asgcmd command can be invoked from a shell using a function or
  38. c +++ an alias.  asgcmd looks at the environment variable SHELL to determine
  39. c +++ which format environment syntax to use.  A function for sh(1), ksh(1)
  40. c +++ or bash would be:
  41. c +++
  42. c +++      % function asg { eval `/usr/bin/asgcmd $*` }
  43. c +++
  44. c +++ An alias for csh(1) would be:
  45. c +++
  46. c +++      % alias asg 'eval `/usr/bin/asgcmd \!*`'
  47. c +++
  48. c +++ hese can be placed in your .cshrc or .profile for command line use.
  49. c +++ Bourne/Korn shell scripts using the asg definition will have to
  50. c +++ include the definition.
  51. c +++
  52. c +++ Example:
  53. c +++      % cat prog.f
  54. c +++      program prog
  55. c +++      open(9,file='result/out.dat',form='unformatted')
  56. c +++      n=1
  57. c +++      to=2.
  58. c +++      write(9) n,to
  59. c +++      end
  60. c +++      % cf77 -o prog prog.f
  61. c +++      % asg -F f77.nonvax -N ieee result/out.dat
  62. c +++      % prog
  63. c +++      % rcp reult/out.dat unixworkstation:out.dat
  64. c +++
  65. c +++ The out.dat file can now be processed normally on an unix
  66. c +++ workstation by an unformatted read.
  67. c +++
  68. c +++ NOTE: The descriptions of the output file must be identical for
  69. c +++ the program and the asgcmd command.
  70. c +++ 
  71. c +++ Example:
  72. c +++      open(9,file='result/out.dat',form='unformatted')
  73. c +++      % asg -F f77.nonvax -N ieee /usr/users/me/result/out.dat << wrong
  74. c +++      % asg -F f77.nonvax -N ieee ./result/out.dat             << wrong
  75. c +++      % asg -F f77.nonvax -N ieee result/out.dat               << correct
  76. c +++
  77. c +++ The shell variable of the example:
  78. c +++   _ASG_FCHAR=result/ut.dat##-C 0105000000000000 -F 0904000000000000+ %
  79. c +++ This variable is lost after logging out.
  80. c +++
  81.  
  82.  
  83. -- 
  84. Bard Grimsmo     |Mail: SINTEF/Varmeteknikk         |Home: Schives Gate 7
  85. Dr.Ing           |      7034 Trondheim, Norway      |      N-7030 Trondheim
  86. Research Engineer|Phone: +47 7 592505               |      Norway
  87. SINTEF Division  |Fax:   +47 7 944513               |Home phone: +47 7 523801
  88.