<div dir="ltr">I have a netCDF file, <a href="http://soil_m.nc">soil_m.nc</a>, that contains only integer variables with scale_factor and add_offset, for example, SOIL_M looks like this:<div><br></div><div>




<span></span>





<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>int SOIL_M(time, y, soil_layers_stag, x) ;</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre">  </span><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>SOIL_M:_FillValue = -999900 ;</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre">  </span><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>SOIL_M:missing_value = -999900 ;</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre">  </span><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>SOIL_M:long_name = "volumetric soil moisture" ;</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre">  </span><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>SOIL_M:units = "m3 m-3" ;</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre">  </span><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>SOIL_M:scale_factor = 0.01f ;</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre">  </span><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>SOIL_M:add_offset = 0.f ;</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre">  </span><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>SOIL_M:valid_range = 0, 100 ;</span></p>


<br></div><div>After I opened the data file by issuing "fin=addfile("<a href="http://soil_m.nc">soil_m.nc</a>","r")" in ncl and then I did "data1=fin->SOIL_M", "data2=tofloat(fin->SOIL_M)", and "data3=int2flt(fin->SOIL_M)" but in all cases the data range from 0 to 100 instead of 0 to 1 or 0.0 to 1.0. I am just wondering if there is a way that NCL can automatically read in an integer variable with the scale_factor and add_offset applied.</div><div><br></div><div>Thanks,</div><div>Yongxin</div></div>