source: LMDZ6/branches/contrails/libf/phylmd/ecrad/test/i3rc/plot_entrapment.m

Last change on this file was 4773, checked in by idelkadi, 12 months ago
  • Update of Ecrad in LMDZ The same organization of the Ecrad offline version is retained in order to facilitate the updating of Ecrad in LMDZ and the comparison between online and offline results. version 1.6.1 of Ecrad (https://github.com/lguez/ecrad.git)
  • Implementation of the double call of Ecrad in LMDZ


File size: 2.3 KB
Line 
1% This script plots horizontal migration distances predicted by
2% SPARTACUS's "explicit entrapment" option, but it requires (1) the
3% whole code to have been compiled with "make
4% PRINT_ENTRAPMENT_DATA=1", and (2) "make i3rc_print_entrapment" to
5% have been run in this directory. This produces the fort.10[12] files
6% containing the migration distances.
7
8xdata = load('fort.101');
9fdata = load('fort.102');
10in = loadnc('i3rc_mls_cumulus_sza.nc');
11out= loadnc('i3rc_mls_cumulus_mono_entr_out.nc');
12
13z=in.height_hl(1:end-1,1)./1000;
14zh=in.height_hl(:,1)./1000;
15[nlev,ncol] = size(in.cloud_fraction);
16
17x_region_direct  = flip(reshape(xdata(:,3:5),nlev,ncol,3),1);
18x_region_diffuse = flip(reshape(xdata(:,6:8),nlev,ncol,3),1);
19n_scat_region = flip(reshape(xdata(:,9:11),nlev,ncol,3),1);
20
21x_diffuse_scaling = sqrt(2.0 * (n_scat_region+exp(-n_scat_region)-1.0) + 1.0e-16) ./ (n_scat_region+1.0e-8);
22
23tot_region_diffuse = sqrt(2.0).*x_region_diffuse.*x_diffuse_scaling;
24tot_region_direct = sqrt(x_region_direct.^2 + (x_region_diffuse.*x_diffuse_scaling).^2);
25
26flux_region_direct = reshape(fdata(:,3:5),nlev,ncol,3);
27flux_region_dn_diffuse = reshape(fdata(:,6:8),nlev,ncol,3);
28
29flux_direct = squeeze(sum(flux_region_direct,3));
30flux_dn_diffuse = squeeze(sum(flux_region_dn_diffuse,3));
31
32ind = find(flux_region_dn_diffuse(:,1,1) < 1.0e-8);
33flux_region_dn_diffuse(ind,:,1) = NaN;
34
35xdirect = squeeze(sum(flux_region_direct.*tot_region_direct,3) ...
36                  ./sum(flux_region_direct,3));
37xdiffuse = squeeze(sum(flux_region_dn_diffuse.*tot_region_diffuse,3) ...
38                   ./sum(flux_region_dn_diffuse,3));
39
40sza = acosd(in.cos_solar_zenith_angle);
41
42isza = [1 16 31 41];
43isza = [1 23 36];
44
45xmax = 12;
46zmax = 4;
47
48figure(2)
49clf
50for ii = 1:length(isza)
51subplot(2,2,ii)
52%plot(squeeze(x_region_direct(:,isza(ii),:)),z);
53%plot(squeeze(x_region_diffuse(:,isza(ii),:)),z,'--');
54
55plot(xdirect(:,isza(ii))./1000,z,'r')
56hold on
57plot(xdiffuse(:,isza(ii))./1000,z,'b');
58ylim([0 zmax]);
59xlim([0 xmax])
60xlabel('Horizontal distance travelled (km)');
61ylabel('Height (km)');
62title(['(' 'a'-1+ii ') SZA=' num2str(sza(isza(ii))) '\circ'])
63if ii == 1
64   legend('Direct','Diffuse','location','southeast')
65end
66grid on
67end
68
69subplot(2,2,4)
70zz = 0.5.*(zh(1:end-1)+zh(2:end));
71plot(in.cloud_fraction, zz,'k');
72ylim([0 zmax])
73xlabel('Cloud fraction');
74ylabel('Height (km)');
75grid on
Note: See TracBrowser for help on using the repository browser.