forked from ibanos90/obs2ioda
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add Fortran Interface for NetCDF C++ API: File Create and Close Operations #28
Open
amstokely
wants to merge
33
commits into
main
Choose a base branch
from
feature/netcdf_cxx_file_ops
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
…tests. As of now, there are no unit tests but that will change in the future. Also updated installation section of The README to include instructions on how to install pFUnit and build obs2ioda with pFUnit support.
The command now is executed with bash -c '<prev command>' to make it possible to run from any shell, given the system has bash installed.
Removed the obs2ioda root dir argument from obs2ioda cmake args. Apparently CMake requires that the cmake root dir and cmake args in stored in seperate variables.
Removed seemingly hard requirement that build directories have to be named 'build' in the install instructions.
This dummy test serves as an example of how to write a unit test with pFUnit and how to add a pFUnit test to obs2ioda.
Example of how pfunit can catch a subtle type mismatch when using iso_c_bindings.
With a hypothetical way this bug could introduce a numerical error in obs2ioda without causing it to crash.
…_mod.f90 Moved all fortran files in obs2ioda-v2/src into obs2ioda-v2/src/fortran. This will help with project organization if other languages are used in obs2ioda. Updated CMakeLists to reflect the new directory structure.
This commit introduces derived types to facilitate interoperability between Fortran and C for 1D arrays of integers, doubles, and reals. Type-bound procedures were implemented to manage conversions between Fortran arrays and C-compatible arrays, including memory management in both directions. Unit tests were written for each new derived type. As memory allocation and alignment errors are easy to introduce with these new changes, valgrind based unit tests were written for each pFUnit test.
…stalled/discoverable. If it is not, cmake skips adding memcheck unit tests.
… fortran. This allows developers to use memory safe string/vector operations and does not add any sigificant code bloat.
…lose, and putVar functions.
… to be useful/maintainable.
…ng the netcdf C++ api from fortran. Added relevant tests.
…lso moved test cmake code to their own functions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of Changes
Problem:
The NetCDF Fortran API lacks support for reading and writing NetCDF string variables, limiting functionality when working with modern NetCDF files. This gap necessitates an alternative approach to access the full range of NetCDF features.
Solution:
Developed an interface to call the NetCDF C++ API from Fortran. Currently, this interface supports basic operations such as opening and closing NetCDF files. This is the foundational step toward a comprehensive Fortran-to-NetCDF C++ interface that will expose all features of the NetCDF C++ API to Fortran applications, significantly enhancing functionality and flexibility.