Changeset 4464
 Timestamp:
 Mar 17, 2020 11:08:46 AM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/flow_statistics.f90
r4463 r4464 25 25 !  26 26 ! $Id$ 27 ! Calculate horizontally averaged profiles of all velocity components at the 27 ! Reset last change (r4463) 28 ! 29 ! 4463 20200317 09:27:36Z Giersch 30 ! Calculate horizontally averaged profiles of all velocity components at the 28 31 ! same place 29 ! 32 ! 30 33 ! 4444 20200305 15:59:50Z raasch 31 34 ! bugfix: cppdirectives for serial mode added … … 268 271 ENDIF 269 272 ! 270 ! Horizontally averaged profiles of all velocities and temperature.273 ! Horizontally averaged profiles of horizontal velocities and temperature. 271 274 ! They must have been computed before, because they are already required 272 275 ! for other horizontal averages. … … 288 291 * flag 289 292 !$ACC ATOMIC 290 sums_l(k,3,tn) = sums_l(k,3,tn) + w(k,j,i) * rmask(j,i,sr) &291 * flag292 !$ACC ATOMIC293 293 sums_l(k,4,tn) = sums_l(k,4,tn) + pt(k,j,i) * rmask(j,i,sr) & 294 294 * flag … … 296 296 ENDDO 297 297 ENDDO 298 !$ACC UPDATE HOST(sums_l(:,1,tn), sums_l(:,2,tn), sums_l(:, 3,tn), sums_l(:,4,tn))298 !$ACC UPDATE HOST(sums_l(:,1,tn), sums_l(:,2,tn), sums_l(:,4,tn)) 299 299 300 300 ! … … 372 372 sums_l(:,1,0) = sums_l(:,1,0) + sums_l(:,1,i) 373 373 sums_l(:,2,0) = sums_l(:,2,0) + sums_l(:,2,i) 374 sums_l(:,3,0) = sums_l(:,3,0) + sums_l(:,3,i)375 374 sums_l(:,4,0) = sums_l(:,4,0) + sums_l(:,4,i) 376 375 IF ( ocean_mode ) THEN … … 399 398 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 400 399 CALL MPI_ALLREDUCE( sums_l(nzb,2,0), sums(nzb,2), nzt+2nzb, MPI_REAL, & 401 MPI_SUM, comm2d, ierr )402 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr )403 CALL MPI_ALLREDUCE( sums_l(nzb,3,0), sums(nzb,3), nzt+2nzb, MPI_REAL, &404 400 MPI_SUM, comm2d, ierr ) 405 401 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) … … 436 432 sums(:,1) = sums_l(:,1,0) 437 433 sums(:,2) = sums_l(:,2,0) 438 sums(:,3) = sums_l(:,3,0)439 434 sums(:,4) = sums_l(:,4,0) 440 435 IF ( ocean_mode ) sums(:,23) = sums_l(:,23,0) … … 455 450 sums(:,1) = sums(:,1) / ngp_2dh(sr) 456 451 sums(:,2) = sums(:,2) / ngp_2dh(sr) 457 sums(:,3) = sums(:,3) / ngp_2dh(sr)458 452 sums(:,4) = sums(:,4) / ngp_2dh_s_inner(:,sr) 459 453 hom(:,1,1,sr) = sums(:,1) ! u 460 454 hom(:,1,2,sr) = sums(:,2) ! v 461 hom(:,1,3,sr) = sums(:,3) ! w462 455 hom(:,1,4,sr) = sums(:,4) ! pt 463 !$ACC UPDATE DEVICE(hom(:,1,1,sr), hom(:,1,2,sr), hom(:,1,3,sr), hom(:,1,4,sr)) 464 456 !$ACC UPDATE DEVICE(hom(:,1,1,sr), hom(:,1,2,sr), hom(:,1,4,sr)) 457 458 465 459 ! 466 460 ! Salinity … … 519 513 ! 520 514 ! Prognostic and diagnostic variables 515 !$ACC ATOMIC 516 sums_l(k,3,tn) = sums_l(k,3,tn) + w(k,j,i) * rmask(j,i,sr) & 517 * flag 521 518 !$ACC ATOMIC 522 519 sums_l(k,8,tn) = sums_l(k,8,tn) + e(k,j,i) * rmask(j,i,sr) & … … 1710 1707 IF ( threads_per_task > 1 ) THEN 1711 1708 DO i = 1, threads_per_task1 1709 sums_l(:,3,0) = sums_l(:,3,0) + sums_l(:,3,i) 1712 1710 sums_l(:,4:40,0) = sums_l(:,4:40,0) + sums_l(:,4:40,i) 1713 1711 sums_l(:,45:pr_palm,0) = sums_l(:,45:pr_palm,0) + & … … 1783 1781 ! Profiles: 1784 1782 DO k = nzb, nzt+1 1783 sums(k,3) = sums(k,3) / ngp_2dh(sr) 1785 1784 sums(k,12:22) = sums(k,12:22) / ngp_2dh(sr) 1786 1785 sums(k,30:32) = sums(k,30:32) / ngp_2dh(sr) … … 1857 1856 ! Collect horizontal average in hom. 1858 1857 ! Compute deduced averages (e.g. total heat flux) 1858 hom(:,1,3,sr) = sums(:,3) ! w 1859 1859 hom(:,1,8,sr) = sums(:,8) ! e profiles 57 are initial profiles 1860 1860 hom(:,1,9,sr) = sums(:,9) ! km
Note: See TracChangeset
for help on using the changeset viewer.