source: LMDZ6/trunk/libf/phylmd/ecrad/test/ckdmip/flatten_sza.m @ 5440

Last change on this file since 5440 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: 1.6 KB
Line 
1function out = flatten_sza(in, isza)
2% Flatten the solar-zenith-angle and column dimensions
3
4if nargin < 2
5  isza = 1:length(in.mu0);
6end
7nsza = length(isza);
8
9ncol = size(in.pressure_hl,2);
10nz = size(in.pressure_hl,1);
11
12out.pressure_hl = in.pressure_hl(:,ceil([1:nsza*ncol]./nsza));
13if isfield(out,'temperature_hl')
14  out.temperature_hl = in.temperature_hl(:,ceil([1:nsza*ncol]./nsza));
15end
16out.mu0 = repmat(in.mu0(isza), ncol, 1);
17%out.reference_surface_mole_fraction = in.reference_surface_mole_fraction;
18%out.mole_fraction_fl = in.mole_fraction_fl(:,:,ceil([1:nsza*ncol]./nsza));
19out.flux_up_sw = reshape(in.flux_up_sw(:,isza,:),[nz nsza*ncol]);
20out.flux_dn_sw = reshape(in.flux_dn_sw(:,isza,:),[nz nsza*ncol]);
21out.flux_dn_direct_sw = reshape(in.flux_dn_direct_sw(:,isza,:),[nz nsza*ncol]);
22if isfield(in, 'band_flux_up_sw')
23  nband = size(in.band_flux_up_sw,1);
24  out.band_wavenumber1_sw = in.band_wavenumber1_sw;
25  out.band_wavenumber2_sw = in.band_wavenumber2_sw;
26  out.band_flux_up_sw = reshape(in.band_flux_up_sw(:,:,isza,:),[nband nz nsza*ncol]);
27  out.band_flux_dn_sw = reshape(in.band_flux_dn_sw(:,:,isza,:),[nband nz nsza*ncol]);
28  out.band_flux_dn_direct_sw = reshape(in.band_flux_dn_direct_sw(:,:,isza,:),[nband nz nsza*ncol]);
29end
30if isfield(in, 'spectral_flux_up_sw')
31  nspectral = size(in.spectral_flux_up_sw,1);
32  out.spectral_flux_up_sw = reshape(in.spectral_flux_up_sw(:,:,isza,:),[nspectral nz nsza*ncol]);
33  out.spectral_flux_dn_sw = reshape(in.spectral_flux_dn_sw(:,:,isza,:),[nspectral nz nsza*ncol]);
34  out.spectral_flux_dn_direct_sw = reshape(in.spectral_flux_dn_direct_sw(:,:,isza,:),[nspectral nz nsza*ncol]);
35end
36
37
Note: See TracBrowser for help on using the repository browser.