Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# These owners will be the default owners for everything in the repo.
#* @defunkt
* @climbfuji @llpcarson @grantfirl @JulieSchramm
* @climbfuji @tanyasmirnova
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CODEOWNERS should not be changed


# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners
Expand Down
29 changes: 26 additions & 3 deletions physics/GFS_GWD_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ end subroutine GFS_GWD_generic_pre_init
!! @{
subroutine GFS_GWD_generic_pre_run( &
& im, levs, nmtvr, mntvar, &
& oc, oa4, clx, theta, &
& sigma, gamma, elvmax, lssav, ldiag3d, &
& var, oc, oa4, clx, &
& varss, ocss, oa4ss, clxss, &
& theta,sigma, gamma, elvmax, lssav, ldiag3d, &
& dtdt, dt3dt, dtf, errmsg, errflg)

use machine, only : kind_phys
Expand All @@ -28,7 +29,8 @@ subroutine GFS_GWD_generic_pre_run( &
real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr)

real(kind=kind_phys), intent(out) :: &
& oc(im), oa4(im,4), clx(im,4), &
& var(im), oc(im), oa4(im,4), clx(im,4), &
& varss(im), ocss(im), oa4ss(im,4), clxss(im,4), &
& theta(im), sigma(im), gamma(im), elvmax(im)

logical, intent(in) :: lssav, ldiag3d
Expand Down Expand Up @@ -80,6 +82,27 @@ subroutine GFS_GWD_generic_pre_run( &
clx(:,2) = 0.0
clx(:,3) = 0.0
clx(:,4) = 0.0
elseif (nmtvr == 24) then ! GSD_drag_suite
var(:) = mntvar(:,1)
oc(:) = mntvar(:,2)
oa4(:,1) = mntvar(:,3)
oa4(:,2) = mntvar(:,4)
oa4(:,3) = mntvar(:,5)
oa4(:,4) = mntvar(:,6)
clx(:,1) = mntvar(:,7)
clx(:,2) = mntvar(:,8)
clx(:,3) = mntvar(:,9)
clx(:,4) = mntvar(:,10)
varss(:) = mntvar(:,15)
ocss(:) = mntvar(:,16)
oa4ss(:,1) = mntvar(:,17)
oa4ss(:,2) = mntvar(:,18)
oa4ss(:,3) = mntvar(:,19)
oa4ss(:,4) = mntvar(:,20)
clxss(:,1) = mntvar(:,21)
clxss(:,2) = mntvar(:,22)
clxss(:,3) = mntvar(:,23)
clxss(:,4) = mntvar(:,24)
else
oc = 0
oa4 = 0
Expand Down
45 changes: 45 additions & 0 deletions physics/GFS_GWD_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@
kind = kind_phys
intent = in
optional = F
[var]
standard_name = standard_deviation_of_subgrid_orography
long_name = standard deviation of subgrid orography
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[oc]
standard_name = convexity_of_subgrid_orography
long_name = convexity of subgrid orography
Expand Down Expand Up @@ -66,6 +75,42 @@
kind = kind_phys
intent = out
optional = F
[varss]
standard_name = standard_deviation_of_subgrid_orography_small_scale
long_name = standard deviation of subgrid orography small scale
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[ocss]
standard_name = convexity_of_subgrid_orography_small_scale
long_name = convexity of subgrid orography small scale
units = none
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[oa4ss]
standard_name = asymmetry_of_subgrid_orography_small_scale
long_name = asymmetry of subgrid orography small scale
units = none
dimensions = (horizontal_dimension,4)
type = real
kind = kind_phys
intent = out
optional = F
[clxss]
standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height_small_scale
long_name = horizontal fraction of grid box covered by subgrid orography higher than critical height small scale
units = frac
dimensions = (horizontal_dimension,4)
type = real
kind = kind_phys
intent = out
optional = F
[theta]
standard_name = angle_from_east_of_maximum_subgrid_orographic_variations
long_name = angle with_respect to east of maximum subgrid orographic variations
Expand Down
57 changes: 33 additions & 24 deletions physics/drag_suite.F90
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ end subroutine drag_suite_init
subroutine drag_suite_run( &
& IM,IX,KM,dvdt,dudt,dtdt,U1,V1,T1,Q1,KPBL, &
& PRSI,DEL,PRSL,PRSLK,PHII,PHIL,DELTIM,KDT, &
& VAR,oc1,oa4,ol4, &
! & varss,oc1ss,oa4ss,ol4ss, &
& var,oc1,oa4,ol4, &
& varss,oc1ss,oa4ss,ol4ss, &
& THETA,SIGMA,GAMMA,ELVMAX, &
& dtaux2d_ls,dtauy2d_ls,dtaux2d_bl,dtauy2d_bl, &
& dtaux2d_ss,dtauy2d_ss,dtaux2d_fd,dtauy2d_fd, &
Expand Down Expand Up @@ -307,9 +307,10 @@ subroutine drag_suite_run( &
real(kind=kind_phys) :: rcl, cdmb
real(kind=kind_phys) :: g_inv

real(kind=kind_phys), intent(out) :: &
real(kind=kind_phys), intent(inout) :: &
& dudt(im,km),dvdt(im,km), &
& dtdt(im,km), rdxzb(im)
& dtdt(im,km)
real(kind=kind_phys), intent(out) :: rdxzb(im)
real(kind=kind_phys), intent(in) :: &
& u1(im,km),v1(im,km), &
& t1(im,km),q1(im,km), &
Expand All @@ -320,8 +321,7 @@ subroutine drag_suite_run( &
real(kind=kind_phys), intent(in) :: var(im),oc1(im), &
& oa4(im,4),ol4(im,4), &
& dx(im)
!real(kind=kind_phys), intent(in) :: varss(im),oc1ss(im), &
real(kind=kind_phys) :: varss(im),oc1ss(im), &
real(kind=kind_phys), intent(in) :: varss(im),oc1ss(im), &
& oa4ss(im,4),ol4ss(im,4)
real(kind=kind_phys), intent(in) :: THETA(im),SIGMA(im), &
& GAMMA(im),ELVMAX(im)
Expand Down Expand Up @@ -474,7 +474,16 @@ subroutine drag_suite_run( &
errmsg = ''
errflg = 0

if (me==master) print *,"Running drag suite"

! Temporary line
!if (me==master) then
! print *, "Ahoj svete!: In drag suite -- cdmbgwd =", cdmbgwd(:)
! print *, "imx =", imx, " dx =", dx(1)
! print *
!end if


! if (me==master) print *,"Running drag suite"
!--------------------------------------------------------------------
! SCALE-ADPTIVE PARAMETER FROM GFS GWD SCHEME
!--------------------------------------------------------------------
Expand Down Expand Up @@ -527,14 +536,14 @@ subroutine drag_suite_run( &
enddo

!temporary use of large-scale data:
do i=1,im
varss(i)=var(i)
oc1ss(i)=oc1(i)
do j=1,4
oa4ss(i,j)=oa4(i,j)
ol4ss(i,j)=ol4(i,j)
enddo
enddo
! do i=1,im
! varss(i)=var(i)
! oc1ss(i)=oc1(i)
! do j=1,4
! oa4ss(i,j)=oa4(i,j)
! ol4ss(i,j)=ol4(i,j)
! enddo
! enddo
!
!--- calculate scale-aware tapering factors
!NOTE: if dx(1) is not representative of most/all dx, this needs to change...
Expand All @@ -548,7 +557,7 @@ subroutine drag_suite_run( &
(dxmax_ls-dxmin_ls)) + 1. )
end if
end if
if (me==master) print *,"in Drag Suite, dx(1:2):",dx(1),dx(2)
! if (me==master) print *,"in Drag Suite, dx(1:2):",dx(1),dx(2)
if ( dx(1) .ge. dxmax_ss ) then
ss_taper = 1.
else
Expand All @@ -558,7 +567,7 @@ subroutine drag_suite_run( &
ss_taper = dxmax_ss * (1. - dxmin_ss/dx(1))/(dxmax_ss-dxmin_ss)
end if
end if
if (me==master) print *,"in Drag Suite, ss_taper:",ss_taper
! if (me==master) print *,"in Drag Suite, ss_taper:",ss_taper

!--- calculate length of grid for flow-blocking drag
!
Expand Down Expand Up @@ -907,7 +916,7 @@ subroutine drag_suite_run( &
vtendwave=0.
!
IF ( (gwd_opt_ss .EQ. 1).and.(ss_taper.GT.1.E-02) ) THEN
if (me==master) print *,"in Drag Suite: Running small-scale gravity wave drag"
! if (me==master) print *,"in Drag Suite: Running small-scale gravity wave drag"
!
! declaring potential temperature
!
Expand Down Expand Up @@ -943,11 +952,11 @@ subroutine drag_suite_run( &
enddo
if((xland(i)-1.5).le.0. .and. 2.*varss(i).le.hpbl(i))then
if(br1(i).gt.0. .and. thvx(i,kpbl2)-thvx(i,kts) > 0.)then
!WRF cleff_ss = sqrt(dxy(i)**2 + dxyp(i)**2)
cleff_ss = sqrt(dxy(i)**2 + dxyp(i)**2) ! WRF
! cleff_ss = 3. * max(dx(i),cleff_ss)
! cleff_ss = 10. * max(dxmax_ss,cleff_ss)
!WRF cleff_ss = 0.1 * max(dxmax_ss,cleff_ss)
cleff_ss = 0.1 * 12000.
cleff_ss = 0.1 * max(dxmax_ss,cleff_ss) ! WRF
! cleff_ss = 0.1 * 12000.
coefm_ss(i) = (1. + olss(i)) ** (oass(i)+1.)
xlinv(i) = coefm_ss(i) / cleff_ss
!govrth(i)=g/(0.5*(thvx(i,kpbl(i))+thvx(i,kts)))
Expand Down Expand Up @@ -1024,7 +1033,7 @@ subroutine drag_suite_run( &
! Topographic Form Drag from Beljaars et al. (2004, QJRMS, equ. 16):
!================================================================
IF ( (gwd_opt_fd .EQ. 1).and.(ss_taper.GT.1.E-02) ) THEN
if (me==master) print *,"in Drag Suite: Running form drag"
! if (me==master) print *,"in Drag Suite: Running form drag"

utendform=0.
vtendform=0.
Expand Down Expand Up @@ -1080,7 +1089,7 @@ subroutine drag_suite_run( &
!=======================================================
! More for the large-scale gwd component
IF ( (gwd_opt_ls .EQ. 1).and.(ls_taper.GT.1.E-02) ) THEN
if (me==master) print *,"in Drag Suite: Running large-scale gravity wave drag"
! if (me==master) print *,"in Drag Suite: Running large-scale gravity wave drag"
!
! now compute vertical structure of the stress.
do k = kts,kpblmax
Expand Down Expand Up @@ -1148,7 +1157,7 @@ subroutine drag_suite_run( &
!COMPUTE BLOCKING COMPONENT
!===============================================================
IF ( (gwd_opt_bl .EQ. 1) .and. (ls_taper .GT. 1.E-02) ) THEN
if (me==master) print *,"in Drag Suite: Running blocking drag"
! if (me==master) print *,"in Drag Suite: Running blocking drag"

do i = its,im
if(.not.ldrag(i)) then
Expand Down
36 changes: 36 additions & 0 deletions physics/drag_suite.meta
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,42 @@
kind = kind_phys
intent = in
optional = F
[varss]
standard_name = standard_deviation_of_subgrid_orography_small_scale
long_name = standard deviation of subgrid orography small scale
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[oc1ss]
standard_name = convexity_of_subgrid_orography_small_scale
long_name = convexity of subgrid orography small scale
units = none
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[oa4ss]
standard_name = asymmetry_of_subgrid_orography_small_scale
long_name = asymmetry of subgrid orography small scale
units = none
dimensions = (horizontal_dimension,4)
type = real
kind = kind_phys
intent = in
optional = F
[ol4ss]
standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height_small_scale
long_name = horizontal fraction of grid box covered by subgrid orography higher than critical height small scale
units = frac
dimensions = (horizontal_dimension,4)
type = real
kind = kind_phys
intent = in
optional = F
[theta]
standard_name = angle_from_east_of_maximum_subgrid_orographic_variations
long_name = angle with respect to east of maximum subgrid orographic variations
Expand Down