I think that we, as ROMS developers, have freely provided a very sophisticated modeling framework to the ocean community without asking anything in return.
I highly appreciate your effort and that of your team, and the appreciation and admiration grows every day I work with the software you provide! I'm sure this holds for most, if not all users of your code.
Regarding your use of Matlab, I have no problem with it, it's easy to read compared to other languages! For my own good it may be better if you keep focusing on Matlab instead of diverting efforts to other languages.... PLEASE keep on writing great Matlab scripts!
I guess the main point of my post should have been that I think the documentation in
https://www.myroms.org/wiki/Nested_Grids is inconsistent with the Fortran code, and hence presumably also with the Matlab pre-processing scripts, although I have not been able to verify the latter. Specifically, on the version of the wiki page last modified 15:13, 17 July 2019, it says in section
https://www.myroms.org/wiki/Nested_Grid ... s_Metadata
Code: Select all
int coincident(Ngrids) ;
coincident:long_name = "coincident donor and receiver grids logical switch" ;
coincident:flag_values = 0, 1 ;
coincident:flag_meanings = "false true" ;
int composite(Ngrids) ;
composite:long_name = "composite grid type logical switch" ;
composite:flag_values = 0, 1 ;
composite:flag_meanings = "false true" ;
int mosaic(Ngrids) ;
mosaic:long_name = "mosaic grid type logical switch" ;
mosaic:flag_values = 0, 1 ;
mosaic:flag_meanings = "false true" ;
int refinement(Ngrids) ;
refinement:long_name = "refinement grid type logical switch" ;
refinement:flag_values = 0, 1 ;
refinement:flag_meanings = "false true" ;
that the 'coincident' etc. fields are of dimension Ngrids. Do I assume correctly that they should instead be of dimension Ncontact?
The ncdump of the NetCDF header in the Wiki is very useful for people who cannot generate a contact file with Matlab. It conveys the correct structure of the contact file without me having to trace the generation of that file in the Matlab code. When I started out writing the script, I basically copy/pasted this information. Hence it maybe worthwhile to fix it.
The bug resulting from this is a bit nasty, because it is latent using 2 grids Ngrids == Ncontact. So even with the incorrect NetCDF structure, everything works. Only when going to three grids there is a *_get_var() start/stride error due to the inconsistent lengh of the allocated array and the lengh of the field in the nc file. I checked the integrity of the NetCDF file 20 times because I thought it was corrupted, after all the NetCDF structure had worked using 2 grids.
Regards, Stefan