Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
934f6e4
add new deformation coefficients to registries
Dec 20, 2019
da78a8c
initialize new deformation coefficients
Dec 20, 2019
b7880ce
add pointers for new coefficients
Dec 20, 2019
235b61c
add initialization of new arrays to zero
Dec 23, 2019
cf17fae
pass new arrays to dyn_tend_work - compiles
Dec 23, 2019
bf910d6
add deformation formulation to 2d Smagorinsky kdiff
mgduda Dec 4, 2025
31a507c
bug fixes for computing the deformation coefficients for the 2D Smago…
skamaroc Dec 27, 2019
a4c08d4
Fixed error in w_x, w_y deformation coefficients.
skamaroc Dec 30, 2019
4fbeab4
New module file for the dissipation routines.
skamaroc Dec 31, 2019
bf5e369
(1) Changes to the Makefile to compile new dissipation module.
mgduda Dec 4, 2025
597f74f
Modifications to use mpas_atm_dimensions in the dissipation module
skamaroc Dec 31, 2019
b454527
Adding configuration string for the les models in the Registry.
mgduda Dec 4, 2025
728077e
Moved the dissipation term computations for u, theta and w from
mgduda Dec 4, 2025
93d2ac5
Added initialization for convective boundary layer LES case.
skamaroc Jan 6, 2020
c5eb44e
add calcalate_n2 routine (no functional code yet)
Jan 7, 2020
b18f3e2
add to arg list of calculate_n2
Jan 8, 2020
a633636
add dry N^2
Jan 16, 2020
d42a459
fix theta to be in diag pool
Jan 17, 2020
f0fc10d
fix to use theta_m and qv instead of non-updated theta
Jan 17, 2020
116368b
use local 1d theta array for efficiency
Jan 17, 2020
b673e28
add qtot drag term to thetav in dry case
Jan 24, 2020
a9d7bfa
add cloudy conditions N2 calculation following WRF and Durran and Kle…
Jan 27, 2020
f12589d
remove thetav use
Jan 30, 2020
7abd792
add bn2 to output and commented out test call
mgduda Dec 4, 2025
a6faf86
added a 3D vertical eddy viscosity to the Registry for use in LES app…
skamaroc Mar 6, 2020
88aa0b2
Added a horizontal eddy_viscosity array to go along with the vertical
skamaroc Mar 9, 2020
05f206c
Bug fixes in the new LES mixing routines.
skamaroc Mar 9, 2020
92fbf81
added test calls to the new 3D LES schemes. This is currently hardwired
mgduda Dec 4, 2025
1eaffdf
Bug fixes for the supercell test case using the 3D Smagorinsky LES mo…
skamaroc Mar 9, 2020
eb4b3ef
switched signs of the vertical turbulent fluxes and vertical flux div…
skamaroc Mar 9, 2020
dbd83ea
Added new lower boundary conditions for LES simulations:
mgduda Dec 4, 2025
59f1348
Added a scalar variable named tke. This is the turbulent kinetic energy
skamaroc Mar 16, 2020
31f21ff
Added passive test of prognostic tke. Does not yet pass debug step.
skamaroc Mar 17, 2020
7e1581b
1.5 order prognostic tke mods. The prognostic tke does not feed back …
skamaroc Mar 18, 2020
84ad242
Added mixing routines for scalars within the LES models,
skamaroc Mar 18, 2020
bf39525
Clean up and changes to run the prognostic tke les model. initial tests
skamaroc Mar 20, 2020
203fdef
bug fixes and the addition of the Prandtl number formulation to the
skamaroc Mar 24, 2020
1f442ae
changed Prandtl number to 1/3 for LES simulations in the MPAS_constan…
skamaroc Apr 2, 2020
57a8829
implemented a perturbation coriolis term option for the LES cases.
skamaroc Apr 2, 2020
7ddd21d
introduced the sheared PBL test case for the LES implementation, incl…
skamaroc Apr 2, 2020
6212e0e
Implemented SAS case sounding in LES initialization.
skamaroc Apr 23, 2020
3591008
Added the SAS LES time-varying lower boundary moisture and heat fluxes.
mgduda Dec 4, 2025
f77c123
changed the initialization for the random potential temperature pretu…
skamaroc May 4, 2020
b6f044a
Added a 3D diagnostic variable: the inverse Prandtl number used in the
skamaroc May 4, 2020
2a9afca
Threaded the 3D inverse Prandtl number through to the routines that n…
skamaroc May 4, 2020
7bef48f
ustm passed to u_dissipation_3d, diag_physics pool accessed
May 13, 2020
f2ae5be
ustm add pointer remove blanks in pool statement
May 15, 2020
1ab69a0
add les_model check to bypass pbl calls
Jun 3, 2020
b6f5cba
add time_of_day_seconds calculation (compiles)
Jun 17, 2020
d6d42f0
add flux_les_sas call in driver_sfclayer routine
Jun 23, 2020
a7a1dc5
add fluxes to sfclay arguments and pass in
Jun 23, 2020
e6d26f2
pass heat flux args to sfclay1d
Jul 30, 2020
460c8b5
copy specified fluxes to hfx and qfx before sfclay1d
Jul 30, 2020
fb5e94f
add MOL and BR calculations to sfclay1d
Jul 30, 2020
88df14a
add ustm drag in u_dissipation_3d les_sas_test
Aug 12, 2020
5c9feb4
skip hfx and qfx calcs in sfclay for specified_flux
Aug 13, 2020
d0d418d
pass hfx and qfx to dissipation and use for les_sas
Aug 13, 2020
3121ce5
comment out duplicate flux_les_sas in dissipiation module
Aug 18, 2020
af3233d
Set dummy TSK and UST=USTM (no VCONV)
Aug 18, 2020
16637ca
sign correction for MOL
Aug 18, 2020
210df8e
pass clock atm_do_timestep to physics_driver to driver_sfclayer
Aug 19, 2020
eba2aee
put k loop around prandtl_inverse calc in dissipation
Aug 19, 2020
9895ad5
bug fixes - fixed an uninitialized value in the w turbulent flux at t…
skamaroc Sep 25, 2020
82a1a8c
hfx = heat_flux*rho*cp (factor added)
Oct 27, 2020
a7828af
add print for ust_edge
Nov 10, 2020
5e34d46
initialize landmask, lu_index(ivgtyp), xland = 1
Nov 10, 2020
4514244
change hardwired value of f - need to generize to use fEdge
Nov 2, 2021
cdb3a2e
fix rdzw/rdzu for w dissipation, use fEdge instead of coriolis_value
Nov 3, 2021
dcaa620
revert to hardwired f until fEdge can be used
Nov 3, 2021
19e94ab
convert moisture_flux w'q' to surface flux qfx
Nov 30, 2021
2bea048
moisture_flux in dynamics should be w'q' = qfx/rho
Dec 8, 2021
99e8905
add commented fEdge line while still using hardwired f
dudhia Mar 24, 2022
684cc61
initial prep to use les_test option
dudhia Jun 22, 2022
2410a51
fix for compile
dudhia Oct 30, 2024
f0ee5eb
fixes to compile init_atmosphere
dudhia Oct 30, 2024
af5807a
to compile atmosphere
dudhia Nov 1, 2024
a284542
fix small error in tke shear production and add surface heat flux
dudhia Jan 2, 2025
c3f694c
remove specialized physics code to leave dynonly les
dudhia Mar 19, 2025
d916283
mods to scale les-supercell case and remove surface fluxes from les_test
dudhia May 21, 2025
97e73ed
add seed tke = 0.1 at all points
dudhia May 23, 2025
ac2f96c
fix scaling for x_period and y_period for cases
dudhia Aug 12, 2025
250db00
revert supercell a_scale to 1.0
dudhia Aug 27, 2025
e446ec8
add config_les_surface to registry and routines (not used yet)
dudhia Sep 29, 2025
96574f2
clean up and reduce duplication
dudhia Oct 8, 2025
a311c6f
remove redundant dissipation routines
dudhia Oct 8, 2025
49372ce
Merge with Bill Skamarock updated LES modules
dudhia Oct 9, 2025
6345dc1
add surface flux namelist options
dudhia Oct 21, 2025
eef4473
Add explicit declarations of iCell, k, and p in the calculate_n2 routine
mgduda Dec 4, 2025
a6eec0e
Avoid passing null pointers for ustm, hfx, and qfx to atm_compute_dyn…
mgduda Dec 5, 2025
08e681b
Remove unused variables from new LES code for init and mixing
mgduda Dec 5, 2025
ec50d82
Remove trailing whitespace from mpas_atm_dissipation_models.F
mgduda Dec 5, 2025
384c5ba
Clean up indentation in mpas_atm_dissipation_models.F
mgduda Dec 5, 2025
49b38aa
Use a macro for debugging print statements in mpas_atm_dissipation_mo…
mgduda Dec 5, 2025
4b87718
Use integer comparisons for config_les_model and config_les_surface
mgduda Dec 6, 2025
8a61b88
Add 'lbc_tke' to the 'lbc_scalars' var_array in atmosphere core Regis…
mgduda Jan 21, 2026
94d2488
Initial pass at porting mpas_atm_dissipation_models to GPUs with OpenACC
mgduda Dec 10, 2025
8b874cb
Update copyright statement at the top of mpas_atm_dissipation_models.F
mgduda Jan 29, 2026
4712ea1
Fix LaTeX quotes in possible_values for config_les_model and config_l…
mgduda Jan 29, 2026
29ed020
Fix indentation of deformation_coef_* variables in atmosphere core Re…
mgduda Feb 3, 2026
3cb172c
Clean up indentation in atm_init_test_coefs routine in mpas_atm_advec…
mgduda Feb 3, 2026
d03b67c
Tidy up module use statements in mpas_atm_time_integration.F
mgduda Feb 3, 2026
27561d0
Fix indentation of call to atm_compute_dyn_tend in atm_srk3
mgduda Feb 3, 2026
73d73c6
Fix indentation of calls to calculate_n2 and les_models in atm_comput…
mgduda Feb 4, 2026
b8094d5
Remove commented-out calls to non-existent dissipation routines
mgduda Feb 4, 2026
c13e7f5
Set the Prandtl number back to 1.0 in mpas_constants
mgduda Feb 4, 2026
5001305
Remove unnecessary variables from the atmosphere core's restart stream
mgduda Feb 4, 2026
bfba0ca
Move computation of time_of_day_seconds into flux_les_sas routine
mgduda Feb 4, 2026
676bb7f
Fix implementation of "CAM-MPAS" 2nd-order horizontal filter
mgduda Feb 4, 2026
60e765b
fixup: tidy up whitespace and comments in mpas_atm_advection.F
mgduda Feb 13, 2026
8bc6582
fixup: eliminate duplicated code to convert namelist options to integ…
mgduda Feb 13, 2026
b762d35
Consolidating OpenACC device-host memory transfers
abishekg7 May 13, 2025
a175fc7
Fixing bug associated with rho_zz_2 not being copied out at the end o…
abishekg7 May 22, 2025
78f19b0
Moving some OpenACC data movements to subroutines
abishekg7 Jun 14, 2025
66a3179
Removing acc data xfer timers for device variables using create/delete
abishekg7 Jul 3, 2025
f34dd04
Using acc declare create for rho_zz_int and corresponding cleanup
abishekg7 Jul 8, 2025
bd75dba
Removing atm_advance_scalars_mono ACC_data_xfer timers around create/…
abishekg7 Jul 8, 2025
688f399
Simplifying OpenACC data transfers around the call to mpas_reconstruc…
abishekg7 Jul 8, 2025
59d0a4b
Need to copyout u_2 and w_2 at the end of dynamics
abishekg7 Aug 14, 2025
3e657cf
Fixes to produce correct results with CURVATURE
abishekg7 Aug 22, 2025
4467748
Adding option to enable GPU execution of mpas_reconstruct_2d
abishekg7 Oct 3, 2025
0b45ee2
fixes needed with intel compiler
abishekg7 Oct 13, 2025
88d8a4e
Make ACC data movements of lbc variables contigent on config_apply_lbcs
abishekg7 Nov 12, 2025
35cc144
Some more fixes to get GPU runs working
abishekg7 Feb 24, 2026
84602ed
Add data movement for some fields under the mpas_halo_groups
May 7, 2025
994674c
Add a data region and acc kernels to the 2D packing code
May 7, 2025
3ea454f
Add the update directives that should have been part of the last commit
May 7, 2025
227a8d0
Comment out data present region, see if this causes an error
May 7, 2025
c7e19fc
Expand the data managed on the GPU for the halo exchange
May 7, 2025
ad0dc4d
Remove the OpenACC management of recvBuf
May 7, 2025
9367137
Add update host(sendBuf) back, address answer diff
May 7, 2025
5a4a3bb
Expand to other packing kernels, only update sendBuf after packing fi…
May 7, 2025
0cf0dbf
Change to simple integers to access the buffers and the field arrays
May 7, 2025
14fbe88
Add kernels to unpacking loops and use a data present region to try t…
May 8, 2025
36ebbe5
Change from data copyin regions to enter/exit directives for the r?ar…
May 8, 2025
c7454a5
Re-enable update host for sendBuf, add update device recvBuf
May 8, 2025
b29e3f0
Remove update directives, use acc host_data use_device(...) near MPI …
May 8, 2025
5b227db
checkpoints: acc pack + cuda aware mpi working
abishekg7 Aug 6, 2025
df7c5fb
seems to be working
abishekg7 Aug 7, 2025
b00e437
Optimized packing and unpacking loops. Adding timers and other cleanup
abishekg7 Aug 7, 2025
354c91a
Working savepoint
abishekg7 Aug 12, 2025
5847e99
u_2 and w_2 need to be copied out after dynamics + cleanup
abishekg7 Aug 13, 2025
321c260
using attach in a directive instead of the acc_attach library call
abishekg7 Aug 13, 2025
28da82b
Using attach clause in parallel region will also auto detach at end o…
abishekg7 Aug 13, 2025
9c344d7
Reverting the indexing in loops and comment cleanup
abishekg7 Aug 13, 2025
b17da15
New namelist option to switch on or off GPU-Aware MPI
abishekg7 Aug 13, 2025
eff87cf
Adding a dependency to mpas_timer.o in mpas_halo.o
abishekg7 Sep 25, 2025
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
79 changes: 77 additions & 2 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,31 @@
description="Formulation of horizontal mixing"
possible_values="`2d_fixed' or `2d_smagorinsky'"/>

