|
341 | 341 |
|
342 | 342 | elif inside_subroutine: |
343 | 343 | subroutine_buffer.append(line) |
344 | | - if line.strip().lower().startswith("end subroutine stdlib_") or line.strip().lower().startswith("end function stdlib_") or line.strip().lower().startswith(r"end subroutine stdlib${ii}$_") or line.strip().lower().startswith(r"end function stdlib${ii}$_"): |
| 344 | + if line.strip().lower().startswith(("end subroutine stdlib_","end function stdlib_",r"end subroutine stdlib${ii}$_",r"end function stdlib${ii}$_")): |
345 | 345 | # End of the current subroutine |
346 | 346 | if filename in ['stdlib_linalg_blas_q.fypp','stdlib_linalg_blas_w.fypp'] : |
347 | 347 | subroutine_buffer.append('\n#:endif\n#:endfor\n') |
|
363 | 363 | file.write(f"module stdlib_blas\n") |
364 | 364 | file.write(" use stdlib_linalg_constants\n") |
365 | 365 | file.write(" use stdlib_linalg_blas_aux\n") |
366 | | - file.write(" implicit none(type,external)\n") |
| 366 | + file.write(" implicit none\n") |
367 | 367 | for group, group_list in blas_groups.items(): |
368 | 368 | for name in group_list: |
369 | 369 | procedures = subroutines[name] |
|
376 | 376 | if '! =====================================================================' in line: |
377 | 377 | wr = False |
378 | 378 | # Switch on again |
379 | | - if line.strip().lower().startswith("end subroutine stdlib_") or line.strip().lower().startswith("end function stdlib_") or line.strip().lower().startswith(r"end subroutine stdlib${ii}$_") or line.strip().lower().startswith(r"end function stdlib${ii}$_"): |
| 379 | + if line.strip().lower().startswith(("end subroutine stdlib_","end function stdlib_",r"end subroutine stdlib${ii}$_",r"end function stdlib${ii}$_")): |
380 | 380 | wr = True |
381 | 381 | if wr: |
382 | | - if not line.strip().startswith("!"): |
| 382 | + if not line.strip().startswith(("!","use")): |
383 | 383 | file.write(line) |
384 | 384 | file.write(f"#:endfor\n") |
385 | 385 | file.write("end interface \n") |
|
393 | 393 | # Write module header |
394 | 394 | file.write("#:include \"common.fypp\" \n") |
395 | 395 | file.write(f"submodule(stdlib_blas) stdlib_blas_{group}\n") |
396 | | - file.write(" implicit none(type,external)\n") |
| 396 | + file.write(" implicit none\n") |
397 | 397 | file.write("\n\n") |
398 | 398 | file.write(" contains\n") |
399 | 399 | file.write("#:for ik,it,ii in LINALG_INT_KINDS_TYPES\n") |
|
462 | 462 | subroutine_buffer.append(" use stdlib_blas_constants_${ck}$"+aaa+"\n") |
463 | 463 |
|
464 | 464 | subroutine_buffer.append(line) |
465 | | - if line.strip().lower().startswith("end subroutine stdlib_") or line.strip().lower().startswith("end function stdlib_") or line.strip().lower().startswith(r"end subroutine stdlib${ii}$_") or line.strip().lower().startswith(r"end function stdlib${ii}$_"): |
| 465 | + if line.strip().lower().startswith(("end subroutine stdlib_","end function stdlib_",r"end subroutine stdlib${ii}$_",r"end function stdlib${ii}$_")): |
466 | 466 | # End of the current subroutine |
467 | 467 | if filename in ['stdlib_linalg_lapack_q.fypp','stdlib_linalg_lapack_w.fypp'] : |
468 | 468 | subroutine_buffer.append('\n#:endif\n#:endfor\n') |
|
488 | 488 | if dependencies: |
489 | 489 | for depen in dependencies: |
490 | 490 | file.write(f" use stdlib_lapack_{depen}\n") |
491 | | - file.write(" implicit none(type,external)\n") |
| 491 | + file.write(" implicit none\n") |
492 | 492 | for mbr in members: |
493 | 493 | for name in lapack_groups[mbr]: |
494 | 494 | procedures = subroutines[name] |
|
501 | 501 | if '! ==============' in line: |
502 | 502 | wr = False |
503 | 503 | # Switch on again |
504 | | - if line.strip().lower().startswith("end subroutine stdlib_") or line.strip().lower().startswith("end function stdlib_") or line.strip().lower().startswith(r"end subroutine stdlib${ii}$_") or line.strip().lower().startswith(r"end function stdlib${ii}$_"): |
| 504 | + if line.strip().lower().startswith(("end subroutine stdlib_","end function stdlib_",r"end subroutine stdlib${ii}$_",r"end function stdlib${ii}$_")): |
505 | 505 | wr = True |
506 | 506 | if wr: |
507 | | - if not line.strip().startswith("!"): |
| 507 | + if not line.strip().startswith(("!","use")): |
508 | 508 | file.write(line) |
509 | 509 | file.write(f"#:endfor\n") |
510 | 510 | file.write("end interface \n") |
|
519 | 519 | # Write module header |
520 | 520 | file.write("#:include \"common.fypp\" \n") |
521 | 521 | file.write(f"submodule(stdlib_lapack_{subgroup_name}) stdlib_lapack_{group}\n") |
522 | | - file.write(" implicit none(type,external)\n") |
| 522 | + file.write(" implicit none\n") |
523 | 523 | file.write("\n\n") |
524 | 524 | file.write(" contains\n") |
525 | 525 | file.write("#:for ik,it,ii in LINALG_INT_KINDS_TYPES\n") |
|
0 commit comments