anchor.diff:      return
     end subroutine time_step
   
  -  subroutine flux_olg(nodes,mesh,z,time)  
  +  subroutine flux_olg(nodes,mesh,z,time,uedges)  
       !----------------------------------------------------------------------------------------------
       !    Calculando o fluxo nas arestas
       !----------------------------------------------------------------------------------------------
       implicit none
       integer(i4),intent(in):: nodes
  -    type(grid_structure),intent(in):: mesh
  +    type(grid_structure),intent(inout):: mesh
       integer,intent(in),optional   :: z
       real(r8),intent(in),optional  :: time
  -
  +    type(scalar_field), intent(inout), optional :: uedges ! Only for moist shallow water model
       integer(i4):: i
       integer(i4):: j
       integer(i4):: k
  
positive.code:           p2=node(i)%edge(n)%xyz2(2,:) 
            do s=1,diml
               !Calculando o produto interno entre o vetor velocidade e o vetor normal unitario a edge 
               dot=dot_product(velocity(node(i)%G(s)%lpg(n,1:3), time),node(i)%G(s)%lvn(n,1:3))
               !Determinando os coeficientes da matriz de rotação para o node i 
               xx=mesh%v(i)%p(1)
               yy=mesh%v(i)%p(2)
  
negative.code:     real (r8):: lat
      real (r8):: utmp
      real (r8):: vtmp
  
      ! Moist shallow water normal velocity
      type(grid_structure), intent(inout), optional :: mesh
      type(scalar_field)  , intent(inout), optional :: uedges
      real (r8):: urecon(1:3)
      real (r8):: u0
      
      ! Advection test cases
      if (.not. moistswm)then
         call cart2sph(p(1), p(2), p(3), lon, lat)
         utmp=u(lon, lat, time)
         vtmp=v(lon, lat, time)
         call convert_vec_sph2cart(utmp, vtmp, p, velocity)
      
      else ! Moist SW test cases
         select case(moistswm_ic)
            case(2)
               u0 = 2._r8*pi*erad/(12._r8*day2sec)
               call cart2sph(p(1), p(2), p(3), lon, lat)
               utmp = u0*cos(lat)
               vtmp = 0._r8
               call convert_vec_sph2cart(utmp, vtmp, p, velocity)
            case default
               print*, 'Highorder error: Invalid velocity vector field.'
               stop
         end select
         ! Reconstruct the vector field at given point
         urecon = vector_reconstruct (p, uedges, mesh, reconadvmtd)
         !print*, maxval(abs(velocity-urecon))/maxval(abs(velocity))
         !stop
         velocity = urecon
      endif
  
      return
    end function velocity
  
  