libsim  Versione7.2.1

◆ wash_char()

elemental character(len=len(in)) function, public char_utilities::wash_char ( character(len=*), intent(in)  in,
character(len=*), intent(in), optional  goodchar,
character(len=*), intent(in), optional  badchar 
)

Remove the requested characters from a string.

This function returns a string cleaned from unwanted characters, either by removing "bad" characters (argument badchar) or by keeping only "good" characters (argument goodchar). If neither badchar nor goodchar are provided, it keeps only alphabetic ASCII characters.

Parametri
[in]instring to be cleaned
[in]badcharoptional set of "bad" characters
[in]goodcharoptional set of "good" characters

Definizione alla linea 1167 del file char_utilities.F90.

1167  ! Now look for the literal string (if any!)
1168  !
1169  if ( method == 0 ) then
1170  !
1171  ! We are at the end of the pattern, and of the string?
1172  !
1173  if ( strim == 0 .and. ptrim == 0 ) then
1174  match = .true.
1175  else
1176  !
1177  ! The string matches a literal part?
1178  !
1179  if ( ll > 0 ) then
1180  if ( string(start:min(strim,start+ll-1)) == literal(1:ll) ) then
1181  start = start + ll
1182  match = string_match( string(start:), pattern(p:) )
1183  endif
1184  endif
1185  endif
1186  endif
1187 
1188  if ( method == 1 ) then
1189  !
1190  ! Scan the whole of the remaining string ...
1191  !
1192  if ( ll == 0 ) then
1193  match = .true.
1194  else
1195  do while ( start <= strim )
1196  k = index( string(start:), literal(1:ll) )
1197  if ( k > 0 ) then
1198  start = start + k + ll - 1
1199  match = string_match( string(start:), pattern(p:) )
1200  if ( match ) then
1201  exit
1202  endif
1203  endif
1204 
1205  start = start + 1
1206  enddo
1207  endif
1208  endif
1209 
1210  if ( method == 2 .and. ll > 0 ) then
1211  !
1212  ! Scan the whole of the remaining string ...
1213  !
1214  if ( string(start:min(strim,start+ll-1)) == literal(1:ll) ) then
1215  match = string_match( string(start+ll:), pattern(p:) )
1216  endif
1217  endif
1218  return
1219 end function string_match
1220 
1221 
1222 SUBROUTINE print_status_line(line)
1223 CHARACTER(len=*),INTENT(in) :: line
1224 CHARACTER(len=1),PARAMETER :: cr=char(13)
1225 WRITE(stdout_unit,'(2A)',advance='no')cr,trim(line)
1226 FLUSH(unit=6) ! probably useless with gfortran, required with Intel fortran
1227 END SUBROUTINE print_status_line
1228 
1229 SUBROUTINE done_status_line()
1230 WRITE(stdout_unit,'()')
1231 END SUBROUTINE done_status_line
1232 
1233 
1242 SUBROUTINE progress_line_update_d(this, val)
1243 CLASS(progress_line),INTENT(inout) :: this
1244 DOUBLE PRECISION,INTENT(in) :: val
1245 
1246 INTEGER :: vint, i
1247 CHARACTER(len=512) :: line
1248 
1249 IF (this%curr >= this%max) RETURN ! line is already closed, do nothing
1250 
1251 this%curr = max(this%min, min(this%max, val))
Index method.

Generated with Doxygen.