-
Notifications
You must be signed in to change notification settings - Fork 292
ncgen -lc is incorrectly handling _Format #1506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
af94f09
ncgen -lc is incorrectly handling _Format
DennisHeimbigner aa3a9f0
Add tests
DennisHeimbigner 9e016b8
Add test cases
DennisHeimbigner 5ba4c6a
Forgot to put test in EXTRA_DIST
DennisHeimbigner c28a351
Misnamed baseline file
DennisHeimbigner 30cfd34
Remove debug output
DennisHeimbigner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| #include <netcdf.h> | ||
|
|
||
|
|
||
| void | ||
| check_err(const int stat, const int line, const char *file) { | ||
| if (stat != NC_NOERR) { | ||
| (void)fprintf(stderr,"line %d of %s: %s\n", line, file, nc_strerror(stat)); | ||
| fflush(stderr); | ||
| exit(1); | ||
| } | ||
| } | ||
|
|
||
| int | ||
| main() {/* create ref_tst_small.nc */ | ||
|
|
||
| int stat; /* return status */ | ||
| int ncid; /* netCDF id */ | ||
|
|
||
| /* dimension ids */ | ||
| int Time_dim; | ||
| int DateStrLen_dim; | ||
|
|
||
| /* dimension lengths */ | ||
| size_t Time_len = NC_UNLIMITED; | ||
| size_t DateStrLen_len = 19; | ||
|
|
||
| /* variable ids */ | ||
| int Times_id; | ||
|
|
||
| /* rank (number of dimensions) for each variable */ | ||
| # define RANK_Times 2 | ||
|
|
||
| /* variable shapes */ | ||
| int Times_dims[RANK_Times]; | ||
|
|
||
| /* enter define mode */ | ||
| stat = nc_create("ref_tst_small.nc", NC_CLOBBER, &ncid); | ||
| check_err(stat,__LINE__,__FILE__); | ||
|
|
||
| /* define dimensions */ | ||
| stat = nc_def_dim(ncid, "Time", Time_len, &Time_dim); | ||
| check_err(stat,__LINE__,__FILE__); | ||
| stat = nc_def_dim(ncid, "DateStrLen", DateStrLen_len, &DateStrLen_dim); | ||
| check_err(stat,__LINE__,__FILE__); | ||
|
|
||
| /* define variables */ | ||
|
|
||
| Times_dims[0] = Time_dim; | ||
| Times_dims[1] = DateStrLen_dim; | ||
| stat = nc_def_var(ncid, "Times", NC_CHAR, RANK_Times, Times_dims, &Times_id); | ||
| check_err(stat,__LINE__,__FILE__); | ||
|
|
||
| /* assign global attributes */ | ||
|
|
||
| { | ||
| stat = nc_put_att_text(ncid, NC_GLOBAL, "TITLE", 31, " OUTPUT FROM WRF V2.0.3.1 MODEL"); | ||
| check_err(stat,__LINE__,__FILE__); | ||
| } | ||
|
|
||
|
|
||
| /* leave define mode */ | ||
| stat = nc_enddef (ncid); | ||
| check_err(stat,__LINE__,__FILE__); | ||
|
|
||
| /* assign variable data */ | ||
|
|
||
| { | ||
| char* Times_data = "2005-04-11_12:00:002005-04-11_13:00:00" ; | ||
| size_t Times_startset[2] = {0, 0} ; | ||
| size_t Times_countset[2] = {2, 19}; | ||
| stat = nc_put_vara(ncid, Times_id, Times_startset, Times_countset, Times_data); | ||
| check_err(stat,__LINE__,__FILE__); | ||
| } | ||
|
|
||
|
|
||
| stat = nc_close(ncid); | ||
| check_err(stat,__LINE__,__FILE__); | ||
| return 0; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added duplicate line?