Skip to content

Commit

Permalink
correct tendency calc
Browse files Browse the repository at this point in the history
	modified:   src/physics/cam/aoa_tracers.F90
  • Loading branch information
fvitt committed Aug 5, 2024
1 parent 7faef52 commit 89b4f10
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/physics/cam/aoa_tracers.F90
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ subroutine aoa_tracers_timestep_tend(state, ptend, cflx, landfrac, dt)
real(r8) :: wimp ! 1./(1.+ k*dt/2)
real(r8) :: wsrc ! teul*wimp

real(r8) :: xmmr
real(r8), parameter :: mmr0 = 1.0e-6_r8 ! initial lower boundary mmr
real(r8), parameter :: per_yr = 0.02_r8 ! fractional increase per year

!------------------------------------------------------------------

teul = .5_r8*dt/(86400._r8 * treldays) ! 1/2 for the semi-implicit scheme if dt=time step
Expand Down Expand Up @@ -363,15 +367,16 @@ subroutine aoa_tracers_timestep_tend(state, ptend, cflx, landfrac, dt)

end do

ptend%q(1:ncol,1:pver-1,ixaoa5) = 0._r8
ptend%q(1:ncol,pver,ixaoa5) = 1.e-6_r8 * 0.02_r8 * years / dt
! AOA1MF
xmmr = mmr0*(1._r8 + per_yr*years)
ptend%q(1:ncol,pver,ixaoa5) = (xmmr - state%q(1:ncol,pver,ixaoa5)) / dt

! record tendencies on history files
call outfld (src_names(1), ptend%q(:,:,ixaoa1), pcols, lchnk)
call outfld (src_names(2), ptend%q(:,:,ixaoa2), pcols, lchnk)
call outfld (src_names(3), ptend%q(:,:,ixht), pcols, lchnk)
call outfld (src_names(4), ptend%q(:,:,ixvt), pcols, lchnk)
call outfld (src_names(5), ptend%q(:,:,ixaoa5), pcols, lchnk)
call outfld (src_names(5), ptend%q(:,:,ixaoa5), pcols, lchnk)

! Set tracer fluxes
do i = 1, ncol
Expand All @@ -392,6 +397,9 @@ subroutine aoa_tracers_timestep_tend(state, ptend, cflx, landfrac, dt)
! VERT
cflx(i,ixvt) = 0._r8

! AOA1MF
cflx(i,ixaoa5) = 0._r8

end do

end subroutine aoa_tracers_timestep_tend
Expand Down Expand Up @@ -429,6 +437,7 @@ subroutine init_cnst_3d(m, latvals, lonvals, mask, q)
end do
else if (m == ixaoa5) then

! AOA1MF
q(:,:) = 0.0_r8

else if (m == ixvt) then
Expand Down

0 comments on commit 89b4f10

Please sign in to comment.