Skip to content

Commit

Permalink
miscellaneous NRL-found checks on variables for stability and argumen…
Browse files Browse the repository at this point in the history
…t intent
  • Loading branch information
Grant Firl authored and Grant Firl committed Aug 24, 2022
1 parent cf353f6 commit 7644b0c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
8 changes: 4 additions & 4 deletions physics/cu_gf_deep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2908,12 +2908,12 @@ subroutine cup_env(z,qes,he,hes,t,q,p,z1, &
!$acc declare copyin(p,t,q)
real(kind=kind_phys), dimension (its:ite,kts:kte) &
,intent (out ) :: &
he,hes,qes
!$acc declare copyout(he,hes,qes)
hes,qes
!$acc declare copyout(hes,qes)
real(kind=kind_phys), dimension (its:ite,kts:kte) &
,intent (inout) :: &
z
!$acc declare copy(z)
he,z
!$acc declare copy(he,z)
real(kind=kind_phys), dimension (its:ite) &
,intent (in ) :: &
psur,z1
Expand Down
2 changes: 1 addition & 1 deletion physics/h2ophys.f
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ subroutine h2ophys_run(im, levs, kh2o, dt, h2o, ph2o, prsl, &
enddo
endif
do i=1,im
if (prsl(i,l) < prsmax) then
if (prsl(i,l) < prsmax .and. pltc(i,2) /= 0.0) then
h2oib(i) = h2o(i,l) ! no filling
tem = 1.0 / pltc(i,2) ! 1/teff
h2o(i,l) = (h2oib(i) + (pltc(i,1)+pltc(i,3)*tem)*dt)
Expand Down
4 changes: 3 additions & 1 deletion physics/radiation_astronomy.f
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,9 @@ subroutine coszmn &

do i = 1, IM
coszdg(i) = coszen(i) * rstp
if (istsun(i) > 0) coszen(i) = coszen(i) / istsun(i)
if (istsun(i) > 0 .and. coszen(i) /= 0.0_kind_phys) then
coszen(i) = coszen(i) / istsun(i)
endif
enddo
!
return
Expand Down
14 changes: 5 additions & 9 deletions physics/sflx.f
Original file line number Diff line number Diff line change
Expand Up @@ -906,15 +906,11 @@ subroutine gfssflx &! --- input
eta = etp
endif
#ifdef SINGLE_PREC
IF (ETP == 0.0) THEN
BETA = 0.0
ELSE
BETA = ETA/ETP
ENDIF
#else
beta = eta / etp
#endif
if (etp == 0.0) then
beta = 0.0
else
beta = eta/etp
endif
!> - Convert the sign of soil heat flux so that:
!! - ssoil>0: warm the surface (night time)
Expand Down
2 changes: 1 addition & 1 deletion physics/ugwp_driver_v0.F
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ subroutine fv3_ugwp_solv2_v0(klon, klev, dtime,
else
kzw2 = zero
endif
if ( kzw2 > zero ) then
if ( kzw2 > zero .and. cdf2 > zero) then
v_kzw = sqrt(kzw2)
!
!linsatdis: kzw2, kzw3, kdsat, c2f2, cdf2, cdf1
Expand Down

0 comments on commit 7644b0c

Please sign in to comment.