Ignore:
Timestamp:
Jun 12, 2018 7:03:02 AM (6 years ago)
Author:
Giersch
Message:

New vertical stretching procedure has been introduced

File:
1 edited

Legend:

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

    r3049 r3065  
    2626! -----------------
    2727! $Id$
     28! dz was replaced by dz(1), error messages related to vertical grid stretching
     29! have been added
     30!
     31! 3049 2018-05-29 13:52:36Z Giersch
    2832! Error messages revised
    2933!
     
    7377!> after spin-up of the CG
    7478!>
     79!> @todo Replace dz(1) appropriatly to account for grid stretching
    7580!> @todo Ensure that code can be compiled for serial and parallel mode. Please
    7681!>       check the placement of the directive "__parallel".
     
    36393644
    36403645       USE control_parameters,                                                    &
    3641            ONLY:  coupling_mode, coupling_mode_remote, coupling_topology, dz
     3646           ONLY:  coupling_mode, coupling_mode_remote, coupling_topology, dz,     &
     3647                  dz_stretch_level_start, message_string
    36423648
    36433649       USE grid_variables,                                                        &
     
    36783684           dxc = dx
    36793685           dyc = dy
    3680            dzc = dz
     3686           dzc = dz(1)
    36813687           cg_nprocs = numprocs
    36823688
    36833689           IF ( myid == 0 )  THEN
    36843690
    3685                CALL MPI_SEND( nxc, 1, MPI_INTEGER  , numprocs, 1,  comm_inter,  &
     3691               CALL MPI_SEND( nxc, 1, MPI_INTEGER  , numprocs, 1,  comm_inter, &
    36863692                   ierr )
    3687                CALL MPI_SEND( nyc, 1, MPI_INTEGER  , numprocs, 2,  comm_inter,  &
     3693               CALL MPI_SEND( nyc, 1, MPI_INTEGER  , numprocs, 2,  comm_inter, &
    36883694                   ierr )
    3689                CALL MPI_SEND( nzc, 1, MPI_INTEGER  , numprocs, 3,  comm_inter,  &
     3695               CALL MPI_SEND( nzc, 1, MPI_INTEGER  , numprocs, 3,  comm_inter, &
    36903696                   ierr )
    3691                CALL MPI_SEND( dxc, 1, MPI_REAL     , numprocs, 4,  comm_inter,  &
     3697               CALL MPI_SEND( dxc, 1, MPI_REAL     , numprocs, 4,  comm_inter, &
    36923698                   ierr )
    3693                CALL MPI_SEND( dyc, 1, MPI_REAL     , numprocs, 5,  comm_inter,  &
     3699               CALL MPI_SEND( dyc, 1, MPI_REAL     , numprocs, 5,  comm_inter, &
    36943700                   ierr )
    3695                CALL MPI_SEND( dzc, 1, MPI_REAL     , numprocs, 6,  comm_inter,  &
     3701               CALL MPI_SEND( dzc, 1, MPI_REAL     , numprocs, 6,  comm_inter, &
    36963702                   ierr )
    3697                CALL MPI_SEND( pdims, 2, MPI_INTEGER, numprocs, 7,  comm_inter,  &
     3703               CALL MPI_SEND( pdims, 2, MPI_INTEGER, numprocs, 7,  comm_inter, &
    36983704                   ierr )
    36993705               CALL MPI_SEND( cg_nprocs, 1, MPI_INTEGER, numprocs, 8,  comm_inter,  &
    37003706                   ierr )
    3701                CALL MPI_RECV( nxf, 1, MPI_INTEGER,   numprocs, 21, comm_inter,  &
     3707               CALL MPI_RECV( nxf, 1, MPI_INTEGER,   numprocs, 21, comm_inter, &
    37023708                   status, ierr )
    3703                CALL MPI_RECV( nyf, 1, MPI_INTEGER,   numprocs, 22, comm_inter,  &
     3709               CALL MPI_RECV( nyf, 1, MPI_INTEGER,   numprocs, 22, comm_inter, &
    37043710                   status, ierr )
    3705                CALL MPI_RECV( nzf, 1, MPI_INTEGER,   numprocs, 23, comm_inter,  &
     3711               CALL MPI_RECV( nzf, 1, MPI_INTEGER,   numprocs, 23, comm_inter, &
    37063712                   status, ierr )
    3707                CALL MPI_RECV( dxf, 1, MPI_REAL,      numprocs, 24, comm_inter,  &
     3713               CALL MPI_RECV( dxf, 1, MPI_REAL,      numprocs, 24, comm_inter, &
    37083714                   status, ierr )
    3709                CALL MPI_RECV( dyf, 1, MPI_REAL,      numprocs, 25, comm_inter,  &
     3715               CALL MPI_RECV( dyf, 1, MPI_REAL,      numprocs, 25, comm_inter, &
    37103716                   status, ierr )
    3711                CALL MPI_RECV( dzf, 1, MPI_REAL,      numprocs, 26, comm_inter,  &
     3717               CALL MPI_RECV( dzf, 1, MPI_REAL,      numprocs, 26, comm_inter, &
    37123718                   status, ierr )
    3713                CALL MPI_RECV( pdims_partner, 2, MPI_INTEGER,                     &
     3719               CALL MPI_RECV( pdims_partner, 2, MPI_INTEGER,                   &
    37143720                   numprocs, 27, comm_inter, status, ierr )
    3715                CALL MPI_RECV( fg_nprocs, 1, MPI_INTEGER,                     &
     3721               CALL MPI_RECV( fg_nprocs, 1, MPI_INTEGER,                       &
    37163722                   numprocs, 28, comm_inter, status, ierr )
    37173723           ENDIF
     
    37253731           CALL MPI_BCAST( pdims_partner, 2, MPI_INTEGER, 0, comm2d, ierr )
    37263732           CALL MPI_BCAST( fg_nprocs,  1, MPI_INTEGER, 0, comm2d, ierr )
     3733           
     3734!
     3735!--        Check if stretching is used within the nested domain. ABS(...) is
     3736!--        necessary because of the default value of -9999999.9_wp (negative)
     3737           IF ( ABS( dz_stretch_level_start(1) ) <= (nzf+1)*dzf )  THEN       
     3738               message_string = 'Stretching in the parent domain is '//        &
     3739                                'only allowed above the nested domain'
     3740               CALL message( 'vertical_nesting_mod', 'PA0497', 1, 2, 0, 6, 0 )
     3741           ENDIF
    37273742
    37283743       ELSEIF ( coupling_mode ==  'vnested_fine' )  THEN
     
    37333748           dxf = dx
    37343749           dyf = dy
    3735            dzf = dz
     3750           dzf = dz(1)
    37363751           fg_nprocs = numprocs
    37373752
     
    37743789
    37753790       ENDIF
    3776  
     3791       
    37773792       ngp_c = ( nxc+1 + 2 * nbgp ) * ( nyc+1 + 2 * nbgp )
    37783793       ngp_f = ( nxf+1 + 2 * nbgp ) * ( nyf+1 + 2 * nbgp )
     
    39103925 
    39113926#if defined( __parallel )
    3912           USE arrays_3d,                                                             &
     3927          USE arrays_3d,                                                       &
    39133928              ONLY:  zu, zw
    39143929             
    3915           USE control_parameters,                                                    &
    3916               ONLY:  coupling_mode
     3930          USE control_parameters,                                              &
     3931              ONLY:  coupling_mode, message_string, number_stretch_level_start
    39173932             
    3918           USE indices,                                                               &
     3933          USE indices,                                                         &
    39193934              ONLY:  nzt
    39203935         
     
    39253940          IMPLICIT NONE
    39263941     
    3927           !-- Allocate and Exchange zuc and zuf, zwc and zwf
     3942!
     3943!--       Allocate and Exchange zuc and zuf, zwc and zwf
    39283944          IF ( coupling_mode(1:8)  == 'vnested_' )  THEN
    39293945         
     
    39323948         
    39333949             IF ( coupling_mode ==  'vnested_crse' )  THEN
    3934          
    3935                    zuc = zu
    3936                    zwc = zw
     3950               
     3951                zuc = zu
     3952                zwc = zw
     3953               
    39373954                IF ( myid == 0 )  THEN
    39383955         
     
    39543971             ELSEIF ( coupling_mode ==  'vnested_fine' )  THEN
    39553972         
    3956                    zuf = zu
    3957                    zwf = zw
     3973!
     3974!--             Check if stretching is used within the nested domain
     3975                IF ( number_stretch_level_start > 0 )  THEN
     3976                   message_string = 'Stretching in the nested domain is not '//&
     3977                           'allowed'
     3978                   CALL message( 'vertical_nesting_mod', 'PA0498', 1, 2, 0, 6, 0 )
     3979                ENDIF
     3980               
     3981                zuf = zu
     3982                zwf = zw
     3983               
    39583984                IF ( myid == 0 )  THEN
    39593985         
Note: See TracChangeset for help on using the changeset viewer.