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

Remove goto statements from chgres_cube #775

Merged
merged 29 commits into from
Mar 23, 2023

Conversation

akubaryk
Copy link
Contributor

@akubaryk akubaryk commented Feb 16, 2023

DESCRIPTION OF CHANGES:

The WAM option of chgres_cube uses routines from NRLMSISE-00, which contain numerous 'goto' statements. Replace it with the more current MSIS 2.1 library (which has no 'goto' statements).

TESTS CONDUCTED:

Regression test run for WAM confirmed to function -- regression test baseline will need updating.

DEPENDENCIES:

N/A

DOCUMENTATION:

N/A

ISSUE:

Related to #759

@GeorgeGayno-NOAA
Copy link
Collaborator

@akubaryk I will review. Be sure to merge the latest updates from 'develop' to your branch.

@GeorgeGayno-NOAA
Copy link
Collaborator

@akubaryk I was able to compile your branch. But when I tried to run our WAM-based regression test, it broke. May I update your branch with some fixes?

GeorgeGayno-NOAA and others added 15 commits February 24, 2023 21:31
Increase the number of characters to hold the parm file
in msis_init.F90.

Fixes ufs-community#759.
Update unit test to read in the check values and
compare them against the computed values.

Fixes ufs-community#759.
Remove old input value file.

Add comments to unit test.

Fixes ufs-community#759.
@GeorgeGayno-NOAA
Copy link
Collaborator

@akubaryk please merge in the latest updates from 'develop'. Then, I will do some final testing and merge.

