Ignore:
Timestamp:
Apr 13, 2020 8:11:20 PM (16 months ago)
Author:
raasch
Message:

restart data handling with MPI-IO added, first part

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/biometeorology_mod.f90

    r4493 r4495  
    2727! -----------------
    2828! $Id$
     29! restart data handling with MPI-IO added
     30!
     31! 4493 2020-04-10 09:49:43Z pavelkrc
    2932! Revise bad formatting
    3033!
     
    144147               dz, dz_stretch_factor,                                          &
    145148               dz_stretch_level, humidity, initializing_actions, nz_do3d,      &
    146                surface_pressure
     149               restart_data_format_output, surface_pressure
    147150
    148151    USE grid_variables,                                                        &
     
    168171               radiation_interactions, rad_sw_in,                              &
    169172               rad_sw_out, rad_lw_in, rad_lw_out
     173
     174    USE restart_data_mpi_io_mod,                                                                   &
     175        ONLY:  rrd_mpi_io, wrd_mpi_io
     176
    170177
    171178    IMPLICIT NONE
     
    352359!-- Read global restart parameters
    353360    INTERFACE bio_rrd_global
    354        MODULE PROCEDURE bio_rrd_global
     361       MODULE PROCEDURE bio_rrd_global_ftn
     362       MODULE PROCEDURE bio_rrd_global_mpi
    355363    END INTERFACE bio_rrd_global
    356364!
     
    13301338! Description:
    13311339! ------------
    1332 !> Soubroutine reads global biometeorology configuration from restart file(s)
    1333 !------------------------------------------------------------------------------!
    1334  SUBROUTINE bio_rrd_global( found )
     1340!> Read module-specific global restart data (Fortran binary format).
     1341!------------------------------------------------------------------------------!
     1342 SUBROUTINE bio_rrd_global_ftn( found )
    13351343
    13361344    USE control_parameters,                                                    &
     
    13891397
    13901398
    1391  END SUBROUTINE bio_rrd_global
     1399 END SUBROUTINE bio_rrd_global_ftn
     1400
     1401
     1402!------------------------------------------------------------------------------!
     1403! Description:
     1404! ------------
     1405!> Read module-specific global restart data (MPI-IO).
     1406!------------------------------------------------------------------------------!
     1407 SUBROUTINE bio_rrd_global_mpi
     1408
     1409
     1410!
     1411!--  Read control flags to determine if input grids need to be averaged
     1412     CALL rrd_mpi_io( 'do_average_theta', do_average_theta )
     1413     CALL rrd_mpi_io( 'do_average_q', do_average_q )
     1414     CALL rrd_mpi_io( 'do_average_u', do_average_u )
     1415     CALL rrd_mpi_io( 'do_average_v', do_average_v )
     1416     CALL rrd_mpi_io( 'do_average_w', do_average_w )
     1417     CALL rrd_mpi_io( 'do_average_mrt', do_average_mrt )
     1418!
     1419!--  Rad control flags to determine which thermal index needs to trigger averaging
     1420     CALL rrd_mpi_io( 'average_trigger_perct', average_trigger_perct )
     1421     CALL rrd_mpi_io( 'average_trigger_utci', average_trigger_utci )
     1422     CALL rrd_mpi_io( 'average_trigger_pet', average_trigger_pet )
     1423     CALL rrd_mpi_io( 'average_trigger_mrt', average_trigger_mrt )
     1424
     1425 END SUBROUTINE bio_rrd_global_mpi
    13921426
    13931427
     
    14421476    IMPLICIT NONE
    14431477
    1444     CALL wrd_write_string( 'do_average_theta' )
    1445     WRITE ( 14 )  do_average_theta
    1446     CALL wrd_write_string( 'do_average_q' )
    1447     WRITE ( 14 )  do_average_q
    1448     CALL wrd_write_string( 'do_average_u' )
    1449     WRITE ( 14 )  do_average_u
    1450     CALL wrd_write_string( 'do_average_v' )
    1451     WRITE ( 14 )  do_average_v
    1452     CALL wrd_write_string( 'do_average_w' )
    1453     WRITE ( 14 )  do_average_w
    1454     CALL wrd_write_string( 'do_average_mrt' )
    1455     WRITE ( 14 )  do_average_mrt
    1456     CALL wrd_write_string( 'average_trigger_perct' )
    1457     WRITE ( 14 )  average_trigger_perct
    1458     CALL wrd_write_string( 'average_trigger_utci' )
    1459     WRITE ( 14 )  average_trigger_utci
    1460     CALL wrd_write_string( 'average_trigger_pet' )
    1461     WRITE ( 14 )  average_trigger_pet
    1462     CALL wrd_write_string( 'average_trigger_mrt' )
    1463     WRITE ( 14 )  average_trigger_mrt
     1478    IF ( TRIM( restart_data_format_output ) == 'fortran_binary' )  THEN
     1479
     1480       CALL wrd_write_string( 'do_average_theta' )
     1481       WRITE ( 14 )  do_average_theta
     1482       CALL wrd_write_string( 'do_average_q' )
     1483       WRITE ( 14 )  do_average_q
     1484       CALL wrd_write_string( 'do_average_u' )
     1485       WRITE ( 14 )  do_average_u
     1486       CALL wrd_write_string( 'do_average_v' )
     1487       WRITE ( 14 )  do_average_v
     1488       CALL wrd_write_string( 'do_average_w' )
     1489       WRITE ( 14 )  do_average_w
     1490       CALL wrd_write_string( 'do_average_mrt' )
     1491       WRITE ( 14 )  do_average_mrt
     1492       CALL wrd_write_string( 'average_trigger_perct' )
     1493       WRITE ( 14 )  average_trigger_perct
     1494       CALL wrd_write_string( 'average_trigger_utci' )
     1495       WRITE ( 14 )  average_trigger_utci
     1496       CALL wrd_write_string( 'average_trigger_pet' )
     1497       WRITE ( 14 )  average_trigger_pet
     1498       CALL wrd_write_string( 'average_trigger_mrt' )
     1499       WRITE ( 14 )  average_trigger_mrt
     1500
     1501    ELSEIF ( TRIM( restart_data_format_output ) == 'mpi' )  THEN
     1502
     1503       CALL wrd_mpi_io( 'do_average_theta', do_average_theta )
     1504       CALL wrd_mpi_io( 'do_average_q', do_average_q )
     1505       CALL wrd_mpi_io( 'do_average_u', do_average_u )
     1506       CALL wrd_mpi_io( 'do_average_v', do_average_v )
     1507       CALL wrd_mpi_io( 'do_average_w', do_average_w )
     1508       CALL wrd_mpi_io( 'do_average_mrt', do_average_mrt )
     1509       CALL wrd_mpi_io( 'average_trigger_perct', average_trigger_perct )
     1510       CALL wrd_mpi_io( 'average_trigger_utci', average_trigger_utci )
     1511       CALL wrd_mpi_io( 'average_trigger_pet', average_trigger_pet )
     1512       CALL wrd_mpi_io( 'average_trigger_mrt', average_trigger_mrt )
     1513    ENDIF
    14641514
    14651515 END SUBROUTINE bio_wrd_global
     
    14751525    IMPLICIT NONE
    14761526
    1477 !
    1478 !-- First nmrtbl has to be written/read, because it is the dimension of mrt_av_grid
    1479     CALL wrd_write_string( 'nmrtbl' )
    1480     WRITE ( 14 )  nmrtbl
    1481 
    1482     IF ( ALLOCATED( mrt_av_grid ) )  THEN
    1483        CALL wrd_write_string( 'mrt_av_grid' )
    1484        WRITE ( 14 )  mrt_av_grid
    1485     ENDIF
    1486 
     1527
     1528    IF ( TRIM( restart_data_format_output ) == 'fortran_binary' )  THEN
     1529
     1530!
     1531!--    First nmrtbl has to be written/read, because it is the dimension of mrt_av_grid
     1532       CALL wrd_write_string( 'nmrtbl' )
     1533       WRITE ( 14 )  nmrtbl
     1534
     1535       IF ( ALLOCATED( mrt_av_grid ) )  THEN
     1536          CALL wrd_write_string( 'mrt_av_grid' )
     1537          WRITE ( 14 )  mrt_av_grid
     1538       ENDIF
     1539
     1540    ELSEIF ( TRIM( restart_data_format_output ) == 'mpi' )  THEN
     1541
     1542!
     1543!--   TODO: the mrt_av_grid is a 1-d array and its size depends on subdomain features. This does
     1544!--         not work with the MPI-IO concept (nor with the restart I/O concept in general.
     1545!--         I am not sure, if this data needs to be written to the restart file at all (Siggi, 13.4.20)
     1546!       CALL wrd_mpi_io( 'nmrtbl', nmrtbl )
     1547!       CALL wrd_mpi_io_..... 'mrt_av_grid'
     1548       WRITE (6,*) '+++ biometeorology module does not work with MPI-IO for restart_data'
     1549       STOP
     1550
     1551    ENDIF
    14871552
    14881553 END SUBROUTINE bio_wrd_local
Note: See TracChangeset for help on using the changeset viewer.