<nml_option name="config_les_model" type="character" default_value="none"
units="-"
description="LES dissipation model"
possible_values="`none', `3d_smagorinsky', `prognostic_1.5_order'"/>

<nml_option name="config_les_surface" type="character" default_value="none"
units="-"
description="LES surface flux option"
possible_values="`specified', `varying'"/>

<nml_option name="config_surface_heat_flux" type="real" default_value="0.0"
units="K m s-1"
description="specified surface heat flux w'theta'"
possible_values="real number"/>

<nml_option name="config_surface_moisture_flux" type="real" default_value="0.0"
units="kg m s-1"
description="specified surface moisture flux w'q'"
possible_values="real number"/>

<nml_option name="config_surface_drag_coefficient" type="real" default_value="0.0"
units="-"
description="Cd 10m drag coefficient"
possible_values="real number"/>

<nml_option name="config_len_disp" type="real" default_value="0.0" in_defaults="false"
units="m"
description="Horizontal length scale, used by the Smagorinsky formulation of horizontal diffusion and by 3-d divergence damping"
Expand All @@ -156,6 +181,11 @@
description="Scaling coefficient of $\delta x^3$ to obtain $\nabla^4$ diffusion coefficient"
possible_values="Non-negative real values"/>

<nml_option name="config_mix_scalars" type="logical" default_value="false"
units="-"
description="Whether to enable horizontal and vertical mixing for scalars"
possible_values=".true. or .false."/>

