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

Gzbugfix #292

Merged
merged 2 commits into from
Oct 10, 2023
Merged
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
28 changes: 14 additions & 14 deletions model/fv_mapz.F90
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
real, dimension(is:ie,km+1):: pe1, pe2, pk1, pk2, pn2, phis
real, dimension(isd:ied,jsd:jed,km):: pe4
real, dimension(is:ie+1,km+1):: pe0, pe3
real, dimension(is:ie):: gz, cvm
real, dimension(is:ie+1):: gz, cvm
real, dimension(isd:ied,jsd:jed,km):: qnl, qni

real rcp, rg, rrg, bkh, dtmp, k1k, dlnp, tpe
Expand Down Expand Up @@ -220,7 +220,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
do k=1,km
#ifdef MOIST_CAPPA
call moist_cv(is,ie,isd,ied,jsd,jed, km, j, k, nwat, sphum, liq_wat, rainwat, &
ice_wat, snowwat, graupel, q, gz, cvm)
ice_wat, snowwat, graupel, q, gz(is:ie), cvm(is:ie))
do i=is,ie
q_con(i,j,k) = gz(i)
cappa(i,j,k) = rdgas / ( rdgas + cvm(i)/(1.+r_vir*q(i,j,k,sphum)) )
Expand Down Expand Up @@ -272,7 +272,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
enddo
#ifdef MOIST_CAPPA
call moist_cv(is,ie,isd,ied,jsd,jed, km, j, k, nwat, sphum, liq_wat, rainwat, &
ice_wat, snowwat, graupel, q, gz, cvm)
ice_wat, snowwat, graupel, q, gz(is:ie), cvm(is:ie))
do i=is,ie
q_con(i,j,k) = gz(i)
cappa(i,j,k) = rdgas / ( rdgas + cvm(i)/(1.+r_vir*q(i,j,k,sphum)) )
Expand Down Expand Up @@ -366,21 +366,21 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
km, pe2, te, &
is, ie, j, isd, ied, jsd, jed, akap, T_VAR=1, conserv=.true.)
else
call map_scalar(km, peln(is,1,j), te, gz, &
call map_scalar(km, peln(is,1,j), te, gz(is:ie), &
km, pn2, te, &
is, ie, j, isd, ied, jsd, jed, 1, abs(kord_tm), cp_air*t_min)
endif

else
if ( kord_tm<0 ) then
! Map t using logp
call map_scalar(km, peln(is,1,j), pt, gz, &
call map_scalar(km, peln(is,1,j), pt, gz(is:ie), &
km, pn2, pt, &
is, ie, j, isd, ied, jsd, jed, &
1, abs(kord_tm), t_min)
else
! Map pt using pe
call map1_ppm (km, pe1, pt, gz, &
call map1_ppm (km, pe1, pt, gz(is:ie), &
km, pe2, pt, &
is, ie, j, isd, ied, jsd, jed, &
1, abs(kord_tm))
Expand Down Expand Up @@ -423,7 +423,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
-2, abs(kord_wz))
endif
! Remap delz for hybrid sigma-p coordinate
call map1_ppm (km, pe1, delz, gz, & ! works
call map1_ppm (km, pe1, delz, gz(is:ie), & ! works
km, pe2, delz, &
is, ie, j, is, ie, js, je, &
1, abs(kord_tm))
Expand Down Expand Up @@ -527,8 +527,8 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
! Note: pt at this stage is T_v or T_m , unless kord_tm > 0
do k=1,km
#ifdef MOIST_CAPPA
call moist_cv(is,ie,isd,ied,jsd,jed, km, j, k, nwat, sphum, liq_wat, rainwat, &
ice_wat, snowwat, graupel, q, gz, cvm)
call moist_cv(is,ie+1,isd,ied,jsd,jed, km, j, k, nwat, sphum, liq_wat, rainwat, &
ice_wat, snowwat, graupel, q, gz(is:ie+1), cvm(is:ie+1))
if ( kord_tm < 0 ) then
do i=is,ie
q_con(i,j,k) = gz(i)
Expand Down Expand Up @@ -613,7 +613,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
enddo
enddo

call map1_ppm( km, pe0(is:ie,:), u, gz, &
call map1_ppm( km, pe0(is:ie,:), u, gz(is:ie), &
km, pe3(is:ie,:), u, &
is, ie, j, isd, ied, jsd, jed+1, &
-1, kord_mt)
Expand All @@ -634,7 +634,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
enddo
enddo

call map1_ppm (km, pe0, v, gz, &
call map1_ppm (km, pe0, v, gz(is:ie+1), &
km, pe3, v, is, ie+1, &
j, isd, ied+1, jsd, jed, -1, kord_mt)

Expand All @@ -660,7 +660,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
do k=km,1,-1
#ifdef MOIST_CAPPA
call moist_cv(is,ie,isd,ied,jsd,jed, km, j, k, nwat, sphum, liq_wat, rainwat, &
ice_wat, snowwat, graupel, q, gz, cvm)
ice_wat, snowwat, graupel, q, gz(is:ie), cvm(is:ie))
do i=is,ie
q_con(i,j,k) = gz(i)
cappa(i,j,k) = rdgas / ( rdgas + cvm(i)/(1.+r_vir*q(i,j,k,sphum)) )
Expand Down Expand Up @@ -759,7 +759,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
do k=1,km
#ifdef USE_COND
call moist_cv(is,ie,isd,ied,jsd,jed, km, j, k, nwat, sphum, liq_wat, rainwat, &
ice_wat, snowwat, graupel, q, gz, cvm)
ice_wat, snowwat, graupel, q, gz(is:ie), cvm(is:ie))
do i=is,ie
! KE using 3D winds:
q_con(i,j,k) = gz(i)
Expand Down Expand Up @@ -870,7 +870,7 @@ subroutine Lagrangian_to_Eulerian(last_step, consv, ps, pe, delp, pkz, pk, &
else
#ifdef USE_COND
call moist_cv(is,ie,isd,ied,jsd,jed, km, j, k, nwat, sphum, liq_wat, rainwat, &
ice_wat, snowwat, graupel, q, gz, cvm)
ice_wat, snowwat, graupel, q, gz(is:ie), cvm(is:ie))
do i=is,ie
pt(i,j,k) = (pt(i,j,k)+dtmp/cvm(i)*pkz(i,j,k))/((1.+r_vir*q(i,j,k,sphum))*(1.-gz(i)))
enddo
Expand Down