[FLASH-USERS] adding subroutines

Ryan Farber rjfarber at umich.edu
Fri May 7 10:34:47 EDT 2021


Hi Maksim,

Many thanks, Ryan! Can I ask a couple more questions, please? I took one of
> the problem directories that were in the source folder, copied and renamed
> it.
>


> *Then I started to add my own .F90 files to it. But they look different
> from files that were originally in this directory (please see the attached
> screenshot - my files are those that start with eos). Is it important or
> can I just ignore it?*
>

Sorry, I don't think I understand the question (and I looked at the
screenshot). It shouldn't matter what the files are named. So you should be
fine but maybe I'm simply not aware of your concern.

Also I am trying to implement tabulated EoS. It works just fine but I need
> to add my tables in the form of txt files to the object directory after
> setup. Can I somehow put them in the problem directory so that they are
> added to the object directory automatically during setup?
> many thanks!
> Maksim
>
> You could write a short bash script to do this. For example, my *setup_new_run.bash
*does a few things amongst the following~

*cd ${FLASH_PATH}*
*rm -rf ${OBJECT_PATH}*
*./setup ${PROB_NAME} -auto -3d*

*(make -j 4 | tee compile_stdout.txt) 3>&1 1>&2 2>&3 | tee
compile_stderr.log*


*cp ${FLASH_PATH}/$OBJECT_PATH/{flash{4,.par},amr_runtime_parameters}
${RUN_PATH}cp ${SCRIPTS_PATH}/{clean_run_dir,m-00.cie,run_basher.bash}
${RUN_PATH}*

Best,
Ryan


> On Fri, May 7, 2021 at 9:14 AM Ryan Farber <rjfarber at umich.edu> wrote:
>
>> 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/20210507/fc1f99ad/attachment-0001.htm>


More information about the flash-users mailing list