[Dart-dev] [Dart-users] DART matlab scripts

So-Young Ha syha at ucar.edu
Wed Feb 20 09:21:49 MST 2013


Hi Tim,

I've gone through this for MPAS/DART a couple of weeks ago - in the development branch (r5894).
All the recent versions of matlab I have (e.g., in yellowstone, our division and my laptop) support the netCDF capability and their native netCDF functions were quite straightforward to use. So, instead of installing the third-party toolboxes, I decided to update a bunch of matlab scripts under DART/matlab/, which did not take more than a couple of hours.
Trust me, I'm not used to matlab yet, but it was fairly simple to update even for me. 

I've got two issues during the update, though. 
I could not find a couple of functions in the native support - such as nc_iscoordvar and nc_isvar. 
And the output from "ncread" (in the native support) has an opposite order of character arrays to the one from nc_getvar. 
The latter was easy to handle, but I failed in dealing with those functions that I couldn't find.
So I ended up updating only small parts that I really needed at that time (which worked well for me).

I understand the backward compatibility issue, but eventually we don't need to worry about the initial setup in startup.m or installing the third-party toolboxes any more, so I'd vote for #3. Based on my experience, I should say that it would not take more than one day for you to update all of them. At least for MPAS/DART, they are almost done.^^


Soyoung



On Feb 20, 2013, at 7:53 AM, Tim Hoar wrote:

> It came to my attention (yesterday at 4PM) that the Matlab diagnostics were not working on yellowstone, and then, to my abject horror, that Roland was not able to run them with a very old version of Matlab (2009a).
> 
> I have tracked down the problem and am open for suggestions on where to go from here.
> 
> DART has used the third-party netCDF toolboxes since the beginning. The most recent version (4028, from 27 Nov. 2012) of these toolboxes made a fundamental non-backward-compatible change that I'm struggling with. From the mexcdf website (http://mexcdf.sourceforge.net/downloads/):
> 
> "(* November 27 2012 John Evans -r4028
> - SQUEEZE call sites removed.  NC_VARGET will try to restore any leading
> - singleton dimensions that were removed because of the 
> - row-major-col-major order issue. "
> I use this call in "hundreds" of places. It is pervasive. How many of my calls are affected by this decision is unknown.
> 
> I used r3801 for my testing - which was rather exhaustive - and everything worked as expected. I installed both 3801 and 4024 on yellowstone and both of these generate the desired results, so it is not a bug in my coding and explains why no one has complained about it till I was showing Roland how easy it was to run the diagnostics ... DOH! WT&%^$3?! (Roland is using an old version of Matlab, but the most recent version of the third-party tools - which is the same version I installed on Yellowstone.)
> 
> As I see it, the choices are these:
> 1) simply recommend that people use the 4024 (30 October 2012) version of those toolboxes - I briefly tested this and it worked. I need to test this more before I feel confident - but I'm pretty confident. I'm supremely confident in the 3801 version. 
> 
> 2) I could try to identify and bulletproof the calls where the singleton dimensions are causing problems. This will likely take at least a week of work - which I'll have in April - MAYBE.
> 
> 3) Since Matlab has had native netCDF support for about 3 years - maybe I should remove the dependency on the third-party tools. This would strand anyone in the future who is using ancient versions of Matlab (like Roland). This will certainly not happen before April - at best.
> 
> 4) I build something like the Kon-Tiki and set sail for Tahiti.
> 
> IN THE IMMEDIATE FUTURE ... i.e. ON YELLOWSTONE NOW ...
> 
> In your Matlab startup.m script (or wherever you launch 'ncstartup') change 'ncstartup' to 'ncstartup_4024'
> and let me know what, if anything, does not behave as expected. Also - I'm serious - I want input on a solution.
> 
> Thanks -- Tim
> 
> Tim Hoar, Associate Scientist
> National Center for Atmospheric Research
> thoar at ucar.edu
> 303.497.1708
> 
> _______________________________________________
> Dart-users mailing list
> Dart-users at mailman.ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/dart-users



More information about the Dart-dev mailing list