This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> Subject: Re: 970624: Restriction of variable name in ncgen? > Glenn-- > > It seems that the allowed "-" in variable names would cause a problem > in c and fortran code. > Is this situation handled differently? > > --Tom You are right, it causes a problem. netcdf test { variables: float theta-0; } produces ... /* variable ids */ int theta-0_id; Which can't be compiled. "test.c", line 19: error(1065): expected a ";" int theta-0_id; ^ ... (other errors) Russ Rew, the author of ncgen (and thus cdl syntax solomon) is on vacation this week. In my previous message, I was trying to rationally deduce the reasoning behind the cdl syntax. Since we are now into the realm of channeling, I'll have to defer further discussion of this until his return. When/if he fixes the above problem, perhaps he will be willing to add the '.' syntax you request. -glenn