<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>That script looks pretty good.  You can see from the error messages that NCL is trying to understand @lat2d and @lon2d, but something is not quite right with them.  We need to see printVarSummary for tas, tas@lat2d, and tas@lon2d.  It is possible that dimensions are mismatched between data and coordinates, for some reason.</div><div><br></div><div>There is also this note in that doc page:  "If your data variable is a two-dimensional (2D) array ordered lon x lat, you will need to reorder it to be lat x lon."  Please check and see if this is the problem.<br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 25, 2021 at 10:00 AM S Br <<a href="mailto:sbr.climate@gmail.com">sbr.climate@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>Hi Dave,<div>Many thanks for your reply. Sorry I missed to provide the details.</div><div>I have run the following NCL script  and came across the errors given below. </div><div>You can see the attached plot that it draws value throughout the globe. It is supposed to be drawn only over the UK.</div><div>Am I doing something wrong?<br></div><div><br></div><div>;********</div><div>srcFileName="<a href="http://tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc" target="_blank">tas_rcp85_land-rcm_uk_12km_01_mon_198012-208011.nc</a>"<br><br>;---Read File<br>f=addfile(srcFileName,"r")<br>print(f)<br><br>;---Get the source lat/lon grid<br>tas=f->tas(0,0,:,:)<br>tas@lat2d=f->projection_y_coordinate<br>tas@lon2d=f->projection_x_coordinate<br><br>;---Plot data<br>  wks = gsn_open_wks("x11","map")<br><br>  res              = True<br>  res@gsnMaximize  = True     ; maximize plot in frame<br>  res@cnFillOn     = True     ; turn on contour fill<br>  res@cnLinesOn    = False    ; turn off contour fill<br>  res@gsnAddCyclic     = False<br>;   res@mpMinLatF    =  48.0             ; only plot 30S to 30N<br>;   res@mpMaxLatF    =  60.0<br>;  res@mpMinLonF    =  -15.0          ; only plot 30S to 30N<br>;   res@mpMaxLonF    = 6.0<br></div><div> res@mpDataBaseVersion = "MediumRes"<br>   res@mpLandFillColor = "white"<br><br>  plot = gsn_csm_contour_map(wks,tas(:,:),res)<br></div><div><br></div><div>********************</div><div>(0)  is_valid_latlon2d_attr: Warning: The 'lat2d' attribute must either be<br>(0)      the same dimension sizes as the data, or one element larger in both directions.<br>(0)    Your data will most likely not be overlaid on the map correctly.<br>(0)   check_for_y_lat_coord: Warning: Data either does not contain<br>(0)       a valid latitude coordinate array or doesn't contain one at all.<br>(0)       A valid latitude coordinate array should have a 'units'<br>(0)    attribute equal to one of the following values:<br>(0)        'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'<br>(0)       is_valid_latlon2d_attr: Warning: The 'lon2d' attribute must either be<br>(0)      the same dimension sizes as the data, or one element larger in both directions.<br>(0)    Your data will most likely not be overlaid on the map correctly.<br>(0)   check_for_lon_coord: Warning: Data either does not contain<br>(0) a valid longitude coordinate array or doesn't contain one at all.<br>(0)      A valid longitude coordinate array should have a 'units'<br>(0)   attribute equal to one of the following values:<br>(0)        'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 25, 2021 at 4:17 PM Dave Allured - NOAA Affiliate <<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Does your file contain its own lat and lon coordinate arrays?  You will need to check this yourself with ncdump or NCL plus print commands.</div><div><br></div><div>If the file has its own coordinate arrays, then do not regrid or reproject.  Doing that will lose detail and reduce the quality of the plotted image.  NCL is quite capable of directly displaying any data with attached coordinate arrays, and it does not need to know anything about the projection of the data.  Please see documentation for "Plotting data on a map" for much more information about aligning data on a map plot.</div><div><br></div><div>    <a href="https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml" target="_blank">https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml</a><br></div><div><br></div><div>If the coordinate arrays in the file are two dimensional, then see example 3, "Curvilinear grid".  When you have 2-D coordinates, they must be passed to the NCL plot routine with special attributes <b>lat2d</b> and <b>lon2d</b>, or alternatively <b>sfXArray</b> and <b>sfYArray</b> attached to the plot resource variable.  Note that 1-D coordinates do not need this special treatment because they are normally attached directly to the data variable to plot.</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 25, 2021 at 8:24 AM S Br 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-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="color:rgb(51,51,51);font-family:Verdana,sans-serif;font-size:12px">Hi All,<br>I have a set of regional gridded data in the British National Grid (OSGB) spatial coordinate system. I am looking to use this data in NCL but the projection is not correctly displayed? Could it be possible to regrid this data to Latitude-longitude in rotated pole coordinates or to a regular lat/lon grid.</p><p style="color:rgb(51,51,51);font-family:Verdana,sans-serif;font-size:12px">I would like to mention that these data sets are generated using the Iris package in Python. The data is correctly displayed in Python but not in NCL.</p><p style="color:rgb(51,51,51);font-family:Verdana,sans-serif;font-size:12px">For your convenience I have attached here a sample NetCDF file.</p><p style="color:rgb(51,51,51);font-family:Verdana,sans-serif;font-size:12px">Thank you.<br>SBR</p></div></blockquote></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div></div></div></div>