libsim Versione 7.2.6
|
◆ wash_char()
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.
Definizione alla linea 1156 del file char_utilities.F90. 1157 literal(ll:ll) = pattern(p:p)
1158 case default
1159 ll = ll + 1
1160 literal(ll:ll) = pattern(p:p)
1161 end select
1162
1163 p = p + 1
1164 enddo
1165
1166 !
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
1219end function string_match
1220
1221
1222SUBROUTINE print_status_line(line)
1223CHARACTER(len=*),INTENT(in) :: line
1224CHARACTER(len=1),PARAMETER :: cr=CHAR(13)
1225WRITE(stdout_unit,'(2A)',advance='no')cr,trim(line)
1226FLUSH(unit=6) ! probably useless with gfortran, required with Intel fortran
1227END SUBROUTINE print_status_line
1228
1229SUBROUTINE done_status_line()
1230WRITE(stdout_unit,'()')
1231END SUBROUTINE done_status_line
1232
1233
1234!> Update a progress line with a new value.
1235!! This subroutine updates the progress line object with a new double
1236!! precision value \a val. Values outside the range \a this%min, \a
1237!! this%max are truncated. If \a val is equal or greter maximum the
1238!! progress bar is closed so that a new line can be printed. When a
1239!! progress_line object reaches its maximum it can no more be updated
1240!! and/or closed. Use the interface method \a update rather than this
1241!! subroutine directly.
|