Skip to content

Commit

Permalink
Merge pull request #446 from jedwards4b/fix/add_gusts
Browse files Browse the repository at this point in the history
Fix/add gusts
  • Loading branch information
jedwards4b authored Apr 1, 2024
2 parents 823f066 + f5473d6 commit a077536
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cesm/flux_atmocn/shr_flux_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -347,25 +347,27 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
!--- compute some needed quantities ---
if (add_gusts) then
vmag = max(seq_flux_atmocn_minwind, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2 + (1.0_R8*ugust(min(rainc(n),6.94444e-4_r8))**2)) )

ugust_out(n) = ugust(min(rainc(n),6.94444e-4_r8))
else
vmag = max(seq_flux_atmocn_minwind, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2) )
ugust_out(n) = 0.0_r8
end if
wind0 = max(seq_flux_atmocn_minwind, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2) )


if (use_coldair_outbreak_mod) then
! Cold Air Outbreak Modification:
! Increase windspeed for negative tbot-ts
! based on Mahrt & Sun 1995,MWR

if (tdiff(n).lt.td0) then
! if add_gusts wind0 and vmag are different, both need this factor.
vscl=min((1._R8+alpha*(abs(tdiff(n)-td0)**0.5_R8/abs(vmag))),maxscl)
vmag=vmag*vscl
vscl=min((1._R8+alpha*(abs(tdiff(n)-td0)**0.5_R8/abs(wind0))),maxscl)
wind0=wind0*vscl
endif
endif

ssq = 0.98_R8 * qsat(ts(n)) / rbot(n) ! sea surf hum (kg/kg)
delt = thbot(n) - ts(n) ! pot temp diff (K)
delq = qbot(n) - ssq ! spec hum dif (kg/kg)
Expand Down Expand Up @@ -466,7 +468,6 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
qref(n) = qbot(n) - delq*fac

duu10n(n) = u10n*u10n ! 10m wind speed squared

u10res(n) = u10n * (wind0/vmag) ! resolved 10m wind

!------------------------------------------------------------
Expand Down

0 comments on commit a077536

Please sign in to comment.