Skip to content

Commit

Permalink
Correct intent error
Browse files Browse the repository at this point in the history
This patch fixes an intent(out) vs intent(inout) error that
resulted in glaciers melting.

In SFCDIF1_GLACIER, the variable FV was declared as intent(out).
Technically, this means that FV was uninitialized.  FV was initialized
for the first iteration (ITER=1), but it was not initialized for
subsequent calls (iterations 2 through 5).
  • Loading branch information
jvgeiger committed Mar 16, 2023
1 parent a401628 commit 9b06a00
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ SUBROUTINE SFCDIF1_GLACIER(ITER ,ZLVL ,ZPD ,Z0H ,Z0M , & !in
REAL, INTENT(INOUT) :: FH2 !sen heat stability correction, weighted by prior iters

! outputs
REAL, INTENT(OUT) :: FV !friction velocity (m/s)
REAL, INTENT(INOUT) :: FV !friction velocity (m/s)
REAL, INTENT(OUT) :: CM !drag coefficient for momentum
REAL, INTENT(OUT) :: CH !drag coefficient for heat
REAL, INTENT(OUT) :: CH2 !drag coefficient for heat
Expand Down

0 comments on commit 9b06a00

Please sign in to comment.