From 6bf03aef39f69ef7d52134e5cb596680bfc7d513 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Thu, 22 Jun 2023 10:42:35 -0400 Subject: [PATCH] Parameter array on device, don't branch from structured data statement --- rrtmgp-frontend/mo_gas_optics_rrtmgp.F90 | 8 ++++---- rte-frontend/mo_rte_lw.F90 | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rrtmgp-frontend/mo_gas_optics_rrtmgp.F90 b/rrtmgp-frontend/mo_gas_optics_rrtmgp.F90 index 906649acd..adfa1bbef 100644 --- a/rrtmgp-frontend/mo_gas_optics_rrtmgp.F90 +++ b/rrtmgp-frontend/mo_gas_optics_rrtmgp.F90 @@ -260,9 +260,9 @@ function gas_optics_int(this, & ! ! Gas optics ! - !$acc data copyin(play, plev, tlay) + !$acc enter data copyin(play, plev, tlay) !$omp target enter data map(to:play, plev, tlay) - !$acc data create(jtemp, jpress, tropo, fmajor, jeta) + !$acc enter data create( jtemp, jpress, tropo, fmajor, jeta) !$omp target enter data map(alloc:jtemp, jpress, tropo, fmajor, jeta) error_msg = compute_gas_taus(this, & ncol, nlay, ngpt, nband, & @@ -329,9 +329,9 @@ function gas_optics_int(this, & end if !$acc exit data delete(tsfc) !$omp target exit data map(release:tsfc) - !$acc end data + !$acc exit data delete(jtemp, jpress, tropo, fmajor, jeta) !$omp target exit data map(release:jtemp, jpress, tropo, fmajor, jeta) - !$acc end data + !$acc exit data delete(play, plev, tlay) !$omp target exit data map(release:play, plev, tlay) end function gas_optics_int !------------------------------------------------------------------------------------------ diff --git a/rte-frontend/mo_rte_lw.F90 b/rte-frontend/mo_rte_lw.F90 index deb646007..dcf3dfff4 100644 --- a/rte-frontend/mo_rte_lw.F90 +++ b/rte-frontend/mo_rte_lw.F90 @@ -142,6 +142,7 @@ function rte_lw(optical_props, top_at_1, & 0.2009319137_wp, 0.2292411064_wp, 0.0698269799_wp, 0._wp, & 0.1355069134_wp, 0.2034645680_wp, 0.1298475476_wp, 0.0311809710_wp], & [max_gauss_pts, max_gauss_pts]) + !$acc declare create(gauss_Ds, gauss_wts) ! ------------------------------------------------------------------------------------ ncol = optical_props%get_ncol() nlay = optical_props%get_nlay() @@ -309,7 +310,7 @@ function rte_lw(optical_props, top_at_1, & ! ! Compute the radiative transfer... ! - !$acc data create( sfc_emis_gpt, flux_up_loc, flux_dn_loc, gpt_flux_up, gpt_flux_dn) copyin(gauss_wts, gauss_Ds) + !$acc data create( sfc_emis_gpt, flux_up_loc, flux_dn_loc, gpt_flux_up, gpt_flux_dn) !$omp target data map(alloc:sfc_emis_gpt, flux_up_loc, flux_dn_loc, gpt_flux_up, gpt_flux_dn) map(to:gauss_wts, gauss_Ds) call expand_and_transpose(optical_props, sfc_emis, sfc_emis_gpt) if(check_values) error_msg = optical_props%validate()