3 A utility that converts unformatted binary real data files
4 to unformatted binary double precision data files.
8 cc -o four2eight four2eight.c
10 If you are running this on a little-endian platform
11 compile with -DSWAP like so:
13 cc -o four2eight -DSWAP four2eight.c
17 four2eight < RRTM_DATA > RRTM_DATA_DBL (for example)
35 fread( &in
, 1, 4, stdin
) > 0 ) {
39 fprintf(stderr
, "%d > %d\n",cr
,cr1
) ;
41 fwrite( &cr
, 1, 4, stdout
) ;
42 for ( i
= 0 ; i
< n
; i
+= 4 )
44 fread ( &x
, 1, 4, stdin
) ;
48 fwrite ( &y
, 1, 8, stdout
) ;
50 fread( &in
, 1, 4, stdin
) ;
51 fwrite( &cr
, 1, 4, stdout
) ;
53 fprintf(stderr
,"\n") ;