0

I am working on power system modeling using PSS/E and C++. PSS/E (34.2) is used for the system representation. C++ is used for the dynamic simulation. The system parameters have been set in PSS/E. Via functions in C++, these parameters are recquiered for running the dynamic simulation in C++. Then the outputs are saved and re-entered to PSSE/E.

The communication between the two enviroments is performed with Fortran UMI (User Model Interface).

I couldn't find any simple example of such interface. I need a simple case to understand how the two software tools (PSS/E and C++) interact via FORTRAN

Anu idea?

Dino C
  • 307
  • 3
  • 15
  • You can fortran subroutines from C.Whether you need to add an underscore to the name can be determined by arguments at compile. Fortran common blocks can also be tied into as extern structs in static space. Beyond this, it would help if you restricted the question to a compiler toolchain. – Abel Nov 15 '19 at 11:28
  • 1
    Melding fortran and C is a bit nuanced and I've only found one good stackoverflow post regarding it. There are however thorough tutorials available. Best one I've found (somewhat gfortran specific) http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html – Abel Nov 15 '19 at 11:43
  • 1
    This is old-style mixed-language programming. Since Fortran 2003, there is the intrinsic module `iso_c_binding` in Fortran and the `bind(c,name=myCFuncName)` that make C-Fortran interoperation a bliss. I do it every day. Fortran 2018, further enables the interoperation of optional arguments and allocatable objects. Intel and GCC Fortran compilers both support these features already. See Modern Fortran Explained: Incorporating Fortran 2018 by Metcalf et al. – Scientist Nov 15 '19 at 18:15

0 Answers0