[FLASH-USERS] adding subroutines

Ryan Farber rjfarber at umich.edu
Fri May 7 00:13:32 EDT 2021


Hi Maksim,

Add your *.F90 file to your problem directory, e.g.,
*~FLASH_NAME/source/Simulation/SimulationMain/AwesomeStuff*

Then, add your *.F90 file to your problem directory's *Makefile*.

For example, I added the following line to mine:

*Cool += Cool_exact_integrate.o compute_tcool.o compute_Lambda.o
compute_index.o*

You'll also need to add an interface. In my case, I added an interface for
the Cool_exact_integrate subroutine in *Cool_interface.F90*

And then make sure to have the appropriate use, ONLY line in files calling
your subroutine. For example, in *Cool.F90* I have

...
*use Cool_interface, ONLY : Cool_exact_integrate*
...
*call Cool_exact_integrate(...)*
==================================================
Hope that helps!

Best,
--------
Ryan


On Thu, May 6, 2021 at 8:37 PM Maksim Kozlov <maksim.kozlov at nu.edu.kz>
wrote:

> Dear FLASH users,
> I would really appreciate it if you help me to resolve the following
> issue. I developed my own fortran subroutine and added corresponding *.F90
> file to the object directory. But the call to this subroutine is not
> recognised: I receive undefined reference error. Do I need to explicitly
> list this new subroutine somewhere?
> Thank you very much!
> Maksim Kozlov
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20210506/5eeeaaa3/attachment.htm>


More information about the flash-users mailing list