Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cam6_4_071: Clean up (all SE dycore) #1214

Open
wants to merge 4 commits into
base: cam_development
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
nudging variables being allocated and never used (many of these were 3D
variables). These have been removed.
Some other minor clean-up as well.
Changes are bit for bit.

Expect baseline failures for all SE tests except WACCM-x due to sponge changes
===============================================================

Tag name: cam6_4_048
Expand Down
2 changes: 1 addition & 1 deletion src/dynamics/se/dycore/control_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module control_mod
integer, public :: ftype = 2 ! Forcing Type
integer, public :: ftype_conserve = 1 !conserve momentum (dp*u)
integer, public :: dribble_in_rsplit_loop = 0
integer, public :: statediag_numtrac = 3
integer, public :: statediag_numtrac = 3

integer, public :: qsplit = 1 ! ratio of dynamics tsteps to tracer tsteps
integer, public :: rsplit =-1 ! for vertically lagrangian dynamics, apply remap
Expand Down
3 changes: 0 additions & 3 deletions src/dynamics/se/dycore/dimensions_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ module dimensions_mod
real(r8), public :: kmcnd_ref(PLEV) !reference profiles for molecular diffusion
real(r8), public :: rho_ref(PLEV) !reference profiles for rho
real(r8), public :: km_sponge_factor(PLEV) !scaling for molecular diffusion (when used as sponge)
real(r8), public :: kmvisi_ref(PLEV+1) !reference profiles for molecular diffusion
real(r8), public :: kmcndi_ref(PLEV+1) !reference profiles for molecular diffusion


integer, public :: nhc_phys
integer, public :: nhe_phys
Expand Down
15 changes: 0 additions & 15 deletions src/dynamics/se/dycore/element_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,6 @@ module element_mod
real (kind=r8) :: FM(np,np,2,nlev) ! momentum forcing
real (kind=r8), allocatable :: FDP(:,:,:) ! save full updated dp right after physics
real (kind=r8) :: FT(np,np,nlev) ! temperature forcing
real (kind=r8) :: etadot_prescribed(np,np,nlevp) ! prescribed vertical tendency
real (kind=r8) :: u_met(np,np,nlev) ! zonal component of prescribed meteorology winds
real (kind=r8) :: dudt_met(np,np,nlev) ! rate of change of zonal component of prescribed meteorology winds
real (kind=r8) :: v_met(np,np,nlev) ! meridional component of prescribed meteorology winds
real (kind=r8) :: dvdt_met(np,np,nlev) ! rate of change of meridional component of prescribed meteorology winds
real (kind=r8) :: T_met(np,np,nlev) ! prescribed meteorology temperature
real (kind=r8) :: dTdt_met(np,np,nlev) ! rate of change of prescribed meteorology temperature
real (kind=r8) :: ps_met(np,np) ! surface pressure of prescribed meteorology
real (kind=r8) :: dpsdt_met(np,np) ! rate of change of surface pressure of prescribed meteorology
real (kind=r8) :: nudge_factor(np,np,nlev) ! nudging factor (prescribed)
real (kind=r8) :: Utnd(npsq,nlev) ! accumulated U tendency due to nudging towards prescribed met
real (kind=r8) :: Vtnd(npsq,nlev) ! accumulated V tendency due to nudging towards prescribed met
real (kind=r8) :: Ttnd(npsq,nlev) ! accumulated T tendency due to nudging towards prescribed met

real (kind=r8) :: pecnd(np,np,nlev) ! pressure perturbation from condensate