<nml_option name="config_del4u_div_factor" type="real" default_value="10.0" in_defaults="false"
units="-"
description="Scaling factor for the divergent component of $\nabla^4 u$ calculation"
Expand Down Expand Up @@ -392,6 +422,10 @@
units="-"
description="Method to use for exchanging halos"
possible_values="`mpas_dmpar', `mpas_halo'"/>
<nml_option name="config_gpu_aware_mpi" type="logical" default_value="false"
units="-"
description="Whether to use GPU-aware MPI for halo exchanges"
possible_values=".true. or .false."/>
</nml_record>

<!-- **************************************************************************************** -->
Expand Down Expand Up @@ -494,6 +528,11 @@
<var name="deriv_two"/>
<var name="defc_a"/>
<var name="defc_b"/>
<var name="deformation_coef_c2"/>
<var name="deformation_coef_s2"/>
<var name="deformation_coef_cs"/>
<var name="deformation_coef_c"/>
<var name="deformation_coef_s"/>
<var name="coeffs_reconstruct"/>
#ifdef MPAS_CAM_DYCORE
<var name="cell_gradient_coef_x"/>
Expand Down Expand Up @@ -1561,6 +1600,20 @@
<var name="cell_gradient_coef_y" type="real" dimensions="maxEdges nCells" units="m^-1"
description="Coefficients for computing the y (meridional) derivative of a cell-centered variable"/>
#endif
<var name="deformation_coef_c2" type="real" dimensions="maxEdges nCells" units="unitless"
description="Coefficients for computing the cos-squared terms of the 3d deformation"/>

