- Timestamp:
- Mar 17, 2020 9:27:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/flow_statistics.f90
r4444 r4463 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Calculate horizontally averaged profiles of all velocity components at the 28 ! same place 29 ! 30 ! 4444 2020-03-05 15:59:50Z raasch 27 31 ! bugfix: cpp-directives for serial mode added 28 32 ! … … 264 268 ENDIF 265 269 ! 266 !-- Horizontally averaged profiles of horizontal velocities and temperature.270 !-- Horizontally averaged profiles of all velocities and temperature. 267 271 !-- They must have been computed before, because they are already required 268 272 !-- for other horizontal averages. … … 284 288 * flag 285 289 !$ACC ATOMIC 290 sums_l(k,3,tn) = sums_l(k,3,tn) + w(k,j,i) * rmask(j,i,sr) & 291 * flag 292 !$ACC ATOMIC 286 293 sums_l(k,4,tn) = sums_l(k,4,tn) + pt(k,j,i) * rmask(j,i,sr) & 287 294 * flag … … 289 296 ENDDO 290 297 ENDDO 291 !$ACC UPDATE HOST(sums_l(:,1,tn), sums_l(:,2,tn), sums_l(:, 4,tn))298 !$ACC UPDATE HOST(sums_l(:,1,tn), sums_l(:,2,tn), sums_l(:,3,tn), sums_l(:,4,tn)) 292 299 293 300 ! … … 365 372 sums_l(:,1,0) = sums_l(:,1,0) + sums_l(:,1,i) 366 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) 367 375 sums_l(:,4,0) = sums_l(:,4,0) + sums_l(:,4,i) 368 376 IF ( ocean_mode ) THEN … … 391 399 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 392 400 CALL MPI_ALLREDUCE( sums_l(nzb,2,0), sums(nzb,2), nzt+2-nzb, 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+2-nzb, MPI_REAL, & 393 404 MPI_SUM, comm2d, ierr ) 394 405 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) … … 425 436 sums(:,1) = sums_l(:,1,0) 426 437 sums(:,2) = sums_l(:,2,0) 438 sums(:,3) = sums_l(:,3,0) 427 439 sums(:,4) = sums_l(:,4,0) 428 440 IF ( ocean_mode ) sums(:,23) = sums_l(:,23,0) … … 443 455 sums(:,1) = sums(:,1) / ngp_2dh(sr) 444 456 sums(:,2) = sums(:,2) / ngp_2dh(sr) 457 sums(:,3) = sums(:,3) / ngp_2dh(sr) 445 458 sums(:,4) = sums(:,4) / ngp_2dh_s_inner(:,sr) 446 459 hom(:,1,1,sr) = sums(:,1) ! u 447 460 hom(:,1,2,sr) = sums(:,2) ! v 461 hom(:,1,3,sr) = sums(:,3) ! w 448 462 hom(:,1,4,sr) = sums(:,4) ! pt 449 !$ACC UPDATE DEVICE(hom(:,1,1,sr), hom(:,1,2,sr), hom(:,1,4,sr)) 450 451 463 !$ACC UPDATE DEVICE(hom(:,1,1,sr), hom(:,1,2,sr), hom(:,1,3,sr), hom(:,1,4,sr)) 464 452 465 ! 453 466 !-- Salinity … … 506 519 ! 507 520 !-- Prognostic and diagnostic variables 508 !$ACC ATOMIC509 sums_l(k,3,tn) = sums_l(k,3,tn) + w(k,j,i) * rmask(j,i,sr) &510 * flag511 521 !$ACC ATOMIC 512 522 sums_l(k,8,tn) = sums_l(k,8,tn) + e(k,j,i) * rmask(j,i,sr) & … … 1700 1710 IF ( threads_per_task > 1 ) THEN 1701 1711 DO i = 1, threads_per_task-1 1702 sums_l(:,3,0) = sums_l(:,3,0) + sums_l(:,3,i)1703 1712 sums_l(:,4:40,0) = sums_l(:,4:40,0) + sums_l(:,4:40,i) 1704 1713 sums_l(:,45:pr_palm,0) = sums_l(:,45:pr_palm,0) + & … … 1774 1783 !-- Profiles: 1775 1784 DO k = nzb, nzt+1 1776 sums(k,3) = sums(k,3) / ngp_2dh(sr)1777 1785 sums(k,12:22) = sums(k,12:22) / ngp_2dh(sr) 1778 1786 sums(k,30:32) = sums(k,30:32) / ngp_2dh(sr) … … 1849 1857 !-- Collect horizontal average in hom. 1850 1858 !-- Compute deduced averages (e.g. total heat flux) 1851 hom(:,1,3,sr) = sums(:,3) ! w1852 1859 hom(:,1,8,sr) = sums(:,8) ! e profiles 5-7 are initial profiles 1853 1860 hom(:,1,9,sr) = sums(:,9) ! km
Note: See TracChangeset
for help on using the changeset viewer.