[MITgcm-support] Reading a binary vector
    Jody Klymak 
    jklymak at uvic.ca
       
    Wed Jul 18 13:34:26 EDT 2007
    
    
  
Hi all,
I need to read a binary vector into the GCM (vertical structure  
function for an internal wave).
The file is written in matlab as
fid=fopen('HorStruct.bin','w',ieee);
fwrite(fid,pmode,prec);
fclose(fid)
... where pmode is Nr long, and
pmode(1)=3.2553
Right now I am trying with MDSREADVECTOR....
       _RL horStructWst(Nr)
       CALL MDSREADVECTOR('HorStruct.bin',readBinaryPrec,'RS',
      &      Nr,horStructWst,1,1,1,myThid)
       WRITE(msgBuf,'(A34,1PE24.14)') 'BOOO =',horStructWst(1)
         CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
But this comes out with numbers that are gibberish.
(PID.TID 0000.0001)         BOOO =   3.51126016402432+283
Any hints as to what I am doing wrong, or a recipe for how to do this  
simply?
As a bonus, it would be nice to know the proper place to insert this  
so that it is read once and saved as a global.
Thanks,  Jody
--
Jody Klymak
http://web.uvic.ca/~jklymak/
    
    
More information about the MITgcm-support
mailing list