PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

Resolving imports from external modules: mapping from container name to module name

Open arporter opened this issue 2 years ago • 1 comments

Currently we default to expecting the Fortran source containing a particular module to have the same name as that module.

This is clearly a bit of a limitation. I guess the way forward would be to allow the user to provide a mapping (in the config file) of module name -> filename for those cases where they're not the same. We'd probably also want to support the case where they're not the same but there is some rule, e.g. filename = mod_name + "_mod".

arporter avatar Sep 29 '22 13:09 arporter

You can use a python format statement for this as well:

filename_for_mod = "{0}_,mod.f90' 

where we then provide the base name in a format statement. We use this already in the config file already:

go_grid_area_t: {0}%%grid%%area_t: array: real,

That avoids the need to eval any kind of expression. we just need to use a format statement.

hiker avatar Sep 30 '22 04:09 hiker