275 | | |
276 | | |
| 273 | }}} |
| 274 | * piernik.F90 send_gas_state routine |
| 275 | {{{ |
| 276 | call MPI_Gather(rho_gas, size(rho_gas), MPI_DOUBLE_PRECISION, rho_gas_global, size(rho_gas), MPI_DOUBLE_PRECISION, 0, comm, ierr) |
| 277 | call MPI_Gather(m_gas, size(m_gas), MPI_DOUBLE_PRECISION, m_gas_global, size(m_gas), MPI_DOUBLE_PRECISION, 0, comm, ierr) |
| 278 | |
| 279 | if (master) then |
| 280 | call MUSCLE_Send("rho_gas", rho_gas_global, %REF(size(rho_gas_global)), MUSCLE_DOUBLE) !here we assume that real is always real*8 |
| 281 | call MUSCLE_Send("m_gas", m_gas_global, %REF(size(m_gas_global)), MUSCLE_DOUBLE) !here we assume that real is always real*8 |
| 282 | endif |
| 283 | }}} |
| 284 | * mc.F90 get_gas_state routine |
| 285 | {{{ |
| 286 | if (master) then |
| 287 | call MUSCLE_Receive("rho_gas", rho_gas_global, %REF(size(rho_gas_global)), MUSCLE_DOUBLE) !here we assume that real is always real*8 |
| 288 | call MUSCLE_Receive("m_gas", m_gas_global, %REF(size(m_gas_global)), MUSCLE_DOUBLE) !here we assume that real is always real*8 |
| 289 | endif |
| 290 | call MPI_Scatter(rho_gas_global, size(rho_gas), MPI_DOUBLE_PRECISION, rho_gas, size(rho_gas), MPI_DOUBLE_PRECISION, 0, comm, ierr) |
| 291 | call MPI_Scatter(m_gas_global, size(m_gas), MPI_DOUBLE_PRECISION, m_gas, size(m_gas), MPI_DOUBLE_PRECISION, 0, comm, ierr) |