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

Combine ip and ip2 libraries #54

Merged
merged 41 commits into from
Jul 21, 2021
Merged

Combine ip and ip2 libraries #54

merged 41 commits into from
Jul 21, 2021

Conversation

kgerheiser
Copy link
Contributor

@kgerheiser kgerheiser commented Jul 15, 2021

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 routines ipolates, ipolatev, and gdswzd. 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.

@GeorgeGayno-NOAA
Copy link
Contributor

@kgerheiser Can you build it on Hera or Dell? I can test it with UFS_UTILS.

@kgerheiser
Copy link
Contributor Author

kgerheiser commented Jul 15, 2021

Try this export ip_ROOT=/home/Kyle.Gerheiser/NCEPLIBS-ip/build/install on Hera

Copy link
Contributor

@edwardhartnett edwardhartnett left a 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...

@kgerheiser
Copy link
Contributor Author

kgerheiser commented Jul 20, 2021

@GeorgeGayno-NOAA I ran the snow2mdl and global_cycle tests on Hera, and it passed. Do any of the others exercise this code?

UFS_UTILS also passes all the Github workflows with the updated library.

@GeorgeGayno-NOAA
Copy link
Contributor

@GeorgeGayno-NOAA I ran the snow2mdl and global_cycle tests on Hera, and it passed. Do any of the others exercise this code?

UFS_UTILS also passes all the Github workflows with the updated library.

What UFS_UTILS branch are you using?

@GeorgeGayno-NOAA
Copy link
Contributor

@GeorgeGayno-NOAA I ran the snow2mdl and global_cycle tests on Hera, and it passed. Do any of the others exercise this code?

UFS_UTILS also passes all the Github workflows with the updated library.

The 'orog' code uses IPLIB.

@kgerheiser
Copy link
Contributor Author

kgerheiser commented Jul 20, 2021

@GeorgeGayno-NOAA is that included in one of the consistency tests?

@GeorgeGayno-NOAA
Copy link
Contributor

@GeorgeGayno-NOAA is that included in one of the tests?

The only tests we have for the 'orog' code currently are the 'grid_gen' consistency tests.

@kgerheiser
Copy link
Contributor Author

grid_gen tests pass as well.

@GeorgeGayno-NOAA
Copy link
Contributor

The corresponding UFS_UTILS issue is: ufs-community/UFS_UTILS#242

@GeorgeGayno-NOAA
Copy link
Contributor

@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 snow2mdl. See ufs-community/UFS_UTILS#242

@kgerheiser
Copy link
Contributor Author

Oh, I didn't commit that change. I removed module load ip and put setenv ip_ROOT /home/Kyle.Gerheiser/NCEPLIBS-ip/build/install

docs/user_guide.md Outdated Show resolved Hide resolved
@@ -1,3 +1,6 @@
!> @file
!! @brief Gaussian grid

Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

src/ip_interpolator_mod.f90 Outdated Show resolved Hide resolved
src/ipolates.f90 Outdated Show resolved Hide resolved
src/ipolates.f90 Outdated Show resolved Hide resolved
Copy link
Contributor

@edwardhartnett edwardhartnett left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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&
Copy link
Contributor

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.

@kgerheiser kgerheiser merged commit 2821fe9 into NOAA-EMC:develop Jul 21, 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.

3 participants