Skip to content

Commit

Permalink
Merge pull request #1059 from grantfirl/ufs-dev-PR119
Browse files Browse the repository at this point in the history
UFS-dev PR#119
  • Loading branch information
grantfirl authored Mar 18, 2024
2 parents d46098d + a2a3092 commit e1f97ad
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 22 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 @@ -271,7 +271,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
41 changes: 27 additions & 14 deletions physics/SFC_Layer/UFS/sfc_diff.f
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,24 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
tvs = half * (tsurf_wat(i)+tskin_wat(i))/prsik1(i)
& * virtfac
endif
z0 = 0.01_kp * z0rl_wat(i)
z0max = max(zmin, min(z0,z1(i)))
! ustar_wat(i) = sqrt(grav * z0 / charnock)
!
wind10m = sqrt(u10m(i)*u10m(i)+v10m(i)*v10m(i))
!
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 @@ -425,17 +437,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 e1f97ad

Please sign in to comment.