ufs-community / UFS_UTILS

Utilities for the NCEP models.
Other
21 stars 104 forks source link

Test UFS_UTILS with combined IP/IP2 library #242

Closed GeorgeGayno-NOAA closed 1 year ago

GeorgeGayno-NOAA commented 3 years ago

@kgerheiser is combining IP and IP2 into a single library. Test this library with UFS_UTILS.

https://github.com/NOAA-EMC/NCEPLIBS-ip2/pull/29

edwardhartnett commented 3 years ago

Please build a test for this in GitHub actions, so we call all see it. That is, write a test that downloads and builds ip/ip2, then builds and runs UFS_UTILS tests. For an example, see this workflow, which builds a fixed version of pnetcdf, caches it, and then builds PIO with it: https://github.com/NCAR/ParallelIO/blob/master/.github/workflows/cmake.yml

GeorgeGayno-NOAA commented 3 years ago

@kgerheiser I ran the snow2mdl regression test on Hera. The test ran to completion. I did not expect bit identical results, but the differences in the snow cover field are larger than they should be. The cover field is shifted from the baseline. Snow cover is set from IMS snow data, which uses an elliptical earth. So my guess is IPLIB is using the wrong radius of the earth or does not realize an elliptical earth was used. The IMS data is grib1, which sets earth radius in GDS octet 17: https://www.nco.ncep.noaa.gov/pmb/docs/on388/table7.html

GeorgeGayno-NOAA commented 3 years ago

General comment: since this is a very big change to the library, should the first digit of the version number be incremented? i.e., 4.0.0?

kgerheiser commented 3 years ago

That's a good lead. I'll take a look there.

General comment: since this is a very big change to the library, should the first digit of the version number be incremented? i.e., 4.0.0?

Yes, that would be appropriate.

GeorgeGayno-NOAA commented 3 years ago

@kgerheiser Can you create "2d-array", "1d-array" and scalar versions of gdswzd for both grib1 and grib2? (it looks like scalar grib1 is missing). I call gdswzd with scalars for grib1 in my snow program. To get it to compile, I have to call 'gdswzd_grib1'. For the non-scalar calls, I am able to call the gdswzd interface directly.

kgerheiser commented 3 years ago

I think I found the problem. You were right about the earth radius. I wasn't setting the WGS-84 radius when it was an elliptical Earth.

GeorgeGayno-NOAA commented 3 years ago

@kgerheiser My branch won't compile anymore. You test library was here: /home/Kyle.Gerheiser/NCEPLIBS-ip2.

kgerheiser commented 3 years ago

Oh, I deleted that yesterday.

kgerheiser commented 3 years ago

grid_gen, snow2mdl, and global_cycle tests pass

GeorgeGayno-NOAA commented 2 years ago

@kgerheiser Has IP v4 been installed on any of our machines? This issue has been open for a while.

GeorgeGayno-NOAA commented 2 years ago

@Hang-Lei-NOAA Has IP v4 been installed on any of our machines?

Hang-Lei-NOAA commented 2 years ago

No, I can install it on Hera tonight.

On Wed, Sep 7, 2022 at 1:53 PM GeorgeGayno-NOAA @.***> wrote:

@Hang-Lei-NOAA https://github.com/Hang-Lei-NOAA Has IP v4 been installed on any of our machines?

— Reply to this email directly, view it on GitHub https://github.com/ufs-community/UFS_UTILS/issues/242#issuecomment-1239702473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWSMFBY72NDGLJJHMOGUITV5DJBZANCNFSM4WLFGIBQ . You are receiving this because you were mentioned.Message ID: @.***>

Hang-Lei-NOAA commented 2 years ago

It has been added on Hera.

On Wed, Sep 7, 2022 at 2:44 PM Hang Lei - NOAA Affiliate @.***> wrote:

No, I can install it on Hera tonight.

On Wed, Sep 7, 2022 at 1:53 PM GeorgeGayno-NOAA @.***> wrote:

@Hang-Lei-NOAA https://github.com/Hang-Lei-NOAA Has IP v4 been installed on any of our machines?

