Page 1 of 1

fortran routine for v8

Posted: Mon Jun 16, 2025 4:41 pm
by daniele
Hello,
I wrote a large code inside cs_user_boundary_conditions_ale.f90 to impose some desired mesh displacement, in the version 7 of CS.
I would like to move to v8, but the cs_user_boundary_conditions_ale.f90 does not exist anymore. Is there a workaround to make it work on v8, to avoid writing one in C from zero?
Thank you very much in advance for your help.
Best regards,
Daniele

Re: fortran routine for v8

Posted: Tue Jun 17, 2025 12:27 pm
by Yvan Fournier
Hello,

You can use iso_c_bindings to provide a C API to your Fotran code, and call that from the standard C user function.

If your Fortran code does not depend on too many internal code_saturne structures, or those can be passed as arguments, this should even continue to wrk after v9.0. If you use many code_saturne Fortran modules in your code, it will be limited to versions 8.0 and 9.0 (so still be OK for a few years).

Best regards,

Yvan