libsim  Versione6.3.0

◆ 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 1182 del file char_utilities.F90.

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))
1252 this%spin = mod(this%spin+1, 4)
1253 line = ''
1254 
1255 vint = nint((this%curr-this%min)/(this%max-this%min)*100.d0)
1256 WRITE(line,this%form)vint, &
1257  progress_line_spin(this%spin+1:this%spin+1)
1258 vint = vint/10
1259 
1260 DO i = 1, vint
1261  line(this%barloc+i:this%barloc+i) = this%done
1262 ENDDO
1263 DO i = vint+1, 10
1264  line(this%barloc+i:this%barloc+i) = this%todo
1265 ENDDO
1266 CALL print_status_line(line)
Index method.

Generated with Doxygen.