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

Make the print for submodule conditionally appearing in log file #1716

Merged
merged 1 commit into from
Apr 18, 2022
Merged

Make the print for submodule conditionally appearing in log file #1716

merged 1 commit into from
Apr 18, 2022

Conversation

weiwangncar
Copy link
Collaborator

@weiwangncar weiwangncar commented Apr 14, 2022

TYPE: no impact, text only

KEYWORDS: print, submodule status

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
Currently when we compile, this section of the submodule status check from top-level Makefile always appears in the log file, which can be confusing to users:

    if [ \( ! -f run/MPTABLE.TBL \) -o \
         \( ! -f phys/module_sf_noahmpdrv.F \) -o \
         \( ! -f phys/module_sf_noahmp_glacier.F \) -o \
         \( ! -f phys/module_sf_noahmp_groundwater.F \) -o \
         \( ! -f phys/module_sf_noahmplsm.F \) ] ; then \
       echo " " ; \
       echo "------------------------------------------------------------------------------" ; \
       echo "Error Error Error NoahMP submodule files not populating WRF directories" ; \
       echo "------------------------------------------------------------------------------" ; \
       echo " " ; \
       exit 31 ; \
    else \
       echo "------------------------------------------------------------------------------" ; \
       echo "NoahMP submodule files populating WRF directories" ; \
       echo "------------------------------------------------------------------------------" ; \
    fi

After that the actual status report print would appear. For example, you may find this in the log file:

 ------------------------------------------------------------------------------
 NoahMP submodule files populating WRF directories
 -----------------------------------------------------------------------------

Solution:
Add @ in front of 'if', and this will stop the entire section to be printed, and depending on the actual status of the submodule, this would appear if there is no trouble getting the files from the noahmp submodule:

 ------------------------------------------------------------------------------
 NoahMP submodule files populating WRF directories
 ------------------------------------------------------------------------------

LIST OF MODIFIED FILES:
M Makefile

TESTS CONDUCTED:

  1. Do mods fix problem? Yes, on a test compilation on Cheyenne.
  2. The Jenkins tests are all passing.

@weiwangncar
Copy link
Collaborator Author

Jenkins tests have passed:
Test Type | Expected | Received | Failed
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Number of Tests : 23 24
Number of Builds : 60 58
Number of Simulations : 158 156 0
Number of Comparisons : 95 92 0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@weiwangncar
Copy link
Collaborator Author

@kkeene44 Can you try this and see if you like the change? If you can, can you also try to compile the code without internet connected (and without getting the noahmp code), and see if the 'Error Error Error ..' would show?

@kkeene44
Copy link
Collaborator

@weiwangncar Yes, this is much better! Thank you! I was unable to compile the code offline because I don't have a system capable of doing that, unfortunately.

@mgduda
Copy link
Collaborator

mgduda commented Apr 14, 2022

@kkeene44 Can you try this and see if you like the change? If you can, can you also try to compile the code without internet connected (and without getting the noahmp code), and see if the 'Error Error Error ..' would show?

Maybe another way to test that the Error message shows up as expected would be to locally modify the Makefile so that it removes some of the NoahMP files after they have been obtained through a submodule? E.g.,

wrf : framework_only
	$(MAKE) MODULE_DIRS="$(ALL_MODULES)" physics
	rm -f run/MPTABLE.TBL
	@if [ \( ! -f run/MPTABLE.TBL \) -o \
	     \( ! -f phys/module_sf_noahmpdrv.F \) -o \
	     \( ! -f phys/module_sf_noahmp_glacier.F \) -o \
	     \( ! -f phys/module_sf_noahmp_groundwater.F \) -o \

(Note the rm command on the third line.)

@weiwangncar
Copy link
Collaborator Author

@mgduda Good suggestion! I just tested this on Cheyenne, it worked as expected. We get the following, and the compile stops:

 ------------------------------------------------------------------------------
 Error Error Error NoahMP submodule files not populating WRF directories
 ------------------------------------------------------------------------------

 Makefile:110: recipe for target 'wrf' failed
 make: *** [wrf] Error 31

@kkeene44
Copy link
Collaborator

@mgduda Thanks for that suggestion, and @weiwangncar thank you testing it out!

@dudhia
Copy link
Collaborator

dudhia commented Apr 15, 2022 via email

@kkeene44
Copy link
Collaborator

kkeene44 commented Apr 15, 2022

Was it resolved that no error messages appear when it compiles accessing the submodule?

@dudhia, Yes it was.

@weiwangncar weiwangncar merged commit 999afd3 into wrf-model:release-v4.4 Apr 18, 2022
@weiwangncar weiwangncar deleted the fix-print branch April 18, 2022 22:31
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
…og file (wrf-model#1716)

TYPE: no impact, text only

KEYWORDS: print, submodule status

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
Currently when we compile, the section of the submodule status check from top-level Makefile always appears in the log file, which can be confusing to users.

Solution:
Add @ in front of 'if', and this will only print the appropriate message according to the situation.

LIST OF MODIFIED FILES: 
M     Makefile

TESTS CONDUCTED: 
1. Do mods fix problem? Yes, on a test compilation on Cheyenne.
2. The Jenkins tests are all passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants