Skip to content

Commit

Permalink
Openacc tweaks and cleanup 2 (#1099)
Browse files Browse the repository at this point in the history
* Making all end parallel directives specify end loop

* Replacing last acc declare in a procedure with acc enter/exit data commands

* Removing pure declarations, turns out they dont really improve performance and openmp isn't allowed within them.

* Adding explicit directives to penta_lu and tridiag_lu, as opposed to the previously used kernels directive. Also splitting up a loop to improve GPU performance.

* Splitting up a couple loops for performance reasons.

* Missed one somehow
  • Loading branch information
huebleruwm authored Jul 19, 2023
1 parent 29ad556 commit 1f4d045
Show file tree
Hide file tree
Showing 22 changed files with 245 additions and 186 deletions.
2 changes: 1 addition & 1 deletion src/CLUBB_core/adg1_adg2_3d_luhar_pdf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ subroutine backsolve_Luhar_params( Sk_max, Skx, & ! In
end subroutine backsolve_Luhar_params

!=============================================================================
pure function max_cubic_root( a_coef, b_coef, c_coef, d_coef ) &
function max_cubic_root( a_coef, b_coef, c_coef, d_coef ) &
result( max_root )

! Description:
Expand Down
4 changes: 2 additions & 2 deletions src/CLUBB_core/advance_clubb_core_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5157,7 +5157,7 @@ subroutine calc_trapezoid_zm( nz, ngrdcol, gr, variable_zm, variable_zt, &
* ( gr%zm(i,k) - gr%zt(i,k) ) * gr%invrs_dzm(i,k)
end do
end do
!$acc end parallel
!$acc end parallel loop

return
end subroutine calc_trapezoid_zm
Expand Down Expand Up @@ -5514,7 +5514,7 @@ subroutine set_Lscale_max( ngrdcol, l_implemented, host_dx, host_dy, &
end subroutine set_Lscale_max

!===============================================================================
pure subroutine calculate_thlp2_rad &
subroutine calculate_thlp2_rad &
( nz, rcm_zm, thlprcp, radht_zm, & ! Intent(in)
clubb_params, & ! Intent(in)
thlp2_forcing ) ! Intent(inout)
Expand Down
2 changes: 1 addition & 1 deletion src/CLUBB_core/advance_helper_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,7 @@ function vertical_avg( total_idx, rho_ds, field, dz )
end function vertical_avg

!=============================================================================
pure function vertical_integral( total_idx, rho_ds, &
function vertical_integral( total_idx, rho_ds, &
field, dz )

! Description:
Expand Down
Loading

0 comments on commit 1f4d045

Please sign in to comment.