Skip to content

Updates to support UPP use with MPAS#1018

Merged
WenMeng-NOAA merged 21 commits into
NOAA-EMC:developfrom
jaymes-kenyon:mpas
Aug 27, 2024
Merged

Updates to support UPP use with MPAS#1018
WenMeng-NOAA merged 21 commits into
NOAA-EMC:developfrom
jaymes-kenyon:mpas

Conversation

@jaymes-kenyon
Copy link
Copy Markdown
Contributor

This PR contains the initial modifications to support UPP functionality with MPAS (specifically, MPASSIT-generated netCDF history files). A newINITPOST_MPAS.F interface is proposed, copied from INITPOST.F. Several static control files are also included; these control files are currently in use by GSL in its real-time HFIP and RRFS-MPAS runs.

This PR addresses issue #1008. Thanks to @SamuelTrahanNOAA for the help in making changes to getVariable.f and getIVariableN.f.

@WenMeng-NOAA WenMeng-NOAA linked an issue Aug 20, 2024 that may be closed by this pull request
@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

@jaymes-kenyon Do you have the sample MPAS model outputs for my UPP standalone test?

@jaymes-kenyon
Copy link
Copy Markdown
Contributor Author

@WenMeng-NOAA — Here's a sample netCDF file on Hera; it's a 12-h forecast from the RRFS-MPAS prototype configuration (3-km CONUS):
/scratch2/BMC/wrfruc/kenyon/sample/rrfs_mpas/2024082100/MPAS-A_out.2024-08-21_12.00.00.nc

Here's an example "itag" file for testing (note the MODELNAME, SUBMODELNAME, and fileNameFlat):

&model_inputs
fileName='/mnt/lfs4/BMC/wrfruc/kenyon/mpas_upp/rrfs/2024082100/MPAS-A_out.2024-08-21_12.00.00.nc'
fileNameFlux='/mnt/lfs4/BMC/wrfruc/kenyon/mpas_upp/rrfs/2024082100/MPAS-A_out.2024-08-21_12.00.00.nc'
IOFORM='netcdfpara'
grib='grib2'
DateStr='2024-08-21_12:00:00'
MODELNAME='RAPR'
SUBMODELNAME='MPAS'
fileNameFlat='postxconfig-NT-rrfs_mpas.txt'
/

Thanks for the testing!

@WenMeng-NOAA WenMeng-NOAA added the Ready for Review This PR is ready for code review. label Aug 23, 2024
@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

@jaymes-kenyon Thanks for sharing with me your itag. My test results are at /home/Wen.Meng/stmp2/mpas_2024082112 on Hera. Please validate and let me if you see issues.
PS. I would suggest to remove the line "fileNameFlat=..." in tag. The 'fileNameFlat' input is not needed for ingesting WRFIO model output, like rap/hrrr/mpas.

@jaymes-kenyon
Copy link
Copy Markdown
Contributor Author

@WenMeng-NOAA — Thanks! Your test results look good.

Thanks also for the clarification regarding the use of "fileNameFlat" within the itag file (for WRFIO applications). I see now that WRFPOST.F specifies a default name (fileNameFlat='postxconfig-NT.txt'). So, the chosen flat file just needs to be linked within the run directory as this default name.

Another MPAS-related PR will likely be ready soon, but I wanted to get this PR done first. Thanks again!

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

@jaymes-kenyon Thanks for verifying. In my test, I didn't add the entry "fileNameFlat" in itag. Instead, I copied file 'postxconfig-NT-rrfs_mpas.txt" into the run directory and rename as 'postxconfig-NT.txt'.
BTW we will proceed your PR to the merging process.

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

The github workflow failed at GCC Linux build. Do you know the root cause? @SamuelTrahanNOAA @AlexanderRichert-NOAA @jaymes-kenyon

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

@FernandoAndrade-NOAA You may start the UPP RTs on R&D machines. There should be no baseline updates with this PR.

