diff --git a/scm/src/scm_vgrid.F90 b/scm/src/scm_vgrid.F90 index 550627997..2223851ff 100644 --- a/scm/src/scm_vgrid.F90 +++ b/scm/src/scm_vgrid.F90 @@ -3,7 +3,7 @@ module scm_vgrid -use scm_kinds, only: sp, dp, qp, kind_scm_dp +use scm_kinds, only: sp, dp, qp, kind_scm_dp, kind_scm_sp use scm_physical_constants, only : con_cp, con_rocp, con_fvirt, con_g, con_rd implicit none @@ -51,6 +51,9 @@ subroutine get_FV3_vgrid(scm_input, scm_state) integer :: nx, ny real(kind_scm_dp), allocatable :: pres_l_row(:), pres_i(:,:) real(kind_scm_dp), parameter :: zero = 0.0 + ! added for forcing initialized pressure to be single precision for + ! single and double precision runs + real(kind_scm_sp), allocatable :: pres_l_row_sp(:) #include "fv_eta.h" @@ -555,11 +558,12 @@ subroutine get_FV3_vgrid(scm_input, scm_state) !> - Calculate layer center pressures, sigma, and exner function. allocate(pres_l_row(nx), source=zero) + allocate(pres_l_row_sp(nx), source=zero) do k=1, km - pres_l_row = ((1.0/(con_rocp+1.0))*& + pres_l_row_sp = ((1.0/(con_rocp+1.0))*& (pres_i(:,k)**(con_rocp+1.0) - pres_i(:,k+1)**(con_rocp+1.0))/ & (pres_i(:,k) - pres_i(:,k+1)))**(1.0/con_rocp) - scm_state%pres_l(:,k) = pres_l_row + scm_state%pres_l(:,k) = pres_l_row_sp scm_state%sl(:,k) = 0.5*(scm_state%si(:,k) + scm_state%si(:,k+1)) scm_state%exner_l(:,k) = (scm_state%pres_l(:,k)/1.0E5)**con_rocp