<div dir="ltr"><div class="gmail_default" style="font-size:small">Hello:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I have the following arrays:</div><div class="gmail_default" style="font-size:small"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Courier;font-size:13px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Courier;font-size:13px">Variable: diag</span><br></div><div class="gmail_default" style="font-size:small">
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Type: float</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Total Size: 1297613240 bytes</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>324403310 values</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 2</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>[nCells | 5898242] x [nVertLevels | 55]</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Coordinates:<span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 3</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>_FillValue :<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>9.96921e+36</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>long_name :<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>Ice-friendly aerosol number concentration</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>units :<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>nb kg^{-1}</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font:13px Courier;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Variable: k2</span></p><p class="gmail-p1" style="margin:0px;font:13px Courier;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Type: integer</span></p><p class="gmail-p1" style="margin:0px;font:13px Courier;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Total Size: 23592968 bytes</span></p><p class="gmail-p1" style="margin:0px;font:13px Courier;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-converted-space"> </span>5898242 values</span></p><p class="gmail-p1" style="margin:0px;font:13px Courier;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 1</span></p><p class="gmail-p1" style="margin:0px;font:13px Courier;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>[nCells | 5898242]</span></p><p class="gmail-p1" style="margin:0px;font:13px Courier;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Coordinates:<span class="gmail-Apple-converted-space"> </span></span></p><p class="gmail-p1" style="margin:0px;font:13px Courier;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 1</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">
</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>_FillValue :<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>0</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">where nCells is the horizontal dimension and nVertLevels is the number of vertical levels. you can think of k2 as the index for the base of a convective cloud with a missing value set to zero. I would like to build an array nifa which contains the value of diag at k2, such that:</span><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">nifa(iCell) = diag(:,k2(iCell)) for iCell varying between 0 and nCells-1.</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">I tried to use the function "where" but this did not work. I get the following:</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)">
</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">nifa = where(k2.ne.k2@_FillValue,diag(:,k2),diag@_FillValue)</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font:13px Courier;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">fatal:NclMalloc Failed:[errno=12]</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)">
</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Segmentation fault (core dumped)</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">I am not sure why this is not working. I also tried the ismissing function but this did not work either. Any suggestions?</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Thanks,</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Laura</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">!-------------------------------------------------------------------------------------------------------------</font><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">Laura D. Fowler </font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">Mesoscale and Microscale Meteorology Division (MMM) </font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">National Center for Atmospheric Research<br></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">P.O. Box 3000, Boulder CO 80307-3000</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">e-mail: <a href="mailto:laura@ucar.edu" target="_blank">laura@ucar.edu</a></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">phone: 303-497-1628</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">!-------------------------------------------------------------------------------------------------------------</font><br></div></div></div></div>