Changeset 1171 for palm/trunk/SOURCE


Ignore:
Timestamp:
May 30, 2013 11:27:45 AM (12 years ago)
Author:
raasch
Message:

New:
---

use_reference-case activated in accelerator version. (buoyancy, diffusion_e)
new option -e which defines the execution command to be used to run PALM,
compiler options for pgi/openacc added (palm_simple_run)
parameter sets for openACC benchmarks added (trunk/EXAMPLES/benchmark_acc)

Changed:


split of prognostic_equations deactivated (time_integration)

Errors:


bugfix: diss array is allocated with full size if accelerator boards are used (init_3d_model)

Location:
palm/trunk/SOURCE
Files:
4 edited

Legend:

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

    r1154 r1171  
    2020! Currrent revisions:
    2121! -----------------
    22 !
     22! openacc statements added to use_reference-case in accelerator version
    2323!
    2424! Former revisions:
     
    225225!--       Normal case: horizontal surface
    226226          IF ( use_reference )  THEN
     227             !$acc kernels present( nzb_s_inner, hom, tend, var )
     228             !$acc loop
    227229             DO  i = i_left, i_right
    228230                DO  j = j_south, j_north
     231                   !$acc loop independent vector(32)
    229232                   DO  k = nzb_s_inner(j,i)+1, nzt-1
    230233                      tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * &
     
    236239                ENDDO
    237240             ENDDO
     241             !$acc end kernels
    238242          ELSE
    239243             !$acc kernels present( nzb_s_inner, hom, tend, var )
  • palm/trunk/SOURCE/diffusion_e.f90

    r1132 r1171  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! use_reference-case activated in accelerator version
    2323!
    2424! Former revisions:
     
    317317!--    runtime errors occur with -C hopt on NEC
    318318       IF ( use_reference )  THEN
    319           STOP '+++ use_reference not implemented in diffusion_e_acc'
    320 !          DO  i = nxl, nxr
    321 !             DO  j = nys, nyn
    322 !                DO  k = nzb_s_inner(j,i)+1, nzt
    323 !
    324 !--                Calculate the mixing length (for dissipation)
    325 !                   dvar_dz = atmos_ocean_sign * &
    326 !                             ( var(k+1,j,i) - var(k-1,j,i) ) * dd2zu(k)
    327 !                   IF ( dvar_dz > 0.0 ) THEN
    328 !                      l_stable = 0.76 * SQRT( e(k,j,i) ) / &
    329 !                                 SQRT( g / var_reference * dvar_dz ) + 1E-5
    330 !                   ELSE
    331 !                      l_stable = l_grid(k)
    332 !                   ENDIF
    333 !
    334 !--                Adjustment of the mixing length
    335 !                   IF ( wall_adjustment )  THEN
    336 !                      l(k,j)  = MIN( wall_adjustment_factor *          &
    337 !                                     ( zu(k) - zw(nzb_s_inner(j,i)) ), &
    338 !                                     l_grid(k), l_stable )
    339 !                      ll(k,j) = MIN( wall_adjustment_factor *          &
    340 !                                     ( zu(k) - zw(nzb_s_inner(j,i)) ), &
    341 !                                     l_grid(k) )
    342 !                   ELSE
    343 !                      l(k,j)  = MIN( l_grid(k), l_stable )
    344 !                      ll(k,j) = l_grid(k)
    345 !                   ENDIF
    346 !
    347 !                ENDDO
    348 !             ENDDO
    349 !
    350 !
    351 !--          Calculate the tendency terms
    352 !             DO  j = nys, nyn
    353 !                DO  k = nzb_s_inner(j,i)+1, nzt
    354 !
    355 !                    dissipation(k,j) = ( 0.19 + 0.74 * l(k,j) / ll(k,j) ) * &
    356 !                                       e(k,j,i) * SQRT( e(k,j,i) ) / l(k,j)
    357 !
    358 !                    tend(k,j,i) = tend(k,j,i)                                  &
    359 !                                        + (                                    &
    360 !                          ( km(k,j,i)+km(k,j,i+1) ) * ( e(k,j,i+1)-e(k,j,i) )  &
    361 !                        - ( km(k,j,i)+km(k,j,i-1) ) * ( e(k,j,i)-e(k,j,i-1) )  &
    362 !                                          ) * ddx2                             &
    363 !                                        + (                                    &
    364 !                          ( km(k,j,i)+km(k,j+1,i) ) * ( e(k,j+1,i)-e(k,j,i) )  &
    365 !                        - ( km(k,j,i)+km(k,j-1,i) ) * ( e(k,j,i)-e(k,j-1,i) )  &
    366 !                                          ) * ddy2                             &
    367 !                                        + (                                    &
    368 !               ( km(k,j,i)+km(k+1,j,i) ) * ( e(k+1,j,i)-e(k,j,i) ) * ddzu(k+1) &
    369 !             - ( km(k,j,i)+km(k-1,j,i) ) * ( e(k,j,i)-e(k-1,j,i) ) * ddzu(k)   &
    370 !                                          ) * ddzw(k)                          &
    371 !                             - dissipation(k,j)
    372 !
    373 !                ENDDO
    374 !             ENDDO
    375 !
    376 !
    377 !--          Store dissipation if needed for calculating the sgs particle
    378 !--          velocities
    379 !             IF ( use_sgs_for_particles  .OR.  wang_kernel )  THEN
    380 !                DO  j = nys, nyn
    381 !                   DO  k = nzb_s_inner(j,i)+1, nzt
    382 !                      diss(k,j,i) = dissipation(k,j)
    383 !                   ENDDO
    384 !                ENDDO
    385 !             ENDIF
    386 !
    387 !          ENDDO
    388 !
     319
     320          !$acc kernels present( ddzu, ddzw, dd2zu, diss, e, km, l_grid ) &
     321          !$acc         present( nzb_s_inner, rif, tend, var, zu, zw )
     322          !$acc loop
     323          DO  i = i_left, i_right
     324             DO  j = j_south, j_north
     325                !$acc loop vector( 32 )
     326                DO  k = 1, nzt
     327
     328                   IF ( k > nzb_s_inner(j,i) )  THEN
     329!
     330!--                   Calculate the mixing length (for dissipation)
     331                      dvar_dz = atmos_ocean_sign * &
     332                                ( var(k+1,j,i) - var(k-1,j,i) ) * dd2zu(k)
     333                      IF ( dvar_dz > 0.0 ) THEN
     334                         l_stable = 0.76 * SQRT( e(k,j,i) ) / &
     335                                    SQRT( g / var_reference * dvar_dz ) + 1E-5
     336                      ELSE
     337                         l_stable = l_grid(k)
     338                      ENDIF
     339!
     340!--                   Adjustment of the mixing length
     341                      IF ( wall_adjustment )  THEN
     342                         l  = MIN( wall_adjustment_factor *          &
     343                                   ( zu(k) - zw(nzb_s_inner(j,i)) ), &
     344                                   l_grid(k), l_stable )
     345                         ll = MIN( wall_adjustment_factor *          &
     346                                   ( zu(k) - zw(nzb_s_inner(j,i)) ), &
     347                                   l_grid(k) )
     348                      ELSE
     349                         l  = MIN( l_grid(k), l_stable )
     350                         ll = l_grid(k)
     351                      ENDIF
     352!
     353!--                   Calculate the tendency terms
     354                      dissipation = ( 0.19 + 0.74 * l / ll ) * &
     355                                    e(k,j,i) * SQRT( e(k,j,i) ) / l
     356
     357                      tend(k,j,i) = tend(k,j,i)                                  &
     358                                        + (                                    &
     359                          ( km(k,j,i)+km(k,j,i+1) ) * ( e(k,j,i+1)-e(k,j,i) )  &
     360                        - ( km(k,j,i)+km(k,j,i-1) ) * ( e(k,j,i)-e(k,j,i-1) )  &
     361                                          ) * ddx2                             &
     362                                        + (                                    &
     363                          ( km(k,j,i)+km(k,j+1,i) ) * ( e(k,j+1,i)-e(k,j,i) )  &
     364                        - ( km(k,j,i)+km(k,j-1,i) ) * ( e(k,j,i)-e(k,j-1,i) )  &
     365                                          ) * ddy2                             &
     366                                        + (                                    &
     367               ( km(k,j,i)+km(k+1,j,i) ) * ( e(k+1,j,i)-e(k,j,i) ) * ddzu(k+1) &
     368             - ( km(k,j,i)+km(k-1,j,i) ) * ( e(k,j,i)-e(k-1,j,i) ) * ddzu(k)   &
     369                                          ) * ddzw(k)                          &
     370                                  - dissipation
     371
     372!
     373!--                   Store dissipation if needed for calculating the sgs particle
     374!--                   velocities
     375                      IF ( use_sgs_for_particles  .OR.  wang_kernel  .OR.      &
     376                           turbulence )  THEN
     377                         diss(k,j,i) = dissipation
     378                      ENDIF
     379
     380                   ENDIF
     381
     382                ENDDO
     383             ENDDO
     384          ENDDO
     385          !$acc end kernels
     386
    389387       ELSE
    390388
     
    439437             - ( km(k,j,i)+km(k-1,j,i) ) * ( e(k,j,i)-e(k-1,j,i) ) * ddzu(k)   &
    440438                                          ) * ddzw(k)                          &
    441                              - dissipation
     439                                  - dissipation
    442440
    443441!
  • palm/trunk/SOURCE/init_3d_model.f90

    r1160 r1171  
    2323! Current revisions:
    2424! ------------------
    25 !
     25! diss array is allocated with full size if accelerator boards are used
    2626!
    2727! Former revisions:
     
    3434! 1153 2013-05-10 14:33:08Z raasch
    3535! diss array is allocated with dummy elements even if it is not needed
    36 ! (required by PGI 12.3 / CUDA 5.0)
     36! (required by PGI 13.4 / CUDA 5.0)
    3737!
    3838! 1115 2013-03-26 18:16:16Z hoffmann
     
    507507!-- 3D-array for storing the dissipation, needed for calculating the sgs
    508508!-- particle velocities
    509     IF ( use_sgs_for_particles  .OR.  wang_kernel  .OR.  turbulence )  THEN
     509    IF ( use_sgs_for_particles  .OR.  wang_kernel  .OR.  turbulence  .OR.  &
     510         num_acc_per_node > 0 )  THEN
     511       print*, '*** allocating diss'
    510512       ALLOCATE( diss(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
    511     ELSE
    512        ALLOCATE( diss(2,2,2) )
    513513    ENDIF
    514514
  • palm/trunk/SOURCE/time_integration.f90

    r1132 r1171  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! split of prognostic_equations deactivated (comment lines)
    2323!
    2424! Former revisions:
     
    245245             CALL prognostic_equations_vector
    246246          ELSEIF ( loop_optimization == 'acc' )  THEN
    247 !             i_left  = nxl;         i_right = nxr
     247             i_left  = nxl;         i_right = nxr
     248             j_south = nys;         j_north = nyn
     249             CALL prognostic_equations_acc
     250
     251!             i_left  = nxl;         i_right = nxl+nbgp-1
    248252!             j_south = nys;         j_north = nyn
    249253!             CALL prognostic_equations_acc
    250 
    251              i_left  = nxl;         i_right = nxl+nbgp-1
    252              j_south = nys;         j_north = nyn
    253              CALL prognostic_equations_acc
    254              i_left  = nxr-nbgp+1;  i_right = nxr
    255              j_south = nys;         j_north = nyn
    256              CALL prognostic_equations_acc
     254!             i_left  = nxr-nbgp+1;  i_right = nxr
     255!             j_south = nys;         j_north = nyn
     256!             CALL prognostic_equations_acc
    257257
    258258!
     
    310310             ENDIF
    311311
    312              i_left  = nxl+nbgp;    i_right = nxr-nbgp
    313              j_south = nys;         j_north = nys+nbgp-1
    314              CALL prognostic_equations_acc
    315              i_left  = nxl+nbgp;    i_right = nxr-nbgp
    316              j_south = nyn-nbgp+1;  j_north = nyn
    317              CALL prognostic_equations_acc
     312!             i_left  = nxl+nbgp;    i_right = nxr-nbgp
     313!             j_south = nys;         j_north = nys+nbgp-1
     314!             CALL prognostic_equations_acc
     315!             i_left  = nxl+nbgp;    i_right = nxr-nbgp
     316!             j_south = nyn-nbgp+1;  j_north = nyn
     317!             CALL prognostic_equations_acc
    318318
    319319             IF ( background_communication )  THEN
     
    374374             ENDIF
    375375
    376              i_left  = nxl+nbgp;    i_right = nxr-nbgp
    377              j_south = nys+nbgp;    j_north = nyn-nbgp
    378              CALL prognostic_equations_acc
     376!             i_left  = nxl+nbgp;    i_right = nxr-nbgp
     377!             j_south = nys+nbgp;    j_north = nyn-nbgp
     378!             CALL prognostic_equations_acc
    379379
    380380             IF ( background_communication )  THEN
Note: See TracChangeset for help on using the changeset viewer.