Changeset 206 for palm/trunk/SOURCE/palm.f90
- Timestamp:
- Oct 13, 2008 2:59:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/palm.f90
r198 r206 4 4 ! Actual revisions: 5 5 ! ----------------- 6 ! 6 ! Initialization of coupled runs modified for MPI-1 and moved to external 7 ! subroutine init_coupling 7 8 ! 8 9 ! Former revisions: … … 77 78 CALL MPI_INIT( ierr ) 78 79 CALL MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr ) 80 CALL MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr ) 79 81 comm_palm = MPI_COMM_WORLD 80 82 comm2d = MPI_COMM_WORLD 81 #endif 82 83 #if defined( __mpi2 ) 84 ! 85 !-- Get information about the coupling mode from the environment variable 86 !-- which has been set by the mpiexec command. 87 !-- This method is currently not used because the mpiexec command is not 88 !-- available on some machines 89 ! CALL local_getenv( 'coupling_mode', 13, coupling_mode, i ) 90 ! IF ( i == 0 ) coupling_mode = 'uncoupled' 91 ! IF ( coupling_mode == 'ocean_to_atmosphere' ) coupling_char = '_O' 92 93 ! 94 !-- Get information about the coupling mode from standard input (PE0 only) and 95 !-- distribute it to the other PEs 96 CALL MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr ) 97 IF ( myid == 0 ) THEN 98 READ (*,*,ERR=10,END=10) coupling_mode 99 10 IF ( TRIM( coupling_mode ) == 'atmosphere_to_ocean' ) THEN 100 i = 1 101 ELSEIF ( TRIM( coupling_mode ) == 'ocean_to_atmosphere' ) THEN 102 i = 2 103 ELSE 104 i = 0 105 ENDIF 106 ENDIF 107 CALL MPI_BCAST( i, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr ) 108 IF ( i == 0 ) THEN 109 coupling_mode = 'uncoupled' 110 ELSEIF ( i == 1 ) THEN 111 coupling_mode = 'atmosphere_to_ocean' 112 ELSEIF ( i == 2 ) THEN 113 coupling_mode = 'ocean_to_atmosphere' 114 ENDIF 115 IF ( coupling_mode == 'ocean_to_atmosphere' ) coupling_char = '_O' 83 84 ! 85 !-- Initialize PE topology in case of coupled runs 86 CALL init_coupling 116 87 #endif 117 88 … … 124 95 CALL cpu_log( log_point(1), 'total', 'start' ) 125 96 CALL cpu_log( log_point(2), 'initialisation', 'start' ) 97 98 ! 99 !-- Open a file for debug output 100 WRITE (myid_char,'(''_'',I4.4)') myid 101 OPEN( 9, FILE='DEBUG'//TRIM( coupling_char )//myid_char, FORM='FORMATTED' ) 126 102 127 103 ! … … 132 108 #if defined( __parallel ) 133 109 CALL MPI_COMM_RANK( comm_palm, myid, ierr ) 134 #endif135 136 !137 !-- Open a file for debug output138 WRITE (myid_char,'(''_'',I4.4)') myid139 OPEN( 9, FILE='DEBUG'//TRIM( coupling_char )//myid_char, FORM='FORMATTED' )140 141 #if defined( __mpi2 )142 110 ! 143 111 !-- TEST OUTPUT (TO BE REMOVED) 144 112 WRITE(9,*) '*** coupling_mode = "', TRIM( coupling_mode ), '"' 145 113 CALL LOCAL_FLUSH( 9 ) 146 print*, '*** PE', myid, ' ', TRIM( coupling_mode ) 114 PRINT*, '*** PE', myid, ' Global target PE:', target_id, & 115 TRIM( coupling_mode ) 147 116 #endif 148 117 … … 220 189 #if defined( __mpi2 ) 221 190 ! 222 !-- Test exchange via intercommunicator 191 !-- Test exchange via intercommunicator in case of a MPI-2 coupling 223 192 IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN 224 193 i = 12345 + myid … … 240 209 241 210 END PROGRAM palm 242
Note: See TracChangeset
for help on using the changeset viewer.