You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nancycollins3 weeks ago
i see that calling a routine with the same array with both an intent(in) and intent(out) goes several levels deep in this code so it would be pretty disruptive to change it. but in the future i'd avoid passing in the same array multiple times with different intents. it's leaving a trap for future code maintainers because someone looking only at the called subroutines could decide to set the outgoing state_ens(:) to 0 or MISSING_R8 as an initial value for debugging, which would result in the probit_ens(:) mysteriously getting overwritten without any protection from the intent(in). you're requiring some behavior in the called subroutine because of how the calling code is written.
Member
@hkershaw-brown hkershaw-brown 3 weeks ago
I don't think it is standard conforming to alias in this way so not just people changing the code, its undefined what the compiler will do.
this is still dangerous since you have the same input for intent(in) and intent(out), but the original code does that so yippee ki yay I guess.
DART/assimilation_code/modules/assimilation/probit_transform_mod.f90
Lines 596 to 601 in f0e7f99
Originally posted by @hkershaw-brown in #794 (comment)
The text was updated successfully, but these errors were encountered: