Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/ufs/dev' into c3-pointer-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelTrahanNOAA committed Sep 25, 2023
2 parents 315d3cc + 31a99de commit f7efdce
Show file tree
Hide file tree
Showing 8 changed files with 423 additions and 34 deletions.
7 changes: 3 additions & 4 deletions physics/cu_gf_deep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4708,11 +4708,10 @@ subroutine get_zu_zd_pdf_fim(kklev,p,rand_vmas,zubeg,ipr,xland,zuh2,draft,ierr,k
if(draft == 1) then
lev_start=min(.9,.1+csum*.013)
kb_adj=max(kb,2)
tunning=max(p(kklev+1),.5*(p(kpbli)+p(kt)))
tunning=p(kklev)
! tunning=p(kklev+1) !p(kpbli+1) !p(kklev) !p(kt)+(p(kpbli)-p(kt))*lev_start
! tunning=.5*(p(kb_adj)+p(kt)) !p(kpbli+1) !p(kklev) !p(kt)+(p(kpbli)-p(kt))*lev_start
! trash is the depth of the cloud
trash=-p(kt)+p(kb_adj)
tunning=p(kklev)
if(rand_vmas.ne.0.) tunning=p(kklev-1)+.1*rand_vmas*trash
beta_deep=1.3 +(1.-trash/1200.)
tunning =min(0.95, (tunning-p(kb_adj))/(p(kt)-p(kb_adj))) !=.6
tunning =max(0.02, tunning)
Expand Down
26 changes: 20 additions & 6 deletions physics/cu_gf_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
fhour,fh_dfi_radar,ix_dfi_radar,num_dfi_radar,cap_suppress, &
dfi_radar_max_intervals,ldiag3d,qci_conv,do_cap_suppress, &
maxupmf,maxMF,do_mynnedmf,ichoice_in,ichoicem_in,ichoice_s_in, &
spp_cu_deep,spp_wts_cu_deep, &
errmsg,errflg)
!-------------------------------------------------------------
implicit none
Expand All @@ -80,6 +81,10 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
integer :: ichoice=0 ! 0 2 5 13 8
integer :: ichoicem=13 ! 0 2 5 13
integer :: ichoice_s=3 ! 0 1 2 3
integer, intent(in) :: spp_cu_deep ! flag for using SPP perturbations
real(kind_phys), dimension(:,:), intent(in) :: &
& spp_wts_cu_deep
real(kind=kind_phys) :: spp_wts_cu_deep_tmp

logical, intent(in) :: do_cap_suppress
real(kind=kind_phys), parameter :: aodc0=0.14
Expand Down Expand Up @@ -313,9 +318,18 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
! these should be coming in from outside
!
! cactiv(:) = 0
rand_mom(:) = 0.
rand_vmas(:) = 0.
rand_clos(:,:) = 0.
if (spp_cu_deep == 0) then
rand_mom(:) = 0.
rand_vmas(:) = 0.
rand_clos(:,:) = 0.
else
do i=1,im
spp_wts_cu_deep_tmp=min(max(-1.0_kind_phys, spp_wts_cu_deep(i,1)),1.0_kind_phys)
rand_mom(i) = spp_wts_cu_deep_tmp
rand_vmas(i) = spp_wts_cu_deep_tmp
rand_clos(i,:) = spp_wts_cu_deep_tmp
end do
end if
!$acc end kernels
!
its=1
Expand Down Expand Up @@ -630,7 +644,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
enddo
!$acc end kernels
if (dx(its)<6500.) then
ichoice=10
! ichoice=10
imid_gf=0
endif
!
Expand Down Expand Up @@ -734,7 +748,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist
,rand_vmas & ! for stochastics vertmass, if temporal and spatial patterns exist
,rand_clos & ! for stochastics closures, if temporal and spatial patterns exist
,0 & ! flag to what you want perturbed
,spp_cu_deep & ! flag to what you want perturbed
! 1 = momentum transport
! 2 = normalized vertical mass flux profile
! 3 = closures
Expand Down Expand Up @@ -816,7 +830,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist
,rand_vmas & ! for stochastics vertmass, if temporal and spatial patterns exist
,rand_clos & ! for stochastics closures, if temporal and spatial patterns exist
,0 & ! flag to what you want perturbed
,spp_cu_deep & ! flag to what you want perturbed
! 1 = momentum transport
! 2 = normalized vertical mass flux profile
! 3 = closures
Expand Down
15 changes: 15 additions & 0 deletions physics/cu_gf_driver.meta
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,21 @@
dimensions = ()
type = integer
intent = in
[spp_wts_cu_deep]
standard_name = spp_weights_for_cu_deep_scheme
long_name = spp weights for cu deep scheme
units = 1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = in
[spp_cu_deep]
standard_name = control_for_deep_convection_spp_perturbations
long_name = control for deep convection spp perturbations
units = count
dimensions = ()
type = integer
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
2 changes: 1 addition & 1 deletion physics/module_mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, &
INTEGER, INTENT(IN) :: rand_perturb_on, kme_stoch, n_var_spp
REAL, DIMENSION(:,:), INTENT(IN) :: rand_pert
REAL, DIMENSION(:), INTENT(IN) :: spp_prt_list, spp_stddev_cutoff
CHARACTER(len=3), DIMENSION(:), INTENT(IN) :: spp_var_list
CHARACTER(len=10), DIMENSION(:), INTENT(IN) :: spp_var_list
INTEGER, INTENT(IN):: has_reqc, has_reqi, has_reqs
#if ( WRF_CHEM == 1 )
REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: &
Expand Down
Loading

0 comments on commit f7efdce

Please sign in to comment.