Global Index (short | long) | Local contents | Local Index (short | long)
Read Variables from wgr and cgr runs
This script calls | |
---|---|
clear var1 = 'Z3'; var2 = 'U'; var3 = 'V'; var4 = 'AIRT'; var5 = 'PS' lind = 5:18; for numind = 1:2; if numind == 1; cd /home/disk/hayes2/dvimont/ccm/ccm3.6/run/sun/gr_5093/wgr2/data lab = 'DOM2x' elseif numind == 2; cd /home/disk/hayes2/dvimont/ccm/ccm3.6/run/sun/gr_5093/wgr_som2/data lab = 'SOM2x' end zw = []; uw = []; vw = []; airtw = []; psw = []; for i = 3:13; if i < 10; filin = ['000' num2str(i) '.nc']; else filin = ['00' num2str(i) '.nc']; end disp(filin) [v1, v2, v3, v4, v5] = getnc(filin, lind, ... var1, var2, var3, var4, var5); zw = [zw; v1]; uw = [uw; v2]; vw = [vw; v3]; airtw = [airtw; v4]; psw = [psw; v5]; end if numind == 1; cd /home/disk/hayes2/dvimont/ccm/ccm3.6/run/sun/gr_5093/cgr2/data elseif numind == 2; cd /home/disk/hayes2/dvimont/ccm/ccm3.6/run/sun/gr_5093/cgr_som2/data end zc = []; uc = []; vc = []; airtc = []; psc = []; for i = 3:13; if i < 10; filin = ['000' num2str(i) '.nc']; else filin = ['00' num2str(i) '.nc']; end disp(filin) [v1, v2, v3, v4, v5] = getnc(filin, lind, ... var1, var2, var3, var4, var5); zc = [zc; v1]; uc = [uc; v2]; vc = [vc; v3]; airtc = [airtc; v4]; psc = [psc; v5]; end % Compress variables, so only yearly data is kept for i = 1:10; ind = (i-1)*12 + [1:6]; zw1(i,:,:,:) = mean(zw(ind,:,:,:)); uw1(i,:,:,:) = mean(uw(ind,:,:,:)); vw1(i,:,:,:) = mean(vw(ind,:,:,:)); airtw1(i,:,:,:) = mean(airtw(ind,:,:,:)); psw1(i,:,:) = mean(psw(ind,:,:)); zc1(i,:,:,:) = mean(zc(ind,:,:,:)); uc1(i,:,:,:) = mean(uc(ind,:,:,:)); vc1(i,:,:,:) = mean(vc(ind,:,:,:)); airtc1(i,:,:,:) = mean(airtc(ind,:,:,:)); psc1(i,:,:) = mean(psc(ind,:,:)); end clear zw uw vw airtw psw zc uc vc airtc psc % Get variables for interpolation ind = 5:18; cd /home/disk/hayes2/dvimont/ccm/ccm3.6/data [lat, lon, lev, hyam, hybm, P0] = getll('wgr_SOM_hard.nc'); hyam = hyam(ind); hybm = hybm(ind); get_global; default_global; newlev = [150 250 300 500 850 970]; zw = atlev(zw1, newlev, psw1, hyam, hybm, P0); zc = atlev(zc1, newlev, psc1, hyam, hybm, P0); uw = atlev(uw1, newlev, psw1, hyam, hybm, P0); uc = atlev(uc1, newlev, psc1, hyam, hybm, P0); vw = atlev(vw1, newlev, psw1, hyam, hybm, P0); vc = atlev(vc1, newlev, psc1, hyam, hybm, P0); airtw = atlev(airtw1, newlev, psw1, hyam, hybm, P0); airtc = atlev(airtc1, newlev, psc1, hyam, hybm, P0); cd /home/disk/hayes2/dvimont/ccm/ccm3.6/matlab_data eval(['save ZUVT_interped_gr' lab '.mat zw zc uw uc vw vc airtw airtc lat lon newlev']) end % Do the same for CT clear % Read Variables from wgr and cgr runs var1 = 'Z3'; var2 = 'U'; var3 = 'V'; var4 = 'AIRT'; var5 = 'PS' lind = 5:18; cd /home/disk/hayes2/dvimont/ccm/ccm3.6/run/sun/ct_5093/cycle/data clear z u v airt ps for i = 1:19; if i < 10; filin = ['000' num2str(i) '.nc']; else filin = ['00' num2str(i) '.nc']; end disp(filin) [v1, v2, v3, v4, v5] = getnc(filin, lind, ... var1, var2, var3, var4, var5); z = [z; v1]; u = [u; v2]; v = [v; v3]; airt = [airt; v4]; ps = [ps; v5]; end for i = 1:9; indc = 24*(i-1)+[1:6]; indw = 24*(i-1)+[13:18]; zw(i,:,:,:) = mean(z(indw,:,:,:)); uw(i,:,:,:) = mean(u(indw,:,:,:)); vw(i,:,:,:) = mean(v(indw,:,:,:)); airtw(i,:,:,:) = mean(airt(indw,:,:,:)); psw(i,:,:) = mean(ps(indw,:,:)); zc(i,:,:,:) = mean(z(indc,:,:,:)); uc(i,:,:,:) = mean(u(indc,:,:,:)); vc(i,:,:,:) = mean(v(indc,:,:,:)); airtc(i,:,:,:) = mean(airt(indc,:,:,:)); psc(i,:,:) = mean(ps(indc,:,:)); end clear z u v airt ps v1 v2 v3 v4 v5 % Get variables for interpolation ind = 5:18; cd /home/disk/hayes2/dvimont/ccm/ccm3.6/data [lat, lon, lev, hyam, hybm, P0] = getll('wgr_SOM_hard.nc'); hyam = hyam(ind); hybm = hybm(ind); get_global; default_global; newlev = [150 250 300 500 850 970]; zw = atlev(zw, newlev, psw, hyam, hybm, P0); zc = atlev(zc, newlev, psc, hyam, hybm, P0); uw = atlev(uw, newlev, psw, hyam, hybm, P0); uc = atlev(uc, newlev, psc, hyam, hybm, P0); vw = atlev(vw, newlev, psw, hyam, hybm, P0); vc = atlev(vc, newlev, psc, hyam, hybm, P0); airtw = atlev(airtw, newlev, psw, hyam, hybm, P0); airtc = atlev(airtc, newlev, psc, hyam, hybm, P0); cd /home/disk/hayes2/dvimont/ccm/ccm3.6/matlab_data save ZUVT_interped_ctdom.mat zw zc uw uc vw vc airtw airtc lat lon newlev % Plot data clear cd /home/disk/hayes2/dvimont/ccm/ccm3.6/matlab_data load ZUVT_interped_grDOM2x.mat zwgd = zw; zcgd = zc; uwgd = uw; ucgd = uc; vwgd = vw; vcgd = vc; twgd = airtw; tcgd = airtc; load ZUVT_interped_grSOM2x.mat zwgs = zw; zcgs = zc; uwgs = uw; ucgs = uc; vwgs = vw; vcgs = vc; twgs = airtw; tcgs = airtc; load ZUVT_interped_ctdom.mat zwcd = zw; zccd = zc; uwcd = uw; uccd = uc; vwcd = vw; vccd = vc; twcd = airtw; tccd = airtc; load ZUVT_interped_ctsom.mat zwcs = zw; zccs = zc; uwcs = uw; uccs = uc; vwcs = vw; vccs = vc; twcs = airtw; tccs = airtc; clear zw zc uw uc vw vc airtw airtc get_global; default_global; [ntim, nlev, nlat, nlon] = size(zwgd); lab = 'HEIGHT'; lab2 = 'z'; lev = find(newlev == 500); cint = 10; clev = [-120:cint:120]; FRAME = [0 360 0 90]; origin = [90 270]; mstyle = 'stereo'; lab = 'UZON'; lab2 = 'u'; lev = find(newlev == 970); cint = 0.5; clev = [-8:cint:8]; FRAME = [0 360 0 90]; origin = [90 270]; mstyle = 'stereo'; FRAME = [-180 180 -50 50]; origin = [0 180]; mstyle = 'giso'; lab = 'AIRT'; lab2 = 't'; lev = find(newlev == 970); cint = 0.25; clev = [-9:cint:9]; FRAME = [0 360 -90 90]; origin = [90 270]; mstyle = 'stereo'; figure(1); for i = 1:2; if i == 1; eval(['v1 = squeeze(' lab2 'wgd(:,lev,:,:));']); eval(['v2 = squeeze(' lab2 'cgd(:,lev,:,:));']); tit = 'CT\_DOM'; elseif i == 2; eval(['v1 = squeeze(' lab2 'wgs(:,lev,:,:));']); eval(['v2 = squeeze(' lab2 'cgs(:,lev,:,:));']); tit = 'CT\_SOM'; end [tstat, dof] = ttest(v1, v2); score = tscore(dof, 2.5); top = squeeze(mean(v1 - v2))/2; sp(i) if ismap(gca); clma; end; gcont(top, clev); dc;%, mstyle, origin); % greyshd(abs(tstat), score); % gshade(abs(tstat), score); title(['NDJFMA ' lab ': ' num2str(newlev(lev)) 'mb ' ... tit ', (WARM - COLD)/2']); xlabel(['Contour Interval: ' num2str(cint) ' m s^-^1']); end cd /home/disk/tao/dvimont/matlab/CCM/GR/GR_Plots/DOM_SOM2 % print -dps2 EDDY_EKE_DS__W-C.ps figure(2); figure_orient; i = 2; eval(['v1 = squeeze(' lab2 'wcs(:,lev,:,:) - ' lab2 'ccs(:,lev,:,:));']); eval(['v2 = squeeze(' lab2 'wcd(:,lev,:,:) - ' lab2 'ccd(:,lev,:,:));']); tit = '(CT\_SOM - CT\_DOM)'; [tstat, dof] = ttest(v1, v2); score = tscore(dof, 2.5); top = squeeze(mean(v1 - v2))/2; sp(i) if ismap(gca); clma; end; mcont(top, clev, mstyle, origin); greyshd(abs(tstat), score); title(['NDJFMA ' lab ': ' num2str(newlev(lev)) 'mb ' ... tit ', (WARM - COLD)/2']); xlabel(['Contour Interval: ' num2str(cint) ' m']); cd /home/disk/tao/dvimont/matlab/CCM/GR/GR_Plots/DOM_SOM2 fdir = '/home/disk/hayes2/dvimont/ccm/ccm3.6/data/gr_5093/wgr/data/';