Ignore:
Timestamp:
Jan 17, 2017 4:38:49 PM (4 years ago)
Author:
raasch
Message:

all OpenACC directives and related parts removed from the code

File:
1 edited

Legend:

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

    r2101 r2118  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! OpenACC directives and related part of code removed
    2323!
    2424! Former revisions:
     
    182182          u_gtrans_l = 0.0_wp
    183183          v_gtrans_l = 0.0_wp
    184           !$acc parallel present( u, v )
    185184          DO  i = nxl, nxr
    186185             DO  j = nys, nyn
     
    191190             ENDDO
    192191          ENDDO
    193           !$acc end parallel
    194192          uv_gtrans_l(1) = u_gtrans_l / REAL( (nxr-nxl+1)*(nyn-nys+1)*(nzt-nzb), KIND=wp )
    195193          uv_gtrans_l(2) = v_gtrans_l / REAL( (nxr-nxl+1)*(nyn-nys+1)*(nzt-nzb), KIND=wp )
     
    210208!-- Determine the maxima of the velocity components, including their
    211209!-- grid index positions.
    212 #if defined( __openacc )
    213     IF ( dt_fixed )  THEN  ! otherwise do it further below for better cache usage
    214        u_max_l = -999999.9_wp
    215        u_min_l =  999999.9_wp
    216        v_max_l = -999999.9_wp
    217        v_min_l =  999999.9_wp
    218        w_max_l = -999999.9_wp
    219        w_min_l =  999999.9_wp
    220        !$acc parallel present( u, v, w )
    221        DO  i = nxl, nxr
    222           DO  j = nys, nyn
    223              DO  k = nzb+1, nzt
    224                 u_max_l = MAX( u_max_l, u(k,j,i) )
    225                 u_min_l = MIN( u_min_l, u(k,j,i) )
    226                 v_max_l = MAX( v_max_l, v(k,j,i) )
    227                 v_min_l = MIN( v_min_l, v(k,j,i) )
    228                 w_max_l = MAX( w_max_l, w(k,j,i) )
    229                 w_min_l = MIN( w_min_l, w(k,j,i) )
    230              ENDDO
    231           ENDDO
    232        ENDDO
    233        !$acc end parallel
    234 #if defined( __parallel )
    235        reduce_l(1) = u_max_l
    236        reduce_l(2) = v_max_l
    237        reduce_l(3) = w_max_l
    238        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
    239        CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MAX, comm2d, ierr )
    240        u_max = reduce(1)
    241        v_max = reduce(2)
    242        w_max = reduce(3)
    243        reduce_l(1) = u_min_l
    244        reduce_l(2) = v_min_l
    245        reduce_l(3) = w_min_l
    246        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
    247        CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
    248        IF ( ABS( reduce(1) ) > u_max )  u_max = reduce(1)
    249        IF ( ABS( reduce(2) ) > v_max )  v_max = reduce(2)
    250        IF ( ABS( reduce(3) ) > w_max )  w_max = reduce(3)
    251 #else
    252        IF ( ABS( u_min_l ) > u_max_l )  THEN
    253           u_max = u_min_l
    254        ELSE
    255           u_max = u_max_l
    256        ENDIF
    257        IF ( ABS( v_min_l ) > v_max_l )  THEN
    258           v_max = v_min_l
    259        ELSE
    260           v_max = v_max_l
    261        ENDIF
    262        IF ( ABS( w_min_l ) > w_max_l )  THEN
    263           w_max = w_min_l
    264        ELSE
    265           w_max = w_max_l
    266        ENDIF
    267 #endif
    268     ENDIF
    269 #else
    270210    CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, u, 'abs', 0.0_wp, &
    271211                         u_max, u_max_ijk )
     
    274214    CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, w, 'abs', 0.0_wp, &
    275215                         w_max, w_max_ijk )
    276 #endif
    277216
    278217    IF ( .NOT. dt_fixed )  THEN
    279 #if defined( __openacc )
    280 !
    281 !--    Variable time step:
    282 !--    Calculate the maximum time step according to the CFL-criterion,
    283 !--    individually for each velocity component
    284        dt_u_l  =  999999.9_wp
    285        dt_v_l  =  999999.9_wp
    286        dt_w_l  =  999999.9_wp
    287        u_max_l = -999999.9_wp
    288        u_min_l =  999999.9_wp
    289        v_max_l = -999999.9_wp
    290        v_min_l =  999999.9_wp
    291        w_max_l = -999999.9_wp
    292        w_min_l =  999999.9_wp
    293        !$acc parallel loop collapse(3) present( u, v, w )
    294        DO  i = nxl, nxr
    295           DO  j = nys, nyn
    296              DO  k = nzb+1, nzt
    297                 dt_u_l  = MIN( dt_u_l, ( dx     / ( ABS( u(k,j,i) - u_gtrans ) + 1.0E-10_wp ) ) )
    298                 dt_v_l  = MIN( dt_v_l, ( dy     / ( ABS( v(k,j,i) - v_gtrans ) + 1.0E-10_wp ) ) )
    299                 dt_w_l  = MIN( dt_w_l, ( dzu(k) / ( ABS( w(k,j,i) )            + 1.0E-10_wp ) ) )
    300                 u_max_l = MAX( u_max_l, u(k,j,i) )
    301                 u_min_l = MIN( u_min_l, u(k,j,i) )
    302                 v_max_l = MAX( v_max_l, v(k,j,i) )
    303                 v_min_l = MIN( v_min_l, v(k,j,i) )
    304                 w_max_l = MAX( w_max_l, w(k,j,i) )
    305                 w_min_l = MIN( w_min_l, w(k,j,i) )
    306              ENDDO
    307           ENDDO
    308        ENDDO
    309        !$acc end parallel
    310 
    311 #if defined( __parallel )
    312        reduce_l(1) = dt_u_l
    313        reduce_l(2) = dt_v_l
    314        reduce_l(3) = dt_w_l
    315        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
    316        CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
    317        dt_u = reduce(1)
    318        dt_v = reduce(2)
    319        dt_w = reduce(3)
    320 
    321        reduce_l(1) = u_max_l
    322        reduce_l(2) = v_max_l
    323        reduce_l(3) = w_max_l
    324        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
    325        CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MAX, comm2d, ierr )
    326        u_max = reduce(1)
    327        v_max = reduce(2)
    328        w_max = reduce(3)
    329        reduce_l(1) = u_min_l
    330        reduce_l(2) = v_min_l
    331        reduce_l(3) = w_min_l
    332        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
    333        CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
    334        IF ( ABS( reduce(1) ) > u_max )  u_max = reduce(1)
    335        IF ( ABS( reduce(2) ) > v_max )  v_max = reduce(2)
    336        IF ( ABS( reduce(3) ) > w_max )  w_max = reduce(3)
    337 #else
    338        dt_u = dt_u_l
    339        dt_v = dt_v_l
    340        dt_w = dt_w_l
    341 
    342        IF ( ABS( u_min_l ) > u_max_l )  THEN
    343           u_max = u_min_l
    344        ELSE
    345           u_max = u_max_l
    346        ENDIF
    347        IF ( ABS( v_min_l ) > v_max_l )  THEN
    348           v_max = v_min_l
    349        ELSE
    350           v_max = v_max_l
    351        ENDIF
    352        IF ( ABS( w_min_l ) > w_max_l )  THEN
    353           w_max = w_min_l
    354        ELSE
    355           w_max = w_max_l
    356        ENDIF
    357 #endif
    358 
    359 #else
    360218!
    361219!--    Variable time step:
     
    390248#endif
    391249
    392 #endif
    393 
    394250!
    395251!--    Compute time step according to the diffusion criterion.
     
    404260       ENDDO
    405261
    406 !$OMP PARALLEL private(i,j,k,value) reduction(MIN: dt_diff_l)
    407 !$OMP DO
    408        !$acc parallel loop collapse(3) present( kh, km )
     262       !$OMP PARALLEL private(i,j,k,value) reduction(MIN: dt_diff_l)
     263       !$OMP DO
    409264       DO  i = nxl, nxr
    410265          DO  j = nys, nyn
     
    415270          ENDDO
    416271       ENDDO
    417        !$acc end parallel
    418 !$OMP END PARALLEL
     272       !$OMP END PARALLEL
    419273#if defined( __parallel )
    420274       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
Note: See TracChangeset for help on using the changeset viewer.