00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 subroutine prismtrs_target_int(id_process_global_rank, &
00013 id_transient_in_id, &
00014 id_epio_id, &
00015 id_nbr_fields, &
00016 id_err)
00017
00018
00019
00020
00021 USE PRISMDrv, dummy_interface => PRISMTrs_Target_int
00022
00023 IMPLICIT NONE
00024
00025
00026
00027
00028
00029 INTEGER , INTENT (In) :: id_process_global_rank
00030
00031
00032 INTEGER, INTENT (In) :: id_transient_in_id
00033
00034
00035 INTEGER, INTENT (IN) :: id_epio_id
00036
00037
00038 INTEGER, INTENT (In) :: id_nbr_fields
00039
00040
00041
00042
00043 INTEGER, INTENT (Out) :: id_err
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 CHARACTER(LEN=len_cvs_string), SAVE :: mycvs =
00065 '$Id: prismtrs_target_int.F90 2685 2010-10-28 14:05:10Z coquart $'
00066
00067
00068
00069 INTEGER, DIMENSION(:), ALLOCATABLE :: ila_field
00070 INTEGER :: il_field_status
00071
00072
00073
00074 INTEGER :: il_size
00075
00076 INTEGER :: ib
00077 INTEGER :: il_exchange_id
00078
00079 LOGICAL :: conservation
00080
00081
00082 LOGICAL :: ll_found
00083 INTEGER, PARAMETER :: nerrp = 2
00084 INTEGER :: ierrp (nerrp)
00085
00086
00087
00088 #ifdef VERBOSE
00089 PRINT *, '| | | Enter PRISMTrs_Target_int '
00090 call psmile_flushstd
00091 #endif
00092
00093
00094
00095
00096 ll_found = .false.
00097 DO ib = 1, Number_of_Exchanges
00098 IF (Drv_Exchanges(ib)%trans_in_id .eq. id_transient_in_id) THEN
00099 IF (Drv_Exchanges(ib)%epio_id .eq. id_epio_id) THEN
00100 il_exchange_id = ib
00101 ll_found = .true.
00102 EXIT
00103 END IF
00104 END IF
00105 END DO
00106
00107 IF (.NOT. ll_found) THEN
00108 ierrp(1) = Number_of_Exchanges
00109 ierrp(2) = ib
00110 call psmile_error_common ( id_err, 'PRISMTrs_Target_int', &
00111 ierrp, 2, __FILE__, __LINE__ )
00112 END IF
00113
00114 conservation = Drv_Exchanges(il_exchange_id)%conservation &
00115 .ne. PSMILe_undef
00116
00117
00118
00119
00120 Drv_Exchanges(il_exchange_id)%trans_in_status = &
00121 Drv_Exchanges(il_exchange_id)%trans_in_status-1
00122
00123
00124 IF (Drv_Exchanges(il_exchange_id)%trans_in_status .EQ. -1) THEN
00125
00126
00127
00128 Drv_Exchanges(il_exchange_id)%trans_in_request = &
00129 id_process_global_rank
00130
00131 #ifdef VERBOSE
00132 PRINT *, &
00133 '| | | | The transient_in ', id_transient_in_id, &
00134 'is NOT available ! Post a request '
00135 call psmile_flushstd
00136 #endif
00137
00138
00139 ELSE IF (Drv_Exchanges(il_exchange_id)%trans_in_status .GE. 0) THEN
00140
00141 il_size = Drv_Exchanges(il_exchange_id)%trans_in_field_size*id_nbr_fields
00142
00143 #ifdef VERBOSE
00144 PRINT *, '| | | | Sending transient_in ', id_transient_in_id, &
00145 'to process ', id_process_global_rank, 'size ', &
00146 il_size
00147 call psmile_flushstd
00148 #endif
00149
00150
00151 call MPI_Send(Drv_Exchanges(il_exchange_id)%trans_in_field_int(1), &
00152 il_size, MPI_Integer, &
00153 id_process_global_rank, 0177, comm_drv_trans, id_err)
00154
00155 call prismtrs_dequeue_in_field_int(il_size, il_exchange_id, id_err)
00156
00157 if (conservation) then
00158 #ifdef VERBOSE
00159 PRINT *, '| | | | Sending global_sum ', Drv_Exchanges(il_exchange_id)%global_sum_int, &
00160 conservation
00161 call psmile_flushstd
00162 #endif
00163
00164 call MPI_Send(Drv_Exchanges(il_exchange_id)%global_sum_int(1), &
00165 id_nbr_fields, MPI_Integer, &
00166 id_process_global_rank, CONSERVTAG, comm_drv_trans, id_err)
00167
00168 call prismtrs_dequeue_glob_sum_int(id_nbr_fields, il_exchange_id, id_err)
00169 endif
00170
00171
00172 ELSE
00173
00174 ierrp (1) = Drv_Exchanges(il_exchange_id)%trans_in_status
00175
00176 call psmile_error_common ( PRISM_Error_Parameter, 'prismtrs_target_dble',&
00177 ierrp, 1, __FILE__, __LINE__ )
00178 ENDIF
00179
00180
00181 #ifdef VERBOSE
00182 PRINT *, '| | | Quit PRISMTrs_Target_int'
00183 call psmile_flushstd
00184 #endif
00185
00186 END SUBROUTINE PRISMTrs_Target_int