Test+Problem+Data+Reading

=Reading the Test Problem Data Files= Pages: Workshop, Overview, CADAC, Data Access, Work Area Setup, Path Setup, Utilities, Grid Data, SPH Data, Running, Reporting, LOG

Reading with IDL
Here is a code snippet for reading the **data/hd256.dat** grid data file (note that binary files on **datastar** are "big-endian" -- IDL can handle this transparently using the /swap_if_little_endian OPENR option): code openr,1,'data/hd265.dat',/swap_if_little_endian       ; direct access binary file (big-endian) m=256                                                 ; unigrid dimensions rho=fltarr(m,m,m) ux=fltarr(m,m,m) uy=fltarr(m,m,m) uz=fltarr(m,m,m) readu,1,rho                       ; mass density readu,1,ux                        ; x-velocity, etc. readu,1,uy readu,1,uz close,1

code and here is one for reading the **data/1e6.sph** SPH data file: code openr,1,'data/1e6.sph',/f77,/swap_if_little_endian     ; sequential access Fortran file (big-endian) np=0L & wp=0. & sx=0. & sy=0. & sz=0. readu,1,np,wp                                          ; number of points, weight factor readu,1,sx,sy,sz                                       ; box size (1x1x1) x =fltarr(np) & y =fltarr(np) & z =fltarr(np) vx=fltarr(np) & vy=fltarr(np) & vz=fltarr(np) readu,1,x & readu,1,y  & readu,1,z                     ; particle positions readu,1,vx & readu,1,vy & readu,1,vz                   ; particle velocities close,1 code IDL procedures related to the initial value data files are available in the **idl/** subdirectory of the utility source code. To access this directory on **datastar** do code cd /gpfs-wan/projects/cadac/software/contrib/aake/codes/KITPcompare07/idl ls -l code