Skip to content
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

Writing uniform provenance info in netdfs global attributes. #129

Merged
merged 4 commits into from
Dec 2, 2021

Conversation

ngs333
Copy link
Contributor

@ngs333 ngs333 commented Nov 24, 2021

This PR creates print_provenance utility functions to uniformly (accross all NCTols apps using the functions) write as netcdf global attributes provenance and provenance related information.
A sample of the info is

// global attributes:
		:grid_version = "0.2" ;
		:code_release_version = "19.0.1" ;
		:git_hash = "51ed4692c8b238e1e15bbc1d240951d3000e6f35" ;
		:creationtime = "Wed Nov 24 13:52:24 2021" ;
		:hostname = "edison" ;
		:history = "make_hgrid --grid_type gnomonic_ed --nlon 96 --grid_name C48_gridy" ;

The new functions are in /tools/libfrencutil/tool_util.c.
configure.ac was modified to place the git_hash info into the generated config.h file.
Numerous apps were modified to use the new functionality.

@ngs333
Copy link
Contributor Author

ngs333 commented Nov 24, 2021

@ceblanton
Hi Chris, I havent set reviewers yet because I am still testing this. Quite a bit of generated artifacts are changed.

@ngs333 ngs333 requested review from nikizadehgfdl, underwoo, bensonr and ceblanton and removed request for underwoo November 24, 2021 20:59
@ceblanton
Copy link
Contributor

Might it be better to include the full hostname? e.g. an201.princeton.rdhpcs.noaa.gov instead of just an201? I was thinking of perhaps a case like login1.school.edu where the short hostname might be ambiguous.

In almost every case it would make no difference, so I'm fine with the short name as is.

@nikizadehgfdl
Copy link
Contributor

What code does code_release_version = "19.0.1" refer to? fre-nctools tags are like v2.*
If precompiled bronx-19 is used what would appear for code_release_version?
Who sets the grid_version?

@ceblanton
Copy link
Contributor

ceblanton commented Nov 30, 2021

@nikizadehgfdl, the code_release_version comes from configure.ac so will need to be updated on each release. The more authoritative state of the code is the git_hash value, which is the hash of the most recent commit. The git tags such as v2.18.0 should be the same as git describe <git_hash>.

No idea about the grid_version. I'd like to think it's like a mini-version unique and meaningful to each grid tool, and is updated by each tool as needed.

@ngs333
Copy link
Contributor Author

ngs333 commented Nov 30, 2021

What code does code_release_version = "19.0.1" refer to? fre-nctools tags are like v2.* If precompiled bronx-19 is used what would appear for code_release_version? Who sets the grid_version?

The code release version is to be set by the user compiling the code with autotools.
In confiure.ac file, its the 2nd argument in AC_INIT.

I'm still working on the meaning of the grid-version, but there seems to be two types:
A) Most apps (make_hgrid, make_vgrid, make_topog, make_[quick,coupler,solo]_mosaic astually just set it to 0.2
and write it to the nc file.

B) check_mask app and the functions in tool_util.c use a variable named grid_vesion which can equal to one of three things. What it could mean may be given by this code :

if(mpp_field_exist(grid_file, "wet") ) {
    grid_version = VERSION_1;
    printf("\n ===>NOTE from check_mask: the grid file is version 1 grid which contains field wet\n");
  }
  else if(mpp_field_exist(grid_file, "gridfiles") ) {
    grid_version = VERSION_2;
    printf("\n ===>NOTE from check_mask: the grid file is version 2 (solo mosaic grid) grid which contains field gridfiles\n");
  }
  else if(mpp_field_exist(grid_file, "lnd_mosaic") ) {
    grid_version = VERSION_3;
    printf("\n ===>NOTE from check_mask: the grid file is version 3 (coupled mosaic grid) grid which contains field lnd_mosaic\n");
  }

and some logic is modified depending on which version it is.
It seems to me type A) and B) are not related, but i'm not 100% sure.

@nikizadehgfdl
Copy link
Contributor

Thanks. My point was that where/which repo would I find the "19.0.1" tag? fre-nctools repo or fms repo?
grid_version is tricky. I kind of remember the VERSION_1 and VERSION_2 in B above to signify pre-mosaic and post-mosaic. But 0.2 does not ring any bell and is confusing.

@ceblanton ceblanton merged commit 27d2597 into NOAA-GFDL:master Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants