Skip to content

Commit 24b2c52

Browse files
committed
replace implicit none(type, external) by implicit none, avoid "use" in interfaces
1 parent 6337a98 commit 24b2c52

File tree

64 files changed

+73
-3024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+73
-3024
lines changed

legacy/refactor_blaslapack_subm.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341

342342
elif inside_subroutine:
343343
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}$_")):
345345
# End of the current subroutine
346346
if filename in ['stdlib_linalg_blas_q.fypp','stdlib_linalg_blas_w.fypp'] :
347347
subroutine_buffer.append('\n#:endif\n#:endfor\n')
@@ -363,7 +363,7 @@
363363
file.write(f"module stdlib_blas\n")
364364
file.write(" use stdlib_linalg_constants\n")
365365
file.write(" use stdlib_linalg_blas_aux\n")
366-
file.write(" implicit none(type,external)\n")
366+
file.write(" implicit none\n")
367367
for group, group_list in blas_groups.items():
368368
for name in group_list:
369369
procedures = subroutines[name]
@@ -376,10 +376,10 @@
376376
if '! =====================================================================' in line:
377377
wr = False
378378
# 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}$_")):
380380
wr = True
381381
if wr:
382-
if not line.strip().startswith("!"):
382+
if not line.strip().startswith(("!","use")):
383383
file.write(line)
384384
file.write(f"#:endfor\n")
385385
file.write("end interface \n")
@@ -393,7 +393,7 @@
393393
# Write module header
394394
file.write("#:include \"common.fypp\" \n")
395395
file.write(f"submodule(stdlib_blas) stdlib_blas_{group}\n")
396-
file.write(" implicit none(type,external)\n")
396+
file.write(" implicit none\n")
397397
file.write("\n\n")
398398
file.write(" contains\n")
399399
file.write("#:for ik,it,ii in LINALG_INT_KINDS_TYPES\n")
@@ -462,7 +462,7 @@
462462
subroutine_buffer.append(" use stdlib_blas_constants_${ck}$"+aaa+"\n")
463463

464464
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}$_")):
466466
# End of the current subroutine
467467
if filename in ['stdlib_linalg_lapack_q.fypp','stdlib_linalg_lapack_w.fypp'] :
468468
subroutine_buffer.append('\n#:endif\n#:endfor\n')
@@ -488,7 +488,7 @@
488488
if dependencies:
489489
for depen in dependencies:
490490
file.write(f" use stdlib_lapack_{depen}\n")
491-
file.write(" implicit none(type,external)\n")
491+
file.write(" implicit none\n")
492492
for mbr in members:
493493
for name in lapack_groups[mbr]:
494494
procedures = subroutines[name]
@@ -501,10 +501,10 @@
501501
if '! ==============' in line:
502502
wr = False
503503
# 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}$_")):
505505
wr = True
506506
if wr:
507-
if not line.strip().startswith("!"):
507+
if not line.strip().startswith(("!","use")):
508508
file.write(line)
509509
file.write(f"#:endfor\n")
510510
file.write("end interface \n")
@@ -519,7 +519,7 @@
519519
# Write module header
520520
file.write("#:include \"common.fypp\" \n")
521521
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")
523523
file.write("\n\n")
524524
file.write(" contains\n")
525525
file.write("#:for ik,it,ii in LINALG_INT_KINDS_TYPES\n")

0 commit comments

Comments
 (0)