Changeset 2118 for palm/trunk/SOURCE/time_integration.f90
- Timestamp:
- Jan 17, 2017 4:38:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/time_integration.f90
r2101 r2118 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! OpenACC directives and related code removed 23 23 ! 24 24 ! Former revisions: … … 273 273 microphysics_seifert, mid, nest_domain, & 274 274 neutral, nr_timesteps_this_run, nudging, & 275 ocean, on_device, passive_scalar,&275 ocean, passive_scalar, & 276 276 prho_reference, pt_reference, pt_slope_offset, random_heatflux, & 277 277 run_coupled, simulated_time, simulated_time_chr, & … … 298 298 299 299 USE indices, & 300 ONLY: i_left, i_right, j_north, j_south, nbgp, nx, nxl, nxlg, nxr,&301 n xrg, nyn, nyng, nys, nysg, nzb, nzt, nzb_u_inner, nzb_v_inner300 ONLY: nbgp, nx, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt, & 301 nzb_u_inner, nzb_v_inner 302 302 303 303 USE interaction_droplets_ptq_mod, & … … 338 338 339 339 USE prognostic_equations_mod, & 340 ONLY: prognostic_equations_acc, prognostic_equations_cache, & 341 prognostic_equations_vector 340 ONLY: prognostic_equations_cache, prognostic_equations_vector 342 341 343 342 USE radiation_model_mod, & … … 522 521 ELSEIF ( loop_optimization == 'vector' ) THEN 523 522 CALL prognostic_equations_vector 524 ELSEIF ( loop_optimization == 'acc' ) THEN525 i_left = nxl; i_right = nxr526 j_south = nys; j_north = nyn527 CALL prognostic_equations_acc528 529 ! i_left = nxl; i_right = nxl+nbgp-1530 ! j_south = nys; j_north = nyn531 ! CALL prognostic_equations_acc532 ! i_left = nxr-nbgp+1; i_right = nxr533 ! j_south = nys; j_north = nyn534 ! CALL prognostic_equations_acc535 536 !537 !-- Exchange of ghost points (lateral boundary conditions)538 IF ( background_communication ) THEN539 540 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'start' )541 542 send_receive = 'lr'543 sendrecv_in_background = .TRUE.544 req = 0545 req_count = 0546 547 IF ( numprocs == 1 ) THEN ! workaround for single-core GPU runs548 on_device = .TRUE. ! to be removed after complete porting549 ELSE ! of ghost point exchange550 !$acc update host( e_p, pt_p, u_p, v_p, w_p )551 ENDIF552 553 CALL exchange_horiz( u_p, nbgp )554 CALL exchange_horiz( v_p, nbgp )555 CALL exchange_horiz( w_p, nbgp )556 CALL exchange_horiz( pt_p, nbgp )557 IF ( .NOT. constant_diffusion ) CALL exchange_horiz( e_p, nbgp )558 IF ( ocean ) THEN559 CALL exchange_horiz( sa_p, nbgp )560 CALL exchange_horiz( rho_ocean, nbgp )561 CALL exchange_horiz( prho, nbgp )562 ENDIF563 IF ( humidity ) THEN564 CALL exchange_horiz( q_p, nbgp )565 IF ( cloud_physics .AND. microphysics_seifert ) THEN566 CALL exchange_horiz( qr_p, nbgp )567 CALL exchange_horiz( nr_p, nbgp )568 ENDIF569 ENDIF570 IF ( cloud_droplets ) THEN571 CALL exchange_horiz( ql, nbgp )572 CALL exchange_horiz( ql_c, nbgp )573 CALL exchange_horiz( ql_v, nbgp )574 CALL exchange_horiz( ql_vp, nbgp )575 ENDIF576 IF ( wang_kernel .OR. collision_turbulence .OR. &577 use_sgs_for_particles ) THEN578 CALL exchange_horiz( diss, nbgp )579 ENDIF580 IF ( passive_scalar ) CALL exchange_horiz( s_p, nbgp )581 582 IF ( numprocs == 1 ) THEN ! workaround for single-core GPU runs583 on_device = .FALSE. ! to be removed after complete porting584 ELSE ! of ghost point exchange585 !$acc update device( e_p, pt_p, u_p, v_p, w_p )586 ENDIF587 588 sendrecv_in_background = .FALSE.589 590 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'pause' )591 592 ENDIF593 594 ! i_left = nxl+nbgp; i_right = nxr-nbgp595 ! j_south = nys; j_north = nys+nbgp-1596 ! CALL prognostic_equations_acc597 ! i_left = nxl+nbgp; i_right = nxr-nbgp598 ! j_south = nyn-nbgp+1; j_north = nyn599 ! CALL prognostic_equations_acc600 601 IF ( background_communication ) THEN602 CALL cpu_log( log_point(41), 'exchange-horiz-wait', 'start' )603 #if defined( __parallel )604 CALL MPI_WAITALL( req_count, req, wait_stat, ierr )605 #endif606 CALL cpu_log( log_point(41), 'exchange-horiz-wait', 'pause' )607 608 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'continue' )609 610 send_receive = 'ns'611 sendrecv_in_background = .TRUE.612 req = 0613 req_count = 0614 615 IF ( numprocs == 1 ) THEN ! workaround for single-core GPU runs616 on_device = .TRUE. ! to be removed after complete porting617 ELSE ! of ghost point exchange618 !$acc update host( e_p, pt_p, u_p, v_p, w_p )619 ENDIF620 621 CALL exchange_horiz( u_p, nbgp )622 CALL exchange_horiz( v_p, nbgp )623 CALL exchange_horiz( w_p, nbgp )624 CALL exchange_horiz( pt_p, nbgp )625 IF ( .NOT. constant_diffusion ) CALL exchange_horiz( e_p, nbgp )626 IF ( ocean ) THEN627 CALL exchange_horiz( sa_p, nbgp )628 CALL exchange_horiz( rho_ocean, nbgp )629 CALL exchange_horiz( prho, nbgp )630 ENDIF631 IF ( humidity ) THEN632 CALL exchange_horiz( q_p, nbgp )633 IF ( cloud_physics .AND. microphysics_seifert ) THEN634 CALL exchange_horiz( qr_p, nbgp )635 CALL exchange_horiz( nr_p, nbgp )636 ENDIF637 ENDIF638 IF ( cloud_droplets ) THEN639 CALL exchange_horiz( ql, nbgp )640 CALL exchange_horiz( ql_c, nbgp )641 CALL exchange_horiz( ql_v, nbgp )642 CALL exchange_horiz( ql_vp, nbgp )643 ENDIF644 IF ( wang_kernel .OR. collision_turbulence .OR. &645 use_sgs_for_particles ) THEN646 CALL exchange_horiz( diss, nbgp )647 ENDIF648 IF ( passive_scalar ) CALL exchange_horiz( s_p, nbgp )649 650 IF ( numprocs == 1 ) THEN ! workaround for single-core GPU runs651 on_device = .FALSE. ! to be removed after complete porting652 ELSE ! of ghost point exchange653 !$acc update device( e_p, pt_p, u_p, v_p, w_p )654 ENDIF655 656 sendrecv_in_background = .FALSE.657 658 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'stop' )659 660 ENDIF661 662 ! i_left = nxl+nbgp; i_right = nxr-nbgp663 ! j_south = nys+nbgp; j_north = nyn-nbgp664 ! CALL prognostic_equations_acc665 666 IF ( background_communication ) THEN667 CALL cpu_log( log_point(41), 'exchange-horiz-wait', 'continue' )668 #if defined( __parallel )669 CALL MPI_WAITALL( req_count, req, wait_stat, ierr )670 #endif671 send_receive = 'al'672 CALL cpu_log( log_point(41), 'exchange-horiz-wait', 'stop' )673 ENDIF674 675 523 ENDIF 676 524 … … 699 547 ! 700 548 !-- Exchange of ghost points (lateral boundary conditions) 701 IF ( .NOT. background_communication ) THEN 702 703 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'start' ) 704 705 IF ( numprocs == 1 ) THEN ! workaround for single-core GPU runs 706 on_device = .TRUE. ! to be removed after complete porting 707 ELSE ! of ghost point exchange 708 !$acc update host( e_p, pt_p, u_p, v_p, w_p ) 709 ENDIF 710 711 CALL exchange_horiz( u_p, nbgp ) 712 CALL exchange_horiz( v_p, nbgp ) 713 CALL exchange_horiz( w_p, nbgp ) 714 CALL exchange_horiz( pt_p, nbgp ) 715 IF ( .NOT. constant_diffusion ) CALL exchange_horiz( e_p, nbgp ) 716 IF ( ocean ) THEN 717 CALL exchange_horiz( sa_p, nbgp ) 718 CALL exchange_horiz( rho_ocean, nbgp ) 719 CALL exchange_horiz( prho, nbgp ) 720 ENDIF 721 IF ( humidity ) THEN 722 CALL exchange_horiz( q_p, nbgp ) 723 IF ( cloud_physics .AND. microphysics_seifert ) THEN 724 CALL exchange_horiz( qr_p, nbgp ) 725 CALL exchange_horiz( nr_p, nbgp ) 726 ENDIF 727 ENDIF 728 IF ( cloud_droplets ) THEN 729 CALL exchange_horiz( ql, nbgp ) 730 CALL exchange_horiz( ql_c, nbgp ) 731 CALL exchange_horiz( ql_v, nbgp ) 732 CALL exchange_horiz( ql_vp, nbgp ) 733 ENDIF 734 IF ( wang_kernel .OR. collision_turbulence .OR. & 735 use_sgs_for_particles ) THEN 736 CALL exchange_horiz( diss, nbgp ) 737 ENDIF 738 IF ( passive_scalar ) CALL exchange_horiz( s_p, nbgp ) 739 740 IF ( numprocs == 1 ) THEN ! workaround for single-core GPU runs 741 on_device = .FALSE. ! to be removed after complete porting 742 ELSE ! of ghost point exchange 743 !$acc update device( e_p, pt_p, u_p, v_p, w_p ) 744 ENDIF 745 746 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'stop' ) 747 748 ENDIF 549 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'start' ) 550 551 CALL exchange_horiz( u_p, nbgp ) 552 CALL exchange_horiz( v_p, nbgp ) 553 CALL exchange_horiz( w_p, nbgp ) 554 CALL exchange_horiz( pt_p, nbgp ) 555 IF ( .NOT. constant_diffusion ) CALL exchange_horiz( e_p, nbgp ) 556 IF ( ocean ) THEN 557 CALL exchange_horiz( sa_p, nbgp ) 558 CALL exchange_horiz( rho_ocean, nbgp ) 559 CALL exchange_horiz( prho, nbgp ) 560 ENDIF 561 IF ( humidity ) THEN 562 CALL exchange_horiz( q_p, nbgp ) 563 IF ( cloud_physics .AND. microphysics_seifert ) THEN 564 CALL exchange_horiz( qr_p, nbgp ) 565 CALL exchange_horiz( nr_p, nbgp ) 566 ENDIF 567 ENDIF 568 IF ( cloud_droplets ) THEN 569 CALL exchange_horiz( ql, nbgp ) 570 CALL exchange_horiz( ql_c, nbgp ) 571 CALL exchange_horiz( ql_v, nbgp ) 572 CALL exchange_horiz( ql_vp, nbgp ) 573 ENDIF 574 IF ( wang_kernel .OR. collision_turbulence .OR. & 575 use_sgs_for_particles ) THEN 576 CALL exchange_horiz( diss, nbgp ) 577 ENDIF 578 IF ( passive_scalar ) CALL exchange_horiz( s_p, nbgp ) 579 580 CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'stop' ) 749 581 750 582 ! … … 821 653 time_disturb = time_disturb + dt_3d 822 654 IF ( time_disturb >= dt_disturb ) THEN 823 !$acc update host( u, v )824 IF ( numprocs == 1 ) on_device = .FALSE. ! workaround, remove later825 655 IF ( disturbance_energy_limit /= 0.0_wp .AND. & 826 656 hom(nzb+5,1,pr_palm,0) < disturbance_energy_limit ) THEN … … 836 666 dist_range = 0 837 667 ENDIF 838 IF ( numprocs == 1 ) on_device = .TRUE. ! workaround, remove later839 !$acc update device( u, v )840 668 time_disturb = time_disturb - dt_disturb 841 669 ENDIF … … 854 682 IF ( cloud_physics ) THEN 855 683 CALL calc_liquid_water_content 856 !$acc update device( ql )857 684 ENDIF 858 685 ! … … 860 687 IF ( humidity ) THEN 861 688 CALL compute_vpt 862 !$acc update device( vpt )863 689 ENDIF 864 690
Note: See TracChangeset
for help on using the changeset viewer.