| 1 | == Fortran API == |
| 2 | |
| 3 | The Fortran API resembles most the C API. To limit portability issues, all MUSCLE Fortran commands are implemented in C but can be called directly from Fortran. It assumes that all function parameters are passed as references, which is the default if using a Fortran variable, or can be forced with the {{{%REF}}} primitive. For instance, {{{%REF(100)}}} passes a reference to the integer 100 to C. |
| 4 | The API is as follows: |
| 5 | {{{ |
| 6 | MUSCLE_Init(integer argc, character*(*) argv) |
| 7 | MUSCLE_Finalize() |
| 8 | |
| 9 | MUSCLE_Kernel_Name(character*255 result) |
| 10 | MUSCLE_Get_Property(character*255 name, character*1024 result) |
| 11 | |
| 12 | MUSCLE_Will_Stop(logical result) |
| 13 | |
| 14 | MUSCLE_Receive(character*(*) exit_name, [your_datatype]*65536 result, integer size, muscle_datatype_t type) |
| 15 | MUSCLE_Send(character*(*) entrance_name, [your_datatype]*(*) data, integer size, muscle_datatype_t type) |
| 16 | }}} |
| 17 | |
| 18 | The length of the result from {{{MUSCLE_Kernel_Name}}} and {{{MUSCLE_Get_Property}}} can be found by calling {{{LenCstr}}} |
| 19 | |
| 20 | For compatibility with Fortran |