Ignore:
Timestamp:
Jul 27, 2007 9:09:17 AM (14 years ago)
Author:
raasch
Message:

preliminary version for coupled runs

File:
1 edited

Legend:

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

    r83 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Intercommunicator (comm_inter) and derived data type (type_xy) for
     7! coupled model runs created
    78!
    89! Former revisions:
     
    480481       CALL MPI_SEND( ibuf, 12, MPI_INTEGER, 0, myid, comm2d, ierr )       
    481482    ENDIF
     483#endif
     484
     485#if defined( __mpi2 )
     486!
     487!-- In case of coupled runs, get the port name on PE0 of the atmosphere model
     488!-- and pass it to PE0 of the ocean model
     489    IF ( myid == 0 )  THEN
     490
     491       IF ( coupling_mode == 'atmosphere_to_ocean' )  THEN
     492
     493          CALL MPI_OPEN_PORT( MPI_INFO_NULL, port_name, ierr )
     494          CALL MPI_PUBLISH_NAME( 'palm_coupler', MPI_INFO_NULL, port_name, &
     495                                 ierr )
     496
     497       ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     498
     499          CALL MPI_LOOKUP_NAME( 'palm_coupler', MPI_INFO_NULL, port_name, ierr )
     500
     501       ENDIF
     502
     503    ENDIF
     504
     505!
     506!-- In case of coupled runs, establish the connection between the atmosphere
     507!-- and the ocean model and define the intercommunicator (comm_inter)
     508    CALL MPI_BARRIER( comm2d, ierr )
     509    IF ( coupling_mode == 'atmosphere_to_ocean' )  THEN
     510
     511       print*, '... before COMM_ACCEPT'
     512       CALL MPI_COMM_ACCEPT( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &
     513                             comm_inter, ierr )
     514       print*, '--- ierr = ', ierr
     515       print*, '--- comm_inter atmosphere = ', comm_inter
     516
     517    ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     518
     519       IF ( myid == 0 )  PRINT*, '*** read: ', port_name, '  ierr = ', ierr
     520       print*, '... before COMM_CONNECT'
     521       CALL MPI_COMM_CONNECT( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &
     522                              comm_inter, ierr )
     523       print*, '--- ierr = ', ierr
     524       print*, '--- comm_inter ocean      = ', comm_inter
     525
     526    ENDIF
     527
     528!
     529!-- In case of coupled runs, create a new MPI derived datatype for the
     530!-- exchange of surface (xy) data .
     531!-- Gridpoint number for the exchange of ghost points (xy-plane)
     532    ngp_xy  = ( nxr - nxl + 3 ) * ( nyn - nys + 3 )
     533
     534!
     535!-- Define a new MPI derived datatype for the exchange of ghost points in
     536!-- y-direction for 2D-arrays (line)
     537    CALL MPI_TYPE_VECTOR( ngp_xy, 1, nzt-nzb+2, MPI_REAL, type_xy, ierr )
     538    CALL MPI_TYPE_COMMIT( type_xy, ierr )
    482539#endif
    483540
Note: See TracChangeset for help on using the changeset viewer.