ufs-community / UFS_UTILS

Utilities for the NCEP models.
Other
20 stars 103 forks source link

compile warnings in UFS_UTILS code #959

Open MatthewPyle-NOAA opened 1 month ago

MatthewPyle-NOAA commented 1 month ago

NCO has gotten more strict about compile warnings in code being delivered for operations. In a review of the RRFS codes, I saw a very limited number of warnings (four total) from UFS_UTILS, all in the same routine.

/lfs/h2/emc/lam/noscrub/Matthew.Pyle/rrfs-workflow_warnings/sorc/UFS_UTILS/sorc/fre-nctools.fd/shared_lib/create_xgrid.c(1602): warning #266: function "insertIntersect" declared implicitly
            insertIntersect(grid1List, intersect[0], intersect[1], intersect[2], 0.0, u2, inbound, p1_1[0], p1_1[1], p1_1[2]);

Is it possible to clean up the code to avoid these warnings?

GeorgeGayno-NOAA commented 1 month ago

Agree that all warnings should be addressed.

Does the RRFS need that particular program? It is straightforward to build only the programs needed by RRFS. That is a quick workaround.

MatthewPyle-NOAA commented 1 month ago

Looks like we're building everything, and we definitely don't need all of them. I'll try to get you the list of what we actually use from UFS_UTILS within RRFS today or tomorrow.

MatthewPyle-NOAA commented 1 month ago

We are using more than I first realized, mainly due to a cold started, locatable RRFS fire weather domain. Will bring in @BenjaminBlake-NOAA to make sure I have these details correct.

But based on grepping in scripts, I think we are potentially using:

chgres_cube filter_topo fvcom_to_FV3 global_equiv_resol make_hgrid make_solo_mosaic orog orog_gsl regional_esg_grid sfc_climo_gen shave

And we are not using:

fregrid inland lakefrac ocean_merge

So definitely looks like we can turn off the fregrid item creating the warnings, among a few other things.

BenjaminBlake-NOAA commented 1 month ago

@MatthewPyle-NOAA We are also not using make_hgrid. There is an option in the make_grid task for using the GFDLgrid instead of the ESGgrid, and that option does use make_hgrid, but it is not needed for RRFSv1. Otherwise your list looks correct to me - thanks for checking

GeorgeGayno-NOAA commented 4 weeks ago

We are using more than I first realized, mainly due to a cold started, locatable RRFS fire weather domain. Will bring in @BenjaminBlake-NOAA to make sure I have these details correct.

But based on grepping in scripts, I think we are potentially using:

chgres_cube filter_topo fvcom_to_FV3 global_equiv_resol make_hgrid make_solo_mosaic orog orog_gsl regional_esg_grid sfc_climo_gen shave

And we are not using:

fregrid inland lakefrac ocean_merge

So definitely looks like we can turn off the fregrid item creating the warnings, among a few other things.

Do you know how to turn off the compilation of fregrid? I can give instructions if you want.

MatthewPyle-NOAA commented 4 weeks ago

@GeorgeGayno-NOAA I think I know how to do it by modifying the CMakeLists.txt file (perhaps adding an RRFS option like the GFS option and shutting off the unwanted items). But not clear to me how to get this into an updated RRFS tag in the repository.

GeorgeGayno-NOAA commented 4 weeks ago

@GeorgeGayno-NOAA I think I know how to do it by modifying the CMakeLists.txt file (perhaps adding an RRFS option like the GFS option and shutting off the unwanted items). But not clear to me how to get this into an updated RRFS tag in the repository.

To avoid modifying CMakeLists.txt you can add -DFRENCTOOLS=OFF to the cmake command. Ex:

cmake -DFRENCTOOLS=OFF

GeorgeGayno-NOAA commented 1 week ago

The warning is removed with the changes at 442bdc5. The change affects the fregrid, make_hgrid and make_solo_mosaic executables, which are used in the grid generation process. All grid_gen regression tests passed on Orion.

GeorgeGayno-NOAA commented 1 week ago

Successfully compiled on WCOSS2 in 'debug' mode using 442bdc5.