      subroutine uv3dmix_spg (tile)      


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

        call Sub_Loop_uv3dmix_spg(tile, Agrif_tabvars_i(15)%iarray0, Agr
     &if_tabvars(117)%array3, Agrif_tabvars_i(8)%iarray0, Agrif_tabvars_
     &i(7)%iarray0, Agrif_tabvars_i(16)%iarray0)

      end


#include "Sub_Loop_uv3dmix_spg.h"
      subroutine uv3dmix_spg_tile (Istr,Iend,Jstr,Jend,
     &                             UFx,UFe,VFx,VFe,
     &                             UFs,VFs, dnUdx,  dmUde,
     &                             dUdz,    dnVdx,   dmVde,  dVdz,
     &                             dZdx_r,  dZdx_p,  dZde_r, dZde_p)      


      use Agrif_Util
#include "Param_BeforeCall_uv3dmix_spg_tile.h"
      integer(4) :: Istr
      integer(4) :: Iend
      integer(4) :: Jstr
      integer(4) :: Jend
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: UFe
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: UFx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: VFe
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: VFx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: UFs
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: VFs
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dmUde
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dmVde
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dnUdx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dnVdx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dUdz
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dVdz
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dZde_p
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dZde_r
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dZdx_p
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dZdx_r
      

        call Sub_Loop_uv3dmix_spg_tile(Istr,Iend,Jstr,Jend,UFx,UFe,VFx,V
     &Fe,UFs,VFs,dnUdx,dmUde,dUdz,dnVdx,dmVde,dVdz,dZdx_r,dZdx_p,dZde_r,
     &dZde_p, Agrif_tabvars_i(14)%iarray0, Agrif_tabvars_i(4)%iarray0, A
     &grif_tabvars_i(13)%iarray0, Agrif_tabvars_i(2)%iarray0, Agrif_tabv
     &ars(158)%array2, Agrif_tabvars_r(3)%array0, Agrif_tabvars(159)%arr
     &ay2, Agrif_tabvars(95)%array2, Agrif_tabvars(96)%array2, Agrif_tab
     &vars(80)%array2, Agrif_tabvars(92)%array2, Agrif_tabvars(87)%array
     &2, Agrif_tabvars(91)%array2, Agrif_tabvars(88)%array2, Agrif_tabva
     &rs(134)%array2, Agrif_tabvars(102)%array2, Agrif_tabvars(101)%arra
     &y2, Agrif_tabvars(149)%array4, Agrif_tabvars(93)%array2, Agrif_tab
     &vars(85)%array2, Agrif_tabvars(150)%array4, Agrif_tabvars(94)%arra
     &y2, Agrif_tabvars(86)%array2, Agrif_tabvars(135)%array2, Agrif_tab
     &vars(143)%array3, Agrif_tabvars_i(153)%iarray0, Agrif_tabvars_l(13
     &)%larray0, Agrif_tabvars_l(14)%larray0, Agrif_tabvars_l(11)%larray
     &0, Agrif_tabvars_l(12)%larray0, Agrif_tabvars_i(8)%iarray0, Agrif_
     &tabvars_i(7)%iarray0)

      end


#include "Sub_Loop_uv3dmix_spg_tile.h"
      subroutine uv3dmix_spg_child_tile(Istr,Iend,Jstr,Jend,
     &                             UFx,UFe,VFx,VFe,
     &                             UFs,VFs, dnUdx,  dmUde,
     &                             dUdz,    dnVdx,   dmVde,  dVdz,
     &                             dZdx_r,  dZdx_p,  dZde_r, dZde_p)      


      use Agrif_Util
#include "Param_BeforeCall_uv3dmix_spg_child_tile.h"
      integer(4) :: Istr
      integer(4) :: Iend
      integer(4) :: Jstr
      integer(4) :: Jend
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: UFe
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: UFx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: VFe
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2) :: VFx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: UFs
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: VFs
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dmUde
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dmVde
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dnUdx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dnVdx
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dUdz
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dVdz
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dZde_p
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dZde_r
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dZdx_p
      real, dimension(Istr-2:Iend+2,Jstr-2:Jend+2,1:2) :: dZdx_r
      

        call Sub_Loop_uv3dmix_spg_child_tile(Istr,Iend,Jstr,Jend,UFx,UFe
     &,VFx,VFe,UFs,VFs,dnUdx,dmUde,dUdz,dnVdx,dmVde,dVdz,dZdx_r,dZdx_p,d
     &Zde_r,dZde_p, Agrif_tabvars_i(14)%iarray0, Agrif_tabvars_i(4)%iarr
     &ay0, Agrif_tabvars_i(13)%iarray0, Agrif_tabvars_i(2)%iarray0, Agri
     &f_tabvars(158)%array2, Agrif_tabvars_r(3)%array0, Agrif_tabvars(15
     &9)%array2, Agrif_tabvars(95)%array2, Agrif_tabvars(96)%array2, Agr
     &if_tabvars(80)%array2, Agrif_tabvars(92)%array2, Agrif_tabvars(87)
     &%array2, Agrif_tabvars(91)%array2, Agrif_tabvars(88)%array2, Agrif
     &_tabvars(134)%array2, Agrif_tabvars(102)%array2, Agrif_tabvars(101
     &)%array2, Agrif_tabvars(50)%array3, Agrif_tabvars(149)%array4, Agr
     &if_tabvars(93)%array2, Agrif_tabvars(85)%array2, Agrif_tabvars(51)
     &%array3, Agrif_tabvars(150)%array4, Agrif_tabvars(94)%array2, Agri
     &f_tabvars(86)%array2, Agrif_tabvars(135)%array2, Agrif_tabvars(143
     &)%array3, Agrif_tabvars_i(153)%iarray0, Agrif_tabvars_l(13)%larray
     &0, Agrif_tabvars_l(14)%larray0, Agrif_tabvars_l(11)%larray0, Agrif
     &_tabvars_l(12)%larray0, Agrif_tabvars_i(8)%iarray0, Agrif_tabvars_
     &i(7)%iarray0)

      end


#include "Sub_Loop_uv3dmix_spg_child_tile.h"
