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

Minor corrections for mixed mode support in AM5 #357

Merged
merged 1 commit into from
Sep 9, 2024
Merged
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
26 changes: 17 additions & 9 deletions driver/GFDL/include/atmosphere.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@
& in the Cubed Sphere')
endif

do j=jsc,jec+1
do i=isc,iec+1
blon(i-isc+1,j-jsc+1) = _DBL_(_RL_(Atm(mygrid)%gridstruct%grid(i,j,1)))
blat(i-isc+1,j-jsc+1) = _DBL_(_RL_(Atm(mygrid)%gridstruct%grid(i,j,2)))
enddo
end do

if (ATMOSPHERE_KIND_ .eq. r8_kind) then
do j=jsc,jec+1
do i=isc,iec+1
blon(i-isc+1,j-jsc+1) = Atm(mygrid)%gridstruct%grid_64(i,j,1)
blat(i-isc+1,j-jsc+1) = Atm(mygrid)%gridstruct%grid_64(i,j,2)
enddo
end do
else
do j=jsc,jec+1
do i=isc,iec+1
blon(i-isc+1,j-jsc+1) = Atm(mygrid)%gridstruct%grid(i,j,1)
blat(i-isc+1,j-jsc+1) = Atm(mygrid)%gridstruct%grid(i,j,2)
enddo
end do
endif
end subroutine ATMOSPHERE_BOUNDARY_

subroutine ATMOSPHERE_PREF_ (p_ref)
Expand Down Expand Up @@ -56,8 +64,8 @@
p_surf(i,j) = _DBL_(_RL_(Atm(mygrid)%ps(i,j)))
t_bot(i,j) = _DBL_(_RL_(Atm(mygrid)%pt(i,j,npz)))
p_bot(i,j) = _DBL_(_RL_(Atm(mygrid)%delp(i,j,npz)/(Atm(mygrid)%peln(i,npz+1,j)-Atm(mygrid)%peln(i,npz,j))))
z_bot(i,j) = rrg*t_bot(i,j)*_DBL_(_RL_(1.+zvir*Atm(mygrid)%q(i,j,npz,sphum))) * &
_DBL_(_RL_(1. - Atm(mygrid)%pe(i,npz,j)/p_bot(i,j)))
z_bot(i,j) = rrg*t_bot(i,j)*_DBL_(_RL_((1.+zvir*Atm(mygrid)%q(i,j,npz,sphum)))) * &
_DBL_(_RL_((1. - Atm(mygrid)%pe(i,npz,j)/p_bot(i,j))))
enddo
enddo

Expand Down
6 changes: 3 additions & 3 deletions tools/fv_grid_tools.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

module fv_grid_tools_mod
#ifdef OVERLOAD_R4
use constants_mod, only: grav, pi=>pi_8
use constantsR4_mod, only: grav, pi=>pi_8
#else
use constantsR4_mod,only: grav, pi=>pi_8
use constants_mod,only: grav, pi=>pi_8
#endif
use fv_arrays_mod, only: radius, omega ! scaled for small earth
! use test_cases_mod, only: small_earth_scale
Expand Down Expand Up @@ -89,7 +89,7 @@ subroutine read_grid(Atm, grid_file, ndims, nregions, ng)
integer, intent(IN) :: ng

type(FmsNetcdfFile_t) :: Grid_input
real, allocatable, dimension(:,:) :: tmpx, tmpy
real(kind=R_GRID), allocatable, dimension(:,:) :: tmpx, tmpy
real(kind=R_GRID), pointer, dimension(:,:,:) :: grid
character(len=128) :: units = ""
character(len=256) :: atm_mosaic, atm_hgrid, grid_form
Expand Down