Subject: Trajectory files-2nd summary

From: Amir Gil <[email-masked]>
Date: Thu, 8 Feb 1996 11:40:55 +0200 (IST)

Hello netters!
Here is further knowledge I gained in the subject:
Tim Mitchel wrote:
ear Amir -- If Steve Lionel is correct (and I suspect he is) in saying that
the only difference between DEC Binary and SGI binary is the byte order, then
you should be able to swap the byte order with the IRIX utility dd.  I'm not
sure if DEC's have dd. If they don't it's not a problem -- just run it on the
SGI. The syntax should be something like:

dd if=DEC_binary.DCD of=SGI_binary.DCD conv=swab

If it will work, it is a lot easier than recompiling CHARMM or converting to
and from ASCII.  Please could you let me know if it does work, as I also run
CHARMm on both Alphas and SGIs.

Best Regards,  Tim Mitchell
[email-masked]
and Steve Lionel added:
Digital UNIX does have dd, but I am unsure that the swab conversion will do
what is desired, as it swaps pairs of bytes and not groups of 4 or 8 bytes.

It is straightforward on Digital UNIX using DEC Fortran to convert a file
>from big-endian to little-endian, or as I mentioned, just specify the
big_endian convert option to the compiler.
     STeve
[email-masked]
Don Gregory gave another info:
The current commercial version of CHARMm v23.2 has been compiled
on the DEC with the " -convert big_endian" flag, just to avoid this
problem.
I hope I'm right is thinking that Amir is actually referring to the use
of CHARMM v23.3 the current academic version (the update of
which we at MSI plan to provide commercially soon)!

Don Gregory
[email-masked]

Checking all this info on a simple standard CHARMm c23f3 version for 
alpha or SGI showed that Steve Lionel was right.The dd option works only 
with pairs of bytes so what you get is not the desired result.
for being more specific here is what you get after converting:
> od -x for040.datasgiconverted|head -3(head of the alpha file converted 
by :dd if=for040.dataalpha of=for040.datasgiconverted conv=swab):

0000000 0054 0000 4f43 4452 0032 0000 000a 0000
0000020 000a 0000 01f4 0000 0000 0000 0000 0000
0000040 0000 0000 0033 0000 0000 0000 90e2 3ca7
> od -x trajtest/for040.dat | head -3  (head of the SGI file)

0000000 0000 0054 434f 5244 0000 0032 0000 000a
0000020 0000 000a 0000 01f4 0000 0000 0000 0000
0000040 0000 0000 0000 0033 0000 0000 3ca7 90e2
> od -x for040.dataalpha | head -3(head of the alpha file)

0000000 5400 0000 434f 5244 3200 0000 0a00 0000
0000020 0a00 0000 f401 0000 0000 0000 0000 0000
0000040 0000 0000 3300 0000 0000 0000 e290 a73c

The version of CHARMm we are working with is the academic version c23f3.
So it seems that the two ways to do the job is by compiling with the right 
flags or converting it to text (using CHARMm utilities) and back to 
binary on the desired machine.
    Amir 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !  Amir Gil					   !
!  Chemical and Application engineer               !
!  Terra Computers				   !
!  Ashuah 6 st.					   !
!  Omer						   !
!  ISRAEL 84965					   !
!  Tel. 07-467502				   !
!  Fax. 07-467475				   !
!  E-Mail [email-masked]		   !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!