Changeset 4590
- Timestamp:
- Jul 6, 2020 2:34:59 PM (4 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/biometeorology_mod.f90
r4577 r4590 21 21 ! Current revisions: 22 22 ! ------------------ 23 ! 24 ! 23 ! 24 ! 25 25 ! Former revisions: 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Enable restart via mpi-IO. Therefore, allocated array mrt_av_grid as 3D array instead of an 29 ! 1D array. 30 ! 31 ! 4577 2020-06-25 09:53:58Z raasch 28 32 ! further re-formatting concerning Fortran parameter variables 29 33 ! … … 183 187 184 188 USE restart_data_mpi_io_mod, & 185 ONLY: rrd_mpi_io, wrd_mpi_io 189 ONLY: rrd_mpi_io, & 190 rd_mpi_io_check_array, & 191 wrd_mpi_io 186 192 187 193 … … 217 223 REAL(wp) :: bio_output_height !< height output is calculated in m 218 224 219 REAL(wp), DIMENSION(:), ALLOCATABLE :: mrt_av_grid !< time average mean220 221 225 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: perct !< PT results (degree_C) 222 226 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: pet !< PET results (degree_C) … … 229 233 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tmrt_av_grid !< tmrt results (degree_C) 230 234 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: utci_av !< UTCI results (aver. input) (degree_C) 235 236 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: mrt_av_grid !< time average mean radiant temperature 231 237 232 238 ! … … 410 416 CHARACTER (LEN=*) :: variable !< The variable in question 411 417 412 INTEGER(iwp) :: i !< Running index, x-dir 413 INTEGER(iwp) :: j !< Running index, y-dir 414 INTEGER(iwp) :: k !< Running index, z-dir 418 INTEGER(iwp) :: i !< Running index, x-direction 419 INTEGER(iwp) :: j !< Running index, y-direction 420 INTEGER(iwp) :: k !< Running index, z-direction 421 INTEGER(iwp) :: l !< index used to link radiation arrays to 3d grid arrays 415 422 416 423 … … 422 429 423 430 IF ( .NOT. ALLOCATED( mrt_av_grid ) ) THEN 424 ALLOCATE( mrt_av_grid(n mrtbl) )431 ALLOCATE( mrt_av_grid(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 425 432 ENDIF 426 433 mrt_av_grid = 0.0_wp … … 486 493 487 494 IF ( mrt_include_sw ) THEN 488 mrt_av_grid(:) = mrt_av_grid(:) + & 489 ( ( human_absorb * mrtinsw(:) + & 490 mrtinlw(:) ) / ( human_emiss * sigma_sb ) )**.25_wp - degc_to_k 495 DO l = 1, nmrtbl 496 i = mrtbl(ix,l) 497 j = mrtbl(iy,l) 498 k = mrtbl(iz,l) 499 mrt_av_grid(k,j,i) = mrt_av_grid(k,j,i) + & 500 ( ( human_absorb * mrtinsw(l) + & 501 mrtinlw(l) ) / ( human_emiss * sigma_sb ) )**0.25_wp - degc_to_k 502 ENDDO 491 503 ELSE 492 mrt_av_grid(:) = mrt_av_grid(:) + & 493 ( mrtinlw(:) / ( human_emiss * sigma_sb ) )**.25_wp - degc_to_k 504 DO l = 1, nmrtbl 505 i = mrtbl(ix,l) 506 j = mrtbl(iy,l) 507 k = mrtbl(iz,l) 508 mrt_av_grid(k,j,i) = mrt_av_grid(k,j,i) + & 509 ( mrtinlw(l) / ( human_emiss * sigma_sb ) )**0.25_wp - degc_to_k 510 ENDDO 494 511 ENDIF 495 512 ENDIF … … 584 601 585 602 IF ( .NOT. ALLOCATED( mrt_av_grid ) ) THEN 586 ALLOCATE( mrt_av_grid(n mrtbl) )603 ALLOCATE( mrt_av_grid(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 587 604 do_average_mrt = .TRUE. 588 605 mrt_av_grid = 0.0_wp … … 591 608 592 609 IF ( mrt_include_sw ) THEN 593 mrt_av_grid(:) = mrt_av_grid(:) + & 594 ( ( human_absorb * mrtinsw(:) + & 595 mrtinlw(:) ) / & 610 DO l = 1, nmrtbl 611 i = mrtbl(ix,l) 612 j = mrtbl(iy,l) 613 k = mrtbl(iz,l) 614 mrt_av_grid(k,j,i) = mrt_av_grid(k,j,i) + & 615 ( ( human_absorb * mrtinsw(l) + & 616 mrtinlw(l) ) / & 596 617 ( human_emiss * sigma_sb ) )**0.25_wp - degc_to_k 597 ELSE 598 mrt_av_grid(:) = mrt_av_grid(:) + & 599 ( mrtinlw(:) / & 618 ENDDO 619 ELSE 620 DO l = 1, nmrtbl 621 i = mrtbl(ix,l) 622 j = mrtbl(iy,l) 623 k = mrtbl(iz,l) 624 mrt_av_grid(k,j,i) = mrt_av_grid(k,j,i) + & 625 ( mrtinlw(l) / & 600 626 ( human_emiss * sigma_sb ) )**0.25_wp - degc_to_k 627 ENDDO 601 628 ENDIF 602 629 ENDIF … … 626 653 !-- do_average_mrt will be .TRUE. leading to a double-averaging. 627 654 IF ( .NOT. do_average_mrt .AND. ALLOCATED( mrt_av_grid ) ) THEN 628 mrt_av_grid(:) = mrt_av_grid(:) / REAL( average_count_3d, KIND=wp ) 655 DO i = nxl, nxr 656 DO j = nys, nyn 657 DO k = nzb, nzt+1 658 mrt_av_grid(k,j,i) = mrt_av_grid(k,j,i) / REAL( average_count_3d, KIND=wp ) 659 ENDDO 660 ENDDO 661 ENDDO 629 662 ENDIF 630 663 … … 692 725 693 726 IF ( ALLOCATED( mrt_av_grid ) .AND. do_average_mrt ) THEN 694 mrt_av_grid(:) = mrt_av_grid(:) / REAL( average_count_3d, KIND = wp ) 727 DO i = nxl, nxr 728 DO j = nys, nyn 729 DO k = nzb, nzt+1 730 mrt_av_grid(k,j,i) = mrt_av_grid(k,j,i) / REAL( average_count_3d, KIND=wp ) 731 ENDDO 732 ENDDO 733 ENDDO 695 734 ENDIF 696 735 … … 942 981 ENDIF 943 982 ELSE 944 local_pf(i,j,k) = mrt_av_grid( l)983 local_pf(i,j,k) = mrt_av_grid(k,j,i) 945 984 ENDIF 946 985 ENDDO … … 1115 1154 ENDIF 1116 1155 ELSE 1117 local_pf(i,j,k) = REAL( mrt_av_grid( l), KIND = sp )1156 local_pf(i,j,k) = REAL( mrt_av_grid(k,j,i), KIND = sp ) 1118 1157 ENDIF 1119 1158 ENDDO … … 1435 1474 SELECT CASE ( restart_string(1:length) ) 1436 1475 1437 CASE ( 'nmrtbl' )1438 READ ( 13 ) bio_nmrtbl1439 1440 1476 CASE ( 'mrt_av_grid' ) 1441 1477 IF ( .NOT. ALLOCATED( mrt_av_grid ) ) THEN 1442 ALLOCATE( mrt_av_grid(bio_nmrtbl) ) 1478 ALLOCATE( mrt_av_grid(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1479 mrt_av_grid = 0.0_wp 1443 1480 ENDIF 1444 1481 READ ( 13 ) mrt_av_grid 1445 1446 1482 1447 1483 CASE DEFAULT … … 1462 1498 SUBROUTINE bio_rrd_local_mpi 1463 1499 1464 STOP '+++ reading restart data with MPI-IO not implemented for bio_rrd_local_mpi' 1500 USE control_parameters 1501 1502 USE indices 1503 1504 USE kinds 1505 1506 1507 IMPLICIT NONE 1508 1509 LOGICAL :: array_found !< 1510 1511 CALL rd_mpi_io_check_array( 'mrt_av_grid' , found = array_found ) 1512 IF ( array_found ) THEN 1513 IF ( .NOT. ALLOCATED( mrt_av_grid ) ) ALLOCATE( mrt_av_grid(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1514 CALL rrd_mpi_io( 'mrt_av_grid', mrt_av_grid ) 1515 ENDIF 1465 1516 1466 1517 END SUBROUTINE bio_rrd_local_mpi … … 1473 1524 !--------------------------------------------------------------------------------------------------! 1474 1525 SUBROUTINE bio_wrd_global 1475 1476 IMPLICIT NONE1477 1526 1478 1527 IF ( TRIM( restart_data_format_output ) == 'fortran_binary' ) THEN … … 1524 1573 SUBROUTINE bio_wrd_local 1525 1574 1526 IMPLICIT NONE1527 1528 1529 1575 IF ( TRIM( restart_data_format_output ) == 'fortran_binary' ) THEN 1530 1531 !1532 !-- First nmrtbl has to be written/read, because it is the dimension of mrt_av_grid1533 CALL wrd_write_string( 'nmrtbl' )1534 WRITE ( 14 ) nmrtbl1535 1576 1536 1577 IF ( ALLOCATED( mrt_av_grid ) ) THEN … … 1541 1582 ELSEIF ( TRIM( restart_data_format_output(1:3) ) == 'mpi' ) THEN 1542 1583 1543 ! 1544 !-- TODO: the mrt_av_grid is a 1-d array and its size depends on subdomain features. This does 1545 !-- not work with the MPI-IO concept (nor with the restart I/O concept in general. 1546 !-- I am not sure, if this data needs to be written to the restart file at all (Siggi, 13.4.20) 1547 ! CALL wrd_mpi_io( 'nmrtbl', nmrtbl ) 1548 ! CALL wrd_mpi_io_..... 'mrt_av_grid' 1549 WRITE (6,*) '+++ biometeorology module does not work with MPI-IO for restart_data' 1550 STOP 1584 IF ( ALLOCATED( mrt_av_grid ) ) CALL wrd_mpi_io( 'mrt_av_grid', mrt_av_grid ) 1551 1585 1552 1586 ENDIF … … 1576 1610 IF ( av ) THEN 1577 1611 ! 1578 !-- Make sure tmrt_av_grid is present and initialize with the fill value1612 !-- Make sure tmrt_av_grid is present and initialize with the fill value 1579 1613 IF ( .NOT. ALLOCATED( tmrt_av_grid ) ) THEN 1580 ALLOCATE( tmrt_av_grid 1614 ALLOCATE( tmrt_av_grid(nys:nyn,nxl:nxr) ) 1581 1615 ENDIF 1582 1616 tmrt_av_grid = REAL( bio_fill_value, KIND = wp ) 1583 1617 1584 1618 ! 1585 !-- mrt_av_grid should always be allcoated here, but better make sure ist actually is.1619 !-- mrt_av_grid should always be allcoated here, but better make sure ist actually is. 1586 1620 IF ( ALLOCATED( mrt_av_grid ) ) THEN 1587 1621 ! … … 1596 1630 ! 1597 1631 !-- Averaging was done before, so we can just copy the result here. 1598 tmrt_av_grid(j,i) = mrt_av_grid( l)1632 tmrt_av_grid(j,i) = mrt_av_grid(k,j,i) 1599 1633 1600 1634 ENDIF -
palm/trunk/SOURCE/module_interface.f90
r4525 r4590 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Enable mpi-io for biomet 28 ! 29 ! 4525 2020-05-10 17:05:07Z raasch 27 30 ! added restart I/O for global salsa data, 28 31 ! added restart with MPI-IO for salsa … … 2003 2006 CALL dynamics_rrd_local 2004 2007 2005 !IF ( biometeorology ) CALL bio_rrd_local2008 IF ( biometeorology ) CALL bio_rrd_local 2006 2009 IF ( bulk_cloud_model ) CALL bcm_rrd_local 2007 2010 IF ( air_chemistry ) CALL chem_rrd_local -
palm/trunk/SOURCE/read_restart_data_mod.f90
r4580 r4590 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Bugfix in allocation of hom and hom_sum in case of mpi-io restart when 28 ! chemistry or salsa are employed 29 ! 30 ! 4580 2020-06-29 07:54:21Z raasch 27 31 ! data handling with MPI-IO for cyclic-fill added (so far only for global data) 28 32 ! … … 880 884 v_init(0:nz+1), pt_init(0:nz+1), q_init(0:nz+1), & 881 885 ref_state(0:nz+1), s_init(0:nz+1), sa_init(0:nz+1), & 882 hom(0:nz+1,2,pr_palm+max_pr_user ,0:statistic_regions),&883 hom_sum(0:nz+1,pr_palm+max_pr_user ,0:statistic_regions) )886 hom(0:nz+1,2,pr_palm+max_pr_user+max_pr_cs+max_pr_salsa,0:statistic_regions), & 887 hom_sum(0:nz+1,pr_palm+max_pr_user+max_pr_cs+max_pr_salsa,0:statistic_regions) ) 884 888 ENDIF 885 889
Note: See TracChangeset
for help on using the changeset viewer.