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

ACTION array allocation too small #378

Closed
ukmo-ccbunney opened this issue May 21, 2021 · 2 comments · Fixed by ukmo-waves/WW3#23 or #419
Closed

ACTION array allocation too small #378

ukmo-ccbunney opened this issue May 21, 2021 · 2 comments · Fixed by ukmo-waves/WW3#23 or #419
Labels
bug Something isn't working

Comments

@ukmo-ccbunney
Copy link
Collaborator

Describe the bug
The ACTION array in the wminitmd.f90 subroutine WMINITNML is allocated with an upper bound of 9:

ALLOCATE ( ACTION(JFIRST:9) )

but it is later accessed with array indices > 9 e.g.:

ACTION(7:11) = '- '

The WMINIT subroutine also contains an ACTION array, however this is defined as a static array of the correct size 11:

CHARACTER(LEN=6) :: ACTION(11), YESXX, XXXNO

To Reproduce
Running a multi-grid model using NAMELIST input (ww3_multi.nml) causes a runtime error.
The error does not occur when using ww3_multi.inp (WMINT is called rather than WMINITNML)

Expected behavior
Not segfault when using ww3_multi.nml

@ukmo-ccbunney ukmo-ccbunney added the bug Something isn't working label May 21, 2021
@ukmo-ccbunney
Copy link
Collaborator Author

It looks like this bug was introduced in PR #285

@ukmo-ccbunney
Copy link
Collaborator Author

@aliabdolali I can put a fix for this bug in PR #372 if you like. Or would you prefer a separate PR for this one?

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

Successfully merging a pull request may close this issue.

1 participant