0
votes

I have incorporated several legacy FORTRAN codes into an openmdao model. The legacy codes both read and write namelists. I followed the instructions in the "File Wrapping Tutorial" for namelists. Everything works per documentation except the load_model method for reading a namelist. The documentation says that:

The Namelist object also includes some functions for parsing a namelist file and loading the variable values into a component’s unknowns.

However, the actual source code for load_model references params and not unknowns:

params = self.comp.params

My question is simply which is intended?

As a work-around I am skipping the load_model method and hard coding a 1:1 var to unknown mapping after the parse_file method.

1

1 Answers

0
votes

The purpose of the load_model method is to take a namelist file and load the values into the model, so yeah, it should be params and not unknowns. You don't really need the load_model method for a successful wrap; its purpose is really only for getting legacy models into OpenMDAO (and it is also useful for unit testing a file wrap component.)

There are probably some things we should clean up to improve the docs for namelist and file wrapping.