<div dir="ltr">Hi there,<div>I am trying to write out some MODIS09A1 variables (QA flags) to netcdf4 (not the classic model). The QA flag and SQA flag are in uint and ushort format respectively. I am using NCLv6.2.1. I&#39;ve correctly set my file option to NetCDF4 prior to creating the ncdf file.</div><div>The problem is, in its native hdf format and when I read it in to ncl I get the following:</div><div><div><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>;;;;;;;;;;;;;;;;;;;;; QAFLAG ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div></div><div><div>Variable: QAFLAG</div></div><div><div>Type: uint</div></div><div><div>Total Size: 645120000 bytes</div></div><div><div>            161280000 values</div></div><div><div>Number of Dimensions: 2</div></div><div><div>Dimensions and sizes:<span class="" style="white-space:pre">        </span>[YDim_MOD_Grid_500m_Surface_Reflectance | 9600] x [XDim_MOD_Grid_500m_Surface_Reflectance | 16800]</div></div><div><div>Coordinates: </div></div><div><div>Number Of Attributes: 7</div></div><div><div>  _FillValue :<span class="" style="white-space:pre">        </span>4294967295</div></div><div><div>  long_name :<span class="" style="white-space:pre">        </span>Surface_reflectance_500m_quality_control_flags</div></div><div><div>  units :<span class="" style="white-space:pre">        </span>bit field</div></div><div><div>  valid_range :<span class="" style="white-space:pre">        </span>( 0, 4294966531 )</div></div><div><br></div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;; SQAFLAG ;;;;;;;;;;;;;;;;;;;;;;;</div><div><div>Variable: SQAFLAG</div></div><div><div>Type: ushort</div></div><div><div>Total Size: 322560000 bytes</div></div><div><div>            161280000 values</div></div><div><div>Number of Dimensions: 2</div></div><div><div>Dimensions and sizes:<span class="" style="white-space:pre">        </span>[YDim_MOD_Grid_500m_Surface_Reflectance | 9600] x [XDim_MOD_Grid_500m_Surface_Reflectance | 16800]</div></div><div><div>Coordinates: </div></div><div><div>Number Of Attributes: 7</div></div><div><div>  _FillValue :<span class="" style="white-space:pre">        </span>65535</div></div><div><div>  long_name :<span class="" style="white-space:pre">        </span>Surface_reflectance_500m_state_flags</div></div><div><div>  units :<span class="" style="white-space:pre">        </span>bit field</div></div><div><div>  valid_range :<span class="" style="white-space:pre">        </span>( 0, 57343 )</div></div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div></blockquote><div><br></div><div>But, when I write out these variables to netcdf4 and then view them using ncl_filedump, they are output as QAFLAG as float (and I don&#39;t specify this anywhere) and SQAFLAG as something else (doesn&#39;t look like float?):</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>;;;;;;;;;;;;;;;;;;;;; QAFLAG ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div><div>    Variable: QAFLAG</div></div><div><div>    Type: uint</div></div><div><div>    Total Size: 161280000 values</div></div><div><div>                645120000 bytes</div></div><div><div>    Number of Dimensions: 2</div></div><div><div>    Dimensions and sizes:<span class="" style="white-space:pre">        </span>[ 9600 &lt;YDim&gt; x 16800 &lt;XDim&gt; ]</div></div><div><div>    Coordinates:</div></div><div><div>        Number of Attributes:        8</div></div><div><div>            missing_value<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span>-1</div></div><div><div>            _FillValue<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span>-1</div></div><div><div>            long_name<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span>sur_refl_qc_500m</div></div><div><div>            units<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span>bit field</div></div><div><div>            valid_range<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span>( 0, -765 )</div></div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;; SQAFLAG ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div><div>Variable: SQAFLAG</div></div><div><div>    Type: ushort</div></div><div><div>    Total Size: 161280000 values</div></div><div><div>                322560000 bytes</div></div><div><div>    Number of Dimensions: 2</div></div><div><div>    Dimensions and sizes:<span class="" style="white-space:pre">        </span>[ 9600 &lt;YDim&gt; x 16800 &lt;XDim&gt; ]</div></div><div><div>    Coordinates:</div></div><div><div>        Number of Attributes:        8</div></div><div><div>            missing_value<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span></div></div><div><div>            _FillValue<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span></div></div><div><div>            long_name<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span>sur_refl_state_500m</div></div><div><div>            units<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span>bit field</div></div><div><div>            valid_range<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span>( 0, -8193 )</div></div><div><div>            QA_bitmap_index<span class="" style="white-space:pre">        </span>: <span class="" style="white-space:pre">        </span></div></div></blockquote><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div><br></div></blockquote>However, when I read these converted .nc files *back* into NCL, it&#39;s all fine ... and looks like the output from the native hdf file. Could you explain why this is happening? Does it have something to do with the data compression? I just want to make sure it is not impacting the contents of the variables.</div><div><br></div><div>(On a side note, the reason I am going through all this is I am eventually reading these objects into R to QC filter my MODIS reflectance data. Is there pre-existing NCL code that allows for application of QC criteria within ncl? It might be faster and would avoid all this ... )</div><div><br></div><div>Thanks for any help! </div><div><br></div><div>Regards,</div><div>Archana</div><div><br></div></div>