Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Legacy mapping of Namelist to Named Common

Carl_S_3
Beginner
552 Views

What is the best way to map a named common to a namelist defintion when they have the same names.

For example

common /StoredData/ a,b,x
and
namelist /Datain/ a,b,x

The intent is to share data amongst source via the named common, and just load/save via namelist. Now the legacy system had it own namelist cludge so there was no name collision. But now that I am switch to "standard namelist" I have colisions.


My thoughts are leaning to a F90 module using a user defined data type, but that involves a fair amount of data copying, and seems quite inefficient.


Any thoughts?
Regards

 Carl

0 Kudos
5 Replies
Steven_L_Intel1
Employee
552 Views

I don't understand the question. What sort of name collision do you see here?  There's nothing wrong with having the same variable names in a common and a namelist. Could you perhaps post a short example that demonstrates the problem you are seeing?

0 Kudos
Carl_S_3
Beginner
552 Views

Well  you are sending me back to the wood shed for further study.

I did not think it was permissable to have the same "variable" names in both a named common and a namelist structure in the same source module.

0 Kudos
Carl_S_3
Beginner
552 Views

Well  you are sending me back to the wood shed for further study.

I did not think it was permissable to have the same "variable" names in both a named common and a namelist structure in the same source module.

0 Kudos
Carl_S_3
Beginner
552 Views

Yup I am official mistaken .... sorry for the bother

0 Kudos
Steven_L_Intel1
Employee
552 Views

To elaborate, COMMON and NAMELIST are two very different types of collections. COMMON establishes a storage association among a set of variables. NAMELIST establishes a group name for variables you can then use in I/O statements - there is very little restriction on what kind of variable can be in a NAMELIST - the main restrictions are that it can't be USE associated and can't be an assumed-size array.

0 Kudos
Reply