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

simpler parm/makefile #788

Merged

Conversation

SamuelTrahanNOAA
Copy link
Contributor

@SamuelTrahanNOAA SamuelTrahanNOAA commented Sep 19, 2023

Replaces parm/makefile with a simpler one that will be easier to maintain.

Regression tests will not test these changes. Instead, you must regenerate the text files. Ensure that both make clean and make work. The resulting txt files should be identical to the ones in the repository.

This script will do that for you. If it prints "SUCCESS" at the end, then the test passed. Otherwise, the test failed.

Expand for test script
#! /bin/bash

# Ensure the test fails if any step failed.
set -xue

# This is the list of all txt files generated by the old makefile.
all_txt_files='postxconfig-NT-GFS.txt postxconfig-NT-GFS-GOES.txt postxconfig-NT-GFS-ANL.txt
postxconfig-NT-GFS-F00.txt postxconfig-NT-GFS-FLUX.txt postxconfig-NT-GFS-FLUX-F00.txt
postxconfig-NT-NMM.txt postxconfig-NT-NGAC.txt postxconfig-NT-GEFS.txt postxconfig-NT-GEFS-F00.txt
postxconfig-NT-hafs_sat.txt postxconfig-NT-hafs_nosat.txt postxconfig-NT-hafs.txt
postxconfig-NT-GFS-TWO.txt postxconfig-NT-GFS-F00-TWO.txt postxconfig-NT-hrrr.txt
postxconfig-NT-rap.txt postxconfig-NT-fv3lam_rrfs.txt postxconfig-NT-UFS-aerosol.txt
postxconfig-NT-UFS-aerosol-F00.txt postxconfig-NT-GEFS-aerosol.txt postxconfig-NT-GEFS-F00-aerosol.txt
postxconfig-NT-AQM.txt'

# Delete all txt files that were generated by the old makefile
rm -f $all_txt_files

# Ensure that all those files were deleted.
for x in $all_txt_files ; do
    ! test -s "$x"
done

# Regenerate all txt files using 8 make threads.
make -j 8

# Confirm there are no changes.
! ( git status --porcelain -uno | grep . )

# Delete all txt files that were generated by the old makefile.
make clean

# Ensure that all those files were deleted.
for x in $all_txt_files ; do
    ! test -s "$x"
done

# Regenerate all txt files using 8 make threads.
make -j 8

# Confirm there are no changes.
! ( git status --porcelain -uno | grep . )

echo SUCCESS

@WenMeng-NOAA WenMeng-NOAA added the enhancement New feature or request label Sep 19, 2023
@SamuelTrahanNOAA
Copy link
Contributor Author

There is no use in running the regression tests on this PR, and they wouldn't test the changes anyway. The only file that should change is the makefile, which is never used when running UPP. As long as the makefile regenerates the txt files correctly, the changes are safe.

@WenMeng-NOAA
Copy link
Collaborator

@SamuelTrahanNOAA Thanks for your help on optimizing UPP scripts. The testing instructions you provided is working for me.

@WenMeng-NOAA
Copy link
Collaborator

The testing of recreating UPP control files in .txt is successful.

@WenMeng-NOAA WenMeng-NOAA added Ready for Review This PR is ready for code review. No Baseline Change No baseline of the UPP regression tests are made. labels Sep 21, 2023
@WenMeng-NOAA
Copy link
Collaborator

This PR is ready for merging.

@WenMeng-NOAA WenMeng-NOAA merged commit 13b11f8 into NOAA-EMC:develop Sep 22, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request No Baseline Change No baseline of the UPP regression tests are made. Ready for Review This PR is ready for code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The parm/makefile is overcomplicated and error-prone
2 participants