-
Notifications
You must be signed in to change notification settings - Fork 9
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
Combine ip and ip2 libraries #54
Conversation
ip and ip2 were combined using modern Fortran to abstract away the grib and grib2 specific portions into a unified interface. Instead of each function taking grib1/grib2 descriptors directly, a derived type ip_grid_descriptor is used and then each interpolation operates on that.
Combined ip libraries warrant a bump in major version
…ip into feature/combined-ip
…ip into feature/combined-ip
@kgerheiser Can you build it on Hera or Dell? I can test it with UFS_UTILS. |
Try this |
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.
Taking this on faith, which is not good. Next time, break up changes into smaller PRs...
@GeorgeGayno-NOAA I ran the UFS_UTILS also passes all the Github workflows with the updated library. |
What UFS_UTILS branch are you using? |
The 'orog' code uses IPLIB. |
@GeorgeGayno-NOAA is that included in one of the consistency tests? |
The only tests we have for the 'orog' code currently are the 'grid_gen' consistency tests. |
|
The corresponding UFS_UTILS issue is: ufs-community/UFS_UTILS#242 |
@kgerheiser I checked out your UFS_UTILS feature/combined-ip branch on Hera. It compiled, but was pointing to the current stack version of IPLIB. Am I looking at the wrong branch? I recall having to make source code changes to get the combined iplib to work with |
Oh, I didn't commit that change. I removed |
@@ -1,3 +1,6 @@ | |||
!> @file | |||
!! @brief Gaussian grid | |||
|
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.
Author tag at file level as well...
!! @param[inout] self The grid to initialize | ||
!! @param[in] g1_desc A grib1_descriptor | ||
!! | ||
!! @author Kyle Gerheiser |
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.
Add a @Date tag as well.
@@ -110,128 +124,128 @@ subroutine init_grib2(self, g2_desc) | |||
|
|||
end subroutine init_grib2 | |||
|
|||
!$$$ SUBPROGRAM DOCUMENTATION BLOCK |
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.
This whole comment block must also be doxygenated.
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.
If you've got this working, probably you should merge and continue with doxygen work in a new PR...
implicit none | ||
|
||
!> @param Constant to choose BILINEAR interpolation method |
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.
The param statements all go into the doxygen header at the top of the subroutine.
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.
It's not a subroutine. @param
can be used to document module variables and constants.
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.
OK, interesting. Can we get this merged and then discuss doxygen afterwards?
case(BICUBIC_INTERP_ID) | ||
CALL interpolate_bicubic(IPOPT,grid_in,grid_out,MI,MO,KM,IBI,LI,GI,NO,RLAT,RLON,IBO,LO,GO,IRET) | ||
CALL interpolate_bicubic(IPOPT,grid_in,grid_out,MI,MO,KM,IBI& |
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.
For easy review, what I suggest is to do all whitespace only reformatting as a separate PR, with no code changes. So merge this PR, then reformat the code however you like, and then do a PR with that.
That way we can easily scan the whitespace changes to ensure no code was accidently changed.
I think this PR is finally ready.
This PR combines the ip and ip2 libraries into a single library with modern interfaces and modules. Internally, instead of passing around the complete grib1/grib2 spec, an abstract
ip_grid_descriptor
object is used as a wrapper. Then, all the interpolation routines can re-use the majority of the code. Spectral interpolation is a special case and under the hood there are still two separate routines for grib1/grib2 because there's a lot of case specific things going on that were difficult to generalize.The code has been tested with a series of unit tests (Intel and GCC, with 66%+ coverage), UFS_UTILS, and wgrib2.
To use the code
use ip_mod
which provides access to the main routinesipolates
,ipolatev
, andgdswzd
. The specific routine can also be called by appending_grib1
or_grib2
.To Do: Finish the Doxygen documentation. A lot of it is complete, but still some more to go.