Ignore:
Timestamp:
Feb 28, 2016 12:45:19 PM (8 years ago)
Author:
raasch
Message:

update of the nested domain system + some bugfixes

File:
1 edited

Legend:

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

    r1763 r1764  
    1919! Current revisions:
    2020! ------------------
    21 !
     21! PMC_ACTIVE flags removed,
     22! nest synchronization after first call of timestep
    2223!
    2324! Former revisions:
     
    238239    USE pegrid
    239240
    240 #if defined( PMC_ACTIVE )
    241241    USE pmc_interface,                                                         &
    242         ONLY:  client_to_server, nesting_mode,                                 &
     242        ONLY:  client_to_server, nested_run, nesting_mode,                     &
    243243               pmci_ensure_nest_mass_conservation, pmci_client_datatrans,      &
    244244               pmci_client_initialize, pmci_client_synchronize,                &
    245245               pmci_server_datatrans, pmci_server_initialize,                  &
    246246               pmci_server_synchronize, pmci_update_new, server_to_client
    247 #endif
    248247
    249248    USE production_e_mod,                                                      &
     
    282281    IF ( simulated_time == 0.0_wp )  CALL timestep
    283282
     283!
     284!-- Synchronize the timestep in case of nested run.
     285!-- The server side must be called first
     286    IF ( nested_run )  THEN
     287       CALL pmci_server_synchronize
     288       CALL pmci_client_synchronize
     289    ENDIF
     290
    284291    CALL run_control
    285 
    286292
    287293!
     
    302308    ENDIF
    303309
    304 #if defined( PMC_ACTIVE )
    305 !
    306 !-- TO_DO: try to give more meaningful comments here
    307 !-- Domain nesting: From server to client commmunication
    308 !-- ( direction=SERVER_TO_CLIENT )
    309 !-- Nest initial conditions
    310 !
    311 !-- Send initial condition data from server to client
    312     CALL pmci_server_initialize
    313 !
    314 !-- Receive and interpolate initial data on client
    315     CALL pmci_client_initialize
    316 !
    317 !-- TO_DO, maybe removed
    318 !-- Obs. Nesting may be unnecessary at this point.
    319 !
    320 !-- Nest boundary conditions
    321     CALL pmci_server_datatrans( server_to_client )
    322     CALL pmci_client_datatrans( server_to_client )
    323 
    324     IF ( nesting_mode == 'two-way' )  THEN
    325        CALL pmci_server_datatrans( client_to_server )
    326        CALL pmci_client_datatrans( client_to_server )
    327 !
    328 !--    Exchange_horiz is needed for all server-domains after the anterpolation
    329        CALL exchange_horiz( u, nbgp )
    330        CALL exchange_horiz( v, nbgp )
    331        CALL exchange_horiz( w, nbgp )
    332        CALL exchange_horiz( pt, nbgp )
    333        IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
    334        intermediate_timestep_count = 0
    335        CALL pres
     310    IF ( nested_run )  THEN
     311!
     312!--    TO_DO: try to give more meaningful comments here
     313!--    Domain nesting: From server to client commmunication
     314!--    ( direction=SERVER_TO_CLIENT )
     315!--    Nest initial conditions
     316!
     317!--    Send initial condition data from server to client
     318       CALL pmci_server_initialize
     319!
     320!--    Receive and interpolate initial data on client
     321       CALL pmci_client_initialize
     322!
     323!--    TO_DO, maybe removed
     324!--    Obs. Nesting may be unnecessary at this point.
     325!
     326!--    Nest boundary conditions
     327       CALL pmci_server_datatrans( server_to_client )
     328       CALL pmci_client_datatrans( server_to_client )
     329
     330       IF ( nesting_mode == 'two-way' )  THEN
     331          CALL pmci_server_datatrans( client_to_server )
     332          CALL pmci_client_datatrans( client_to_server )
     333!
     334!--       Exchange_horiz is needed for all server-domains after the anterpolation
     335          CALL exchange_horiz( u, nbgp )
     336          CALL exchange_horiz( v, nbgp )
     337          CALL exchange_horiz( w, nbgp )
     338          CALL exchange_horiz( pt, nbgp )
     339          IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
     340          intermediate_timestep_count = 0
     341          CALL pres
     342       ENDIF
     343!
     344!--    Correct the w top-BC in nest domains to ensure mass conservation.
     345!--    Copy the interpolated/anterpolated boundary values to the _p
     346!--    arrays, too, to make sure the interpolated/anterpolated boundary
     347!--    values are carried over from one RK inner step to another.
     348!--    These actions must not be done for the root domain.
     349       IF ( nest_domain )  THEN
     350          CALL pmci_ensure_nest_mass_conservation
     351          CALL pmci_update_new
     352       ENDIF
     353
    336354    ENDIF
    337 !
    338 !-- Correct the w top-BC in nest domains to ensure mass conservation.
    339 !-- Copy the interpolated/anterpolated boundary values to the _p
    340 !-- arrays, too, to make sure the interpolated/anterpolated boundary
    341 !-- values are carried over from one RK inner step to another.
    342 !-- These actions must not be done for the root domain.
    343     IF ( nest_domain )  THEN
    344        CALL pmci_ensure_nest_mass_conservation
    345        CALL pmci_update_new
    346     ENDIF
    347 #endif
    348355
    349356#if defined( __dvrp_graphics )
     
    366373          CALL timestep
    367374
    368 #if defined( PMC_ACTIVE )
    369 !
    370 !--       TO_DO: try to give more detailed and meaningful comments here
    371 !--       Server side must be called first
    372           CALL pmci_server_synchronize
    373           CALL pmci_client_synchronize
    374 #endif
     375          IF ( nested_run )  THEN
     376!
     377!--          TO_DO: try to give more detailed and meaningful comments here
     378!--          Server side must be called first
     379             CALL pmci_server_synchronize
     380             CALL pmci_client_synchronize
     381          ENDIF
    375382       ENDIF
    376383
     
    694701          CALL swap_timelevel
    695702
    696 #if defined( PMC_ACTIVE )
    697 !
    698 !--       TO_DO: try to give more meaningful comments here
    699 !--       Domain nesting
    700 !--       Note that the nesting operations are omitted intentionally on the
    701 !--       first two RK-substeps.
    702           CALL cpu_log( log_point(60), 'nesting', 'start' )
    703 !
    704 !--       From server to client commmunication ( direction=SERVER_TO_CLIENT )
    705           CALL pmci_server_datatrans( server_to_client )
    706           CALL pmci_client_datatrans( server_to_client )
    707 
    708           IF ( nesting_mode == 'two-way' )  THEN
    709 !
    710 !--          From client to server commmunication ( direction=CLIENT_TO_SERVER )
    711              CALL pmci_server_datatrans( client_to_server )
    712              CALL pmci_client_datatrans( client_to_server )
    713 !
    714 !--          Exchange_horiz is needed for all server-domains after the
    715 !--          anterpolation
    716              CALL exchange_horiz( u, nbgp )
    717              CALL exchange_horiz( v, nbgp )
    718              CALL exchange_horiz( w, nbgp )
    719              CALL exchange_horiz( pt, nbgp )
    720              IF ( humidity  .OR.  passive_scalar )  THEN
    721                 CALL exchange_horiz( q, nbgp )
    722              ENDIF
    723              IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
    724           ENDIF
    725 !
    726 !--       Correct the w top-BC in nest domains to ensure mass conservation.
    727 !--       This action must never be done for the root domain.
    728           IF ( nest_domain )  THEN
    729              CALL pmci_ensure_nest_mass_conservation
    730 !
    731 !--          pmc_update_new is not necessary if nesting is made at each substep.
    732              CALL pmci_update_new
    733           ENDIF
    734 
    735           CALL cpu_log( log_point(60), 'nesting', 'stop' )
    736 #endif
     703          IF ( nested_run )  THEN
     704!
     705!--          TO_DO: try to give more meaningful comments here
     706!--          Domain nesting
     707!--          Note that the nesting operations are omitted intentionally on the
     708!--          first two RK-substeps.
     709             CALL cpu_log( log_point(60), 'nesting', 'start' )
     710!
     711!--          From server to client commmunication ( direction=SERVER_TO_CLIENT )
     712             CALL pmci_server_datatrans( server_to_client )
     713             CALL pmci_client_datatrans( server_to_client )
     714
     715             IF ( nesting_mode == 'two-way' )  THEN
     716!
     717!--             From client to server commmunication ( direction=CLIENT_TO_SERVER )
     718                CALL pmci_server_datatrans( client_to_server )
     719                CALL pmci_client_datatrans( client_to_server )
     720!
     721!--             Exchange_horiz is needed for all server-domains after the
     722!--             anterpolation
     723                CALL exchange_horiz( u, nbgp )
     724                CALL exchange_horiz( v, nbgp )
     725                CALL exchange_horiz( w, nbgp )
     726                CALL exchange_horiz( pt, nbgp )
     727                IF ( humidity  .OR.  passive_scalar )  THEN
     728                   CALL exchange_horiz( q, nbgp )
     729                ENDIF
     730                IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
     731             ENDIF
     732!
     733!--          Correct the w top-BC in nest domains to ensure mass conservation.
     734!--          This action must never be done for the root domain.
     735             IF ( nest_domain )  THEN
     736                CALL pmci_ensure_nest_mass_conservation
     737!
     738!--             pmc_update_new is not necessary if nesting is made at each
     739!--             substep
     740                CALL pmci_update_new
     741             ENDIF
     742
     743             CALL cpu_log( log_point(60), 'nesting', 'stop' )
     744
     745          ENDIF
    737746
    738747!
     
    11481157!
    11491158!--    Output elapsed simulated time in form of a progress bar on stdout
    1150 !--    TO_DO: should be done by root domain later
    1151 #if ! defined( PMC_ACTIVE )
    11521159       IF ( myid == 0 )  CALL output_progress_bar
    1153 #endif
    11541160
    11551161       CALL cpu_log( log_point_s(10), 'timesteps', 'stop' )
     
    11581164    ENDDO   ! time loop
    11591165
    1160 !-- TO_DO: should be done by root domain later
    1161 #if ! defined( PMC_ACTIVE )
    11621166    IF ( myid == 0 )  CALL finish_progress_bar
    1163 #endif
    11641167
    11651168#if defined( __dvrp_graphics )
Note: See TracChangeset for help on using the changeset viewer.