— Reply to this email directly, view it on GitHub https://github.com/ufs-community/UFS_UTILS/issues/242#issuecomment-1239702473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWSMFBY72NDGLJJHMOGUITV5DJBZANCNFSM4WLFGIBQ . You are receiving this because you were mentioned.Message ID: @.***>

GeorgeGayno-NOAA commented 2 years ago

To ease the transition between IP library v3.3.3 and v4.0, the rank of some arrays were changed to comply with the gdswzd and ipolates routine interface changes. Therefore, the regression tests have to be rerun using both v3.3.3 and v4.0.

First, I tested the branch at 59292b4 using IP library v3.3.3 (on Cactus). The snow2mdl, global_cycle and grid_gen regression tests all passed as expected.

GeorgeGayno-NOAA commented 1 year ago

To ease the transition between IP library v3.3.3 and v4.0, the rank of some arrays were changed to comply with the gdswzd and ipolates routine interface changes. Therefore, the regression tests have to be rerun using both v3.3.3 and v4.0.

First, I tested the branch at 59292b4 using IP library v3.3.3 (on Cactus). The snow2mdl, global_cycle and grid_gen regression tests all passed as expected.

Repeated this test on Hera. All tests passed.

GeorgeGayno-NOAA commented 1 year ago

Note: To compile with v4.0, you need to uncomment the use ipolates_mod statement in ./sorc/emcsfc_snow2mdl.fd/snow2mdl.F90 and in ./orog.fd/mtnlm7_oclsm.f and adjust the build modules.

edwardhartnett commented 1 year ago

George, I have found it best to make changes so that both versions are handled.

That is, I check in the CMake file what version I am dealing with, and then use ifdefs in the code to handle both versions of the code.

Does this make sense?

Technically we could just say ip-4.0.0 is required and users should just deal with it, but it is kinder not to make it mandatory if we don't have to...

GeorgeGayno-NOAA commented 1 year ago

George, I have found it best to make changes so that both versions are handled.

That is, I check in the CMake file what version I am dealing with, and then use ifdefs in the code to handle both versions of the code.

Does this make sense?

Technically we could just say ip-4.0.0 is required and users should just deal with it, but it is kinder not to make it mandatory if we don't have to...

That would be great. Do you have a CMake example I can look at?

edwardhartnett commented 1 year ago

I have not done it for ip, but if you look at g2 you will see it can handle two very different versions of bacio...

GeorgeGayno-NOAA commented 1 year ago

It has been added on Hera. On Wed, Sep 7, 2022 at 2:44 PM Hang Lei - NOAA Affiliate @.***> wrote:

@Hang-Lei-NOAA Can you also install the GNU version on Hera?

Hang-Lei-NOAA commented 1 year ago

@George Gayno - NOAA Affiliate @.***> I have added it under the GNU compiler option.

On Mon, Sep 12, 2022 at 5:29 PM GeorgeGayno-NOAA @.***> wrote:

It has been added on Hera. On Wed, Sep 7, 2022 at 2:44 PM Hang Lei - NOAA Affiliate @.***> wrote:

@Hang-Lei-NOAA https://github.com/Hang-Lei-NOAA Can you also install the GNU version on Hera?

— Reply to this email directly, view it on GitHub https://github.com/ufs-community/UFS_UTILS/issues/242#issuecomment-1244511011, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWSMFFVWUG2TOYIGQMVZKLV56OEBANCNFSM4WLFGIBQ . You are receiving this because you were mentioned.Message ID: @.***>

GeorgeGayno-NOAA commented 1 year ago

@Hang-Lei-NOAA Thanks for installing on Hera. Please install on Orion and Jet when you are not busy. And add it to your next NCEPLIBS upgrade on WCOSS2.

GeorgeGayno-NOAA commented 1 year ago

Commit 794304d was compiled on Orion. All consistency tests passed.

GeorgeGayno-NOAA commented 1 year ago

Tested Hang's ip v4.0 on Cactus. Using 5fbfa1f, the chgres_cube, global_cycle, grid_gen and snow2mdl consistency tests all passed.