more efficient submodule filenaming
@@ -181,12 +181,13 @@ class FortranCompiler(Compiler):
def module_name_to_filename(self, module_name: str) -> str:
if '_' in module_name: # submodule
+ s = module_name.lower()
if self.id in ('gcc', 'intel'):
- filename = module_name.lower() + '.smod'
+ filename = s.replace('_', '@') + '.smod'
elif self.id in ('pgi', 'flang'):
- filename = module_name.lower() + '.mod'
+ filename = s.replace('_', '-') + '.mod'
else:
- filename = module_name.lower() + '.mod'
+ filename = s + '.mod'
else: # module
filename = module_name.lower() + '.mod'
