57   TYPE(t_region
), 
POINTER :: regions(:)
 
   62   INTEGER :: ipatch, ilev, ir
 
   65   INTEGER :: bctype, iregsrc, n1, n2, n1src, n2src, neqs, neqssrc, &
 
   66              ndc, ndcsrc, ndim, ndimsrc, ncv, errorflag
 
   70   TYPE(t_level
), 
POINTER       :: level
 
   71   TYPE(t_dcelltransf
), 
POINTER :: sendeccell, recveccell
 
   72   TYPE(t_dcelltransf
), 
POINTER :: sndturbeccell, rcvturbeccell
 
   76   global => regions(ireg)%global
 
   79   'TURB_rFLO_RansAllocDataBuffers.F90' )
 
   81   IF (regions(ireg)%turbInput%modelClass /= model_rans) goto 999
 
   85   ncv = regions(ireg)%turbInput%nCv
 
   87   DO ilev=1,regions(ireg)%nGridLevels
 
   88     DO ipatch=1,regions(ireg)%nPatches
 
   90       patch => regions(ireg)%levels(ilev)%patches(ipatch)
 
   93       IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
 
   94           (bctype>=bc_tra_peri   .AND. bctype<=bc_tra_peri  +bc_range) .OR. &
 
   95           (bctype>=bc_rot_peri   .AND. bctype<=bc_rot_peri  +bc_range)) 
THEN 
   96         iregsrc = 
patch%srcRegion
 
   97         IF (regions(iregsrc)%procid /= global%myProcid) 
THEN   
  100           n1src   = abs(
patch%srcL1end-
patch%srcL1beg) + 2
 
  101           n2src   = abs(
patch%srcL2end-
patch%srcL2beg) + 2
 
  104           ndc     = regions(ireg   )%nDumCells
 
  105           ndcsrc  = regions(iregsrc)%nDumCells
 
  106           ndim    = n1*n2*neqs*ndc
 
  107           ndimsrc = n1src*n2src*neqssrc*ndcsrc
 
  108           ALLOCATE( 
patch%turb%sendBuff(ndimsrc),stat=errorflag )
 
  109           ALLOCATE( 
patch%turb%recvBuff(ndim   ),stat=errorflag )
 
  110           global%error = errorflag
 
  111           IF (global%error /= 0) CALL 
errorstop( global,err_allocate,__line__ )
 
  112           patch%turb%nSendBuff = ndimsrc
 
  113           patch%turb%nRecvBuff = ndim
 
  114           global%nRequests        = global%nRequests + 1
 
  115           patch%turb%iRequest  = global%nRequests
 
  117       ELSE IF ((bctype>=bc_regionint  .AND. bctype<=bc_regionint +bc_range) .OR. &
 
  118                (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range)) 
THEN 
  119         CALL 
errorstop( global,err_unknown_bc,__line__ )  
 
  127   IF (global%nProcAlloc > 1) 
THEN     
  129     DO ilev=1,regions(ireg)%nGridLevels
 
  133       level => regions(ireg)%levels(ilev)
 
  135       ALLOCATE( level%sndTurbEcCells(global%nRegions),stat=errorflag )
 
  136       ALLOCATE( level%rcvTurbEcCells(global%nRegions),stat=errorflag )
 
  137       global%error = errorflag
 
  138       IF (global%error /= 0) CALL 
errorstop( global,err_allocate,__line__ )
 
  140       DO ir=1,global%nRegions
 
  141         sendeccell    => regions(ireg)%levels(ilev)%sendEcCells(ir)
 
  142         recveccell    => regions(ireg)%levels(ilev)%recvEcCells(ir)
 
  143         sndturbeccell => regions(ireg)%levels(ilev)%sndTurbEcCells(ir)
 
  144         rcvturbeccell => regions(ireg)%levels(ilev)%rcvTurbEcCells(ir)
 
  145         sndturbeccell%nCells = sendeccell%nCells
 
  146         rcvturbeccell%nCells = recveccell%nCells
 
  148         IF (sndturbeccell%nCells > 0) 
THEN 
  149           global%nRequests       = global%nRequests + 1
 
  150           sndturbeccell%iRequest = global%nRequests
 
  151           ALLOCATE( sndturbeccell%buff(sndturbeccell%nCells*ncv), &
 
  153           global%error = errorflag
 
  154           IF (global%error /= 0) CALL 
errorstop( global,err_allocate,__line__ )
 
  156         IF (rcvturbeccell%nCells > 0) 
THEN 
  157           rcvturbeccell%iRequest = -999999
 
  158           ALLOCATE( rcvturbeccell%buff(rcvturbeccell%nCells*ncv), &
 
  160           global%error = errorflag
 
  161           IF (global%error /= 0) CALL 
errorstop( global,err_allocate,__line__ )
 
subroutine registerfunction(global, funName, fileName)
 
subroutine turb_rflo_ransallocdatabuffers(regions, iReg)
 
subroutine errorstop(global, errorCode, errorLine, addMessage)
 
subroutine deregisterfunction(global)