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

the tocgrib utility uses the NCEPLIBS-w3emc subroutine w3as00(), which depends on mysterious subroutines #280

Closed
edwardhartnett opened this issue Oct 1, 2023 · 5 comments · Fixed by NOAA-EMC/NCEPLIBS-w3emc#223
Assignees
Labels
build Building software is complicated

Comments

@edwardhartnett
Copy link
Contributor

In NCEPLIBS-w3emc we have a cmake option:

option(BUILD_WITH_EXTRA_DEPS "Build w3emc with subprograms which call unknown dependencies" ON)

One of these subroutines is w3as00() and it is used in tocgrib.

It should be noted that it is impossible to build the shared libraries with unresolved dependencies.

@edwardhartnett
Copy link
Contributor Author

@AlexanderRichert-NOAA , @GeorgeVandenberghe-NOAA and @Hang-Lei-NOAA I'm not sure what, if anything to do about this.

NOAA operational code is built static only, so this is not a problem, but tocgrob2 cannot be built with shared libraries. Is that a problem for anyone? Is there any way we can fix it by tracking down where this code is being called from?

@GeorgeVandenberghe-NOAA

Run ldd on all production executables to find it, then look at the build for those that come up positive.

I think I am preaching to the choir when I assert we are going to have to be able to run production with shared libraries to support much improved NetCDF compression options available only with runtime selection. (and this preaching is from someone who otherwise despises shared library APIs)

@GeorgeVandenberghe-NOAA
Copy link

@AlexanderRichert-NOAA
Copy link
Contributor

Here's what I've come up with as far as the 'missing' subroutines in w3emc (i.e., the subroutines that are undefined when I try to build w3emc as a shared lib):

  • iargc/getarg: There seems to be some quirkiness in src/args_mod.f, which frankly I'm not sure I understand the point of. I have a sneaking suspicion we could remove that file from w3emc entirely (it's wrapping Fortran intrinsics, which should probably be replaced with modern equivalents of those subroutines (command_argument_count() and get_command_argument()) in w3as00.
  • int2ch: converts integer to character string. We could probably replace the two calls to this subroutine (both in src/w3fq07.f) with write....
  • consol: seems to just print or in some way output strings with statuses. I suspect these calls could be replaced with print statements.
  • w3fi33: converts array of first 8 identification words into an array of 27 data field identifiers. The code is available at https://ntrs.nasa.gov/api/citations/19820002778/downloads/19820002778.pdf, so we could just add this to w3emc.

For the last three, I'm going to look in the operational executables and see if any of them use these subroutines. Something tells me they're unused, in which case maybe the way to go is to just remove them. In any case I'll plan to put in a PR to w3emc to resolve this stuff...

@edwardhartnett
Copy link
Contributor Author

Awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Building software is complicated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants