Ignore:
Timestamp:
Mar 15, 2018 9:17:58 AM (3 years ago)
Author:
Giersch
Message:

Reading/Writing? data in case of restart runs revised

File:
1 edited

Legend:

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

    r2801 r2894  
    2525! -----------------
    2626! $Id$
     27! Modified todo list, _write_restart_data/_last_actions has been renamed to
     28! _wrd_local, unit 14 will be opened now for each io_group
     29! write_3d_binary is called wrd_local now, wrd_global moved from wrd_local to
     30! palm.f90, unit 14 is closed directly after the wrd_local call, Module related
     31! routines for writing restart data have been moved to wrd_local
     32!
     33! 2801 2018-02-14 16:01:55Z suehring
    2734! Changed lpm from subroutine to module.
    2835! Introduce particle transfer in nested models.
     
    204211!>
    205212!> @todo create routine last_actions instead of calling lsm_last_actions etc.
    206 !> @todo eventually move CALL usm_write_restart_data to suitable location
    207213!> @todo move chem_init call to init_3d_model or to check_parameters
    208214!------------------------------------------------------------------------------!
     
    213219
    214220    USE chemistry_model_mod,                                                   &
    215         ONLY:  chem_init, chem_last_actions
     221        ONLY:  chem_init
    216222
    217223    USE chem_photolysis_mod,                                                   &
     
    222228               cloud_physics, constant_diffusion, coupling_char, coupling_mode,&
    223229               do2d_at_begin, do3d_at_begin, humidity, initializing_actions,   &
    224                io_blocks, io_group, land_surface, large_scale_forcing,         &
     230               io_blocks, io_group, large_scale_forcing,                       &
    225231               message_string, microphysics_morrison, microphysics_seifert,    &
    226232               nest_domain, neutral, nudging, passive_scalar, runnr,           &
    227                simulated_time, simulated_time_chr, spinup, urban_surface,      &
     233               simulated_time, simulated_time_chr, spinup,                     &
    228234               user_interface_current_revision,                                &
    229235               user_interface_required_revision, version, wall_heatflux,       &
     
    242248    USE kinds
    243249
    244     USE land_surface_model_mod,                                                &
    245         ONLY:  lsm_write_restart_data
    246 
    247250    USE particle_attributes,                                                   &
    248251        ONLY:  particle_advection
    249252
    250253    USE pegrid
     254
     255    USE pmc_particle_interface,                                                &
     256        ONLY: pmcp_g_alloc_win
    251257
    252258    USE pmc_interface,                                                         &
     
    255261               pmci_ensure_nest_mass_conservation
    256262
    257     USE pmc_particle_interface,                                                 &
    258         ONLY: pmcp_g_alloc_win
    259 
    260     USE radiation_model_mod,                                                   &
    261         ONLY:  radiation, radiation_last_actions
    262        
    263     USE urban_surface_mod,                                                     &
    264         ONLY:  usm_write_restart_data       
     263    USE write_restart_data_mod,                                                &
     264        ONLY:  wrd_global, wrd_local
     265
    265266
    266267    IMPLICIT NONE
     
    478479    IF ( write_binary )  THEN
    479480
    480        CALL cpu_log( log_point(22), 'write_3d_binary', 'start' )
     481       CALL cpu_log( log_point(22), 'wrd_local', 'start' )
    481482
    482483       CALL location_message( 'writing restart data', .FALSE. )
    483 
    484        CALL check_open( 14 )
    485484
    486485       DO  i = 0, io_blocks-1
    487486          IF ( i == io_group )  THEN
    488 !
    489 !--          Write flow field data
    490              CALL write_3d_binary
     487
     488!
     489!--          Open binary file
     490             CALL check_open( 14 )
     491!
     492!--          Write control parameters and other global variables for restart.
     493             IF ( myid == 0 )  CALL wrd_global
     494!
     495!--          Write processor specific flow field data for restart runs
     496             CALL wrd_local
     497!
     498!--          Close binary file
     499             CALL close_file( 14 )
     500
    491501          ENDIF
    492502#if defined( __parallel )
     
    497507       CALL location_message( 'finished', .TRUE. )
    498508
    499        CALL cpu_log( log_point(22), 'write_3d_binary', 'stop' )
    500 
    501 !
    502 !--    If required, write particle data
     509       CALL cpu_log( log_point(22), 'wrd_local', 'stop' )
     510
     511!
     512!--    If required, write particle data in own restart files
    503513       IF ( particle_advection )  CALL lpm_write_restart_file
    504514       
     
    509519    IF ( myid == 0 )  CALL header
    510520!
    511 !-- If required, final land surface and user-defined actions, and
     521!-- If required, final user-defined actions, and
    512522!-- last actions on the open files and close files. Unit 14 was opened
    513 !-- in write_3d_binary but it is closed here, to allow writing on this
     523!-- in wrd_local but it is closed here, to allow writing on this
    514524!-- unit in routine user_last_actions.
    515525    CALL cpu_log( log_point(4), 'last actions', 'start' )
    516     DO  i = 0, io_blocks-1
    517        IF ( i == io_group )  THEN
    518 
    519           IF ( urban_surface )  THEN
    520              CALL usm_write_restart_data
    521           ENDIF
    522           IF ( land_surface )  THEN
    523              CALL lsm_write_restart_data
    524           ENDIF
    525           IF ( radiation )  THEN
    526              CALL radiation_last_actions
    527           ENDIF
    528           IF ( air_chemistry )  THEN
    529              CALL chem_last_actions
    530           ENDIF
    531526         
    532           CALL user_last_actions
    533           IF ( write_binary )  CALL close_file( 14 )
    534        ENDIF
    535 #if defined( __parallel )
    536        CALL MPI_BARRIER( comm2d, ierr )
    537 #endif
    538     ENDDO
     527    CALL user_last_actions
    539528    CALL close_file( 0 )
    540529    CALL close_dvrp
     530
    541531    CALL cpu_log( log_point(4), 'last actions', 'stop' )
    542532
Note: See TracChangeset for help on using the changeset viewer.