Skip to content

Commit

Permalink
Merge branch 'ufs/dev' into feature/hafsv2_baseline_with_ssc
Browse files Browse the repository at this point in the history
  • Loading branch information
binli2337 committed Jan 30, 2024
2 parents e0401d6 + f31b4af commit ae1f0ca
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion physics/CONV/SAMF/samfshalcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, &
parameter(cinacrmx=-120.,shevf=2.0)
parameter(dtmax=10800.,dtmin=600.)
parameter(bb1=4.0,bb2=0.8,csmf=0.2)
parameter(tkcrt=2.,cmxfac=15.)
parameter(tkcrt=2.,cmxfac=10.)
! parameter(bet1=1.875,cd1=.506,f1=2.0,gam1=.5)
parameter(betaw=.03,dxcrtc0=9.e3)
parameter(h1=0.33333333)
Expand Down
2 changes: 1 addition & 1 deletion physics/PBL/SATMEDMF/satmedmfvdifq.F
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
parameter(elmfac=1.0,elefac=1.0,cql=100.)
parameter(dw2min=1.e-4,dkmax=1000.,xkgdx=1000.)
parameter(qlcr=3.5e-5,zstblmax=2500.)
parameter(xkinv1=0.15,xkinv2=0.3)
parameter(xkinv1=0.4,xkinv2=0.3)
parameter(h1=0.33333333,hcrinv=250.)
parameter(vegflo=0.1,vegfup=1.0,z0lo=0.1,z0up=1.0)
parameter(vc0=1.0,zc0=1.0)
Expand Down
39 changes: 26 additions & 13 deletions physics/SFC_Layer/UFS/sfc_diff.f
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,6 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
& * virtfac
endif
z0 = 0.01_kp * z0rl_wat(i)
z0max = max(zmin, min(z0,z1(i)))
! ustar_wat(i) = sqrt(grav * z0 / charnock)
if (icplocn2atm == 0) then
wind10m=sqrt(u10m(i)*u10m(i)+v10m(i)*v10m(i))
windrel=wind(i)
Expand All @@ -367,6 +364,21 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
windrel=sqrt((u1(i)-usfco(i))**2+(v1(i)-vsfco(i))**2)
endif
if (sfc_z0_type == -1) then ! using wave model derived momentum roughness
tem1 = 0.11 * vis / ustar_wat(i)
z0 = tem1 + 0.01_kp * z0rl_wav(i)
if (redrag) then
z0max = max(min(z0, z0s_max),1.0e-7_kp)
else
z0max = max(min(z0,0.1_kp), 1.0e-7_kp)
endif
z0rl_wat(i) = 100.0_kp * z0max ! cm
else
z0 = 0.01_kp * z0rl_wat(i)
z0max = max(zmin, min(z0,z1(i)))
endif
!
!** test xubin's new z0

! ztmax = z0max
Expand Down Expand Up @@ -436,17 +448,18 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
z0rl_wat(i) = 1.0e-4_kp
endif

elseif (z0rl_wav(i) <= 1.0e-7_kp .or. &
& z0rl_wav(i) > 1.0_kp) then
! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i)
tem1 = 0.11 * vis / ustar_wat(i)
z0 = tem1 + (charnock/grav)*ustar_wat(i)*ustar_wat(i)
elseif (z0rl_wav(i) <= 1.0e-7_kp .or.
& z0rl_wav(i) > 1.0_kp) then
! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i)
tem1 = 0.11 * vis / ustar_wat(i)
z0 = tem1 + (charnock/grav)*ustar_wat(i)*ustar_wat(i)

if (redrag) then
z0rl_wat(i) = 100.0_kp * max(min(z0, z0s_max),1.0e-7_kp)
else
z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.0e-7_kp)
endif

if (redrag) then
z0rl_wat(i) = 100.0_kp * max(min(z0, z0s_max),1.0e-7_kp)
else
z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.0e-7_kp)
endif
endif

endif ! end of if(open ocean)
Expand Down
8 changes: 2 additions & 6 deletions tools/check_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
if suffix in SUFFICES:
with open(os.path.join(root, file)) as f:
contents = f.read()
try:
contents.decode('ascii')
except UnicodeDecodeError:
if not contents.isascii():
for line in contents.split('\n'):
try:
line.decode('ascii')
except UnicodeDecodeError:
if not line.isascii():
raise Exception('Detected non-ascii characters in file {}, line: "{}"'.format(os.path.join(root, file), line))

0 comments on commit ae1f0ca

Please sign in to comment.