Changeset 2512
- Timestamp:
- Oct 4, 2017 8:26:59 AM (7 years ago)
- Location:
- palm/trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmrun
r2507 r2512 662 662 663 663 664 # CHECK, IF DIRECTORY IS UNDER SVN CONTROL665 if [[ ! -d . svn ]]664 # CHECK, IF TRUNK-DIRECTORY IS UNDER SVN CONTROL 665 if [[ ! -d ../.svn ]] 666 666 then 667 667 printf "\n\n +++ source directory" 668 668 printf "\n \"$source_path\" " 669 669 printf "\n is not under control of \"subversion\"." 670 printf "\n Please do not use palm mrun-option \"-s LM\"\n"670 printf "\n Please do not use palmrun-option \"-s LM\"\n" 671 671 fi 672 672 -
palm/trunk/SOURCE/check_open.f90
r2300 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! upper bounds of cross section and 3d output changed from nx+1,ny+1 to nx,ny 28 ! no output of ghost layer data 29 ! iso2d-related parts removed 30 ! 31 ! 2300 2017-06-29 13:31:14Z raasch 27 32 ! -host 28 33 ! … … 178 183 CHARACTER (LEN=2) :: mask_char !< 179 184 CHARACTER (LEN=2) :: suffix !< 180 CHARACTER (LEN=20) :: xtext = 'time in s' !<181 185 CHARACTER (LEN=30) :: filename !< 182 186 CHARACTER (LEN=80) :: rtext !< 183 CHARACTER (LEN=100) :: batch_scp !<184 187 CHARACTER (LEN=100) :: line !< 185 CHARACTER (LEN=400) :: command !<186 188 187 189 INTEGER(iwp) :: av !< 188 INTEGER(iwp) :: numline = 1 !<189 INTEGER(iwp) :: cranz !<190 190 INTEGER(iwp) :: file_id !< 191 191 INTEGER(iwp) :: i !< 192 INTEGER(iwp) :: iaddres !<193 192 INTEGER(iwp) :: ioerr !< IOSTAT flag for IO-commands ( 0 = no error ) 194 INTEGER(iwp) :: iusern !<195 193 INTEGER(iwp) :: j !< 196 194 INTEGER(iwp) :: k !< 197 INTEGER(iwp) :: legpos = 1 !<198 INTEGER(iwp) :: timodex = 1 !<199 195 200 INTEGER(iwp), DIMENSION(10) :: klist !< 201 202 LOGICAL :: datleg = .TRUE. !< 203 LOGICAL :: get_filenames !< 204 LOGICAL :: grid = .TRUE. !< 205 LOGICAL :: netcdf_extend !< 206 LOGICAL :: rand = .TRUE. !< 207 LOGICAL :: swap = .TRUE. !< 208 LOGICAL :: twoxa = .TRUE. !< 209 LOGICAL :: twoya = .TRUE. !< 210 211 REAL(wp) :: ansx = -999.999_wp !< 212 REAL(wp) :: ansy = -999.999_wp !< 213 REAL(wp) :: gwid = 0.1_wp !< 214 REAL(wp) :: rlegfak = 1.5_wp !< 215 REAL(wp) :: sizex = 250.0_wp !< 216 REAL(wp) :: sizey = 40.0_wp !< 217 REAL(wp) :: texfac = 1.5_wp !< 218 219 REAL(wp), DIMENSION(:), ALLOCATABLE :: eta !< 220 REAL(wp), DIMENSION(:), ALLOCATABLE :: ho !< 221 REAL(wp), DIMENSION(:), ALLOCATABLE :: hu !< 222 223 224 225 NAMELIST /RAHMEN/ numline, cranz, datleg, rtext, swap 226 NAMELIST /CROSS/ ansx, ansy, grid, gwid, klist, legpos, & 227 rand, rlegfak, sizex, sizey, texfac, & 228 timodex, twoxa, twoya, xtext 229 196 LOGICAL :: netcdf_extend !< 230 197 231 198 ! … … 422 389 IF ( myid == 0 .AND. .NOT. openfile(file_id)%opened_before ) THEN 423 390 ! 424 !-- Outputfor combine_plot_fields391 !-- Write index bounds of total domain for combine_plot_fields 425 392 IF ( data_output_2d_on_each_pe .AND. myid_char /= '' ) THEN 426 WRITE (21) -nbgp, nx+nbgp, -nbgp, ny+nbgp ! total array size 427 WRITE (21) 0, nx+1, 0, ny+1 ! output part 428 ENDIF 429 ! 430 !-- Determine and write ISO2D coordiante header 431 ALLOCATE( eta(0:ny+1), ho(0:nx+1), hu(0:nx+1) ) 432 hu = 0.0_wp 433 ho = (ny+1) * dy 434 DO i = 1, ny 435 eta(i) = REAL( i ) / ( ny + 1.0_wp ) 436 ENDDO 437 eta(0) = 0.0_wp 438 eta(ny+1) = 1.0_wp 439 440 WRITE (21) dx,eta,hu,ho 441 DEALLOCATE( eta, ho, hu ) 393 WRITE (21) 0, nx, 0, ny 394 ENDIF 442 395 443 396 ENDIF … … 455 408 IF ( myid == 0 .AND. .NOT. openfile(file_id)%opened_before ) THEN 456 409 ! 457 !-- Outputfor combine_plot_fields410 !-- Write index bounds of total domain for combine_plot_fields 458 411 IF ( data_output_2d_on_each_pe .AND. myid_char /= '' ) THEN 459 WRITE (22) -nbgp, nx+nbgp, 0, nz+1 ! total array size 460 WRITE (22) 0, nx+1, 0, nz+1 ! output part 461 ENDIF 462 ! 463 !-- Determine and write ISO2D coordinate header 464 ALLOCATE( eta(0:nz+1), ho(0:nx+1), hu(0:nx+1) ) 465 hu = 0.0_wp 466 ho = zu(nz+1) 467 DO i = 1, nz 468 eta(i) = REAL( zu(i) ) / zu(nz+1) 469 ENDDO 470 eta(0) = 0.0_wp 471 eta(nz+1) = 1.0_wp 472 473 WRITE (22) dx,eta,hu,ho 474 DEALLOCATE( eta, ho, hu ) 412 WRITE (22) 0, nx, 0, nz+1 ! output part 413 ENDIF 475 414 476 415 ENDIF … … 488 427 IF ( myid == 0 .AND. .NOT. openfile(file_id)%opened_before ) THEN 489 428 ! 490 !-- Outputfor combine_plot_fields429 !-- Write index bounds of total domain for combine_plot_fields 491 430 IF ( data_output_2d_on_each_pe .AND. myid_char /= '' ) THEN 492 WRITE (23) -nbgp, ny+nbgp, 0, nz+1 ! total array size 493 WRITE (23) 0, ny+1, 0, nz+1 ! output part 494 ENDIF 495 ! 496 !-- Determine and write ISO2D coordiante header 497 ALLOCATE( eta(0:nz+1), ho(0:ny+1), hu(0:ny+1) ) 498 hu = 0.0_wp 499 ho = zu(nz+1) 500 DO i = 1, nz 501 eta(i) = REAL( zu(i) ) / zu(nz+1) 502 ENDDO 503 eta(0) = 0.0_wp 504 eta(nz+1) = 1.0_wp 505 506 WRITE (23) dx,eta,hu,ho 507 DEALLOCATE( eta, ho, hu ) 431 WRITE (23) 0, ny, 0, nz+1 ! output part 432 ENDIF 508 433 509 434 ENDIF … … 514 439 FORM='UNFORMATTED' ) 515 440 ! 516 !-- Write coordinate file for AVS441 !-- Specifications for combine_plot_fields 517 442 IF ( myid == 0 ) THEN 518 443 #if defined( __parallel ) 519 ! 520 !-- Specifications for combine_plot_fields 521 WRITE ( 30 ) -nbgp,nx+nbgp,-nbgp,ny+nbgp 522 WRITE ( 30 ) 0,nx+1,0,ny+1,0,nz_do3d 444 WRITE ( 30 ) 0, nx, 0, ny, 0, nz_do3d 523 445 #endif 524 446 ENDIF -
palm/trunk/SOURCE/data_output_2d.f90
r2292 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! upper bounds of cross section output changed from nx+1,ny+1 to nx,ny 28 ! no output of ghost layer data 29 ! 30 ! 2292 2017-06-20 09:51:42Z schwenkel 27 31 ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' 28 32 ! includes two more prognostic equations for cloud drop concentration (nc) … … 165 169 ! Description: 166 170 ! ------------ 167 !> Data output of horizontalcross-sections in netCDF format or binary format168 !> compatible to old graphic software iso2d.171 !> Data output of cross-sections in netCDF format or binary format 172 !> to be later converted to NetCDF by helper routine combine_plot_fields. 169 173 !> Attention: The position of the sectional planes is still not always computed 170 174 !> --------- correctly. (zu is used always)! … … 201 205 202 206 USE indices, & 203 ONLY: nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, & 204 nz, nzb, nzt 207 ONLY: nbgp, nx, nxl, nxr, ny, nyn, nys, nz, nzb, nzt 205 208 206 209 USE kinds … … 271 274 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: local_2d !< 272 275 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: local_2d_l !< 273 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tmp_2d !< temporary field used to exchange surface-related quantities274 276 275 277 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: local_pf !< … … 303 305 CASE ( 'xy' ) 304 306 s_ind = 1 305 ALLOCATE( level_z(nzb:nzt+1), local_2d(nxl g:nxrg,nysg:nyng) )307 ALLOCATE( level_z(nzb:nzt+1), local_2d(nxl:nxr,nys:nyn) ) 306 308 307 309 IF ( netcdf_data_format > 4 ) THEN … … 311 313 ENDDO 312 314 ns = ns - 1 313 ALLOCATE( local_2d_sections(nxl g:nxrg,nysg:nyng,1:ns) )315 ALLOCATE( local_2d_sections(nxl:nxr,nys:nyn,1:ns) ) 314 316 local_2d_sections = 0.0_wp 315 317 ENDIF … … 325 327 IF ( myid == 0 ) THEN 326 328 #if defined( __parallel ) 327 ALLOCATE( total_2d( -nbgp:nx+nbgp,-nbgp:ny+nbgp) )329 ALLOCATE( total_2d(0:nx,0:ny) ) 328 330 #endif 329 331 ENDIF … … 332 334 CASE ( 'xz' ) 333 335 s_ind = 2 334 ALLOCATE( local_2d(nxl g:nxrg,nzb:nzt+1) )336 ALLOCATE( local_2d(nxl:nxr,nzb:nzt+1) ) 335 337 336 338 IF ( netcdf_data_format > 4 ) THEN … … 340 342 ENDDO 341 343 ns = ns - 1 342 ALLOCATE( local_2d_sections(nxl g:nxrg,1:ns,nzb:nzt+1) )343 ALLOCATE( local_2d_sections_l(nxl g:nxrg,1:ns,nzb:nzt+1) )344 ALLOCATE( local_2d_sections(nxl:nxr,1:ns,nzb:nzt+1) ) 345 ALLOCATE( local_2d_sections_l(nxl:nxr,1:ns,nzb:nzt+1) ) 344 346 local_2d_sections = 0.0_wp; local_2d_sections_l = 0.0_wp 345 347 ENDIF … … 356 358 IF ( myid == 0 ) THEN 357 359 #if defined( __parallel ) 358 ALLOCATE( total_2d( -nbgp:nx+nbgp,nzb:nzt+1) )360 ALLOCATE( total_2d(0:nx,nzb:nzt+1) ) 359 361 #endif 360 362 ENDIF … … 363 365 CASE ( 'yz' ) 364 366 s_ind = 3 365 ALLOCATE( local_2d(nys g:nyng,nzb:nzt+1) )367 ALLOCATE( local_2d(nys:nyn,nzb:nzt+1) ) 366 368 367 369 IF ( netcdf_data_format > 4 ) THEN … … 371 373 ENDDO 372 374 ns = ns - 1 373 ALLOCATE( local_2d_sections(1:ns,nys g:nyng,nzb:nzt+1) )374 ALLOCATE( local_2d_sections_l(1:ns,nys g:nyng,nzb:nzt+1) )375 ALLOCATE( local_2d_sections(1:ns,nys:nyn,nzb:nzt+1) ) 376 ALLOCATE( local_2d_sections_l(1:ns,nys:nyn,nzb:nzt+1) ) 375 377 local_2d_sections = 0.0_wp; local_2d_sections_l = 0.0_wp 376 378 ENDIF … … 387 389 IF ( myid == 0 ) THEN 388 390 #if defined( __parallel ) 389 ALLOCATE( total_2d( -nbgp:ny+nbgp,nzb:nzt+1) )391 ALLOCATE( total_2d(0:ny,nzb:nzt+1) ) 390 392 #endif 391 393 ENDIF … … 434 436 ! 435 437 !-- Allocate a temporary array for resorting (kji -> ijk). 436 ALLOCATE( local_pf(nxl g:nxrg,nysg:nyng,nzb:nzt+1) )438 ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb:nzt+1) ) 437 439 local_pf = 0.0 438 !439 !-- Allocate temporary array used for exchanging ghoist points of surface-data440 ALLOCATE( tmp_2d(nysg:nyng,nxlg:nxrg) )441 tmp_2d = 0.0442 440 443 441 ! … … 481 479 CASE ( 'lwp*_xy' ) ! 2d-array 482 480 IF ( av == 0 ) THEN 483 DO i = nxl g, nxrg484 DO j = nys g, nyng481 DO i = nxl, nxr 482 DO j = nys, nyn 485 483 local_pf(i,j,nzb+1) = SUM( ql(nzb:nzt,j,i) * & 486 484 dzw(1:nzt+1) ) … … 488 486 ENDDO 489 487 ELSE 490 DO i = nxl g, nxrg491 DO j = nys g, nyng488 DO i = nxl, nxr 489 DO j = nys, nyn 492 490 local_pf(i,j,nzb+1) = lwp_av(j,i) 493 491 ENDDO … … 519 517 i = surf_def_h(0)%i(m) 520 518 j = surf_def_h(0)%j(m) 521 tmp_2d(j,i) = surf_def_h(0)%ol(m)519 local_pf(i,j,nzb+1) = surf_def_h(0)%ol(m) 522 520 ENDDO 523 521 DO m = 1, surf_lsm_h%ns 524 522 i = surf_lsm_h%i(m) 525 523 j = surf_lsm_h%j(m) 526 tmp_2d(j,i) = surf_lsm_h%ol(m)524 local_pf(i,j,nzb+1) = surf_lsm_h%ol(m) 527 525 ENDDO 528 526 DO m = 1, surf_usm_h%ns 529 527 i = surf_usm_h%i(m) 530 528 j = surf_usm_h%j(m) 531 tmp_2d(j,i) = surf_usm_h%ol(m) 532 ENDDO 533 534 CALL exchange_horiz_2d( tmp_2d, nbgp ) 535 536 DO i = nxlg, nxrg 537 DO j = nysg, nyng 538 local_pf(i,j,nzb+1) = tmp_2d(j,i) 539 ENDDO 540 ENDDO 541 542 ELSE 543 DO i = nxlg, nxrg 544 DO j = nysg, nyng 529 local_pf(i,j,nzb+1) = surf_usm_h%ol(m) 530 ENDDO 531 ELSE 532 DO i = nxl, nxr 533 DO j = nys, nyn 545 534 local_pf(i,j,nzb+1) = ol_av(j,i) 546 535 ENDDO … … 565 554 IF ( simulated_time >= particle_advection_start ) THEN 566 555 tend = prt_count 567 CALL exchange_horiz( tend, nbgp )556 ! CALL exchange_horiz( tend, nbgp ) 568 557 ELSE 569 558 tend = 0.0_wp 570 559 ENDIF 571 DO i = nxl g, nxrg572 DO j = nys g, nyng560 DO i = nxl, nxr 561 DO j = nys, nyn 573 562 DO k = nzb, nzt+1 574 563 local_pf(i,j,k) = tend(k,j,i) … … 578 567 resorted = .TRUE. 579 568 ELSE 580 CALL exchange_horiz( pc_av, nbgp )569 ! CALL exchange_horiz( pc_av, nbgp ) 581 570 to_be_resorted => pc_av 582 571 ENDIF … … 610 599 ENDDO 611 600 ENDDO 612 CALL exchange_horiz( tend, nbgp )601 ! CALL exchange_horiz( tend, nbgp ) 613 602 ELSE 614 603 tend = 0.0_wp 615 604 ENDIF 616 DO i = nxl g, nxrg617 DO j = nys g, nyng605 DO i = nxl, nxr 606 DO j = nys, nyn 618 607 DO k = nzb, nzt+1 619 608 local_pf(i,j,k) = tend(k,j,i) … … 623 612 resorted = .TRUE. 624 613 ELSE 625 CALL exchange_horiz( pr_av, nbgp )614 ! CALL exchange_horiz( pr_av, nbgp ) 626 615 to_be_resorted => pr_av 627 616 ENDIF 628 617 629 618 CASE ( 'pra*_xy' ) ! 2d-array / integral quantity => no av 630 CALL exchange_horiz_2d( precipitation_amount )631 DO i = nxl g, nxrg632 DO j = nys g, nyng619 ! CALL exchange_horiz_2d( precipitation_amount ) 620 DO i = nxl, nxr 621 DO j = nys, nyn 633 622 local_pf(i,j,nzb+1) = precipitation_amount(j,i) 634 623 ENDDO … … 641 630 CASE ( 'prr*_xy' ) ! 2d-array 642 631 IF ( av == 0 ) THEN 643 CALL exchange_horiz_2d( prr(nzb+1,:,:) )644 DO i = nxl g, nxrg645 DO j = nys g, nyng632 ! CALL exchange_horiz_2d( prr(nzb+1,:,:) ) 633 DO i = nxl, nxr 634 DO j = nys, nyn 646 635 local_pf(i,j,nzb+1) = prr(nzb+1,j,i) * hyrho(nzb+1) 647 636 ENDDO 648 637 ENDDO 649 638 ELSE 650 CALL exchange_horiz_2d( prr_av(nzb+1,:,:) )651 DO i = nxl g, nxrg652 DO j = nys g, nyng639 ! CALL exchange_horiz_2d( prr_av(nzb+1,:,:) ) 640 DO i = nxl, nxr 641 DO j = nys, nyn 653 642 local_pf(i,j,nzb+1) = prr_av(nzb+1,j,i) * hyrho(nzb+1) 654 643 ENDDO … … 661 650 CASE ( 'prr_xy', 'prr_xz', 'prr_yz' ) 662 651 IF ( av == 0 ) THEN 663 CALL exchange_horiz( prr, nbgp )664 DO i = nxl g, nxrg665 DO j = nys g, nyng652 ! CALL exchange_horiz( prr, nbgp ) 653 DO i = nxl, nxr 654 DO j = nys, nyn 666 655 DO k = nzb, nzt+1 667 656 local_pf(i,j,k) = prr(k,j,i) * hyrho(nzb+1) … … 670 659 ENDDO 671 660 ELSE 672 CALL exchange_horiz( prr_av, nbgp )673 DO i = nxl g, nxrg674 DO j = nys g, nyng661 ! CALL exchange_horiz( prr_av, nbgp ) 662 DO i = nxl, nxr 663 DO j = nys, nyn 675 664 DO k = nzb, nzt+1 676 665 local_pf(i,j,k) = prr_av(k,j,i) * hyrho(nzb+1) … … 687 676 to_be_resorted => pt 688 677 ELSE 689 DO i = nxl g, nxrg690 DO j = nys g, nyng678 DO i = nxl, nxr 679 DO j = nys, nyn 691 680 DO k = nzb, nzt+1 692 681 local_pf(i,j,k) = pt(k,j,i) + l_d_cp * & … … 762 751 ENDDO 763 752 ENDDO 764 CALL exchange_horiz( tend, nbgp )753 ! CALL exchange_horiz( tend, nbgp ) 765 754 ELSE 766 755 tend = 0.0_wp 767 756 ENDIF 768 DO i = nxl g, nxrg769 DO j = nys g, nyng757 DO i = nxl, nxr 758 DO j = nys, nyn 770 759 DO k = nzb, nzt+1 771 760 local_pf(i,j,k) = tend(k,j,i) … … 775 764 resorted = .TRUE. 776 765 ELSE 777 CALL exchange_horiz( ql_vp_av, nbgp )766 ! CALL exchange_horiz( ql_vp_av, nbgp ) 778 767 to_be_resorted => ql_vp 779 768 ENDIF … … 793 782 i = surf_def_h(0)%i(m) 794 783 j = surf_def_h(0)%j(m) 795 tmp_2d(j,i) = surf_def_h(0)%qsws(m)784 local_pf(i,j,nzb+1) = surf_def_h(0)%qsws(m) 796 785 ENDDO 797 786 DO m = 1, surf_lsm_h%ns 798 787 i = surf_lsm_h%i(m) 799 788 j = surf_lsm_h%j(m) 800 tmp_2d(j,i) = surf_lsm_h%qsws(m)789 local_pf(i,j,nzb+1) = surf_lsm_h%qsws(m) 801 790 ENDDO 802 791 DO m = 1, surf_usm_h%ns 803 792 i = surf_usm_h%i(m) 804 793 j = surf_usm_h%j(m) 805 tmp_2d(j,i) = surf_usm_h%qsws(m) 806 ENDDO 807 808 CALL exchange_horiz_2d( tmp_2d, nbgp ) 809 810 DO i = nxlg, nxrg 811 DO j = nysg, nyng 812 local_pf(i,j,nzb+1) = tmp_2d(j,i) 813 ENDDO 814 ENDDO 815 ELSE 816 DO i = nxlg, nxrg 817 DO j = nysg, nyng 794 local_pf(i,j,nzb+1) = surf_usm_h%qsws(m) 795 ENDDO 796 ELSE 797 DO i = nxl, nxr 798 DO j = nys, nyn 818 799 local_pf(i,j,nzb+1) = qsws_av(j,i) 819 800 ENDDO … … 826 807 CASE ( 'qv_xy', 'qv_xz', 'qv_yz' ) 827 808 IF ( av == 0 ) THEN 828 DO i = nxl g, nxrg829 DO j = nys g, nyng809 DO i = nxl, nxr 810 DO j = nys, nyn 830 811 DO k = nzb, nzt+1 831 812 local_pf(i,j,k) = q(k,j,i) - ql(k,j,i) … … 867 848 i = surf_def_h(0)%i(m) 868 849 j = surf_def_h(0)%j(m) 869 tmp_2d(j,i) = surf_def_h(0)%shf(m)850 local_pf(i,j,nzb+1) = surf_def_h(0)%shf(m) 870 851 ENDDO 871 852 DO m = 1, surf_lsm_h%ns 872 853 i = surf_lsm_h%i(m) 873 854 j = surf_lsm_h%j(m) 874 tmp_2d(j,i) = surf_lsm_h%shf(m)855 local_pf(i,j,nzb+1) = surf_lsm_h%shf(m) 875 856 ENDDO 876 857 DO m = 1, surf_usm_h%ns 877 858 i = surf_usm_h%i(m) 878 859 j = surf_usm_h%j(m) 879 tmp_2d(j,i) = surf_usm_h%shf(m) 880 ENDDO 881 882 CALL exchange_horiz_2d( tmp_2d, nbgp ) 883 884 DO i = nxlg, nxrg 885 DO j = nysg, nyng 886 local_pf(i,j,nzb+1) = tmp_2d(j,i) 887 ENDDO 888 ENDDO 889 ELSE 890 DO i = nxlg, nxrg 891 DO j = nysg, nyng 860 local_pf(i,j,nzb+1) = surf_usm_h%shf(m) 861 ENDDO 862 ELSE 863 DO i = nxl, nxr 864 DO j = nys, nyn 892 865 local_pf(i,j,nzb+1) = shf_av(j,i) 893 866 ENDDO … … 903 876 i = surf_def_h(0)%i(m) 904 877 j = surf_def_h(0)%j(m) 905 tmp_2d(j,i) = surf_def_h(0)%ssws(m)878 local_pf(i,j,nzb+1) = surf_def_h(0)%ssws(m) 906 879 ENDDO 907 880 DO m = 1, surf_lsm_h%ns 908 881 i = surf_lsm_h%i(m) 909 882 j = surf_lsm_h%j(m) 910 tmp_2d(j,i) = surf_lsm_h%ssws(m)883 local_pf(i,j,nzb+1) = surf_lsm_h%ssws(m) 911 884 ENDDO 912 885 DO m = 1, surf_usm_h%ns 913 886 i = surf_usm_h%i(m) 914 887 j = surf_usm_h%j(m) 915 tmp_2d(j,i) = surf_usm_h%ssws(m) 916 ENDDO 917 918 CALL exchange_horiz_2d( tmp_2d, nbgp ) 919 920 DO i = nxlg, nxrg 921 DO j = nysg, nyng 922 local_pf(i,j,nzb+1) = tmp_2d(j,i) 923 ENDDO 924 ENDDO 925 ELSE 926 DO i = nxlg, nxrg 927 DO j = nysg, nyng 888 local_pf(i,j,nzb+1) = surf_usm_h%ssws(m) 889 ENDDO 890 ELSE 891 DO i = nxl, nxr 892 DO j = nys, nyn 928 893 local_pf(i,j,nzb+1) = ssws_av(j,i) 929 894 ENDDO … … 939 904 i = surf_def_h(0)%i(m) 940 905 j = surf_def_h(0)%j(m) 941 tmp_2d(j,i) = surf_def_h(0)%ts(m)906 local_pf(i,j,nzb+1) = surf_def_h(0)%ts(m) 942 907 ENDDO 943 908 DO m = 1, surf_lsm_h%ns 944 909 i = surf_lsm_h%i(m) 945 910 j = surf_lsm_h%j(m) 946 tmp_2d(j,i) = surf_lsm_h%ts(m)911 local_pf(i,j,nzb+1) = surf_lsm_h%ts(m) 947 912 ENDDO 948 913 DO m = 1, surf_usm_h%ns 949 914 i = surf_usm_h%i(m) 950 915 j = surf_usm_h%j(m) 951 tmp_2d(j,i) = surf_usm_h%ts(m) 952 ENDDO 953 954 CALL exchange_horiz_2d( tmp_2d, nbgp ) 955 956 DO i = nxlg, nxrg 957 DO j = nysg, nyng 958 local_pf(i,j,nzb+1) = tmp_2d(j,i) 959 ENDDO 960 ENDDO 961 962 ELSE 963 DO i = nxlg, nxrg 964 DO j = nysg, nyng 916 local_pf(i,j,nzb+1) = surf_usm_h%ts(m) 917 ENDDO 918 ELSE 919 DO i = nxl, nxr 920 DO j = nys, nyn 965 921 local_pf(i,j,nzb+1) = ts_av(j,i) 966 922 ENDDO … … 990 946 i = surf_def_h(0)%i(m) 991 947 j = surf_def_h(0)%j(m) 992 tmp_2d(j,i) = surf_def_h(0)%us(m)948 local_pf(i,j,nzb+1) = surf_def_h(0)%us(m) 993 949 ENDDO 994 950 DO m = 1, surf_lsm_h%ns 995 951 i = surf_lsm_h%i(m) 996 952 j = surf_lsm_h%j(m) 997 tmp_2d(j,i) = surf_lsm_h%us(m)953 local_pf(i,j,nzb+1) = surf_lsm_h%us(m) 998 954 ENDDO 999 955 DO m = 1, surf_usm_h%ns 1000 956 i = surf_usm_h%i(m) 1001 957 j = surf_usm_h%j(m) 1002 tmp_2d(j,i) = surf_usm_h%us(m) 1003 ENDDO 1004 1005 CALL exchange_horiz_2d( tmp_2d, nbgp ) 1006 1007 DO i = nxlg, nxrg 1008 DO j = nysg, nyng 1009 local_pf(i,j,nzb+1) = tmp_2d(j,i) 1010 ENDDO 1011 ENDDO 1012 ELSE 1013 DO i = nxlg, nxrg 1014 DO j = nysg, nyng 958 local_pf(i,j,nzb+1) = surf_usm_h%us(m) 959 ENDDO 960 ELSE 961 DO i = nxl, nxr 962 DO j = nys, nyn 1015 963 local_pf(i,j,nzb+1) = us_av(j,i) 1016 964 ENDDO … … 1056 1004 i = surf_def_h(0)%i(m) 1057 1005 j = surf_def_h(0)%j(m) 1058 tmp_2d(j,i) = surf_def_h(0)%z0(m)1006 local_pf(i,j,nzb+1) = surf_def_h(0)%z0(m) 1059 1007 ENDDO 1060 1008 DO m = 1, surf_lsm_h%ns 1061 1009 i = surf_lsm_h%i(m) 1062 1010 j = surf_lsm_h%j(m) 1063 tmp_2d(j,i) = surf_lsm_h%z0(m)1011 local_pf(i,j,nzb+1) = surf_lsm_h%z0(m) 1064 1012 ENDDO 1065 1013 DO m = 1, surf_usm_h%ns 1066 1014 i = surf_usm_h%i(m) 1067 1015 j = surf_usm_h%j(m) 1068 tmp_2d(j,i) = surf_usm_h%z0(m) 1069 ENDDO 1070 1071 CALL exchange_horiz_2d( tmp_2d, nbgp ) 1072 1073 DO i = nxlg, nxrg 1074 DO j = nysg, nyng 1075 local_pf(i,j,nzb+1) = tmp_2d(j,i) 1076 ENDDO 1077 ENDDO 1078 1079 ELSE 1080 DO i = nxlg, nxrg 1081 DO j = nysg, nyng 1016 local_pf(i,j,nzb+1) = surf_usm_h%z0(m) 1017 ENDDO 1018 ELSE 1019 DO i = nxl, nxr 1020 DO j = nys, nyn 1082 1021 local_pf(i,j,nzb+1) = z0_av(j,i) 1083 1022 ENDDO … … 1093 1032 i = surf_def_h(0)%i(m) 1094 1033 j = surf_def_h(0)%j(m) 1095 tmp_2d(j,i) = surf_def_h(0)%z0h(m)1034 local_pf(i,j,nzb+1) = surf_def_h(0)%z0h(m) 1096 1035 ENDDO 1097 1036 DO m = 1, surf_lsm_h%ns 1098 1037 i = surf_lsm_h%i(m) 1099 1038 j = surf_lsm_h%j(m) 1100 tmp_2d(j,i) = surf_lsm_h%z0h(m)1039 local_pf(i,j,nzb+1) = surf_lsm_h%z0h(m) 1101 1040 ENDDO 1102 1041 DO m = 1, surf_usm_h%ns 1103 1042 i = surf_usm_h%i(m) 1104 1043 j = surf_usm_h%j(m) 1105 tmp_2d(j,i) = surf_usm_h%z0h(m) 1106 ENDDO 1107 1108 CALL exchange_horiz_2d( tmp_2d, nbgp ) 1109 1110 DO i = nxlg, nxrg 1111 DO j = nysg, nyng 1112 local_pf(i,j,nzb+1) = tmp_2d(j,i) 1113 ENDDO 1114 ENDDO 1115 ELSE 1116 DO i = nxlg, nxrg 1117 DO j = nysg, nyng 1044 local_pf(i,j,nzb+1) = surf_usm_h%z0h(m) 1045 ENDDO 1046 ELSE 1047 DO i = nxl, nxr 1048 DO j = nys, nyn 1118 1049 local_pf(i,j,nzb+1) = z0h_av(j,i) 1119 1050 ENDDO … … 1129 1060 i = surf_def_h(0)%i(m) 1130 1061 j = surf_def_h(0)%j(m) 1131 tmp_2d(j,i) = surf_def_h(0)%z0q(m)1062 local_pf(i,j,nzb+1) = surf_def_h(0)%z0q(m) 1132 1063 ENDDO 1133 1064 DO m = 1, surf_lsm_h%ns 1134 1065 i = surf_lsm_h%i(m) 1135 1066 j = surf_lsm_h%j(m) 1136 tmp_2d(j,i) = surf_lsm_h%z0q(m)1067 local_pf(i,j,nzb+1) = surf_lsm_h%z0q(m) 1137 1068 ENDDO 1138 1069 DO m = 1, surf_usm_h%ns 1139 1070 i = surf_usm_h%i(m) 1140 1071 j = surf_usm_h%j(m) 1141 tmp_2d(j,i) = surf_usm_h%z0q(m) 1142 ENDDO 1143 1144 CALL exchange_horiz_2d( tmp_2d, nbgp ) 1145 1146 DO i = nxlg, nxrg 1147 DO j = nysg, nyng 1148 local_pf(i,j,nzb+1) = tmp_2d(j,i) 1149 ENDDO 1150 ENDDO 1151 ELSE 1152 DO i = nxlg, nxrg 1153 DO j = nysg, nyng 1072 local_pf(i,j,nzb+1) = surf_usm_h%z0q(m) 1073 ENDDO 1074 ELSE 1075 DO i = nxl, nxr 1076 DO j = nys, nyn 1154 1077 local_pf(i,j,nzb+1) = z0q_av(j,i) 1155 1078 ENDDO … … 1206 1129 !-- Resort the array to be output, if not done above 1207 1130 IF ( .NOT. resorted ) THEN 1208 DO i = nxl g, nxrg1209 DO j = nys g, nyng1131 DO i = nxl, nxr 1132 DO j = nys, nyn 1210 1133 DO k = nzb_do, nzt_do 1211 1134 local_pf(i,j,k) = to_be_resorted(k,j,i) … … 1269 1192 !-- Carry out the averaging (all data are on the PE) 1270 1193 DO k = nzb_do, nzt_do 1271 DO j = nys g, nyng1272 DO i = nxl g, nxrg1194 DO j = nys, nyn 1195 DO i = nxl, nxr 1273 1196 local_2d(i,j) = local_2d(i,j) + local_pf(i,j,k) 1274 1197 ENDDO … … 1300 1223 !-- here on a local array and will be written to the output 1301 1224 !-- file afterwards to increase the performance. 1302 DO i = nxl g, nxrg1303 DO j = nys g, nyng1225 DO i = nxl, nxr 1226 DO j = nys, nyn 1304 1227 local_2d_sections(i,j,iis) = local_2d(i,j) 1305 1228 ENDDO … … 1319 1242 DO i = 0, io_blocks-1 1320 1243 IF ( i == io_group ) THEN 1321 WRITE ( 21 ) nxl g, nxrg, nysg, nyng, nysg, nyng1244 WRITE ( 21 ) nxl, nxr, nys, nyn, nys, nyn 1322 1245 WRITE ( 21 ) local_2d 1323 1246 ENDIF … … 1335 1258 CALL MPI_BARRIER( comm2d, ierr ) 1336 1259 1337 ngp = ( nxr g-nxlg+1 ) * ( nyng-nysg+1 )1260 ngp = ( nxr-nxl+1 ) * ( nyn-nys+1 ) 1338 1261 IF ( myid == 0 ) THEN 1339 1262 ! 1340 1263 !-- Local array can be relocated directly. 1341 total_2d(nxl g:nxrg,nysg:nyng) = local_2d1264 total_2d(nxl:nxr,nys:nyn) = local_2d 1342 1265 ! 1343 1266 !-- Receive data from all other PEs. … … 1361 1284 !-- Relocate the local array for the next loop increment 1362 1285 DEALLOCATE( local_2d ) 1363 ALLOCATE( local_2d(nxl g:nxrg,nysg:nyng) )1286 ALLOCATE( local_2d(nxl:nxr,nys:nyn) ) 1364 1287 1365 1288 #if defined( __netcdf ) … … 1367 1290 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1368 1291 id_var_do2d(av,if), & 1369 total_2d(0:nx+1,0:ny+1), &1292 total_2d(0:nx,0:ny), & 1370 1293 start = (/ 1, 1, 1, do2d_xy_time_count(av) /), & 1371 count = (/ nx+ 2, ny+2, 1, 1 /) )1294 count = (/ nx+1, ny+1, 1, 1 /) ) 1372 1295 ELSE 1373 1296 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1374 1297 id_var_do2d(av,if), & 1375 total_2d(0:nx+1,0:ny+1), &1298 total_2d(0:nx,0:ny), & 1376 1299 start = (/ 1, 1, is, do2d_xy_time_count(av) /), & 1377 count = (/ nx+ 2, ny+2, 1, 1 /) )1300 count = (/ nx+1, ny+1, 1, 1 /) ) 1378 1301 ENDIF 1379 1302 CALL netcdf_handle_error( 'data_output_2d', 54 ) … … 1383 1306 ! 1384 1307 !-- First send the local index limits to PE0 1385 ind(1) = nxl g; ind(2) = nxrg1386 ind(3) = nys g; ind(4) = nyng1308 ind(1) = nxl; ind(2) = nxr 1309 ind(3) = nys; ind(4) = nyn 1387 1310 CALL MPI_SEND( ind(1), 4, MPI_INTEGER, 0, 0, & 1388 1311 comm2d, ierr ) 1389 1312 ! 1390 1313 !-- Send data to PE0 1391 CALL MPI_SEND( local_2d(nxl g,nysg), ngp,&1314 CALL MPI_SEND( local_2d(nxl,nys), ngp, & 1392 1315 MPI_REAL, 0, 1, comm2d, ierr ) 1393 1316 ENDIF … … 1405 1328 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1406 1329 id_var_do2d(av,if), & 1407 local_2d(nxl:nxr+1,nys:nyn+1),&1330 local_2d(nxl:nxr,nys:nyn), & 1408 1331 start = (/ 1, 1, 1, do2d_xy_time_count(av) /), & 1409 count = (/ nx+ 2, ny+2, 1, 1 /) )1332 count = (/ nx+1, ny+1, 1, 1 /) ) 1410 1333 ELSE 1411 1334 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1412 1335 id_var_do2d(av,if), & 1413 local_2d(nxl:nxr+1,nys:nyn+1),&1336 local_2d(nxl:nxr,nys:nyn), & 1414 1337 start = (/ 1, 1, is, do2d_xy_time_count(av) /), & 1415 count = (/ nx+ 2, ny+2, 1, 1 /) )1338 count = (/ nx+1, ny+1, 1, 1 /) ) 1416 1339 ENDIF 1417 1340 CALL netcdf_handle_error( 'data_output_2d', 447 ) … … 1455 1378 IF ( section(is,s_ind) == -1 ) THEN 1456 1379 1457 ALLOCATE( local_2d_l(nxl g:nxrg,nzb_do:nzt_do) )1380 ALLOCATE( local_2d_l(nxl:nxr,nzb_do:nzt_do) ) 1458 1381 local_2d_l = 0.0_wp 1459 ngp = ( nxr g-nxlg+ 1 ) * ( nzt_do-nzb_do + 1 )1382 ngp = ( nxr-nxl + 1 ) * ( nzt_do-nzb_do + 1 ) 1460 1383 ! 1461 1384 !-- First local averaging on the PE 1462 1385 DO k = nzb_do, nzt_do 1463 1386 DO j = nys, nyn 1464 DO i = nxl g, nxrg1387 DO i = nxl, nxr 1465 1388 local_2d_l(i,k) = local_2d_l(i,k) + & 1466 1389 local_pf(i,j,k) … … 1472 1395 !-- Now do the averaging over all PEs along y 1473 1396 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 1474 CALL MPI_ALLREDUCE( local_2d_l(nxl g,nzb_do), &1475 local_2d(nxl g,nzb_do), ngp, MPI_REAL, &1397 CALL MPI_ALLREDUCE( local_2d_l(nxl,nzb_do), & 1398 local_2d(nxl,nzb_do), ngp, MPI_REAL, & 1476 1399 MPI_SUM, comm1dy, ierr ) 1477 1400 #else … … 1508 1431 !-- stored here on a local array and will be written to the 1509 1432 !-- output file afterwards to increase the performance. 1510 DO i = nxl g, nxrg1433 DO i = nxl, nxr 1511 1434 DO k = nzb_do, nzt_do 1512 1435 local_2d_sections_l(i,is,k) = local_2d(i,k) … … 1536 1459 nys-1 == -1 ) ) & 1537 1460 THEN 1538 WRITE (22) nxl g, nxrg, nzb_do, nzt_do, nzb, nzt+11461 WRITE (22) nxl, nxr, nzb_do, nzt_do, nzb, nzt+1 1539 1462 WRITE (22) local_2d 1540 1463 ELSE … … 1555 1478 CALL MPI_BARRIER( comm2d, ierr ) 1556 1479 1557 ngp = ( nxr g-nxlg+ 1 ) * ( nzt_do-nzb_do + 1 )1480 ngp = ( nxr-nxl + 1 ) * ( nzt_do-nzb_do + 1 ) 1558 1481 IF ( myid == 0 ) THEN 1559 1482 ! … … 1563 1486 ( section(is,s_ind) == -1 .AND. & 1564 1487 nys-1 == -1 ) ) THEN 1565 total_2d(nxl g:nxrg,nzb_do:nzt_do) = local_2d1488 total_2d(nxl:nxr,nzb_do:nzt_do) = local_2d 1566 1489 ENDIF 1567 1490 ! … … 1592 1515 !-- Relocate the local array for the next loop increment 1593 1516 DEALLOCATE( local_2d ) 1594 ALLOCATE( local_2d(nxl g:nxrg,nzb_do:nzt_do) )1517 ALLOCATE( local_2d(nxl:nxr,nzb_do:nzt_do) ) 1595 1518 1596 1519 #if defined( __netcdf ) 1597 nc_stat = NF90_PUT_VAR( id_set_xz(av), &1598 id_var_do2d(av,if), &1599 total_2d(0:nx +1,nzb_do:nzt_do),&1600 start = (/ 1, is, 1, do2d_xz_time_count(av) /), &1601 count = (/ nx+2, 1, nzt_do-nzb_do+1, 1 /) )1520 nc_stat = NF90_PUT_VAR( id_set_xz(av), & 1521 id_var_do2d(av,if), & 1522 total_2d(0:nx,nzb_do:nzt_do), & 1523 start = (/ 1, is, 1, do2d_xz_time_count(av) /), & 1524 count = (/ nx+1, 1, nzt_do-nzb_do+1, 1 /) ) 1602 1525 CALL netcdf_handle_error( 'data_output_2d', 58 ) 1603 1526 #endif … … 1611 1534 ( section(is,s_ind) == -1 .AND. nys-1 == -1 ) ) & 1612 1535 THEN 1613 ind(1) = nxl g; ind(2) = nxrg1536 ind(1) = nxl; ind(2) = nxr 1614 1537 ind(3) = nzb_do; ind(4) = nzt_do 1615 1538 ELSE … … 1622 1545 !-- If applicable, send data to PE0. 1623 1546 IF ( ind(1) /= -9999 ) THEN 1624 CALL MPI_SEND( local_2d(nxl g,nzb_do), ngp, &1547 CALL MPI_SEND( local_2d(nxl,nzb_do), ngp, & 1625 1548 MPI_REAL, 0, 1, comm2d, ierr ) 1626 1549 ENDIF … … 1638 1561 nc_stat = NF90_PUT_VAR( id_set_xz(av), & 1639 1562 id_var_do2d(av,if), & 1640 local_2d(nxl:nxr +1,nzb_do:nzt_do),&1563 local_2d(nxl:nxr,nzb_do:nzt_do), & 1641 1564 start = (/ 1, is, 1, do2d_xz_time_count(av) /), & 1642 count = (/ nx+2, 1, nzt_do-nzb_do+1, 1 /) )1565 count = (/ nx+1, 1, nzt_do-nzb_do+1, 1 /) ) 1643 1566 CALL netcdf_handle_error( 'data_output_2d', 451 ) 1644 1567 #endif … … 1673 1596 IF ( section(is,s_ind) == -1 ) THEN 1674 1597 1675 ALLOCATE( local_2d_l(nys g:nyng,nzb_do:nzt_do) )1598 ALLOCATE( local_2d_l(nys:nyn,nzb_do:nzt_do) ) 1676 1599 local_2d_l = 0.0_wp 1677 ngp = ( nyn g-nysg+1 ) * ( nzt_do-nzb_do+1 )1600 ngp = ( nyn-nys+1 ) * ( nzt_do-nzb_do+1 ) 1678 1601 ! 1679 1602 !-- First local averaging on the PE 1680 1603 DO k = nzb_do, nzt_do 1681 DO j = nys g, nyng1604 DO j = nys, nyn 1682 1605 DO i = nxl, nxr 1683 1606 local_2d_l(j,k) = local_2d_l(j,k) + & … … 1690 1613 !-- Now do the averaging over all PEs along x 1691 1614 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 1692 CALL MPI_ALLREDUCE( local_2d_l(nys g,nzb_do), &1693 local_2d(nys g,nzb_do), ngp, MPI_REAL, &1615 CALL MPI_ALLREDUCE( local_2d_l(nys,nzb_do), & 1616 local_2d(nys,nzb_do), ngp, MPI_REAL, & 1694 1617 MPI_SUM, comm1dx, ierr ) 1695 1618 #else … … 1726 1649 !-- stored here on a local array and will be written to the 1727 1650 !-- output file afterwards to increase the performance. 1728 DO j = nys g, nyng1651 DO j = nys, nyn 1729 1652 DO k = nzb_do, nzt_do 1730 1653 local_2d_sections_l(is,j,k) = local_2d(j,k) … … 1754 1677 nxl-1 == -1 ) ) & 1755 1678 THEN 1756 WRITE (23) nys g, nyng, nzb_do, nzt_do, nzb, nzt+11679 WRITE (23) nys, nyn, nzb_do, nzt_do, nzb, nzt+1 1757 1680 WRITE (23) local_2d 1758 1681 ELSE … … 1773 1696 CALL MPI_BARRIER( comm2d, ierr ) 1774 1697 1775 ngp = ( nyn g-nysg+1 ) * ( nzt_do-nzb_do+1 )1698 ngp = ( nyn-nys+1 ) * ( nzt_do-nzb_do+1 ) 1776 1699 IF ( myid == 0 ) THEN 1777 1700 ! … … 1781 1704 ( section(is,s_ind) == -1 .AND. nxl-1 == -1 ) ) & 1782 1705 THEN 1783 total_2d(nys g:nyng,nzb_do:nzt_do) = local_2d1706 total_2d(nys:nyn,nzb_do:nzt_do) = local_2d 1784 1707 ENDIF 1785 1708 ! … … 1810 1733 !-- Relocate the local array for the next loop increment 1811 1734 DEALLOCATE( local_2d ) 1812 ALLOCATE( local_2d(nys g:nyng,nzb_do:nzt_do) )1735 ALLOCATE( local_2d(nys:nyn,nzb_do:nzt_do) ) 1813 1736 1814 1737 #if defined( __netcdf ) 1815 nc_stat = NF90_PUT_VAR( id_set_yz(av), &1816 id_var_do2d(av,if), &1817 total_2d(0:ny +1,nzb_do:nzt_do),&1818 start = (/ is, 1, 1, do2d_yz_time_count(av) /), &1819 count = (/ 1, ny+2, nzt_do-nzb_do+1, 1 /) )1738 nc_stat = NF90_PUT_VAR( id_set_yz(av), & 1739 id_var_do2d(av,if), & 1740 total_2d(0:ny,nzb_do:nzt_do), & 1741 start = (/ is, 1, 1, do2d_yz_time_count(av) /), & 1742 count = (/ 1, ny+1, nzt_do-nzb_do+1, 1 /) ) 1820 1743 CALL netcdf_handle_error( 'data_output_2d', 61 ) 1821 1744 #endif … … 1829 1752 ( section(is,s_ind) == -1 .AND. nxl-1 == -1 ) ) & 1830 1753 THEN 1831 ind(1) = nys g; ind(2) = nyng1754 ind(1) = nys; ind(2) = nyn 1832 1755 ind(3) = nzb_do; ind(4) = nzt_do 1833 1756 ELSE … … 1840 1763 !-- If applicable, send data to PE0. 1841 1764 IF ( ind(1) /= -9999 ) THEN 1842 CALL MPI_SEND( local_2d(nys g,nzb_do), ngp, &1765 CALL MPI_SEND( local_2d(nys,nzb_do), ngp, & 1843 1766 MPI_REAL, 0, 1, comm2d, ierr ) 1844 1767 ENDIF … … 1856 1779 nc_stat = NF90_PUT_VAR( id_set_yz(av), & 1857 1780 id_var_do2d(av,if), & 1858 local_2d(nys:nyn +1,nzb_do:nzt_do),&1781 local_2d(nys:nyn,nzb_do:nzt_do), & 1859 1782 start = (/ is, 1, 1, do2d_xz_time_count(av) /), & 1860 count = (/ 1, ny+ 2, nzt_do-nzb_do+1, 1 /) )1783 count = (/ 1, ny+1, nzt_do-nzb_do+1, 1 /) ) 1861 1784 CALL netcdf_handle_error( 'data_output_2d', 452 ) 1862 1785 #endif … … 1887 1810 !-- Do not output redundant ghost point data except for the 1888 1811 !-- boundaries of the total domain. 1889 IF ( nxr == nx .AND. nyn /= ny ) THEN1890 nc_stat = NF90_PUT_VAR( id_set_xy(av), &1891 id_var_do2d(av,if), &1892 local_2d_sections(nxl:nxr+1, &1893 nys:nyn,1:nis), &1894 start = (/ nxl+1, nys+1, 1, &1895 do2d_xy_time_count(av) /), &1896 count = (/ nxr-nxl+2, &1897 nyn-nys+1, nis, 1 &1898 /) )1899 ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN1900 nc_stat = NF90_PUT_VAR( id_set_xy(av), &1901 id_var_do2d(av,if), &1902 local_2d_sections(nxl:nxr, &1903 nys:nyn+1,1:nis), &1904 start = (/ nxl+1, nys+1, 1, &1905 do2d_xy_time_count(av) /), &1906 count = (/ nxr-nxl+1, &1907 nyn-nys+2, nis, 1 &1908 /) )1909 ELSEIF ( nxr == nx .AND. nyn == ny ) THEN1910 nc_stat = NF90_PUT_VAR( id_set_xy(av), &1911 id_var_do2d(av,if), &1912 local_2d_sections(nxl:nxr+1, &1913 nys:nyn+1,1:nis), &1914 start = (/ nxl+1, nys+1, 1, &1915 do2d_xy_time_count(av) /), &1916 count = (/ nxr-nxl+2, &1917 nyn-nys+2, nis, 1 &1918 /) )1919 ELSE1812 ! IF ( nxr == nx .AND. nyn /= ny ) THEN 1813 ! nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1814 ! id_var_do2d(av,if), & 1815 ! local_2d_sections(nxl:nxr+1, & 1816 ! nys:nyn,1:nis), & 1817 ! start = (/ nxl+1, nys+1, 1, & 1818 ! do2d_xy_time_count(av) /), & 1819 ! count = (/ nxr-nxl+2, & 1820 ! nyn-nys+1, nis, 1 & 1821 ! /) ) 1822 ! ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN 1823 ! nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1824 ! id_var_do2d(av,if), & 1825 ! local_2d_sections(nxl:nxr, & 1826 ! nys:nyn+1,1:nis), & 1827 ! start = (/ nxl+1, nys+1, 1, & 1828 ! do2d_xy_time_count(av) /), & 1829 ! count = (/ nxr-nxl+1, & 1830 ! nyn-nys+2, nis, 1 & 1831 ! /) ) 1832 ! ELSEIF ( nxr == nx .AND. nyn == ny ) THEN 1833 ! nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1834 ! id_var_do2d(av,if), & 1835 ! local_2d_sections(nxl:nxr+1, & 1836 ! nys:nyn+1,1:nis), & 1837 ! start = (/ nxl+1, nys+1, 1, & 1838 ! do2d_xy_time_count(av) /), & 1839 ! count = (/ nxr-nxl+2, & 1840 ! nyn-nys+2, nis, 1 & 1841 ! /) ) 1842 ! ELSE 1920 1843 nc_stat = NF90_PUT_VAR( id_set_xy(av), & 1921 1844 id_var_do2d(av,if), & … … 1927 1850 nyn-nys+1, nis, 1 & 1928 1851 /) ) 1929 ENDIF1852 ! ENDIF 1930 1853 1931 1854 CALL netcdf_handle_error( 'data_output_2d', 55 ) … … 1946 1869 ! 1947 1870 !-- Distribute data over all PEs along y 1948 ngp = ( nxr g-nxlg+1 ) * ( nzt_do-nzb_do+1 ) * ns1871 ngp = ( nxr-nxl+1 ) * ( nzt_do-nzb_do+1 ) * ns 1949 1872 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 1950 CALL MPI_ALLREDUCE( local_2d_sections_l(nxl g,1,nzb_do), &1951 local_2d_sections(nxl g,1,nzb_do), &1873 CALL MPI_ALLREDUCE( local_2d_sections_l(nxl,1,nzb_do), & 1874 local_2d_sections(nxl,1,nzb_do), & 1952 1875 ngp, MPI_REAL, MPI_SUM, comm1dy, & 1953 1876 ierr ) … … 1959 1882 !-- Do not output redundant ghost point data except for the 1960 1883 !-- boundaries of the total domain. 1961 IF ( nxr == nx ) THEN1962 nc_stat = NF90_PUT_VAR( id_set_xz(av), &1963 id_var_do2d(av,if), &1964 local_2d_sections(nxl:nxr+1,1:ns, &1965 nzb_do:nzt_do), &1966 start = (/ nxl+1, 1, 1, &1967 do2d_xz_time_count(av) /), &1968 count = (/ nxr-nxl+2, ns, nzt_do-nzb_do+1, &1969 1 /) )1970 ELSE1884 ! IF ( nxr == nx ) THEN 1885 ! nc_stat = NF90_PUT_VAR( id_set_xz(av), & 1886 ! id_var_do2d(av,if), & 1887 ! local_2d_sections(nxl:nxr+1,1:ns, & 1888 ! nzb_do:nzt_do), & 1889 ! start = (/ nxl+1, 1, 1, & 1890 ! do2d_xz_time_count(av) /), & 1891 ! count = (/ nxr-nxl+2, ns, nzt_do-nzb_do+1, & 1892 ! 1 /) ) 1893 ! ELSE 1971 1894 nc_stat = NF90_PUT_VAR( id_set_xz(av), & 1972 1895 id_var_do2d(av,if), & … … 1977 1900 count = (/ nxr-nxl+1, ns, nzt_do-nzb_do+1, & 1978 1901 1 /) ) 1979 ENDIF1902 ! ENDIF 1980 1903 1981 1904 CALL netcdf_handle_error( 'data_output_2d', 57 ) … … 1996 1919 ! 1997 1920 !-- Distribute data over all PEs along x 1998 ngp = ( nyn g-nysg+1 ) * ( nzt-nzb + 2 ) * ns1921 ngp = ( nyn-nys+1 ) * ( nzt-nzb + 2 ) * ns 1999 1922 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 2000 CALL MPI_ALLREDUCE( local_2d_sections_l(1,nys g,nzb_do), &2001 local_2d_sections(1,nys g,nzb_do), &1923 CALL MPI_ALLREDUCE( local_2d_sections_l(1,nys,nzb_do), & 1924 local_2d_sections(1,nys,nzb_do), & 2002 1925 ngp, MPI_REAL, MPI_SUM, comm1dx, & 2003 1926 ierr ) … … 2009 1932 !-- Do not output redundant ghost point data except for the 2010 1933 !-- boundaries of the total domain. 2011 IF ( nyn == ny ) THEN2012 nc_stat = NF90_PUT_VAR( id_set_yz(av), &2013 id_var_do2d(av,if), &2014 local_2d_sections(1:ns, &2015 nys:nyn+1,nzb_do:nzt_do), &2016 start = (/ 1, nys+1, 1, &2017 do2d_yz_time_count(av) /), &2018 count = (/ ns, nyn-nys+2, &2019 nzt_do-nzb_do+1, 1 /) )2020 ELSE1934 ! IF ( nyn == ny ) THEN 1935 ! nc_stat = NF90_PUT_VAR( id_set_yz(av), & 1936 ! id_var_do2d(av,if), & 1937 ! local_2d_sections(1:ns, & 1938 ! nys:nyn+1,nzb_do:nzt_do), & 1939 ! start = (/ 1, nys+1, 1, & 1940 ! do2d_yz_time_count(av) /), & 1941 ! count = (/ ns, nyn-nys+2, & 1942 ! nzt_do-nzb_do+1, 1 /) ) 1943 ! ELSE 2021 1944 nc_stat = NF90_PUT_VAR( id_set_yz(av), & 2022 1945 id_var_do2d(av,if), & … … 2027 1950 count = (/ ns, nyn-nys+1, & 2028 1951 nzt_do-nzb_do+1, 1 /) ) 2029 ENDIF1952 ! ENDIF 2030 1953 2031 1954 CALL netcdf_handle_error( 'data_output_2d', 60 ) -
palm/trunk/SOURCE/data_output_3d.f90
r2292 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! upper bounds of 3d output changed from nx+1,ny+1 to nx,ny 28 ! no output of ghost layer data 29 ! 30 ! 2292 2017-06-20 09:51:42Z schwenkel 27 31 ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' 28 32 ! includes two more prognostic equations for cloud drop concentration (nc) … … 178 182 179 183 USE indices, & 180 ONLY: nbgp, nx, nxl, nx lg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nzb184 ONLY: nbgp, nx, nxl, nxr, ny, nyn, nys, nzb 181 185 182 186 USE kinds … … 241 245 ! 242 246 !-- Open output file. 243 !-- Also creates coordinate and fld-file for AVS. 244 !-- For classic or 64bit netCDF output or output of other (old) data formats, 245 !-- for a run on more than one PE, each PE opens its own file and 246 !-- writes the data of its subdomain in binary format (regardless of the format 247 !-- the user has requested). After the run, these files are combined to one 248 !-- file by combine_plot_fields in the format requested by the user (netcdf 249 !-- and/or avs). 247 !-- For classic or 64bit netCDF output on more than one PE, each PE opens its 248 !-- own file and writes the data of its subdomain in binary format. After the 249 !-- run, these files are combined to one NetCDF file by combine_plot_fields. 250 250 !-- For netCDF4/HDF5 output, data is written in parallel into one file. 251 251 IF ( netcdf_data_format < 5 ) THEN … … 314 314 ! 315 315 !-- Allocate a temporary array with the desired output dimensions. 316 ALLOCATE( local_pf(nxl g:nxrg,nysg:nyng,nzb_do:nzt_do) )316 ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) ) 317 317 318 318 SELECT CASE ( trimvar ) … … 359 359 IF ( simulated_time >= particle_advection_start ) THEN 360 360 tend = prt_count 361 CALL exchange_horiz( tend, nbgp )362 361 ELSE 363 362 tend = 0.0_wp 364 363 ENDIF 365 DO i = nxl g, nxrg366 DO j = nys g, nyng364 DO i = nxl, nxr 365 DO j = nys, nyn 367 366 DO k = nzb_do, nzt_do 368 367 local_pf(i,j,k) = tend(k,j,i) … … 372 371 resorted = .TRUE. 373 372 ELSE 374 CALL exchange_horiz( pc_av, nbgp )375 373 to_be_resorted => pc_av 376 374 ENDIF … … 404 402 ENDDO 405 403 ENDDO 406 CALL exchange_horiz( tend, nbgp )407 404 ELSE 408 405 tend = 0.0_wp 409 406 ENDIF 410 DO i = nxl g, nxrg411 DO j = nys g, nyng407 DO i = nxl, nxr 408 DO j = nys, nyn 412 409 DO k = nzb_do, nzt_do 413 410 local_pf(i,j,k) = tend(k,j,i) … … 417 414 resorted = .TRUE. 418 415 ELSE 419 CALL exchange_horiz( pr_av, nbgp )420 416 to_be_resorted => pr_av 421 417 ENDIF … … 423 419 CASE ( 'prr' ) 424 420 IF ( av == 0 ) THEN 425 CALL exchange_horiz( prr, nbgp ) 426 DO i = nxlg, nxrg 427 DO j = nysg, nyng 421 DO i = nxl, nxr 422 DO j = nys, nyn 428 423 DO k = nzb_do, nzt_do 429 424 local_pf(i,j,k) = prr(k,j,i) … … 432 427 ENDDO 433 428 ELSE 434 CALL exchange_horiz( prr_av, nbgp ) 435 DO i = nxlg, nxrg 436 DO j = nysg, nyng 429 DO i = nxl, nxr 430 DO j = nys, nyn 437 431 DO k = nzb_do, nzt_do 438 432 local_pf(i,j,k) = prr_av(k,j,i) … … 448 442 to_be_resorted => pt 449 443 ELSE 450 DO i = nxl g, nxrg451 DO j = nys g, nyng444 DO i = nxl, nxr 445 DO j = nys, nyn 452 446 DO k = nzb_do, nzt_do 453 447 local_pf(i,j,k) = pt(k,j,i) + l_d_cp * & … … 517 511 ENDDO 518 512 ENDDO 519 CALL exchange_horiz( tend, nbgp )520 513 ELSE 521 514 tend = 0.0_wp 522 515 ENDIF 523 DO i = nxl g, nxrg524 DO j = nys g, nyng516 DO i = nxl, nxr 517 DO j = nys, nyn 525 518 DO k = nzb_do, nzt_do 526 519 local_pf(i,j,k) = tend(k,j,i) … … 530 523 resorted = .TRUE. 531 524 ELSE 532 CALL exchange_horiz( ql_vp_av, nbgp )533 525 to_be_resorted => ql_vp_av 534 526 ENDIF … … 543 535 CASE ( 'qv' ) 544 536 IF ( av == 0 ) THEN 545 DO i = nxl g, nxrg546 DO j = nys g, nyng537 DO i = nxl, nxr 538 DO j = nys, nyn 547 539 DO k = nzb_do, nzt_do 548 540 local_pf(i,j,k) = q(k,j,i) - ql(k,j,i) … … 620 612 621 613 DEALLOCATE ( local_pf ) 622 ALLOCATE( local_pf(nxl g:nxrg,nysg:nyng,nzb_do:nzt_do) )614 ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) ) 623 615 624 616 CALL lsm_data_output_3d( av, do3d(av,if), found, local_pf ) … … 632 624 633 625 DEALLOCATE ( local_pf ) 634 ALLOCATE( local_pf(nxl g:nxrg,nysg:nyng,nzb_do:nzt_do) )626 ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) ) 635 627 ENDIF 636 628 … … 672 664 !-- Resort the array to be output, if not done above 673 665 IF ( .NOT. resorted ) THEN 674 DO i = nxl g, nxrg675 DO j = nys g, nyng666 DO i = nxl, nxr 667 DO j = nys, nyn 676 668 DO k = nzb_do, nzt_do 677 669 local_pf(i,j,k) = to_be_resorted(k,j,i) … … 695 687 DO i = 0, io_blocks-1 696 688 IF ( i == io_group ) THEN 697 WRITE ( 30 ) nxl g, nxrg, nysg, nyng, nzb_do, nzt_do689 WRITE ( 30 ) nxl, nxr, nys, nyn, nzb_do, nzt_do 698 690 WRITE ( 30 ) local_pf(:,:,nzb_do:nzt_do) 699 691 ENDIF … … 707 699 ! 708 700 !-- Parallel output in netCDF4/HDF5 format. 709 !-- Do not output redundant ghost point data except for the 710 !-- boundaries of the total domain. 711 IF ( nxr == nx .AND. nyn /= ny ) THEN 712 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 713 local_pf(nxl:nxr+1,nys:nyn,nzb_do:nzt_do), & 714 start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /), & 715 count = (/ nxr-nxl+2, nyn-nys+1, nzt_do-nzb_do+1, 1 /) ) 716 ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN 717 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 718 local_pf(nxl:nxr,nys:nyn+1,nzb_do:nzt_do), & 719 start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /), & 720 count = (/ nxr-nxl+1, nyn-nys+2, nzt_do-nzb_do+1, 1 /) ) 721 ELSEIF ( nxr == nx .AND. nyn == ny ) THEN 722 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 723 local_pf(nxl:nxr+1,nys:nyn+1,nzb_do:nzt_do ), & 724 start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /), & 725 count = (/ nxr-nxl+2, nyn-nys+2, nzt_do-nzb_do+1, 1 /) ) 726 ELSE 701 ! IF ( nxr == nx .AND. nyn /= ny ) THEN 702 ! nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 703 ! local_pf(nxl:nxr+1,nys:nyn,nzb_do:nzt_do), & 704 ! start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /), & 705 ! count = (/ nxr-nxl+2, nyn-nys+1, nzt_do-nzb_do+1, 1 /) ) 706 ! ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN 707 ! nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 708 ! local_pf(nxl:nxr,nys:nyn+1,nzb_do:nzt_do), & 709 ! start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /), & 710 ! count = (/ nxr-nxl+1, nyn-nys+2, nzt_do-nzb_do+1, 1 /) ) 711 ! ELSEIF ( nxr == nx .AND. nyn == ny ) THEN 712 ! nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 713 ! local_pf(nxl:nxr+1,nys:nyn+1,nzb_do:nzt_do ), & 714 ! start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /), & 715 ! count = (/ nxr-nxl+2, nyn-nys+2, nzt_do-nzb_do+1, 1 /) ) 716 ! ELSE 727 717 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if), & 728 718 local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do), & 729 719 start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /), & 730 720 count = (/ nxr-nxl+1, nyn-nys+1, nzt_do-nzb_do+1, 1 /) ) 731 ENDIF721 ! ENDIF 732 722 CALL netcdf_handle_error( 'data_output_3d', 386 ) 733 723 #endif … … 738 728 local_pf(nxl:nxr+1,nys:nyn+1,nzb_do:nzt_do), & 739 729 start = (/ 1, 1, 1, do3d_time_count(av) /), & 740 count = (/ nx+ 2, ny+2, nzt_do-nzb_do+1, 1 /) )730 count = (/ nx+1, ny+1, nzt_do-nzb_do+1, 1 /) ) 741 731 CALL netcdf_handle_error( 'data_output_3d', 446 ) 742 732 #endif -
palm/trunk/SOURCE/land_surface_model_mod.f90
r2504 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! upper bounds of cross section and 3d output changed from nx+1,ny+1 to nx,ny 28 ! no output of ghost layer data 29 ! 30 ! 2504 2017-09-27 10:36:13Z maronga 27 31 ! Support roots and water under pavement. Added several pavement types. 28 32 ! … … 3886 3890 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 3887 3891 3888 REAL(wp), DIMENSION(nxl g:nxrg,nysg:nyng,nzb:nzt+1) :: local_pf !<3892 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< 3889 3893 3890 3894 … … 3903 3907 ENDDO 3904 3908 ELSE 3905 DO i = nxl g, nxrg3906 DO j = nys g, nyng3909 DO i = nxl, nxr 3910 DO j = nys, nyn 3907 3911 local_pf(i,j,nzb+1) = c_liq_av(j,i) 3908 3912 ENDDO … … 3921 3925 ENDDO 3922 3926 ELSE 3923 DO i = nxl g, nxrg3924 DO j = nys g, nyng3927 DO i = nxl, nxr 3928 DO j = nys, nyn 3925 3929 local_pf(i,j,nzb+1) = c_soil_av(j,i) 3926 3930 ENDDO … … 3939 3943 ENDDO 3940 3944 ELSE 3941 DO i = nxl g, nxrg3942 DO j = nys g, nyng3945 DO i = nxl, nxr 3946 DO j = nys, nyn 3943 3947 local_pf(i,j,nzb+1) = c_veg_av(j,i) 3944 3948 ENDDO … … 3957 3961 ENDDO 3958 3962 ELSE 3959 DO i = nxl g, nxrg3960 DO j = nys g, nyng3963 DO i = nxl, nxr 3964 DO j = nys, nyn 3961 3965 local_pf(i,j,nzb+1) = ghf_av(j,i) 3962 3966 ENDDO … … 3975 3979 ENDDO 3976 3980 ELSE 3977 DO i = nxl g, nxrg3978 DO j = nys g, nyng3981 DO i = nxl, nxr 3982 DO j = nys, nyn 3979 3983 local_pf(i,j,nzb+1) = lai_av(j,i) 3980 3984 ENDDO … … 3993 3997 ENDDO 3994 3998 ELSE 3995 DO i = nxl g, nxrg3996 DO j = nys g, nyng3999 DO i = nxl, nxr 4000 DO j = nys, nyn 3997 4001 local_pf(i,j,nzb+1) = m_liq_av(j,i) 3998 4002 ENDDO … … 4013 4017 ENDDO 4014 4018 ELSE 4015 DO i = nxl g, nxrg4016 DO j = nys g, nyng4019 DO i = nxl, nxr 4020 DO j = nys, nyn 4017 4021 DO k = nzb_soil, nzt_soil 4018 4022 local_pf(i,j,k) = m_soil_av(k,j,i) … … 4035 4039 ENDDO 4036 4040 ELSE 4037 DO i = nxl g, nxrg4038 DO j = nys g, nyng4041 DO i = nxl, nxr 4042 DO j = nys, nyn 4039 4043 local_pf(i,j,nzb+1) = qsws_liq_av(j,i) 4040 4044 ENDDO … … 4053 4057 ENDDO 4054 4058 ELSE 4055 DO i = nxl g, nxrg4056 DO j = nys g, nyng4059 DO i = nxl, nxr 4060 DO j = nys, nyn 4057 4061 local_pf(i,j,nzb+1) = qsws_soil_av(j,i) 4058 4062 ENDDO … … 4071 4075 ENDDO 4072 4076 ELSE 4073 DO i = nxl g, nxrg4074 DO j = nys g, nyng4077 DO i = nxl, nxr 4078 DO j = nys, nyn 4075 4079 local_pf(i,j,nzb+1) = qsws_veg_av(j,i) 4076 4080 ENDDO … … 4090 4094 ENDDO 4091 4095 ELSE 4092 DO i = nxl g, nxrg4093 DO j = nys g, nyng4096 DO i = nxl, nxr 4097 DO j = nys, nyn 4094 4098 local_pf(i,j,nzb+1) = r_a_av(j,i) 4095 4099 ENDDO … … 4108 4112 ENDDO 4109 4113 ELSE 4110 DO i = nxl g, nxrg4111 DO j = nys g, nyng4114 DO i = nxl, nxr 4115 DO j = nys, nyn 4112 4116 local_pf(i,j,nzb+1) = r_s_av(j,i) 4113 4117 ENDDO … … 4128 4132 ENDDO 4129 4133 ELSE 4130 DO i = nxl g, nxrg4131 DO j = nys g, nyng4134 DO i = nxl, nxr 4135 DO j = nys, nyn 4132 4136 DO k = nzb_soil, nzt_soil 4133 4137 local_pf(i,j,k) = t_soil_av(k,j,i) … … 4177 4181 LOGICAL :: found !< 4178 4182 4179 REAL(sp), DIMENSION(nxl g:nxrg,nysg:nyng,nzb_soil:nzt_soil) :: local_pf !<4183 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_soil:nzt_soil) :: local_pf !< 4180 4184 4181 4185 -
palm/trunk/SOURCE/netcdf_interface_mod.f90
r2302 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! upper bounds of cross section and 3d output changed from nx+1,ny+1 to nx,ny 28 ! no output of ghost layer data any more 29 ! 30 ! 2302 2017-07-03 14:07:20Z suehring 27 31 ! Reading of 3D topography using NetCDF data type NC_BYTE 28 32 ! … … 1307 1311 ! 1308 1312 !-- Define x-axis (for scalar position) 1309 CALL netcdf_create_dim( id_set_3d(av), 'x', nx+ 2, id_dim_x_3d(av), &1313 CALL netcdf_create_dim( id_set_3d(av), 'x', nx+1, id_dim_x_3d(av), & 1310 1314 73 ) 1311 1315 CALL netcdf_create_var( id_set_3d(av), (/ id_dim_x_3d(av) /), 'x', & … … 1314 1318 ! 1315 1319 !-- Define x-axis (for u position) 1316 CALL netcdf_create_dim( id_set_3d(av), 'xu', nx+ 2, id_dim_xu_3d(av), &1320 CALL netcdf_create_dim( id_set_3d(av), 'xu', nx+1, id_dim_xu_3d(av), & 1317 1321 358 ) 1318 1322 CALL netcdf_create_var( id_set_3d(av), (/ id_dim_xu_3d(av) /), 'xu', & … … 1321 1325 ! 1322 1326 !-- Define y-axis (for scalar position) 1323 CALL netcdf_create_dim( id_set_3d(av), 'y', ny+ 2, id_dim_y_3d(av), &1327 CALL netcdf_create_dim( id_set_3d(av), 'y', ny+1, id_dim_y_3d(av), & 1324 1328 76 ) 1325 1329 CALL netcdf_create_var( id_set_3d(av), (/ id_dim_y_3d(av) /), 'y', & … … 1328 1332 ! 1329 1333 !-- Define y-axis (for v position) 1330 CALL netcdf_create_dim( id_set_3d(av), 'yv', ny+ 2, id_dim_yv_3d(av), &1334 CALL netcdf_create_dim( id_set_3d(av), 'yv', ny+1, id_dim_yv_3d(av), & 1331 1335 361 ) 1332 1336 CALL netcdf_create_var( id_set_3d(av), (/ id_dim_yv_3d(av) /), 'yv', & … … 1537 1541 ! 1538 1542 !-- Write data for x (shifted by +dx/2) and xu axis 1539 ALLOCATE( netcdf_data(0:nx +1) )1540 1541 DO i = 0, nx +11543 ALLOCATE( netcdf_data(0:nx) ) 1544 1545 DO i = 0, nx 1542 1546 netcdf_data(i) = ( i + 0.5 ) * dx 1543 1547 ENDDO … … 1545 1549 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_x_3d(av), & 1546 1550 netcdf_data, start = (/ 1 /), & 1547 count = (/ nx+ 2/) )1551 count = (/ nx+1 /) ) 1548 1552 CALL netcdf_handle_error( 'netcdf_define_header', 83 ) 1549 1553 1550 DO i = 0, nx +11554 DO i = 0, nx 1551 1555 netcdf_data(i) = i * dx 1552 1556 ENDDO … … 1554 1558 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_xu_3d(av), & 1555 1559 netcdf_data, start = (/ 1 /), & 1556 count = (/ nx+ 2/) )1560 count = (/ nx+1 /) ) 1557 1561 CALL netcdf_handle_error( 'netcdf_define_header', 385 ) 1558 1562 … … 1561 1565 ! 1562 1566 !-- Write data for y (shifted by +dy/2) and yv axis 1563 ALLOCATE( netcdf_data(0:ny +1) )1564 1565 DO i = 0, ny +11567 ALLOCATE( netcdf_data(0:ny) ) 1568 1569 DO i = 0, ny 1566 1570 netcdf_data(i) = ( i + 0.5_wp ) * dy 1567 1571 ENDDO … … 1569 1573 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_y_3d(av), & 1570 1574 netcdf_data, start = (/ 1 /), & 1571 count = (/ ny+ 2/) )1575 count = (/ ny+1 /) ) 1572 1576 CALL netcdf_handle_error( 'netcdf_define_header', 84 ) 1573 1577 1574 DO i = 0, ny +11578 DO i = 0, ny 1575 1579 netcdf_data(i) = i * dy 1576 1580 ENDDO … … 1578 1582 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_yv_3d(av), & 1579 1583 netcdf_data, start = (/ 1 /), & 1580 count = (/ ny+ 2/))1584 count = (/ ny+1 /)) 1581 1585 CALL netcdf_handle_error( 'netcdf_define_header', 387 ) 1582 1586 … … 1612 1616 netcdf_data_format > 4 ) THEN 1613 1617 1614 IF ( nxr == nx .AND. nyn /= ny ) THEN1615 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av), &1616 zu_s_inner(nxl:nxr+1,nys:nyn), &1617 start = (/ nxl+1, nys+1 /), &1618 count = (/ nxr-nxl+2, nyn-nys+1 /) )1619 ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN1620 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av), &1621 zu_s_inner(nxl:nxr,nys:nyn+1), &1622 start = (/ nxl+1, nys+1 /), &1623 count = (/ nxr-nxl+1, nyn-nys+2 /) )1624 ELSEIF ( nxr == nx .AND. nyn == ny ) THEN1625 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av), &1626 zu_s_inner(nxl:nxr+1,nys:nyn+1), &1627 start = (/ nxl+1, nys+1 /), &1628 count = (/ nxr-nxl+2, nyn-nys+2 /) )1629 ELSE1618 ! IF ( nxr == nx .AND. nyn /= ny ) THEN 1619 ! nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av), & 1620 ! zu_s_inner(nxl:nxr+1,nys:nyn), & 1621 ! start = (/ nxl+1, nys+1 /), & 1622 ! count = (/ nxr-nxl+2, nyn-nys+1 /) ) 1623 ! ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN 1624 ! nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av), & 1625 ! zu_s_inner(nxl:nxr,nys:nyn+1), & 1626 ! start = (/ nxl+1, nys+1 /), & 1627 ! count = (/ nxr-nxl+1, nyn-nys+2 /) ) 1628 ! ELSEIF ( nxr == nx .AND. nyn == ny ) THEN 1629 ! nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av), & 1630 ! zu_s_inner(nxl:nxr+1,nys:nyn+1), & 1631 ! start = (/ nxl+1, nys+1 /), & 1632 ! count = (/ nxr-nxl+2, nyn-nys+2 /) ) 1633 ! ELSE 1630 1634 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zusi_3d(av), & 1631 1635 zu_s_inner(nxl:nxr,nys:nyn), & 1632 1636 start = (/ nxl+1, nys+1 /), & 1633 1637 count = (/ nxr-nxl+1, nyn-nys+1 /) ) 1634 ENDIF1638 ! ENDIF 1635 1639 CALL netcdf_handle_error( 'netcdf_define_header', 419 ) 1636 1640 1637 IF ( nxr == nx .AND. nyn /= ny ) THEN1638 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av), &1639 zw_w_inner(nxl:nxr+1,nys:nyn), &1640 start = (/ nxl+1, nys+1 /), &1641 count = (/ nxr-nxl+2, nyn-nys+1 /) )1642 ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN1643 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av), &1644 zw_w_inner(nxl:nxr,nys:nyn+1), &1645 start = (/ nxl+1, nys+1 /), &1646 count = (/ nxr-nxl+1, nyn-nys+2 /) )1647 ELSEIF ( nxr == nx .AND. nyn == ny ) THEN1648 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av), &1649 zw_w_inner(nxl:nxr+1,nys:nyn+1), &1650 start = (/ nxl+1, nys+1 /), &1651 count = (/ nxr-nxl+2, nyn-nys+2 /) )1652 ELSE1641 ! IF ( nxr == nx .AND. nyn /= ny ) THEN 1642 ! nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av), & 1643 ! zw_w_inner(nxl:nxr+1,nys:nyn), & 1644 ! start = (/ nxl+1, nys+1 /), & 1645 ! count = (/ nxr-nxl+2, nyn-nys+1 /) ) 1646 ! ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN 1647 ! nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av), & 1648 ! zw_w_inner(nxl:nxr,nys:nyn+1), & 1649 ! start = (/ nxl+1, nys+1 /), & 1650 ! count = (/ nxr-nxl+1, nyn-nys+2 /) ) 1651 ! ELSEIF ( nxr == nx .AND. nyn == ny ) THEN 1652 ! nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av), & 1653 ! zw_w_inner(nxl:nxr+1,nys:nyn+1), & 1654 ! start = (/ nxl+1, nys+1 /), & 1655 ! count = (/ nxr-nxl+2, nyn-nys+2 /) ) 1656 ! ELSE 1653 1657 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_zwwi_3d(av), & 1654 1658 zw_w_inner(nxl:nxr,nys:nyn), & 1655 1659 start = (/ nxl+1, nys+1 /), & 1656 1660 count = (/ nxr-nxl+1, nyn-nys+1 /) ) 1657 ENDIF1661 ! ENDIF 1658 1662 CALL netcdf_handle_error( 'netcdf_define_header', 420 ) 1659 1663 … … 1961 1965 ! 1962 1966 !-- Define x-axis (for scalar position) 1963 CALL netcdf_create_dim( id_set_xy(av), 'x', nx+ 2, id_dim_x_xy(av), &1967 CALL netcdf_create_dim( id_set_xy(av), 'x', nx+1, id_dim_x_xy(av), & 1964 1968 113 ) 1965 1969 CALL netcdf_create_var( id_set_xy(av), (/ id_dim_x_xy(av) /), 'x', & … … 1968 1972 ! 1969 1973 !-- Define x-axis (for u position) 1970 CALL netcdf_create_dim( id_set_xy(av), 'xu', nx+ 2, &1974 CALL netcdf_create_dim( id_set_xy(av), 'xu', nx+1, & 1971 1975 id_dim_xu_xy(av), 388 ) 1972 1976 CALL netcdf_create_var( id_set_xy(av), (/ id_dim_xu_xy(av) /), 'xu', & … … 1975 1979 ! 1976 1980 !-- Define y-axis (for scalar position) 1977 CALL netcdf_create_dim( id_set_xy(av), 'y', ny+ 2, id_dim_y_xy(av), &1981 CALL netcdf_create_dim( id_set_xy(av), 'y', ny+1, id_dim_y_xy(av), & 1978 1982 116 ) 1979 1983 CALL netcdf_create_var( id_set_xy(av), (/ id_dim_y_xy(av) /), 'y', & … … 1982 1986 ! 1983 1987 !-- Define y-axis (for scalar position) 1984 CALL netcdf_create_dim( id_set_xy(av), 'yv', ny+ 2, &1988 CALL netcdf_create_dim( id_set_xy(av), 'yv', ny+1, & 1985 1989 id_dim_yv_xy(av), 364 ) 1986 1990 CALL netcdf_create_var( id_set_xy(av), (/ id_dim_yv_xy(av) /), 'yv', & … … 2255 2259 ! 2256 2260 !-- Write data for x (shifted by +dx/2) and xu axis 2257 ALLOCATE( netcdf_data(0:nx +1) )2258 2259 DO i = 0, nx +12261 ALLOCATE( netcdf_data(0:nx) ) 2262 2263 DO i = 0, nx 2260 2264 netcdf_data(i) = ( i + 0.5_wp ) * dx 2261 2265 ENDDO … … 2263 2267 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_x_xy(av), & 2264 2268 netcdf_data, start = (/ 1 /), & 2265 count = (/ nx+ 2/) )2269 count = (/ nx+1 /) ) 2266 2270 CALL netcdf_handle_error( 'netcdf_define_header', 127 ) 2267 2271 2268 DO i = 0, nx +12272 DO i = 0, nx 2269 2273 netcdf_data(i) = i * dx 2270 2274 ENDDO … … 2272 2276 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_xu_xy(av), & 2273 2277 netcdf_data, start = (/ 1 /), & 2274 count = (/ nx+ 2/) )2278 count = (/ nx+1 /) ) 2275 2279 CALL netcdf_handle_error( 'netcdf_define_header', 367 ) 2276 2280 … … 2281 2285 ALLOCATE( netcdf_data(0:ny+1) ) 2282 2286 2283 DO i = 0, ny +12287 DO i = 0, ny 2284 2288 netcdf_data(i) = ( i + 0.5_wp ) * dy 2285 2289 ENDDO … … 2287 2291 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_y_xy(av), & 2288 2292 netcdf_data, start = (/ 1 /), & 2289 count = (/ ny+ 2/))2293 count = (/ ny+1 /)) 2290 2294 CALL netcdf_handle_error( 'netcdf_define_header', 128 ) 2291 2295 2292 DO i = 0, ny +12296 DO i = 0, ny 2293 2297 netcdf_data(i) = i * dy 2294 2298 ENDDO … … 2296 2300 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_yv_xy(av), & 2297 2301 netcdf_data, start = (/ 1 /), & 2298 count = (/ ny+ 2/))2302 count = (/ ny+1 /)) 2299 2303 CALL netcdf_handle_error( 'netcdf_define_header', 368 ) 2300 2304 … … 2309 2313 netcdf_data_format > 4 ) THEN 2310 2314 2311 IF ( nxr == nx .AND. nyn /= ny ) THEN2312 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av), &2313 zu_s_inner(nxl:nxr+1,nys:nyn), &2314 start = (/ nxl+1, nys+1 /), &2315 count = (/ nxr-nxl+2, nyn-nys+1 /) )2316 ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN2317 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av), &2318 zu_s_inner(nxl:nxr,nys:nyn+1), &2319 start = (/ nxl+1, nys+1 /), &2320 count = (/ nxr-nxl+1, nyn-nys+2 /) )2321 ELSEIF ( nxr == nx .AND. nyn == ny ) THEN2322 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av), &2323 zu_s_inner(nxl:nxr+1,nys:nyn+1), &2324 start = (/ nxl+1, nys+1 /), &2325 count = (/ nxr-nxl+2, nyn-nys+2 /) )2326 ELSE2315 ! IF ( nxr == nx .AND. nyn /= ny ) THEN 2316 ! nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av), & 2317 ! zu_s_inner(nxl:nxr+1,nys:nyn), & 2318 ! start = (/ nxl+1, nys+1 /), & 2319 ! count = (/ nxr-nxl+2, nyn-nys+1 /) ) 2320 ! ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN 2321 ! nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av), & 2322 ! zu_s_inner(nxl:nxr,nys:nyn+1), & 2323 ! start = (/ nxl+1, nys+1 /), & 2324 ! count = (/ nxr-nxl+1, nyn-nys+2 /) ) 2325 ! ELSEIF ( nxr == nx .AND. nyn == ny ) THEN 2326 ! nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av), & 2327 ! zu_s_inner(nxl:nxr+1,nys:nyn+1), & 2328 ! start = (/ nxl+1, nys+1 /), & 2329 ! count = (/ nxr-nxl+2, nyn-nys+2 /) ) 2330 ! ELSE 2327 2331 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zusi_xy(av), & 2328 2332 zu_s_inner(nxl:nxr,nys:nyn), & 2329 2333 start = (/ nxl+1, nys+1 /), & 2330 2334 count = (/ nxr-nxl+1, nyn-nys+1 /) ) 2331 ENDIF2335 ! ENDIF 2332 2336 CALL netcdf_handle_error( 'netcdf_define_header', 427 ) 2333 2337 2334 IF ( nxr == nx .AND. nyn /= ny ) THEN2335 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av), &2336 zw_w_inner(nxl:nxr+1,nys:nyn), &2337 start = (/ nxl+1, nys+1 /), &2338 count = (/ nxr-nxl+2, nyn-nys+1 /) )2339 ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN2340 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av), &2341 zw_w_inner(nxl:nxr,nys:nyn+1), &2342 start = (/ nxl+1, nys+1 /), &2343 count = (/ nxr-nxl+1, nyn-nys+2 /) )2344 ELSEIF ( nxr == nx .AND. nyn == ny ) THEN2345 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av), &2346 zw_w_inner(nxl:nxr+1,nys:nyn+1), &2347 start = (/ nxl+1, nys+1 /), &2348 count = (/ nxr-nxl+2, nyn-nys+2 /) )2349 ELSE2338 ! IF ( nxr == nx .AND. nyn /= ny ) THEN 2339 ! nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av), & 2340 ! zw_w_inner(nxl:nxr+1,nys:nyn), & 2341 ! start = (/ nxl+1, nys+1 /), & 2342 ! count = (/ nxr-nxl+2, nyn-nys+1 /) ) 2343 ! ELSEIF ( nxr /= nx .AND. nyn == ny ) THEN 2344 ! nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av), & 2345 ! zw_w_inner(nxl:nxr,nys:nyn+1), & 2346 ! start = (/ nxl+1, nys+1 /), & 2347 ! count = (/ nxr-nxl+1, nyn-nys+2 /) ) 2348 ! ELSEIF ( nxr == nx .AND. nyn == ny ) THEN 2349 ! nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av), & 2350 ! zw_w_inner(nxl:nxr+1,nys:nyn+1), & 2351 ! start = (/ nxl+1, nys+1 /), & 2352 ! count = (/ nxr-nxl+2, nyn-nys+2 /) ) 2353 ! ELSE 2350 2354 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_zwwi_xy(av), & 2351 2355 zw_w_inner(nxl:nxr,nys:nyn), & 2352 2356 start = (/ nxl+1, nys+1 /), & 2353 2357 count = (/ nxr-nxl+1, nyn-nys+1 /) ) 2354 ENDIF2358 ! ENDIF 2355 2359 CALL netcdf_handle_error( 'netcdf_define_header', 428 ) 2356 2360 … … 2684 2688 ! 2685 2689 !-- Define x-axis (for scalar position) 2686 CALL netcdf_create_dim( id_set_xz(av), 'x', nx+ 2, id_dim_x_xz(av), &2690 CALL netcdf_create_dim( id_set_xz(av), 'x', nx+1, id_dim_x_xz(av), & 2687 2691 150 ) 2688 2692 CALL netcdf_create_var( id_set_xz(av), (/ id_dim_x_xz(av) /), 'x', & … … 2691 2695 ! 2692 2696 !-- Define x-axis (for u position) 2693 CALL netcdf_create_dim( id_set_xz(av), 'xu', nx+ 2, id_dim_xu_xz(av), &2697 CALL netcdf_create_dim( id_set_xz(av), 'xu', nx+1, id_dim_xu_xz(av), & 2694 2698 372 ) 2695 2699 CALL netcdf_create_var( id_set_xz(av), (/ id_dim_xu_xz(av) /), 'xu', & … … 2940 2944 ! 2941 2945 !-- Write data for x (shifted by +dx/2) and xu axis 2942 ALLOCATE( netcdf_data(0:nx +1) )2943 2944 DO i = 0, nx +12946 ALLOCATE( netcdf_data(0:nx) ) 2947 2948 DO i = 0, nx 2945 2949 netcdf_data(i) = ( i + 0.5_wp ) * dx 2946 2950 ENDDO … … 2948 2952 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_x_xz(av), & 2949 2953 netcdf_data, start = (/ 1 /), & 2950 count = (/ nx+ 2/) )2954 count = (/ nx+1 /) ) 2951 2955 CALL netcdf_handle_error( 'netcdf_define_header', 165 ) 2952 2956 2953 DO i = 0, nx +12957 DO i = 0, nx 2954 2958 netcdf_data(i) = i * dx 2955 2959 ENDDO … … 2957 2961 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_xu_xz(av), & 2958 2962 netcdf_data, start = (/ 1 /), & 2959 count = (/ nx+ 2/) )2963 count = (/ nx+1 /) ) 2960 2964 CALL netcdf_handle_error( 'netcdf_define_header', 377 ) 2961 2965 … … 3337 3341 ! 3338 3342 !-- Define y-axis (for scalar position) 3339 CALL netcdf_create_dim( id_set_yz(av), 'y', ny+ 2, id_dim_y_yz(av), &3343 CALL netcdf_create_dim( id_set_yz(av), 'y', ny+1, id_dim_y_yz(av), & 3340 3344 189 ) 3341 3345 CALL netcdf_create_var( id_set_yz(av), (/ id_dim_y_yz(av) /), 'y', & … … 3344 3348 ! 3345 3349 !-- Define y-axis (for v position) 3346 CALL netcdf_create_dim( id_set_yz(av), 'yv', ny+ 2, id_dim_yv_yz(av), &3350 CALL netcdf_create_dim( id_set_yz(av), 'yv', ny+1, id_dim_yv_yz(av), & 3347 3351 380 ) 3348 3352 CALL netcdf_create_var( id_set_yz(av), (/ id_dim_yv_yz(av) /), 'yv', & … … 3592 3596 ! 3593 3597 !-- Write data for y (shifted by +dy/2) and yv axis 3594 ALLOCATE( netcdf_data(0:ny +1) )3595 3596 DO j = 0, ny +13598 ALLOCATE( netcdf_data(0:ny) ) 3599 3600 DO j = 0, ny 3597 3601 netcdf_data(j) = ( j + 0.5_wp ) * dy 3598 3602 ENDDO … … 3600 3604 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_y_yz(av), & 3601 3605 netcdf_data, start = (/ 1 /), & 3602 count = (/ ny+ 2/) )3606 count = (/ ny+1 /) ) 3603 3607 CALL netcdf_handle_error( 'netcdf_define_header', 204 ) 3604 3608 3605 DO j = 0, ny +13609 DO j = 0, ny 3606 3610 netcdf_data(j) = j * dy 3607 3611 ENDDO … … 3609 3613 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_yv_yz(av), & 3610 3614 netcdf_data, start = (/ 1 /), & 3611 count = (/ ny+ 2/) )3615 count = (/ ny+1 /) ) 3612 3616 CALL netcdf_handle_error( 'netcdf_define_header', 384 ) 3613 3617 -
palm/trunk/SOURCE/palm.f90
r2320 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! user interface required revision updated 28 ! 29 ! 2320 2017-07-21 12:47:43Z suehring 27 30 ! Modularize large-scale forcing and nudging 28 31 ! … … 237 240 238 241 version = 'PALM 4.0' 239 user_interface_required_revision = 'r2 297'242 user_interface_required_revision = 'r2512' 240 243 241 244 #if defined( __parallel ) -
palm/trunk/SOURCE/plant_canopy_model_mod.f90
r2318 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! upper bounds of 3d output changed from nx+1,ny+1 to nx,ny 28 ! no output of ghost layer data 29 ! 30 ! 2318 2017-07-20 17:27:44Z suehring 27 31 ! Get topography top index via Function call 28 32 ! … … 356 360 LOGICAL :: found !< 357 361 358 REAL(sp), DIMENSION(nxl g:nxrg,nysg:nyng,nzb:nz_do3d) :: local_pf !<362 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb:nz_do3d) :: local_pf !< 359 363 360 364 … … 365 369 366 370 CASE ( 'pcm_heatrate' ) 367 CALL exchange_horiz( pc_heating_rate, nbgp )368 371 IF ( av == 0 ) THEN 369 DO i = nxl g, nxrg370 DO j = nys g, nyng372 DO i = nxl, nxr 373 DO j = nys, nyn 371 374 DO k = nzb_s_inner(j,i), nz_do3d 372 375 local_pf(i,j,k) = pc_heating_rate(k-nzb_s_inner(j,i),j,i) … … 379 382 CASE ( 'pcm_lad' ) 380 383 IF ( av == 0 ) THEN 381 DO i = nxl g, nxrg382 DO j = nys g, nyng384 DO i = nxl, nxr 385 DO j = nys, nyn 383 386 DO k = nzb_s_inner(j,i), nz_do3d 384 387 local_pf(i,j,k) = lad_s(k-nzb_s_inner(j,i),j,i) -
palm/trunk/SOURCE/radiation_model_mod.f90
r2504 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! upper bounds of cross section and 3d output changed from nx+1,ny+1 to nx,ny 28 ! no output of ghost layer data 29 ! 30 ! 2504 2017-09-27 10:36:13Z maronga 27 31 ! Updates pavement types and albedo parameters 28 32 ! … … 2810 2814 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 2811 2815 2812 REAL(wp), DIMENSION(nxl g:nxrg,nysg:nyng,nzb:nzt+1) :: local_pf !<2816 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< 2813 2817 2814 2818 found = .TRUE. … … 2818 2822 CASE ( 'rad_net*_xy' ) ! 2d-array 2819 2823 IF ( av == 0 ) THEN 2820 DO i = nxl g, nxrg2821 DO j = nys g, nyng2824 DO i = nxl, nxr 2825 DO j = nys, nyn 2822 2826 local_pf(i,j,nzb+1) = rad_net(j,i) 2823 2827 ENDDO 2824 2828 ENDDO 2825 2829 ELSE 2826 DO i = nxl g, nxrg2827 DO j = nys g, nyng2830 DO i = nxl, nxr 2831 DO j = nys, nyn 2828 2832 local_pf(i,j,nzb+1) = rad_net_av(j,i) 2829 2833 ENDDO … … 2836 2840 CASE ( 'rad_lw_in_xy', 'rad_lw_in_xz', 'rad_lw_in_yz' ) 2837 2841 IF ( av == 0 ) THEN 2838 DO i = nxl g, nxrg2839 DO j = nys g, nyng2842 DO i = nxl, nxr 2843 DO j = nys, nyn 2840 2844 DO k = nzb, nzt+1 2841 2845 local_pf(i,j,k) = rad_lw_in(k,j,i) … … 2844 2848 ENDDO 2845 2849 ELSE 2846 DO i = nxl g, nxrg2847 DO j = nys g, nyng2850 DO i = nxl, nxr 2851 DO j = nys, nyn 2848 2852 DO k = nzb, nzt+1 2849 2853 local_pf(i,j,k) = rad_lw_in_av(k,j,i) … … 2856 2860 CASE ( 'rad_lw_out_xy', 'rad_lw_out_xz', 'rad_lw_out_yz' ) 2857 2861 IF ( av == 0 ) THEN 2858 DO i = nxl g, nxrg2859 DO j = nys g, nyng2862 DO i = nxl, nxr 2863 DO j = nys, nyn 2860 2864 DO k = nzb, nzt+1 2861 2865 local_pf(i,j,k) = rad_lw_out(k,j,i) … … 2864 2868 ENDDO 2865 2869 ELSE 2866 DO i = nxl g, nxrg2867 DO j = nys g, nyng2870 DO i = nxl, nxr 2871 DO j = nys, nyn 2868 2872 DO k = nzb, nzt+1 2869 2873 local_pf(i,j,k) = rad_lw_out_av(k,j,i) … … 2876 2880 CASE ( 'rad_lw_cs_hr_xy', 'rad_lw_cs_hr_xz', 'rad_lw_cs_hr_yz' ) 2877 2881 IF ( av == 0 ) THEN 2878 DO i = nxl g, nxrg2879 DO j = nys g, nyng2882 DO i = nxl, nxr 2883 DO j = nys, nyn 2880 2884 DO k = nzb, nzt+1 2881 2885 local_pf(i,j,k) = rad_lw_cs_hr(k,j,i) … … 2884 2888 ENDDO 2885 2889 ELSE 2886 DO i = nxl g, nxrg2887 DO j = nys g, nyng2890 DO i = nxl, nxr 2891 DO j = nys, nyn 2888 2892 DO k = nzb, nzt+1 2889 2893 local_pf(i,j,k) = rad_lw_cs_hr_av(k,j,i) … … 2896 2900 CASE ( 'rad_lw_hr_xy', 'rad_lw_hr_xz', 'rad_lw_hr_yz' ) 2897 2901 IF ( av == 0 ) THEN 2898 DO i = nxl g, nxrg2899 DO j = nys g, nyng2902 DO i = nxl, nxr 2903 DO j = nys, nyn 2900 2904 DO k = nzb, nzt+1 2901 2905 local_pf(i,j,k) = rad_lw_hr(k,j,i) … … 2904 2908 ENDDO 2905 2909 ELSE 2906 DO i = nxl g, nxrg2907 DO j = nys g, nyng2910 DO i = nxl, nxr 2911 DO j = nys, nyn 2908 2912 DO k = nzb, nzt+1 2909 2913 local_pf(i,j,k) = rad_lw_hr_av(k,j,i) … … 2916 2920 CASE ( 'rad_sw_in_xy', 'rad_sw_in_xz', 'rad_sw_in_yz' ) 2917 2921 IF ( av == 0 ) THEN 2918 DO i = nxl g, nxrg2919 DO j = nys g, nyng2922 DO i = nxl, nxr 2923 DO j = nys, nyn 2920 2924 DO k = nzb, nzt+1 2921 2925 local_pf(i,j,k) = rad_sw_in(k,j,i) … … 2924 2928 ENDDO 2925 2929 ELSE 2926 DO i = nxl g, nxrg2927 DO j = nys g, nyng2930 DO i = nxl, nxr 2931 DO j = nys, nyn 2928 2932 DO k = nzb, nzt+1 2929 2933 local_pf(i,j,k) = rad_sw_in_av(k,j,i) … … 2936 2940 CASE ( 'rad_sw_out_xy', 'rad_sw_out_xz', 'rad_sw_out_yz' ) 2937 2941 IF ( av == 0 ) THEN 2938 DO i = nxl g, nxrg2939 DO j = nys g, nyng2942 DO i = nxl, nxr 2943 DO j = nys, nyn 2940 2944 DO k = nzb, nzt+1 2941 2945 local_pf(i,j,k) = rad_sw_out(k,j,i) … … 2944 2948 ENDDO 2945 2949 ELSE 2946 DO i = nxl g, nxrg2947 DO j = nys g, nyng2950 DO i = nxl, nxr 2951 DO j = nys, nyn 2948 2952 DO k = nzb, nzt+1 2949 2953 local_pf(i,j,k) = rad_sw_out_av(k,j,i) … … 2956 2960 CASE ( 'rad_sw_cs_hr_xy', 'rad_sw_cs_hr_xz', 'rad_sw_cs_hr_yz' ) 2957 2961 IF ( av == 0 ) THEN 2958 DO i = nxl g, nxrg2959 DO j = nys g, nyng2962 DO i = nxl, nxr 2963 DO j = nys, nyn 2960 2964 DO k = nzb, nzt+1 2961 2965 local_pf(i,j,k) = rad_sw_cs_hr(k,j,i) … … 2964 2968 ENDDO 2965 2969 ELSE 2966 DO i = nxl g, nxrg2967 DO j = nys g, nyng2970 DO i = nxl, nxr 2971 DO j = nys, nyn 2968 2972 DO k = nzb, nzt+1 2969 2973 local_pf(i,j,k) = rad_sw_cs_hr_av(k,j,i) … … 2976 2980 CASE ( 'rad_sw_hr_xy', 'rad_sw_hr_xz', 'rad_sw_hr_yz' ) 2977 2981 IF ( av == 0 ) THEN 2978 DO i = nxl g, nxrg2979 DO j = nys g, nyng2982 DO i = nxl, nxr 2983 DO j = nys, nyn 2980 2984 DO k = nzb, nzt+1 2981 2985 local_pf(i,j,k) = rad_sw_hr(k,j,i) … … 2984 2988 ENDDO 2985 2989 ELSE 2986 DO i = nxl g, nxrg2987 DO j = nys g, nyng2990 DO i = nxl, nxr 2991 DO j = nys, nyn 2988 2992 DO k = nzb, nzt+1 2989 2993 local_pf(i,j,k) = rad_sw_hr_av(k,j,i) … … 3028 3032 LOGICAL :: found !< 3029 3033 3030 REAL(sp), DIMENSION(nxl g:nxrg,nysg:nyng,nzb:nzt+1) :: local_pf !<3034 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< 3031 3035 3032 3036 … … 3038 3042 CASE ( 'rad_sw_in' ) 3039 3043 IF ( av == 0 ) THEN 3040 DO i = nxl g, nxrg3041 DO j = nys g, nyng3044 DO i = nxl, nxr 3045 DO j = nys, nyn 3042 3046 DO k = nzb, nzt+1 3043 3047 local_pf(i,j,k) = rad_sw_in(k,j,i) … … 3046 3050 ENDDO 3047 3051 ELSE 3048 DO i = nxl g, nxrg3049 DO j = nys g, nyng3052 DO i = nxl, nxr 3053 DO j = nys, nyn 3050 3054 DO k = nzb, nzt+1 3051 3055 local_pf(i,j,k) = rad_sw_in_av(k,j,i) … … 3057 3061 CASE ( 'rad_sw_out' ) 3058 3062 IF ( av == 0 ) THEN 3059 DO i = nxl g, nxrg3060 DO j = nys g, nyng3063 DO i = nxl, nxr 3064 DO j = nys, nyn 3061 3065 DO k = nzb, nzt+1 3062 3066 local_pf(i,j,k) = rad_sw_out(k,j,i) … … 3065 3069 ENDDO 3066 3070 ELSE 3067 DO i = nxl g, nxrg3068 DO j = nys g, nyng3071 DO i = nxl, nxr 3072 DO j = nys, nyn 3069 3073 DO k = nzb, nzt+1 3070 3074 local_pf(i,j,k) = rad_sw_out_av(k,j,i) … … 3076 3080 CASE ( 'rad_sw_cs_hr' ) 3077 3081 IF ( av == 0 ) THEN 3078 DO i = nxl g, nxrg3079 DO j = nys g, nyng3082 DO i = nxl, nxr 3083 DO j = nys, nyn 3080 3084 DO k = nzb, nzt+1 3081 3085 local_pf(i,j,k) = rad_sw_cs_hr(k,j,i) … … 3084 3088 ENDDO 3085 3089 ELSE 3086 DO i = nxl g, nxrg3087 DO j = nys g, nyng3090 DO i = nxl, nxr 3091 DO j = nys, nyn 3088 3092 DO k = nzb, nzt+1 3089 3093 local_pf(i,j,k) = rad_sw_cs_hr_av(k,j,i) … … 3095 3099 CASE ( 'rad_sw_hr' ) 3096 3100 IF ( av == 0 ) THEN 3097 DO i = nxl g, nxrg3098 DO j = nys g, nyng3101 DO i = nxl, nxr 3102 DO j = nys, nyn 3099 3103 DO k = nzb, nzt+1 3100 3104 local_pf(i,j,k) = rad_sw_hr(k,j,i) … … 3103 3107 ENDDO 3104 3108 ELSE 3105 DO i = nxl g, nxrg3106 DO j = nys g, nyng3109 DO i = nxl, nxr 3110 DO j = nys, nyn 3107 3111 DO k = nzb, nzt+1 3108 3112 local_pf(i,j,k) = rad_sw_hr_av(k,j,i) … … 3114 3118 CASE ( 'rad_lw_in' ) 3115 3119 IF ( av == 0 ) THEN 3116 DO i = nxl g, nxrg3117 DO j = nys g, nyng3120 DO i = nxl, nxr 3121 DO j = nys, nyn 3118 3122 DO k = nzb, nzt+1 3119 3123 local_pf(i,j,k) = rad_lw_in(k,j,i) … … 3122 3126 ENDDO 3123 3127 ELSE 3124 DO i = nxl g, nxrg3125 DO j = nys g, nyng3128 DO i = nxl, nxr 3129 DO j = nys, nyn 3126 3130 DO k = nzb, nzt+1 3127 3131 local_pf(i,j,k) = rad_lw_in_av(k,j,i) … … 3133 3137 CASE ( 'rad_lw_out' ) 3134 3138 IF ( av == 0 ) THEN 3135 DO i = nxl g, nxrg3136 DO j = nys g, nyng3139 DO i = nxl, nxr 3140 DO j = nys, nyn 3137 3141 DO k = nzb, nzt+1 3138 3142 local_pf(i,j,k) = rad_lw_out(k,j,i) … … 3141 3145 ENDDO 3142 3146 ELSE 3143 DO i = nxl g, nxrg3144 DO j = nys g, nyng3147 DO i = nxl, nxr 3148 DO j = nys, nyn 3145 3149 DO k = nzb, nzt+1 3146 3150 local_pf(i,j,k) = rad_lw_out_av(k,j,i) … … 3152 3156 CASE ( 'rad_lw_cs_hr' ) 3153 3157 IF ( av == 0 ) THEN 3154 DO i = nxl g, nxrg3155 DO j = nys g, nyng3158 DO i = nxl, nxr 3159 DO j = nys, nyn 3156 3160 DO k = nzb, nzt+1 3157 3161 local_pf(i,j,k) = rad_lw_cs_hr(k,j,i) … … 3160 3164 ENDDO 3161 3165 ELSE 3162 DO i = nxl g, nxrg3163 DO j = nys g, nyng3166 DO i = nxl, nxr 3167 DO j = nys, nyn 3164 3168 DO k = nzb, nzt+1 3165 3169 local_pf(i,j,k) = rad_lw_cs_hr_av(k,j,i) … … 3171 3175 CASE ( 'rad_lw_hr' ) 3172 3176 IF ( av == 0 ) THEN 3173 DO i = nxl g, nxrg3174 DO j = nys g, nyng3177 DO i = nxl, nxr 3178 DO j = nys, nyn 3175 3179 DO k = nzb, nzt+1 3176 3180 local_pf(i,j,k) = rad_lw_hr(k,j,i) … … 3179 3183 ENDDO 3180 3184 ELSE 3181 DO i = nxl g, nxrg3182 DO j = nys g, nyng3185 DO i = nxl, nxr 3186 DO j = nys, nyn 3183 3187 DO k = nzb, nzt+1 3184 3188 local_pf(i,j,k) = rad_lw_hr_av(k,j,i) -
palm/trunk/SOURCE/urban_surface_mod.f90
r2350 r2512 26 26 ! ----------------- 27 27 ! $Id$ 28 ! upper bounds of 3d output changed from nx+1,ny+1 to nx,ny 29 ! no output of ghost layer data 30 ! 31 ! 2350 2017-08-15 11:48:26Z kanani 28 32 ! Bugfix and error message for nopointer version. 29 33 ! Additional "! defined(__nopointer)" as workaround to enable compilation of … … 2424 2428 INTEGER(iwp), INTENT(IN) :: nzt_do !< vertical upper limit of the data output (usually nz_do3d) 2425 2429 LOGICAL, INTENT(OUT) :: found !< 2426 REAL(sp), DIMENSION(nxl g:nxrg,nysg:nyng,nzb_do:nzt_do) :: local_pf !< sp - it has to correspond to module data_output_3d2427 REAL(wp), DIMENSION(nzb:nzt+1,nys g:nyng,nxlg:nxrg) :: temp_pf !< temp array for urban surface output procedure2430 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< sp - it has to correspond to module data_output_3d 2431 REAL(wp), DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) :: temp_pf !< temp array for urban surface output procedure 2428 2432 2429 2433 CHARACTER (len=varnamelength) :: var, surfid … … 2900 2904 2901 2905 END SELECT 2902 2903 !-- fill out array local_pf which is subsequently treated by data_output_3d 2904 CALL exchange_horiz( temp_pf, nbgp ) 2905 ! 2906 !-- To Do: why reversed loop order 2907 DO j = nysg,nyng 2908 DO i = nxlg,nxrg 2909 DO k = nzb_do, nzt_do 2906 ! 2907 !-- Rearrange dimensions for NetCDF output 2908 DO j = nys, nyn 2909 DO i = nxl, nxr 2910 DO k = nzb_do, nzt_do 2910 2911 local_pf(i,j,k) = temp_pf(k,j,i) 2911 2912 ENDDO -
palm/trunk/SOURCE/user_data_output_2d.f90
r2233 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ghost layer points removed from output array local_pf 28 ! 29 ! 2233 2017-05-30 18:08:54Z suehring 27 30 ! 28 31 ! 2232 2017-05-30 17:47:52Z suehring … … 85 88 LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) 86 89 87 REAL(wp), DIMENSION(nxl g:nxrg,nysg:nyng,nzb:nzt+1) :: local_pf !<90 REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb:nzt+1) :: local_pf !< 88 91 89 92 … … 99 102 ! CASE ( 'u2_xy', 'u2_xz', 'u2_yz' ) 100 103 ! IF ( av == 0 ) THEN 101 ! DO i = nxl g, nxrg102 ! DO j = nys g, nyng104 ! DO i = nxl, nxr 105 ! DO j = nys, nyn 103 106 ! DO k = nzb_do, nzt_do 104 107 ! local_pf(i,j,k) = u2(k,j,i) … … 107 110 ! ENDDO 108 111 ! ELSE 109 ! DO i = nxl g, nxrg110 ! DO j = nys g, nyng112 ! DO i = nxl, nxr 113 ! DO j = nys, nyn 111 114 ! DO k = nzb_do, nzt_do 112 115 ! local_pf(i,j,k) = u2_av(k,j,i) … … 118 121 ! grid = 'zu' 119 122 ! 120 !-- In case two-dimensional surface variables are output ted, the user123 !-- In case two-dimensional surface variables are output, the user 121 124 !-- has to access related surface-type. Uncomment and extend following lines 122 125 !-- appropriately (example output of vertical surface momentum flux of u- … … 160 163 161 164 END SUBROUTINE user_data_output_2d 162 -
palm/trunk/SOURCE/user_data_output_3d.f90
r2101 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ghost layer points removed from output array local_pf 28 ! 29 ! 2101 2017-01-05 16:42:31Z suehring 27 30 ! 28 31 ! 2000 2016-08-20 18:09:15Z knoop … … 78 81 LOGICAL :: found !< 79 82 80 REAL(sp), DIMENSION(nxl g:nxrg,nysg:nyng,nzb_do:nzt_do) :: local_pf !<83 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< 81 84 82 85 … … 92 95 ! CASE ( 'u2' ) 93 96 ! IF ( av == 0 ) THEN 94 ! DO i = nxl g, nxrg95 ! DO j = nys g, nyng97 ! DO i = nxl, nxr 98 ! DO j = nys, nyn 96 99 ! DO k = nzb_do, nzt_do 97 100 ! local_pf(i,j,k) = u2(k,j,i) … … 100 103 ! ENDDO 101 104 ! ELSE 102 ! DO i = nxl g, nxrg103 ! DO j = nys g, nyng105 ! DO i = nxl, nxr 106 ! DO j = nys, nyn 104 107 ! DO k = nzb_do, nzt_do 105 108 ! local_pf(i,j,k) = u2_av(k,j,i) -
palm/trunk/SOURCE/user_parin.f90
r2298 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! current interface revision number number set to r2512 28 ! 29 ! 2298 2017-06-29 09:28:18Z raasch 27 30 ! user interface current revision updated 28 31 ! … … 102 105 !-- current revision does not match with previous revisions (e.g. if routines 103 106 !-- have been added/deleted or if parameter lists in subroutines have been changed). 104 user_interface_current_revision = 'r2 297'107 user_interface_current_revision = 'r2512' 105 108 106 109 ! -
palm/trunk/UTIL/combine_plot_fields.f90
r2365 r2512 25 25 ! ----------------- 26 26 ! $Id$ 27 ! PALM output does not contain ghost layer data any more 28 ! avs- and iso2d-related parts removed, handling of compressed data removed 29 ! 30 ! 2365 2017-08-21 14:59:59Z kanani 27 31 ! Vertical grid nesting implemented (SadiqHuq) 28 32 ! … … 121 125 INTEGER(iwp), DIMENSION(0:1,1000) :: id_var, levels 122 126 123 LOGICAL :: avs_output, compressed, found, iso2d_output, netcdf_output, & 124 netcdf_parallel, netcdf_0, netcdf_1 127 LOGICAL :: found, netcdf_output, netcdf_parallel, netcdf_0, netcdf_1 125 128 LOGICAL :: vnest 126 129 127 130 REAL(wp) :: cpu_start_time, cpu_end_time, dx, simulated_time 128 REAL(wp), DIMENSION(:), ALLOCATABLE :: eta, ho, hu129 131 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: pf, pf_tmp 130 132 REAL(spk), DIMENSION(:,:,:), ALLOCATABLE :: pf3d, pf3d_tmp … … 227 229 228 230 ! 229 !-- Inquire whether an iso2d parameter file exists230 INQUIRE( FILE='PLOT2D_'//modus//'_GLOBAL'//TRIM( model_string ), &231 EXIST=iso2d_output )232 233 !234 231 !-- Inquire whether a NetCDF file exists 235 232 INQUIRE( FILE='DATA_2D_'//modus//'_NETCDF'//TRIM( model_string ), & … … 387 384 !-- File from PE0 contains special information at the beginning, 388 385 !-- concerning the lower and upper indices of the total-domain 389 !-- used in PALM (nxag, nxeg, nyag, nyeg) and the lower and 390 !-- upper indices of the array to be written by this routine 391 !-- (nxa, nxe, nya, nye). Usually in the horizontal directions 392 !-- nxag=-1 and nxa=0 while all other variables have the same 393 !-- value (i.e. nxeg=nxe). 386 !-- used in PALM (nxa, nxe, nya, nye). 394 387 !-- Allocate necessary arrays, open the output file and write 395 388 !-- the coordinate informations needed by ISO2D. 396 389 IF ( id == 0 .AND. fanz(0) == 0 .AND. fanz(1) == 0 ) THEN 397 READ ( id+110 ) nxag, nxeg, nyag, nyeg 390 398 391 READ ( id+110 ) nxa, nxe, nya, nye 399 ALLOCATE ( eta(nya:nye), ho(nxa:nxe), hu(nxa:nxe), & 400 pf(nxag:nxeg,nyag:nyeg) ) 401 READ ( id+110 ) dx, eta, hu, ho 402 403 392 ALLOCATE ( pf(nxa:nxe,nya:nye) ) 404 393 ! 405 394 !-- Set actual domain bounds to total domain … … 407 396 ye_do = nye 408 397 409 IF ( iso2d_output ) THEN410 OPEN ( 2, FILE='PLOT2D_'//modus//TRIM( model_string ),&411 FORM='UNFORMATTED' )412 WRITE ( 2 ) dx, eta, hu, ho413 ENDIF414 398 ENDIF 415 399 ! 416 400 !-- Read output time 417 401 IF ( netcdf_output .AND. id == 0 ) THEN 418 IF ( netcdf_1 ) THEN 419 READ ( id+110, END=998 ) simulated_time, time_step, av 420 ELSE 421 ! 422 !-- For compatibility with earlier PALM versions 423 READ ( id+110, END=998 ) simulated_time, time_step 424 av = 0 425 ENDIF 402 READ ( id+110, END=998 ) simulated_time, time_step, av 426 403 ENDIF 427 404 ! … … 460 437 ENDDO 461 438 ! 462 !-- Write the data of the total domain cross-section 463 IF ( iso2d_output ) WRITE ( 2 ) pf(nxa:nxe,nya:nye) 464 465 ! 466 !-- Write same data in NetCDF format 439 !-- Write data in NetCDF format 467 440 IF ( netcdf_output ) THEN 468 441 #if defined( __netcdf ) … … 544 517 ENDDO 545 518 CLOSE ( 2 ) 546 DEALLOCATE ( eta, ho, hu,pf )519 DEALLOCATE ( pf ) 547 520 548 521 ! … … 598 571 CALL SYSTEM_CLOCK( count, count_rate ) 599 572 cpu_start_time = REAL( count ) / REAL( count_rate ) 600 601 !602 !-- Inquire whether an avs fld file exists603 INQUIRE( FILE='PLOT3D_FLD'//TRIM( model_string ), EXIST=avs_output )604 573 605 574 ! … … 639 608 640 609 ! 641 !-- Combination only works, if data are not compressed. In that case,642 !-- PALM created a flag file (PLOT3D_COMPRESSED)643 INQUIRE ( FILE='PLOT3D_COMPRESSED'//TRIM( model_string ), &644 EXIST=compressed )645 646 !647 610 !-- Find out the number of files and open them 648 DO WHILE ( found .AND. .NOT. compressed)611 DO WHILE ( found ) 649 612 650 613 OPEN ( danz+110, & … … 678 641 PRINT*, ' 3D-data: ', danz, ' file(s) found' 679 642 ELSE 680 IF ( found .AND. compressed ) THEN 681 PRINT*, '+++ no 3D-data processing, since data are compressed' 682 ELSE 683 PRINT*, ' no 3D-data file available' 684 ENDIF 643 PRINT*, ' no 3D-data file available' 685 644 ENDIF 686 645 ENDIF … … 764 723 DO id = 0, danz-1 765 724 ! 766 !-- File from PE0 contains special information at the beginning, 767 !-- concerning the lower and upper indices of the total-domain used 768 !-- in PALM (nxag, nxeg, nyag, nyeg) and the lower and 769 !-- upper indices of the array to be written by this routine (nxa, 770 !-- nxe, nya, nye, nza, nze). Usually nxag=-1 and nxa=0, nyag=-1 771 !-- and nya=0, nzeg=nz and nze=nz_do3d. 772 !-- Allocate necessary array and open the output file. 725 !-- File from PE0 contains at the beginning the index bounds 726 !-- of PALM's total domain. 727 !-- Allocate the array for storing the total domain data 773 728 IF ( id == 0 .AND. fanz(0) == 0 .AND. fanz(1) == 0 ) THEN 774 READ ( id+110 ) nxag, nxeg, nyag, nyeg729 ! READ ( id+110 ) nxag, nxeg, nyag, nyeg 775 730 READ ( id+110 ) nxa, nxe, nya, nye, nza, nze 776 731 ALLOCATE ( pf3d(nxa:nxe,nya:nye,nza:nze) ) 777 IF ( avs_output ) THEN778 OPEN ( 2, FILE='PLOT3D_DATA'//TRIM( model_string ), &779 FORM='UNFORMATTED' )780 ENDIF781 732 ENDIF 782 733 … … 818 769 819 770 ! 820 !-- Write data of the total domain 821 IF ( avs_output ) WRITE ( 2 ) pf3d(nxa:nxe,nya:nye,nza:nze) 822 823 ! 824 !-- Write same data in NetCDF format 771 !-- Write data of the total domain in NetCDF format 825 772 IF ( netcdf_output ) THEN 826 773 #if defined( __netcdf )
Note: See TracChangeset
for help on using the changeset viewer.