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

Ftype5 #1

Open
wants to merge 2 commits into
base: master
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
4 changes: 2 additions & 2 deletions components/homme/src/preqx/share/prim_advance_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,9 @@ subroutine applyCAMforcing_dp3d(elem,hvcoord,dyn_timelev,dt_dyn,nets,nete)
integer, intent(in) :: dyn_timelev,nets,nete

call t_startf("ApplyCAMForcing")
if (ftype == 3) then
if ((ftype == 3).or.(ftype == 5)) then
call ApplyCAMForcing_dynamics_dp(elem,hvcoord,dyn_timelev,dt_dyn,nets,nete)
elseif (ftype == 4) then
elseif ((ftype == 4)) then
call ApplyCAMForcing_dynamics (elem,hvcoord,dyn_timelev,dt_dyn,nets,nete)
endif
call t_stopf("ApplyCAMForcing")
Expand Down
2 changes: 1 addition & 1 deletion components/homme/src/share/namelist_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ subroutine readnl(par)
#ifndef CAM
!standalone homme does not support ftype=1 (cause it is identical to ftype=0).
!also, standalone ftype=0 is the same as standalone ftype=2.
if ((ftype == 0).or.(ftype == 2).or.(ftype == 3).or.(ftype == 4).or.(ftype == -1)) then
if ((ftype == 0).or.(ftype == 2).or.(ftype == 3).or.(ftype == 4).or.(ftype == -1).or.(ftype == 5)) then
else
call abortmp('Standalone homme supports only se_ftype=-1,0,2,3,4')
endif
Expand Down
62 changes: 58 additions & 4 deletions components/homme/src/share/prim_driver_base.F90
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,36 @@ subroutine prim_run_subcycle(elem, hybrid,nets,nete, dt, single_column, tl, hvco
call t_stopf("copy_qdp_h2d")
#endif



!temp test code
!this only makes sense if qsplit=1
if (ftype == 5) then
if(qsize >= 8) then
do ie=nets,nete
do k=1,nlev
!elem(ie)%state%Qdp(:,:,k,6,n0q)=elem(ie)%derived%FM(:,:,1,k)*elem(ie)%state%dp3d(:,:,k,tl%n0)
!elem(ie)%state%Qdp(:,:,k,7,n0q)=elem(ie)%derived%FM(:,:,2,k)*elem(ie)%state%dp3d(:,:,k,tl%n0)
!elem(ie)%state%Qdp(:,:,k,8,n0q)=elem(ie)%derived%FT(:,:,k)*elem(ie)%state%dp3d(:,:,k,tl%n0)
#if 1
elem(ie)%state%Qdp(:,:,k,6,n0_qdp)=elem(ie)%derived%FM(:,:,1,k)
elem(ie)%state%Qdp(:,:,k,7,n0_qdp)=elem(ie)%derived%FM(:,:,2,k)
elem(ie)%state%Qdp(:,:,k,8,n0_qdp)=elem(ie)%derived%FT(:,:,k)
#endif
enddo
enddo
else
print *,'qsize is less than 8'
stop
endif
endif







! Loop over rsplit vertically lagrangian timesiteps
call t_startf("prim_step_rX")
call prim_step(elem, hybrid, nets, nete, dt, tl, hvcoord, compute_diagnostics,single_column)
Expand Down Expand Up @@ -1091,7 +1121,7 @@ subroutine prim_step(elem, hybrid,nets,nete, dt, tl, hvcoord, compute_diagnostic
use prim_advance_mod, only: prim_advance_exp
use prim_advection_mod, only: prim_advec_tracers_remap
use reduction_mod, only: parallelmax
use time_mod, only: time_at,TimeLevel_t, timelevel_update, nsplit
use time_mod, only: time_at,TimeLevel_t,timelevel_update,timelevel_qdp, nsplit
use prim_advance_mod, only: applycamforcing_dp3d
use prim_state_mod, only: prim_printstate, prim_diag_scalars, prim_energy_halftimes

Expand All @@ -1106,10 +1136,11 @@ subroutine prim_step(elem, hybrid,nets,nete, dt, tl, hvcoord, compute_diagnostic
real(kind=real_kind) :: st, st1, dp, dt_q
integer :: ie, t, q,k,i,j,n
real (kind=real_kind) :: maxcflx, maxcfly
real (kind=real_kind) :: dp_np1(np,np)
!real (kind=real_kind) :: dp_np1(np,np)
logical :: compute_diagnostics
logical :: single_column

integer :: n0q, np1q

dt_q = dt*qsplit

Expand All @@ -1134,13 +1165,16 @@ subroutine prim_step(elem, hybrid,nets,nete, dt, tl, hvcoord, compute_diagnostic
!applyCAMforcing_dp3d should be glued to the call of prim_advance_exp
!energy diagnostics is broken for ftype 3,4
call ApplyCAMforcing_dp3d(elem,hvcoord,tl%n0,dt,nets,nete)

!temp test code
!this only makes sense if qsplit=1

! ===============
! Dynamical Step
! ===============
call t_startf("prim_step_dyn")
call prim_advance_exp(elem, deriv1, hvcoord, &
hybrid, dt, tl, nets, nete, compute_diagnostics, &
single_column)
hybrid, dt, tl, nets, nete, compute_diagnostics, single_column)
do n=2,qsplit
call TimeLevel_update(tl,"leapfrog")
!applyCAMforcing_dp3d should be glued to the call of prim_advance_exp
Expand Down Expand Up @@ -1178,6 +1212,26 @@ subroutine prim_step(elem, hybrid,nets,nete, dt, tl, hvcoord, compute_diagnostic
call t_stopf("PAT_remap")
end if
call t_stopf("prim_step_advec")

call TimeLevel_Qdp( tl, qsplit, n0q, np1q)
#if 1
!temp test code
!this only makes sense if qsplit=1
if (ftype == 5) then
if(qsize >= 8) then
do ie=nets,nete
do k=1,nlev
#if 1
elem(ie)%derived%FM(:,:,1,k) =elem(ie)%state%Qdp(:,:,k,6,np1q)
elem(ie)%derived%FM(:,:,2,k) = elem(ie)%state%Qdp(:,:,k,7,np1q)
elem(ie)%derived%FT(:,:,k) = elem(ie)%state%Qdp(:,:,k,8,np1q)
#endif
enddo
enddo
endif
endif
#endif

endif

end subroutine prim_step
Expand Down
2 changes: 1 addition & 1 deletion components/homme/src/test_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ subroutine compute_test_forcing(elem,hybrid,hvcoord,nt,ntQ,dt,nets,nete,tl)
endselect

!for ftype3 we scale tendencies by dp
if(ftype == 3) then
if((ftype == 3).or.(ftype==5)) then
!initialize dp3d from ps
do ie=nets,nete
do k=1,nlev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

preqx_setup()
# name target NP NC PLEV USE_PIO WITH_ENERGY QSIZE_D
createTestExec(preqx-nlev30-interp preqx 4 4 30 FALSE TRUE 5)
createTestExec(preqx-nlev30-interp preqx 4 4 30 FALSE TRUE 8)

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

preqx_setup()
# name target NP NC PLEV USE_PIO WITH_ENERGY QSIZE_D
createTestExec(preqx-nlev30-native preqx 4 4 30 TRUE FALSE 4)
createTestExec(preqx-nlev30-native preqx 4 4 30 TRUE FALSE 8)