<var name="deformation_coef_s2" type="real" dimensions="maxEdges nCells" units="unitless"
description="Coefficients for computing the sine-squared terms of the 3d deformation"/>

<var name="deformation_coef_cs" type="real" dimensions="maxEdges nCells" units="unitless"
description="Coefficients for computing the cos-sine terms of the 3d deformation"/>

<var name="deformation_coef_c" type="real" dimensions="maxEdges nCells" units="unitless"
description="Coefficients for computing the cos-only terms of the 3d deformation"/>

<var name="deformation_coef_s" type="real" dimensions="maxEdges nCells" units="unitless"
description="Coefficients for computing the sine-only terms of the 3d deformation"/>

<!-- Arrays required for reconstruction of velocity field -->
<var name="coeffs_reconstruct" type="real" dimensions="R3 maxEdges nCells" units="unitless"
Expand Down Expand Up @@ -1673,6 +1726,9 @@
<var name="nwfa" array_group="number" units="nb kg^{-1}"
description="Water-friendly aerosol number concentration"
packages="mp_thompson_aers_in"/>

<var name="tke" array_group="turbulence" units="m^2 s^{-2}"
description="Turbulent kinetic energy for the prognostic tke LES scheme"/>
</var_array>
#endif

Expand Down Expand Up @@ -1921,8 +1977,20 @@
<var name="rho_p_save" type="real" dimensions="nVertLevels nCells Time" units="kg m^{-3}"
description="predicted value rho_p, saved before acoustic steps"/>

