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

Adding code to convert the 2-D Wave Height and Wind Gust fields between Extended Schimdt Gnomonic (ESG) grid and Rotated LatLon (RLL) grid for rrfs-based 3drtma #71

Merged

Conversation

GangZhao-NOAA
Copy link
Contributor

@GangZhao-NOAA GangZhao-NOAA commented Aug 6, 2024

A tool to convert the 2-D Wave Height and Wind Gust fields between Extended Schimdt Gnomonic (ESG) grid and Rotated LatLon (RLL) grid for RRFS-based 3DRTMA

DESCRIPTION OF CHANGES:

One or more paragraphs describing the problem, solution, and required changes.

Motivation
The rrfs-based 3DRTMA needs to analyze the 2-D significant wave height and 10-m wind gust, which are not the prognostic variables of fv3-lam model. Instead of the Extended Schmidt Gnomonic (ESG) grid of fv3-lam model. Prior to the analysis, the firstguess of these 2 variables retrieved from other sources (e.g., WW3) are defined on Rotated LatLon (RLL) grid, therefore the firstguess of these two variables need to be transferred from RLL grid to ESG grid to prepare for the GSI analysis, so that these two data could be analyzed with other FV3-lam variables together in GSI. Then after the analysis, the analysis fields are defined on ESG grid and need to be converted to RLL grid which is recognizable to the Universal Post-Process (UPP). But those 2 variables (wave height and gust) could not be transferred to RLL grid through the fv3-lam model forecast, so we also need to convert the analyses of the two variables back from ESG grid to RLL grid. This is the motivation to develop a tool to convert ESG grid to Rotated grid and vice versa for analysis of wave height and wind gust in rrfs-based 3DRTMA.

Solution
Developing FORTRAN code, which reads in 2-D field (from grib2 format firstguess files) on Rotated LatLon (RLL) grid, then interpolates the data to ESG grid , then append the 2-D field to the netcdf format fv3-lam firstguess file before the GSI analysis; or reads in 2-D fields (from netcdf format GSI analysis file) on ESG grid, then interpolates (and extrapolates for some points) the data to RLL grid (if this is after analysis, then better interpolates the analysis increments), then dump out the data into netcdf format files. There are some special variable-dependent treatments: for example, the value of wave height and wind gust must be non-negative, the analysis of wave height should be set as undefined value over the land area, etc.

Note
This code needs the support of NCEP IP library. There are two different versions of IP lib installed -- v4.3.0 on Hera and v3.0.2 on WCOSS2, and there are significant changes between them. IP lib v4 and above could work with grib1 and grib2 both, but IP lib v3 supports grib1 only. This regriding tool is designed to work with both IP lib v3.x and v4.x, and has been tested successfully on Hera and WCOSS2.

TESTS CONDUCTED:

  1. The code has been tested on WCOSS2, Hera and Jet. It could be compiled successfully and running with correct results.
  2. As mentioned above, this code uses IP lib v3.0.2 on WCOSS2, and IP lib v4.3.0 on Hera. Because IP lib v3.0.2 uses grib1 which comes with 3-digit precision after decimal point, but IP lib v4 with 6-digit precision. so the results with lib v3 are not IDENTICAL to results with lib v4, but the differences are trivial.

DEPENDENCIES:

This PR is dependent on the PR #67 (relying on "MGBF" lib).

DOCUMENTATION:

ISSUE:

Fixes issue mentioned in #65

CONTRIBUTORS (optional):

Jim Purser (NCEP/EMC): ESG library.

between the Extended Schmidt Gnomonic (ESG) grid and the rotated
latlon (RLL) grid.
Copy link
Collaborator

@guoqing-noaa guoqing-noaa left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -86,6 +87,8 @@ find_package(gsi REQUIRED)
add_subdirectory(baselib/regional_esg_grid.fd)
add_subdirectory(baselib)

add_subdirectory(rtma_esg_conversion.fd/esg_lib.fd)

Choose a reason for hiding this comment

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

@GangZhao-NOAA Is that ok to also put the add_subdirectory line to the following foreach loop as for other tools?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TingLei-NOAA
Hi Ting,

Technically I agree with you that, by adding a line as following,
list(APPEND SUBLIST "RTMA_ESG_CONVERSION.fd/ESG_LIB")
then the add_subdirectory line you mentioned -- "add_subdirectory(rtma_esg_conversion.fd/esg_lib.fd)" could be put into the following foreach loop.

However, as you also mentioned, that foreach loop is used to define each application tool (ie., the executables). As for the "rtma_esg_conversion.fd/esg_lib.fd", it is a library which some RRFS tools could depend on and link to , but not a application tool. So I would like to put this line "add_subdirectory(rtma_esg_conversion.fd/esg_lib.fd)" here together with the declarations of the other libraries (e.g., baselib, gsi lib, etc.).

Thank you!

-Gang

Choose a reason for hiding this comment

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

Gang, Thanks a lot for your explanation. I totally agree. This also follows the existing layout of this project.

@TingLei-NOAA
Copy link

The cmakefiles and how this part is added to rrfs_utl is following the same strategy of rrfs_ult organization.
I haven't reviewed the sources codes and presume they are verified by the developers.
Hence, I approved this PR.

@GangZhao-NOAA
Copy link
Contributor Author

GangZhao-NOAA commented Sep 13, 2024 via email

@guoqing-noaa guoqing-noaa merged commit bed91f7 into NOAA-GSL:develop Sep 13, 2024
1 check 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.

4 participants