Changeset 27


Ignore:
Timestamp:
11/29/07 12:04:29 (16 years ago)
Author:
kolasinski
Message:

Conform to SAXO new version - Structures varcontient and contient do not exist anymore in read_ncdf_varget

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/procs/nc_read.pro

    r10 r27  
    8181; pour verifier si il y a une variable je fais 
    8282 
    83 ; contient=ncdf_inquire(cdfid) 
    84 ; for varid=0,contient.nvars-1 do BEGIN 
    85 ;    varcontient=ncdf_varinq(cdfid,varid)  
    86 ;    if varcontient.name eq nom then goto, variabletrouvee 
     83; inq=ncdf_inquire(cdfid) 
     84; for varid=0,inq.nvars-1 do BEGIN 
     85;    varinq=ncdf_varinq(cdfid,varid)  
     86;    if varinq.name eq nom then goto, variabletrouvee 
    8787; endfor 
    8888; return, -1 
     
    109109; ouverture fichier netCDF + contenu 
    110110   cdfid=ncdf_open(directory+file_name)  
    111    contient=ncdf_inquire(cdfid) 
     111   inq=ncdf_inquire(cdfid) 
    112112; que contient la variable 
    113113   varid = ncdf_varid(cdfid, var_name) 
     
    123123      return,  field 
    124124   ENDIF  
    125    varcontient=ncdf_varinq(cdfid, var_name) 
     125   varinq=ncdf_varinq(cdfid, var_name) 
    126126 
    127127; test sur la dimension 
    128128   err_mess = '' 
    129    field_dim = n_elements(varcontient.dim) 
     129   field_dim = n_elements(varinq.dim) 
    130130 
    131131; get unlimited record variable 
    132    IF contient.recdim NE -1 THEN BEGIN 
    133       ncdf_diminq, cdfid,  contient.recdim,  name_time, nb_time 
    134       ;;ncdf_varget, cdfid, contient.recdim, time_array 
     132   IF inq.recdim NE -1 THEN BEGIN 
     133      ncdf_diminq, cdfid,  inq.recdim,  name_time, nb_time 
     134      ;;ncdf_varget, cdfid, inq.recdim, time_array 
    135135      ;;nb_time = (size(time_array))(1) 
    136136   ENDIF ELSE BEGIN 
     
    151151         ncdf_diminq, cdfid,  dimidt,  name_time, nb_time 
    152152         print, 'You chose ', name_time,  ' as a record dimension and its size is ',  nb_time 
    153          contient.recdim = dimidt 
     153         inq.recdim = dimidt 
    154154      ENDIF ELSE BEGIN 
    155155         print, 'No record dimension considered in the file' 
     
    157157      ENDELSE 
    158158 
    159       IF varcontient.dim[varcontient.ndims-1] NE dimidt THEN STOP,  $ 
     159      IF varinq.dim[varinq.ndims-1] NE dimidt THEN STOP,  $ 
    160160       'Post_it cannot handle variables whose record dimension is not the last one' 
    161161 
    162 ;      ncdf_diminq,cdfid,(n_elements(varcontient.dim)-1), name_time, nb_time      
     162;      ncdf_diminq,cdfid,(n_elements(varinq.dim)-1), name_time, nb_time      
    163163;      dimidl = ncdf_dimid(cdfid, name_time) 
    164164;      ncdf_diminq,cdfid,dimidl, name_time, nb_time 
     
    202202   IF debug_w THEN print, 'key_yreverse, firsty, lasty',key_yreverse, firsty, lasty 
    203203 
    204    CASE n_elements(varcontient.dim) OF 
     204   CASE n_elements(varinq.dim) OF 
    205205 
    206206      ;; fichier 2d : surface 
     
    215215      ;; fichier 3d : 2 cas = 1/ 2d espace + temps 2/ 3d espace 
    216216      3: BEGIN  
    217          ;; si varcontient.dim contient la dim infinie (no 3) -> temps 
     217         ;; si varinq.dim contient la dim infinie (no 3) -> temps 
    218218         dim_3 = '3d' 
    219219         IF nb_time GE 1 THEN dim_3 = '2d' 
     
    495495 
    496496; scaling ? 
    497    FOR i = 0, varcontient.natts-1 DO BEGIN 
     497   FOR i = 0, varinq.natts-1 DO BEGIN 
    498498      att_txt = ncdf_attname(cdfid, varid, i) 
    499499      IF att_txt EQ 'scale_factor' THEN BEGIN 
     
    511511; get long name  
    512512;   result = '???' 
    513    FOR i = 0, varcontient.natts-1 DO BEGIN 
     513   FOR i = 0, varinq.natts-1 DO BEGIN 
    514514      att_txt = ncdf_attname(cdfid, varid, i) 
    515515      IF att_txt EQ 'long_name' OR att_txt EQ 'title' THEN ncdf_attget, cdfid, varid, att_txt, result 
     
    533533 
    534534   valmask = 1.e20 
    535    FOR i = 0, varcontient.natts-1 DO BEGIN 
     535   FOR i = 0, varinq.natts-1 DO BEGIN 
    536536      att_txt = ncdf_attname(cdfid, varid, i) 
    537537      IF att_txt EQ 'missing_value' OR att_txt EQ 'mask value' OR att_txt EQ '_FillValue' THEN ncdf_attget, cdfid, varid, att_txt, valmask 
Note: See TracChangeset for help on using the changeset viewer.