Changeset 4893 for palm/trunk/SOURCE/urban_surface_mod.f90
- Timestamp:
- Mar 2, 2021 4:39:14 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/urban_surface_mod.f90
r4872 r4893 27 27 ! ----------------- 28 28 ! $Id$ 29 ! revised output of surface data via MPI-IO for better performance 30 ! 31 ! 4872 2021-02-12 15:49:02Z raasch 29 32 ! internal switch removed from namelist 30 33 ! … … 6608 6611 SUBROUTINE usm_rrd_local_mpi 6609 6612 6610 6611 6613 CHARACTER(LEN=1) :: dum !< dummy string to create input-variable name 6612 6614 6613 6615 INTEGER(iwp) :: l !< loop index for surface types 6614 6616 6615 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: global_start 6616 6617 LOGICAL :: ldum !< dummy variable 6617 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: global_end_index 6618 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: global_start_index 6619 6620 LOGICAL :: data_to_read !< dummy variable 6621 6618 6622 6619 6623 DO l = 0, 1 … … 6621 6625 WRITE( dum, '(I1)' ) l 6622 6626 6623 CALL rrd_mpi_io( 'usm_start_index_h_' //dum, surf_usm_h(l)%start_index ) 6624 CALL rrd_mpi_io( 'usm_end_index_h_' //dum, surf_usm_h(l)%end_index ) 6625 CALL rrd_mpi_io( 'usm_global_start_h_' //dum, global_start ) 6626 6627 CALL rd_mpi_io_surface_filetypes( surf_usm_h(l)%start_index, surf_usm_h(l)%end_index, ldum, & 6628 global_start ) 6629 6630 IF ( MAXVAL( surf_usm_h(l)%end_index ) <= 0 ) CYCLE 6631 6632 IF ( .NOT. ALLOCATED( t_surf_wall_h_1(l)%val ) ) & 6627 CALL rrd_mpi_io( 'usm_global_start_h_' //dum, global_start_index ) 6628 CALL rrd_mpi_io( 'usm_global_end_h_' //dum, global_end_index ) 6629 6630 CALL rd_mpi_io_surface_filetypes( surf_usm_h(l)%start_index, surf_usm_h(l)%end_index, & 6631 data_to_read, global_start_index, global_end_index ) 6632 IF ( .NOT. data_to_read ) CYCLE 6633 6634 IF ( .NOT. ALLOCATED( t_surf_wall_h_1(l)%val ) ) & 6633 6635 ALLOCATE( t_surf_wall_h_1(l)%val(1:surf_usm_h(l)%ns) ) 6634 6636 CALL rrd_mpi_io_surface( 't_surf_wall_h(' // dum // ')', t_surf_wall_h_1(l)%val ) 6635 6637 6636 IF ( .NOT. ALLOCATED( t_surf_window_h_1(l)%val ) )&6638 IF ( .NOT. ALLOCATED( t_surf_window_h_1(l)%val ) ) & 6637 6639 ALLOCATE( t_surf_window_h_1(l)%val(1:surf_usm_h(l)%ns) ) 6638 6640 CALL rrd_mpi_io_surface( 't_surf_window_h(' // dum // ')', t_surf_window_h_1(l)%val ) 6639 6641 6640 IF ( .NOT. ALLOCATED( t_surf_green_h_1(l)%val ) )&6642 IF ( .NOT. ALLOCATED( t_surf_green_h_1(l)%val ) ) & 6641 6643 ALLOCATE( t_surf_green_h_1(l)%val(1:surf_usm_h(l)%ns) ) 6642 6644 CALL rrd_mpi_io_surface( 't_surf_green_h(' // dum // ')', t_surf_green_h_1(l)%val ) 6643 6645 6644 IF ( .NOT. ALLOCATED( m_liq_usm_h_1(l)%val ) )&6646 IF ( .NOT. ALLOCATED( m_liq_usm_h_1(l)%val ) ) & 6645 6647 ALLOCATE( m_liq_usm_h_1(l)%val(1:surf_usm_h(l)%ns) ) 6646 6648 CALL rrd_mpi_io_surface( 'm_liq_usm_h(' // dum // ')', m_liq_usm_h_1(l)%val ) 6647 6649 6648 6650 IF ( indoor_model ) THEN 6649 IF ( .NOT. ALLOCATED( surf_usm_h(l)%waste_heat ) )&6651 IF ( .NOT. ALLOCATED( surf_usm_h(l)%waste_heat ) ) & 6650 6652 ALLOCATE( surf_usm_h(l)%waste_heat(1:surf_usm_h(l)%ns) ) 6651 6653 CALL rrd_mpi_io_surface( 'waste_heat_h(' // dum // ')', surf_usm_h(l)%waste_heat ) 6652 IF ( .NOT. ALLOCATED( surf_usm_h(l)%t_prev ) )&6654 IF ( .NOT. ALLOCATED( surf_usm_h(l)%t_prev ) ) & 6653 6655 ALLOCATE( surf_usm_h(l)%t_prev(1:surf_usm_h(l)%ns) ) 6654 6656 CALL rrd_mpi_io_surface( 't_prev_h(' // dum // ')', surf_usm_h(l)%t_prev ) … … 6660 6662 WRITE( dum, '(I1)' ) l 6661 6663 6662 CALL rrd_mpi_io( 'usm_start_index_v_' //dum, surf_usm_v(l)%start_index ) 6663 CALL rrd_mpi_io( 'usm_end_index_v_' // dum, surf_usm_v(l)%end_index ) 6664 CALL rrd_mpi_io( 'usm_global_start_v_' // dum, global_start ) 6665 6666 CALL rd_mpi_io_surface_filetypes( surf_usm_v(l)%start_index, surf_usm_v(l)%end_index, ldum, & 6667 global_start ) 6668 6669 IF ( MAXVAL( surf_usm_v(l)%end_index ) <= 0 ) CYCLE 6670 6671 IF ( .NOT. ALLOCATED( t_surf_wall_v_1(l)%val ) ) & 6664 CALL rrd_mpi_io( 'usm_global_start_v_' // dum, global_start_index ) 6665 CALL rrd_mpi_io( 'usm_global_end_v_' // dum, global_end_index ) 6666 6667 CALL rd_mpi_io_surface_filetypes( surf_usm_v(l)%start_index, surf_usm_v(l)%end_index, & 6668 data_to_read, global_start_index, global_end_index ) 6669 IF ( .NOT. data_to_read ) CYCLE 6670 6671 IF ( .NOT. ALLOCATED( t_surf_wall_v_1(l)%val ) ) & 6672 6672 ALLOCATE( t_surf_wall_v_1(l)%val(1:surf_usm_v(l)%ns) ) 6673 6673 CALL rrd_mpi_io_surface( 't_surf_wall_v(' // dum // ')', t_surf_wall_v_1(l)%val ) 6674 6674 6675 IF ( .NOT. ALLOCATED( t_surf_window_v_1(l)%val ) )&6675 IF ( .NOT. ALLOCATED( t_surf_window_v_1(l)%val ) ) & 6676 6676 ALLOCATE( t_surf_window_v_1(l)%val(1:surf_usm_v(l)%ns) ) 6677 6677 CALL rrd_mpi_io_surface( 't_surf_window_v(' // dum // ')', t_surf_window_v_1(l)%val ) 6678 6678 6679 IF ( .NOT. ALLOCATED( t_surf_green_v_1(l)%val ) )&6679 IF ( .NOT. ALLOCATED( t_surf_green_v_1(l)%val ) ) & 6680 6680 ALLOCATE( t_surf_green_v_1(l)%val(1:surf_usm_v(l)%ns) ) 6681 6681 CALL rrd_mpi_io_surface( 't_surf_green_v(' // dum // ')', t_surf_green_v_1(l)%val) 6682 6682 6683 6683 IF ( indoor_model ) THEN 6684 IF ( .NOT. ALLOCATED( surf_usm_v(l)%waste_heat ) )&6684 IF ( .NOT. ALLOCATED( surf_usm_v(l)%waste_heat ) ) & 6685 6685 ALLOCATE( surf_usm_v(l)%waste_heat(1:surf_usm_v(l)%ns) ) 6686 6686 CALL rrd_mpi_io_surface( 'waste_heat_v(' // dum // ')', surf_usm_v(l)%waste_heat ) 6687 IF ( .NOT. ALLOCATED( surf_usm_v(l)%t_prev ) )&6687 IF ( .NOT. ALLOCATED( surf_usm_v(l)%t_prev ) ) & 6688 6688 ALLOCATE( surf_usm_v(l)%t_prev(1:surf_usm_v(l)%ns) ) 6689 6689 CALL rrd_mpi_io_surface( 't_prev_v(' // dum // ')', surf_usm_v(l)%t_prev ) … … 6696 6696 WRITE( dum, '(I1)' ) l 6697 6697 6698 CALL rrd_mpi_io( 'usm_start_index_h_2_' //dum, surf_usm_h(l)%start_index ) 6699 CALL rrd_mpi_io( 'usm_end_index_h_2_' //dum, surf_usm_h(l)%end_index ) 6700 CALL rrd_mpi_io( 'usm_global_start_h_2_' //dum, global_start ) 6701 6702 CALL rd_mpi_io_surface_filetypes( surf_usm_h(l)%start_index, surf_usm_h(l)%end_index, ldum, & 6703 global_start ) 6704 6705 IF ( MAXVAL( surf_usm_h(l)%end_index ) <= 0 ) CYCLE 6706 6707 IF ( .NOT. ALLOCATED( t_wall_h_1(l)%val ) ) & 6698 CALL rrd_mpi_io( 'usm_global_start_h_2_' //dum, global_start_index ) 6699 CALL rrd_mpi_io( 'usm_global_end_h_2_' //dum, global_end_index ) 6700 6701 CALL rd_mpi_io_surface_filetypes( surf_usm_h(l)%start_index, surf_usm_h(l)%end_index, & 6702 data_to_read, global_start_index, global_end_index ) 6703 IF ( .NOT. data_to_read ) CYCLE 6704 6705 IF ( .NOT. ALLOCATED( t_wall_h_1(l)%val ) ) & 6708 6706 ALLOCATE( t_wall_h_1(l)%val(nzb_wall:nzt_wall+1,1:surf_usm_h(l)%ns) ) 6709 6707 CALL rrd_mpi_io_surface( 't_wall_h(' // dum // ')', t_wall_h_1(l)%val ) 6710 6708 6711 IF ( .NOT. ALLOCATED( t_window_h_1(l)%val ) )&6709 IF ( .NOT. ALLOCATED( t_window_h_1(l)%val ) ) & 6712 6710 ALLOCATE( t_window_h_1(l)%val(nzb_wall:nzt_wall+1,1:surf_usm_h(l)%ns) ) 6713 6711 CALL rrd_mpi_io_surface( 't_window_h(' // dum // ')', t_window_h_1(l)%val ) 6714 6712 6715 IF ( .NOT. ALLOCATED( t_green_h_1(l)%val ) )&6713 IF ( .NOT. ALLOCATED( t_green_h_1(l)%val ) ) & 6716 6714 ALLOCATE( t_green_h_1(l)%val(nzb_wall:nzt_wall+1,1:surf_usm_h(l)%ns) ) 6717 6715 CALL rrd_mpi_io_surface( 't_green_h(' // dum // ')', t_green_h_1(l)%val ) … … 6723 6721 WRITE( dum, '(I1)' ) l 6724 6722 6725 CALL rrd_mpi_io( 'usm_start_index_v_2_' //dum, surf_usm_v(l)%start_index ) 6726 CALL rrd_mpi_io( 'usm_end_index_v_2_' // dum, surf_usm_v(l)%end_index ) 6727 CALL rrd_mpi_io( 'usm_global_start_v_2_' // dum, global_start ) 6728 6729 CALL rd_mpi_io_surface_filetypes( surf_usm_v(l)%start_index, surf_usm_v(l)%end_index, ldum, & 6730 global_start ) 6731 6732 IF ( MAXVAL( surf_usm_v(l)%end_index ) <= 0 ) CYCLE 6733 6734 IF ( .NOT. ALLOCATED( t_wall_v_1(l)%val ) ) & 6723 CALL rrd_mpi_io( 'usm_global_start_v_2_' // dum, global_start_index ) 6724 CALL rrd_mpi_io( 'usm_global_end_v_2_' // dum, global_end_index ) 6725 6726 CALL rd_mpi_io_surface_filetypes( surf_usm_v(l)%start_index, surf_usm_v(l)%end_index, & 6727 data_to_read, global_start_index, global_end_index ) 6728 IF ( .NOT. data_to_read ) CYCLE 6729 6730 IF ( .NOT. ALLOCATED( t_wall_v_1(l)%val ) ) & 6735 6731 ALLOCATE ( t_wall_v_1(l)%val(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) 6736 6732 CALL rrd_mpi_io_surface( 't_wall_v(' // dum // ')', t_wall_v_1(l)%val ) 6737 6733 6738 IF ( .NOT. ALLOCATED( t_window_v_1(l)%val ) ) 6734 IF ( .NOT. ALLOCATED( t_window_v_1(l)%val ) ) & 6739 6735 ALLOCATE ( t_window_v_1(l)%val(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) 6740 6736 CALL rrd_mpi_io_surface( 't_window_v(' // dum // ')', t_window_v_1(l)%val ) 6741 6737 6742 IF ( .NOT. ALLOCATED( t_green_v_1(l)%val ) ) 6738 IF ( .NOT. ALLOCATED( t_green_v_1(l)%val ) ) & 6743 6739 ALLOCATE ( t_green_v_1(l)%val(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) 6744 6740 CALL rrd_mpi_io_surface( 't_green_v(' // dum // ')', t_green_v_1(l)%val ) … … 6747 6743 6748 6744 END SUBROUTINE usm_rrd_local_mpi 6745 6749 6746 6750 6747 !--------------------------------------------------------------------------------------------------! … … 7422 7419 INTEGER(iwp) :: l !< index surface type orientation 7423 7420 7424 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: global_start_index !< index for surface data (MPI-IO) 7421 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: global_end_index !< end index for surface data (MPI-IO) 7422 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: global_start_index !< start index for surface data (MPI-IO) 7425 7423 7426 7424 LOGICAL :: surface_data_to_write !< switch for MPI-I/O if PE has surface data to write … … 7548 7546 WRITE( dum, '(I1)') l 7549 7547 7550 CALL rd_mpi_io_surface_filetypes( surf_usm_h(l)%start_index, surf_usm_h(l)%end_index, & 7551 surface_data_to_write, global_start_index ) 7552 7553 CALL wrd_mpi_io( 'usm_start_index_h_' // dum, surf_usm_h(l)%start_index ) 7554 CALL wrd_mpi_io( 'usm_end_index_h_' // dum, surf_usm_h(l)%end_index ) 7548 CALL rd_mpi_io_surface_filetypes( surf_usm_h(l)%start_index, surf_usm_h(l)%end_index, & 7549 surface_data_to_write, global_start_index, & 7550 global_end_index ) 7551 7555 7552 CALL wrd_mpi_io( 'usm_global_start_h_' // dum, global_start_index ) 7553 CALL wrd_mpi_io( 'usm_global_end_h_' // dum, global_end_index ) 7556 7554 7557 7555 IF ( .NOT. surface_data_to_write ) CYCLE … … 7574 7572 7575 7573 CALL rd_mpi_io_surface_filetypes( surf_usm_v(l)%start_index, surf_usm_v(l)%end_index, & 7576 surface_data_to_write, global_start_index ) 7577 7578 CALL wrd_mpi_io( 'usm_start_index_v_' // dum, surf_usm_v(l)%start_index ) 7579 CALL wrd_mpi_io( 'usm_end_index_v_' // dum, surf_usm_v(l)%end_index ) 7574 surface_data_to_write, global_start_index, & 7575 global_end_index ) 7576 7580 7577 CALL wrd_mpi_io( 'usm_global_start_v_' // dum, global_start_index ) 7578 CALL wrd_mpi_io( 'usm_global_end_v_' // dum, global_end_index ) 7581 7579 7582 7580 IF ( .NOT. surface_data_to_write ) CYCLE … … 7596 7594 WRITE( dum, '(I1)') l 7597 7595 7598 CALL rd_mpi_io_surface_filetypes( surf_usm_h(l)%start_index, surf_usm_h(l)%end_index, & 7599 surface_data_to_write, global_start_index ) 7600 7601 CALL wrd_mpi_io( 'usm_start_index_h_2_' // dum, surf_usm_h(l)%start_index ) 7602 CALL wrd_mpi_io( 'usm_end_index_h_2_' // dum, surf_usm_h(l)%end_index ) 7596 CALL rd_mpi_io_surface_filetypes( surf_usm_h(l)%start_index, surf_usm_h(l)%end_index, & 7597 surface_data_to_write, global_start_index, & 7598 global_end_index ) 7599 7603 7600 CALL wrd_mpi_io( 'usm_global_start_h_2_' // dum, global_start_index ) 7601 CALL wrd_mpi_io( 'usm_global_end_h_2_' // dum, global_end_index ) 7604 7602 7605 7603 IF ( .NOT. surface_data_to_write ) CYCLE … … 7616 7614 7617 7615 CALL rd_mpi_io_surface_filetypes( surf_usm_v(l)%start_index, surf_usm_v(l)%end_index, & 7618 surface_data_to_write, global_start_index ) 7619 7620 CALL wrd_mpi_io( 'usm_start_index_v_2_' //dum, surf_usm_v(l)%start_index ) 7621 CALL wrd_mpi_io( 'usm_end_index_v_2_' // dum, surf_usm_v(l)%end_index ) 7616 surface_data_to_write, global_start_index, & 7617 global_end_index ) 7618 7622 7619 CALL wrd_mpi_io( 'usm_global_start_v_2_' // dum, global_start_index ) 7620 CALL wrd_mpi_io( 'usm_global_end_v_2_' // dum, global_end_index ) 7623 7621 7624 7622 IF ( .NOT. surface_data_to_write ) CYCLE
Note: See TracChangeset
for help on using the changeset viewer.