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

Update orography code for low-res grids #1012

Merged
merged 71 commits into from
Jan 17, 2025

Conversation

GeorgeGayno-NOAA
Copy link
Collaborator

@GeorgeGayno-NOAA GeorgeGayno-NOAA commented Jan 13, 2025

DESCRIPTION OF CHANGES:

Low-resolution grids are defined as C24/C18/C12.

1 - Updates to the orography code:

  • read_global_orog and read_global_mask - A check was added to ensure the i/j-dimensions of the global data match the dimensions passed in as arguments.
  • qc_orog_by_ramp was updated to read the j-dimension of the RAMP data from the file itself, instead of being declared in the routine. This made writing a unit test easier.
  • makemt2 - variable "maxsum" is now calculated dynamically instead of being hardwired. The hardwired value was not large enough for grids coarser than C48.
  • make_mask - variable "maxsum" is not used and was removed.
  • remove_isolated_pts - This routine was originally written for the global gaussian grid. Some of the logic did not work for FV3 tiles. To fix, the check along the "east/west" tile edges was removed. Also removed was logic that was (I believe) used for reduced gaussian grids (where the number of 'i' points decreased toward the poles).
  • All I/O routines were updated to use the F90 NetCDF routines.
  • Minor corrections to the Doxygen for a few routines.
  • The gdas_init utility was updated to set the "fixed" file directory for C24/C18/C12.

2 - New unit tests for the following routines/functions:

  • find_nearest_pole_points
  • find_poles
  • get_index
  • get_lat_angle
  • get_lon_angle
  • get_xnsum
  • get_xnsum2
  • get_xnsum3
  • inside_a_polygon
  • latlon2xyz
  • minmax
  • qc_orog_by_ramp
  • read_global_mask
  • read_global_orog
  • read_mask
  • read_mdl_dims
  • read_mdl_grid_file
  • remove_isolated_pts
  • transpose_mask
  • transpose_orog

TESTS CONDUCTED:

  • Compile branch on all Tier 1 machines using Intel (Orion, Jet, Hera, Hercules and WCOSS2). Done using 64d26a4.
  • Compile branch on Hera using GNU. Done using 64d26a4.
  • Compile branch in 'Debug' mode on WCOSS2. Done on Cactus using 64d26a4. There were no warnings.
  • Run unit tests locally on any Tier 1 machine using both Intel and GNU. Done on Cactus (Intel) and Hera (GNU) using 64d26a4. All tests passed.
  • Run grid_gen consistency tests locally on all Tier 1 machines. Done on Hera, Hercules, Jet, Cactus and Orion using 64d26a4. All tests passed as expected.
  • Compile with Doxygen. Done on Cactus using 64d26a4. The orog.fd code had no warnings.

Describe any additional tests performed.

DEPENDENCIES:

None.

DOCUMENTATION:

Doxygen successfully created. See above.

ISSUE

Fixes #1000.

RELATED ISSUES

ufs-community/ufs-weather-model#2508

GeorgeGayno-NOAA and others added 30 commits November 21, 2024 20:17
George Gayno and others added 21 commits January 9, 2025 11:48
data from the file. This will make unit testing easier.
Also, update the routine to use the f90 netcdf routines.

Fixes ufs-community#1000.
9-degrees for the coarsest atmospheric resolutions.

Fixes ufs-community#1000.
@GeorgeGayno-NOAA GeorgeGayno-NOAA self-assigned this Jan 14, 2025
@GeorgeGayno-NOAA
Copy link
Collaborator Author

The gdas_init utility was run on Hera for a 2025/01/08/06z C12 case. The 'fixed' files for C12 were staged in ./orog.lowres here:

