Changes between Version 22 and Version 23 of Piernik

Show
Ignore:
Timestamp:
03/11/13 00:25:57 (12 years ago)
Author:
mmamonski
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Piernik

    v22 v23  
    206206In 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 
    207207{{{ 
    208    call MUSCLE_Receive("rho_gas", rho_gas, %REF(size(rho_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8 
    209    call MUSCLE_Receive("m_gas", m_gas, %REF(size(m_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8 
     208   call MUSCLE_Receive("rho_gas", rho_gas, size(rho_gas), MUSCLE_DOUBLE) !here we assume that real is always real*8 
     209   call MUSCLE_Receive("m_gas", m_gas, size(m_gas), MUSCLE_DOUBLE) !here we assume that real is always real*8 
    210210}}} 
    211211As 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. 
     
    213213Now we need to add corresponding `MUSCLE_Send` calls to the MHD kernel after the gas density and momentum values are recomputed: 
    214214{{{ 
    215    call MUSCLE_Send("rho_gas", rho_gas, %REF(size(rho_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8 
    216    call MUSCLE_Send("m_gas", m_gas, %REF(size(m_gas)), MUSCLE_DOUBLE) !here we assume that real is always real*8 
     215   call MUSCLE_Send("rho_gas", rho_gas, size(rho_gas), MUSCLE_DOUBLE) !here we assume that real is always real*8 
     216   call MUSCLE_Send("m_gas", m_gas, size(m_gas), MUSCLE_DOUBLE) !here we assume that real is always real*8 
    217217}}} 
    218218 
     
    230230} 
    231231}}} 
     232And the corresponding code: 
     233{{{ 
     234#ifdef MHD_KERNEL 
     235      call time_step(dt) 
     236      call MUSCLE_Send("dt_final", dt, dt_len, MUSCLE_DOUBLE) 
     237#else /*MC_KERNEL*/ 
     238      dt = timestep_mc() 
     239      call MUSCLE_Send("dt_mc", dt, dt_len, MUSCLE_DOUBLE) 
     240      call MUSCLE_Receive("dt_final", dt, dt_len, MUSCLE_DOUBLE) 
     241#endif 
     242}}} 
    232243== MPI enabling == 
    233244