00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_error_common ( ierror, char_string, ierrp, nerrp, &
00012 file, line )
00013
00014
00015
00016 use psmile_common, dummy_interface => psmile_error_common
00017
00018 implicit none
00019
00020 #include "prism.inc"
00021
00022
00023
00024
00025 integer, Intent (In) :: ierror
00026
00027
00028
00029 character(len=*), Intent(In) :: char_string
00030
00031
00032
00033 integer, Intent (In) :: nerrp
00034
00035
00036
00037 integer, Intent (In) :: ierrp (nerrp)
00038
00039
00040
00041 character(len=*), Intent(In) :: file
00042
00043
00044
00045 integer, Intent (In) :: line
00046
00047
00048
00049
00050
00051 integer :: ierr, lenstr
00052 integer :: char_len
00053 character(len=MPI_MAX_ERROR_STRING) :: error_string
00054 logical :: abort
00055
00056 character(len=16) :: ch_rank
00057 integer :: ipos
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 Character(len=len_cvs_string), save :: mycvs =
00110 '$Id: psmile_error_common.F90 2706 2010-11-04 15:33:32Z hanke $'
00111
00112
00113
00114
00115
00116 call psmile_flushstd
00117
00118 abort = .true.
00119
00120
00121
00122 ipos = 0
00123 lenstr = len_trim (char_string)
00124 call psmile_int2char ( Appl%rank, ch_rank, ipos)
00125
00126 write (*, 9990) ch_rank(1:ipos), trim(Appl%name), file, line
00127
00128
00129
00130 if ( PRISM_Error_MPI <= ierror .and. ierror <= 10 ) then
00131 call MPI_Error_string ( ierrp(1), error_string, char_len, ierr)
00132 write (*, 1010) char_string(1:lenstr), error_string(1:char_len)
00133
00134 if (ierror == PRISM_Error_Send) then
00135 write (*, 1020) ierrp (2), ierrp (3)
00136 else if (ierror == PRISM_Error_Recv) then
00137 write (*, 1030) ierrp (2), ierrp (3)
00138 else if (nerrp > 1) then
00139 write (*, 1090) ierrp (2:nerrp)
00140 endif
00141
00142
00143
00144 else if (ierror == PRISM_Error_Parameter) then
00145
00146 write (*, 1110) char_string(1:lenstr), ierrp (1), ierrp (2)
00147
00148 else if (ierror == PRISM_Error_Alloc) then
00149
00150 write (*, 1130) char_string(1:lenstr), ierrp (2)
00151
00152 else if (ierror == PRISM_Error_Dealloc) then
00153
00154 write (*, 1140) char_string(1:lenstr)
00155
00156 abort = .false.
00157
00158 else if (ierror == PRISM_Error_Arg) then
00159
00160 write (*, 1150) char_string(1:lenstr), ierrp (1)
00161
00162 abort = .true.
00163
00164 else if (ierror == PRISM_Error_Invalid_Arg) then
00165
00166 write (*, 1160) char_string(1:lenstr)
00167
00168 abort = .true.
00169
00170 else if (ierror == PRISM_Error_Arglist) then
00171
00172 write (*, 1190) char_string(1:lenstr), ierrp (:)
00173
00174 abort = .true.
00175
00176 else
00177
00178
00179
00180 write (*, 9980) ierror, char_string(1:lenstr), nerrp
00181 write (*, 9970) ierrp
00182 endif
00183
00184 call psmile_flushstd
00185
00186
00187
00188 if (abort) call PSMILe_Abort
00189
00190
00191
00192
00193
00194
00195
00196 1010 format (1x, 'Error in MPI routine ', a, ': Error message :', a)
00197 1020 format (1x, 'Error occured in Send to process', i4, ' using tag', i5)
00198 1030 format (1x, 'Error occured in Receive from process', i4, ' using tag', i5)
00199 1090 format (1x, 'Error parameters:', (1x, 10(i7, :, ',')))
00200
00201
00202
00203 1110 format (1x, 'Value of parameter ', a, ' is insufficient.', &
00204 /1x, 'Current value:', i5, '; should be ', i6)
00205 1130 format (1x, 'Cannot allocate ', a, &
00206 '. Number of data items to be allocated was', i9)
00207 1140 format (1x, 'Cannot deallocate ', a, '.')
00208 1150 format (1x, 'Argument ', a, ' is out of range.', &
00209 /1x, 'Current value:', i5)
00210 1160 format (1x, 'Argument ', a, ' is invalid.')
00211
00212 1190 format (1x, 'Error in argument list: ', a, (1x, 10(i7, :, ',')))
00213
00214
00215
00216
00217
00218
00219
00220
00221 9970 format (1x, 10i7)
00222 9980 format (1x, 'Unknown error code', i4, '; string ', a, '; nerrp', i3)
00223 9990 format (1x, '[', a, '] PSMILe: Error in component: ', a, &
00224 '; File ', a, ': line', i6 )
00225 end subroutine psmile_error_common