Changeset 4517
- Timestamp:
- May 3, 2020 2:29:30 PM (5 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/Makefile
r4513 r4517 25 25 # ----------------- 26 26 # $Id$ 27 # dependencies for MPI-IO added 28 # 29 # 4513 2020-04-30 13:45:47Z raasch 27 30 # dependencies from chemistry modules updated 28 31 # … … 460 463 palm_date_time_mod.o \ 461 464 radiation_model_mod.o \ 465 restart_data_mpi_io_mod.o \ 462 466 surface_mod.o 463 467 chem_gasphase_mod.o: \ -
palm/trunk/SOURCE/biometeorology_mod.f90
r4495 r4517 27 27 ! ----------------- 28 28 ! $Id$ 29 ! added restart with MPI-IO for reading local arrays 30 ! 31 ! 4495 2020-04-13 20:11:20Z raasch 29 32 ! restart data handling with MPI-IO added 30 33 ! … … 365 368 !-- Read local restart parameters 366 369 INTERFACE bio_rrd_local 367 MODULE PROCEDURE bio_rrd_local 370 MODULE PROCEDURE bio_rrd_local_ftn 371 MODULE PROCEDURE bio_rrd_local_mpi 368 372 END INTERFACE bio_rrd_local 369 373 ! … … 1429 1433 ! Description: 1430 1434 ! ------------ 1431 !> Soubroutine reads local biometeorology configuration from restart file(s)1432 !------------------------------------------------------------------------------! 1433 SUBROUTINE bio_rrd_local ( found )1435 !> Read module-specific local restart data arrays (Fortran binary format). 1436 !------------------------------------------------------------------------------! 1437 SUBROUTINE bio_rrd_local_ftn( found ) 1434 1438 1435 1439 … … 1465 1469 1466 1470 1467 END SUBROUTINE bio_rrd_local 1471 END SUBROUTINE bio_rrd_local_ftn 1472 1473 1474 !------------------------------------------------------------------------------! 1475 ! Description: 1476 ! ------------ 1477 !> Read module-specific local restart data arrays (Fortran binary format). 1478 !------------------------------------------------------------------------------! 1479 SUBROUTINE bio_rrd_local_mpi 1480 1481 STOP '+++ reading restart data with MPI-IO not implemented for bio_rrd_local_mpi' 1482 1483 END SUBROUTINE bio_rrd_local_mpi 1484 1468 1485 1469 1486 !------------------------------------------------------------------------------! -
palm/trunk/SOURCE/bulk_cloud_model_mod.f90
r4506 r4517 25 25 ! ----------------- 26 26 ! $Id$ 27 ! added restart with MPI-IO for reading local arrays 28 ! 29 ! 4506 2020-04-21 10:57:45Z schwenkel 27 30 ! Use correct magnus formula for liquid water temperature 28 31 ! … … 183 186 184 187 USE restart_data_mpi_io_mod, & 185 ONLY: r rd_mpi_io, wrd_mpi_io188 ONLY: rd_mpi_io_check_array, rrd_mpi_io, wrd_mpi_io 186 189 187 190 USE statistics, & … … 404 407 405 408 INTERFACE bcm_rrd_local 406 MODULE PROCEDURE bcm_rrd_local 409 MODULE PROCEDURE bcm_rrd_local_ftn 410 MODULE PROCEDURE bcm_rrd_local_mpi 407 411 END INTERFACE bcm_rrd_local 408 412 … … 3397 3401 ! Description: 3398 3402 ! ------------ 3399 !> This routine reads the respective restart data for the bulk cloud module.3400 !------------------------------------------------------------------------------! 3401 SUBROUTINE bcm_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, &3402 nxr_on_file, nynf, nync, nyn_on_file, nysf, &3403 nysc, nys_on_file, tmp_2d, tmp_3d, found )3403 !> Read module-specific local restart data arrays (Fortran binary format). 3404 !------------------------------------------------------------------------------! 3405 SUBROUTINE bcm_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 3406 nxr_on_file, nynf, nync, nyn_on_file, nysf, & 3407 nysc, nys_on_file, tmp_2d, tmp_3d, found ) 3404 3408 3405 3409 … … 3432 3436 REAL(wp), DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_3d !< 3433 3437 3434 !3435 !-- Here the reading of user-defined restart data follows:3436 !-- Sample for user-defined output3437 3438 3438 3439 3439 found = .TRUE. … … 3561 3561 3562 3562 3563 END SUBROUTINE bcm_rrd_local 3563 END SUBROUTINE bcm_rrd_local_ftn 3564 3565 3566 !------------------------------------------------------------------------------! 3567 ! Description: 3568 ! ------------ 3569 !> Read module-specific local restart data arrays (MPI-IO). 3570 !------------------------------------------------------------------------------! 3571 SUBROUTINE bcm_rrd_local_mpi 3572 3573 LOGICAL :: array_found !< 3574 3575 3576 CALL rd_mpi_io_check_array( 'prr' , found = array_found ) 3577 IF ( array_found ) THEN 3578 IF ( .NOT. ALLOCATED( prr ) ) ALLOCATE( prr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3579 CALL rrd_mpi_io( 'prr', prr ) 3580 ENDIF 3581 3582 CALL rd_mpi_io_check_array( 'prr_av' , found = array_found ) 3583 IF ( array_found ) THEN 3584 IF ( .NOT. ALLOCATED( prr_av ) ) ALLOCATE( prr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3585 CALL rrd_mpi_io( 'prr_av', prr_av ) 3586 ENDIF 3587 3588 CALL rd_mpi_io_check_array( 'precipitation_amount' , found = array_found ) 3589 IF ( array_found ) THEN 3590 IF ( .NOT. ALLOCATED( precipitation_amount ) ) THEN 3591 ALLOCATE( precipitation_amount(nysg:nyng,nxlg:nxrg) ) 3592 ENDIF 3593 CALL rrd_mpi_io( 'precipitation_amount', precipitation_amount ) 3594 ENDIF 3595 3596 CALL rrd_mpi_io( 'ql', ql ) 3597 3598 CALL rd_mpi_io_check_array( 'ql_av' , found = array_found ) 3599 IF ( array_found ) THEN 3600 IF ( .NOT. ALLOCATED( ql_av ) ) ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3601 CALL rrd_mpi_io( 'ql_av', ql_av ) 3602 ENDIF 3603 3604 CALL rrd_mpi_io( 'qc', qc ) 3605 3606 CALL rd_mpi_io_check_array( 'qc_av' , found = array_found ) 3607 IF ( array_found ) THEN 3608 IF ( .NOT. ALLOCATED( qc_av ) ) ALLOCATE( qc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3609 CALL rrd_mpi_io( 'qc_av', qc_av ) 3610 ENDIF 3611 3612 IF ( microphysics_morrison ) THEN 3613 3614 CALL rrd_mpi_io( 'nc', nc ) 3615 3616 CALL rd_mpi_io_check_array( 'nc_av' , found = array_found ) 3617 IF ( array_found ) THEN 3618 IF ( .NOT. ALLOCATED( nc_av ) ) ALLOCATE( nc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3619 CALL rrd_mpi_io( 'nc_av', nc_av ) 3620 ENDIF 3621 3622 ENDIF 3623 3624 IF ( microphysics_seifert ) THEN 3625 3626 CALL rrd_mpi_io( 'nr', nr ) 3627 3628 CALL rd_mpi_io_check_array( 'nr_av' , found = array_found ) 3629 IF ( array_found ) THEN 3630 IF ( .NOT. ALLOCATED( nr_av ) ) ALLOCATE( nr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3631 CALL rrd_mpi_io( 'nr_av', nr_av ) 3632 ENDIF 3633 3634 CALL rrd_mpi_io( 'qr', qr ) 3635 3636 CALL rd_mpi_io_check_array( 'qr_av' , found = array_found ) 3637 IF ( array_found ) THEN 3638 IF ( .NOT. ALLOCATED( qr_av ) ) ALLOCATE( qr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3639 CALL rrd_mpi_io( 'qr_av', qr_av ) 3640 ENDIF 3641 3642 ENDIF 3643 3644 IF ( microphysics_ice_extension ) THEN 3645 3646 CALL rrd_mpi_io( 'ni', ni ) 3647 3648 CALL rd_mpi_io_check_array( 'ni_av' , found = array_found ) 3649 IF ( array_found ) THEN 3650 IF ( .NOT. ALLOCATED( ni_av ) ) ALLOCATE( ni_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3651 CALL rrd_mpi_io( 'ni_av', ni_av ) 3652 ENDIF 3653 3654 CALL rrd_mpi_io( 'qi', qi ) 3655 3656 CALL rd_mpi_io_check_array( 'qi_av' , found = array_found ) 3657 IF ( array_found ) THEN 3658 IF ( .NOT. ALLOCATED( qi_av ) ) ALLOCATE( qi_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3659 CALL rrd_mpi_io( 'qi_av', qi_av ) 3660 ENDIF 3661 3662 ENDIF 3663 3664 3665 END SUBROUTINE bcm_rrd_local_mpi 3564 3666 3565 3667 -
palm/trunk/SOURCE/chemistry_model_mod.f90
r4511 r4517 27 27 ! ----------------- 28 28 ! $Id$ 29 ! added restart with MPI-IO 30 ! 31 ! 4511 2020-04-30 12:20:40Z raasch 29 32 ! decycling replaced by explicit setting of lateral boundary conditions 30 33 ! … … 312 315 max_pr_user, & 313 316 monotonic_limiter_z, & 317 restart_data_format_output, & 314 318 scalar_advec, & 315 319 timestep_scheme, use_prescribed_profile_data, ws_scheme_sca, air_chemistry … … 329 333 USE cpulog, & 330 334 ONLY: cpu_log, log_point_s 335 336 USE restart_data_mpi_io_mod, & 337 ONLY: rrd_mpi_io, wrd_mpi_io 331 338 332 339 USE statistics … … 501 508 502 509 INTERFACE chem_rrd_local 503 MODULE PROCEDURE chem_rrd_local 510 MODULE PROCEDURE chem_rrd_local_ftn 511 MODULE PROCEDURE chem_rrd_local_mpi 504 512 END INTERFACE chem_rrd_local 505 513 … … 3042 3050 ! Description: 3043 3051 ! ------------ 3044 !> Subroutine to read restart data of chemical species3045 !------------------------------------------------------------------------------! 3046 SUBROUTINE chem_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, &3047 nxr_on_file, nynf, nync, nyn_on_file, nysf, nysc, &3048 nys_on_file, tmp_3d, found )3052 !> Read module-specific local restart data arrays (Fortran binary format). 3053 !------------------------------------------------------------------------------! 3054 SUBROUTINE chem_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 3055 nxr_on_file, nynf, nync, nyn_on_file, nysf, nysc, & 3056 nys_on_file, tmp_3d, found ) 3049 3057 3050 3058 USE control_parameters … … 3076 3084 3077 3085 3078 IF ( ALLOCATED( chem_species) ) THEN3086 IF ( ALLOCATED( chem_species ) ) THEN 3079 3087 3080 3088 DO lsp = 1, nspec … … 3105 3113 3106 3114 3107 END SUBROUTINE chem_rrd_local 3115 END SUBROUTINE chem_rrd_local_ftn 3116 3117 3118 !------------------------------------------------------------------------------! 3119 ! Description: 3120 ! ------------ 3121 !> Read module-specific local restart data arrays (Fortran binary format). 3122 !------------------------------------------------------------------------------! 3123 SUBROUTINE chem_rrd_local_mpi 3124 3125 IMPLICIT NONE 3126 3127 INTEGER(iwp) :: lsp !< 3128 3129 IF ( ALLOCATED( chem_species ) ) THEN 3130 3131 DO lsp = 1, nspec 3132 3133 CALL rrd_mpi_io( TRIM( chem_species(lsp)%name ), chem_species(lsp)%conc ) 3134 CALL rrd_mpi_io( TRIM( chem_species(lsp)%name )//'_av', chem_species(lsp)%conc_av ) 3135 3136 ENDDO 3137 3138 ENDIF 3139 3140 END SUBROUTINE chem_rrd_local_mpi 3108 3141 3109 3142 … … 3208 3241 INTEGER(iwp) :: lsp !< running index for chem spcs. 3209 3242 3210 DO lsp = 1, nspec 3211 CALL wrd_write_string( TRIM( chem_species(lsp)%name ) ) 3212 WRITE ( 14 ) chem_species(lsp)%conc 3213 CALL wrd_write_string( TRIM( chem_species(lsp)%name )//'_av' ) 3214 WRITE ( 14 ) chem_species(lsp)%conc_av 3215 ENDDO 3243 IF ( TRIM( restart_data_format_output ) == 'fortran_binary' ) THEN 3244 3245 DO lsp = 1, nspec 3246 CALL wrd_write_string( TRIM( chem_species(lsp)%name ) ) 3247 WRITE ( 14 ) chem_species(lsp)%conc 3248 CALL wrd_write_string( TRIM( chem_species(lsp)%name )//'_av' ) 3249 WRITE ( 14 ) chem_species(lsp)%conc_av 3250 ENDDO 3251 3252 ELSEIF ( TRIM( restart_data_format_output ) == 'mpi' ) THEN 3253 3254 DO lsp = 1, nspec 3255 CALL wrd_mpi_io( TRIM( chem_species(lsp)%name ), chem_species(lsp)%conc ) 3256 CALL wrd_mpi_io( TRIM( chem_species(lsp)%name ) // '_av', chem_species(lsp)%conc_av ) 3257 ENDDO 3258 3259 ENDIF 3216 3260 3217 3261 END SUBROUTINE chem_wrd_local -
palm/trunk/SOURCE/diagnostic_output_quantities_mod.f90
r4457 r4517 110 110 data_output, & 111 111 message_string, & 112 restart_data_format_output, & 112 113 varnamelength 113 114 ! … … 1942 1943 !> Note: With the current structure reading of non-standard array is not 1943 1944 !> possible 1945 !> COMMENT: these arrays should be given standard index bounds! (Siggi) 1944 1946 !------------------------------------------------------------------------------! 1945 1947 ! SUBROUTINE doq_rrd_local( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & … … 2048 2050 IMPLICIT NONE 2049 2051 2050 IF ( ALLOCATED( pt_2m_av ) ) THEN 2051 CALL wrd_write_string( 'pt_2m_av' ) 2052 WRITE ( 14 ) pt_2m_av 2052 IF ( TRIM( restart_data_format_output ) == 'fortran_binary' ) THEN 2053 2054 IF ( ALLOCATED( pt_2m_av ) ) THEN 2055 CALL wrd_write_string( 'pt_2m_av' ) 2056 WRITE ( 14 ) pt_2m_av 2057 ENDIF 2058 2059 IF ( ALLOCATED( ti_av ) ) THEN 2060 CALL wrd_write_string( 'ti_av' ) 2061 WRITE ( 14 ) ti_av 2062 ENDIF 2063 2064 IF ( ALLOCATED( uu_av ) ) THEN 2065 CALL wrd_write_string( 'uu_av' ) 2066 WRITE ( 14 ) uu_av 2067 ENDIF 2068 2069 IF ( ALLOCATED( uv_10m_av ) ) THEN 2070 CALL wrd_write_string( 'uv_10m_av' ) 2071 WRITE ( 14 ) uv_10m_av 2072 ENDIF 2073 2074 IF ( ALLOCATED( vv_av ) ) THEN 2075 CALL wrd_write_string( 'vv_av' ) 2076 WRITE ( 14 ) vv_av 2077 ENDIF 2078 2079 IF ( ALLOCATED( ww_av ) ) THEN 2080 CALL wrd_write_string( 'ww_av' ) 2081 WRITE ( 14 ) ww_av 2082 ENDIF 2083 2084 IF ( ALLOCATED( wu_av ) ) THEN 2085 CALL wrd_write_string( 'wu_av' ) 2086 WRITE ( 14 ) wu_av 2087 ENDIF 2088 2089 IF ( ALLOCATED( wv_av ) ) THEN 2090 CALL wrd_write_string( 'wv_av' ) 2091 WRITE ( 14 ) wv_av 2092 ENDIF 2093 2094 IF ( ALLOCATED( wtheta_av ) ) THEN 2095 CALL wrd_write_string( 'wtheta_av' ) 2096 WRITE ( 14 ) wtheta_av 2097 ENDIF 2098 2099 IF ( ALLOCATED( wq_av ) ) THEN 2100 CALL wrd_write_string( 'wq_av' ) 2101 WRITE ( 14 ) wq_av 2102 ENDIF 2103 2104 IF ( ALLOCATED( wspeed_av ) ) THEN 2105 CALL wrd_write_string( 'wspeed_av' ) 2106 WRITE ( 14 ) wspeed_av 2107 ENDIF 2108 2109 IF ( ALLOCATED( u_center_av ) ) THEN 2110 CALL wrd_write_string( 'u_center_av' ) 2111 WRITE ( 14 ) u_center_av 2112 ENDIF 2113 2114 IF ( ALLOCATED( v_center_av ) ) THEN 2115 CALL wrd_write_string( 'v_center_av' ) 2116 WRITE ( 14 ) v_center_av 2117 ENDIF 2118 2119 ELSEIF ( TRIM( restart_data_format_output ) == 'mpi' ) THEN 2120 2121 STOP 'mpi-io for doq_wrd_local not realized' 2122 2053 2123 ENDIF 2054 2124 2055 IF ( ALLOCATED( ti_av ) ) THEN2056 CALL wrd_write_string( 'ti_av' )2057 WRITE ( 14 ) ti_av2058 ENDIF2059 2060 IF ( ALLOCATED( uu_av ) ) THEN2061 CALL wrd_write_string( 'uu_av' )2062 WRITE ( 14 ) uu_av2063 ENDIF2064 2065 IF ( ALLOCATED( uv_10m_av ) ) THEN2066 CALL wrd_write_string( 'uv_10m_av' )2067 WRITE ( 14 ) uv_10m_av2068 ENDIF2069 2070 IF ( ALLOCATED( vv_av ) ) THEN2071 CALL wrd_write_string( 'vv_av' )2072 WRITE ( 14 ) vv_av2073 ENDIF2074 2075 IF ( ALLOCATED( ww_av ) ) THEN2076 CALL wrd_write_string( 'ww_av' )2077 WRITE ( 14 ) ww_av2078 ENDIF2079 2080 IF ( ALLOCATED( wu_av ) ) THEN2081 CALL wrd_write_string( 'wu_av' )2082 WRITE ( 14 ) wu_av2083 ENDIF2084 2085 IF ( ALLOCATED( wv_av ) ) THEN2086 CALL wrd_write_string( 'wv_av' )2087 WRITE ( 14 ) wv_av2088 ENDIF2089 2090 IF ( ALLOCATED( wtheta_av ) ) THEN2091 CALL wrd_write_string( 'wtheta_av' )2092 WRITE ( 14 ) wtheta_av2093 ENDIF2094 2095 IF ( ALLOCATED( wq_av ) ) THEN2096 CALL wrd_write_string( 'wq_av' )2097 WRITE ( 14 ) wq_av2098 ENDIF2099 2100 IF ( ALLOCATED( wspeed_av ) ) THEN2101 CALL wrd_write_string( 'wspeed_av' )2102 WRITE ( 14 ) wspeed_av2103 ENDIF2104 2105 IF ( ALLOCATED( u_center_av ) ) THEN2106 CALL wrd_write_string( 'u_center_av' )2107 WRITE ( 14 ) u_center_av2108 ENDIF2109 2110 IF ( ALLOCATED( v_center_av ) ) THEN2111 CALL wrd_write_string( 'v_center_av' )2112 WRITE ( 14 ) v_center_av2113 ENDIF2114 2115 2125 END SUBROUTINE doq_wrd_local 2116 2126 -
palm/trunk/SOURCE/dynamics_mod.f90
r4505 r4517 25 25 ! ----------------- 26 26 ! $Id$ 27 ! added restart with MPI-IO for reading local arrays 28 ! 29 ! 4505 2020-04-20 15:37:15Z schwenkel 27 30 ! Add flag for saturation check 28 31 ! … … 279 282 280 283 INTERFACE dynamics_rrd_local 281 MODULE PROCEDURE dynamics_rrd_local 284 MODULE PROCEDURE dynamics_rrd_local_ftn 285 MODULE PROCEDURE dynamics_rrd_local_mpi 282 286 END INTERFACE dynamics_rrd_local 283 287 … … 1871 1875 ! Description: 1872 1876 ! ------------ 1873 !> Read module-specific processor specific restart data from file(s).1877 !> Read module-specific local restart data arrays (Fortran binary format). 1874 1878 !> Subdomain index limits on file are given by nxl_on_file, etc. 1875 1879 !> Indices nxlc, etc. indicate the range of gridpoints to be mapped from the subdomain on file (f) 1876 1880 !> to the subdomain of the current PE (c). They have been calculated in routine rrd_local. 1877 1881 !--------------------------------------------------------------------------------------------------! 1878 SUBROUTINE dynamics_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, nxr_on_file, nynf, nync, &1879 nyn_on_file, nysf, nysc, nys_on_file, tmp_2d, tmp_3d, found )1882 SUBROUTINE dynamics_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, nxr_on_file, nynf, nync, & 1883 nyn_on_file, nysf, nysc, nys_on_file, tmp_2d, tmp_3d, found ) 1880 1884 1881 1885 … … 1920 1924 END SELECT 1921 1925 1922 END SUBROUTINE dynamics_rrd_local 1926 END SUBROUTINE dynamics_rrd_local_ftn 1927 1928 1929 !--------------------------------------------------------------------------------------------------! 1930 ! Description: 1931 ! ------------ 1932 !> Read module-specific local restart data arrays (MPI-IO). 1933 !--------------------------------------------------------------------------------------------------! 1934 SUBROUTINE dynamics_rrd_local_mpi 1935 1936 IMPLICIT NONE 1937 1938 ! LOGICAL :: array_found !< 1939 1940 1941 ! CALL rd_mpi_io_check_array( 'u2_av' , found = array_found ) 1942 ! IF ( array_found ) THEN 1943 ! IF ( .NOT. ALLOCATED( u2_av ) ) ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1944 ! CALL rrd_mpi_io( 'u2_av', u2_av ) 1945 ! ENDIF 1946 1947 CONTINUE 1948 1949 END SUBROUTINE dynamics_rrd_local_mpi 1950 1923 1951 1924 1952 -
palm/trunk/SOURCE/gust_mod.f90
r4495 r4517 25 25 ! ----------------- 26 26 ! $Id$ 27 ! added restart with MPI-IO for reading local arrays 28 ! 29 ! 4495 2020-04-13 20:11:20Z raasch 27 30 ! restart data handling with MPI-IO added 28 31 ! … … 186 189 187 190 INTERFACE gust_rrd_local 188 MODULE PROCEDURE gust_rrd_local 191 MODULE PROCEDURE gust_rrd_local_ftn 192 MODULE PROCEDURE gust_rrd_local_mpi 189 193 END INTERFACE gust_rrd_local 190 194 … … 618 622 ! Description: 619 623 ! ------------ 620 !> This routine reads the respective restart data for the gust module.621 !------------------------------------------------------------------------------! 622 SUBROUTINE gust_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, &623 nxr_on_file, nynf, nync, nyn_on_file, nysf, &624 nysc, nys_on_file, tmp_2d, tmp_3d, found )624 !> Read module-specific local restart data arrays (Fortran binary format). 625 !------------------------------------------------------------------------------! 626 SUBROUTINE gust_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 627 nxr_on_file, nynf, nync, nyn_on_file, nysf, & 628 nysc, nys_on_file, tmp_2d, tmp_3d, found ) 625 629 626 630 … … 686 690 687 691 688 END SUBROUTINE gust_rrd_local 692 END SUBROUTINE gust_rrd_local_ftn 693 694 695 !------------------------------------------------------------------------------! 696 ! Description: 697 ! ------------ 698 !> Read module-specific local restart data arrays (MPI-IO). 699 !------------------------------------------------------------------------------! 700 SUBROUTINE gust_rrd_local_mpi 701 702 703 ! CALL rrd_mpi_io( 'local_array', local_array ) 704 705 END SUBROUTINE gust_rrd_local_mpi 689 706 690 707 -
palm/trunk/SOURCE/lagrangian_particle_model_mod.f90
r4495 r4517 210 210 211 211 USE restart_data_mpi_io_mod, & 212 ONLY: r rd_mpi_io, wrd_mpi_io212 ONLY: rd_mpi_io_check_array, rrd_mpi_io, wrd_mpi_io 213 213 214 214 USE statistics, & … … 413 413 414 414 INTERFACE lpm_rrd_local 415 MODULE PROCEDURE lpm_rrd_local 415 MODULE PROCEDURE lpm_rrd_local_ftn 416 MODULE PROCEDURE lpm_rrd_local_mpi 416 417 END INTERFACE lpm_rrd_local 417 418 … … 3021 3022 3022 3023 3023 SUBROUTINE lpm_rrd_local( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 3024 nxr_on_file, nynf, nync, nyn_on_file, nysf, & 3025 nysc, nys_on_file, tmp_3d, found ) 3024 !------------------------------------------------------------------------------! 3025 ! Description: 3026 ! ------------ 3027 !> Read module-specific local restart data arrays (Fortran binary format). 3028 !------------------------------------------------------------------------------! 3029 SUBROUTINE lpm_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 3030 nxr_on_file, nynf, nync, nyn_on_file, nysf, & 3031 nysc, nys_on_file, tmp_3d, found ) 3026 3032 3027 3033 … … 3101 3107 END SELECT 3102 3108 3103 3104 END SUBROUTINE lpm_rrd_local 3109 END SUBROUTINE lpm_rrd_local_ftn 3110 3105 3111 3112 !------------------------------------------------------------------------------! 3113 ! Description: 3114 ! ------------ 3115 !> Read module-specific local restart data arrays (MPI-IO). 3116 !------------------------------------------------------------------------------! 3117 SUBROUTINE lpm_rrd_local_mpi 3118 3119 IMPLICIT NONE 3120 3121 LOGICAL :: array_found !< 3122 3123 CALL rrd_mpi_io( 'iran', iran ) ! matching random numbers is still unresolved issue 3124 CALL rrd_mpi_io( 'iran_part', iran_part ) 3125 3126 CALL rd_mpi_io_check_array( 'pc_av' , found = array_found ) 3127 IF ( array_found ) THEN 3128 IF ( .NOT. ALLOCATED( pc_av ) ) ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3129 CALL rrd_mpi_io( 'pc_av', pc_av ) 3130 ENDIF 3131 3132 CALL rd_mpi_io_check_array( 'pr_av' , found = array_found ) 3133 IF ( array_found ) THEN 3134 IF ( .NOT. ALLOCATED( pr_av ) ) ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3135 CALL rrd_mpi_io( 'pr_av', pr_av ) 3136 ENDIF 3137 3138 CALL rd_mpi_io_check_array( 'ql_c_av' , found = array_found ) 3139 IF ( array_found ) THEN 3140 IF ( .NOT. ALLOCATED( ql_c_av ) ) ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3141 CALL rrd_mpi_io( 'ql_c_av', ql_c_av ) 3142 ENDIF 3143 3144 CALL rd_mpi_io_check_array( 'ql_v_av' , found = array_found ) 3145 IF ( array_found ) THEN 3146 IF ( .NOT. ALLOCATED( ql_v_av ) ) ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3147 CALL rrd_mpi_io( 'ql_v_av', ql_v_av ) 3148 ENDIF 3149 3150 CALL rd_mpi_io_check_array( 'ql_vp_av' , found = array_found ) 3151 IF ( array_found ) THEN 3152 IF ( .NOT. ALLOCATED( ql_vp_av ) ) ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3153 CALL rrd_mpi_io( 'ql_vp_av', ql_vp_av ) 3154 ENDIF 3155 3156 END SUBROUTINE lpm_rrd_local_mpi 3157 3158 3106 3159 !------------------------------------------------------------------------------! 3107 3160 ! Description: … … 3168 3221 #endif 3169 3222 3170 CALL wrd_write_string( 'iran' ) 3171 WRITE ( 14 ) iran, iran_part 3172 3223 IF ( TRIM( restart_data_format_output ) == 'fortran_binary' ) THEN 3224 3225 CALL wrd_write_string( 'iran' ) ! matching random numbers is still unresolved issue 3226 WRITE ( 14 ) iran, iran_part 3227 3228 ELSEIF ( TRIM( restart_data_format_output ) == 'mpi' ) THEN 3229 3230 CALL wrd_mpi_io( 'iran', iran ) ! matching random numbers is still unresolved issue 3231 CALL wrd_mpi_io( 'iran_part', iran_part ) 3232 3233 ENDIF 3173 3234 3174 3235 END SUBROUTINE lpm_wrd_local -
palm/trunk/SOURCE/land_surface_model_mod.f90
r4495 r4517 25 25 ! ----------------- 26 26 ! $Id$ 27 ! added restart with MPI-IO for reading local arrays 28 ! 29 ! 4495 2020-04-13 20:11:20Z raasch 27 30 ! restart data handling with MPI-IO added 28 31 ! … … 291 294 292 295 USE restart_data_mpi_io_mod, & 293 ONLY: rd_mpi_io_surface_filetypes, wrd_mpi_io, wrd_mpi_io_surface 296 ONLY: rd_mpi_io_check_array, rd_mpi_io_surface_filetypes, rrd_mpi_io, rrd_mpi_io_surface, & 297 wrd_mpi_io, wrd_mpi_io_surface 294 298 295 299 USE statistics, & … … 808 812 809 813 INTERFACE lsm_rrd_local 810 MODULE PROCEDURE lsm_rrd_local 814 MODULE PROCEDURE lsm_rrd_local_ftn 815 MODULE PROCEDURE lsm_rrd_local_mpi 811 816 END INTERFACE lsm_rrd_local 812 817 … … 6674 6679 CALL wrd_mpi_io( 'lsm_end_index_h', surf_lsm_h%end_index ) 6675 6680 CALL wrd_mpi_io( 'lsm_global_start_index_h', global_start_index ) 6676 CALL wrd_mpi_io_surface 6681 CALL wrd_mpi_io_surface( 't_soil_h', t_soil_h%var_2d ) 6677 6682 CALL wrd_mpi_io_surface( 'm_soil_h', m_soil_h%var_2d ) 6678 6683 CALL wrd_mpi_io_surface( 'm_liq_h', m_liq_h%var_1d ) … … 6686 6691 surface_data_to_write, global_start_index ) 6687 6692 6688 CALL wrd_mpi_io( 'lsm_start_index_v_' // dum, surf_lsm_v(l)%start_index )6689 CALL wrd_mpi_io( 'lsm_end_index_v_' // dum, surf_lsm_v(l)%end_index )6690 CALL wrd_mpi_io( 'lsm_global_start_index_v_' // dum , global_start_index )6693 CALL wrd_mpi_io( 'lsm_start_index_v_' // dum, surf_lsm_v(l)%start_index ) 6694 CALL wrd_mpi_io( 'lsm_end_index_v_' // dum, surf_lsm_v(l)%end_index ) 6695 CALL wrd_mpi_io( 'lsm_global_start_index_v_' // dum , global_start_index ) 6691 6696 6692 6697 IF ( .NOT. surface_data_to_write ) CYCLE … … 6708 6713 ! Description: 6709 6714 ! ------------ 6710 !> Soubroutine reads lsm data from restart file(s)6715 !> Read module-specific local restart data arrays (Fortran binary format). 6711 6716 !------------------------------------------------------------------------------! 6712 SUBROUTINE lsm_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, &6713 nxr_on_file, nynf, nync, nyn_on_file, nysf, nysc, &6714 nys_on_file, tmp_2d, found )6717 SUBROUTINE lsm_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 6718 nxr_on_file, nynf, nync, nyn_on_file, nysf, nysc, & 6719 nys_on_file, tmp_2d, found ) 6715 6720 6716 6721 … … 7305 7310 7306 7311 7307 END SUBROUTINE lsm_rrd_local 7312 END SUBROUTINE lsm_rrd_local_ftn 7313 7314 !------------------------------------------------------------------------------! 7315 ! 7316 ! Description: 7317 ! ------------ 7318 !> Read module-specific local restart data arrays (MPI-IO). 7319 !------------------------------------------------------------------------------! 7320 SUBROUTINE lsm_rrd_local_mpi 7321 7322 USE control_parameters 7323 7324 USE indices 7325 7326 USE pegrid 7327 7328 7329 IMPLICIT NONE 7330 7331 CHARACTER(LEN=1) :: dum !< dummy to create correct string for creating variable string 7332 7333 INTEGER(iwp) :: l !< running index surface orientation 7334 7335 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: end_index 7336 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: global_start 7337 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: start_index 7338 7339 LOGICAL :: array_found 7340 LOGICAL :: ldum 7341 7342 7343 CALL rd_mpi_io_check_array( 'c_liq_av', found = array_found ) 7344 IF ( array_found ) THEN 7345 IF ( .NOT. ALLOCATED( c_liq_av ) ) ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) ) 7346 CALL rrd_mpi_io( 'c_liq_av', c_liq_av ) 7347 ENDIF 7348 7349 CALL rd_mpi_io_check_array( 'c_soil_av', found = array_found ) 7350 IF ( array_found ) THEN 7351 IF ( .NOT. ALLOCATED( c_soil_av ) ) ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) ) 7352 CALL rrd_mpi_io( 'c_soil_av', c_soil_av ) 7353 ENDIF 7354 7355 CALL rd_mpi_io_check_array( 'c_veg_av', found = array_found ) 7356 IF ( array_found ) THEN 7357 IF ( .NOT. ALLOCATED( c_veg_av ) ) ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) ) 7358 CALL rrd_mpi_io( 'c_veg_av', c_veg_av ) 7359 ENDIF 7360 7361 CALL rd_mpi_io_check_array( 'lai_av', found = array_found ) 7362 IF ( array_found ) THEN 7363 IF ( .NOT. ALLOCATED( lai_av ) ) ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) ) 7364 CALL rrd_mpi_io( 'lai_av', lai_av ) 7365 ENDIF 7366 7367 CALL rd_mpi_io_check_array( 'm_liq_av', found = array_found ) 7368 IF ( array_found ) THEN 7369 IF ( .NOT. ALLOCATED( m_liq_av ) ) ALLOCATE( m_liq_av(nysg:nyng,nxlg:nxrg) ) 7370 CALL rrd_mpi_io( 'm_liq_av', m_liq_av ) 7371 ENDIF 7372 7373 CALL rd_mpi_io_check_array( 'm_soil_av', found = array_found ) 7374 IF ( array_found ) THEN 7375 IF ( .NOT. ALLOCATED( m_soil_av ) ) ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 7376 CALL rrd_mpi_io( 'm_soil_av', m_soil_av, nzb_soil, nzt_soil ) 7377 ENDIF 7378 7379 CALL rd_mpi_io_check_array( 'qsws_liq_av', found = array_found ) 7380 IF ( array_found ) THEN 7381 IF ( .NOT. ALLOCATED( qsws_liq_av ) ) ALLOCATE( qsws_liq_av(nysg:nyng,nxlg:nxrg) ) 7382 CALL rrd_mpi_io( 'qsws_liq_av', qsws_liq_av ) 7383 ENDIF 7384 7385 CALL rd_mpi_io_check_array( 'qsws_soil_av', found = array_found ) 7386 IF ( array_found ) THEN 7387 IF ( .NOT. ALLOCATED( qsws_soil_av ) ) ALLOCATE( qsws_soil_av(nysg:nyng,nxlg:nxrg) ) 7388 CALL rrd_mpi_io( 'qsws_soil_av', qsws_soil_av ) 7389 ENDIF 7390 7391 CALL rd_mpi_io_check_array( 'qsws_veg_av', found = array_found ) 7392 IF ( array_found ) THEN 7393 IF ( .NOT. ALLOCATED( qsws_veg_av ) ) ALLOCATE( qsws_veg_av(nysg:nyng,nxlg:nxrg) ) 7394 CALL rrd_mpi_io( 'qsws_veg_av', qsws_veg_av ) 7395 ENDIF 7396 7397 CALL rd_mpi_io_check_array( 't_soil_av', found = array_found ) 7398 IF ( array_found ) THEN 7399 IF ( .NOT. ALLOCATED( t_soil_av ) ) ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) 7400 CALL rrd_mpi_io( 't_soil_av', t_soil_av, nzb_soil, nzt_soil ) 7401 ENDIF 7402 7403 CALL rrd_mpi_io( 'lsm_start_index_h', surf_lsm_h%start_index ) 7404 CALL rrd_mpi_io( 'lsm_end_index_h', surf_lsm_h%end_index ) 7405 CALL rrd_mpi_io( 'lsm_global_start_index_h', global_start ) 7406 7407 CALL rd_mpi_io_surface_filetypes ( surf_lsm_h%start_index, surf_lsm_h%end_index, ldum, & 7408 global_start ) 7409 7410 CALL rrd_mpi_io_surface( 't_soil_h', t_soil_h%var_2d ) 7411 CALL rrd_mpi_io_surface( 'm_soil_h', m_soil_h%var_2d ) 7412 CALL rrd_mpi_io_surface( 'm_liq_h', m_liq_h%var_1d ) 7413 CALL rrd_mpi_io_surface( 't_surface_h', t_surface_h%var_1d ) 7414 7415 7416 DO l = 0, 3 7417 7418 WRITE( dum, '(I1)') l 7419 7420 !kk In case of nothing to do, the settings of start_index and end_index differ 7421 !kk between writing and reading restart file 7422 !kk 7423 !kk Has to be discussed with the developpers 7424 7425 CALL rrd_mpi_io( 'lsm_start_index_v_' // dum, start_index ) 7426 CALL rrd_mpi_io( 'lsm_end_index_v_' // dum, end_index ) 7427 CALL rrd_mpi_io( 'lsm_global_start_index_v_' // dum , global_start ) 7428 7429 CALL rd_mpi_io_surface_filetypes( start_index, end_index, ldum, global_start ) 7430 7431 IF ( MAXVAL( end_index ) <= 0 ) CYCLE 7432 7433 CALL rrd_mpi_io_surface( 't_soil_v(' // dum // ')', t_soil_v(l)%var_2d ) 7434 CALL rrd_mpi_io_surface( 'm_soil_v(' // dum // ')', m_soil_v(l)%var_2d ) 7435 CALL rrd_mpi_io_surface( 'm_liq_v(' // dum // ')', m_liq_v(l)%var_1d ) 7436 CALL rrd_mpi_io_surface( 't_surface_v(' // dum // ')', t_surface_v(l)%var_1d ) 7437 7438 ENDDO 7439 7440 END SUBROUTINE lsm_rrd_local_mpi 7308 7441 7309 7442 !------------------------------------------------------------------------------! -
palm/trunk/SOURCE/module_interface.f90
r4514 r4517 25 25 ! ----------------- 26 26 ! $Id$ 27 ! added restart with MPI-IO for reading local arrays 28 ! 29 ! 4514 2020-04-30 16:29:59Z suehring 27 30 ! Added global restart routines for plant-canopy model 28 31 ! … … 704 707 705 708 INTERFACE module_interface_rrd_local 706 MODULE PROCEDURE module_interface_rrd_local 709 MODULE PROCEDURE module_interface_rrd_local_ftn 710 MODULE PROCEDURE module_interface_rrd_local_mpi 707 711 END INTERFACE module_interface_rrd_local 708 712 … … 1806 1810 ! Description: 1807 1811 ! ------------ 1808 !> Read module-specific restart data specific to local MPI ranks1809 !------------------------------------------------------------------------------! 1810 SUBROUTINE module_interface_rrd_local ( map_index, &1811 nxlf, nxlc, nxl_on_file, &1812 nxrf, nxrc, nxr_on_file, &1813 nynf, nync, nyn_on_file, &1814 nysf, nysc, nys_on_file, &1815 tmp_2d, tmp_3d, found )1812 !> Read module-specific local restart data arrays (Fortran binary format). 1813 !------------------------------------------------------------------------------! 1814 SUBROUTINE module_interface_rrd_local_ftn( map_index, & 1815 nxlf, nxlc, nxl_on_file, & 1816 nxrf, nxrc, nxr_on_file, & 1817 nynf, nync, nyn_on_file, & 1818 nysf, nysc, nys_on_file, & 1819 tmp_2d, tmp_3d, found ) 1816 1820 1817 1821 … … 1839 1843 1840 1844 1841 IF ( debug_output ) CALL debug_message( 'module-specific read local restart data', 'start' ) 1845 IF ( debug_output ) THEN 1846 CALL debug_message( 'module-specific read local restart data (Fortran binary)', 'start' ) 1847 ENDIF 1842 1848 1843 1849 CALL dynamics_rrd_local( & … … 1965 1971 ) ! ToDo: change interface to pass variable 1966 1972 1967 IF ( debug_output ) CALL debug_message( 'module-specific read local restart data', 'end' ) 1968 1969 1970 END SUBROUTINE module_interface_rrd_local 1973 IF ( debug_output ) THEN 1974 CALL debug_message( 'module-specific read local restart data (Fortran binary)', 'end' ) 1975 ENDIF 1976 1977 END SUBROUTINE module_interface_rrd_local_ftn 1978 1979 1980 !------------------------------------------------------------------------------! 1981 ! Description: 1982 ! ------------ 1983 !> Read module-specific local restart data arrays (MPI-IO). 1984 !------------------------------------------------------------------------------! 1985 SUBROUTINE module_interface_rrd_local_mpi 1986 1987 IF ( debug_output ) THEN 1988 CALL debug_message( 'module-specific read local restart data (MPI-IO)', 'start' ) 1989 ENDIF 1990 1991 CALL dynamics_rrd_local 1992 1993 ! IF ( biometeorology ) CALL bio_rrd_local 1994 IF ( bulk_cloud_model ) CALL bcm_rrd_local 1995 IF ( air_chemistry ) CALL chem_rrd_local 1996 ! CALL doq_rrd_local 1997 IF ( gust_module_enabled ) CALL gust_rrd_local 1998 IF ( particle_advection ) CALL lpm_rrd_local 1999 IF ( land_surface ) CALL lsm_rrd_local 2000 IF ( plant_canopy ) CALL pcm_rrd_local 2001 IF ( ocean_mode ) CALL ocean_rrd_local 2002 IF ( radiation ) CALL radiation_rrd_local 2003 ! IF ( salsa ) CALL salsa_rrd_local 2004 IF ( urban_surface ) CALL usm_rrd_local 2005 IF ( surface_output ) CALL surface_data_output_rrd_local 2006 2007 IF ( user_module_enabled ) CALL user_rrd_local 2008 2009 IF ( debug_output ) THEN 2010 CALL debug_message( 'module-specific read local restart data (Fortran binary)', 'end' ) 2011 ENDIF 2012 2013 END SUBROUTINE module_interface_rrd_local_mpi 1971 2014 1972 2015 -
palm/trunk/SOURCE/ocean_mod.f90
r4495 r4517 25 25 ! ----------------- 26 26 ! $Id$ 27 ! added restart with MPI-IO for reading local arrays 28 ! 29 ! 4495 2020-04-13 20:11:20Z raasch 27 30 ! restart data handling with MPI-IO added 28 31 ! … … 102 105 103 106 USE restart_data_mpi_io_mod, & 104 ONLY: rrd_mpi_io, rrd_mpi_io_global_array, wrd_mpi_io, wrd_mpi_io_global_array 107 ONLY: rd_mpi_io_check_array, rrd_mpi_io, rrd_mpi_io_global_array, wrd_mpi_io, & 108 wrd_mpi_io_global_array 105 109 106 110 USE surface_mod, & … … 232 236 233 237 INTERFACE ocean_rrd_local 234 MODULE PROCEDURE ocean_rrd_local 238 MODULE PROCEDURE ocean_rrd_local_ftn 239 MODULE PROCEDURE ocean_rrd_local_mpi 235 240 END INTERFACE ocean_rrd_local 236 241 … … 2039 2044 ! Description: 2040 2045 ! ------------ 2041 !> This routine reads the respective restart data for the ocean module.2042 !------------------------------------------------------------------------------! 2043 SUBROUTINE ocean_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, &2044 nxr_on_file, nynf, nync, nyn_on_file, nysf, &2045 nysc, nys_on_file, tmp_3d, found )2046 !> Read module-specific local restart data arrays (Fortran binary format). 2047 !------------------------------------------------------------------------------! 2048 SUBROUTINE ocean_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 2049 nxr_on_file, nynf, nync, nyn_on_file, nysf, & 2050 nysc, nys_on_file, tmp_3d, found ) 2046 2051 2047 2052 USE averaging, & … … 2108 2113 END SELECT 2109 2114 2110 END SUBROUTINE ocean_rrd_local 2115 END SUBROUTINE ocean_rrd_local_ftn 2116 2117 2118 !------------------------------------------------------------------------------! 2119 ! Description: 2120 ! ------------ 2121 !> Read module-specific local restart data arrays (MPI-IO). 2122 !------------------------------------------------------------------------------! 2123 SUBROUTINE ocean_rrd_local_mpi 2124 2125 USE averaging, & 2126 ONLY: rho_ocean_av, sa_av 2127 2128 USE indices, & 2129 ONLY: nxlg, nxrg, nyng, nysg, nzb, nzt 2130 2131 IMPLICIT NONE 2132 2133 LOGICAL :: array_found !< 2134 2135 2136 CALL rd_mpi_io_check_array( 'rho_ocean_av' , found = array_found ) 2137 IF ( array_found ) THEN 2138 IF ( .NOT. ALLOCATED( rho_ocean_av ) ) ALLOCATE( rho_ocean_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2139 CALL rrd_mpi_io( 'rho_ocean_av', rho_ocean_av ) 2140 ENDIF 2141 2142 CALL rrd_mpi_io( 'sa', sa ) 2143 2144 CALL rd_mpi_io_check_array( 'sa_av' , found = array_found ) 2145 IF ( array_found ) THEN 2146 IF ( .NOT. ALLOCATED( sa_av ) ) ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2147 CALL rrd_mpi_io( 'sa_av', sa_av ) 2148 ENDIF 2149 2150 END SUBROUTINE ocean_rrd_local_mpi 2111 2151 2112 2152 -
palm/trunk/SOURCE/plant_canopy_model_mod.f90
r4515 r4517 27 27 ! ----------------- 28 28 ! $Id$ 29 ! added restart with MPI-IO for reading local arrays 30 ! 31 ! 4515 2020-04-30 16:37:18Z suehring 29 32 ! Rename error number again since this was recently given in -r 4511 30 33 ! … … 237 240 238 241 USE restart_data_mpi_io_mod, & 239 ONLY: rrd_mpi_io, & 242 ONLY: rd_mpi_io_check_array, & 243 rrd_mpi_io, & 240 244 wrd_mpi_io 241 245 … … 361 365 362 366 INTERFACE pcm_rrd_local 363 MODULE PROCEDURE pcm_rrd_local 367 MODULE PROCEDURE pcm_rrd_local_ftn 368 MODULE PROCEDURE pcm_rrd_local_mpi 364 369 END INTERFACE pcm_rrd_local 365 370 … … 1685 1690 END SUBROUTINE pcm_rrd_global_mpi 1686 1691 1692 1687 1693 !------------------------------------------------------------------------------! 1688 1694 ! Description: 1689 1695 ! ------------ 1690 !> Subroutine reads local (subdomain) restart data1691 !------------------------------------------------------------------------------! 1692 SUBROUTINE pcm_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, &1693 nxr_on_file, nynf, nync, nyn_on_file, nysf, &1694 nysc, nys_on_file, found )1696 !> Read module-specific local restart data arrays (Fortran binary format). 1697 !------------------------------------------------------------------------------! 1698 SUBROUTINE pcm_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, & 1699 nxr_on_file, nynf, nync, nyn_on_file, nysf, & 1700 nysc, nys_on_file, found ) 1695 1701 1696 1702 INTEGER(iwp) :: k !< … … 1751 1757 END SELECT 1752 1758 1753 END SUBROUTINE pcm_rrd_local 1759 END SUBROUTINE pcm_rrd_local_ftn 1760 1761 1762 !------------------------------------------------------------------------------! 1763 ! Description: 1764 ! ------------ 1765 !> Read module-specific local restart data arrays (MPI-IO). 1766 !------------------------------------------------------------------------------! 1767 SUBROUTINE pcm_rrd_local_mpi 1768 1769 IMPLICIT NONE 1770 1771 LOGICAL :: array_found !< 1772 1773 1774 !> TODO: following code does not work because arrays are sized 0:pch_index along k!!!!! 1775 CALL rd_mpi_io_check_array( 'pcm_heatrate_av' , found = array_found ) 1776 IF ( array_found ) THEN 1777 IF ( .NOT. ALLOCATED( pcm_heatrate_av ) ) ALLOCATE( pcm_heatrate_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1778 CALL rrd_mpi_io( 'pcm_heatrate_av', pcm_heatrate_av ) 1779 ENDIF 1780 1781 CALL rd_mpi_io_check_array( 'pcm_latentrate_av' , found = array_found ) 1782 IF ( array_found ) THEN 1783 IF ( .NOT. ALLOCATED( pcm_latentrate_av ) ) ALLOCATE( pcm_latentrate_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1784 CALL rrd_mpi_io( 'pcm_latentrate_av', pcm_latentrate_av ) 1785 ENDIF 1786 1787 CALL rd_mpi_io_check_array( 'pcm_transpirationrate_av' , found = array_found ) 1788 IF ( array_found ) THEN 1789 IF ( .NOT. ALLOCATED( pcm_transpirationrate_av ) ) ALLOCATE( pcm_transpirationrate_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1790 CALL rrd_mpi_io( 'pcm_transpirationrate_av', pcm_transpirationrate_av ) 1791 ENDIF 1792 1793 END SUBROUTINE pcm_rrd_local_mpi 1794 1754 1795 1755 1796 !------------------------------------------------------------------------------! -
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 -
palm/trunk/SOURCE/read_restart_data_mod.f90
r4514 r4517 1147 1147 1148 1148 ! 1149 !-- Close restart File1149 !-- Close restart file 1150 1150 CALL rd_mpi_io_close 1151 1151 … … 1376 1376 ! Description: 1377 1377 ! ------------ 1378 !> Reads processor specific data of variables and arrays from restart file1378 !> Reads processor (subdomain) specific data of variables and arrays from restart file 1379 1379 !> (binary format). 1380 1380 !------------------------------------------------------------------------------! … … 1385 1385 CHARACTER (LEN=10) :: binary_version_local 1386 1386 CHARACTER (LEN=10) :: version_on_file 1387 CHARACTER (LEN=20) :: tmp_name !< temporary variable 1387 1388 1388 1389 INTEGER(iwp) :: files_to_be_opened !< … … 1428 1429 INTEGER(isp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_2d_seq_random !< temporary array for storing random generator data 1429 1430 1430 LOGICAL :: found 1431 LOGICAL :: array_found !< 1432 LOGICAL :: found !< 1431 1433 1432 1434 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tmp_2d !< temporary array for storing 2D data … … 1438 1440 !-- Read data from previous model run. 1439 1441 CALL cpu_log( log_point_s(14), 'rrd_local', 'start' ) 1440 ! 1441 !-- Allocate temporary buffer arrays. In previous versions, there were 1442 !-- declared as automated arrays, causing memory problems when these 1443 !-- were allocate on stack. 1444 ALLOCATE( nxlfa(numprocs_previous_run,1000) ) 1445 ALLOCATE( nxrfa(numprocs_previous_run,1000) ) 1446 ALLOCATE( nynfa(numprocs_previous_run,1000) ) 1447 ALLOCATE( nysfa(numprocs_previous_run,1000) ) 1448 ALLOCATE( offset_xa(numprocs_previous_run,1000) ) 1449 ALLOCATE( offset_ya(numprocs_previous_run,1000) ) 1450 1451 ! 1452 !-- Check which of the restart files contain data needed for the subdomain 1453 !-- of this PE 1454 files_to_be_opened = 0 1455 1456 DO i = 1, numprocs_previous_run 1457 ! 1458 !-- Store array bounds of the previous run ("pr") in temporary scalars 1459 nxlpr = hor_index_bounds_previous_run(1,i-1) 1460 nxrpr = hor_index_bounds_previous_run(2,i-1) 1461 nyspr = hor_index_bounds_previous_run(3,i-1) 1462 nynpr = hor_index_bounds_previous_run(4,i-1) 1463 1464 ! 1465 !-- Determine the offsets. They may be non-zero in case that the total domain 1466 !-- on file is smaller than the current total domain. 1467 offset_x = ( nxl / ( nx_on_file + 1 ) ) * ( nx_on_file + 1 ) 1468 offset_y = ( nys / ( ny_on_file + 1 ) ) * ( ny_on_file + 1 ) 1469 1470 ! 1471 !-- Start with this offset and then check, if the subdomain on file 1472 !-- matches another time(s) in the current subdomain by shifting it 1473 !-- for nx_on_file+1, ny_on_file+1 respectively 1474 1475 shift_y = 0 1476 j = 0 1477 DO WHILE ( nyspr+shift_y <= nyn-offset_y ) 1478 1479 IF ( nynpr+shift_y >= nys-offset_y ) THEN 1480 1481 shift_x = 0 1482 DO WHILE ( nxlpr+shift_x <= nxr-offset_x ) 1483 1484 IF ( nxrpr+shift_x >= nxl-offset_x ) THEN 1485 j = j +1 1486 IF ( j > 1000 ) THEN 1487 ! 1488 !-- Array bound exceeded 1489 message_string = 'data from subdomain of previous' // & 1490 ' run mapped more than 1000 times' 1491 CALL message( 'rrd_local', 'PA0284', 2, 2, -1, 6, 1 ) 1442 1443 IF ( TRIM( restart_data_format_input ) == 'fortran_binary' ) THEN 1444 ! 1445 !-- Input in Fortran binary format 1446 1447 ! 1448 !-- Allocate temporary buffer arrays. In previous versions, there were 1449 !-- declared as automated arrays, causing memory problems when these 1450 !-- were allocate on stack. 1451 ALLOCATE( nxlfa(numprocs_previous_run,1000) ) 1452 ALLOCATE( nxrfa(numprocs_previous_run,1000) ) 1453 ALLOCATE( nynfa(numprocs_previous_run,1000) ) 1454 ALLOCATE( nysfa(numprocs_previous_run,1000) ) 1455 ALLOCATE( offset_xa(numprocs_previous_run,1000) ) 1456 ALLOCATE( offset_ya(numprocs_previous_run,1000) ) 1457 1458 ! 1459 !-- Check which of the restart files contain data needed for the subdomain 1460 !-- of this PE 1461 files_to_be_opened = 0 1462 1463 DO i = 1, numprocs_previous_run 1464 ! 1465 !-- Store array bounds of the previous run ("pr") in temporary scalars 1466 nxlpr = hor_index_bounds_previous_run(1,i-1) 1467 nxrpr = hor_index_bounds_previous_run(2,i-1) 1468 nyspr = hor_index_bounds_previous_run(3,i-1) 1469 nynpr = hor_index_bounds_previous_run(4,i-1) 1470 1471 ! 1472 !-- Determine the offsets. They may be non-zero in case that the total domain 1473 !-- on file is smaller than the current total domain. 1474 offset_x = ( nxl / ( nx_on_file + 1 ) ) * ( nx_on_file + 1 ) 1475 offset_y = ( nys / ( ny_on_file + 1 ) ) * ( ny_on_file + 1 ) 1476 1477 ! 1478 !-- Start with this offset and then check, if the subdomain on file 1479 !-- matches another time(s) in the current subdomain by shifting it 1480 !-- for nx_on_file+1, ny_on_file+1 respectively 1481 1482 shift_y = 0 1483 j = 0 1484 DO WHILE ( nyspr+shift_y <= nyn-offset_y ) 1485 1486 IF ( nynpr+shift_y >= nys-offset_y ) THEN 1487 1488 shift_x = 0 1489 DO WHILE ( nxlpr+shift_x <= nxr-offset_x ) 1490 1491 IF ( nxrpr+shift_x >= nxl-offset_x ) THEN 1492 j = j +1 1493 IF ( j > 1000 ) THEN 1494 ! 1495 !-- Array bound exceeded 1496 message_string = 'data from subdomain of previous' // & 1497 ' run mapped more than 1000 times' 1498 CALL message( 'rrd_local', 'PA0284', 2, 2, -1, 6, 1 ) 1499 ENDIF 1500 1501 IF ( j == 1 ) THEN 1502 files_to_be_opened = files_to_be_opened + 1 1503 file_list(files_to_be_opened) = i-1 1504 ENDIF 1505 1506 offset_xa(files_to_be_opened,j) = offset_x + shift_x 1507 offset_ya(files_to_be_opened,j) = offset_y + shift_y 1508 ! 1509 !-- Index bounds of overlapping data 1510 nxlfa(files_to_be_opened,j) = MAX( nxl-offset_x-shift_x, nxlpr ) 1511 nxrfa(files_to_be_opened,j) = MIN( nxr-offset_x-shift_x, nxrpr ) 1512 nysfa(files_to_be_opened,j) = MAX( nys-offset_y-shift_y, nyspr ) 1513 nynfa(files_to_be_opened,j) = MIN( nyn-offset_y-shift_y, nynpr ) 1514 1492 1515 ENDIF 1493 1516 1494 IF ( j == 1 ) THEN 1495 files_to_be_opened = files_to_be_opened + 1 1496 file_list(files_to_be_opened) = i-1 1497 ENDIF 1498 1499 offset_xa(files_to_be_opened,j) = offset_x + shift_x 1500 offset_ya(files_to_be_opened,j) = offset_y + shift_y 1501 ! 1502 !-- Index bounds of overlapping data 1503 nxlfa(files_to_be_opened,j) = MAX( nxl-offset_x-shift_x, nxlpr ) 1504 nxrfa(files_to_be_opened,j) = MIN( nxr-offset_x-shift_x, nxrpr ) 1505 nysfa(files_to_be_opened,j) = MAX( nys-offset_y-shift_y, nyspr ) 1506 nynfa(files_to_be_opened,j) = MIN( nyn-offset_y-shift_y, nynpr ) 1507 1508 ENDIF 1509 1510 shift_x = shift_x + ( nx_on_file + 1 ) 1511 ENDDO 1512 1517 shift_x = shift_x + ( nx_on_file + 1 ) 1518 ENDDO 1519 1520 ENDIF 1521 1522 shift_y = shift_y + ( ny_on_file + 1 ) 1523 ENDDO 1524 1525 IF ( j > 0 ) overlap_count(files_to_be_opened) = j 1526 1527 ENDDO 1528 1529 ! 1530 !-- Save the id-string of the current process, since myid_char may now be used 1531 !-- to open files created by PEs with other id. 1532 myid_char_save = myid_char 1533 1534 IF ( files_to_be_opened /= 1 .OR. numprocs /= numprocs_previous_run ) THEN 1535 WRITE( message_string, * ) 'number of PEs or virtual PE-grid changed in restart run. & ', & 1536 'Set debug_output =.T. to get a list of files from which the & ',& 1537 'single PEs will read respectively' 1538 CALL message( 'rrd_local', 'PA0285', 0, 0, 0, 6, 0 ) 1539 IF ( debug_output ) THEN 1540 IF ( files_to_be_opened <= 120 ) THEN 1541 WRITE( debug_string, '(2A,1X,120(I6.6,1X))' ) & 1542 'number of PEs or virtual PE-grid changed in restart run. PE will read from ', & 1543 'files ', file_list(1:files_to_be_opened) 1544 ELSE 1545 WRITE( debug_string, '(3A,1X,120(I6.6,1X),A)' ) & 1546 'number of PEs or virtual PE-grid changed in restart run. PE will read from ', & 1547 'files ', file_list(1:120), '... and more' 1548 ENDIF 1549 CALL debug_message( 'rrd_local', 'info' ) 1513 1550 ENDIF 1514 1515 shift_y = shift_y + ( ny_on_file + 1 ) 1516 ENDDO 1517 1518 IF ( j > 0 ) overlap_count(files_to_be_opened) = j 1519 1520 ENDDO 1521 1522 ! 1523 !-- Save the id-string of the current process, since myid_char may now be used 1524 !-- to open files created by PEs with other id. 1525 myid_char_save = myid_char 1526 1527 IF ( files_to_be_opened /= 1 .OR. numprocs /= numprocs_previous_run ) THEN 1528 WRITE( message_string, * ) 'number of PEs or virtual PE-grid changed in restart run. & ', & 1529 'Set debug_output =.T. to get a list of files from which the & ',& 1530 'single PEs will read respectively' 1531 CALL message( 'rrd_local', 'PA0285', 0, 0, 0, 6, 0 ) 1532 IF ( debug_output ) THEN 1533 IF ( files_to_be_opened <= 120 ) THEN 1534 WRITE( debug_string, '(2A,1X,120(I6.6,1X))' ) & 1535 'number of PEs or virtual PE-grid changed in restart run. PE will read from ', & 1536 'files ', file_list(1:files_to_be_opened) 1537 ELSE 1538 WRITE( debug_string, '(3A,1X,120(I6.6,1X),A)' ) & 1539 'number of PEs or virtual PE-grid changed in restart run. PE will read from ', & 1540 'files ', file_list(1:120), '... and more' 1541 ENDIF 1542 CALL debug_message( 'rrd_local', 'info' ) 1543 ENDIF 1544 ENDIF 1545 1546 ! 1547 !-- Read data from all restart files determined above 1548 DO i = 1, files_to_be_opened 1549 1550 j = file_list(i) 1551 ! 1552 !-- Set the filename (underscore followed by four digit processor id) 1553 WRITE (myid_char,'(''_'',I6.6)') j 1554 1555 ! 1556 !-- Open the restart file. If this file has been created by PE0 (_000000), 1557 !-- the global variables at the beginning of the file have to be skipped 1558 !-- first. 1559 CALL check_open( 13 ) 1560 IF ( j == 0 ) CALL rrd_skip_global 1561 1562 ! 1563 !-- First compare the version numbers 1564 READ ( 13 ) length 1565 READ ( 13 ) restart_string(1:length) 1566 READ ( 13 ) version_on_file 1567 1568 binary_version_local = '4.7' 1569 IF ( TRIM( version_on_file ) /= TRIM( binary_version_local ) ) THEN 1570 WRITE( message_string, * ) 'version mismatch concerning ', & 1571 'binary_version_local:', & 1572 '&version on file = "', TRIM( version_on_file ), '"', & 1573 '&version in program = "', TRIM( binary_version_local ), '"' 1574 CALL message( 'rrd_local', 'PA0286', 1, 2, 0, 6, 0 ) 1575 ENDIF 1576 1577 ! 1578 !-- Read number of processors, processor-id, and array ranges. 1579 !-- Compare the array ranges with those stored in the index bound array. 1580 READ ( 13 ) numprocs_on_file, myid_on_file, nxl_on_file, nxr_on_file, nys_on_file, & 1581 nyn_on_file, nzb_on_file, nzt_on_file 1582 1583 IF ( nxl_on_file /= hor_index_bounds_previous_run(1,j) ) THEN 1584 WRITE( message_string, * ) 'problem with index bound nxl on ', & 1585 'restart file "', myid_char, '"', & 1586 '&nxl = ', nxl_on_file, ' but it should be', & 1587 '&= ', hor_index_bounds_previous_run(1,j), & 1588 '&from the index bound information array' 1589 CALL message( 'rrd_local', 'PA0287', 2, 2, -1, 6, 1 ) 1590 ENDIF 1591 1592 IF ( nxr_on_file /= hor_index_bounds_previous_run(2,j) ) THEN 1593 WRITE( message_string, * ) 'problem with index bound nxr on ', & 1594 'restart file "', myid_char, '"' , & 1595 ' nxr = ', nxr_on_file, ' but it should be', & 1596 ' = ', hor_index_bounds_previous_run(2,j), & 1597 ' from the index bound information array' 1598 CALL message( 'rrd_local', 'PA0288', 2, 2, -1, 6, 1 ) 1599 1600 ENDIF 1601 1602 IF ( nys_on_file /= hor_index_bounds_previous_run(3,j) ) THEN 1603 WRITE( message_string, * ) 'problem with index bound nys on ', & 1604 'restart file "', myid_char, '"', & 1605 '&nys = ', nys_on_file, ' but it should be', & 1606 '&= ', hor_index_bounds_previous_run(3,j), & 1607 '&from the index bound information array' 1608 CALL message( 'rrd_local', 'PA0289', 2, 2, -1, 6, 1 ) 1609 ENDIF 1610 1611 IF ( nyn_on_file /= hor_index_bounds_previous_run(4,j) ) THEN 1612 WRITE( message_string, * ) 'problem with index bound nyn on ', & 1613 'restart file "', myid_char, '"', & 1614 '&nyn = ', nyn_on_file, ' but it should be', & 1615 '&= ', hor_index_bounds_previous_run(4,j), & 1616 '&from the index bound information array' 1617 CALL message( 'rrd_local', 'PA0290', 2, 2, -1, 6, 1 ) 1618 ENDIF 1619 1620 IF ( nzb_on_file /= nzb ) THEN 1621 WRITE( message_string, * ) 'mismatch between actual data and data ', & 1622 'from prior run on PE ', myid, & 1623 '&nzb on file = ', nzb_on_file, & 1624 '&nzb = ', nzb 1625 CALL message( 'rrd_local', 'PA0291', 1, 2, 0, 6, 0 ) 1626 ENDIF 1627 1628 IF ( nzt_on_file /= nzt ) THEN 1629 WRITE( message_string, * ) 'mismatch between actual data and data ', & 1630 'from prior run on PE ', myid, & 1631 '&nzt on file = ', nzt_on_file, & 1632 '&nzt = ', nzt 1633 CALL message( 'rrd_local', 'PA0292', 1, 2, 0, 6, 0 ) 1634 ENDIF 1635 1636 ! 1637 !-- Allocate temporary arrays sized as the arrays on the restart file 1638 ALLOCATE( tmp_2d(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), & 1639 tmp_3d(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 1640 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 1641 1642 ! 1643 !-- Read arrays 1644 !-- ATTENTION: If the following read commands have been altered, the 1645 !-- ---------- version number of the variable binary_version_local must 1646 !-- be altered, too. Furthermore, the output list of arrays in 1647 !-- wrd_write_local must also be altered 1648 !-- accordingly. 1649 READ ( 13 ) length 1650 READ ( 13 ) restart_string(1:length) 1651 1652 1653 ! 1654 !-- Loop over processor specific field data 1655 DO WHILE ( restart_string(1:length) /= '*** end ***' ) 1656 1657 ! 1658 !-- Map data on file as often as needed (data are read only for k=1) 1659 DO k = 1, overlap_count(i) 1660 1661 found = .FALSE. 1662 1663 ! 1664 !-- Get the index range of the subdomain on file which overlap with 1665 !-- the current subdomain 1666 nxlf = nxlfa(i,k) 1667 nxlc = nxlfa(i,k) + offset_xa(i,k) 1668 nxrf = nxrfa(i,k) 1669 nxrc = nxrfa(i,k) + offset_xa(i,k) 1670 nysf = nysfa(i,k) 1671 nysc = nysfa(i,k) + offset_ya(i,k) 1672 nynf = nynfa(i,k) 1673 nync = nynfa(i,k) + offset_ya(i,k) 1674 1675 1676 SELECT CASE ( restart_string(1:length) ) 1677 1678 CASE ( 'ghf_av' ) 1679 IF ( .NOT. ALLOCATED( ghf_av ) ) THEN 1680 ALLOCATE( ghf_av(nysg:nyng,nxlg:nxrg) ) 1681 ENDIF 1682 IF ( k == 1 ) READ ( 13 ) tmp_2d 1683 ghf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1684 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1685 1686 CASE ( 'e' ) 1687 IF ( k == 1 ) READ ( 13 ) tmp_3d 1688 e(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1689 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1690 1691 CASE ( 'e_av' ) 1692 IF ( .NOT. ALLOCATED( e_av ) ) THEN 1693 ALLOCATE( e_av(nzb:nzt+1,nys-nbgp:nyn+nbgp, & 1694 nxl-nbgp:nxr+nbgp) ) 1695 ENDIF 1696 IF ( k == 1 ) READ ( 13 ) tmp_3d 1697 e_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1698 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1699 1700 CASE ( 'kh' ) 1701 IF ( k == 1 ) READ ( 13 ) tmp_3d 1702 kh(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1703 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1704 1705 CASE ( 'kh_av' ) 1706 IF ( .NOT. ALLOCATED( kh_av ) ) THEN 1707 ALLOCATE( kh_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) 1708 ENDIF 1709 IF ( k == 1 ) READ ( 13 ) tmp_3d 1710 kh_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1711 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1712 1713 CASE ( 'km' ) 1714 IF ( k == 1 ) READ ( 13 ) tmp_3d 1715 km(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1716 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1717 1718 CASE ( 'km_av' ) 1719 IF ( .NOT. ALLOCATED( km_av ) ) THEN 1720 ALLOCATE( km_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) 1721 ENDIF 1722 IF ( k == 1 ) READ ( 13 ) tmp_3d 1723 km_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1724 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1725 1726 CASE ( 'lpt_av' ) 1727 IF ( .NOT. ALLOCATED( lpt_av ) ) THEN 1728 ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) 1729 ENDIF 1730 IF ( k == 1 ) READ ( 13 ) tmp_3d 1731 lpt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1732 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1733 1734 CASE ( 'lwp_av' ) 1735 IF ( .NOT. ALLOCATED( lwp_av ) ) THEN 1736 ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) 1737 ENDIF 1738 IF ( k == 1 ) READ ( 13 ) tmp_2d 1739 lwp_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1740 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1741 1742 CASE ( 'p' ) 1743 IF ( k == 1 ) READ ( 13 ) tmp_3d 1744 p(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1745 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1746 1747 CASE ( 'p_av' ) 1748 IF ( .NOT. ALLOCATED( p_av ) ) THEN 1749 ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1750 ENDIF 1751 IF ( k == 1 ) READ ( 13 ) tmp_3d 1752 p_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1753 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1754 1755 CASE ( 'pt' ) 1756 IF ( k == 1 ) READ ( 13 ) tmp_3d 1757 pt(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1758 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1759 1760 CASE ( 'pt_av' ) 1761 IF ( .NOT. ALLOCATED( pt_av ) ) THEN 1762 ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1763 ENDIF 1764 IF ( k == 1 ) READ ( 13 ) tmp_3d 1765 pt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1766 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1767 1768 CASE ( 'pt_2m_av' ) 1769 IF ( .NOT. ALLOCATED( pt_2m_av ) ) THEN 1770 ALLOCATE( pt_2m_av(nysg:nyng,nxlg:nxrg) ) 1771 ENDIF 1772 IF ( k == 1 ) READ ( 13 ) tmp_2d 1773 pt_2m_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1774 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1775 1776 CASE ( 'q' ) 1777 IF ( k == 1 ) READ ( 13 ) tmp_3d 1778 q(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1779 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1780 1781 CASE ( 'q_av' ) 1782 IF ( .NOT. ALLOCATED( q_av ) ) THEN 1783 ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) 1784 ENDIF 1785 IF ( k == 1 ) READ ( 13 ) tmp_3d 1786 q_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1787 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1788 1789 CASE ( 'ql' ) 1790 IF ( k == 1 ) READ ( 13 ) tmp_3d 1791 ql(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1792 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1793 1794 CASE ( 'ql_av' ) 1795 IF ( .NOT. ALLOCATED( ql_av ) ) THEN 1796 ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1797 ENDIF 1798 IF ( k == 1 ) READ ( 13 ) tmp_3d 1799 ql_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1800 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1801 1802 CASE ( 'qsurf_av' ) 1803 IF ( .NOT. ALLOCATED( qsurf_av ) ) THEN 1804 ALLOCATE( qsurf_av(nysg:nyng,nxlg:nxrg) ) 1805 ENDIF 1806 IF ( k == 1 ) READ ( 13 ) tmp_2d 1807 qsurf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1808 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1809 1810 CASE ( 'qsws_av' ) 1811 IF ( .NOT. ALLOCATED( qsws_av ) ) THEN 1812 ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) 1813 ENDIF 1814 IF ( k == 1 ) READ ( 13 ) tmp_2d 1815 qsws_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1816 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1817 1818 CASE ( 'qv_av' ) 1819 IF ( .NOT. ALLOCATED( qv_av ) ) THEN 1820 ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1821 ENDIF 1822 IF ( k == 1 ) READ ( 13 ) tmp_3d 1823 qv_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1824 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1825 1826 CASE ( 'r_a_av' ) 1827 IF ( .NOT. ALLOCATED( r_a_av ) ) THEN 1828 ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) 1829 ENDIF 1830 IF ( k == 1 ) READ ( 13 ) tmp_2d 1831 r_a_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1832 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1833 1834 CASE ( 'random_iv' ) ! still unresolved issue 1835 IF ( k == 1 ) READ ( 13 ) random_iv 1836 IF ( k == 1 ) READ ( 13 ) random_iy 1837 1838 CASE ( 'seq_random_array' ) 1839 ALLOCATE( tmp_2d_id_random(nys_on_file:nyn_on_file,nxl_on_file:nxr_on_file) ) 1840 ALLOCATE( tmp_2d_seq_random(5,nys_on_file:nyn_on_file,nxl_on_file:nxr_on_file) ) 1841 IF ( .NOT. ALLOCATED( id_random_array ) ) THEN 1842 ALLOCATE( id_random_array(nys:nyn,nxl:nxr) ) 1843 ENDIF 1844 IF ( .NOT. ALLOCATED( seq_random_array ) ) THEN 1845 ALLOCATE( seq_random_array(5,nys:nyn,nxl:nxr) ) 1846 ENDIF 1847 IF ( k == 1 ) READ ( 13 ) tmp_2d_id_random 1848 IF ( k == 1 ) READ ( 13 ) tmp_2d_seq_random 1849 id_random_array(nysc:nync,nxlc:nxrc) = tmp_2d_id_random(nysf:nynf,nxlf:nxrf) 1850 seq_random_array(:,nysc:nync,nxlc:nxrc) = tmp_2d_seq_random(:,nysf:nynf,nxlf:nxrf) 1851 DEALLOCATE( tmp_2d_id_random, tmp_2d_seq_random ) 1852 1853 CASE ( 's' ) 1854 IF ( k == 1 ) READ ( 13 ) tmp_3d 1855 s(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1856 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1857 1858 CASE ( 's_av' ) 1859 IF ( .NOT. ALLOCATED( s_av ) ) THEN 1860 ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) 1861 ENDIF 1862 IF ( k == 1 ) READ ( 13 ) tmp_3d 1863 s_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1864 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1865 1866 CASE ( 'shf_av' ) 1867 IF ( .NOT. ALLOCATED( shf_av ) ) THEN 1868 ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) 1869 ENDIF 1870 IF ( k == 1 ) READ ( 13 ) tmp_2d 1871 shf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1872 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1873 1874 CASE ( 'ssurf_av' ) 1875 IF ( .NOT. ALLOCATED( ssurf_av ) ) THEN 1876 ALLOCATE( ssurf_av(nysg:nyng,nxlg:nxrg) ) 1877 ENDIF 1878 IF ( k == 1 ) READ ( 13 ) tmp_2d 1879 ssurf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1880 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1881 1882 CASE ( 'ssws_av' ) 1883 IF ( .NOT. ALLOCATED( ssws_av ) ) THEN 1884 ALLOCATE( ssws_av(nysg:nyng,nxlg:nxrg) ) 1885 ENDIF 1886 IF ( k == 1 ) READ ( 13 ) tmp_2d 1887 ssws_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1888 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1889 1890 CASE ( 'ti_av' ) 1891 IF ( .NOT. ALLOCATED( ti_av ) ) THEN 1892 ALLOCATE( ti_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 1893 ENDIF 1894 IF ( k == 1 ) THEN 1895 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 1896 nxl_on_file:nxr_on_file) ) 1897 READ ( 13 ) tmp_3d_non_standard 1898 ENDIF 1899 ti_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 1900 1901 CASE ( 'ts_av' ) 1902 IF ( .NOT. ALLOCATED( ts_av ) ) THEN 1903 ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) 1904 ENDIF 1905 IF ( k == 1 ) READ ( 13 ) tmp_2d 1906 ts_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1907 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1908 1909 CASE ( 'tsurf_av' ) 1910 IF ( .NOT. ALLOCATED( tsurf_av ) ) THEN 1911 ALLOCATE( tsurf_av(nysg:nyng,nxlg:nxrg) ) 1912 ENDIF 1913 IF ( k == 1 ) READ ( 13 ) tmp_2d 1914 tsurf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1915 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1916 1917 CASE ( 'u' ) 1918 IF ( k == 1 ) READ ( 13 ) tmp_3d 1919 u(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1920 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1921 1922 CASE ( 'u_av' ) 1923 IF ( .NOT. ALLOCATED( u_av ) ) THEN 1924 ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1925 ENDIF 1926 IF ( k == 1 ) READ ( 13 ) tmp_3d 1927 u_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1928 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1929 1930 CASE ( 'u_center_av' ) 1931 IF ( .NOT. ALLOCATED( u_center_av ) ) THEN 1932 ALLOCATE( u_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 1933 ENDIF 1934 IF ( k == 1 ) THEN 1935 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 1936 nxl_on_file:nxr_on_file) ) 1937 READ ( 13 ) tmp_3d_non_standard 1938 ENDIF 1939 u_center_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 1940 1941 CASE ( 'uu_av' ) 1942 IF ( .NOT. ALLOCATED( uu_av ) ) THEN 1943 ALLOCATE( uu_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 1944 ENDIF 1945 IF ( k == 1 ) THEN 1946 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 1947 nxl_on_file:nxr_on_file) ) 1948 READ ( 13 ) tmp_3d_non_standard 1949 ENDIF 1950 uu_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 1951 1952 CASE ( 'uv_10m_av' ) 1953 IF ( .NOT. ALLOCATED( uv_10m_av ) ) THEN 1954 ALLOCATE( uv_10m_av(nysg:nyng,nxlg:nxrg) ) 1955 ENDIF 1956 IF ( k == 1 ) READ ( 13 ) tmp_2d 1957 uv_10m_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1958 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1959 1960 CASE ( 'u_m_l' ) 1961 IF ( k == 1 ) THEN 1962 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 1963 1:2) ) 1964 READ ( 13 ) tmp_3d_non_standard 1965 ENDIF 1966 IF ( bc_radiation_l ) THEN 1967 u_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 1968 ENDIF 1969 1970 CASE ( 'u_m_n' ) 1971 IF ( k == 1 ) THEN 1972 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,ny-1:ny, & 1973 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 1974 READ ( 13 ) tmp_3d_non_standard 1975 ENDIF 1976 IF ( bc_radiation_n ) THEN 1977 u_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 1978 ENDIF 1979 1980 CASE ( 'u_m_r' ) 1981 IF ( k == 1 ) THEN 1982 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 1983 nx-1:nx) ) 1984 READ ( 13 ) tmp_3d_non_standard 1985 ENDIF 1986 IF ( bc_radiation_r ) THEN 1987 u_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 1988 ENDIF 1989 1990 CASE ( 'u_m_s' ) 1991 IF ( k == 1 ) THEN 1992 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,0:1, & 1993 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 1994 READ ( 13 ) tmp_3d_non_standard 1995 ENDIF 1996 IF ( bc_radiation_s ) THEN 1997 u_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 1998 ENDIF 1999 2000 CASE ( 'us_av' ) 2001 IF ( .NOT. ALLOCATED( us_av ) ) THEN 2002 ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) 2003 ENDIF 2004 IF ( k == 1 ) READ ( 13 ) tmp_2d 2005 us_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2006 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2007 2008 CASE ( 'v' ) 2009 IF ( k == 1 ) READ ( 13 ) tmp_3d 2010 v(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2011 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2012 2013 CASE ( 'v_av' ) 2014 IF ( .NOT. ALLOCATED( v_av ) ) THEN 2015 ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2016 ENDIF 2017 IF ( k == 1 ) READ ( 13 ) tmp_3d 2018 v_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2019 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2020 2021 CASE ( 'v_center_av' ) 2022 IF ( .NOT. ALLOCATED( v_center_av ) ) THEN 2023 ALLOCATE( v_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2024 ENDIF 2025 IF ( k == 1 ) THEN 2026 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 2027 nxl_on_file:nxr_on_file) ) 2028 READ ( 13 ) tmp_3d_non_standard 2029 ENDIF 2030 v_center_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 2031 2032 CASE ( 'vv_av' ) 2033 IF ( .NOT. ALLOCATED( vv_av ) ) THEN 2034 ALLOCATE( vv_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2035 ENDIF 2036 IF ( k == 1 ) THEN 2037 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 2038 nxl_on_file:nxr_on_file) ) 2039 READ ( 13 ) tmp_3d_non_standard 2040 ENDIF 2041 vv_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 2042 2043 CASE ( 'v_m_l' ) 2044 IF ( k == 1 ) THEN 2045 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 2046 0:1) ) 2047 READ ( 13 ) tmp_3d_non_standard 2048 ENDIF 2049 IF ( bc_radiation_l ) THEN 2050 v_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 2051 ENDIF 2052 2053 CASE ( 'v_m_n' ) 2054 IF ( k == 1 ) THEN 2055 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,ny-1:ny, & 2056 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 2057 READ ( 13 ) tmp_3d_non_standard 2058 ENDIF 2059 IF ( bc_radiation_n ) THEN 2060 v_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 2061 ENDIF 2062 2063 CASE ( 'v_m_r' ) 2064 IF ( k == 1 ) THEN 2065 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 2066 nx-1:nx) ) 2067 READ ( 13 ) tmp_3d_non_standard 2068 ENDIF 2069 IF ( bc_radiation_r ) THEN 2070 v_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 2071 ENDIF 2072 2073 CASE ( 'v_m_s' ) 2074 IF ( k == 1 ) THEN 2075 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,1:2, & 2076 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 2077 READ ( 13 ) tmp_3d_non_standard 2078 ENDIF 2079 IF ( bc_radiation_s ) THEN 2080 v_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 2081 ENDIF 2082 2083 CASE ( 'vpt' ) 2084 IF ( k == 1 ) READ ( 13 ) tmp_3d 2085 vpt(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2086 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2087 2088 CASE ( 'vpt_av' ) 2089 IF ( .NOT. ALLOCATED( vpt_av ) ) THEN 2090 ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2091 ENDIF 2092 IF ( k == 1 ) READ ( 13 ) tmp_3d 2093 vpt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2094 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2095 2096 CASE ( 'w' ) 2097 IF ( k == 1 ) READ ( 13 ) tmp_3d 2098 w(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2099 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2100 2101 CASE ( 'w_av' ) 2102 IF ( .NOT. ALLOCATED( w_av ) ) THEN 2103 ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2104 ENDIF 2105 IF ( k == 1 ) READ ( 13 ) tmp_3d 2106 w_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2107 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2108 2109 CASE ( 'ww_av' ) 2110 IF ( .NOT. ALLOCATED( ww_av ) ) THEN 2111 ALLOCATE( ww_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2112 ENDIF 2113 IF ( k == 1 ) THEN 2114 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 2115 nxl_on_file:nxr_on_file) ) 2116 READ ( 13 ) tmp_3d_non_standard 2117 ENDIF 2118 ww_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 2119 2120 CASE ( 'w_m_l' ) 2121 IF ( k == 1 ) THEN 2122 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 2123 0:1) ) 2124 READ ( 13 ) tmp_3d_non_standard 2125 ENDIF 2126 IF ( bc_radiation_l ) THEN 2127 w_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 2128 ENDIF 2129 2130 CASE ( 'w_m_n' ) 2131 IF ( k == 1 ) THEN 2132 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,ny-1:ny, & 2133 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 2134 READ ( 13 ) tmp_3d_non_standard 2135 ENDIF 2136 IF ( bc_radiation_n ) THEN 2137 w_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 2138 ENDIF 2139 2140 CASE ( 'w_m_r' ) 2141 IF ( k == 1 ) THEN 2142 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 2143 nx-1:nx) ) 2144 READ ( 13 ) tmp_3d_non_standard 2145 ENDIF 2146 IF ( bc_radiation_r ) THEN 2147 w_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 2148 ENDIF 2149 2150 CASE ( 'w_m_s' ) 2151 IF ( k == 1 ) THEN 2152 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,0:1, & 2153 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 2154 READ ( 13 ) tmp_3d_non_standard 2155 ENDIF 2156 IF ( bc_radiation_s ) THEN 2157 w_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 2158 ENDIF 2159 2160 CASE ( 'wspeed_av' ) 2161 IF ( .NOT. ALLOCATED( wspeed_av ) ) THEN 2162 ALLOCATE( wspeed_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2163 ENDIF 2164 IF ( k == 1 ) THEN 2165 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 2166 nxl_on_file:nxr_on_file) ) 2167 READ ( 13 ) tmp_3d_non_standard 2168 ENDIF 2169 wspeed_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 2170 2171 CASE ( 'z0_av' ) 2172 IF ( .NOT. ALLOCATED( z0_av ) ) THEN 2173 ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) 2174 ENDIF 2175 IF ( k == 1 ) READ ( 13 ) tmp_2d 2176 z0_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2177 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2178 2179 CASE ( 'z0h_av' ) 2180 IF ( .NOT. ALLOCATED( z0h_av ) ) THEN 2181 ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) 2182 ENDIF 2183 IF ( k == 1 ) READ ( 13 ) tmp_2d 2184 z0h_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2185 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2186 2187 CASE ( 'z0q_av' ) 2188 IF ( .NOT. ALLOCATED( z0q_av ) ) THEN 2189 ALLOCATE( z0q_av(nysg:nyng,nxlg:nxrg) ) 2190 ENDIF 2191 IF ( k == 1 ) READ ( 13 ) tmp_2d 2192 z0q_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2193 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2194 2195 CASE DEFAULT 2196 2197 ! 2198 !-- Read restart data of surfaces 2199 IF ( .NOT. found ) CALL surface_rrd_local( k, nxlf, nxlc, nxl_on_file, nxrf, & 2200 nxr_on_file, nynf, nyn_on_file, & 2201 nysf, nysc, nys_on_file, found ) 2202 ! 2203 !-- Read restart data of other modules 2204 IF ( .NOT. found ) CALL module_interface_rrd_local( & 2205 k, nxlf, nxlc, nxl_on_file, nxrf, & 2206 nxrc, nxr_on_file, nynf, nync, & 2207 nyn_on_file, nysf, nysc, & 2208 nys_on_file, tmp_2d, tmp_3d, found ) 2209 2210 2211 IF ( .NOT. found ) THEN 2212 WRITE( message_string, * ) 'unknown variable named "', & 2213 restart_string(1:length), & 2214 '" found in subdomain data ', & 2215 'from prior run on PE ', myid 2216 CALL message( 'rrd_local', 'PA0302', 1, 2, 0, 6, 0 ) 2217 2218 ENDIF 2219 2220 END SELECT 2221 2222 ENDDO ! overlaploop 2223 2224 ! 2225 !-- Deallocate non standard array needed for specific variables only 2226 IF ( ALLOCATED( tmp_3d_non_standard ) ) DEALLOCATE( tmp_3d_non_standard ) 2227 2228 ! 2229 !-- Read next character string 1551 ENDIF 1552 1553 ! 1554 !-- Read data from all restart files determined above 1555 DO i = 1, files_to_be_opened 1556 1557 j = file_list(i) 1558 ! 1559 !-- Set the filename (underscore followed by four digit processor id) 1560 WRITE (myid_char,'(''_'',I6.6)') j 1561 1562 ! 1563 !-- Open the restart file. If this file has been created by PE0 (_000000), 1564 !-- the global variables at the beginning of the file have to be skipped 1565 !-- first. 1566 CALL check_open( 13 ) 1567 IF ( j == 0 ) CALL rrd_skip_global 1568 1569 ! 1570 !-- First compare the version numbers 2230 1571 READ ( 13 ) length 2231 1572 READ ( 13 ) restart_string(1:length) 2232 2233 ENDDO ! dataloop 2234 ! 2235 !-- Close the restart file 2236 CALL close_file( 13 ) 2237 2238 DEALLOCATE( tmp_2d, tmp_3d ) 2239 2240 ENDDO ! loop over restart files 2241 ! 2242 !-- Deallocate temporary buffer arrays 2243 DEALLOCATE( nxlfa ) 2244 DEALLOCATE( nxrfa ) 2245 DEALLOCATE( nynfa ) 2246 DEALLOCATE( nysfa ) 2247 DEALLOCATE( offset_xa ) 2248 DEALLOCATE( offset_ya ) 2249 ! 2250 !-- Restore the original filename for the restart file to be written 2251 myid_char = myid_char_save 1573 READ ( 13 ) version_on_file 1574 1575 binary_version_local = '4.7' 1576 IF ( TRIM( version_on_file ) /= TRIM( binary_version_local ) ) THEN 1577 WRITE( message_string, * ) 'version mismatch concerning ', & 1578 'binary_version_local:', & 1579 '&version on file = "', TRIM( version_on_file ), '"', & 1580 '&version in program = "', TRIM( binary_version_local ), '"' 1581 CALL message( 'rrd_local', 'PA0286', 1, 2, 0, 6, 0 ) 1582 ENDIF 1583 1584 ! 1585 !-- Read number of processors, processor-id, and array ranges. 1586 !-- Compare the array ranges with those stored in the index bound array. 1587 READ ( 13 ) numprocs_on_file, myid_on_file, nxl_on_file, nxr_on_file, nys_on_file, & 1588 nyn_on_file, nzb_on_file, nzt_on_file 1589 1590 IF ( nxl_on_file /= hor_index_bounds_previous_run(1,j) ) THEN 1591 WRITE( message_string, * ) 'problem with index bound nxl on ', & 1592 'restart file "', myid_char, '"', & 1593 '&nxl = ', nxl_on_file, ' but it should be', & 1594 '&= ', hor_index_bounds_previous_run(1,j), & 1595 '&from the index bound information array' 1596 CALL message( 'rrd_local', 'PA0287', 2, 2, -1, 6, 1 ) 1597 ENDIF 1598 1599 IF ( nxr_on_file /= hor_index_bounds_previous_run(2,j) ) THEN 1600 WRITE( message_string, * ) 'problem with index bound nxr on ', & 1601 'restart file "', myid_char, '"' , & 1602 ' nxr = ', nxr_on_file, ' but it should be', & 1603 ' = ', hor_index_bounds_previous_run(2,j), & 1604 ' from the index bound information array' 1605 CALL message( 'rrd_local', 'PA0288', 2, 2, -1, 6, 1 ) 1606 1607 ENDIF 1608 1609 IF ( nys_on_file /= hor_index_bounds_previous_run(3,j) ) THEN 1610 WRITE( message_string, * ) 'problem with index bound nys on ', & 1611 'restart file "', myid_char, '"', & 1612 '&nys = ', nys_on_file, ' but it should be', & 1613 '&= ', hor_index_bounds_previous_run(3,j), & 1614 '&from the index bound information array' 1615 CALL message( 'rrd_local', 'PA0289', 2, 2, -1, 6, 1 ) 1616 ENDIF 1617 1618 IF ( nyn_on_file /= hor_index_bounds_previous_run(4,j) ) THEN 1619 WRITE( message_string, * ) 'problem with index bound nyn on ', & 1620 'restart file "', myid_char, '"', & 1621 '&nyn = ', nyn_on_file, ' but it should be', & 1622 '&= ', hor_index_bounds_previous_run(4,j), & 1623 '&from the index bound information array' 1624 CALL message( 'rrd_local', 'PA0290', 2, 2, -1, 6, 1 ) 1625 ENDIF 1626 1627 IF ( nzb_on_file /= nzb ) THEN 1628 WRITE( message_string, * ) 'mismatch between actual data and data ', & 1629 'from prior run on PE ', myid, & 1630 '&nzb on file = ', nzb_on_file, & 1631 '&nzb = ', nzb 1632 CALL message( 'rrd_local', 'PA0291', 1, 2, 0, 6, 0 ) 1633 ENDIF 1634 1635 IF ( nzt_on_file /= nzt ) THEN 1636 WRITE( message_string, * ) 'mismatch between actual data and data ', & 1637 'from prior run on PE ', myid, & 1638 '&nzt on file = ', nzt_on_file, & 1639 '&nzt = ', nzt 1640 CALL message( 'rrd_local', 'PA0292', 1, 2, 0, 6, 0 ) 1641 ENDIF 1642 1643 ! 1644 !-- Allocate temporary arrays sized as the arrays on the restart file 1645 ALLOCATE( tmp_2d(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), & 1646 tmp_3d(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 1647 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 1648 1649 ! 1650 !-- Read arrays 1651 !-- ATTENTION: If the following read commands have been altered, the 1652 !-- ---------- version number of the variable binary_version_local must 1653 !-- be altered, too. Furthermore, the output list of arrays in 1654 !-- wrd_write_local must also be altered 1655 !-- accordingly. 1656 READ ( 13 ) length 1657 READ ( 13 ) restart_string(1:length) 1658 1659 1660 ! 1661 !-- Loop over processor specific field data 1662 DO WHILE ( restart_string(1:length) /= '*** end ***' ) 1663 1664 ! 1665 !-- Map data on file as often as needed (data are read only for k=1) 1666 DO k = 1, overlap_count(i) 1667 1668 found = .FALSE. 1669 1670 ! 1671 !-- Get the index range of the subdomain on file which overlap with 1672 !-- the current subdomain 1673 nxlf = nxlfa(i,k) 1674 nxlc = nxlfa(i,k) + offset_xa(i,k) 1675 nxrf = nxrfa(i,k) 1676 nxrc = nxrfa(i,k) + offset_xa(i,k) 1677 nysf = nysfa(i,k) 1678 nysc = nysfa(i,k) + offset_ya(i,k) 1679 nynf = nynfa(i,k) 1680 nync = nynfa(i,k) + offset_ya(i,k) 1681 1682 1683 SELECT CASE ( restart_string(1:length) ) 1684 1685 CASE ( 'ghf_av' ) 1686 IF ( .NOT. ALLOCATED( ghf_av ) ) THEN 1687 ALLOCATE( ghf_av(nysg:nyng,nxlg:nxrg) ) 1688 ENDIF 1689 IF ( k == 1 ) READ ( 13 ) tmp_2d 1690 ghf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1691 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1692 1693 CASE ( 'e' ) 1694 IF ( k == 1 ) READ ( 13 ) tmp_3d 1695 e(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1696 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1697 1698 CASE ( 'e_av' ) 1699 IF ( .NOT. ALLOCATED( e_av ) ) THEN 1700 ALLOCATE( e_av(nzb:nzt+1,nys-nbgp:nyn+nbgp, & 1701 nxl-nbgp:nxr+nbgp) ) 1702 ENDIF 1703 IF ( k == 1 ) READ ( 13 ) tmp_3d 1704 e_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1705 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1706 1707 CASE ( 'kh' ) 1708 IF ( k == 1 ) READ ( 13 ) tmp_3d 1709 kh(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1710 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1711 1712 CASE ( 'kh_av' ) 1713 IF ( .NOT. ALLOCATED( kh_av ) ) THEN 1714 ALLOCATE( kh_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) 1715 ENDIF 1716 IF ( k == 1 ) READ ( 13 ) tmp_3d 1717 kh_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1718 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1719 1720 CASE ( 'km' ) 1721 IF ( k == 1 ) READ ( 13 ) tmp_3d 1722 km(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1723 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1724 1725 CASE ( 'km_av' ) 1726 IF ( .NOT. ALLOCATED( km_av ) ) THEN 1727 ALLOCATE( km_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) 1728 ENDIF 1729 IF ( k == 1 ) READ ( 13 ) tmp_3d 1730 km_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1731 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1732 1733 CASE ( 'lpt_av' ) 1734 IF ( .NOT. ALLOCATED( lpt_av ) ) THEN 1735 ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) 1736 ENDIF 1737 IF ( k == 1 ) READ ( 13 ) tmp_3d 1738 lpt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1739 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1740 1741 CASE ( 'lwp_av' ) 1742 IF ( .NOT. ALLOCATED( lwp_av ) ) THEN 1743 ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) 1744 ENDIF 1745 IF ( k == 1 ) READ ( 13 ) tmp_2d 1746 lwp_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1747 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1748 1749 CASE ( 'p' ) 1750 IF ( k == 1 ) READ ( 13 ) tmp_3d 1751 p(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1752 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1753 1754 CASE ( 'p_av' ) 1755 IF ( .NOT. ALLOCATED( p_av ) ) THEN 1756 ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1757 ENDIF 1758 IF ( k == 1 ) READ ( 13 ) tmp_3d 1759 p_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1760 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1761 1762 CASE ( 'pt' ) 1763 IF ( k == 1 ) READ ( 13 ) tmp_3d 1764 pt(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1765 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1766 1767 CASE ( 'pt_av' ) 1768 IF ( .NOT. ALLOCATED( pt_av ) ) THEN 1769 ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1770 ENDIF 1771 IF ( k == 1 ) READ ( 13 ) tmp_3d 1772 pt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1773 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1774 1775 CASE ( 'pt_2m_av' ) 1776 IF ( .NOT. ALLOCATED( pt_2m_av ) ) THEN 1777 ALLOCATE( pt_2m_av(nysg:nyng,nxlg:nxrg) ) 1778 ENDIF 1779 IF ( k == 1 ) READ ( 13 ) tmp_2d 1780 pt_2m_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1781 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1782 1783 CASE ( 'q' ) 1784 IF ( k == 1 ) READ ( 13 ) tmp_3d 1785 q(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1786 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1787 1788 CASE ( 'q_av' ) 1789 IF ( .NOT. ALLOCATED( q_av ) ) THEN 1790 ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) 1791 ENDIF 1792 IF ( k == 1 ) READ ( 13 ) tmp_3d 1793 q_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1794 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1795 1796 CASE ( 'ql' ) 1797 IF ( k == 1 ) READ ( 13 ) tmp_3d 1798 ql(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1799 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1800 1801 CASE ( 'ql_av' ) 1802 IF ( .NOT. ALLOCATED( ql_av ) ) THEN 1803 ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1804 ENDIF 1805 IF ( k == 1 ) READ ( 13 ) tmp_3d 1806 ql_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1807 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1808 1809 CASE ( 'qsurf_av' ) 1810 IF ( .NOT. ALLOCATED( qsurf_av ) ) THEN 1811 ALLOCATE( qsurf_av(nysg:nyng,nxlg:nxrg) ) 1812 ENDIF 1813 IF ( k == 1 ) READ ( 13 ) tmp_2d 1814 qsurf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1815 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1816 1817 CASE ( 'qsws_av' ) 1818 IF ( .NOT. ALLOCATED( qsws_av ) ) THEN 1819 ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) 1820 ENDIF 1821 IF ( k == 1 ) READ ( 13 ) tmp_2d 1822 qsws_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1823 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1824 1825 CASE ( 'qv_av' ) 1826 IF ( .NOT. ALLOCATED( qv_av ) ) THEN 1827 ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1828 ENDIF 1829 IF ( k == 1 ) READ ( 13 ) tmp_3d 1830 qv_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1831 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1832 1833 CASE ( 'r_a_av' ) 1834 IF ( .NOT. ALLOCATED( r_a_av ) ) THEN 1835 ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) 1836 ENDIF 1837 IF ( k == 1 ) READ ( 13 ) tmp_2d 1838 r_a_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1839 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1840 1841 CASE ( 'random_iv' ) ! still unresolved issue 1842 IF ( k == 1 ) READ ( 13 ) random_iv 1843 IF ( k == 1 ) READ ( 13 ) random_iy 1844 1845 CASE ( 'seq_random_array' ) 1846 ALLOCATE( tmp_2d_id_random(nys_on_file:nyn_on_file,nxl_on_file:nxr_on_file) ) 1847 ALLOCATE( tmp_2d_seq_random(5,nys_on_file:nyn_on_file,nxl_on_file:nxr_on_file) ) 1848 IF ( .NOT. ALLOCATED( id_random_array ) ) THEN 1849 ALLOCATE( id_random_array(nys:nyn,nxl:nxr) ) 1850 ENDIF 1851 IF ( .NOT. ALLOCATED( seq_random_array ) ) THEN 1852 ALLOCATE( seq_random_array(5,nys:nyn,nxl:nxr) ) 1853 ENDIF 1854 IF ( k == 1 ) READ ( 13 ) tmp_2d_id_random 1855 IF ( k == 1 ) READ ( 13 ) tmp_2d_seq_random 1856 id_random_array(nysc:nync,nxlc:nxrc) = tmp_2d_id_random(nysf:nynf,nxlf:nxrf) 1857 seq_random_array(:,nysc:nync,nxlc:nxrc) = tmp_2d_seq_random(:,nysf:nynf,nxlf:nxrf) 1858 DEALLOCATE( tmp_2d_id_random, tmp_2d_seq_random ) 1859 1860 CASE ( 's' ) 1861 IF ( k == 1 ) READ ( 13 ) tmp_3d 1862 s(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1863 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1864 1865 CASE ( 's_av' ) 1866 IF ( .NOT. ALLOCATED( s_av ) ) THEN 1867 ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) 1868 ENDIF 1869 IF ( k == 1 ) READ ( 13 ) tmp_3d 1870 s_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1871 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1872 1873 CASE ( 'shf_av' ) 1874 IF ( .NOT. ALLOCATED( shf_av ) ) THEN 1875 ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) 1876 ENDIF 1877 IF ( k == 1 ) READ ( 13 ) tmp_2d 1878 shf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1879 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1880 1881 CASE ( 'ssurf_av' ) 1882 IF ( .NOT. ALLOCATED( ssurf_av ) ) THEN 1883 ALLOCATE( ssurf_av(nysg:nyng,nxlg:nxrg) ) 1884 ENDIF 1885 IF ( k == 1 ) READ ( 13 ) tmp_2d 1886 ssurf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1887 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1888 1889 CASE ( 'ssws_av' ) 1890 IF ( .NOT. ALLOCATED( ssws_av ) ) THEN 1891 ALLOCATE( ssws_av(nysg:nyng,nxlg:nxrg) ) 1892 ENDIF 1893 IF ( k == 1 ) READ ( 13 ) tmp_2d 1894 ssws_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1895 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1896 1897 CASE ( 'ti_av' ) 1898 IF ( .NOT. ALLOCATED( ti_av ) ) THEN 1899 ALLOCATE( ti_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 1900 ENDIF 1901 IF ( k == 1 ) THEN 1902 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 1903 nxl_on_file:nxr_on_file) ) 1904 READ ( 13 ) tmp_3d_non_standard 1905 ENDIF 1906 ti_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 1907 1908 CASE ( 'ts_av' ) 1909 IF ( .NOT. ALLOCATED( ts_av ) ) THEN 1910 ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) 1911 ENDIF 1912 IF ( k == 1 ) READ ( 13 ) tmp_2d 1913 ts_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1914 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1915 1916 CASE ( 'tsurf_av' ) 1917 IF ( .NOT. ALLOCATED( tsurf_av ) ) THEN 1918 ALLOCATE( tsurf_av(nysg:nyng,nxlg:nxrg) ) 1919 ENDIF 1920 IF ( k == 1 ) READ ( 13 ) tmp_2d 1921 tsurf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1922 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1923 1924 CASE ( 'u' ) 1925 IF ( k == 1 ) READ ( 13 ) tmp_3d 1926 u(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1927 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1928 1929 CASE ( 'u_av' ) 1930 IF ( .NOT. ALLOCATED( u_av ) ) THEN 1931 ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1932 ENDIF 1933 IF ( k == 1 ) READ ( 13 ) tmp_3d 1934 u_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1935 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1936 1937 CASE ( 'u_center_av' ) 1938 IF ( .NOT. ALLOCATED( u_center_av ) ) THEN 1939 ALLOCATE( u_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 1940 ENDIF 1941 IF ( k == 1 ) THEN 1942 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 1943 nxl_on_file:nxr_on_file) ) 1944 READ ( 13 ) tmp_3d_non_standard 1945 ENDIF 1946 u_center_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 1947 1948 CASE ( 'uu_av' ) 1949 IF ( .NOT. ALLOCATED( uu_av ) ) THEN 1950 ALLOCATE( uu_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 1951 ENDIF 1952 IF ( k == 1 ) THEN 1953 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 1954 nxl_on_file:nxr_on_file) ) 1955 READ ( 13 ) tmp_3d_non_standard 1956 ENDIF 1957 uu_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 1958 1959 CASE ( 'uv_10m_av' ) 1960 IF ( .NOT. ALLOCATED( uv_10m_av ) ) THEN 1961 ALLOCATE( uv_10m_av(nysg:nyng,nxlg:nxrg) ) 1962 ENDIF 1963 IF ( k == 1 ) READ ( 13 ) tmp_2d 1964 uv_10m_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 1965 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 1966 1967 CASE ( 'u_m_l' ) 1968 IF ( k == 1 ) THEN 1969 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 1970 1:2) ) 1971 READ ( 13 ) tmp_3d_non_standard 1972 ENDIF 1973 IF ( bc_radiation_l ) THEN 1974 u_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 1975 ENDIF 1976 1977 CASE ( 'u_m_n' ) 1978 IF ( k == 1 ) THEN 1979 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,ny-1:ny, & 1980 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 1981 READ ( 13 ) tmp_3d_non_standard 1982 ENDIF 1983 IF ( bc_radiation_n ) THEN 1984 u_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 1985 ENDIF 1986 1987 CASE ( 'u_m_r' ) 1988 IF ( k == 1 ) THEN 1989 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 1990 nx-1:nx) ) 1991 READ ( 13 ) tmp_3d_non_standard 1992 ENDIF 1993 IF ( bc_radiation_r ) THEN 1994 u_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 1995 ENDIF 1996 1997 CASE ( 'u_m_s' ) 1998 IF ( k == 1 ) THEN 1999 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,0:1, & 2000 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 2001 READ ( 13 ) tmp_3d_non_standard 2002 ENDIF 2003 IF ( bc_radiation_s ) THEN 2004 u_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 2005 ENDIF 2006 2007 CASE ( 'us_av' ) 2008 IF ( .NOT. ALLOCATED( us_av ) ) THEN 2009 ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) 2010 ENDIF 2011 IF ( k == 1 ) READ ( 13 ) tmp_2d 2012 us_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2013 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2014 2015 CASE ( 'v' ) 2016 IF ( k == 1 ) READ ( 13 ) tmp_3d 2017 v(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2018 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2019 2020 CASE ( 'v_av' ) 2021 IF ( .NOT. ALLOCATED( v_av ) ) THEN 2022 ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2023 ENDIF 2024 IF ( k == 1 ) READ ( 13 ) tmp_3d 2025 v_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2026 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2027 2028 CASE ( 'v_center_av' ) 2029 IF ( .NOT. ALLOCATED( v_center_av ) ) THEN 2030 ALLOCATE( v_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2031 ENDIF 2032 IF ( k == 1 ) THEN 2033 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 2034 nxl_on_file:nxr_on_file) ) 2035 READ ( 13 ) tmp_3d_non_standard 2036 ENDIF 2037 v_center_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 2038 2039 CASE ( 'vv_av' ) 2040 IF ( .NOT. ALLOCATED( vv_av ) ) THEN 2041 ALLOCATE( vv_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2042 ENDIF 2043 IF ( k == 1 ) THEN 2044 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 2045 nxl_on_file:nxr_on_file) ) 2046 READ ( 13 ) tmp_3d_non_standard 2047 ENDIF 2048 vv_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 2049 2050 CASE ( 'v_m_l' ) 2051 IF ( k == 1 ) THEN 2052 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 2053 0:1) ) 2054 READ ( 13 ) tmp_3d_non_standard 2055 ENDIF 2056 IF ( bc_radiation_l ) THEN 2057 v_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 2058 ENDIF 2059 2060 CASE ( 'v_m_n' ) 2061 IF ( k == 1 ) THEN 2062 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,ny-1:ny, & 2063 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 2064 READ ( 13 ) tmp_3d_non_standard 2065 ENDIF 2066 IF ( bc_radiation_n ) THEN 2067 v_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 2068 ENDIF 2069 2070 CASE ( 'v_m_r' ) 2071 IF ( k == 1 ) THEN 2072 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 2073 nx-1:nx) ) 2074 READ ( 13 ) tmp_3d_non_standard 2075 ENDIF 2076 IF ( bc_radiation_r ) THEN 2077 v_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 2078 ENDIF 2079 2080 CASE ( 'v_m_s' ) 2081 IF ( k == 1 ) THEN 2082 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,1:2, & 2083 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 2084 READ ( 13 ) tmp_3d_non_standard 2085 ENDIF 2086 IF ( bc_radiation_s ) THEN 2087 v_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 2088 ENDIF 2089 2090 CASE ( 'vpt' ) 2091 IF ( k == 1 ) READ ( 13 ) tmp_3d 2092 vpt(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2093 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2094 2095 CASE ( 'vpt_av' ) 2096 IF ( .NOT. ALLOCATED( vpt_av ) ) THEN 2097 ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2098 ENDIF 2099 IF ( k == 1 ) READ ( 13 ) tmp_3d 2100 vpt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2101 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2102 2103 CASE ( 'w' ) 2104 IF ( k == 1 ) READ ( 13 ) tmp_3d 2105 w(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2106 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2107 2108 CASE ( 'w_av' ) 2109 IF ( .NOT. ALLOCATED( w_av ) ) THEN 2110 ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2111 ENDIF 2112 IF ( k == 1 ) READ ( 13 ) tmp_3d 2113 w_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2114 tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2115 2116 CASE ( 'ww_av' ) 2117 IF ( .NOT. ALLOCATED( ww_av ) ) THEN 2118 ALLOCATE( ww_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2119 ENDIF 2120 IF ( k == 1 ) THEN 2121 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 2122 nxl_on_file:nxr_on_file) ) 2123 READ ( 13 ) tmp_3d_non_standard 2124 ENDIF 2125 ww_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 2126 2127 CASE ( 'w_m_l' ) 2128 IF ( k == 1 ) THEN 2129 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 2130 0:1) ) 2131 READ ( 13 ) tmp_3d_non_standard 2132 ENDIF 2133 IF ( bc_radiation_l ) THEN 2134 w_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 2135 ENDIF 2136 2137 CASE ( 'w_m_n' ) 2138 IF ( k == 1 ) THEN 2139 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,ny-1:ny, & 2140 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 2141 READ ( 13 ) tmp_3d_non_standard 2142 ENDIF 2143 IF ( bc_radiation_n ) THEN 2144 w_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 2145 ENDIF 2146 2147 CASE ( 'w_m_r' ) 2148 IF ( k == 1 ) THEN 2149 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & 2150 nx-1:nx) ) 2151 READ ( 13 ) tmp_3d_non_standard 2152 ENDIF 2153 IF ( bc_radiation_r ) THEN 2154 w_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3d_non_standard(:,nysf-nbgp:nynf+nbgp,:) 2155 ENDIF 2156 2157 CASE ( 'w_m_s' ) 2158 IF ( k == 1 ) THEN 2159 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,0:1, & 2160 nxl_on_file-nbgp:nxr_on_file+nbgp) ) 2161 READ ( 13 ) tmp_3d_non_standard 2162 ENDIF 2163 IF ( bc_radiation_s ) THEN 2164 w_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3d_non_standard(:,:,nxlf-nbgp:nxrf+nbgp) 2165 ENDIF 2166 2167 CASE ( 'wspeed_av' ) 2168 IF ( .NOT. ALLOCATED( wspeed_av ) ) THEN 2169 ALLOCATE( wspeed_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2170 ENDIF 2171 IF ( k == 1 ) THEN 2172 ALLOCATE( tmp_3d_non_standard(nzb:nzt+1,nys_on_file:nyn_on_file, & 2173 nxl_on_file:nxr_on_file) ) 2174 READ ( 13 ) tmp_3d_non_standard 2175 ENDIF 2176 wspeed_av(:,nysc:nync,nxlc:nxrc) = tmp_3d_non_standard(:,nysf:nynf,nxlf:nxrf) 2177 2178 CASE ( 'z0_av' ) 2179 IF ( .NOT. ALLOCATED( z0_av ) ) THEN 2180 ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) 2181 ENDIF 2182 IF ( k == 1 ) READ ( 13 ) tmp_2d 2183 z0_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2184 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2185 2186 CASE ( 'z0h_av' ) 2187 IF ( .NOT. ALLOCATED( z0h_av ) ) THEN 2188 ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) 2189 ENDIF 2190 IF ( k == 1 ) READ ( 13 ) tmp_2d 2191 z0h_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2192 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2193 2194 CASE ( 'z0q_av' ) 2195 IF ( .NOT. ALLOCATED( z0q_av ) ) THEN 2196 ALLOCATE( z0q_av(nysg:nyng,nxlg:nxrg) ) 2197 ENDIF 2198 IF ( k == 1 ) READ ( 13 ) tmp_2d 2199 z0q_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & 2200 tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) 2201 2202 CASE DEFAULT 2203 2204 ! 2205 !-- Read restart data of surfaces 2206 IF ( .NOT. found ) CALL surface_rrd_local( k, nxlf, nxlc, nxl_on_file, nxrf, & 2207 nxr_on_file, nynf, nyn_on_file, & 2208 nysf, nysc, nys_on_file, found ) 2209 ! 2210 !-- Read restart data of other modules 2211 IF ( .NOT. found ) CALL module_interface_rrd_local( & 2212 k, nxlf, nxlc, nxl_on_file, nxrf, & 2213 nxrc, nxr_on_file, nynf, nync, & 2214 nyn_on_file, nysf, nysc, & 2215 nys_on_file, tmp_2d, tmp_3d, found ) 2216 2217 2218 IF ( .NOT. found ) THEN 2219 WRITE( message_string, * ) 'unknown variable named "', & 2220 restart_string(1:length), & 2221 '" found in subdomain data ', & 2222 'from prior run on PE ', myid 2223 CALL message( 'rrd_local', 'PA0302', 1, 2, 0, 6, 0 ) 2224 2225 ENDIF 2226 2227 END SELECT 2228 2229 ENDDO ! overlaploop 2230 2231 ! 2232 !-- Deallocate non standard array needed for specific variables only 2233 IF ( ALLOCATED( tmp_3d_non_standard ) ) DEALLOCATE( tmp_3d_non_standard ) 2234 2235 ! 2236 !-- Read next character string 2237 READ ( 13 ) length 2238 READ ( 13 ) restart_string(1:length) 2239 2240 ENDDO ! dataloop 2241 ! 2242 !-- Close the restart file 2243 CALL close_file( 13 ) 2244 2245 DEALLOCATE( tmp_2d, tmp_3d ) 2246 2247 ENDDO ! loop over restart files 2248 ! 2249 !-- Deallocate temporary buffer arrays 2250 DEALLOCATE( nxlfa ) 2251 DEALLOCATE( nxrfa ) 2252 DEALLOCATE( nynfa ) 2253 DEALLOCATE( nysfa ) 2254 DEALLOCATE( offset_xa ) 2255 DEALLOCATE( offset_ya ) 2256 ! 2257 !-- Restore the original filename for the restart file to be written 2258 myid_char = myid_char_save 2259 2260 2261 ELSEIF ( TRIM( restart_data_format_input ) == 'mpi' ) THEN 2262 2263 ! 2264 !-- Read global restart data using MPI-IO 2265 ! 2266 !-- Open the MPI-IO restart file. 2267 CALL rd_mpi_io_open( 'read', 'BININ' // TRIM( coupling_char ) ) 2268 2269 2270 CALL rd_mpi_io_check_array( 'ghf_av' , found = array_found ) 2271 IF ( array_found ) THEN 2272 IF (.NOT. ALLOCATED( ghf_av ) ) ALLOCATE( ghf_av(nysg:nyng,nxlg:nxrg) ) 2273 CALL rrd_mpi_io( 'ghf_av', ghf_av ) 2274 ENDIF 2275 2276 CALL rrd_mpi_io( 'e', e ) 2277 2278 CALL rd_mpi_io_check_array( 'e_av' , found = array_found ) 2279 IF ( array_found ) THEN 2280 IF ( .NOT. ALLOCATED( e_av ) ) ALLOCATE( e_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2281 CALL rrd_mpi_io( 'e_av', e_av ) 2282 ENDIF 2283 2284 CALL rrd_mpi_io( 'kh', kh ) 2285 2286 CALL rd_mpi_io_check_array( 'kh_av' , found = array_found ) 2287 IF ( array_found ) THEN 2288 IF ( .NOT. ALLOCATED( kh_av ) ) ALLOCATE( kh_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2289 CALL rrd_mpi_io( 'kh_av', kh_av ) 2290 ENDIF 2291 2292 CALL rrd_mpi_io( 'km' , km) 2293 2294 CALL rd_mpi_io_check_array( 'km_av' , found = array_found ) 2295 IF ( array_found ) THEN 2296 IF ( .NOT. ALLOCATED( km_av ) ) ALLOCATE( km_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2297 CALL rrd_mpi_io( 'km_av', km_av ) 2298 ENDIF 2299 2300 CALL rd_mpi_io_check_array( 'lpt_av' , found = array_found ) 2301 IF ( array_found ) THEN 2302 IF ( .NOT. ALLOCATED( lpt_av ) ) ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2303 CALL rrd_mpi_io( 'lpt_av', lpt_av ) 2304 ENDIF 2305 2306 CALL rd_mpi_io_check_array( 'lwp_av' , found = array_found ) 2307 IF ( array_found ) THEN 2308 IF ( .NOT. ALLOCATED( lwp_av ) ) ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) 2309 CALL rrd_mpi_io( 'lwp_av', lwp_av ) 2310 ENDIF 2311 2312 CALL rrd_mpi_io( 'p', p) 2313 2314 CALL rd_mpi_io_check_array( 'p_av' , found = array_found ) 2315 IF ( array_found ) THEN 2316 IF ( .NOT. ALLOCATED( p_av ) ) ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2317 CALL rrd_mpi_io( 'p_av', p_av ) 2318 ENDIF 2319 2320 CALL rrd_mpi_io( 'pt', pt) 2321 2322 CALL rd_mpi_io_check_array( 'pt_av' , found = array_found ) 2323 IF ( array_found ) THEN 2324 IF ( .NOT. ALLOCATED( pt_av ) ) ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2325 CALL rrd_mpi_io( 'pt_av', pt_av ) 2326 ENDIF 2327 2328 CALL rd_mpi_io_check_array( 'pt_2m_av' , found = array_found ) 2329 IF ( array_found ) THEN 2330 IF ( .NOT. ALLOCATED( pt_2m_av ) ) ALLOCATE( pt_2m_av(nysg:nyng,nxlg:nxrg) ) 2331 CALL rrd_mpi_io( 'pt_2m_av', pt_2m_av ) 2332 ENDIF 2333 2334 CALL rd_mpi_io_check_array( 'q' , found = array_found ) 2335 IF ( array_found ) THEN 2336 CALL rrd_mpi_io( 'q', q ) 2337 ENDIF 2338 2339 CALL rd_mpi_io_check_array( 'q_av' , found = array_found ) 2340 IF ( array_found ) THEN 2341 IF ( .NOT. ALLOCATED( q_av ) ) ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2342 CALL rrd_mpi_io( 'q_av', q_av ) 2343 ENDIF 2344 2345 CALL rd_mpi_io_check_array( 'ql' , found = array_found ) 2346 IF ( array_found ) THEN 2347 CALL rrd_mpi_io( 'ql', ql ) 2348 ENDIF 2349 2350 CALL rd_mpi_io_check_array( 'ql_av' , found = array_found ) 2351 IF ( array_found ) THEN 2352 IF ( .NOT. ALLOCATED( ql_av ) ) ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2353 CALL rrd_mpi_io( 'ql_av', ql_av ) 2354 ENDIF 2355 2356 CALL rd_mpi_io_check_array( 'qsurf_av' , found = array_found ) 2357 IF ( array_found ) THEN 2358 IF ( .NOT. ALLOCATED( qsurf_av ) ) ALLOCATE( qsurf_av(nysg:nyng,nxlg:nxrg) ) 2359 CALL rrd_mpi_io( 'qsurf_av', qsurf_av ) 2360 ENDIF 2361 2362 CALL rd_mpi_io_check_array( 'qsws_av' , found = array_found ) 2363 IF ( array_found ) THEN 2364 IF ( .NOT. ALLOCATED( qsws_av ) ) ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) 2365 CALL rrd_mpi_io( 'qsws_av', qsws_av ) 2366 ENDIF 2367 2368 CALL rd_mpi_io_check_array( 'qv_av' , found = array_found ) 2369 IF ( array_found ) THEN 2370 IF ( .NOT. ALLOCATED( qv_av ) ) ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2371 CALL rrd_mpi_io( 'qv_av', qv_av ) 2372 ENDIF 2373 2374 CALL rd_mpi_io_check_array( 'r_a_av' , found = array_found ) 2375 IF ( array_found ) THEN 2376 IF ( .NOT. ALLOCATED( r_a_av ) ) ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) 2377 CALL rrd_mpi_io( 'r_a_av', r_a_av ) 2378 ENDIF 2379 2380 ! 2381 !-- ATTENTION: The random seeds are global data! If independent values for every PE are required, 2382 !-- the general approach of PE indendent restart will be lost. That means that in general the 2383 !-- parallel random number generator in random_generator_parallel_mod should be used! 2384 CALL rrd_mpi_io_global_array( 'random_iv', random_iv ) 2385 CALL rrd_mpi_io( 'random_iy', random_iy ) 2386 2387 CALL rd_mpi_io_check_array( 'id_random_array' , found = array_found ) 2388 IF ( array_found ) THEN 2389 IF ( .NOT. ALLOCATED( id_random_array ) ) ALLOCATE( id_random_array(nys:nyn,nxl:nxr) ) 2390 IF ( .NOT. ALLOCATED( seq_random_array ) ) ALLOCATE( seq_random_array(5,nys:nyn,nxl:nxr) ) 2391 CALL rrd_mpi_io( 'id_random_array', id_random_array) 2392 DO i = 1, SIZE( seq_random_array, 1 ) 2393 WRITE( tmp_name, '(A,I2.2)' ) 'seq_random_array', i 2394 CALL rrd_mpi_io( TRIM(tmp_name), seq_random_array(i,:,:) ) 2395 ENDDO 2396 ENDIF 2397 2398 CALL rd_mpi_io_check_array( 's' , found = array_found ) 2399 IF ( array_found ) THEN 2400 CALL rrd_mpi_io( 's', s ) 2401 ENDIF 2402 2403 CALL rd_mpi_io_check_array( 's_av' , found = array_found ) 2404 IF ( array_found ) THEN 2405 IF ( .NOT. ALLOCATED( s_av ) ) ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2406 CALL rrd_mpi_io( 's_av', s_av ) 2407 ENDIF 2408 2409 CALL rd_mpi_io_check_array( 'shf_av' , found = array_found ) 2410 IF ( array_found ) THEN 2411 IF ( .NOT. ALLOCATED( shf_av ) ) ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) 2412 CALL rrd_mpi_io( 'shf_av', shf_av ) 2413 ENDIF 2414 2415 CALL rd_mpi_io_check_array( 'ssurf_av' , found = array_found ) 2416 IF ( array_found ) THEN 2417 IF ( .NOT. ALLOCATED( ssurf_av ) ) ALLOCATE( ssurf_av(nysg:nyng,nxlg:nxrg) ) 2418 CALL rrd_mpi_io( 'ssurf_av', ssurf_av ) 2419 ENDIF 2420 2421 CALL rd_mpi_io_check_array( 'ssws_av' , found = array_found ) 2422 IF ( array_found ) THEN 2423 IF ( .NOT. ALLOCATED( ssws_av ) ) ALLOCATE( ssws_av(nysg:nyng,nxlg:nxrg) ) 2424 CALL rrd_mpi_io( 'ssws_av', ssws_av ) 2425 ENDIF 2426 2427 CALL rd_mpi_io_check_array( 'ti_av' , found = array_found ) 2428 IF ( array_found ) THEN 2429 IF ( .NOT. ALLOCATED( ti_av ) ) ALLOCATE( ti_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2430 CALL rrd_mpi_io( 'ti_av', ti_av ) 2431 ENDIF 2432 2433 CALL rd_mpi_io_check_array( 'ts_av' , found = array_found ) 2434 IF ( array_found ) THEN 2435 IF ( .NOT. ALLOCATED( ts_av ) ) ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) 2436 CALL rrd_mpi_io( 'ts_av', ts_av ) 2437 ENDIF 2438 2439 CALL rd_mpi_io_check_array( 'tsurf_av' , found = array_found ) 2440 IF ( array_found ) THEN 2441 IF ( .NOT. ALLOCATED( tsurf_av ) ) ALLOCATE( tsurf_av(nysg:nyng,nxlg:nxrg) ) 2442 CALL rrd_mpi_io( 'tsurf_av', tsurf_av ) 2443 ENDIF 2444 2445 CALL rrd_mpi_io( 'u', u) 2446 2447 CALL rd_mpi_io_check_array( 'u_av' , found = array_found ) 2448 IF ( array_found ) THEN 2449 IF ( .NOT. ALLOCATED( u_av ) ) ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2450 CALL rrd_mpi_io( 'u_av', u_av ) 2451 ENDIF 2452 2453 CALL rd_mpi_io_check_array( 'u_center_av' , found = array_found ) 2454 IF ( array_found ) THEN 2455 IF ( .NOT. ALLOCATED( u_center_av ) ) ALLOCATE( u_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2456 CALL rrd_mpi_io( 'u_center_av', u_center_av ) 2457 ENDIF 2458 2459 CALL rd_mpi_io_check_array( 'uu_av' , found = array_found ) 2460 IF ( array_found ) THEN 2461 IF ( .NOT. ALLOCATED( uu_av ) ) ALLOCATE( uu_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2462 CALL rrd_mpi_io( 'uu_av', uu_av ) 2463 ENDIF 2464 2465 CALL rd_mpi_io_check_array( 'uv_10m_av' , found = array_found ) 2466 IF ( array_found ) THEN 2467 IF ( .NOT. ALLOCATED( uv_10m_av ) ) ALLOCATE( uv_10m_av(nysg:nyng,nxlg:nxrg) ) 2468 CALL rrd_mpi_io( 'uv_10m_av', uv_10m_av ) 2469 ENDIF 2470 2471 CALL rd_mpi_io_check_array( 'u_m_l' , found = array_found ) 2472 IF ( array_found ) THEN 2473 IF ( .NOT. ALLOCATED( u_m_l ) ) ALLOCATE( u_m_l(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2474 CALL rrd_mpi_io( 'u_m_l', u_m_l ) 2475 ENDIF 2476 2477 CALL rd_mpi_io_check_array( 'u_m_n' , found = array_found ) 2478 IF ( array_found ) THEN 2479 IF ( .NOT. ALLOCATED( u_m_n ) ) ALLOCATE( u_m_n(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2480 CALL rrd_mpi_io( 'u_m_n', u_m_n ) 2481 ENDIF 2482 2483 CALL rd_mpi_io_check_array( 'u_m_r' , found = array_found ) 2484 IF ( array_found ) THEN 2485 IF ( .NOT. ALLOCATED( u_m_r ) ) ALLOCATE( u_m_r(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2486 CALL rrd_mpi_io( 'u_m_r', u_m_r ) 2487 ENDIF 2488 2489 CALL rd_mpi_io_check_array( 'u_m_s' , found = array_found ) 2490 IF ( array_found ) THEN 2491 IF ( .NOT. ALLOCATED( u_m_s ) ) ALLOCATE( u_m_s(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2492 CALL rrd_mpi_io( 'u_m_s', u_m_s ) 2493 ENDIF 2494 2495 CALL rd_mpi_io_check_array( 'us_av' , found = array_found ) 2496 IF ( array_found ) THEN 2497 IF ( .NOT. ALLOCATED( us_av ) ) ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) 2498 CALL rrd_mpi_io( 'us_av', us_av ) 2499 ENDIF 2500 2501 CALL rrd_mpi_io( 'v', v ) 2502 2503 CALL rd_mpi_io_check_array( 'v_av' , found = array_found ) 2504 IF ( array_found ) THEN 2505 IF ( .NOT. ALLOCATED( v_av ) ) ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2506 CALL rrd_mpi_io( 'v_av', v_av ) 2507 ENDIF 2508 2509 CALL rd_mpi_io_check_array( 'v_center_av' , found = array_found ) 2510 IF ( array_found ) THEN 2511 IF ( .NOT. ALLOCATED( v_center_av ) ) ALLOCATE( v_center_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2512 CALL rrd_mpi_io( 'v_center_av', v_center_av ) 2513 ENDIF 2514 2515 CALL rd_mpi_io_check_array( 'vv_av' , found = array_found ) 2516 IF ( array_found ) THEN 2517 IF ( .NOT. ALLOCATED( vv_av ) ) ALLOCATE( vv_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2518 CALL rrd_mpi_io( 'vv_av', vv_av ) 2519 ENDIF 2520 2521 CALL rd_mpi_io_check_array( 'v_m_l' , found = array_found ) 2522 IF ( array_found ) THEN 2523 IF ( .NOT. ALLOCATED( v_m_l ) ) ALLOCATE( v_m_l(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2524 CALL rrd_mpi_io( 'v_m_l', v_m_l ) 2525 ENDIF 2526 2527 CALL rd_mpi_io_check_array( 'v_m_n' , found = array_found ) 2528 IF ( array_found ) THEN 2529 IF ( .NOT. ALLOCATED( v_m_n ) ) ALLOCATE( v_m_n(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2530 CALL rrd_mpi_io( 'v_m_n', v_m_n ) 2531 ENDIF 2532 2533 CALL rd_mpi_io_check_array( 'v_m_r' , found = array_found ) 2534 IF ( array_found ) THEN 2535 IF ( .NOT. ALLOCATED( v_m_r ) ) ALLOCATE( v_m_r(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2536 CALL rrd_mpi_io( 'v_m_r', v_m_r ) 2537 ENDIF 2538 2539 CALL rd_mpi_io_check_array( 'v_m_s' , found = array_found ) 2540 IF ( array_found ) THEN 2541 IF ( .NOT. ALLOCATED( v_m_s ) ) ALLOCATE( v_m_s(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2542 CALL rrd_mpi_io( 'v_m_s', v_m_s ) 2543 ENDIF 2544 2545 CALL rd_mpi_io_check_array( 'vpt' , found = array_found ) 2546 IF ( array_found ) THEN 2547 CALL rrd_mpi_io( 'vpt', vpt) 2548 ENDIF 2549 2550 CALL rd_mpi_io_check_array( 'vpt_av' , found = array_found ) 2551 IF ( array_found ) THEN 2552 IF ( .NOT. ALLOCATED( vpt_av ) ) ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2553 CALL rrd_mpi_io( 'vpt_av', vpt_av ) 2554 ENDIF 2555 2556 CALL rrd_mpi_io( 'w', w) 2557 2558 CALL rd_mpi_io_check_array( 'w_av' , found = array_found ) 2559 IF ( array_found ) THEN 2560 IF ( .NOT. ALLOCATED( w_av ) ) ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2561 CALL rrd_mpi_io( 'w_av', w_av ) 2562 ENDIF 2563 2564 CALL rd_mpi_io_check_array( 'ww_av' , found = array_found ) 2565 IF ( array_found ) THEN 2566 IF ( .NOT. ALLOCATED( ww_av ) ) ALLOCATE( w_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2567 CALL rrd_mpi_io( 'ww_av', ww_av ) 2568 ENDIF 2569 2570 CALL rd_mpi_io_check_array( 'w_m_l' , found = array_found ) 2571 IF ( array_found ) THEN 2572 IF ( .NOT. ALLOCATED( w_m_l ) ) ALLOCATE( w_m_l(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2573 CALL rrd_mpi_io( 'w_m_l', w_m_l ) 2574 ENDIF 2575 2576 CALL rd_mpi_io_check_array( 'w_m_n' , found = array_found ) 2577 IF ( array_found ) THEN 2578 IF ( .NOT. ALLOCATED( w_m_n ) ) ALLOCATE( w_m_n(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2579 CALL rrd_mpi_io( 'w_m_n', w_m_n ) 2580 ENDIF 2581 2582 CALL rd_mpi_io_check_array( 'w_m_r' , found = array_found ) 2583 IF ( array_found ) THEN 2584 IF ( .NOT. ALLOCATED( w_m_r ) ) ALLOCATE( w_m_r(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2585 CALL rrd_mpi_io( 'w_m_r', w_m_r ) 2586 ENDIF 2587 2588 CALL rd_mpi_io_check_array( 'w_m_s' , found = array_found ) 2589 IF ( array_found ) THEN 2590 IF ( .NOT. ALLOCATED( w_m_s ) ) ALLOCATE( w_m_s(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2591 CALL rrd_mpi_io( 'w_m_s', w_m_s ) 2592 ENDIF 2593 2594 CALL rd_mpi_io_check_array( 'wspeed_av' , found = array_found ) 2595 IF ( array_found ) THEN 2596 IF ( .NOT. ALLOCATED( wspeed_av ) ) ALLOCATE( wspeed_av(nzb:nzt+1,nys:nyn,nxl:nxr) ) 2597 CALL rrd_mpi_io( 'wspeed_av', wspeed_av ) 2598 ENDIF 2599 2600 CALL rd_mpi_io_check_array( 'z0_av' , found = array_found ) 2601 IF ( array_found ) THEN 2602 IF ( .NOT. ALLOCATED( z0_av ) ) ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) 2603 CALL rrd_mpi_io( 'z0_av', z0_av ) 2604 ENDIF 2605 2606 CALL rd_mpi_io_check_array( 'z0h_av' , found = array_found ) 2607 IF ( array_found ) THEN 2608 IF ( .NOT. ALLOCATED( z0h_av ) ) ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) 2609 CALL rrd_mpi_io( 'z0h_av', z0h_av ) 2610 ENDIF 2611 2612 CALL rd_mpi_io_check_array( 'z0q_av' , found = array_found ) 2613 IF ( array_found ) THEN 2614 IF ( .NOT. ALLOCATED( z0q_av ) ) ALLOCATE( z0q_av(nysg:nyng,nxlg:nxrg) ) 2615 CALL rrd_mpi_io( 'z0q_av', z0q_av ) 2616 ENDIF 2617 2618 ! 2619 !-- Read restart data of surfaces 2620 CALL surface_rrd_local 2621 2622 ! 2623 !-- Read restart data of other modules 2624 CALL module_interface_rrd_local 2625 2626 ! 2627 !-- Close restart file 2628 CALL rd_mpi_io_close 2629 2630 ENDIF 2252 2631 2253 2632 ! -
palm/trunk/SOURCE/surface_data_output_mod.f90
r4502 r4517 25 25 ! ----------------- 26 26 ! $Id$ 27 ! added restart with MPI-IO for reading local arrays 28 ! 29 ! 4502 2020-04-17 16:14:16Z schwenkel 27 30 ! Implementation of ice microphysics 28 31 ! … … 147 150 148 151 USE restart_data_mpi_io_mod, & 149 ONLY: r rd_mpi_io, wrd_mpi_io152 ONLY: rd_mpi_io_check_array, rrd_mpi_io, wrd_mpi_io 150 153 151 154 USE surface_mod, & … … 267 270 268 271 INTERFACE surface_data_output_rrd_local 269 MODULE PROCEDURE surface_data_output_rrd_local 272 MODULE PROCEDURE surface_data_output_rrd_local_ftn 273 MODULE PROCEDURE surface_data_output_rrd_local_mpi 270 274 END INTERFACE surface_data_output_rrd_local 271 275 … … 4883 4887 ! Description: 4884 4888 ! ------------ 4885 !> This routine reads the respective restart data.4889 !> Read module-specific local restart data arrays (Fortran binary format). 4886 4890 !------------------------------------------------------------------------------! 4887 SUBROUTINE surface_data_output_rrd_local ( found )4891 SUBROUTINE surface_data_output_rrd_local_ftn( found ) 4888 4892 4889 4893 … … 4895 4899 LOGICAL, INTENT(OUT) :: found 4896 4900 4897 ! 4898 !-- Here the reading of user-defined restart data follows: 4899 !-- Sample for user-defined output 4901 4900 4902 found = .TRUE. 4901 4903 … … 4912 4914 4913 4915 4914 END SUBROUTINE surface_data_output_rrd_local 4916 END SUBROUTINE surface_data_output_rrd_local_ftn 4917 4918 4919 !------------------------------------------------------------------------------! 4920 ! Description: 4921 ! ------------ 4922 !> Read module-specific local restart data arrays (MPI-IO). 4923 !------------------------------------------------------------------------------! 4924 SUBROUTINE surface_data_output_rrd_local_mpi 4925 4926 IMPLICIT NONE 4927 4928 LOGICAL :: array_found !< 4929 4930 4931 CALL rd_mpi_io_check_array( 'surfaces%var_av' , found = array_found ) 4932 4933 !> does not work this way: surface%var_av has non-standard dimensions 4934 ! IF ( array_found ) THEN 4935 ! IF ( .NOT. ALLOCATED( surfaces%var_av ) ) ALLOCATE( ....... ) 4936 ! CALL rrd_mpi_io( 'surfaces%var_av', surfaces%var_av ) 4937 ! ENDIF 4938 4939 END SUBROUTINE surface_data_output_rrd_local_mpi 4940 4915 4941 4916 4942 !------------------------------------------------------------------------------! … … 4936 4962 END SUBROUTINE surface_data_output_wrd_global 4937 4963 4964 4938 4965 !------------------------------------------------------------------------------! 4939 4966 ! Description: -
palm/trunk/SOURCE/surface_mod.f90
r4502 r4517 26 26 ! ----------------- 27 27 ! $Id$ 28 ! added restart with MPI-IO for reading local arrays 29 ! 30 ! 4502 2020-04-17 16:14:16Z schwenkel 28 31 ! Implementation of ice microphysics 29 32 ! … … 145 148 146 149 USE restart_data_mpi_io_mod, & 147 ONLY: rd_mpi_io_surface_filetypes, total_number_of_surface_values, wrd_mpi_io, & 150 ONLY: rd_mpi_io_surface_filetypes, rrd_mpi_io, rrd_mpi_io_global_array, & 151 rrd_mpi_io_surface, total_number_of_surface_values, wrd_mpi_io, & 148 152 wrd_mpi_io_global_array, wrd_mpi_io_surface 149 153 … … 499 503 500 504 INTERFACE surface_rrd_local 501 MODULE PROCEDURE surface_rrd_local 505 MODULE PROCEDURE surface_rrd_local_ftn 506 MODULE PROCEDURE surface_rrd_local_mpi 502 507 END INTERFACE surface_rrd_local 503 508 … … 4236 4241 ! Description: 4237 4242 ! ------------ 4238 !> Reads surface-related restart data . Please note, restart data for a certain4243 !> Reads surface-related restart data in Fortran binary format. Please note, restart data for a certain 4239 4244 !> surface orientation (e.g. horizontal upward-facing) is stored in one 4240 4245 !> array, even if surface elements may belong to different surface types … … 4244 4249 !> of cyclic_fill mode. 4245 4250 !------------------------------------------------------------------------------! 4246 SUBROUTINE surface_rrd_local ( kk, nxlf, nxlc, nxl_on_file, nxrf, &4247 nxr_on_file, nynf, nyn_on_file, nysf, &4248 nysc, nys_on_file, found )4251 SUBROUTINE surface_rrd_local_ftn( kk, nxlf, nxlc, nxl_on_file, nxrf, & 4252 nxr_on_file, nynf, nyn_on_file, nysf, & 4253 nysc, nys_on_file, found ) 4249 4254 4250 4255 … … 5185 5190 ENDIF 5186 5191 5187 5188 CONTAINS 5192 CONTAINS 5189 5193 !------------------------------------------------------------------------------! 5190 5194 ! Description: … … 5403 5407 5404 5408 5405 END SUBROUTINE surface_rrd_local 5409 END SUBROUTINE surface_rrd_local_ftn 5410 5411 5412 !------------------------------------------------------------------------------! 5413 ! Description: 5414 ! ------------ 5415 !> Reads surface-related restart data in MPI-IO format. 5416 !> TO_DO: this routine needs to be adjusted for cyclic_fill mode 5417 !------------------------------------------------------------------------------! 5418 SUBROUTINE surface_rrd_local_mpi 5419 5420 5421 IMPLICIT NONE 5422 5423 CHARACTER(LEN=1) :: dum !< dummy string to create input-variable name 5424 5425 INTEGER(iwp) :: l !< loop index for surface types 5426 5427 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: global_start_index !< index for surface data (MPI-IO) 5428 5429 LOGICAL :: ldum !< dummy variable 5430 5431 TYPE(surf_type), DIMENSION(0:2) :: surf_h !< gathered horizontal surfaces, contains all surface types 5432 TYPE(surf_type), DIMENSION(0:3) :: surf_v !< gathered vertical surfaces, contains all surface types 5433 5434 ! 5435 !-- Get total number of surface points on the file 5436 CALL rrd_mpi_io_global_array( 'ns_h_on_file', ns_h_on_file ) 5437 CALL rrd_mpi_io_global_array( 'ns_v_on_file', ns_v_on_file ) 5438 5439 5440 DO l = 0, 2 5441 5442 IF ( ns_h_on_file(l) == 0 ) CYCLE !< no data of this surface type on file 5443 5444 IF ( ALLOCATED( surf_h(l)%start_index ) ) CALL deallocate_surface_attributes_h( surf_h(l) ) 5445 surf_h(l)%ns = ns_h_on_file(l) 5446 CALL allocate_surface_attributes_h( surf_h(l), nys, nyn, nxl, nxr ) 5447 5448 WRITE( dum, '(I1)') l 5449 5450 CALL rrd_mpi_io( 'surf_h(' // dum // ')%start_index', surf_h(l)%start_index ) 5451 CALL rrd_mpi_io( 'surf_h(' // dum // ')%end_index', surf_h(l)%end_index ) 5452 CALL rrd_mpi_io( 'global_start_index_h_' // dum , global_start_index ) 5453 5454 CALL rd_mpi_io_surface_filetypes( surf_h(l)%start_index, surf_h(l)%end_index, ldum, global_start_index ) 5455 5456 IF ( ALLOCATED ( surf_h(l)%us ) ) THEN 5457 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%us', surf_h(l)%us ) 5458 ENDIF 5459 5460 IF ( ALLOCATED ( surf_h(l)%ts ) ) THEN 5461 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%ts', surf_h(l)%ts ) 5462 ENDIF 5463 5464 IF ( ALLOCATED ( surf_h(l)%qs ) ) THEN 5465 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%qs', surf_h(l)%qs ) 5466 ENDIF 5467 5468 IF ( ALLOCATED ( surf_h(l)%ss ) ) THEN 5469 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%ss', surf_h(l)%ss ) 5470 ENDIF 5471 5472 IF ( ALLOCATED ( surf_h(l)%qcs ) ) THEN 5473 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%qcs', surf_h(l)%qcs ) 5474 ENDIF 5475 5476 IF ( ALLOCATED ( surf_h(l)%ncs ) ) THEN 5477 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%ncs', surf_h(l)%ncs ) 5478 ENDIF 5479 5480 IF ( ALLOCATED ( surf_h(l)%qis ) ) THEN 5481 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%qis', surf_h(l)%qis ) 5482 ENDIF 5483 5484 IF ( ALLOCATED ( surf_h(l)%nis ) ) THEN 5485 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%nis', surf_h(l)%nis ) 5486 ENDIF 5487 5488 IF ( ALLOCATED ( surf_h(l)%qrs ) ) THEN 5489 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%qrs', surf_h(l)%qrs ) 5490 ENDIF 5491 5492 IF ( ALLOCATED ( surf_h(l)%nrs ) ) THEN 5493 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%nrs', surf_h(l)%nrs ) 5494 ENDIF 5495 5496 IF ( ALLOCATED ( surf_h(l)%ol ) ) THEN 5497 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%ol', surf_h(l)%ol ) 5498 ENDIF 5499 5500 IF ( ALLOCATED ( surf_h(l)%rib ) ) THEN 5501 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%rib', surf_h(l)%rib ) 5502 ENDIF 5503 5504 IF ( ALLOCATED ( surf_h(l)%pt_surface ) ) THEN 5505 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%pt_surface', surf_h(l)%pt_surface ) 5506 ENDIF 5507 5508 IF ( ALLOCATED ( surf_h(l)%q_surface ) ) THEN 5509 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%q_surface', surf_h(l)%q_surface ) 5510 ENDIF 5511 5512 IF ( ALLOCATED ( surf_h(l)%vpt_surface ) ) THEN 5513 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%vpt_surface', surf_h(l)%vpt_surface ) 5514 ENDIF 5515 5516 IF ( ALLOCATED ( surf_h(l)%usws ) ) THEN 5517 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%usws', surf_h(l)%usws ) 5518 ENDIF 5519 5520 IF ( ALLOCATED ( surf_h(l)%vsws ) ) THEN 5521 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%vsws', surf_h(l)%vsws ) 5522 ENDIF 5523 5524 IF ( ALLOCATED ( surf_h(l)%shf ) ) THEN 5525 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%shf', surf_h(l)%shf ) 5526 ENDIF 5527 5528 IF ( ALLOCATED ( surf_h(l)%qsws ) ) THEN 5529 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%qsws', surf_h(l)%qsws ) 5530 ENDIF 5531 5532 IF ( ALLOCATED ( surf_h(l)%ssws ) ) THEN 5533 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%ssws', surf_h(l)%ssws ) 5534 ENDIF 5535 5536 IF ( ALLOCATED ( surf_h(l)%css ) ) THEN 5537 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%css', surf_h(l)%css ) 5538 ENDIF 5539 5540 IF ( ALLOCATED ( surf_h(l)%cssws ) ) THEN 5541 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%cssws', surf_h(l)%cssws ) 5542 ENDIF 5543 5544 IF ( ALLOCATED ( surf_h(l)%qcsws ) ) THEN 5545 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%qcsws', surf_h(l)%qcsws ) 5546 ENDIF 5547 5548 IF ( ALLOCATED ( surf_h(l)%ncsws ) ) THEN 5549 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%ncsws', surf_h(l)%ncsws ) 5550 ENDIF 5551 5552 IF ( ALLOCATED ( surf_h(l)%qisws ) ) THEN 5553 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%qisws', surf_h(l)%qisws ) 5554 ENDIF 5555 5556 IF ( ALLOCATED ( surf_h(l)%nisws ) ) THEN 5557 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%nisws', surf_h(l)%nisws ) 5558 ENDIF 5559 5560 IF ( ALLOCATED ( surf_h(l)%qrsws ) ) THEN 5561 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%qrsws', surf_h(l)%qrsws ) 5562 ENDIF 5563 5564 IF ( ALLOCATED ( surf_h(l)%nrsws ) ) THEN 5565 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%nrsws', surf_h(l)%nrsws ) 5566 ENDIF 5567 5568 IF ( ALLOCATED ( surf_h(l)%sasws ) ) THEN 5569 CALL rrd_mpi_io_surface( 'surf_h(' // dum // ')%sasws', surf_h(l)%sasws ) 5570 ENDIF 5571 5572 ENDDO 5573 5574 ! 5575 !-- Read vertical surfaces 5576 DO l = 0, 3 5577 5578 IF ( ns_v_on_file(l) == 0 ) CYCLE !< no data of this surface type on file 5579 5580 IF ( ALLOCATED( surf_v(l)%start_index ) ) CALL deallocate_surface_attributes_v( surf_v(l) ) 5581 surf_v(l)%ns = ns_v_on_file(l) 5582 CALL allocate_surface_attributes_v( surf_v(l), nys, nyn, nxl, nxr ) 5583 5584 WRITE( dum, '(I1)' ) l 5585 5586 CALL rrd_mpi_io( 'surf_v(' // dum // ')%start_index', surf_v(l)%start_index ) 5587 CALL rrd_mpi_io( 'surf_v(' // dum // ')%end_index', surf_v(l)%end_index ) 5588 CALL rrd_mpi_io( 'global_start_index_v_' // dum , global_start_index ) 5589 5590 CALL rd_mpi_io_surface_filetypes( surf_v(l)%start_index, surf_v(l)%end_index, ldum, & 5591 global_start_index ) 5592 5593 IF ( ALLOCATED ( surf_v(l)%us ) ) THEN 5594 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%us', surf_v(l)%us ) 5595 ENDIF 5596 5597 IF ( ALLOCATED ( surf_v(l)%ts ) ) THEN 5598 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%ts', surf_v(l)%ts ) 5599 ENDIF 5600 5601 IF ( ALLOCATED ( surf_v(l)%qs ) ) THEN 5602 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%qs', surf_v(l)%qs ) 5603 ENDIF 5604 5605 IF ( ALLOCATED ( surf_v(l)%ss ) ) THEN 5606 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%ss', surf_v(l)%ss ) 5607 ENDIF 5608 5609 IF ( ALLOCATED ( surf_v(l)%qcs ) ) THEN 5610 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%qcs', surf_v(l)%qcs ) 5611 ENDIF 5612 5613 IF ( ALLOCATED ( surf_v(l)%ncs ) ) THEN 5614 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%ncs', surf_v(l)%ncs ) 5615 ENDIF 5616 5617 IF ( ALLOCATED ( surf_v(l)%qis ) ) THEN 5618 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%qis', surf_v(l)%qis ) 5619 ENDIF 5620 5621 IF ( ALLOCATED ( surf_v(l)%nis ) ) THEN 5622 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%nis', surf_v(l)%nis ) 5623 ENDIF 5624 5625 IF ( ALLOCATED ( surf_v(l)%qrs ) ) THEN 5626 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%qrs', surf_v(l)%qrs ) 5627 ENDIF 5628 5629 IF ( ALLOCATED ( surf_v(l)%nrs ) ) THEN 5630 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%nrs', surf_v(l)%nrs ) 5631 ENDIF 5632 5633 IF ( ALLOCATED ( surf_v(l)%ol ) ) THEN 5634 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%ol', surf_v(l)%ol ) 5635 ENDIF 5636 5637 IF ( ALLOCATED ( surf_v(l)%rib ) ) THEN 5638 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%rib', surf_v(l)%rib ) 5639 ENDIF 5640 5641 IF ( ALLOCATED ( surf_v(l)%pt_surface ) ) THEN 5642 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%pt_surface', surf_v(l)%pt_surface ) 5643 ENDIF 5644 5645 IF ( ALLOCATED ( surf_v(l)%q_surface ) ) THEN 5646 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%q_surface', surf_v(l)%q_surface ) 5647 ENDIF 5648 5649 IF ( ALLOCATED ( surf_v(l)%vpt_surface ) ) THEN 5650 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%vpt_surface', surf_v(l)%vpt_surface ) 5651 ENDIF 5652 5653 IF ( ALLOCATED ( surf_v(l)%shf ) ) THEN 5654 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%shf', surf_v(l)%shf ) 5655 ENDIF 5656 5657 IF ( ALLOCATED ( surf_v(l)%qsws ) ) THEN 5658 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%qsws', surf_v(l)%qsws ) 5659 ENDIF 5660 5661 IF ( ALLOCATED ( surf_v(l)%ssws ) ) THEN 5662 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%ssws', surf_v(l)%ssws ) 5663 ENDIF 5664 5665 IF ( ALLOCATED ( surf_v(l)%css ) ) THEN 5666 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%css', surf_v(l)%css ) 5667 ENDIF 5668 5669 IF ( ALLOCATED ( surf_v(l)%cssws ) ) THEN 5670 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%cssws', surf_v(l)%cssws ) 5671 ENDIF 5672 5673 IF ( ALLOCATED ( surf_v(l)%qcsws ) ) THEN 5674 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%qcsws', surf_v(l)%qcsws ) 5675 ENDIF 5676 5677 IF ( ALLOCATED ( surf_v(l)%ncsws ) ) THEN 5678 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%ncsws', surf_v(l)%ncsws ) 5679 ENDIF 5680 5681 IF ( ALLOCATED ( surf_v(l)%qisws ) ) THEN 5682 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%qisws', surf_v(l)%qisws ) 5683 ENDIF 5684 5685 IF ( ALLOCATED ( surf_v(l)%nisws ) ) THEN 5686 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%nisws', surf_v(l)%nisws ) 5687 ENDIF 5688 5689 IF ( ALLOCATED ( surf_v(l)%qrsws ) ) THEN 5690 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%qrsws', surf_v(l)%qrsws ) 5691 ENDIF 5692 5693 IF ( ALLOCATED ( surf_v(l)%nrsws ) ) THEN 5694 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%nrsws', surf_v(l)%nrsws ) 5695 ENDIF 5696 5697 IF ( ALLOCATED ( surf_v(l)%sasws ) ) THEN 5698 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%sasws', surf_v(l)%sasws ) 5699 ENDIF 5700 5701 IF ( ALLOCATED ( surf_v(l)%mom_flux_uv ) ) THEN 5702 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%mom_uv', surf_v(l)%mom_flux_uv) 5703 ENDIF 5704 5705 IF ( ALLOCATED ( surf_v(l)%mom_flux_w ) ) THEN 5706 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%mom_w', surf_v(l)%mom_flux_w) 5707 ENDIF 5708 5709 IF ( ALLOCATED ( surf_v(l)%mom_flux_tke ) ) THEN 5710 CALL rrd_mpi_io_surface( 'surf_v(' // dum // ')%mom_tke', surf_v(l)%mom_flux_tke) 5711 ENDIF 5712 5713 ENDDO 5714 5715 ! 5716 !-- Redistribute surface elements on its respective type. 5717 5718 DO l = 0 , 2 5719 CALL restore_surface_elements( surf_def_h(l), surf_h(l) ) 5720 CALL restore_surface_elements( surf_lsm_h, surf_h(l) ) 5721 CALL restore_surface_elements( surf_usm_h, surf_h(l) ) 5722 ENDDO 5723 5724 DO l = 0 , 3 5725 CALL restore_surface_elements( surf_def_v(l), surf_v(l) ) 5726 CALL restore_surface_elements( surf_lsm_v(l), surf_v(l) ) 5727 CALL restore_surface_elements( surf_usm_v(l), surf_v(l) ) 5728 ENDDO 5729 5730 CONTAINS 5731 5732 SUBROUTINE restore_surface_elements( surf_target, surf_file ) 5733 5734 IMPLICIT NONE 5735 5736 INTEGER(iwp) :: lsp !< running index chemical species 5737 5738 TYPE( surf_type ) :: surf_target !< target surface type 5739 TYPE( surf_type ) :: surf_file !< surface type on file 5740 5741 5742 IF ( ALLOCATED( surf_target%us ) .AND. ALLOCATED( surf_file%us ) ) THEN 5743 surf_target%us = surf_file%us 5744 ENDIF 5745 5746 IF ( ALLOCATED( surf_target%ol ) .AND. & 5747 ALLOCATED( surf_file%ol ) ) & 5748 surf_target%ol = surf_file%ol 5749 5750 IF ( ALLOCATED( surf_target%pt_surface ) .AND. & 5751 ALLOCATED( surf_file%pt_surface ) ) & 5752 surf_target%pt_surface = surf_file%pt_surface 5753 5754 IF ( ALLOCATED( surf_target%q_surface ) .AND. & 5755 ALLOCATED( surf_file%q_surface ) ) & 5756 surf_target%q_surface = surf_file%q_surface 5757 5758 IF ( ALLOCATED( surf_target%vpt_surface ) .AND. & 5759 ALLOCATED( surf_file%vpt_surface ) ) & 5760 surf_target%vpt_surface = surf_file%vpt_surface 5761 5762 IF ( ALLOCATED( surf_target%usws ) .AND. & 5763 ALLOCATED( surf_file%usws ) ) & 5764 surf_target%usws = surf_file%usws 5765 5766 IF ( ALLOCATED( surf_target%vsws ) .AND. & 5767 ALLOCATED( surf_file%vsws ) ) & 5768 surf_target%vsws = surf_file%vsws 5769 5770 IF ( ALLOCATED( surf_target%ts ) .AND. & 5771 ALLOCATED( surf_file%ts ) ) & 5772 surf_target%ts = surf_file%ts 5773 5774 IF ( ALLOCATED( surf_target%shf ) .AND. & 5775 ALLOCATED( surf_file%shf ) ) & 5776 surf_target%shf = surf_file%shf 5777 5778 IF ( ALLOCATED( surf_target%qs ) .AND. & 5779 ALLOCATED( surf_file%qs ) ) & 5780 surf_target%qs = surf_file%qs 5781 5782 IF ( ALLOCATED( surf_target%qsws ) .AND. & 5783 ALLOCATED( surf_file%qsws ) ) & 5784 surf_target%qsws = surf_file%qsws 5785 5786 IF ( ALLOCATED( surf_target%ss ) .AND. & 5787 ALLOCATED( surf_file%ss ) ) & 5788 surf_target%ss = surf_file%ss 5789 5790 IF ( ALLOCATED( surf_target%ssws ) .AND. & 5791 ALLOCATED( surf_file%ssws ) ) & 5792 surf_target%ssws = surf_file%ssws 5793 5794 IF ( ALLOCATED( surf_target%css ) .AND. & 5795 ALLOCATED( surf_file%css ) ) THEN 5796 DO lsp = 1, nvar 5797 surf_target%css(lsp,:) = surf_file%css(lsp,:) 5798 ENDDO 5799 ENDIF 5800 5801 IF ( ALLOCATED( surf_target%cssws ) .AND. & 5802 ALLOCATED( surf_file%cssws ) ) THEN 5803 DO lsp = 1, nvar 5804 surf_target%cssws(lsp,:) = surf_file%cssws(lsp,:) 5805 ENDDO 5806 ENDIF 5807 IF ( ALLOCATED( surf_target%qcs ) .AND. & 5808 ALLOCATED( surf_file%qcs ) ) & 5809 surf_target%qcs = surf_file%qcs 5810 IF ( ALLOCATED( surf_target%qcsws ) .AND. & 5811 ALLOCATED( surf_file%qcsws ) ) & 5812 surf_target%qcsws = surf_file%qcsws 5813 IF ( ALLOCATED( surf_target%ncs ) .AND. & 5814 ALLOCATED( surf_file%ncs ) ) & 5815 surf_target%ncs = surf_file%ncs 5816 IF ( ALLOCATED( surf_target%ncsws ) .AND. & 5817 ALLOCATED( surf_file%ncsws ) ) & 5818 surf_target%ncsws = surf_file%ncsws 5819 IF ( ALLOCATED( surf_target%qrs ) .AND. & 5820 ALLOCATED( surf_file%qrs ) ) & 5821 surf_target%qrs = surf_file%qrs 5822 IF ( ALLOCATED( surf_target%qrsws ) .AND. & 5823 ALLOCATED( surf_file%qrsws ) ) & 5824 surf_target%qrsws = surf_file%qrsws 5825 IF ( ALLOCATED( surf_target%nrs ) .AND. & 5826 ALLOCATED( surf_file%nrs ) ) & 5827 surf_target%nrs = surf_file%nrs 5828 5829 IF ( ALLOCATED( surf_target%nrsws ) .AND. & 5830 ALLOCATED( surf_file%nrsws ) ) & 5831 surf_target%nrsws = surf_file%nrsws 5832 IF ( ALLOCATED( surf_target%sasws ) .AND. & 5833 ALLOCATED( surf_file%sasws ) ) & 5834 surf_target%sasws = surf_file%sasws 5835 IF ( ALLOCATED( surf_target%mom_flux_uv ) .AND. & 5836 ALLOCATED( surf_file%mom_flux_uv ) ) & 5837 surf_target%mom_flux_uv = & 5838 surf_file%mom_flux_uv 5839 IF ( ALLOCATED( surf_target%mom_flux_w ) .AND. & 5840 ALLOCATED( surf_file%mom_flux_w ) ) & 5841 surf_target%mom_flux_w = & 5842 surf_file%mom_flux_w 5843 IF ( ALLOCATED( surf_target%mom_flux_tke ) .AND. & 5844 ALLOCATED( surf_file%mom_flux_tke ) ) & 5845 surf_target%mom_flux_tke(0:1,:) = & 5846 surf_file%mom_flux_tke(0:1,:) 5847 5848 5849 END SUBROUTINE restore_surface_elements 5850 5851 END SUBROUTINE surface_rrd_local_mpi 5852 5853 5854 5406 5855 5407 5856 -
palm/trunk/SOURCE/urban_surface_mod.f90
r4510 r4517 27 27 ! ----------------- 28 28 ! $Id$ 29 ! added restart with MPI-IO for reading local arrays 30 ! 31 ! 4510 2020-04-29 14:19:18Z raasch 29 32 ! Further re-formatting to follow the PALM coding standard 30 33 ! … … 368 371 USE restart_data_mpi_io_mod, & 369 372 ONLY: rd_mpi_io_surface_filetypes, & 373 rrd_mpi_io, & 374 rrd_mpi_io_surface, & 370 375 wrd_mpi_io, & 371 376 wrd_mpi_io_surface … … 617 622 618 623 619 620 621 624 ! 622 625 !-- Building facade/wall/green/window properties (partly according to PIDS). … … 840 843 841 844 INTERFACE usm_rrd_local 842 MODULE PROCEDURE usm_rrd_local 845 MODULE PROCEDURE usm_rrd_local_ftn 846 MODULE PROCEDURE usm_rrd_local_mpi 843 847 END INTERFACE usm_rrd_local 844 848 … … 6110 6114 ! Description: 6111 6115 ! ------------ 6112 !> Soubroutine reads t_surf and t_wall data from restart files 6116 !> Read module-specific local restart data arrays (Fortran binary format). 6117 !> Soubroutine reads t_surf and t_wall. 6113 6118 !--------------------------------------------------------------------------------------------------! 6114 SUBROUTINE usm_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxr_on_file, nynf, nyn_on_file,&6115 nysf, nysc, nys_on_file, found )6119 SUBROUTINE usm_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxr_on_file, nynf, nyn_on_file, & 6120 nysf, nysc, nys_on_file, found ) 6116 6121 6117 6122 … … 6654 6659 END SELECT 6655 6660 6656 END SUBROUTINE usm_rrd_local 6661 END SUBROUTINE usm_rrd_local_ftn 6662 6663 6664 !--------------------------------------------------------------------------------------------------! 6665 ! Description: 6666 ! ------------ 6667 !> Read module-specific local restart data arrays (MPI-IO). 6668 !> Soubroutine reads t_surf and t_wall. 6669 !> 6670 !> This read routine is a counterpart of usm_wrd_local. 6671 !> In usm_wrd_local, all array are unconditionally written, therefore all arrays are read here. 6672 !> This is a preliminary version of reading usm data. The final version has to be discussed with 6673 !> the developers. 6674 !> 6675 !> If it is possible to call usm_allocate_surface before reading the restart file, this reading 6676 !> routine would become much simpler, because no checking for allocation will be necessary any more. 6677 !--------------------------------------------------------------------------------------------------! 6678 SUBROUTINE usm_rrd_local_mpi 6679 6680 6681 CHARACTER(LEN=1) :: dum !< dummy string to create input-variable name 6682 6683 INTEGER(iwp) :: l !< loop index for surface types 6684 6685 INTEGER(iwp), DIMENSION(nys:nyn,nxl:nxr) :: global_start 6686 6687 LOGICAL :: ldum !< dummy variable 6688 6689 6690 CALL rrd_mpi_io( 'usm_start_index_h', surf_usm_h%start_index ) 6691 CALL rrd_mpi_io( 'usm_end_index_h', surf_usm_h%end_index ) 6692 CALL rrd_mpi_io( 'usm_global_start_h', global_start ) 6693 6694 CALL rd_mpi_io_surface_filetypes( surf_usm_h%start_index, surf_usm_h%end_index, ldum, & 6695 global_start ) 6696 6697 IF ( .NOT. ALLOCATED( t_surf_wall_h_1 ) ) ALLOCATE( t_surf_wall_h_1(1:surf_usm_h%ns) ) 6698 CALL rrd_mpi_io_surface( 't_surf_wall_h', t_surf_wall_h_1 ) 6699 6700 IF ( .NOT. ALLOCATED( t_surf_window_h_1 ) ) ALLOCATE( t_surf_window_h_1(1:surf_usm_h%ns) ) 6701 CALL rrd_mpi_io_surface( 't_surf_window_h', t_surf_window_h_1 ) 6702 6703 IF ( .NOT. ALLOCATED( t_surf_green_h_1 ) ) ALLOCATE( t_surf_green_h_1(1:surf_usm_h%ns) ) 6704 CALL rrd_mpi_io_surface( 't_surf_green_h', t_surf_green_h_1 ) 6705 6706 DO l = 0, 3 6707 6708 WRITE( dum, '(I1)' ) l 6709 6710 CALL rrd_mpi_io( 'usm_start_index_v_' //dum, surf_usm_v(l)%start_index ) 6711 CALL rrd_mpi_io( 'usm_end_index_v_' // dum, surf_usm_v(l)%end_index ) 6712 CALL rrd_mpi_io( 'usm_global_start_v_' // dum, global_start ) 6713 6714 CALL rd_mpi_io_surface_filetypes( surf_usm_v(l)%start_index, surf_usm_v(l)%end_index, ldum, & 6715 global_start ) 6716 6717 IF ( .NOT. ALLOCATED( t_surf_wall_v_1(l)%t ) ) & 6718 ALLOCATE( t_surf_wall_v_1(l)%t(1:surf_usm_v(l)%ns) ) 6719 CALL rrd_mpi_io_surface( 't_surf_wall_v(' // dum // ')', t_surf_wall_v_1(l)%t ) 6720 6721 IF ( .NOT. ALLOCATED( t_surf_window_v_1(l)%t ) ) & 6722 ALLOCATE( t_surf_window_v_1(l)%t(1:surf_usm_v(l)%ns) ) 6723 CALL rrd_mpi_io_surface( 't_surf_window_v(' // dum // ')', t_surf_window_v_1(l)%t ) 6724 6725 IF ( .NOT. ALLOCATED( t_surf_green_v_1(l)%t ) ) & 6726 ALLOCATE( t_surf_green_v_1(l)%t(1:surf_usm_v(l)%ns) ) 6727 CALL rrd_mpi_io_surface( 't_surf_green_v(' // dum // ')', t_surf_green_v_1(l)%t) 6728 6729 ENDDO 6730 6731 CALL rrd_mpi_io( 'usm_start_index_h_2', surf_usm_h%start_index ) 6732 CALL rrd_mpi_io( 'usm_end_index_h_2', surf_usm_h%end_index ) 6733 CALL rrd_mpi_io( 'usm_global_start_h_2', global_start ) 6734 6735 CALL rd_mpi_io_surface_filetypes( surf_usm_h%start_index, surf_usm_h%end_index, ldum, & 6736 global_start ) 6737 6738 IF ( .NOT. ALLOCATED( t_wall_h_1 ) ) & 6739 ALLOCATE( t_wall_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 6740 CALL rrd_mpi_io_surface( 't_wall_h', t_wall_h_1 ) 6741 6742 IF ( .NOT. ALLOCATED( t_window_h_1 ) ) & 6743 ALLOCATE( t_window_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 6744 CALL rrd_mpi_io_surface( 't_window_h', t_window_h_1 ) 6745 6746 IF ( .NOT. ALLOCATED( t_green_h_1 ) ) & 6747 ALLOCATE( t_green_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) 6748 CALL rrd_mpi_io_surface( 't_green_h', t_green_h_1 ) 6749 6750 DO l = 0, 3 6751 6752 WRITE( dum, '(I1)' ) l 6753 6754 CALL rrd_mpi_io( 'usm_start_index_v_2_' //dum, surf_usm_v(l)%start_index ) 6755 CALL rrd_mpi_io( 'usm_end_index_v_2_' // dum, surf_usm_v(l)%end_index ) 6756 CALL rrd_mpi_io( 'usm_global_start_v_2_' // dum, global_start ) 6757 6758 CALL rd_mpi_io_surface_filetypes( surf_usm_v(l)%start_index, surf_usm_v(l)%end_index, ldum, & 6759 global_start ) 6760 6761 IF ( .NOT. ALLOCATED( t_wall_v_1(l)%t ) ) & 6762 ALLOCATE ( t_wall_v_1(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) 6763 CALL rrd_mpi_io_surface( 't_wall_v(' // dum // ')', t_wall_v_1(l)%t ) 6764 6765 IF ( .NOT. ALLOCATED( t_window_v_1(l)%t ) ) & 6766 ALLOCATE ( t_window_v_1(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) 6767 CALL rrd_mpi_io_surface( 't_window_v(' // dum // ')', t_window_v_1(l)%t ) 6768 6769 IF ( .NOT. ALLOCATED( t_green_v_1(l)%t ) ) & 6770 ALLOCATE ( t_green_v_1(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) 6771 CALL rrd_mpi_io_surface( 't_green_v(' // dum // ')', t_green_v_1(l)%t ) 6772 6773 ENDDO 6774 6775 END SUBROUTINE usm_rrd_local_mpi 6776 6657 6777 6658 6778 -
palm/trunk/SOURCE/user_module.f90
r4504 r4517 21 21 ! ----------------- 22 22 ! 23 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! added restart with MPI-IO for reading local arrays 28 ! 29 ! 4504 2020-04-20 12:11:24Z raasch 27 30 ! hint for setting rmask arrays added 28 31 ! … … 207 210 208 211 INTERFACE user_rrd_local 209 MODULE PROCEDURE user_rrd_local 212 MODULE PROCEDURE user_rrd_local_ftn 213 MODULE PROCEDURE user_rrd_local_mpi 210 214 END INTERFACE user_rrd_local 211 215 … … 1130 1134 SUBROUTINE user_rrd_global_mpi 1131 1135 1136 ! USE restart_data_mpi_io_mod, & 1137 ! ONLY: rrd_mpi_io 1138 1132 1139 ! CALL rrd_mpi_io( 'global_parameter', global_parameter ) 1133 1140 CONTINUE … … 1139 1146 ! Description: 1140 1147 ! ------------ 1141 !> Reading processor specific restart data from file(s) that has been defined by the user. Subdomain 1148 !> Read module-specific local restart data arrays (Fortran binary format). 1149 !> Subdomain 1142 1150 !> index limits on file are given by nxl_on_file, etc. Indices nxlc, etc. indicate the range of 1143 1151 !> gridpoints to be mapped from the subdomain on file (f) to the subdomain of the current PE (c). 1144 1152 !> They have been calculated in routine rrd_local. 1145 1153 !--------------------------------------------------------------------------------------------------! 1146 SUBROUTINE user_rrd_local ( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, nxr_on_file, nynf, nync,&1147 nyn_on_file, nysf, nysc, nys_on_file, tmp_3d, found )1154 SUBROUTINE user_rrd_local_ftn( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc, nxr_on_file, nynf, nync, & 1155 nyn_on_file, nysf, nysc, nys_on_file, tmp_3d, found ) 1148 1156 1149 1157 … … 1194 1202 END SELECT 1195 1203 1196 END SUBROUTINE user_rrd_local 1204 END SUBROUTINE user_rrd_local_ftn 1205 1206 1207 !--------------------------------------------------------------------------------------------------! 1208 ! Description: 1209 ! ------------ 1210 !> Read module-specific local restart data arrays (MPI-IO). 1211 !--------------------------------------------------------------------------------------------------! 1212 SUBROUTINE user_rrd_local_mpi 1213 1214 ! USE restart_data_mpi_io_mod, & 1215 ! ONLY: rd_mpi_io_check_array, rrd_mpi_io 1216 1217 ! CALL rd_mpi_io_check_array( 'u2_av' , found = array_found ) 1218 ! IF ( array_found ) THEN 1219 ! IF ( .NOT. ALLOCATED( u2_av ) ) ALLOCATE( u2_av(nysg:nyng,nxlg:nxrg) ) 1220 ! CALL rrd_mpi_io( 'rad_u2_av', rad_u2_av ) 1221 ! ENDIF 1222 1223 CONTINUE 1224 1225 END SUBROUTINE user_rrd_local_mpi 1197 1226 1198 1227 … … 1203 1232 !--------------------------------------------------------------------------------------------------! 1204 1233 SUBROUTINE user_wrd_global 1234 1235 ! USE restart_data_mpi_io_mod, & 1236 ! ONLY: wrd_mpi_io 1205 1237 1206 1238 IF ( TRIM( restart_data_format_output ) == 'fortran_binary' ) THEN … … 1224 1256 !--------------------------------------------------------------------------------------------------! 1225 1257 SUBROUTINE user_wrd_local 1258 1259 ! USE restart_data_mpi_io_mod, & 1260 ! ONLY: wrd_mpi_io 1226 1261 1227 1262 !
Note: See TracChangeset
for help on using the changeset viewer.