      subroutine t3dmix_spg (tile)      


      use Agrif_Util
#include "Param_BeforeCall_t3dmix_spg.h"
      integer(4) :: tile
      

        call Sub_Loop_t3dmix_spg(tile, Agrif_tabvars_i(15)%iarray0, Agri
     &f_tabvars_i(16)%iarray0, Agrif_tabvars(116)%array3, Agrif_tabvars(
     &117)%array3, Agrif_tabvars_i(8)%iarray0, Agrif_tabvars_i(7)%iarray
     &0)

      end


#include "Sub_Loop_t3dmix_spg.h"
      subroutine t3dmix_spg_tile (istr,iend,jstr,jend, itrc, FX,FE
     &                                           ,FC,dTdr,dTdx,dTde,
     &                                              FFC,CF,BC,CD,DC,
     &                                                diff3u,diff3v,
     &                                                          Akz
     &                                                            )      


      use Agrif_Util
#include "Param_BeforeCall_t3dmix_spg_tile.h"
      integer(4) :: istr
      integer(4) :: iend
      integer(4) :: jstr
      integer(4) :: jend
      integer(4) :: itrc
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: FX
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: FE
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,0:N) :: Akz
      real, dimension(Istr-2:Iend+2,0:N) :: CF
      real, dimension(Istr-2:Iend+2,0:N) :: DC
      real, dimension(Istr-2:Iend+2,0:N) :: CD
      real, dimension(Istr-2:Iend+2,0:N) :: BC
      real, dimension(Istr-2:Iend+2,0:N) :: FFC
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: FC
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dTdr
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dTdx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dTde
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: diff3u
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: diff3v
      

        call Sub_Loop_t3dmix_spg_tile(istr,iend,jstr,jend,itrc,FX,FE,FC,
     &dTdr,dTdx,dTde,FFC,CF,BC,CD,DC,diff3u,diff3v,Akz, Agrif_tabvars_i(
     &14)%iarray0, Agrif_tabvars_i(4)%iarray0, Agrif_tabvars_i(13)%iarra
     &y0, Agrif_tabvars_i(2)%iarray0, Agrif_tabvars_r(3)%array0, Agrif_t
     &abvars_i(155)%iarray0, Agrif_tabvars(126)%array3, Agrif_tabvars(98
     &)%array2, Agrif_tabvars(127)%array3, Agrif_tabvars(99)%array2, Agr
     &if_tabvars(143)%array3, Agrif_tabvars(142)%array3, Agrif_tabvars(1
     &25)%array3, Agrif_tabvars(78)%array2, Agrif_tabvars(103)%array2, A
     &grif_tabvars_i(153)%iarray0, Agrif_tabvars(148)%array5, Agrif_tabv
     &ars(79)%array2, Agrif_tabvars(104)%array2, Agrif_tabvars(133)%arra
     &y2, Agrif_tabvars_l(13)%larray0, Agrif_tabvars_l(14)%larray0, Agri
     &f_tabvars_l(11)%larray0, Agrif_tabvars_l(12)%larray0, Agrif_tabvar
     &s_i(8)%iarray0, Agrif_tabvars_i(7)%iarray0)

      end


#include "Sub_Loop_t3dmix_spg_tile.h"
      subroutine t3dmix_spg_child_tile (istr,iend,jstr,jend, itrc, FX,FE
     &                                          ,FC,dTdr, dTdx,dTde,
     &                                              FFC,CF,BC,CD,DC,
     &                                                diff3u,diff3v,
     &                                                          Akz
     &                                                             )      


      use Agrif_Util
#include "Param_BeforeCall_t3dmix_spg_child_tile.h"
      integer(4) :: istr
      integer(4) :: iend
      integer(4) :: jstr
      integer(4) :: jend
      integer(4) :: itrc
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: FX
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: FE
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,0:N) :: Akz
      real, dimension(Istr-2:Iend+2,0:N) :: CF
      real, dimension(Istr-2:Iend+2,0:N) :: DC
      real, dimension(Istr-2:Iend+2,0:N) :: CD
      real, dimension(Istr-2:Iend+2,0:N) :: BC
      real, dimension(Istr-2:Iend+2,0:N) :: FFC
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: FC
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dTdr
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dTdx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dTde
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: diff3u
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: diff3v
      

        call Sub_Loop_t3dmix_spg_child_tile(istr,iend,jstr,jend,itrc,FX,
     &FE,FC,dTdr,dTdx,dTde,FFC,CF,BC,CD,DC,diff3u,diff3v,Akz, Agrif_tabv
     &ars_i(14)%iarray0, Agrif_tabvars_i(4)%iarray0, Agrif_tabvars_i(13)
     &%iarray0, Agrif_tabvars_i(2)%iarray0, Agrif_tabvars_r(3)%array0, A
     &grif_tabvars_i(155)%iarray0, Agrif_tabvars(126)%array3, Agrif_tabv
     &ars(98)%array2, Agrif_tabvars(127)%array3, Agrif_tabvars(99)%array
     &2, Agrif_tabvars(143)%array3, Agrif_tabvars(142)%array3, Agrif_tab
     &vars(125)%array3, Agrif_tabvars(78)%array2, Agrif_tabvars(103)%arr
     &ay2, Agrif_tabvars(49)%array4, Agrif_tabvars_i(153)%iarray0, Agrif
     &_tabvars(148)%array5, Agrif_tabvars(79)%array2, Agrif_tabvars(104)
     &%array2, Agrif_tabvars(133)%array2, Agrif_tabvars_l(13)%larray0, A
     &grif_tabvars_l(14)%larray0, Agrif_tabvars_l(11)%larray0, Agrif_tab
     &vars_l(12)%larray0, Agrif_tabvars_i(8)%iarray0, Agrif_tabvars_i(7)
     &%iarray0)

      end


#include "Sub_Loop_t3dmix_spg_child_tile.h"