/scratch1/NCEPDEV/da/George.Gayno/ufs_utils.git/UFS_UTILS/fix $ ls -l
total 8
lrwxrwxrwx 1 George.Gayno da   48 Sep 30 13:49 am -> /scratch1/NCEPDEV/global/glopara/fix/am/20220805
-rwxr-xr-x 1 George.Gayno da 2247 Nov 19 16:48 link_fixdirs.sh
lrwxrwxrwx 1 George.Gayno da   11 Jan 15 14:44 orog -> orog.lowres
drwxr-sr-x 5 George.Gayno da 4096 Nov 21 19:14 orog.lowres
lrwxrwxrwx 1 George.Gayno da   55 Sep 30 13:49 sfc_climo -> /scratch1/NCEPDEV/global/glopara/fix/sfc_climo/20230925
/scratch1/NCEPDEV/da/George.Gayno/ufs_utils.git/UFS_UTILS/fix/orog.lowres/C12 $ ls -l
total 836
-rw-r--r-- 1 George.Gayno da 40615 Nov 22 17:48 C12.mx100_oro_data.tile1.nc
-rw-r--r-- 1 George.Gayno da 40615 Nov 22 17:48 C12.mx100_oro_data.tile2.nc
-rw-r--r-- 1 George.Gayno da 40615 Nov 22 17:48 C12.mx100_oro_data.tile3.nc
-rw-r--r-- 1 George.Gayno da 40615 Nov 22 17:48 C12.mx100_oro_data.tile4.nc
-rw-r--r-- 1 George.Gayno da 40615 Nov 22 17:48 C12.mx100_oro_data.tile5.nc
-rw-r--r-- 1 George.Gayno da 40615 Nov 22 17:48 C12.mx100_oro_data.tile6.nc
-rw-r--r-- 1 George.Gayno da 40615 Dec 10 19:28 C12.mx900_oro_data.tile1.nc
-rw-r--r-- 1 George.Gayno da 40615 Dec 10 19:28 C12.mx900_oro_data.tile2.nc
-rw-r--r-- 1 George.Gayno da 40615 Dec 10 19:28 C12.mx900_oro_data.tile3.nc
-rw-r--r-- 1 George.Gayno da 40615 Dec 10 19:28 C12.mx900_oro_data.tile4.nc
-rw-r--r-- 1 George.Gayno da 40615 Dec 10 19:28 C12.mx900_oro_data.tile5.nc
-rw-r--r-- 1 George.Gayno da 40615 Dec 10 19:28 C12.mx900_oro_data.tile6.nc
-rw-r--r-- 1 George.Gayno da 51123 Nov 21 19:14 C12_grid.tile1.nc
-rw-r--r-- 1 George.Gayno da 51123 Nov 21 19:14 C12_grid.tile2.nc
-rw-r--r-- 1 George.Gayno da 51123 Nov 21 19:14 C12_grid.tile3.nc
-rw-r--r-- 1 George.Gayno da 51123 Nov 21 19:14 C12_grid.tile4.nc
-rw-r--r-- 1 George.Gayno da 51123 Nov 21 19:14 C12_grid.tile5.nc
-rw-r--r-- 1 George.Gayno da 51123 Nov 21 19:14 C12_grid.tile6.nc
-rw-r--r-- 1 George.Gayno da 22865 Nov 21 19:14 C12_mosaic.nc
drwxr-sr-x 7 George.Gayno da  4096 Dec  9 19:40 ocean_mask
-rw-r--r-- 1 George.Gayno da   317 Dec 10 19:29 readme.C12.mx900.txt
drwxr-sr-x 2 George.Gayno da 12288 Dec 10 19:28 sfc

The utility ran to completion and successfully created model coldstart files.

@GeorgeGayno-NOAA GeorgeGayno-NOAA marked this pull request as ready for review January 15, 2025 15:33
@sanatcumar
Copy link
Collaborator

sanatcumar commented Jan 15, 2025

Hi George,
we will need the C12/18 and C24 ocean mask to test this change fully?? or we can test just the C96 to show it works ?. At some point should I generate the C12/18 an 24 ocn mask files ?

@GeorgeGayno-NOAA
Copy link
Collaborator Author

Hi George, we will need the C12/18 and C24 ocean mask to test this change fully?? or we can test just the C96 to show it works ?. At some point should I generate the C12/18 an 24 ocn mask files ?

Denise created ocean mask files for those resolutions. And I created grids using those mask files. Everything is on Hera: /scratch1/NCEPDEV/da/George.Gayno/ufs_utils.git/UFS_UTILS/fix/orog.lowres. Her code changes will be added in a subsequent PR.

These grids are being created for low resolution UFS weather model tests. I don't know if they will be officially baselined in the 'fix' directory.

This PR fixes a problem in the orog code that caused a crash at these resolutions. While fixing that error, I added some additional unit testing.

sanatcumar

This comment was marked as resolved.

Copy link
Collaborator

@sanatcumar sanatcumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the latest commit. I was able to compile with no errors. tested a default C96.mx100 grid. All grid generation related functions are unaffected. The gdas_init utility ran successfully and created model cold start files as expected for C12 and C24 cases.

@GeorgeGayno-NOAA GeorgeGayno-NOAA merged commit d4f0db2 into ufs-community:develop Jan 17, 2025
4 checks passed
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.

Very low-resolution grids
2 participants