<var name="kdiff" type="real" dimensions="nVertLevels nCells Time" units="m^2 s^{-1}"
description="Smagorinsky horizontal eddy viscosity"/>
<var name="eddy_visc_vert" type="real" dimensions="nVertLevels nCells Time" units="m^2 s^{-1}"
description="vertical eddy viscosity for les models"/>

<var name="eddy_visc_horz" type="real" dimensions="nVertLevels nCells Time" units="m^2 s^{-1}"
description="horizontal eddy viscosity for les models"/>

<var name="prandtl_3d_inv" type="real" dimensions="nVertLevels nCells Time" units="unitless"
description="Inverse prandtl number used for vertical mixing in prognostic LES formulation"/>

<var name="bn2" type="real" dimensions="nVertLevels nCells Time" units="s^{-2}"
description="Square of Brunt-Vaisala frequency"/>

<var name="tend_rtheta_adv" type="real" dimensions="nVertLevels nCells Time" units="kg K m^{-3} s^{-1}"
description="flux divergence for rho*theta_m/zz, used in the Tiedtke convective parameterization"/>

<var name="surface_pressure" type="real" dimensions="nCells Time" units="Pa"
description="Diagnosed surface pressure"/>
Expand Down Expand Up @@ -2024,6 +2092,9 @@
<var name="tend_nwfa" name_in_code="nwfa" array_group="number" units="nb m^{-3} s^{-1}"
description="Tendency of water-friendly aerosol number concentration multiplied by dry air density divided by d(zeta)/dz"
packages="mp_thompson_aers_in"/>

