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

Check for comment in perturbation definition earlier #67

Open
aidanheerdegen opened this issue Jul 13, 2021 · 0 comments
Open

Check for comment in perturbation definition earlier #67

aidanheerdegen opened this issue Jul 13, 2021 · 0 comments

Comments

@aidanheerdegen
Copy link
Contributor

There was confusion from someone defining a perturbation. They got this error:

assertion failed: forcing_parse_field: wrong number of fields in perturbation definition, should be 5.

even though the perturbation definition seemed fine:

    {
      "filename": "INPUT/RYF.rlds.1990_1991.nc",
      "fieldname": "rlds",
      "cname": "lwfld_ai",
      "perturbations": [
        {
          "type": "offset",
          "dimension": "temporal",
          "value": "INPUT/RYF.rlds.1990_1991_wcwc10.nc",
          "calendar": "experiment"
        }
      ]
    },

The issue was a missing comment field, which is now mandatory, but the check for the comment is after this section

call self%core%get(perturbation_jv_ptr, "comment", &
comment, found)
call assert(found, 'forcing_parse_field: perturbation missing "comment" field')

so never gets flagged, and the user does not know why their perturbation definition is incorrect.

I believe moving the assert block which checks for a comment to the beginning of the loop (say line 194) makes sense, and the rest of the logic can remain as-is.

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

No branches or pull requests

1 participant