| 207 | In the original code, before every MC step the rho_gas and m_gas multidimensional arrays were recomputed, in the MUSCLE variant we replace the code with MUSCLE_Receive calls |
| 208 | {{{ |
| 209 | call MUSCLE_Receive("rho_gas", rho_gas, %REF(size(rho_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8 |
| 210 | call MUSCLE_Receive("m_gas", m_gas, %REF(size(m_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8 |
| 211 | }}} |
| 212 | As mentioned before the arrays are multidimensional (4 and 3 dimensional saying more precisely) but taking into consideration fact that both kernels are FORTRAN codes and that FORTRAN multidimensional arrays have continues memory layout we can safely cast it to single dimension. |
| 213 | |
| 214 | Now we need to add corresponding `MUSCLE_Send` calls to the MHD kernel after the gas density and momentum is recomputed: |
| 215 | {{{ |
| 216 | call MUSCLE_Send("rho_gas", rho_gas, %REF(size(rho_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8 |
| 217 | call MUSCLE_Send("m_gas", m_gas, %REF(size(m_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8 |
| 218 | }}} |
| 219 | |