<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class="">Hi Dennis,</div>
<div class=""><br class="">
</div>
Ah that’s great. I’ll test those out.
<div class="">I also have found out that cdo has a command that will calculate the area of grid cells.</div>
<div class="">cdo gridarea infile outfile</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">-Jonathan</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Apr 21, 2021, at 10:34 PM, Dennis Shea <<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">Hi Jonathan,</div>
<div class=""><br class="">
</div>
<div class="">It was called to my attention that there are some <b class="">undocumented</b> 'area_' functions in shea_util.ncl.
<br class="">
</div>
<div class="">I am not sure if any of these would be what you want.<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">%> less "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"</div>
<div class=""><br class="">
</div>
<div class="">Search for: <br class="">
</div>
<div class=""><b class="">area_global_rectilinear_grid</b></div>
<div class=""><b class="">area_polar_region</b></div>
<div class=""><b class="">area_earth_region</b></div>
<div class=""><b class=""><br class="">
</b></div>
<div class="">I guess I was too lazy to document them! <b class=""><br class="">
</b></div>
<div class="">The<b class=""> shea_util.ncl </b>library is automatically loaded.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<b class=""></b></div>
<div class=""> <br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
<br class="">
<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" class="">jbuzan@purdue.edu</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">Thanks Dennis, I’ll work this out.
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">-Jonathan</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Apr 21, 2021, at 5:21 PM, Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank" class="">shea@ucar.edu</a>> wrote:</div>
<br class="">
<div class="">
<div dir="ltr" class="">
<div class="">I don't think there is a function but for rectilinear grids (ie: lat[*], lon[*] )<br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><b id="gmail-m_1533494442639267383gmail-m_4720138370737935015gmail-m_-1196554217107131009gmail-m_7385995958215111083gmail-yui_3_10_0_1_1619017610545_110" class="">cell_area</b>= (pi/180)*R^2* ((sind(lat(i)*rad) - sind(lat(j)*rad))*dlon);
<b class="">dlon in radians</b></div>
<div class=""><br class="">
</div>
<div class="">R: radius of earth: rearth = 6371.220 ; default; kilometers; ECMWF uses this value</div>
<div class=""><br class="">
</div>
<div class="">see: <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/get_d2r.shtml" target="_blank" class="">
<b class="">get_d2r</b></a>, <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/get_pi.shtml" target="_blank" class="">
<b class="">get_pi</b></a></div>
<div class=""><br class="">
</div>
<div class="">EG:<br class="">
</div>
<div class="">
<pre class=""><b class="">rad = 0.0174532925199433 (double)<br class="">rad = <b class="">0.01745329 (float)<br class=""><br class=""></b></b></pre>
<pre class="">For 2D lat/lon<b class=""><b class="">, </b></b>it would be a bit more tedious<b class=""><b class=""><br class=""><br class=""><br class=""></b></b></pre>
<pre class=""><b class=""><b class=""><br class=""></b></b></pre>
<pre class=""><b class=""><b class=""><br class=""></b></b></pre>
</div>
</div>
<br class="">
<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" class="">ncl-talk@mailman.ucar.edu</a>> wrote:<br class="">
</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 class="">
<br class="">
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 class="">
<br class="">
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 class="">
<br class="">
Is there one?<br class="">
<br class="">
Cheers,<br class="">
-Jonathan<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank" class="">ncl-talk@mailman.ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>