anchor.diff: -c> \file
  -c> \defgroup Averaging Average fine grids to a coarse grid
  -c> Average cells from coarse grid to fine grid.
  -c>
  -c> Routines described here average are used to fill coarse grid ghost
  -c> cells, and average sibling grids onto a parent grid.  Indices
  -c> for cells at block boundaries are transformed using encodings
  -c> stored in `transform_cptr`.
  -c>
  -c> \param [in] mx,my       Number of cells in x,y direction
  -c> \param [in] mbc      Number of ghost cells
  -c> \param [in] meqn     Number of equations
  -c> \param [in] qcoarse,qfine  Solution on coarse,fine grid
  -c> \param [in] areacoarse,areafine  Area of mesh cells on coarse,fine grids.
  -c> \param [in] idir     Face orientation - 0 for x-faces; 1 for y-faces [0-1]
  -c> \param [in] iface    Face number of fine grid [0-3].
  -c> \param [in] iface_coarse Face number of coarse grid [0-3].
  -c> \param [in] num_neighbors Number of fine grid neighbors [2].
  -c> \param [in] refratio  Refinement ratio between coarse and fine grids [2].
  -c> \param [in] manifold  Flag indicating whether we are on mapped grid [0-1].
  -c> \param [in] transform_cptr  Encoding for indices at block boundaries (C only).
  -
  -c> \ingroup Averaging
  -c> Average fine ghost cell values.
  -c>
  -c> Average fine grid interior values to neighboring ghost cell values of
  -c> the coarse grid.
  +c     > \file
  +c     > \defgroup Averaging Average fine grids to a coarse grid
  +c     > Average cells from coarse grid to fine grid.
  +c     >
  +c     > Routines described here average are used to fill coarse grid ghost
  +c     > cells, and average sibling grids onto a parent grid.  Indices
  +c     > for cells at block boundaries are transformed using encodings
  +c     > stored in `transform_cptr`.
  +c     >
  +c     > \param [in] mx,my       Number of cells in x,y direction
  +c     > \param [in] mbc      Number of ghost cells
  +c     > \param [in] meqn     Number of equations
  +c     > \param [in] qcoarse,qfine  Solution on coarse,fine grid
  +c     > \param [in] areacoarse,areafine  Area of mesh cells on coarse,fine
  +c     grids.
  +c     > \param [in] idir     Face orientation - 0 for x-faces; 1 for y-faces
  +c     [0-1]
  +c     > \param [in] iface    Face number of fine grid [0-3].
  +c     > \param [in] iface_coarse Face number of coarse grid [0-3].
  +c     > \param [in] num_neighbors Number of fine grid neighbors [2].
  +c     > \param [in] refratio  Refinement ratio between coarse and fine grids
  +c     [2].
  +c     > \param [in] manifold  Flag indicating whether we are on mapped grid [0
  +c     -1].
  +c     > \param [in] transform_cptr  Encoding for indices at block boundaries
  +c     (C only).
  +
  +c     > \ingroup Averaging
  +c     > Average fine ghost cell values.
  +c     >
  +c     > Average fine grid interior values to neighboring ghost cell values of
  +c     > the coarse grid.
         subroutine fc2d_geoclaw_fort_average_face(mx,my,mbc,meqn,
        &      qcoarse,qfine,areacoarse, areafine,
        &      idir,iface_coarse,num_neighbors,refratio,igrid,
        &      manifold, transform_cptr)
  -      use geoclaw_module, only: dry_tolerance  
  +      use geoclaw_module, only: dry_tolerance
   
         implicit none
   
  
positive.code: 
  c     # Average fine grid onto coarse grid
        if (idir .eq. 0) then
              do jc = 1,my
                 do ibc = 1,mbc
  c                 # ibc = 1 corresponds to first layer of ghost cells, and
  c                 # ibc = 2 corresponds to the second layer
  
                    if (iface_coarse .eq. 0) then
                       ic = 1-ibc
                    elseif (iface_coarse .eq. 1) then
                       ic = mx+ibc
                    endif
  
                    call fclaw2d_transform_face_half(ic,jc,i2,j2,
       &                  transform_cptr)
  c                 # ---------------------------------------------
  c                 # Two 'half-size' neighbors will be passed into
  c                 # this routine.  Only half of the coarse grid ghost
  c                 # indices will be valid for the particular grid
  c                 # passed in.  We skip those ghost cells that will
  c                 # have to be filled in by the other half-size
  c                 # grid.
  c                 # ---------------------------------------------
                    skip_this_grid = .false.
                    do m = 0,r2-1
                       if (.not. is_valid_average(i2(m),j2(m),mx,my))
       &                     then
                          skip_this_grid = .true.
                          exit
                       endif
                    enddo
  
                    if (.not. skip_this_grid) then
                       if (is_manifold) then
                          do mq = 1,meqn
                             sum = 0
                             af_sum = 0
                             do m = 0,r2-1
                                qf = qfine(mq,i2(m),j2(m))
                                qv(m) = qf
                                kf = areafine(i2(m),j2(m))
                                sum = sum + qf*kf
                                af_sum = af_sum + kf
                             enddo
  c                       # ----------------------------------------
  c                       # At block seams, the coarse grid mesh cell
  c                       # areas may not have been computed using
  
negative.code:       double precision hc, huc, hvc
        double precision hf, huf, hvf, bf, etaf
        double precision capac, capa
        integer nwet
  
        integer mbathy,mcapa
  
        mbathy = 1
        mcapa = 0
  
        is_manifold = manifold .eq. 1
  
  