Ignore:
Timestamp:
Oct 13, 2008 2:59:11 PM (16 years ago)
Author:
raasch
Message:

ocean-atmosphere coupling realized with MPI-1, adjustments in mrun, mbuild, subjob for lcxt4

File:
1 edited

Legend:

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

    r110 r206  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Implementation of a MPI-1 Coupling: replaced myid with target_id,
     7! deleted __mpi2 directives
    78!
    89! Former revisions:
     
    3233    REAL    ::  simulated_time_remote
    3334
    34 #if defined( __parallel )  &&  defined( __mpi2 )
     35#if defined( __parallel )
    3536
    36     CALL cpu_log( log_point(39), 'surface_coupler', 'start' )
     37       CALL cpu_log( log_point(39), 'surface_coupler', 'start' )
    3738
    3839!
     
    4344!-- If necessary, the coupler will be called at the beginning of the next
    4445!-- restart run.
    45     CALL MPI_SENDRECV( terminate_coupled,        1, MPI_INTEGER, myid,  0, &
    46                        terminate_coupled_remote, 1, MPI_INTEGER, myid,  0, &
    47                        comm_inter, status, ierr )
     46    CALL MPI_SENDRECV( terminate_coupled,        1, MPI_INTEGER, target_id,  &
     47                       0, &
     48                       terminate_coupled_remote, 1, MPI_INTEGER, target_id,  &
     49                       0, comm_inter, status, ierr )
    4850    IF ( terminate_coupled_remote > 0 )  THEN
    4951       IF ( myid == 0 )  THEN
     
    6466!-- Exchange the current simulated time between the models,
    6567!-- currently just for testing
    66     CALL MPI_SEND( simulated_time, 1, MPI_REAL, myid, 11, comm_inter, ierr )
    67     CALL MPI_RECV( simulated_time_remote, 1, MPI_REAL, myid, 11, &
     68    CALL MPI_SEND( simulated_time, 1, MPI_REAL, target_id, 11, &
     69                   comm_inter, ierr )
     70    CALL MPI_RECV( simulated_time_remote, 1, MPI_REAL, target_id, 11, &
    6871                   comm_inter, status, ierr )
    6972    WRITE ( 9, * )  simulated_time, ' remote: ', simulated_time_remote
     
    7881       WRITE ( 9, * )  '*** send shf to ocean'
    7982       CALL local_flush( 9 )
    80        CALL MPI_SEND( shf(nys-1,nxl-1), ngp_xy, MPI_REAL, myid, 12, &
     83       CALL MPI_SEND( shf(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 12, &
    8184                      comm_inter, ierr )
    82        WRITE ( 9, * )  '    ready'
    83        CALL local_flush( 9 )
    8485
    8586!
     
    8889          WRITE ( 9, * )  '*** send qsws to ocean'
    8990          CALL local_flush( 9 )
    90           CALL MPI_SEND( qsws(nys-1,nxl-1), ngp_xy, MPI_REAL, myid, 13, &
     91          CALL MPI_SEND( qsws(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 13, &
    9192               comm_inter, ierr )
    92           WRITE ( 9, * )  '    ready'
    93           CALL local_flush( 9 )
    9493       ENDIF
    9594
     
    9897       WRITE ( 9, * )  '*** receive pt from ocean'
    9998       CALL local_flush( 9 )
    100        CALL MPI_RECV( pt(0,nys-1,nxl-1), 1, type_xy, myid, 14, comm_inter, &
    101                       status, ierr )
    102        WRITE ( 9, * )  '    ready'
    103        CALL local_flush( 9 )
     99       CALL MPI_RECV( pt(0,nys-1,nxl-1), 1, type_xy, target_id, 14, &
     100                      comm_inter, status, ierr )
    104101
    105102!
     
    107104       WRITE ( 9, * )  '*** send usws to ocean'
    108105       CALL local_flush( 9 )
    109        CALL MPI_SEND( usws(nys-1,nxl-1), ngp_xy, MPI_REAL, myid, 15, &
     106       CALL MPI_SEND( usws(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 15, &
    110107                      comm_inter, ierr )
    111        WRITE ( 9, * )  '    ready'
    112        CALL local_flush( 9 )
    113108
    114109!
     
    116111       WRITE ( 9, * )  '*** send vsws to ocean'
    117112       CALL local_flush( 9 )
    118        CALL MPI_SEND( vsws(nys-1,nxl-1), ngp_xy, MPI_REAL, myid, 16, &
     113       CALL MPI_SEND( vsws(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 16, &
    119114                      comm_inter, ierr )
    120        WRITE ( 9, * )  '    ready'
    121        CALL local_flush( 9 )
    122115
    123116    ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     
    127120       WRITE ( 9, * )  '*** receive tswst from atmosphere'
    128121       CALL local_flush( 9 )
    129        CALL MPI_RECV( tswst(nys-1,nxl-1), ngp_xy, MPI_REAL, myid, 12, &
     122       CALL MPI_RECV( tswst(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 12, &
    130123                      comm_inter, status, ierr )
    131        WRITE ( 9, * )  '    ready'
    132        CALL local_flush( 9 )
    133124
    134125!
     
    138129          WRITE ( 9, * )  '*** receive qswst_remote from atmosphere'
    139130          CALL local_flush( 9 )
    140           CALL MPI_RECV( qswst_remote(nys-1,nxl-1), ngp_xy, MPI_REAL, myid, &
    141                13, comm_inter, status, ierr )
    142           WRITE ( 9, * )  '    ready'
    143           CALL local_flush( 9 )
     131          CALL MPI_RECV( qswst_remote(nys-1,nxl-1), ngp_xy, MPI_REAL, &
     132                         target_id, 13, comm_inter, status, ierr )
    144133
    145134          !here tswst is still the sum of atmospheric bottom heat fluxes
     
    165154       WRITE ( 9, * )  '*** send pt to atmosphere'
    166155       CALL local_flush( 9 )
    167        CALL MPI_SEND( pt(nzt,nys-1,nxl-1), 1, type_xy, myid, 14, comm_inter, &
    168                       ierr )
    169        WRITE ( 9, * )  '    ready'
    170        CALL local_flush( 9 )
     156       CALL MPI_SEND( pt(nzt,nys-1,nxl-1), 1, type_xy, target_id, 14, &
     157                      comm_inter, ierr )
    171158
    172159!
     
    175162       WRITE ( 9, * )  '*** receive uswst from atmosphere'
    176163       CALL local_flush( 9 )
    177        CALL MPI_RECV( uswst(nys-1,nxl-1), ngp_xy, MPI_REAL, myid, 15, &
     164       CALL MPI_RECV( uswst(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 15, &
    178165                      comm_inter, status, ierr )
    179        WRITE ( 9, * )  '    ready'
    180        CALL local_flush( 9 )
    181166
    182167!
     
    185170       WRITE ( 9, * )  '*** receive vswst from atmosphere'
    186171       CALL local_flush( 9 )
    187        CALL MPI_RECV( vswst(nys-1,nxl-1), ngp_xy, MPI_REAL, myid, 16, &
     172       CALL MPI_RECV( vswst(nys-1,nxl-1), ngp_xy, MPI_REAL, target_id, 16, &
    188173                      comm_inter, status, ierr )
    189        WRITE ( 9, * )  '    ready'
    190        CALL local_flush( 9 )
    191174
    192175!
Note: See TracChangeset for help on using the changeset viewer.