Commit 39bc593f authored by Pierre Cazenave's avatar Pierre Cazenave

Add the coordinates from the struct instead of saving new variables each time.

parent 2c27456f
......@@ -75,12 +75,6 @@ grid_name = 'wrf_grid';
grid_source = 'wrf grid (structured) surface forcing';
CoordVar = 'lat lon';
fv.xlon = zeros(wrf.south_north, wrf.west_east);
fv.xlat = zeros(wrf.south_north, wrf.west_east);
fv.fmask = zeros(wrf.south_north, wrf.west_east);
[fv.xlon, fv.xlat] = deal(wrf.XLONG, wrf.XLAT);
% -------------------------------------------------------------------------
% Define the netCDF parameters
%--------------------------------------------------------------------------
......@@ -194,6 +188,9 @@ for i = 1:wrf.ntimes
netcdf.putVar(ncid, varid_Times, [0, i-1], [19, 1], cc);
end
netcdf.putVar(ncid, varid_XLONG, [0, 0], size(wrf.XLONG), wrf.XLONG)
netcdf.putVar(ncid, varid_XLAT, [0, 0], size(wrf.XLAT), wrf.XLAT)
netcdf.putVar(ncid, varid_Shortwave, [0, 0, 0], size(wrf.Shortwave), wrf.Shortwave); % shortwave W/m^2
netcdf.putVar(ncid, varid_Net_Heat, [0, 0, 0], size(wrf.Net_Heat), wrf.Net_Heat); % net W/m^2
netcdf.putVar(ncid, varid_U10, [0, 0, 0], size(wrf.U10), wrf.U10); % m/s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment