Skip to content

Commit

Permalink
Merge pull request #237 from skosukhin/fix-acc-minmaxloc-wa
Browse files Browse the repository at this point in the history
Fix minmaxloc workaround. 
1. Cray compiler supports minloc and maxloc for OpenACC and OpenMP starting version 15.
2. Nvidia compiler supports minloc and maxloc for OpenACC but not for OpenMP
  • Loading branch information
RobertPincus authored Nov 20, 2023
2 parents 634bee9 + 7ced954 commit 24e7538
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rrtmgp-kernels/accel/mo_gas_optics_rrtmgp_kernels.F90
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ subroutine compute_tau_absorption( &
!$omp target teams distribute parallel do simd
do icol = 1,ncol
itropo_lower(icol,2) = nlay
#if ( defined(_CRAYFTN) && defined(_OPENMP) ) || defined(__NVCOMPILER)
#if ( defined(_CRAYFTN) && _RELEASE_MAJOR <= 14 ) || ( defined(_OPENMP) && defined(__NVCOMPILER) )
itropo_upper(icol,1) = 1
call minmaxloc(icol, tropo, play, itropo_lower(icol,1), itropo_upper(icol,2))
#else
Expand All @@ -266,7 +266,7 @@ subroutine compute_tau_absorption( &
!$omp target teams distribute parallel do simd
do icol = 1,ncol
itropo_lower(icol,1) = 1
#if ( defined(_CRAYFTN) && defined(_OPENMP) ) || defined(__NVCOMPILER)
#if ( defined(_CRAYFTN) && _RELEASE_MAJOR <= 14 ) || ( defined(_OPENMP) && defined(__NVCOMPILER) )
itropo_upper(icol,2) = nlay
call minmaxloc(icol, tropo, play, itropo_lower(icol,2), itropo_upper(icol,1))
#else
Expand Down

0 comments on commit 24e7538

Please sign in to comment.