@jaymes-kenyon
Copy link
Copy Markdown
Contributor Author

@WenMeng-NOAA — It seems to be failing in getVariable.f and getIVariableN.f (both changed in this PR) due to "undefined reference to ext_ncd_get_var_ti_real_ ".

Specifically, getVariable.f and getIVariableN.f now use calls to ext_ncd_get_var_ti_real, which is a subroutine within NCEPlibs-wrf_io (https://github.com/NOAA-EMC/NCEPLIBS-wrf_io). Is this library available in the automatic testing setup?

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

The UPP RTs have been successfully completed on WCOSS2 without baseline changes.

@epic-cicd-jenkins
Copy link
Copy Markdown
Collaborator

Orion UPP Regression Tests FAILED

@epic-cicd-jenkins
Copy link
Copy Markdown
Collaborator

Hera UPP Regression Tests FAILED

@epic-cicd-jenkins
Copy link
Copy Markdown
Collaborator

Hercules UPP Regression Tests FAILED

@FernandoAndrade-NOAA
Copy link
Copy Markdown
Contributor

Please ignore the Jenkins failures, I will run manually.

@FernandoAndrade-NOAA
Copy link
Copy Markdown
Contributor

RTs showed no changes across Hera, Hercules, and Orion. @WenMeng-NOAA I'm assuming we will be waiting for additional comments on the CI failures before the merge.

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

@FernandoAndrade-NOAA I successfully built an UPP executable with GNU compiler on Hera (See /home/Wen.Meng/stmp2/jaymes/UPP/tests/compile_upp_guc.log). I would think the CI workflow should be updated with this PR. Since we have completed the UPP RTs on WCOSS2 and R&D machines, we could skip this CI issue and address it later. Please let me know your thoughts.

@AlexanderRichert-NOAA
Copy link
Copy Markdown
Contributor

AlexanderRichert-NOAA commented Aug 26, 2024

This appears to be a problem with the CMake configuration, and I would strongly recommend against merging as is. Specifically, the modifications to getIVariableN.f & getVariable.f use subroutines from wrf_io, but wrf_io isn't being found because BUILD_WITH_WRFIO is not enabled. Note that in CMakeLists.txt, lines 156-157, the inclusion of getIVariableN.f and getVariable.f is unconditional (specifically, it doesn't depend on BUILD_WITH_WRFIO being enabled). So I imagine you'll want to either make it conditional, or always use wrf_io.

@SamuelTrahanNOAA
Copy link
Copy Markdown
Contributor

What happens if the CMakeLists change is reverted?

We could explicitly enable the build with wrfio when using MPAS.

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

@AlexanderRichert-NOAA @SamuelTrahanNOAA Thanks for comments on narrowing down the checklist. In the CMakelist.txt, the default setting is "build without WRF-IO lib. @jaymes-kenyon Could you change "OFF" to "ON" in that line in your branch to see if it resolve the CI issue?

@SamuelTrahanNOAA
Copy link
Copy Markdown
Contributor

SamuelTrahanNOAA commented Aug 26, 2024

I found the problem: io_int_stubs.f lacks ext_ncd_get_var_ti_real

The correct fix is to add the missing stub.

EDIT: I mistyped the subroutine name. It ends with _real, not _integer.

@SamuelTrahanNOAA
Copy link
Copy Markdown
Contributor

@jaymes-kenyon - Please merge this pull request to your branch:

It'll add the missing stub so your branch can compile without the wrf-io library.

add `ext_ncd_get_var_ti_real` stub so UPP can compile without wrf-io library
@SamuelTrahanNOAA
Copy link
Copy Markdown
Contributor

All three github tests passed. It seems the fixed worked. Do you want to retest other platforms? Or are the github tests sufficient for a fix of adding one stub?

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

All three github tests passed. It seems the fixed worked. Do you want to retest other platforms? Or are the github tests sufficient for a fix of adding one stub?

