You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: plot_nesting.m
    path of file: ./repos/tracacode/1911-COAWST/script/mfiles/rutgers/utility
    
    the code of the file until where you have to start completion: function F=plot_nesting(Gnames, Hnames, Vname, Tindex, Level, varargin)

%
% PLOT_NESTING:  Plots requested ROMS variable from nesting NetCDF files
%
% F=plot_nesting(Gnames, Hnames, Vname, Tindex, Level, ...
%                perimeter, iplot, Caxis)
%
% This function plots requested ROMS nesting variable from input
% history NetCDF files. This function is very useful when debugging
% a ROMS application. The plotting is not that fancy but it provides
% enough information for browsing ROMS variables very quickly. The
% location of the minumum is marked with a filled magenta circle
% whereas the maximum is marked with a filled magenta square.
%
% It also draws the coastline if the data is available in the
% grid file or structure.
%
% On Input:

    
function F=plot_nesting(Gnames, Hnames, Vname, Tindex, Level, varargin)

%
% PLOT_NESTING:  Plots requested ROMS variable from nesting NetCDF files
%
% F=plot_nesting(Gnames, Hnames, Vname, Tindex, Level, ...
%                perimeter, iplot, Caxis)
%
% This function plots requested ROMS nesting variable from input
% history NetCDF files. This function is very useful when debugging
% a ROMS application. The plotting is not that fancy but it provides
% enough information for browsing ROMS variables very quickly. The
% location of the minumum is marked with a filled magenta circle
% whereas the maximum is marked with a filled magenta square.
%
% It also draws the coastline if the data is available in the
% grid file or structure.
%
% On Input:
%
%    Gnames        ROMS Grid NetCDF files/URL name (cell array)
%              or, an existing ROMS grid structure (struct array)
%
%    Hnames        ROMS history NetCDF files/URL name (cell array)
%
%    Vname         ROMS NetCDF variable name to plot (string)
%
%    Tindex        Time record index used to process (scalar)
%                    (Use Inf or inf for last record)
%
%    Level         If 3D variable, vertical level to plot (scalar)
%
%                     Level > 0,    terrain-following level
%                     Level < 0,    depth (field interpolation)
%
%    iplot         Plotting function to use (scalar, OPTIONAL)
%
%                     iplot = 0,    use PCOLOR
%                     iplot = 1,    use modified PCOLORJW (default)
%
%    perimeter     Switch to draw nested grids domain perimeter.
%                    (OPTIONAL, default = false)
%
%    Caxis         A two element vector [cmin cmax] to set manual
%                    scaling of pseudocolor for plotting objects
%                    (array, OPTIONAL)
%
% On Output:
%
%    F             Requested 2D or 3D plotting field (structure array)
%
%                    F(n).ncname       NetCDF file
%                    F(n).vname        Variable name
%                    F(n).record       Variable time record number
%                    F(n).time         Variable time
%                    F(n).value        Variable values
%                    F(n).min          Minimum plotted variable value
%                    F(n).max          Maximum plotted variable value
%                    F(n).x            Variable x-coordinates
%                    F(n).y            Variable y-coordinates
%                    F(n).hp           figure pcolor handler
%                    F(n).ht           figure title handler
%                    F(n).hc           figure coastlines handler
  
% svn $Id: plot_nesting.m 938 2019-01-28 06:35:10Z arango $
%=========================================================================%
%  Copyright (c) 2002-2019 The ROMS/TOMS Group                            %
%    Licensed under a MIT/X style license                                 %
%    See License_ROMS.txt                           Hernan G. Arango      %
%=========================================================================%

% Initialize.

got.data  = false;
got.coast = false;
got.Mname = false;
got.Xname = false;
got.Yname = false;
got.Zname = false;
got.Caxis = false;

isr3d = false;
isw3d = false;
isvec = false;

iplot = 1;             % use PCOLORJW to locate correctly C-grid variables

perimeter = false;

Tname = [];
Tsize = 0;
recordless = true;

switch numel(varargin)
  case 1
    iplot = varargin{1};
  case 2
    iplot = varargin{1};
    perimeter = varargin{2};
  case 3
    iplot = varargin{1};
    perimeter = varargin{2};
    Caxis = varargin{3};
    got.Caxis = true;
end