[ncl-talk] Warning: The 'lon2d' attribute must either be the same dimension

Barry Lynn barry.h.lynn at gmail.com
Thu Jan 5 09:58:40 MST 2017


Hello:

I have attached the wrf_times.file.

However, I added res at gsnAddCyclic = False

and sres at gsnAddCyclic = False, but the error remains.

The problem pertains not to the mapping of the terrain ("res"), but of the
snowh_rate_dom variable.

Since, I am plotting a subdomain of terrain by setting:

  res at mpFillOn     = False
  res at mpMaxLatF    = lat_end                  ; specify the plot domain
  res at mpMinLatF    = lat_beg
  res at mpMinLonF    = lon_beg                  ;
  res at mpMaxLonF    = lon_end

I need to excerpt snowh_rate_dom from snowh_rate.

I do this as follows, and this is where the error message pertains to.

(Note, if you try to run the program, you have to read in the uploaded nc
file, not wrf_output, and set ntimes = 0.)

 i_loc = 1
  j_loc = 1

GET_IJ::get_ij(xlat2d,xlon2d,lat_beg,lon_beg,i_loc,j_loc,dims2d(0),dims2d(1))
  x_start = i_loc
  y_start = j_loc

  print("x_start = " + x_start)
  print("y_start = " + y_start)

GET_IJ::get_ij(xlat2d,xlon2d,lat_end,lon_end,i_loc,j_loc,dims2d(0),dims2d(1))
  x_end = i_loc
  y_end = j_loc
  print("x_end = " + x_end)
  print("y_end = " + y_end)
  snowh_rate_dom  = snowh_rate(y_start:y_end,x_start:x_end)
  printVarSummary(snowh_rate_dom)
  printVarSummary(snowh_rate)

  lat_dom = xlat2d(y_start:y_end,x_start:x_end)
  lon_dom = xlon2d(y_start:y_end,x_start:x_end)
  snowh_rate_dom!0 = "lat_dom"
  snowh_rate_dom!1 = "lon_dom"
  snowh_rate_dom at lat_dom = lat_dom
  snowh_rate_dom at lon_dom = lon_dom



On Thu, Jan 5, 2017 at 5:45 PM, Mary Haley <haley at ucar.edu> wrote:

> Barry,
>
> I was unable to run the script because I was missing an ASCII file.
>
> I think the problem is that NCL is trying to add a longitude cyclic point,
> and you don't want to do this for WRF data. What's happening is that NCL is
> taking your 270 x 270 data array and turning it into a 270 x 271 array, but
> the lat2d and lon2d are untouched (because gsnAddCyclic doesn't touch
> these), and hence you end up with two arrays of different sizes.
>
> Try setting:
>
>   res at gsnAddCyclic = False
>
> --Mary
>
>
> On Thu, Jan 5, 2017 at 1:42 AM, Barry Lynn <barry.h.lynn at gmail.com> wrote:
>
>> Hello:
>>
>> I thought that I have done what was indicated on this page, but I
>> continue to get an error in dimensioning the second variable.  I am trying
>> to plot a subset of the first variable (no problem), and then extract the
>> same subset from the second variable. I've done it before, but
>> it doesn't work here.
>>
>> I been at this about 4 or 5 hours, tried different things, including
>> adapting the suggestions here:
>>
>> https://www.ncl.ucar.edu/Support/talk_archives/2012/2697.html
>>
>> I uploaded an extraction of the original WRF file, in case this is need.
>>
>> Thank you.
>>
>> ftp> put wrfsnow.ncl
>> local: wrfsnow.ncl remote: wrfsnow.ncl
>> 229 Entering Extended Passive Mode (|||49155|).
>> 150 Ok to send data.
>> 100% |********************************************************************|
>>  7521        3.06 MiB/s    00:00 ETA
>> 226 Transfer complete.
>> 7521 bytes sent in 00:00 (11.93 KiB/s)
>> ftp> put wrfsnow.out.file
>> local: wrfsnow.out.file remote: wrfsnow.out.file
>> 229 Entering Extended Passive Mode (|||49161|).
>> 150 Ok to send data.
>> 100% |********************************************************************|
>>  2566        8.21 MiB/s    00:00 ETA
>> 226 Transfer complete.
>> 2566 bytes sent in 00:00 (6.15 KiB/s)
>> ftp> put file_for_ncltalk.nc
>> local: file_for_ncltalk.nc remote: file_for_ncltalk.nc
>> 229 Entering Extended Passive Mode (|||49179|).
>> 150 Ok to send data.
>> 100% |********************************************************************|
>>  2279 KiB  278.71 KiB/s    00:00 ETA
>> 226 Transfer complete.
>> 2333728 bytes sent in 00:08 (260.45 KiB/s)
>>
>>
>> --
>> Barry H. Lynn, Ph.D
>> Senior Lecturer,
>> The Institute of the Earth Science,
>> The Hebrew University of Jerusalem,
>> Givat Ram, Jerusalem 91904, Israel
>> Tel: 972 547 231 170
>> Fax: (972)-25662581
>>
>> C.E.O, Weather It Is, LTD
>> Weather and Climate Focus
>> http://weather-it-is.com
>> Jerusalem, Israel
>> Local: 02 930 9525
>> Cell: 054 7 231 170
>> Int-IS: x972 2 930 9525
>> US 914 432 3108 <(914)%20432-3108>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>


-- 
Barry H. Lynn, Ph.D
Senior Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
US 914 432 3108
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170105/ffc1b101/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_times.file
Type: application/octet-stream
Size: 311 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170105/ffc1b101/attachment.obj 


More information about the ncl-talk mailing list