@GeorgeGayno-NOAA GeorgeGayno-NOAA changed the title removing goto statements (toward addressing #759) Remove goto statements from chgres_cube (#775) Mar 15, 2023
@GeorgeGayno-NOAA GeorgeGayno-NOAA changed the title Remove goto statements from chgres_cube (#775) Remove goto statements from chgres_cube Mar 15, 2023
@GeorgeGayno-NOAA
Copy link
Collaborator

@akubaryk The chgres_cube routines should have doxygen. I added it to wam_climo_data.f90 at eb12905. Please check. And replace the ??? with correct comments. We don't need doxygen in the msis library.

@GeorgeGayno-NOAA
Copy link
Collaborator

@akubaryk I had to fix a bug with the unit test (35edbed). It would not compile on WCOSS2.

@akubaryk
Copy link
Contributor Author

akubaryk commented Mar 16, 2023

I have pulled in the latest updates and added some details to the doxygen in wam_climo_data.

@GeorgeGayno-NOAA
Copy link
Collaborator

Before merging, run some final tests using the @akubaryk branch at f8bec8a.

On Dogwood, the branch was compiled successfully, the unit tests ran successfully, and the doxygen was created without warnings. The c96.fv3.netcdf2wam.sh regression test failed as expected due to differences between the new NRLMSIS2.1 library and the old NRLMSISE-00 library. Here are the differences from the baseline:

CHECK out.atm.tile1.nc          + /lfs/h2/emc/global/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp -dmfqS out.atm.tile1.nc /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/chgres_cube/baseline_data/c96_fv3_netcdf2wam/out.atm.tile1.nc
Variable Group   Count          Sum      AbsSum          Min       Max     Range         Mean     StdDev
zh       /      663539 -8.49367e+08 8.75024e+08     -3315.59   538.305    3853.9     -1280.06    1289.55
t        /      663551 -3.55417e+06 4.44218e+06     -30.7631   10.0412   40.8043     -5.35628    9.01491
spo      /      738534     -395.629     1852.24   -0.0137775  0.014633 0.0284105 -0.000535695 0.00405962
spo2     /     1382398      7412.28        7519 -7.54148e-05 0.0297442 0.0298196    0.0053619 0.00911125
CHECK out.atm.tile2.nc+ /lfs/h2/emc/global/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp -dmfqS out.atm.tile2.nc /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/chgres_cube/baseline_data/c96_fv3_netcdf2wam/out.atm.tile2.nc
Variable Group   Count          Sum      AbsSum          Min       Max     Range         Mean     StdDev
zh       /      663536 -8.49367e+08 8.75024e+08     -3315.62   538.305   3853.93     -1280.06    1289.55
t        /      663550 -3.55417e+06 4.44218e+06     -30.7631   10.0412   40.8043     -5.35629    9.01491
spo      /      738534     -395.629     1852.24   -0.0137775  0.014633 0.0284105 -0.000535695 0.00405962
spo2     /     1382400      7412.28     7518.99 -7.53999e-05 0.0297442 0.0298196    0.0053619 0.00911124
CHECK out.atm.tile3.nc+ /lfs/h2/emc/global/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp -dmfqS out.atm.tile3.nc /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/chgres_cube/baseline_data/c96_fv3_netcdf2wam/out.atm.tile3.nc
Variable Group   Count        Sum      AbsSum          Min        Max     Range        Mean     StdDev
zh       /      663537 2.1573e+07 2.49348e+08     -2021.16    640.953   2662.11     32.5122     493.91
t        /      663528    -292958  2.0573e+06     -21.8264    13.1463   34.9727   -0.441515     4.6316
spo      /      730818   -4824.29     5060.36   -0.0281621 0.00245656 0.0306187 -0.00660121 0.00826247
spo2     /     1382397    4419.19     4528.03 -7.54297e-05  0.0229874 0.0230628  0.00319676 0.00569511
CHECK out.atm.tile4.nc+ /lfs/h2/emc/global/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp -dmfqS out.atm.tile4.nc /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/chgres_cube/baseline_data/c96_fv3_netcdf2wam/out.atm.tile4.nc
Variable Group   Count          Sum      AbsSum          Min       Max     Range         Mean     StdDev
zh       /      663536 -8.47257e+08 8.73199e+08     -3315.47    540.93    3856.4     -1276.88    1288.74
t        /      663552 -3.54576e+06 4.43764e+06      -30.763    10.078    40.841     -5.34361    9.00888
spo      /      738485     -408.134      1857.3   -0.0142339 0.0145697 0.0288036 -0.000552665 0.00406604
spo2     /     1382400       7403.1     7509.76 -7.54148e-05 0.0297441 0.0298196   0.00535525 0.00910279
CHECK out.atm.tile5.nc+ /lfs/h2/emc/global/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp -dmfqS out.atm.tile5.nc /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/chgres_cube/baseline_data/c96_fv3_netcdf2wam/out.atm.tile5.nc
Variable Group   Count          Sum      AbsSum          Min       Max     Range         Mean     StdDev
zh       /      663535 -8.47257e+08 8.73199e+08     -3315.47    540.93    3856.4     -1276.88    1288.74
t        /      663552 -3.54576e+06 4.43764e+06      -30.763    10.078    40.841     -5.34361    9.00888
spo      /      738485     -408.134      1857.3   -0.0142339 0.0145697 0.0288036 -0.000552665 0.00406604
spo2     /     1382400      7403.08     7509.79 -7.54148e-05 0.0297441 0.0298196   0.00535524  0.0091028
CHECK out.atm.tile6.nc+ /lfs/h2/emc/global/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp -dmfqS out.atm.tile6.nc /lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/chgres_cube/baseline_data/c96_fv3_netcdf2wam/out.atm.tile6.nc
Variable Group   Count          Sum      AbsSum          Min       Max     Range        Mean     StdDev
zh       /      663548 -7.57984e+08 7.87663e+08        -3063   308.344   3371.34    -1142.32    1144.93
t        /      663552 -3.24153e+06 3.89588e+06     -26.0903   5.46359   31.5539    -4.88513    7.72334
spo      /      748988     -977.463      2382.9   -0.0127479 0.0152791  0.028027 -0.00130505  0.0049774
spo2     /     1382400      7159.98      7265.3 -7.53999e-05 0.0292095 0.0292849  0.00517938 0.00848134

These differences were checked by the developers and found to be correct. Output from the regression test was used to coldstart the forecast model without problems.

@GeorgeGayno-NOAA
Copy link
Collaborator

GeorgeGayno-NOAA commented Mar 16, 2023

The branch at f8bec8a was then compiled on Jet, Hera and Orion. The unit tests ran successfully. The c96.fv3.netcdf2wam.sh regression test failed as expected. Differences from the baseline were nearly identical to those on Dogwood.

On Hera, the branch was also compiled using the GNU compiler. The unit tests ran successfully. The regression test failed, but the differences from the baseline were nearly identical to those using Intel.

@GeorgeGayno-NOAA
Copy link
Collaborator

@akubaryk I will update your branch with the latest changes from develop, then merge it. Thanks for all your work.

@GeorgeGayno-NOAA GeorgeGayno-NOAA merged commit 4494bd2 into ufs-community:develop Mar 23, 2023
AnnetteGibbs-NOAA added a commit to AnnetteGibbs-NOAA/UFS_UTILS that referenced this pull request Jul 3, 2023
* origin/develop:
  Update ccpp submodule (ufs-community#827)
  Change length of character variable "mosaic_name" in "make_solo_mosaic.c" (ufs-community#824)
  Update GDAS INIT utility for GFS COM reorganization (ufs-community#820)
  Add backup calculation for orography and mask generation (ufs-community#713)
  Improve repository build script (ufs-community#819)
  Use latest wgrib2 executable on Jet. (ufs-community#816)
  chgres_cube - Minor update for high-resolution grids . (ufs-community#814)
  Update PR template (ufs-community#813)
  global_cycle - Add soil moisture nudging for NoahMP option (ufs-community#809)
  Release v1.10.0 (ufs-community#807)
  Run sfc_climo_gen utility on Hera (ufs-community#791)
  Fix bug in chgres_cube subroutine search_many (ufs-community#808)
  sfc_climo_gen - Output fractions of each vegetation/soil type category (ufs-community#748)
  Replace w3nco library with w3emc (ufs-community#802)
  Fix Debug compilation (ufs-community#800)
  Update WCOSS2 build module to use new ESMF v8.4.1 library. (ufs-community#799)
  Update chgres_cube documentation for duplicate grib2 records (ufs-community#795)
  Use latest Cray modules on WCOSS2 (ufs-community#792)
  Remove checksum attribute from global_cycle restart files (ufs-community#794)
  Remove goto statements from chgres_cube (ufs-community#775)
  FVCOM_TOOLS - Remove dependency on module_nwp_base.f90 (ufs-community#790)
  Remove "gcovr" step from the 'developer' workflow (ufs-community#785)
  Update build module for Cheyenne (ufs-community#783)
  GDAS Init utility - consolidate the copy of coldstart files (ufs-community#773)
  Remove support for ODIN machine (ufs-community#782)
  Update GDAS INIT utility to optionally use fracoro data (ufs-community#741)
  Option to build only application specific utilities (e.g. GFS) (ufs-community#777)
  Use combined IP/IP2 library (ufs-community#695)
  Initial updates to global_cycle for Noah-MP land model (ufs-community#774)
  New resolution options for the cpld_gridgen utility (ufs-community#769)
  Use new EPIC-maintained hpc-stack on Jet  (ufs-community#771)
  Update GDAS initialization scripts for the new ENKF directory (ufs-community#764)
  Reduce memory usage in chgres_cube (ufs-community#766)
  Detect duplicate vertical levels in chgres_cube. (ufs-community#767)
  Point to new input orography directory. (ufs-community#758)
  Release version 1.9 (ufs-community#754)
  HAFSv1 grid nesting updates (ufs-community#752)
  Remove compiler warnings from chgres_cube (ufs-community#747)
  chgres_cube: Split input_data module into to 3 separate modules (ufs-community#744)
  More work on CI, checking with different versions of ESMF (ufs-community#742)
  Add processing of soil color to sfc_climo_gen (ufs-community#721)
  more work on CI - added Linux_versions workflow (ufs-community#739)
  Add TEST_FILE_DIR option to CMake build, where test data files can be found instead of using FTP.  (ufs-community#732)
  adding developer workflow (ufs-community#724)
  Update GDAS INIT utility for v16.3. (ufs-community#723)
  OROG_GSL - Remove negative bias in orographic asymmetery (OA) fields (ufs-community#718)
  Incorporate BNU soil type data (ufs-community#717)
  High-resolution MODIS and STATSGO veg/soil data. (ufs-community#703)
  Run WCOSS2 consistency tests under role account (ufs-community#711)
  Fix macOS CI workflow (ufs-community#715)
  Add utility codes to create BNU soil texture data (ufs-community#707)
  Update chgres_cube to output netcdf4 file. (ufs-community#704)
  Incorporate high-res global VIIRS vegetation data. (ufs-community#699)
  Run grid_gen consistency tests in parallel. (ufs-community#697)
  Fix error handling in "link_fixdirs.sh". Add -L to the copy command. (ufs-community#701)
  Update for new fixed data directory structure (ufs-community#688)
  Add WCOSS2 support for tests (ufs-community#693)
  Increase test data pull timeout (ufs-community#692)
  Option to install binaries to any directory. (ufs-community#685)
  Update global_cycle to use the latest CCPP version of sfcsub.F (ufs-community#671)
  Incorporate weight_gen program. (ufs-community#677)
  Add install of jpeg-turbo to macos workflows (ufs-community#684)
  Improve logic in regression test driver script (ufs-community#681)
  Release v1.8 (ufs-community#679)
  Update link_fixdirs.sh for new data directories (ufs-community#672)
  Update default ice climatology in ./ush/global_cycle.sh. (ufs-community#664)
  Remove all references to WCOSS 1 from UFS_UTILS (ufs-community#667)
  Update workflows to use latest macOS and ubuntu (ufs-community#675)
  Update GDAS Initialization utility for recent HPSS tarball name change (ufs-community#666)
  Port UFS_UTILS to WCOSS2 (ufs-community#642)
  Fix chgres_cube to process GEFS GRIB2 data (ufs-community#658)
  Update global_cycle_driver.sh for GFS OPS directory convention  (ufs-community#655)
  Update documentation for SRW App (ufs-community#656)
  New coupled model utility (ufs-community#647)
  Update support for S4 and enable regression testing (ufs-community#654)
  global_cycle - Link to CCPP version of sfcsub.F (ufs-community#636)
  Add processing of new global AFWA snow data to emcsfc_snow2mdl. (ufs-community#648)
  Update build module on Cheyenne (ufs-community#646)
  Move to Intel 2022 on Jet, Hera and Orion (ufs-community#650)
  Host doxygen documentation for multiple releases (ufs-community#644)
  Download unit test data as part of the CMake build (ufs-community#630)
  chgres_cube - Complete removal of wgrib2 library (ufs-community#641)
  Eliminate circular dependency in chgres_cube
  Update workflow files to pull netcdf-c library from GitHub
  chgres_cube - Remove the wgrib2 library from the GRIB2 data read routines.
  Undefined symbols on macOS with Intel compiler (ufs-community#628)
  Update FVCOM code to handle sub-domain restart files using multiple cores. (ufs-community#624)
  chgres_cube - Run routine 'convert_omega' on all tasks. (ufs-community#627)
  Use ESMF 8.2.0 library
  Automate update of consistency test baseline data. (ufs-community#603)
  Update workflow files to use newer versions of ESMF and NCEPLIBS. (ufs-community#617)
  Update build modules to be lua compliant (ufs-community#614)
  Allow FVCOM tools to Update Ice Surface Roughness Length (ufs-community#604)
  Update the requested memory in the Orion chgres_cube consistency test script (ufs-community#611)
  Use copy of grib_util under Jet role account. (ufs-community#608)
  Run consistency tests on Orion using role account (ufs-community#606)
  Run consistency tests on Hera using role account (ufs-community#605)
  Run consistency tests on Jet using role account. (ufs-community#607)
  Update more documentation after move to ufs-community (ufs-community#597)
  fvcom_tools - Add option to process 'cold' or 'warm' restart files (ufs-community#595)
  Update documentation after move to ufs-community (ufs-community#594)
  chgres_cube - Eliminate segmentation fault in input_data.F90 (ufs-community#585)
  Update to language of unit test README to match that in unit test.
  chgres_cube - Simplify surface processing using field bundles (ufs-community#572)
  Add compiler flags for GNU Fortran v10 or newer compilers. (ufs-community#583)
  Move verbose output from example unit test to be commented to streamline test output.
  Updates to test README to add instructions for use of example unit test.
  Add Findwgrib2.cmake (ufs-community#578)
  Added unit test to be used as an instructional example for new users.
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.

2 participants