<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Peter,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I'm sorry I didn't respond sooner. I had started looking into this right away, and then I didn't get back to it until just now.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">What I tried to do was trim down the curvilinear_to_SCRIP to its bare minimum required steps so that maybe the weird errors go away.</div><div class="gmail_default" style="font-size:small"><br></div>Given the size of the grid, I've added<div class="gmail_default" style="font-size:small;display:inline">:</div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline"></div><div class="gmail_default" style="font-size:small;display:inline"></div>opt@NetCDFType = "netcdf4"<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Can you run your script with the new attached version of curv_to_scrip.ncl and see how far it gets before it bombs? I've inserted a lot of print statements. If it still bombs, please send me all the output.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Meanwhile, I'm running the script now, but it's going to take awhile and I have to run some errands. Here's the size of the source and destination files that get created, and you'll see the source one is over 3 GB:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default">-rw-rw-r-- 1 haley CIT\Domain Users 117M Feb 22 17:34 <a href="http://destination_grid_file.nc">destination_grid_file.nc</a></div><div class="gmail_default">-rw-rw-r-- 1 haley CIT\Domain Users 3.5G Feb 22 17:34 <a href="http://source_grid_file.nc">source_grid_file.nc</a></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 15, 2018 at 2:21 AM, Kuipers Munneke, P. (Peter) <span dir="ltr"><<a href="mailto:P.KuipersMunneke@uu.nl" target="_blank">P.KuipersMunneke@uu.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div class="m_-8570989957475053280BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="m_-8570989957475053280PlainText">Hi,<br>
<br>
Today I have tried the solution below. Unfortunately, the customized script didn’t provide a solution. The behavior in the customized script is totally erratic and variables get undefined within the script. It’s not just the cts_opt variable, but when I comment
some lines that try to read the cts_opt variable, it starts to complain that other variables are unknown, e.g. lat2d, or FTitle. I have tried to generate local variables and write the variables into these but they suffer from the same problem. I suspect that
it is some sort of memory issue where bits and bytes are altered or overwritten as soon as a variable is read.
<br>
<br>
For example, I inserted a printVarSummary statement at many places in the file attached. All the way down this message is the result. The procedure crashes between lines 42 and 49 in the attached file. Which seems completely random. If I comment lines 44-47,
the procedure crashes at line 60. If I comment lines 51-58, I get:<br>
<br>
fatal:Variable (FTitle) is undefined<br>
fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 99 in file ./curv_to_scrip.ncl<br>
<br>
So all of a sudden it’s no longer cts_opt that is missing, but another variable.<br>
<br>
I suppose there is not really an easy solution to this problem. As said, I think it is memory-related.<br>
<br>
Best, <br>
Peter<br>
</div>
</span></font></div>
<div class="m_-8570989957475053280BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="m_-8570989957475053280PlainText"><br>
<br>
<br>
==================<br>
<br>
Copyright (C) 1995-2017 - All Rights Reserved<br>
University Corporation for Atmospheric Research<br>
NCAR Command Language Version 6.4.0<br>
The use of this software is governed by a License Agreement.<br>
See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br>
(0) test<br>
<br>
<br>
Variable: opt<br>
Type: logical<br>
Total Size: 4 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates: <br>
Number Of Attributes: 12<br>
NetCDFType : netcdf4<br>
Debug : False<br>
PrintTimings : False<br>
ForceOverwrite : True<br>
InterpMethod : bilinear<br>
DstRegional : True<br>
SrcRegional : True<br>
DstGridLon : <ARRAY of 1464100 elements><br>
DstGridLat : <ARRAY of 1464100 elements><br>
SrcGridLon : <ARRAY of 44448889 elements><br>
SrcGridLat : <ARRAY of 44448889 elements><br>
WgtFileName : ./Bedmap_on_MODIS_grid.nc<br>
(0) True<br>
<br>
Variable: cts_opt (parameter)<br>
Type: logical<br>
Total Size: 4 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates: <br>
Number Of Attributes: 4<br>
Debug : False<br>
ForceOverwrite : True<br>
PrintTimings : False<br>
NetCDFType : netcdf4<br>
<br>
Variable: cts_opt (parameter)<br>
Type: logical<br>
Total Size: 4 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates: <br>
Number Of Attributes: 4<br>
Debug : False<br>
ForceOverwrite : True<br>
PrintTimings : False<br>
NetCDFType : netcdf4<br>
<br>
Variable: cts_opt (parameter)<br>
Type: logical<br>
Total Size: 4 bytes<br>
1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes: [1]<br>
Coordinates: <br>
Number Of Attributes: 4<br>
Debug : False<br>
ForceOverwrite : True<br>
PrintTimings : False<br>
NetCDFType : netcdf4<br>
fatal:Variable (cts_opt) is undefined<br>
fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 49 in file ./curv_to_scrip.ncl<span class=""><br>
<br>
fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 3912 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl<br>
<br>
fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 4042 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl<br>
<br></span>
fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 73 in file make_topogrid.ncl<div><div class="h5"><br>
<br>
<br>
<br>
<br>
> On Feb 14, 2018, at 0:22, Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>> wrote:<br>
> <br>
> Hi Peter,<br>
> <br>
> Thanks for providing good details about the problem and the files. <br>
> <br>
> I'm running your script right now with 6.4.0, but haven't seen the problem yet. The script is taking awhile to run, so I'll post back here when it's done. So far, it has printed this output:<br>
> <br>
> (0) get_src_grid_info: source lat dims = (6667,6667)<br>
> (0) get_src_grid_info: source lon dims = (6667,6667)<br>
> (0) get_src_grid_info: source grid type is 'curvilinear'<br>
> (0) curvilinear_to_SCRIP: calculating grid corners...<br>
> (0) curvilinear_to_SCRIP: one or more lat values are at the<br>
> (0) poles, so calculating grid corners using<br>
> (0) calc_SCRIP_corners_boundaries.<wbr>..<br>
> (0) calc_SCRIP_corners_boundaries<br>
> (0) min/max original lat: -90/-48.4644<br>
> (0) min/max original lon: -179.983/180<br>
> <br>
> When you run the script, do you see the error message before this output or after?<br>
> <br>
> <br>
> We've seen this problem before with other users and are completely mystified about where it's happening. You are correct that it appears to be coming from ESMF_regridding.ncl, although we've looked at the code multiple times and don't see the source of the
issue. This has actually happened with earlier versions of NCL (up to 2 years ago), but it doesn't happen consistently.
<br>
> <br>
> What I did for another user that had this problem was to take the "curvilinear_to_SCRIP" procedure that's in ESMF_regridding.ncl, put it in it's own xxxx.ncl script, and then changed all the "Opt" references to something else, like "cts_opt", just to see
if the problem persists.<br>
> <br>
> Since I can't reproduce your problem yet, maybe you can try this yourself. Save the attached curv_to_scrip.ncl file, and then load it from the make_topogrid_debug.ncl script as follows:<br>
> <br>
> load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl"<br>
> load "./curv_to_scrip.ncl"<br>
> <br>
> What will happen is that the "curvilinear_to_SCRIP" in the second NCL script will override the one in ESMF_regridding.ncl, because I made sure there was an "undef" command before it.<br>
> <br>
> [As I've been typing this email and trying things out, your script is still running without any errors.]<br>
> <br>
> Let ncl-talk know if you still see the problem with the new script.<br>
> <br>
> Thanks,<br>
> <br>
> --Mary<br>
> <br>
> <br>
> <br>
> On Tue, Feb 13, 2018 at 8:20 AM, Kuipers Munneke, P. (Peter) <<a href="mailto:P.KuipersMunneke@uu.nl" target="_blank">P.KuipersMunneke@uu.nl</a>> wrote:<br>
> Dear all,<br>
> <br>
> As a regular NCL user, I stumbled upon an issue with the ESMF regridding software, which I have just started to use. I suspect that the Attached you find the cleanest version of the code that reproduces the error, in make_topogrid_debug.ncl. The structure
of the code is an exact replica of <a href="https://www.ncl.ucar.edu/Applications/Scripts/ESMF_regrid_16.ncl" target="_blank">
https://www.ncl.ucar.edu/<wbr>Applications/Scripts/ESMF_<wbr>regrid_16.ncl</a>.<br>
> <br>
> The undefined variable “opt” is not the “opt” in the make_topogrid_debug.ncl file. If I rename it to something else, the error message continues to mention the “Opt” variable instead of the renamed one. This makes me suspect that the error is generated in
ESMF_regridding.ncl itself.<br>
> <br>
> I would be very grateful for your help.<br>
> <br>
> With best regards,<br>
> Peter<br>
> <br>
> ============<br>
> <br>
> <br>
> - NCL version 6.4.0<br>
> <br>
> - Data files are available at <a href="http://www.staff.science.uu.nl/~kuipe117/ncl_debug" target="_blank">
http://www.staff.science.uu.<wbr>nl/~kuipe117/ncl_debug</a><br>
> <br>
> - The exact error message is<br>
> <br>
> fatal:Variable (Opt) is undefined<br>
> fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 1613 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl<br>
> <br>
> fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 3912 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl<br>
> <br>
> fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 4042 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl<br>
> <br>
> fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 51 in file make_topogrid_debug.ncl<br>
> <br>
> - The system is Mac OS High Sierra 10.13.3<br>
> <br>
> uname -a gives:<br>
> <br>
> Darwin <a href="http://mbpkuipsmunneke.soliscom.uu.nl" target="_blank">mbpkuipsmunneke.soliscom.uu.nl</a> 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_<wbr>X86_64 x86_64<br>
> <br>
> gcc —version gives:<br>
> <br>
> Configured with: --prefix=/Library/Developer/<wbr>CommandLineTools/usr --with-gxx-include-dir=/usr/<wbr>include/c++/4.2.1<br>
> Apple LLVM version 9.0.0 (clang-900.0.39.2)<br>
> Target: x86_64-apple-darwin17.4.0<br>
> Thread model: posix<br>
> InstalledDir: /Library/Developer/<wbr>CommandLineTools/usr/bin<br>
> <br>
> ______________________________<wbr>_________________<br>
> ncl-talk mailing list<br>
> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
> List instructions, subscriber options, unsubscribe:<br>
> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
> <br>
> <br></div></div>
> <curv_to_scrip.ncl><br>
<br>
</div>
</span></font></div>
</div>
</blockquote></div><br></div>