function oct_plot_nestforcing(child_frc,thefield,thetime,skip)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Test the embedded forcing file.
%
%  Further Information:  
%  http://www.croco-ocean.org
%  
%  This file is part of CROCOTOOLS
%
%  CROCOTOOLS is free software; you can redistribute it and/or modify
%  it under the terms of the GNU General Public License as published
%  by the Free Software Foundation; either version 2 of the License,
%  or (at your option) any later version.
%
%  CROCOTOOLS is distributed in the hope that it will be useful, but
%  WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%  GNU General Public License for more details.
%
%  You should have received a copy of the GNU General Public License
%  along with this program; if not, write to the Free Software
%  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
%  MA  02111-1307  USA
%
%  Copyright (c) 2004-2006 by Pierrick Penven 
%  e-mail:Pierrick.Penven@ird.fr  
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
npts=[0 0 0 0];
i=0;
for time=thetime
  i=i+1;
  
  subplot(2,length(thetime),i)


  ncid = netcdf.open(child_frc, 'NC_NOWRITE');
  parent_frc=ncid.parent_file(:);
  child_grd=ncid.grd_file(:);
  u=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'sustr'));
  v=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'svstr'));
  if thefield(1:3)=='spd'
    fieldc=sqrt((oct_u2rho_2d(u)).^2+(oct_v2rho_2d(v)).^2);
    fieldname='wind speed';
  else
    fieldc=netcdf.getVar(ncid, netcdf.inqVarID(ncid, thefield));
    fieldname=netcdf.getAtt(ncid, netcdf.inqVarID(ncid, thefield), 'long_name');
  end
  result=close(ncid);

  ncid = netcdf.open(child_grd, 'NC_NOWRITE');
  parent_grd=ncid.parent_grid(:);
  refinecoeff=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'refine_coef'));
  lonc=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'lon_rho'));
  latc=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'lat_rho'));
  mask=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'mask_rho'));
  angle=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'angle'));
  result=close(ncid);
  warning off
  mask=mask./mask;
  warning on
  [ured,vred,lonred,latred,maskred]=...
  oct_uv_vec2rho(u,v,lonc,latc,angle,mask,skip*refinecoeff,npts);
  pcolor(lonc,latc,mask.*fieldc)
  shading interp
  axis image
  caxis([min(min(fieldc)) max(max(fieldc))])
  colorbar
  hold on
  quiver(lonred,latred,ured,vred,'k')
  hold off
  axis([min(min(lonc)) max(max(lonc)) min(min(latc)) max(max(latc))])


  subplot(2,length(thetime),i+length(thetime))

  ncid = netcdf.open(parent_frc, 'NC_NOWRITE');
  u=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'sustr'));
  v=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'svstr'));
  if thefield(1:3)=='spd'
    field=sqrt((oct_u2rho_2d(u)).^2+(oct_v2rho_2d(v)).^2);
    fieldname='wind speed';
  else
    field=netcdf.getVar(ncid, netcdf.inqVarID(ncid, thefield));
    fieldname=netcdf.getAtt(ncid, netcdf.inqVarID(ncid, thefield), 'long_name');
  end
  result=close(ncid);
  ncid = netcdf.open(parent_grd, 'NC_NOWRITE');
  lon=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'lon_rho'));
  lat=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'lat_rho'));
  mask=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'mask_rho'));
  angle=netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'angle'));
  result=close(ncid);
  warning off
  mask=mask./mask;
  warning on
  [ured,vred,lonred,latred,maskred]=...
  oct_uv_vec2rho(u,v,lon,lat,angle,mask,skip,npts);
  pcolor(lon,lat,mask.*field)
  shading interp
  axis image
  caxis([min(min(fieldc)) max(max(fieldc))])
  colorbar
  hold on
  quiver(lonred,latred,ured,vred,'k')
  hold off
  axis([min(min(lonc)) max(max(lonc)) min(min(latc)) max(max(latc))])
end


return