@SamuelTrahanNOAA Thanks for the fix. The UPP RTs are conducted with WRF_IO enabled. I will rerun the RTs on WCOSS2 to confirm.

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

Re-ran the UPP RTs on WCOSS2. No baseline update is needed.

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

@FernandoAndrade-NOAA Please approval this PR for merging process.

Copy link
Copy Markdown
Contributor

@SamuelTrahanNOAA SamuelTrahanNOAA left a comment

Choose a reason for hiding this comment

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

These code changes have the Official Sam Seal of Approval: 🦭👍

Keep up the good job, everyone!

@WenMeng-NOAA
Copy link
Copy Markdown
Collaborator

This PR is ready for merging.

@WenMeng-NOAA WenMeng-NOAA merged commit f5e4a18 into NOAA-EMC:develop Aug 27, 2024
DavidHuber-NOAA added a commit to DavidHuber-NOAA/UPP that referenced this pull request Sep 9, 2024
* origin/develop:
  Updates to support MPAS applications (RRFS and HFIP) (NOAA-EMC#1029)
  Add 6-hrly max winds at 10m to SFS (NOAA-EMC#1019)
  Update jet.lua (NOAA-EMC#1027)
  Updates to support UPP use with MPAS (NOAA-EMC#1018)
  [develop]: Turn on WARN_AS_ERROR for Doxygen Documentation Builds (NOAA-EMC#1023)
  Sample PR for testing (NOAA-EMC#1007)
  Enable template 4-49 to obtain aerosol ensemble information (NOAA-EMC#1011)
  Relocate gfs/gefs/sfs control files (NOAA-EMC#990)
  update g2tmp on aws to 1.12.0 (NOAA-EMC#996)
  [develop]: Update requirements files (NOAA-EMC#994)
  Bump zipp from 3.17.0 to 3.19.1 in /doc/UserGuide (NOAA-EMC#991)
  remove stack-python load for Gaea build (NOAA-EMC#993)
  Bump certifi from 2024.2.2 to 2024.7.4 in /doc/UserGuide (NOAA-EMC#988)
  [develop]: Add Doxygen variable definitions to modules (NOAA-EMC#965)
  Read bucket either as an integer or float (NOAA-EMC#984)
  Update Orion module file for Rocky 9 upgrade (NOAA-EMC#987)
  UPP bugfixes for inline post and g2tmpl 1.12.0 compatibility (and number concentration updates) (NOAA-EMC#974)
  Sync the RRFS hotfix NOAA-EMC#967 and NOAA-EMC#968. (NOAA-EMC#979)
  Bump urllib3 from 2.2.1 to 2.2.2 in /doc/UserGuide (NOAA-EMC#981)
  Fix for hydrostatic runs - write out Omega and HGT from model output (NOAA-EMC#959)
  Bump requests from 2.31.0 to 2.32.0 in /doc/UserGuide (NOAA-EMC#963)
  Correct rt.sh paths (NOAA-EMC#957)
  Updates to use GRIB2 template 4.9 for QPFFFG and QPFARI variables in RRFS (NOAA-EMC#929)
  Add hourly averaged smoke PM2.5 and dust PM10 (NOAA-EMC#917)
  Update Namelist documentation for all namelist options (NOAA-EMC#940)
  update gtg code revision to v.4.16.3 (NOAA-EMC#954)
  Bump jinja2 from 3.1.3 to 3.1.4 in /doc/UserGuide (NOAA-EMC#953)
  Clean up labeling for 15-min accumulated fields (NOAA-EMC#948)
  Updates to the GSL exp1 ceiling diagnostic (NOAA-EMC#947)
  Additional RT log information (NOAA-EMC#941)
  add cmake load to modulefile/gaea.lua (NOAA-EMC#945)
  RRFS updates (NOAA-EMC#938)
  add module for AWS (NOAA-EMC#934)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MPAS Ready for Review This PR is ready for code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New UPP branch for MPAS-related development?

6 participants