Changeset 4517 for palm/trunk/SOURCE/radiation_model_mod.f90
- Timestamp:
- May 3, 2020 2:29:30 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/radiation_model_mod.f90
r4495 r4517 28 28 ! ----------------- 29 29 ! $Id$ 30 ! added restart with MPI-IO for reading local arrays 31 ! 32 ! 4495 2020-04-13 20:11:20Z raasch 30 33 ! restart data handling with MPI-IO added 31 34 ! … … 364 367 #endif 365 368 USE restart_data_mpi_io_mod, & 366 ONLY: wrd_mpi_io369 ONLY: rd_mpi_io_check_array, rrd_mpi_io, wrd_mpi_io 367 370 368 371 USE statistics, & … … 971 974 972 975 INTERFACE radiation_rrd_local 973 MODULE PROCEDURE radiation_rrd_local 976 MODULE PROCEDURE radiation_rrd_local_ftn 977 MODULE PROCEDURE radiation_rrd_local_mpi 974 978 END INTERFACE radiation_rrd_local 975 979 … … 12080 12084 ! Description: 12081 12085 ! ------------ 12082 !> Subroutine reads local (subdomain) restart data12086 !> Read module-specific local restart data arrays (Fortran binary format). 12083 12087 !------------------------------------------------------------------------------! 12084 SUBROUTINE radiation_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, &12085 nxr_on_file, nynf, nync, nyn_on_file, nysf, &12086 nysc, nys_on_file, tmp_2d, tmp_3d, found )12088 SUBROUTINE radiation_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 12089 nxr_on_file, nynf, nync, nyn_on_file, nysf, & 12090 nysc, nys_on_file, tmp_2d, tmp_3d, found ) 12087 12091 12088 12092 … … 12428 12432 END SELECT 12429 12433 12430 END SUBROUTINE radiation_rrd_local 12431 12434 END SUBROUTINE radiation_rrd_local_ftn 12435 12436 12437 !------------------------------------------------------------------------------! 12438 ! Description: 12439 ! ------------ 12440 !> Read module-specific local restart data arrays (MPI-IO). 12441 !------------------------------------------------------------------------------! 12442 SUBROUTINE radiation_rrd_local_mpi 12443 12444 USE control_parameters 12445 12446 USE indices 12447 12448 USE kinds 12449 12450 12451 IMPLICIT NONE 12452 12453 LOGICAL :: array_found !< 12454 12455 REAL(wp), DIMENSION(nysg:nyng,nxlg:nxrg) :: tmp !< temporary array for reading from file 12456 12457 12458 CALL rd_mpi_io_check_array( 'rad_net_av' , found = array_found ) 12459 IF ( array_found ) THEN 12460 IF ( .NOT. ALLOCATED( rad_net_av ) ) ALLOCATE( rad_net_av(nysg:nyng,nxlg:nxrg) ) 12461 CALL rrd_mpi_io( 'rad_net_av', rad_net_av ) 12462 ENDIF 12463 12464 CALL rd_mpi_io_check_array( 'rad_lw_in_xy_av' , found = array_found ) 12465 IF ( array_found ) THEN 12466 IF ( .NOT. ALLOCATED( rad_lw_in_xy_av ) ) ALLOCATE( rad_lw_in_xy_av(nysg:nyng,nxlg:nxrg) ) 12467 CALL rrd_mpi_io( 'rad_lw_in_xy_av', rad_lw_in_xy_av ) 12468 ENDIF 12469 12470 CALL rd_mpi_io_check_array( 'rad_lw_out_xy_av' , found = array_found ) 12471 IF ( array_found ) THEN 12472 IF ( .NOT. ALLOCATED( rad_lw_out_xy_av ) ) ALLOCATE( rad_lw_out_xy_av(nysg:nyng,nxlg:nxrg) ) 12473 CALL rrd_mpi_io( 'rad_lw_out_xy_av', rad_lw_out_xy_av ) 12474 ENDIF 12475 12476 CALL rd_mpi_io_check_array( 'rad_sw_in_xy_av' , found = array_found ) 12477 IF ( array_found ) THEN 12478 IF ( .NOT. ALLOCATED( rad_sw_in_xy_av ) ) ALLOCATE( rad_sw_in_xy_av(nysg:nyng,nxlg:nxrg) ) 12479 CALL rrd_mpi_io( 'rad_sw_in_xy_av', rad_sw_in_xy_av ) 12480 ENDIF 12481 12482 CALL rd_mpi_io_check_array( 'rad_sw_out_xy_av' , found = array_found ) 12483 IF ( array_found ) THEN 12484 IF ( .NOT. ALLOCATED( rad_sw_out_xy_av ) ) ALLOCATE( rad_sw_out_xy_av(nysg:nyng,nxlg:nxrg) ) 12485 CALL rrd_mpi_io( 'rad_sw_out_xy_av', rad_sw_out_xy_av ) 12486 ENDIF 12487 12488 CALL rd_mpi_io_check_array( 'rad_lw_in' , found = array_found ) 12489 IF ( array_found ) THEN 12490 IF ( radiation_scheme == 'clear-sky' .OR. radiation_scheme == 'constant' .OR. & 12491 radiation_scheme == 'external' ) THEN 12492 IF ( .NOT. ALLOCATED( rad_lw_in ) ) ALLOCATE( rad_lw_in(0:0,nysg:nyng,nxlg:nxrg) ) 12493 CALL rrd_mpi_io( 'rad_lw_in', tmp ) 12494 rad_lw_in(0,:,:) = tmp 12495 ELSE 12496 IF ( .NOT. ALLOCATED( rad_lw_in ) ) ALLOCATE( rad_lw_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12497 CALL rrd_mpi_io( 'rad_lw_in', rad_lw_in ) 12498 ENDIF 12499 ENDIF 12500 12501 CALL rd_mpi_io_check_array( 'rad_lw_in_av' , found = array_found ) 12502 IF ( array_found ) THEN 12503 IF ( radiation_scheme == 'clear-sky' .OR. radiation_scheme == 'constant' .OR. & 12504 radiation_scheme == 'external' ) THEN 12505 IF ( .NOT. ALLOCATED( rad_lw_in_av ) ) ALLOCATE( rad_lw_in_av(0:0,nysg:nyng,nxlg:nxrg) ) 12506 CALL rrd_mpi_io( 'rad_lw_in_av', tmp ) 12507 rad_lw_in_av(0,:,:) = tmp 12508 ELSE 12509 IF ( .NOT. ALLOCATED( rad_lw_in_av ) ) ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12510 CALL rrd_mpi_io( 'rad_lw_in_av', rad_lw_in_av ) 12511 ENDIF 12512 ENDIF 12513 12514 CALL rd_mpi_io_check_array( 'rad_lw_out' , found = array_found ) 12515 IF ( array_found ) THEN 12516 IF ( radiation_scheme == 'clear-sky' .OR. radiation_scheme == 'constant' .OR. & 12517 radiation_scheme == 'external' ) THEN 12518 IF ( .NOT. ALLOCATED( rad_lw_out ) ) ALLOCATE( rad_lw_out(0:0,nysg:nyng,nxlg:nxrg) ) 12519 CALL rrd_mpi_io( 'rad_lw_out', tmp ) 12520 rad_lw_out(0,:,:) = tmp 12521 ELSE 12522 IF ( .NOT. ALLOCATED( rad_lw_out ) ) ALLOCATE( rad_lw_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12523 CALL rrd_mpi_io( 'rad_lw_out', rad_lw_out ) 12524 ENDIF 12525 ENDIF 12526 12527 CALL rd_mpi_io_check_array( 'rad_lw_out_av' , found = array_found ) 12528 IF ( array_found ) THEN 12529 IF ( radiation_scheme == 'clear-sky' .OR. radiation_scheme == 'constant' .OR. & 12530 radiation_scheme == 'external' ) THEN 12531 IF ( .NOT. ALLOCATED( rad_lw_out_av ) ) ALLOCATE( rad_lw_out_av(0:0,nysg:nyng,nxlg:nxrg) ) 12532 CALL rrd_mpi_io( 'rad_lw_out_av', tmp ) 12533 rad_lw_out_av(0,:,:) = tmp 12534 ELSE 12535 IF ( .NOT. ALLOCATED( rad_lw_out_av ) ) ALLOCATE( rad_lw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12536 CALL rrd_mpi_io( 'rad_lw_out_av', rad_lw_out_av ) 12537 ENDIF 12538 ENDIF 12539 12540 CALL rd_mpi_io_check_array( 'rad_lw_cs_hr' , found = array_found ) 12541 IF ( array_found ) THEN 12542 IF ( .NOT. ALLOCATED( rad_lw_cs_hr ) ) ALLOCATE( rad_lw_cs_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12543 CALL rrd_mpi_io( 'rad_lw_cs_hr', rad_lw_cs_hr ) 12544 ENDIF 12545 12546 CALL rd_mpi_io_check_array( 'rad_lw_cs_hr_av' , found = array_found ) 12547 IF ( array_found ) THEN 12548 IF ( .NOT. ALLOCATED( rad_lw_cs_hr_av ) ) ALLOCATE( rad_lw_cs_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12549 CALL rrd_mpi_io( 'rad_lw_cs_hr_av', rad_lw_cs_hr_av ) 12550 ENDIF 12551 12552 CALL rd_mpi_io_check_array( 'rad_lw_hr' , found = array_found ) 12553 IF ( array_found ) THEN 12554 IF ( .NOT. ALLOCATED( rad_lw_hr ) ) ALLOCATE( rad_lw_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12555 CALL rrd_mpi_io( 'rad_lw_hr', rad_lw_hr ) 12556 ENDIF 12557 12558 CALL rd_mpi_io_check_array( 'rad_lw_hr_av' , found = array_found ) 12559 IF ( array_found ) THEN 12560 IF ( .NOT. ALLOCATED( rad_lw_hr_av ) ) ALLOCATE( rad_lw_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12561 CALL rrd_mpi_io( 'rad_lw_hr_av', rad_lw_hr_av ) 12562 ENDIF 12563 12564 CALL rd_mpi_io_check_array( 'rad_sw_in' , found = array_found ) 12565 IF ( array_found ) THEN 12566 IF ( radiation_scheme == 'clear-sky' .OR. radiation_scheme == 'constant' .OR. & 12567 radiation_scheme == 'external' ) THEN 12568 IF ( .NOT. ALLOCATED( rad_sw_in ) ) ALLOCATE( rad_sw_in(0:0,nysg:nyng,nxlg:nxrg) ) 12569 CALL rrd_mpi_io( 'rad_sw_in', tmp ) 12570 rad_sw_in(0,:,:) = tmp 12571 ELSE 12572 IF ( .NOT. ALLOCATED( rad_sw_in ) ) ALLOCATE( rad_sw_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12573 CALL rrd_mpi_io( 'rad_sw_in', rad_sw_in ) 12574 ENDIF 12575 ENDIF 12576 12577 CALL rd_mpi_io_check_array( 'rad_sw_in_av' , found = array_found ) 12578 IF ( array_found ) THEN 12579 IF ( radiation_scheme == 'clear-sky' .OR. radiation_scheme == 'constant' .OR. & 12580 radiation_scheme == 'external' ) THEN 12581 IF ( .NOT. ALLOCATED( rad_sw_in_av ) ) ALLOCATE( rad_sw_in_av(0:0,nysg:nyng,nxlg:nxrg) ) 12582 CALL rrd_mpi_io( 'rad_sw_in_av', tmp ) 12583 rad_sw_in_av(0,:,:) = tmp 12584 ELSE 12585 IF ( .NOT. ALLOCATED( rad_sw_in_av ) ) ALLOCATE( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12586 CALL rrd_mpi_io( 'rad_sw_in_av', rad_sw_in_av ) 12587 ENDIF 12588 ENDIF 12589 12590 CALL rd_mpi_io_check_array( 'rad_sw_out' , found = array_found ) 12591 IF ( array_found ) THEN 12592 IF ( radiation_scheme == 'clear-sky' .OR. radiation_scheme == 'constant' .OR. & 12593 radiation_scheme == 'external' ) THEN 12594 IF ( .NOT. ALLOCATED( rad_sw_out ) ) ALLOCATE( rad_sw_out(0:0,nysg:nyng,nxlg:nxrg) ) 12595 CALL rrd_mpi_io( 'rad_sw_out', tmp) 12596 rad_sw_out(0,:,:) = tmp 12597 ELSE 12598 IF ( .NOT. ALLOCATED( rad_sw_out ) ) ALLOCATE( rad_sw_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12599 CALL rrd_mpi_io( 'rad_sw_out', rad_sw_out ) 12600 ENDIF 12601 ENDIF 12602 12603 CALL rd_mpi_io_check_array( 'rad_sw_out_av' , found = array_found ) 12604 IF ( array_found ) THEN 12605 IF ( radiation_scheme == 'clear-sky' .OR. radiation_scheme == 'constant' .OR. & 12606 radiation_scheme == 'external' ) THEN 12607 IF ( .NOT. ALLOCATED( rad_sw_out_av ) ) ALLOCATE( rad_sw_out_av(0:0,nysg:nyng,nxlg:nxrg) ) 12608 CALL rrd_mpi_io( 'rad_sw_out_av', tmp ) 12609 rad_sw_out_av(0,:,:) = tmp 12610 ELSE 12611 IF ( .NOT. ALLOCATED( rad_sw_out_av ) ) ALLOCATE( rad_sw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12612 CALL rrd_mpi_io( 'rad_sw_out_av', rad_sw_out_av ) 12613 ENDIF 12614 ENDIF 12615 12616 CALL rd_mpi_io_check_array( 'rad_sw_cs_hr' , found = array_found ) 12617 IF ( array_found ) THEN 12618 IF ( .NOT. ALLOCATED( rad_sw_cs_hr ) ) ALLOCATE( rad_sw_cs_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12619 CALL rrd_mpi_io( 'rad_sw_cs_hr', rad_sw_cs_hr ) 12620 ENDIF 12621 12622 CALL rd_mpi_io_check_array( 'rad_sw_cs_hr_av' , found = array_found ) 12623 IF ( array_found ) THEN 12624 IF ( .NOT. ALLOCATED( rad_sw_cs_hr_av ) ) ALLOCATE( rad_sw_cs_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12625 CALL rrd_mpi_io( 'rad_sw_cs_hr_av', rad_sw_cs_hr_av ) 12626 ENDIF 12627 12628 CALL rd_mpi_io_check_array( 'rad_sw_hr' , found = array_found ) 12629 IF ( array_found ) THEN 12630 IF ( .NOT. ALLOCATED( rad_sw_hr ) ) ALLOCATE( rad_sw_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12631 CALL rrd_mpi_io( 'rad_sw_hr', rad_sw_hr ) 12632 ENDIF 12633 12634 CALL rd_mpi_io_check_array( 'rad_sw_hr_av' , found = array_found ) 12635 IF ( array_found ) THEN 12636 IF ( .NOT. ALLOCATED( rad_sw_hr_av ) ) ALLOCATE( rad_sw_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 12637 CALL rrd_mpi_io( 'rad_sw_hr_av', rad_sw_hr_av ) 12638 ENDIF 12639 12640 END SUBROUTINE radiation_rrd_local_mpi 12432 12641 12433 12642 END MODULE radiation_model_mod
Note: See TracChangeset
for help on using the changeset viewer.