Skip to content

Commit

Permalink
merge of minor updates from GFDL Weather and CLimate Dynamics Divisio…
Browse files Browse the repository at this point in the history
…n (20211006)

    * Addressing GNU Warnings
  • Loading branch information
bensonr committed Oct 6, 2021
1 parent 0944c00 commit 94e9f2c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
3 changes: 2 additions & 1 deletion GFDL_tools/fv_ada_nudge.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,8 @@ subroutine ps_nudging(dt, factor, npz, ak, bk, ps_obs, mask, tm, ps, phis, delp,
pt0 = tm(i,j)/(pk0(km+1)-pk0(km))*(kappa*(pn0(km+1)-pn0(km)))
pst = pk0(km+1) + (gz0(i,j)-phis(i,j))/(cp_air*pt0)
endif
666 ps_dt(i,j) = pst**(1./kappa) - ps(i,j)
ps_dt(i,j) = pst**(1./kappa) - ps(i,j)
666 continue ! i-loop
enddo ! j-loop

if( nf_ps>0 ) call del2_scalar(ps_dt, del2_cd, 1, nf_ps, bd, npx, npy, gridstruct, domain)
Expand Down
6 changes: 3 additions & 3 deletions model/fv_regional_bc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ module fv_regional_mod
,oro_data ='oro_data.tile7.halo4.nc'

#ifdef OVERLOAD_R4
real, parameter:: real_snan=x'FFBFFFFF'
real, parameter:: real_snan=real(Z'FFBFFFFF')
#else
real, parameter:: real_snan=x'FFF7FFFFFFFFFFFF'
real, parameter:: real_snan=real(Z'FFF7FFFFFFFFFFFF')
#endif
real(kind=R_GRID), parameter:: dbl_snan=x'FFF7FFFFFFFFFFFF'
real(kind=R_GRID), parameter:: dbl_snan=real(Z'FFF7FFFFFFFFFFFF',kind=R_GRID)

interface dump_field
module procedure dump_field_3d
Expand Down
22 changes: 13 additions & 9 deletions tools/fv_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5081,25 +5081,29 @@ subroutine ppme(p,qe,delp,im,km)

km1 = km - 1

do 500 k=2,km
do 500 i=1,im
500 a6(i,k) = delp(i,k-1) + delp(i,k)
do k=2,km
do i=1,im
a6(i,k) = delp(i,k-1) + delp(i,k)
enddo
enddo

do 1000 k=1,km1
do 1000 i=1,im
do k=1,km1
do i=1,im
delq(i,k) = p(i,k+1) - p(i,k)
1000 continue
enddo
enddo

do 1220 k=2,km1
do 1220 i=1,im
do k=2,km1
do i=1,im
c1 = (delp(i,k-1)+0.5*delp(i,k))/a6(i,k+1)
c2 = (delp(i,k+1)+0.5*delp(i,k))/a6(i,k)
tmp = delp(i,k)*(c1*delq(i,k) + c2*delq(i,k-1)) / &
(a6(i,k)+delp(i,k+1))
qmax = max(p(i,k-1),p(i,k),p(i,k+1)) - p(i,k)
qmin = p(i,k) - min(p(i,k-1),p(i,k),p(i,k+1))
dc(i,k) = sign(min(abs(tmp),qmax,qmin), tmp)
1220 continue
enddo
enddo

!****6***0*********0*********0*********0*********0*********0**********72
! 4th order interpolation of the provisional cell edge value
Expand Down
2 changes: 1 addition & 1 deletion tools/fv_eta.F90
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ subroutine var_les(km, ak, bk, ptop, ks, pint, s_rate)
real ep, es, alpha, beta, gama
real, parameter:: akap = 2./7.
!---- Tunable parameters:
real:: k_inc = 10 ! # of layers from bottom up to near const dz region
integer:: k_inc = 10 ! # of layers from bottom up to near const dz region
real:: s0 = 0.8 ! lowest layer stretch factor
!-----------------------
real:: s_inc
Expand Down
3 changes: 1 addition & 2 deletions tools/fv_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,14 @@ subroutine fv_io_register_restart(Atm)
if ( Atm%flagstruct%hybrid_z ) then
call register_restart_field(Atm%Fv_restart_tile, 'ZE0', Atm%ze0, dim_names_4d3, is_optional=.true.)
endif
else !The restart file has the non-hydrostatic variables
else !The restart file has the non-hydrostatic variables
call register_restart_field(Atm%Fv_restart_tile, 'W', Atm%w, dim_names_4d3)
call register_restart_field(Atm%Fv_restart_tile, 'DZ', Atm%delz, dim_names_4d3)
if ( Atm%flagstruct%hybrid_z ) then
call register_restart_field(Atm%Fv_restart_tile, 'ZE0', Atm%ze0, dim_names_4d3)
endif
endif
endif

call register_restart_field(Atm%Fv_restart_tile, 'T', Atm%pt, dim_names_4d3)
call register_restart_field(Atm%Fv_restart_tile, 'delp', Atm%delp, dim_names_4d3)
call register_restart_field(Atm%Fv_restart_tile, 'phis', Atm%phis, dim_names_3d)
Expand Down
3 changes: 2 additions & 1 deletion tools/fv_nudge.F90
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,8 @@ subroutine ps_nudging(dt, factor, factor_nwp, npz, ak, bk, ps_obs, mask, tm, ps,
pt0 = tm(i,j)/(pk0(km+1)-pk0(km))*(kappa*(pn0(km+1)-pn0(km)))
pst = pk0(km+1) + (gz0(i,j)-phis(i,j))/(cp_air*pt0)
endif
666 ps_dt(i,j) = pst**(1./kappa) - ps(i,j)
ps_dt(i,j) = pst**(1./kappa) - ps(i,j)
666 continue ! i-loop
enddo ! j-loop

if( nf_ps>0 ) call del2_scalar(ps_dt, del2_cd, 1, nf_ps, bd, npx, npy, gridstruct, domain)
Expand Down

0 comments on commit 94e9f2c

Please sign in to comment.