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

Fix if-statement conditions for VX tasks in setup.sh #661

Closed
gsketefian opened this issue Jan 8, 2022 · 1 comment
Closed

Fix if-statement conditions for VX tasks in setup.sh #661

gsketefian opened this issue Jan 8, 2022 · 1 comment
Assignees
Labels
bug Something isn't working low priority
Milestone

Comments

@gsketefian
Copy link
Collaborator

Description

The script setup.sh contains the following if-statement (currently at line 1989) that is supposed to turn off the VX_GRIDSTAT_TN task if the experiment is being run in NCO mode (RUN_ENVIR set to "nco"):

  if [ "${RUN_TASK_VX_GRIDSTAT}" = "TRUE" ] || \
     [ "${RUN_TASK_VX_GRIDSTAT}" = "FALSE" ]; then

    msg="
When RUN_ENVIR is set to \"nco\", it is assumed that the verification
will not be run.
  RUN_TASK_VX_GRIDSTAT = \"${RUN_TASK_VX_GRIDSTAT}\"
Resetting RUN_TASK_VX_GRIDSTAT to \"FALSE\"
Reset value is:"

    RUN_TASK_VX_GRIDSTAT="FALSE"

    msg="$msg""
  RUN_TASK_VX_GRIDSTAT = \"${RUN_TASK_VX_GRIDSTAT}\"
"

    print_info_msg "$msg"

  fi

However, it is clear that the test of this if-statement will always be satisfied because RUN_TASK_VX_GRIDSTAT is always set to either "TRUE" or "FALSE". As a result, the message to alert the user that RUN_TASK_VX_GRIDSTAT is being reset to "FALSE" will be printed even if RUN_TASK_VX_GRIDSTAT was already set to "FALSE".

The fix is to simply change the test of the if-statement to the following:

  if [ "${RUN_TASK_VX_GRIDSTAT}" = "TRUE" ]; then
...
  fi

Note that there are two analogous if-statements for the VX_POINTSTAT_TN and VX_ENSGRID_TN tasks that contain the same bug and need to be fixed in the same way.

Steps to Reproduce

Run an experiment in NCO mode (i.e. RUN_ENVIR set to "nco") with RUN_TASK_VX_GRIDSTAT set to "FALSE". The experiment will still print out a message saying that RUN_TASK_VX_GRIDSTAT is being reset to "FALSE". Same can be done with the VX_POINTSTAT_TN and VX_ENSGRID_TN tasks.

@gsketefian gsketefian added the bug Something isn't working label Jan 8, 2022
@gsketefian
Copy link
Collaborator Author

@michelleharrold I just noticed what I think is a bug while working on another PR. Can you take a look at this issue and see if I understood the code correctly (and that there really is a bug)? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority
Projects
None yet
Development

No branches or pull requests

4 participants