Skip to content

Commit

Permalink
Update logical for optional argument wlat, caught with debug by gnu c…
Browse files Browse the repository at this point in the history
…ompiler (#477)
  • Loading branch information
apcraig committed Nov 17, 2023
1 parent b129416 commit f6ff8f7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion columnphysics/icepack_therm_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@ subroutine lateral_melt (dt, ncat, &
bin1_arealoss, tmp !

logical (kind=log_kind) :: &
fsd_wlat, & ! .true. if wlat present and wlat > puny
flag ! .true. if there could be lateral melting

real (kind=dbl_kind), dimension (ncat) :: &
Expand Down Expand Up @@ -1024,7 +1025,14 @@ subroutine lateral_melt (dt, ncat, &
f_flx = c0
end if

if (tr_fsd .and. wlat > puny) then
! fsd_wlat == if (tr_fsd .and. wlat > puny)
! need fsd_wlat because wlat is optional
fsd_wlat = .false.
if (tr_fsd .and. present(wlat)) then
if (wlat > puny) fsd_wlat = .true.
endif

if (fsd_wlat) then
flag = .true.

! for FSD rside and fside not yet computed correctly, redo here
Expand Down

0 comments on commit f6ff8f7

Please sign in to comment.