Skip to content

Commit

Permalink
Create temps, pressures on the device only once.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertPincus committed Jun 21, 2023
1 parent 982fd91 commit 1f8313e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/all-sky/rrtmgp_allsky.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ program rte_rrtmgp_clouds_aerosols

!
nUserArgs = command_argument_count()
if (nUserArgs < 5) call stop_on_err("Need to supply ncol nlay nreps input_file gas-optics [cloud-optics [aerosol-optics]]")
if (nUserArgs < 5) call stop_on_err("Usage: rrtmgp_allsky ncol nlay nreps input_file gas-optics [cloud-optics [aerosol-optics]]")

call get_command_argument(1, char_input)
read(char_input, '(i8)') ncol
Expand Down Expand Up @@ -425,8 +425,8 @@ subroutine compute_profiles(SST, ncol, nlay, p_lay, t_lay, p_lev, t_lev, q_lay,
z_trop + 2._wp * (z_top - z_trop)/nlay * [(i, i=1, nlay/2)]]
z_lay(:) = 0.5_wp * (z_lev(1:nlay) + z_lev(2:nlay+1))

!$acc enter data copyin(z_lev, z_lay) create( p_lay, t_lay, p_lev, t_lev, q, o3)
!$omp target enter data map(to:z_lev, z_lay) map(alloc:p_lay, t_lay, p_lev, t_lev, q, o3)
!$acc data copyin(z_lev, z_lay)
!$omp target data map(to:z_lev, z_lay)

!
! The two loops are the same, except applied to layers and levels
Expand Down Expand Up @@ -477,6 +477,8 @@ subroutine compute_profiles(SST, ncol, nlay, p_lay, t_lay, p_lev, t_lev, q_lay,
t_lev(icol,ilay) = T
end do
end do
!$acc end data
!$omp target end data
end subroutine compute_profiles
! ----------------------------------------------------------------------------------
subroutine stop_on_err(error_msg)
Expand Down

0 comments on commit 1f8313e

Please sign in to comment.