! reference profiles
real (kind=r8) :: T_ref(np,np,nlev) ! reference temperature
Expand Down
2 changes: 1 addition & 1 deletion src/dynamics/se/dycore/fvm_consistent_se_cslam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ subroutine run_consistent_se_cslam(elem,fvm,hybrid,dt_fvm,tl,nets,nete,hvcoord,&
!call t_stopf('fvm:orthogonal_swept_areas')
do ie=nets,nete
! Intel compiler version 2023.0.0 on derecho had significant slowdown on subroutine interface without
! these pointers.
! these pointers.
fcube => fvm(ie)%c(:,:,:,:)
spherecentroid => fvm(ie)%spherecentroid(:,1-nhe:nc+nhe,1-nhe:nc+nhe)
do k=kmin,kmax
Expand Down
2 changes: 1 addition & 1 deletion src/dynamics/se/dycore/prim_advance_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ end subroutine distribute_flux_at_corners

subroutine tot_energy_dyn(elem,fvm,nets,nete,tl,tl_qdp,outfld_name_suffix)
use dimensions_mod, only: npsq,nlev,np,nc,use_cslam,qsize
use physconst, only: rga, cpair, rearth, omega
use physconst, only: rga, rearth, omega
use element_mod, only: element_t
use cam_history, only: outfld
use cam_history_support, only: max_fieldname_len
Expand Down
5 changes: 2 additions & 3 deletions src/dynamics/se/dycore/prim_advection_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module prim_advection_mod
!
use shr_kind_mod, only: r8=>shr_kind_r8
use dimensions_mod, only: nlev, np, qsize, nc
use physconst, only: cpair
use derivative_mod, only: derivative_t
use element_mod, only: element_t
use fvm_control_volume_mod, only: fvm_struct
Expand Down Expand Up @@ -948,7 +947,7 @@ subroutine vertical_remap(hybrid,elem,fvm,hvcoord,np1,np1_qdp,nets,nete)
use vertremap_mod, only: remap1
use hybrid_mod, only: hybrid_t, config_thread_region,get_loop_ranges, PrintHybrid
use fvm_control_volume_mod, only: fvm_struct
use dimensions_mod, only: ntrac
use dimensions_mod, only: use_cslam, ntrac
use dimensions_mod, only: kord_tr,kord_tr_cslam
use cam_logfile, only: iulog
use physconst, only: pi
Expand Down Expand Up @@ -1076,7 +1075,7 @@ subroutine vertical_remap(hybrid,elem,fvm,hvcoord,np1,np1_qdp,nets,nete)
call remap1(elem(ie)%state%v(:,:,2,:,np1),np,1,1,1,dp_star_moist,dp_moist,ptop,-1,.false.,kord_uvT)
enddo

if (ntrac>0) then
if (use_cslam) then
!
! vertical remapping of CSLAM tracers
!
Expand Down
18 changes: 1 addition & 17 deletions src/dynamics/se/dycore/prim_init.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module prim_init

use shr_kind_mod, only: r8=>shr_kind_r8
use dimensions_mod, only: nc, use_cslam
use dimensions_mod, only: nc
use reduction_mod, only: reductionbuffer_ordered_1d_t
use quadrature_mod, only: quadrature_t, gausslobatto

Expand Down Expand Up @@ -348,25 +348,9 @@ subroutine prim_init1(elem, fvm, par, Tl)
elem(ie)%derived%FQ=0.0_r8
elem(ie)%derived%FT=0.0_r8
elem(ie)%derived%FDP=0.0_r8
elem(ie)%derived%pecnd=0.0_r8

elem(ie)%derived%Omega=0
elem(ie)%state%dp3d=0

elem(ie)%derived%etadot_prescribed = nan
elem(ie)%derived%u_met = nan
elem(ie)%derived%v_met = nan
elem(ie)%derived%dudt_met = nan
elem(ie)%derived%dvdt_met = nan
elem(ie)%derived%T_met = nan
elem(ie)%derived%dTdt_met = nan
elem(ie)%derived%ps_met = nan
elem(ie)%derived%dpsdt_met = nan
elem(ie)%derived%nudge_factor = nan

elem(ie)%derived%Utnd=0._r8
elem(ie)%derived%Vtnd=0._r8
elem(ie)%derived%Ttnd=0._r8
end do

! ==========================================================
Expand Down
3 changes: 1 addition & 2 deletions src/dynamics/se/dycore/viscosity_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ subroutine biharmonic_wk_dp3d(elem,dptens,dpflux,ttens,vtens,deriv,edge3,hybrid,
real (kind=r8), dimension(np,np,nlevp) :: T_i


real (kind=r8) :: nu_ratio1, nu_ratio2, dp_thresh
real (kind=r8) :: nu_ratio1, nu_ratio2
logical var_coef1

kblk = kend - kbeg + 1
Expand All @@ -89,7 +89,6 @@ subroutine biharmonic_wk_dp3d(elem,dptens,dpflux,ttens,vtens,deriv,edge3,hybrid,
!so tensor is only used on second call to laplace_sphere_wk
var_coef1 = .true.
if(hypervis_scaling > 0) var_coef1 = .false.
dp_thresh=.025_r8 ! tunable coefficient
do ie=nets,nete
!$omp parallel do num_threads(vert_num_threads) private(k,tmp)
do k=kbeg,kend
Expand Down
2 changes: 1 addition & 1 deletion src/dynamics/se/dyn_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1993,7 +1993,7 @@ subroutine set_phis(dyn_in)
PHIS_OUT=phis_tmp, mask=pmask(:))
deallocate(glob_ind)

end if
end if

deallocate(pmask)

Expand Down
6 changes: 3 additions & 3 deletions src/dynamics/se/stepon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ subroutine diag_dynvar_ic(elem, fvm)

if (hist_fld_active('dp_ref_gll')) then
do ie = 1, nelemd
call get_dp_ref(hyai, hybi, ps0, elem(ie)%state%phis(:,:), dp_ref(:,:,:), ps_ref(:,:))
call get_dp_ref(hyai,hybi,ps0,elem(ie)%state%phis(:,:),dp_ref(:,:,:),ps_ref(:,:))
do j = 1, np
do i = 1, np
ftmp(i+(j-1)*np,:,1) = elem(ie)%state%dp3d(i,j,:,tl_f)/dp_ref(i,j,:)
Expand All @@ -420,8 +420,8 @@ subroutine diag_dynvar_ic(elem, fvm)
if (hist_fld_active('PS_gll')) then
allocate(fld_2d(np,np))
do ie = 1, nelemd
call get_ps(elem(ie)%state%Qdp(:,:,:,:,tl_Qdp), thermodynamic_active_species_idx_dycore,&
elem(ie)%state%dp3d(:,:,:,tl_f),fld_2d,hyai(1)*ps0)
call get_ps(elem(ie)%state%Qdp(:,:,:,:,tl_Qdp),&
thermodynamic_active_species_idx_dycore,elem(ie)%state%dp3d(:,:,:,tl_f),fld_2d,hyai(1)*ps0)
do j = 1, np
do i = 1, np
ftmp(i+(j-1)*np,1,1) = fld_2d(i,j)
Expand Down
Loading