<var name="tend_tke" name_in_code="tke" array_group="turbulence" units="kg m^{-3} m^2 s^{-2} s^{-1}"
description="Tendency of tke multiplied by dry air density divided by d(zeta)/dz"/>
</var_array>
#endif
</var_struct>
Expand Down Expand Up @@ -2102,6 +2173,10 @@
<var name="lbc_nwfa" name_in_code="nwfa" array_group="number" packages="mp_thompson_aers_in"
units="m^{-3} s^{-1}"
description="Lateral boundary tendency of water-friendly aerosol number concentration"/>

<var name="lbc_tke" name_in_code="tke" array_group="turbulence"
units="m^2 s^{-3}"
description="Lateral boundary tendency of TKE"/>
</var_array>
</var_struct>

Expand Down
5 changes: 3 additions & 2 deletions src/core_atmosphere/dynamics/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.SUFFIXES: .F .o

OBJS = mpas_atm_time_integration.o \
mpas_atm_boundaries.o
mpas_atm_boundaries.o \
mpas_atm_dissipation_models.o

all: $(OBJS)

mpas_atm_time_integration.o: mpas_atm_boundaries.o mpas_atm_iau.o
mpas_atm_time_integration.o: mpas_atm_boundaries.o mpas_atm_iau.o mpas_atm_dissipation_models.o

mpas_atm_boundaries.o:

