[ncl-talk] wkSpaceTime works for one grid, but not another grid - unstructured grids

Adam Herrington adam.herrington at stonybrook.edu
Sun Jul 8 14:38:01 MDT 2018


I have a run on an unstructured grid. I map to lat-lon grids using ESMF
regridding, with an offline weights file. wkSpaceTime runs fine when I use
the weight file mapping to a grid with nlon = 512, but it gives an error
when I use the weights file for a grid of nlon = 513. I've used both of
these wgt files for many months and I have no reason to believe they are
corrupt. The error occurs for the grid with nlon = 513:

fatal:Dimension size mismatch, dimension (1) of left hand side reference
does not have the same size as the right hand side reference after
subscripting.
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 240 in
file $NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl

fatal:["Execute.c":8640]:Execute: Error occurred at or near line 738 in
file $NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl

line 738 of cam_diagnostics calls the function "resolveWavesHayashi." It
has a problem with this block of code:

varspacetime = new((/2,mlon+1,N+1/),typeof(varfft),1e20)

varspacetime(:,:mlon/2-1,:N/2-1) = varfft(:,mlon/2:1,N/2:N-1)
varspacetime(:,:mlon/2-1,N/2:)   = varfft(:,mlon/2:1,:N/2)
varspacetime(:, mlon/2: ,:N/2)   = varfft(:,:mlon/2,N/2:0) <---fatal error
here
varspacetime(:, mlon/2: ,N/2+1:) = varfft(:,:mlon/2,N-1:N/2)

So from the error, I gather that the sizes of subscripted dimension 1 don't
agree during the array assignment, i.e., " mlon/2: " is not equal to "
:mlon/2". But it should be. The next line uses the same dimension 1
assignment so I think that would probably cause an error too.

I'm not sure if this is a user error or not. My script is attached. It is a
slightly modified version of
http://www.ncl.ucar.edu/Applications/Scripts/wkSpaceTime_1.ncl.

Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180708/0e5fc1c8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wkspacetime2.ncl
Type: application/octet-stream
Size: 3547 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180708/0e5fc1c8/attachment.obj>


More information about the ncl-talk mailing list