-
Notifications
You must be signed in to change notification settings - Fork 151
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
More robust logic in gw_drag.F90 when deep_scheme='off' #1108
Comments
Just remembering something @brian-eaton explained to me was the "correct" way to call a pbuf field. I don't remember exactly but I think the optional "ierr" argument is used in the pbuf_get_index call, and that it could be used as a "proxy" for the deep_scheme = 'off' case (i.e, if the ZM pbuf variable doesn't exists, then deep_scheme must be 'off'). This is relevant to step (2) above. |
Hi @adamrher. I propose that we have |
Yes @brian-eaton, that sounds like a plan! |
Merge pull request ESCOMP#1131 from brian-eaton/misc05 cam6_4_031: fix issues ESCOMP#1108, ESCOMP#1106, ESCOMP#1058, ESCOMP#1051, ESCOMP#1050; merge PR#1101 ESCOMP commit: 9f0cb73
Merge pull request ESCOMP#1131 from brian-eaton/misc05 cam6_4_031: fix issues ESCOMP#1108, ESCOMP#1106, ESCOMP#1058, ESCOMP#1051, ESCOMP#1050; merge PR#1101 ESCOMP commit: 9f0cb73
Merge pull request ESCOMP#1131 from brian-eaton/misc05 cam6_4_031: fix issues ESCOMP#1108, ESCOMP#1106, ESCOMP#1058, ESCOMP#1051, ESCOMP#1050; merge PR#1101 ESCOMP commit: 9f0cb73
What happened?
When I run a configuration with deep_scheme='off' and use_gw_convect_dp=.true., it errors out as gw_drag.F90 is doing a pbuf_get_index for a ZM pbuf variable that doesn't exist. So I just run with use_gw_convect_dp=.false, which is fine. However, with the new moving mountains gw sources that came in recently, it's using that same pbuf index
ttend_dp_idx
to perform a pbuf_get_field call in the moving mountains code block. If use_gw_convect_dp=.false, then that index retains its initialized value of -1 and the model errors out in the pbuf_get_field call.I propose:
(1) Move the pbuf_get_index outside the
use_gw_convect_dp
conditional(2) Create logic to only call pbuf_get_index if deep_scheme /= 'off', otherwise
ttend_dp_idx
retains its initialized value of -1(3) Put a kill switch in if
use_gw_convect_dp
=.true. andttend_dp_idx
= -1(4) Add logic around the moving mountain code block
use_gw_movmtn_pbl
to only perform the pbuf_get_field whenttend_dp_idx
/= -1, else fill an array of the same size as that ZM pbuf variable with zeros, and pass that into the subroutine callgw_movmtn_src
(the ZM array is not actually used by the moving mountains at this time, so making it zero doesn't change answers).What are the steps to reproduce the bug?
see above.
What CAM tag were you using?
cam6_4_015
What machine were you running CAM on?
CISL machine (e.g. cheyenne)
What compiler were you using?
Intel
Path to a case directory, if applicable
No response
Will you be addressing this bug yourself?
Any CAM SE can do this
Extra info
@JulioTBacmeister
The text was updated successfully, but these errors were encountered: