<div dir="ltr"><div>Hi Jonathan,</div><div><br></div><div>It was called to my attention that there are some <b>undocumented</b> 'area_' functions in shea_util.ncl. <br></div><div>I am not sure if any of these would be what you want.<br></div><div><br></div><div>%> less "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"</div><div><br></div><div>Search for: <br></div><div><b>area_global_rectilinear_grid</b></div><div><b>area_polar_region</b></div><div><b>area_earth_region</b></div><div><b><br></b></div><div>I guess I was too lazy to document them! <b><br></b></div><div>The<b> shea_util.ncl </b>library is automatically loaded.</div><div><br></div><div><br><b></b></div><div> <br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 21, 2021 at 9:49 AM Buzan, Jonathan <<a href="mailto:jbuzan@purdue.edu" target="_blank">jbuzan@purdue.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
Thanks Dennis, I’ll work this out.
<div><br>
</div>
<div>Cheers,</div>
<div>-Jonathan</div>
<div><br>
</div>
<div><br>
<div><br>
<blockquote type="cite">
<div>On Apr 21, 2021, at 5:21 PM, Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:</div>
<br>
<div>
<div dir="ltr">
<div>I don't think there is a function but for rectilinear grids (ie: lat[*], lon[*] )<br>
</div>
<div><br>
</div>
<div><b id="gmail-m_1533494442639267383gmail-m_4720138370737935015gmail-m_-1196554217107131009gmail-m_7385995958215111083gmail-yui_3_10_0_1_1619017610545_110">cell_area</b>= (pi/180)*R^2* ((sind(lat(i)*rad) - sind(lat(j)*rad))*dlon);
<b>dlon in radians</b></div>
<div><br>
</div>
<div>R: radius of earth: rearth = 6371.220 ; default; kilometers; ECMWF uses this value</div>
<div><br>
</div>
<div>see: <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/get_d2r.shtml" target="_blank">
<b>get_d2r</b></a>, <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/get_pi.shtml" target="_blank">
<b>get_pi</b></a></div>
<div><br>
</div>
<div>EG:<br>
</div>
<div>
<pre><b>rad = 0.0174532925199433 (double)<br>rad = <b>0.01745329 (float)<br><br></b></b></pre>
<pre>For 2D lat/lon<b><b>, </b></b>it would be a bit more tedious<b><b><br><br><br></b></b></pre>
<pre><b><b><br></b></b></pre>
<pre><b><b><br></b></b></pre>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Apr 21, 2021 at 8:27 AM Buzan, Jonathan via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi NCL-Talk,<br>
<br>
I am working with SSP files. They are incomplete 1km x 1km lat-lon grids (aka the omit high latitudes), with missing/fill values over oceans. The population data is absolutes, not density per area. All of this makes it hard to interpolate to a low resolution
grid approximate to CMIP data (aka 100 km x 100 km). <br>
<br>
I was thinking that I would divide each grid cell by the area to get a density value, then interpolate that to 1°x1° grid. But, I am having trouble finding a NCL function that will calculate the area of a grid cell.<br>
<br>
Is there one?<br>
<br>
Cheers,<br>
-Jonathan<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote></div>