Ignore:
Timestamp:
Feb 8, 2016 12:25:53 PM (6 years ago)
Author:
raasch
Message:

openacc adjustments and bugfixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/surface_layer_fluxes.f90

    r1710 r1747  
    1818!--------------------------------------------------------------------------------!
    1919! Current revisions:
    20 ! -----------------
    21 !
     20! ------------------
     21! adjustments for OpenACC usage
    2222!
    2323! Former revisions:
     
    168168    PRIVATE
    169169
    170     PUBLIC init_surface_layer_fluxes, surface_layer_fluxes
     170    PUBLIC init_surface_layer_fluxes, pt1, qv1, surface_layer_fluxes, uv_total
    171171
    172172    INTERFACE init_surface_layer_fluxes
     
    406406
    407407
    408        !$OMP PARALLEL DO PRIVATE( k, z_mo )
    409        !$acc kernels loop
     408       !$OMP PARALLEL DO PRIVATE( k )
     409       !$acc kernels loop present( nzb_s_inner, u, uv_total, v ) private( j, k )
    410410       DO  i = nxl, nxr
    411411          DO  j = nys, nyn
     
    455455                       ol_u      !< Upper bound of L for Newton iteration
    456456
    457 
    458457       IF ( TRIM( most_method ) /= 'circular' )  THEN
    459458     
     459          !$acc data present( nzb_s_inner, pt, q, qsws, rib, shf, uv_total, vpt, zu, zw )
     460
    460461          !$OMP PARALLEL DO PRIVATE( k, z_mo )
    461           !$acc kernels loop
     462          !$acc kernels loop private( j, k, z_mo )
    462463          DO  i = nxl, nxr
    463464             DO  j = nys, nyn
     
    498499             ENDDO
    499500          ENDDO
     501          !$acc end data
    500502
    501503       ENDIF
     
    507509
    508510          !$OMP PARALLEL DO PRIVATE( k, z_mo )
    509           !$acc kernels loop
     511          !# WARNING: does not work on GPU so far
     512          !!!!!!$acc kernels loop
    510513          DO  i = nxl, nxr
    511514             DO  j = nys, nyn
     
    626629
    627630          !$OMP PARALLEL DO PRIVATE( k, z_mo )
    628           !$acc kernels loop
     631          !# WARNING: does not work on GPU so far
     632          !!!!!!$acc kernels loop
    629633          DO  i = nxl, nxr
    630634             DO  j = nys, nyn
     
    668672
    669673          !$OMP PARALLEL DO PRIVATE( k, z_mo )
    670           !$acc kernels loop
     674          !$acc kernels loop present( nzb_s_inner, ol, pt, pt1, q, ql, qs, qv1, ts, us, vpt, zu, zw ) private( j, k, z_mo )
    671675          DO  i = nxl, nxr
    672676             DO  j = nys, nyn
     
    719723
    720724       !$OMP PARALLEL DO PRIVATE( k, z_mo )
    721        !$acc kernels loop
     725       ! ### WARNING: does not work on GPU because of function calls
     726       !!!!!$acc kernels loop
     727       !$acc update host( ol, uv_total )
    722728       DO  i = nxlg, nxrg
    723729          DO  j = nysg, nyng
     
    733739          ENDDO
    734740       ENDDO
     741       !$acc update device( us )
    735742
    736743    END SUBROUTINE calc_us
     
    742749       IMPLICIT NONE
    743750
     751       !$acc kernels loop present( nzb_s_inner, pt, pt1, pt_d_t, q, ql, qv1 ) private( j, k )
    744752       DO  i = nxlg, nxrg
    745753          DO  j = nysg, nyng
     
    770778!--       For a given heat flux in the surface layer:
    771779          !$OMP PARALLEL DO
    772           !$acc kernels loop
     780          !$acc kernels loop private( j )
    773781          DO  i = nxlg, nxrg
    774782             DO  j = nysg, nyng
     
    787795          IF ( large_scale_forcing .AND. lsf_surf )  THEN
    788796             !$OMP PARALLEL DO
    789              !$acc kernels loop
     797             !$acc kernels loop private( j, k )
    790798             DO  i = nxlg, nxrg
    791799                DO  j = nysg, nyng
     
    797805
    798806          !$OMP PARALLEL DO PRIVATE( k, z_mo )
    799           !$acc kernels loop
     807          ! ### WARNING: leads to severe compile error
     808          !!!!$acc kernels loop
    800809          DO  i = nxlg, nxrg
    801810             DO  j = nysg, nyng
     
    827836!--          For a given water flux in the Prandtl layer:
    828837             !$OMP PARALLEL DO
    829              !$acc kernels loop
     838             !$acc kernels loop private( j )
    830839             DO  i = nxlg, nxrg
    831840                DO  j = nysg, nyng
     
    840849             IF ( large_scale_forcing .AND. lsf_surf )  THEN
    841850                !$OMP PARALLEL DO
    842                 !$acc kernels loop
     851                !$acc kernels loop private( j, k )
    843852                DO  i = nxlg, nxrg
    844853                   DO  j = nysg, nyng
     
    850859
    851860             !$OMP PARALLEL DO PRIVATE( e_s, k, z_mo )
    852              !$acc kernels loop independent
     861             ! ### WARNING: leads to severe compile error
     862             !!!!$acc kernels loop independent
    853863             DO  i = nxlg, nxrg
    854                 !$acc loop independent
     864                !!!!$acc loop independent
    855865                DO  j = nysg, nyng
    856866
     
    892902
    893903          !$OMP PARALLEL DO PRIVATE( k, z_mo )
    894           !$acc kernels loop independent
     904          ! ### WARNING: leads to severe compile error
     905          !!!!!$acc kernels loop independent
    895906          DO  i = nxlg, nxrg
    896              !$acc loop independent
     907             !!!!$acc loop independent
    897908             DO  j = nysg, nyng
    898909
     
    913924
    914925       ENDIF
     926       !$acc end data
    915927
    916928    END SUBROUTINE calc_scaling_parameters
     
    930942!--    First compute the corresponding component of u* and square it.
    931943       !$OMP PARALLEL DO PRIVATE( k, ol_mid, z_mo )
    932        !$acc kernels loop
     944       ! ### WARNING: leads to severe compile error
     945       !!!!!$acc kernels loop
     946       !$acc update host( ol, u, us, v )
    933947       DO  i = nxl, nxr
    934948          DO  j = nys, nyn
     
    957971!--    First compute the corresponding component of u* and square it.
    958972       !$OMP PARALLEL DO PRIVATE( k, ol_mid, z_mo )
    959        !$acc kernels loop
     973       ! ### WARNING: leads to severe compile error
     974       !!!!!!$acc kernels loop
    960975       DO  i = nxl, nxr
    961976          DO  j = nys, nyn
     
    983998!
    984999!--    Exchange the boundaries for the momentum fluxes (is this still required?)
    985        !$acc update host( usws, vsws )
     1000       !!!!!!!!$acc update host( usws, vsws )
    9861001       CALL exchange_horiz_2d( usws )
    9871002       CALL exchange_horiz_2d( vsws )
     
    9931008            skip_time_do_lsm .OR. .NOT. land_surface ) )  THEN
    9941009          !$OMP PARALLEL DO
    995           !$acc kernels loop independent
     1010          !$acc kernels loop independent present( shf, ts, us )
    9961011          DO  i = nxlg, nxrg
    9971012             !$acc loop independent
     
    10091024            land_surface ) )  THEN
    10101025          !$OMP PARALLEL DO
    1011           !$acc kernels loop independent
     1026          !$acc kernels loop independent present( qs, qsws, us )
    10121027          DO  i = nxlg, nxrg
    10131028             !$acc loop independent
     
    10241039            precipitation )  THEN
    10251040          !$OMP PARALLEL DO
    1026           !$acc kernels loop independent
     1041          !$acc kernels loop independent present( nrs, nrsws, qrs, qrsws, us )
    10271042          DO  i = nxlg, nxrg
    10281043             !$acc loop independent
     
    10381053       IF ( ibc_e_b == 2 )  THEN
    10391054          !$OMP PARALLEL DO
    1040           !$acc kernels loop independent
     1055          !$acc kernels loop independent present( e, nzb_s_inner, us )
    10411056          DO  i = nxlg, nxrg
    10421057             !$acc loop independent
     
    10501065          ENDDO
    10511066       ENDIF
    1052        !$acc end data
    10531067
    10541068    END SUBROUTINE calc_surface_fluxes
Note: See TracChangeset for help on using the changeset viewer.