%N nxnycg %F $MIR/src/subs/cgsubs.for
%D Work out number of sub-plots per page
%P nebk
%: plotting
%B
      subroutine nxnycg (nxdef, nydef, nz, nx, ny, nlast)

      integer nxdef, nydef, nx, ny, nz, nlast
  ---------------------------------------------------------------------
  Work out number of plots in the x and y directions and the
  total number of plots

  Inputs
    nx,ydef   Default x and y numbers of sub-plots per page
    nz        Total number of sub-plots
  Outputs
    nx,ny     Number of sub-plots in x and y directions per page
    nlast     Number of sub-plots on the last row of the last page
