comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problem with structures getting padded to multiples of 4-bytes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Problem with structures getting padded to multiples of 4-bytes [message #1726] Tue, 22 February 1994 08:24
zawodny is currently offline  zawodny
Messages: 121
Registered: August 1992
Senior Member
Howdy All,

I've come a cross something a bit odd with large structures. I'm
running IDL Version 3.5.1 (OSF alpha) on a DECStation 3000 Model 400 AXP.
I've used a lot of small structures that are a non-integer number of (4-byte)
words in length with little problem, however, the following structure
should be 2618 bytes in length but comes up 2620. When written to a file,
the record is indeed 2620 bytes long and the last two (extra) bytes appear to
be padded with zero's. Is this a known problem and are there work arounds for
it? Rumor has it that this does not happen on a SUN SPARC-10 running whatever
they run for an OS this week.

Thanks,

The structure:

;
; Make some temporary arrays
tmpf4 = fltarr(4)
tmpf8 = fltarr(8)
tmpf25 = fltarr(25)
tmpf70 = fltarr(70)
impf70 = intarr(70)

; Define the structure
ozn = {OZN_STR, $
; Field Type
DATE: 0., $
TIME: 0., $
LAT: 0., $
LON: 0., $
TYPE_INST: 0., $
TYPE_LOCAL: 0., $
BETA: 0., $
TIMEOFYR: 0., $
NMCTEMP: tmpf25, $
NMCTERR: tmpf25, $
NMCALT: tmpf25, $
NMCDEN: tmpf25, $
NMCDERR: tmpf25, $
METCOR: tmpf4, $
MET_POINTER: 0., $
MET_CODE: 0., $
MET_REV_DATE: 0., $
PROC_LEVEL: 0., $
PROC_DATE: 0., $
PROC_TIME: 0., $
MEANSBTALT: 0., $
MIRROR_CAL: 0., $
QUALF600: 0., $
FILLVAL: 0., $
SBTNLAT: tmpf8, $
SBTNLON: tmpf8, $
TIMESPAN: 0., $
GEOALT: tmpf70, $
PRESS: tmpf70, $
TEMP: tmpf70, $
O3ND: tmpf70, $
O3MR: tmpf70, $
O3NDE: impf70, $
O3MRE: impf70, $
ND_QUAL_FLAG: impf70, $
MR_QUAL_FLAG: impf70, $
INT_FILL: 0 }


Doing a help,/str,ozn yields:

** Structure OZN_STR, 37 tags, length=2620:
DATE FLOAT 0.00000
TIME FLOAT 0.00000
LAT FLOAT 0.00000
LON FLOAT 0.00000
TYPE_INST FLOAT 0.00000
TYPE_LOCAL FLOAT 0.00000
BETA FLOAT 0.00000
TIMEOFYR FLOAT 0.00000
NMCTEMP FLOAT Array(25)
NMCTERR FLOAT Array(25)
NMCALT FLOAT Array(25)
NMCDEN FLOAT Array(25)
NMCDERR FLOAT Array(25)
METCOR FLOAT Array(4)
MET_POINTER FLOAT 0.00000
MET_CODE FLOAT 0.00000
MET_REV_DATE FLOAT 0.00000
PROC_LEVEL FLOAT 0.00000
PROC_DATE FLOAT 0.00000
PROC_TIME FLOAT 0.00000
MEANSBTALT FLOAT 0.00000
MIRROR_CAL FLOAT 0.00000
QUALF600 FLOAT 0.00000
FILLVAL FLOAT 0.00000
SBTNLAT FLOAT Array(8)
SBTNLON FLOAT Array(8)
TIMESPAN FLOAT 0.00000
GEOALT FLOAT Array(70)
PRESS FLOAT Array(70)
TEMP FLOAT Array(70)
O3ND FLOAT Array(70)
O3MR FLOAT Array(70)
O3NDE INT Array(70)
O3MRE INT Array(70)
ND_QUAL_FLAG INT Array(70)
MR_QUAL_FLAG INT Array(70)
INT_FILL INT 0



--
Joseph M. Zawodny (KO4LW) NASA Langley Research Center
Internet: zawodny@arbd0.larc.nasa.gov MS-475, Hampton VA, 23681-0001
Packet: ko4lw@n4hog.va.usa
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: changing cursor, general GUI questions
Next Topic: Re: Problem with structures getting padded to multiples of 4-bytes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:33:43 PDT 2025

Total time taken to generate the page: 0.00500 seconds