Expand Down
32 changes: 0 additions & 32 deletions src/core_atmosphere/dynamics/mpas_atm_boundaries.F
Original file line number Diff line number Diff line change
Expand Up @@ -395,18 +395,14 @@ subroutine mpas_atm_get_bdy_tend(clock, block, vertDim, horizDim, field, delta_t
nullify(tend)
call mpas_pool_get_array(lbc, 'lbc_'//trim(field), tend, 1)

MPAS_ACC_TIMER_START('mpas_atm_get_bdy_tend [ACC_data_xfer]')
if (associated(tend)) then
!$acc enter data copyin(tend)
else
call mpas_pool_get_array(lbc, 'lbc_scalars', tend_scalars, 1)
!$acc enter data copyin(tend_scalars)

! Ensure the integer pointed to by idx_ptr is copied to the gpu device
call mpas_pool_get_dimension(lbc, 'index_'//trim(field), idx_ptr)
idx = idx_ptr
end if
MPAS_ACC_TIMER_STOP('mpas_atm_get_bdy_tend [ACC_data_xfer]')

!$acc parallel default(present)
if (associated(tend)) then
Expand All @@ -426,13 +422,6 @@ subroutine mpas_atm_get_bdy_tend(clock, block, vertDim, horizDim, field, delta_t
end if
!$acc end parallel

MPAS_ACC_TIMER_START('mpas_atm_get_bdy_tend [ACC_data_xfer]')
if (associated(tend)) then
!$acc exit data delete(tend)
else
!$acc exit data delete(tend_scalars)
end if
MPAS_ACC_TIMER_STOP('mpas_atm_get_bdy_tend [ACC_data_xfer]')

end subroutine mpas_atm_get_bdy_tend

Expand Down Expand Up @@ -533,9 +522,6 @@ subroutine mpas_atm_get_bdy_state_2d(clock, block, vertDim, horizDim, field, del
! query the field as a scalar constituent
!
if (associated(tend) .and. associated(state)) then
MPAS_ACC_TIMER_START('mpas_atm_get_bdy_state_2d [ACC_data_xfer]')
!$acc enter data copyin(tend, state)
MPAS_ACC_TIMER_STOP('mpas_atm_get_bdy_state_2d [ACC_data_xfer]')

!$acc parallel default(present)
!$acc loop gang vector collapse(2)
Expand All @@ -546,20 +532,13 @@ subroutine mpas_atm_get_bdy_state_2d(clock, block, vertDim, horizDim, field, del
end do
!$acc end parallel

MPAS_ACC_TIMER_START('mpas_atm_get_bdy_state_2d [ACC_data_xfer]')
!$acc exit data delete(tend, state)
MPAS_ACC_TIMER_STOP('mpas_atm_get_bdy_state_2d [ACC_data_xfer]')
else
call mpas_pool_get_array(lbc, 'lbc_scalars', tend_scalars, 1)
call mpas_pool_get_array(lbc, 'lbc_scalars', state_scalars, 2)
call mpas_pool_get_dimension(lbc, 'index_'//trim(field), idx_ptr)

idx=idx_ptr ! Avoid non-array pointer for OpenACC

MPAS_ACC_TIMER_START('mpas_atm_get_bdy_state_2d [ACC_data_xfer]')
!$acc enter data copyin(tend_scalars, state_scalars)
MPAS_ACC_TIMER_STOP('mpas_atm_get_bdy_state_2d [ACC_data_xfer]')

!$acc parallel default(present)
!$acc loop gang vector collapse(2)
do i=1, horizDim+1
Expand All @@ -569,9 +548,6 @@ subroutine mpas_atm_get_bdy_state_2d(clock, block, vertDim, horizDim, field, del
end do
!$acc end parallel

MPAS_ACC_TIMER_START('mpas_atm_get_bdy_state_2d [ACC_data_xfer]')
!$acc exit data delete(tend_scalars, state_scalars)
MPAS_ACC_TIMER_STOP('mpas_atm_get_bdy_state_2d [ACC_data_xfer]')
end if

end subroutine mpas_atm_get_bdy_state_2d
Expand Down Expand Up @@ -652,10 +628,6 @@ subroutine mpas_atm_get_bdy_state_3d(clock, block, innerDim, vertDim, horizDim,
call mpas_pool_get_array(lbc, 'lbc_'//trim(field), tend, 1)
call mpas_pool_get_array(lbc, 'lbc_'//trim(field), state, 2)

MPAS_ACC_TIMER_START('mpas_atm_get_bdy_state_3d [ACC_data_xfer]')
!$acc enter data copyin(tend, state)
MPAS_ACC_TIMER_STOP('mpas_atm_get_bdy_state_3d [ACC_data_xfer]')

!$acc parallel default(present)
!$acc loop gang vector collapse(3)
do i=1, horizDim+1
Expand All @@ -667,10 +639,6 @@ subroutine mpas_atm_get_bdy_state_3d(clock, block, innerDim, vertDim, horizDim,
end do
!$acc end parallel

MPAS_ACC_TIMER_START('mpas_atm_get_bdy_state_3d [ACC_data_xfer]')
!$acc exit data delete(tend, state)
MPAS_ACC_TIMER_STOP('mpas_atm_get_bdy_state_3d [ACC_data_xfer]')

end subroutine mpas_atm_get_bdy_state_3d


Expand Down
Loading