Global Index (short | long) | Local contents | Local Index (short | long)
This script calls | |
---|---|
clear cd /home/disk/tao/data/nmc.reanalysis/monthly filin = 'hgt500.monthly.4897.nc'; nc = netcdf(filin, 'nowrite'); lat = nc{'lat'}(:); lon = nc{'lon'}(:); [xk, yk] = keep_var([121 300 20 88], lon, lat); z500 = nc{'data'}(:,yk,xk); add_offset = nc{'data'}.add_offset(:); scale_factor = nc{'data'}.scale_factor(:); mv = nc{'data'}.missing_value(:); nc = close(nc); lat = lat(yk); lon = lon(xk); z500(z500 == mv) = NaN; z500 = z500 * scale_factor; z500 = z500 + add_offset; [ntim, nlat, nlon] = size(z500); clear z for i = 1:nlat/2; latind = 2*(i-1) + [1 2]; for j = 1:nlon/2; lonind = 2*(j-1) + [1 2]; z(:,i,j) = squeeze(mean(mean(shiftdim(z500(:,latind,lonind), 1)))); end end lat2 = mean([lat(1:2:nlat)'; lat(2:2:nlat)'])'; lon2 = mean([lon(1:2:nlon)'; lon(2:2:nlon)'])'; [ntim, nlat, nlon] = size(z); [z, clim] = annave(z); z = cosweight(z, lat2); z = reshape(z, ntim, nlat*nlon); [lam, lds, pcs, per] = eof_dan(z); ctlim = [120 300 20 90]; default_global; [ntim, nlat, nlon] = size(z500); z500 = reshape(z500, ntim, nlat*nlon); num = 1; tem = pcs(:,num)'*z500/ntim; tem = reshape(tem, nlat, nlon); figure(1); sd(1) gcont(tem, [-100:10:100]); dc sd(2) plot(1:ntim, pcs(:,num)); axis([0 ntim+1 -4 4]) grid on filin = ['uwnd_sfc.monthly.nc']; nc = netcdf(filin, 'nowrite'); lat = nc{'lat'}(:); lon = nc{'lon'}(:); [xk, yk] = keep_var([110 300 -60 90], lon, lat); u = nc{'uwnd'}(:, yk, xk); ao = nc{'uwnd'}.add_offset(:); sf = nc{'uwnd'}.scale_factor(:); nc = close(nc); u = u * sf; u = u + ao; filin = ['vwnd_sfc.monthly.nc']; nc = netcdf(filin, 'nowrite'); v = nc{'vwnd'}(:, yk, xk); ao = nc{'vwnd'}.add_offset(:); sf = nc{'vwnd'}.scale_factor(:); nc = close(nc); v = v * sf; v = v + ao; lat = lat(yk); lon = lon(xk); u = u.*abs(u); v = v.*abs(v); tim = 121:600; [ntim, nlat, nlon] = size(u); u = reshape(u, ntim, nlat*nlon); v = reshape(v, ntim, nlat*nlon); [u, clim] = annave(u); [v, clim] = annave(v); num = 1; utem = pcs(tim,num)' * u / ntim; utem = flipud(reshape(utem, nlat, nlon)); vtem = pcs(tim,num)' * v / ntim; vtem = flipud(reshape(vtem, nlat, nlon)); ctlim = [110 300 -60 90]; default_global; YAX = flipud(YAX); figure(2); figure_landscape; sp2(1) [h, a, c] = gquiv(utem, vtem, 2, 2); dc xlabel(['Max = ' num2str(round(c(2)*100)/100) ' dynes cm^-^1']) utem = pcs(tim,num)' * u / ntim; utem = reshape(utem, nlat, nlon); vtem = pcs(tim,num)' * v / ntim; vtem = reshape(vtem, nlat, nlon); f = (2*7.292e-5)*sin(lat*pi/180); temx = utem ./ (f * ones(1, nlon)); temy = vtem ./ (f * ones(1, nlon)); temcurl = sph_curl(temx, temy, lon, lat); yk2 = keep_var3([-3 3], lat); temcurl(yk2, :) = NaN * ones(length(yk2), nlon); temcurl = flipud(temcurl); sp2(2) gcont(10*temcurl, [-5:5]); dc