Skip to content

Commit

Permalink
minor corrections to reproduce answers (#357)
Browse files Browse the repository at this point in the history
Co-authored-by: Uriel Ramirez <uriel.ramirez@noaa.gov>
  • Loading branch information
uramirez8707 and Uriel Ramirez authored Sep 9, 2024
1 parent f7125f7 commit 8bddaf4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
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

0 comments on commit 8bddaf4

Please sign in to comment.