<div dir="ltr"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear Karin,</div><div><br></div><div>Thank you so much for your help!!</div><div><br></div><div>Sincerely,</div><div>Lyndz</div></div></div></div></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 16, 2020 at 2:04 AM Karin Meier-Fleischer <<a href="mailto:meier-fleischer@dkrz.de">meier-fleischer@dkrz.de</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 Lyndz,<br>
<br>
in your case I think you can't use the  shapefile_mask_data function <br>
because you want to select an element of the variable Type. By the way <br>
the shapefile is not correct because ID is to written properly.<br>
<br>
I've attached the NCL script to compute the average of the polygon for <br>
Type equal 2.000. For your data there is only one value inside the <br>
shapefile polygon.<br>
<br>
-Karin<br>
<br>
<br>
Am 14.04.20 um 14:22 schrieb Lyndz:<br>
> Hi Karin,<br>
> <br>
> Thank you for the response.<br>
> <br>
> The attached file is the input NetCDF file.<br>
> <br>
> Sincerely,<br>
> Lyndz<br>
> <br>
> On Tue, Apr 14, 2020 at 8:11 PM Karin Meier-Fleischer <br>
> <<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a> <mailto:<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>>> wrote:<br>
> <br>
>     Hi Lyndz,<br>
> <br>
>     excuse me for the late reply. Without the data file<br>
>     <a href="http://ymonmean_temp_1979-2018.nc" rel="noreferrer" target="_blank">ymonmean_temp_1979-2018.nc</a> <<a href="http://ymonmean_temp_1979-2018.nc" rel="noreferrer" target="_blank">http://ymonmean_temp_1979-2018.nc</a>> it is<br>
>     not possible to help.<br>
> <br>
>     Sorry,<br>
>     Karin<br>
> <br>
>     Am 04.04.20 um 13:51 schrieb Lyndz:<br>
>      > Dear NCL-experts,<br>
>      ><br>
>      > *[Description of the Problem]*<br>
>      ><br>
>      > I would like to get the area average of temperature (netcdf file)<br>
>     based<br>
>      > on a shapefile mask.<br>
>      ><br>
>      > The attached file contains a shapefile of climate types.<br>
>      > I want to get the area average based on Climate type 2.<br>
>      > I want to do this per time step and save the output file to a<br>
>     text file.<br>
>      ><br>
>      ><br>
>      > *[What I have so far]*<br>
>      ><br>
>      > I have a script that plots the shapefile. However, I dont know<br>
>     how I can<br>
>      > get the area average of climate type 2 only.<br>
>      ><br>
>      ><br>
>      > *[Error]*<br>
>      > I get the following error using the attached script:<br>
>      ><br>
>      > (0)gsn_csm_contour_map_other: Fatal: the input data array must be<br>
>     1D or 2D<br>
>      ><br>
>      > fatal:Illegal right-hand side type for assignment<br>
>      ><br>
>      > fatal:["Execute.c":8637]:Execute: Error occurred at or near line<br>
>     65 in<br>
>      > file mask_rainfall.ncl<br>
>      ><br>
>      ><br>
>      ><br>
>      > I'll appreciate any help on how I can do this correctly in NCL.<br>
>      ><br>
>      > Sincerely,<br>
>      > Lyndz<br>
> <br>
<br>
-- <br>
Dipl. Geophys. Karin Meier-Fleischer<br>
Visualization Group - NCL, CDO, Python<br>
Application Support<br>
<br>
Deutsches Klimarechenzentrum GmbH (DKRZ)<br>
Bundesstrasse 45a - D20146 Hamburg - Germany<br>
<br>
Phone:    +49 (0)40 460094 126<br>
Fax:      +49 (0)40 460094 270<br>
E-Mail:   <a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a><br>
URL:      <a href="http://www.dkrz.de" rel="noreferrer" target="_blank">www.dkrz.de</a><br>
<br>
Geschäftsführer: Prof. Dr. Thomas Ludwig<br>
Sitz der Gesellschaft: Hamburg<br>
Amtsgericht Hamburg HRB 39784<br>
</blockquote></div>