From debasish.hazra5 at gmail.com Mon Aug 17 06:10:07 2026 From: debasish.hazra5 at gmail.com (Debasish Hazra) Date: Mon, 17 Aug 2026 08:10:07 -0400 Subject: [ncl-talk] 2-d lat lon Message-ID: Hi, I am trying to read a file which has latitude and longitude in 2 dimensions. I am using lat2d and lon2d to read it, but getting an error while trying to assign the coordinates to the variable of interest and plot.Attached is ncl script and output in text, Any help on this is appreciated. Thanks Debasish -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- Copyright (C) 1995-2019 - All Rights Reserved University Corporation for Atmospheric Research NCAR Command Language Version 6.6.2 The use of this software is governed by a License Agreement. See http://www.ncl.ucar.edu/ for more details. Variable: lat2d Type: float Total Size: 4718592 bytes 1179648 values Number of Dimensions: 2 Dimensions and sizes: [row | 768] x [col | 1536] Coordinates: row: [0..767] col: [0..1535] Number Of Attributes: 3 units : degrees_north standard_name : latitude long_name : latitude Variable: lon2d Type: float Total Size: 4718592 bytes 1179648 values Number of Dimensions: 2 Dimensions and sizes: [row | 768] x [col | 1536] Coordinates: row: [0..767] col: [0..1535] Number Of Attributes: 3 units : degrees_east standard_name : longitude long_name : longitude (0) latitude (degrees_north) : min=-89.8207 max=89.8207 (0) longitude (degrees_east) : min=0 max=359.766 Variable: times Type: double Total Size: 1168 bytes 146 values Number of Dimensions: 1 Dimensions and sizes: [case | 146] Coordinates: case: [0..145] Number Of Attributes: 3 units : hours since 1970-01-01 00:00:00 calendar : standard standard_name : forecast_reference_time Variable: vtimes Type: double Total Size: 46720 bytes 5840 values Number of Dimensions: 2 Dimensions and sizes: [case | 146] x [lead_day | 40] Coordinates: case: [0..145] lead_day: [0..39] Number Of Attributes: 3 units : hours since 1970-01-01 00:00:00 calendar : standard standard_name : time Variable: days Type: integer Total Size: 584 bytes 146 values Number of Dimensions: 1 Dimensions and sizes: [case | 146] Coordinates: case: [0..145] Number Of Attributes: 1 long_name : continuous day index starting from 2025-01-01 Variable: fstart Type: integer Total Size: 584 bytes 146 values Number of Dimensions: 1 Dimensions and sizes: [case | 146] Coordinates: case: [0..145] Number Of Attributes: 1 units : hour UTC Variable: labels Type: float Total Size: 27556577280 bytes 6889144320 values Number of Dimensions: 5 Dimensions and sizes: [case | 146] x [lead_day | 40] x [channel | 1] x [row | 768] x [col | 1536] Coordinates: case: [0..145] lead_day: [0..39] channel: [0..0] row: [0..767] col: [0..1535] Number Of Attributes: 3 _FillValue : nan long_name : GDAAS label coordinates : latitude longitude valid_time Variable: fout Type: float Total Size: 188743680 bytes 47185920 values Number of Dimensions: 3 Dimensions and sizes: [lead_day | 40] x [row | 768] x [col | 1536] Coordinates: lead_day: [0..39] row: [0..767] col: [0..1535] Number Of Attributes: 5 channel : 0 case : 0 _FillValue : nan long_name : AOT prediction coordinates : latitude longitude valid_time fatal:["NclVar.c":1390]:Assignment type mismatch, right hand side can't be coerced to type of left hand side fatal:["Execute.c":8637]:Execute: Error occurred at or near line 51 in file Test_input.ncl -------------- next part -------------- A non-text attachment was scrubbed... Name: Test_input.ncl Type: application/octet-stream Size: 1465 bytes Desc: not available URL: From dave.allured at noaa.gov Mon Aug 17 11:35:13 2026 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Mon, 17 Aug 2026 11:35:13 -0600 Subject: [ncl-talk] 2-d lat lon In-Reply-To: References: Message-ID: NCL can directly plot data with 2-D coordinates, with best-quality results. Do not try to convert coordinates to 1-D before plotting, because that code is more complicated and results in a lower-quality plot. Please see several "curvilinear grid" examples on this page: https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml Also avoid "native grid" plots in the examples, unless you fully understand how they work. Also avoid all forms of regridding. On Mon, Aug 17, 2026 at 6:10?AM Debasish Hazra via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi, > I am trying to read a file which has latitude and longitude in 2 > dimensions. I am using lat2d and lon2d to read it, but getting an error > while trying to assign the coordinates to the variable of interest and > plot.Attached is ncl script and output in text, Any help on this is > appreciated. > Thanks > Debasish > -------------- next part -------------- An HTML attachment was scrubbed... URL: From debasish.hazra5 at gmail.com Sat Aug 22 09:17:08 2026 From: debasish.hazra5 at gmail.com (Debasish Hazra) Date: Sat, 22 Aug 2026 11:17:08 -0400 Subject: [ncl-talk] 2-d lat lon In-Reply-To: References: Message-ID: Thanks Dave, it worked. On Mon, Aug 17, 2026 at 1:35?PM Dave Allured - NOAA Affiliate < dave.allured at noaa.gov> wrote: > NCL can directly plot data with 2-D coordinates, with best-quality > results. Do not try to convert coordinates to 1-D before plotting, because > that code is more complicated and results in a lower-quality plot. Please > see several "curvilinear grid" examples on this page: > > https://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml > > Also avoid "native grid" plots in the examples, unless you fully > understand how they work. Also avoid all forms of regridding. > > > On Mon, Aug 17, 2026 at 6:10?AM Debasish Hazra via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Hi, >> I am trying to read a file which has latitude and longitude in 2 >> dimensions. I am using lat2d and lon2d to read it, but getting an error >> while trying to assign the coordinates to the variable of interest and >> plot.Attached is ncl script and output in text, Any help on this is >> appreciated. >> Thanks >> Debasish >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: