source: trunk/SRC/ToBeReviewed/LECTURE/GRIB/scan_grib_nbits.pro @ 114

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

  • Property svn:executable set to *
File size: 970 bytes
Line 
1FUNCTION scan_grib_nbits, num, recstart
2;
3  compile_opt idl2, strictarrsubs
4;
5
6;
7  nrec =  n_elements(recstart)
8  nbits = bytarr(nrec)
9;
10  FOR i = 0L, nrec-1 DO BEGIN
11    offset = recstart[i]+8
12    a = assoc(num, bytarr(1, /nozero), offset-1)
13    sizepds = bit2int([binary(a[1]), binary(a[2]), binary(a[3])])
14    flag = binary(a[8])
15    gdsnotomitted = flag[0]
16    bmsnotomitted = flag[1]
17    ddd =  bit2int([binary(a[27]), binary(a[28])], /checkneg)
18;
19    offset = offset+sizepds
20;
21    IF gdsnotomitted THEN BEGIN
22      a = assoc(num, bytarr(1, /nozero), offset-1)
23      sizedds = bit2int([binary(a[1]), binary(a[2]), binary(a[3])])
24      offset = offset+sizedds
25    ENDIF
26;
27    IF bmsnotomitted THEN BEGIN
28      a = assoc(num, bytarr(1, /nozero), offset-1)
29      sizebms = bit2int([binary(a[1]), binary(a[2]), binary(a[3])])
30      offset = offset+sizebms
31    ENDIF
32
33    a = assoc(num, bytarr(1, /nozero), offset-1)
34    nbits[i] = a[11]
35
36  ENDFOR
37;
38  RETURN, nbits
39END
Note: See TracBrowser for help on using the repository browser.