Skip to content
Permalink
bf09a9ac33
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
642 lines (553 sloc) 25 KB
clc %clears command window
%%
fprintf(" 1 to visualise one of the seven models,\n")
fprintf(" 2 to compare model figures,\n")
fprintf(" 3 to compare the ozone layer between 2 different hours of the same model\n")
fprintf(" and\n 0 to exit.\n")
ok=input("input:");
while ok<0 || ok>3
if ok==0
fprintf("over\n")
break
end
clc
fprintf("error!\n")
fprintf(" 1 to visualise one of the seven models,\n")
fprintf(" 2 to compare model figures,\n")
fprintf(" 3 to compare the ozone layer between 2 different hours of the same model\n")
fprintf(" and\n 0 to exit.\n")
ok=input("input:");
end
while ok==1 || ok==2 || ok==3
ncFilelList=["Individual_Models\W_fr-meteofrance,MODEL,SILAM+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",...
"Individual_Models\W_fr-meteofrance,MODEL,MATCH+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",...
"Individual_Models\W_fr-meteofrance,MODEL,ENSEMBLE+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",...
"Individual_Models\W_fr-meteofrance,MODEL,CHIMERE+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",...
"Individual_Models\W_fr-meteofrance,MODEL,EURAD+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",...
"Individual_Models\W_fr-meteofrance,MODEL,MOCAGE+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",...
"Individual_Models\W_fr-meteofrance,MODEL,EMEP+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc"];
meteoModelTitleList=["Meteorologic Model: Silam","Meteorologic Model:Match","Meteorologic Model:Ensemble",...
"Meteorologic Model:Chimere","Meteorologic Model:Eurad","Meteorologic Model:Mokage","Meteorologic Model:Emep"];
if ok==0
fprintf("over\n")
break
end
if ok==1
fprintf("1=Meteorologic Model Silam\n")
fprintf("2=Meteorologic Model Match\n")
fprintf("3=Meteorologic Model Ensemble\n")
fprintf("4=Meteorologic Model Chimere\n")
fprintf("5=Meteorologic Model Eurad\n")
fprintf("6=Meteorologic Model Mocage\n")
fprintf("7=Meteorologic Model Emep\n")
m1=input("file:");
while m1<1 || m1>7
fprintf("error \n")
m1=input("file:");
end
h=input("input an integer between 0 and 26 representing 1 of the 25 hours:");
while h>25 || h<1
fprintf("input again\n")
h=input("input an integer between 0 and 26 representing 1 of the 25 hours:");
end
for i = 1:length(ncFilelList)
if i==m1
pnc1=ncFilelList(i);
t1=meteoModelTitleList(i);
end
end
figure(1)
clf
y = double(ncread(pnc1,'longitude'));
zlabel('ozone')
x = double(ncread(pnc1,'latitude'));
time = ncread(pnc1,'time');
ozone = ncread(pnc1,'unknown');
z = ozone(:,:,h);
title(t1)
mesh(x,y,z)
figure(2)
clf
title(t1)
[x,y] = meshgrid(x, y);
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'magenta')
setm(gca,'ffacecolor','#0072BD')
surfm(x,y,z, 'EdgeColor', 'none','FaceAlpha', 0.6)
figure(3)
clf
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
%bordersm('countries','FaceColor', [0.5 0.7 0.5])
setm(gca,'ffacecolor','#0072BD')
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'magenta')
NumContours = 4;
contourfm(x, y, z, NumContours,'w')
Plots = findobj(gca,'Type','Axes');
Plots.SortMethod = 'depth';
end
if ok==2
fprintf("1=Meteorologic Model Silam\n")
fprintf("2=Meteorologic Model Match\n")
fprintf("3=Meteorologic Model Ensemble\n")
fprintf("4=Meteorologic Model Chimere\n")
fprintf("5=Meteorologic Model Eurad\n")
fprintf("6=Meteorologic Model Mocage\n")
fprintf("7=Meteorologic Model Emep\n")
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:");
while fnum<0 || fnum>3
fprintf("input again\n")
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:");
if fnum==0
fprintf("exit\n")
break
end
end
while fnum>=1 && fnum<=3
if fnum~=0
h=input("input an integer between 0 and 26 representing 1 of the 25 hours:");
end
while h>25 || h<1
fprintf("input again\n")
h=input("input an integer between 0 and 26 representing 1 of the 25 hours:");
end
m1=input("f1:");
while m1<1 || m1>7
fprintf("error \n")
m1=input("f1:");
end
m2=input("f2:");
while m2<1 || m2>7
fprintf("error \n")
m2=input("f2:");
end
for i = 1:length(ncFilelList)
if m1==m2 || m1<1 || m2<1 || m1>7 || m2>7
fprintf("invalid input\n Try again from beginning\n")
break
end
if i==m1
pnc1=ncFilelList(i);
t1=meteoModelTitleList(i);
end
if i==m2
pnc2=ncFilelList(i);
t2=meteoModelTitleList(i);
end
end
if fnum==1
figure(1)
clf
y1 = double(ncread(pnc1,'longitude'));
zlabel('ozone')
x1 = double(ncread(pnc1,'latitude'));
time1 = ncread(pnc1,'time');
ozone1 = ncread(pnc1,'unknown');
z1 = ozone1(:,:,h);
title(t1)
mesh(x1,y1,z1)
figure(2)
clf
y2 = double(ncread(pnc2,'longitude'));
zlabel('ozone')
x2 = double(ncread(pnc2,'latitude'));
time2 = ncread(pnc2,'time');
ozone2 = ncread(pnc2,'unknown');
z2 = ozone2(:,:,h);
title(t2)
mesh(x2,y2,z2)
end
if fnum==2
figure(3)
clf
title(t1)
y1 = double(ncread(pnc1,'longitude'));
zlabel('ozone')
x1 = double(ncread(pnc1,'latitude'));
time1 = ncread(pnc1,'time');
ozone1 = ncread(pnc1,'unknown');
z1 = ozone1(:,:,h);
[x1,y1] = meshgrid(x1, y1);
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'magenta')
setm(gca,'ffacecolor','#0072BD')
surfm(x1,y1,z1, 'EdgeColor', 'none','FaceAlpha', 0.6)
figure(4)
clf
title(t2)
y2 = double(ncread(pnc2,'longitude'));
zlabel('ozone')
x2 = double(ncread(pnc2,'latitude'));
time2 = ncread(pnc2,'time');
ozone2 = ncread(pnc2,'unknown');
z2 = ozone2(:,:,h);
[x2,y2] = meshgrid(x2, y2);
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'm')
setm(gca,'ffacecolor','#0072BD')
surfm(x2,y2,z2, 'EdgeColor', 'none','FaceAlpha', 0.6)
end
if fnum == 3
y1 = double(ncread(pnc1,'longitude'));
zlabel('ozone')
x1 = double(ncread(pnc1,'latitude'));
time1 = ncread(pnc1,'time');
ozone1 = ncread(pnc1,'unknown');
[x1,y1] = meshgrid(x1, y1);
z1 = ozone1(:,:,h);
figure(5)
clf
title(t1)
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
%bordersm('countries','FaceColor', [0.5 0.7 0.5])
setm(gca,'ffacecolor','#0072BD')
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'm')
NumContours1 = 5;
contourfm(x1, y1, z1, NumContours1,'r')
Plots = findobj(gca,'Type','Axes');
Plots.SortMethod = 'depth';
y2 = double(ncread(pnc2,'longitude'));
zlabel('ozone')
x2 = double(ncread(pnc2,'latitude'));
time2 = ncread(pnc2,'time');
ozone2 = ncread(pnc2,'unknown');
z2 = ozone2(:,:,h);
[x2,y2] = meshgrid(x2, y2);
figure(6)
clf
title(t2)
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
%bordersm('countries','FaceColor', [0.5 0.7 0.5])
setm(gca,'ffacecolor','#0072BD')
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'm')
NumContours2 = 5;
contourfm(x2, y2, z2, NumContours2,'r')
Plots = findobj(gca,'Type','Axes');
Plots.SortMethod = 'depth';
end
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:");
while fnum<0 || fnum>3
fprintf("input again\n")
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:");
if fnum==0
fprintf("exit\n")
break
end
end
end
end
if ok==3
clc
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:");
while fnum<0 || fnum>3
fprintf("input again\n")
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:");
if fnum==0
clc
fprintf("exit\n")
break
end
end
while fnum>=1 && fnum<=3
if fnum~=0
h1=input("input an integer between 0 and 26 representing 1 of the 25 hours:");
while h1>25 || h1<1
fprintf("input again\n")
h1=input("input an integer between 0 and 26 representing 1 of the 25 hours:");
end
h2=input("input a second integer between 0 and 26 representing 1 of the 25 hours:");
while h2>25 || h2<1
clc
fprintf("input again\n")
h2=input("input an integer between 0 and 26 representing 1 of the 25 hours:");
end
end
if fnum==1
clc
fprintf("1=Meteorologic Model Silam\n")
fprintf("2=Meteorologic Model Match\n")
fprintf("3=Meteorologic Model Ensemble\n")
fprintf("4=Meteorologic Model Chimere\n")
fprintf("5=Meteorologic Model Eurad\n")
fprintf("6=Meteorologic Model Mocage\n")
fprintf("7=Meteorologic Model Emep\n")
m1=input("File:");
while m1<1 || m1>7
clc
fprintf("error \n")
fprintf("1=Meteorologic Model Silam\n")
fprintf("2=Meteorologic Model Match\n")
fprintf("3=Meteorologic Model Ensemble\n")
fprintf("4=Meteorologic Model Chimere\n")
fprintf("5=Meteorologic Model Eurad\n")
fprintf("6=Meteorologic Model Mocage\n")
fprintf("7=Meteorologic Model Emep\n")
m1=input("File:");
end
for i = 1:length(ncFilelList)
if i==m1
pnc1=ncFilelList(i);
t1=meteoModelTitleList(i);
end
end
y = double(ncread(pnc1,'longitude'));
zlabel('ozone')
x = double(ncread(pnc1,'latitude'));
time = ncread(pnc1,'time');
ozone = ncread(pnc1,'unknown');
z1 = ozone(:,:,h1);
z2 = ozone(:,:,h2);
figure(1)
clf
title(t1)
mesh(x,y,z1)
figure(2)
clf
title(t1)
mesh(x,y,z2)
end
if fnum==2
clc
fprintf("1=Meteorologic Model Silam\n")
fprintf("2=Meteorologic Model Match\n")
fprintf("3=Meteorologic Model Ensemble\n")
fprintf("4=Meteorologic Model Chimere\n")
fprintf("5=Meteorologic Model Eurad\n")
fprintf("6=Meteorologic Model Mocage\n")
fprintf("7=Meteorologic Model Emep\n")
m1=input("File:");
while m1<1 || m1>7
clc
fprintf("error \n")
fprintf("1=Meteorologic Model Silam\n")
fprintf("2=Meteorologic Model Match\n")
fprintf("3=Meteorologic Model Ensemble\n")
fprintf("4=Meteorologic Model Chimere\n")
fprintf("5=Meteorologic Model Eurad\n")
fprintf("6=Meteorologic Model Mocage\n")
fprintf("7=Meteorologic Model Emep\n")
m1=input("File:");
end
for i = 1:length(ncFilelList)
if i==m1
pnc1=ncFilelList(i);
t1=meteoModelTitleList(i);
end
end
y = double(ncread(pnc1,'longitude'));
zlabel('ozone')
x = double(ncread(pnc1,'latitude'));
time = ncread(pnc1,'time');
ozone = ncread(pnc1,'unknown');
z1 = ozone(:,:,h1);
z2 = ozone(:,:,h2);
[x,y] = meshgrid(x, y);
figure(3)
clf
title(t1)
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'green')
setm(gca,'ffacecolor','#0072BD')
surfm(x,y,z1, 'EdgeColor', 'none','FaceAlpha', 0.6)
figure(4)
clf
title(t1)
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'green')
setm(gca,'ffacecolor','#0072BD')
surfm(x,y,z2, 'EdgeColor', 'none','FaceAlpha', 0.6)
end
if fnum==3
clc
fprintf("1=Meteorologic Model Silam\n")
fprintf("2=Meteorologic Model Match\n")
fprintf("3=Meteorologic Model Ensemble\n")
fprintf("4=Meteorologic Model Chimere\n")
fprintf("5=Meteorologic Model Eurad\n")
fprintf("6=Meteorologic Model Mocage\n")
fprintf("7=Meteorologic Model Emep\n")
m1=input("File:");
while m1<1 || m1>7
clc
fprintf("error \n")
fprintf("1=Meteorologic Model Silam\n")
fprintf("2=Meteorologic Model Match\n")
fprintf("3=Meteorologic Model Ensemble\n")
fprintf("4=Meteorologic Model Chimere\n")
fprintf("5=Meteorologic Model Eurad\n")
fprintf("6=Meteorologic Model Mocage\n")
fprintf("7=Meteorologic Model Emep\n")
m1=input("File:");
end
NumContours = 5;
for i = 1:length(ncFilelList)
if i==m1
pnc1=ncFilelList(i);
t1=meteoModelTitleList(i);
end
end
y = double(ncread(pnc1,'longitude'));
zlabel('ozone')
x = double(ncread(pnc1,'latitude'));
time = ncread(pnc1,'time');
ozone = ncread(pnc1,'unknown');
z1 = ozone(:,:,h1);
z2 = ozone(:,:,h2);
[x,y] = meshgrid(x, y);
figure(5)
clf
title(t1)
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
%bordersm('countries','FaceColor', [0.5 0.7 0.5])
setm(gca,'ffacecolor','#0072BD')
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'green')
contourfm(x, y, z1, NumContours,'r')
Plots = findobj(gca,'Type','Axes');
Plots.SortMethod = 'depth';
figure(6)
clf
title(t1)
worldmap('Europe'); % set the part of the earth to show
load coastlines
plotm(coastlat,coastlon)
%bordersm('countries','FaceColor', [0.5 0.7 0.5])
setm(gca,'ffacecolor','#0072BD')
land = shaperead('landareas', 'UseGeoCoords', true);
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan')
rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', 'hexagram', 'Color', 'green')
contourfm(x, y, z2, NumContours,'r')
Plots = findobj(gca,'Type','Axes');
Plots.SortMethod = 'depth';
end
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:");
while fnum<0 || fnum>3
fprintf("input again\n")
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:");
if fnum==0
fprintf("exit\n")
break
end
end
end
end
%%
clc
fprintf(" 1 to visualise one of the seven models,\n")
fprintf(" 2 to compare model figures,\n")
fprintf(" 3 to compare the ozone layer between 2 different hours of the same model\n")
fprintf(" and\n 0 to exit.\n")
ok=input("input:");
while ok<0 || ok>3
if ok==0
fprintf("over\n")
break
end
clc
fprintf("error!\n")
fprintf(" 1 to visualise one of the seven models,\n")
fprintf(" 2 to compare model figures,\n")
fprintf(" 3 to compare the ozone layer between 2 different hours of the same model\n")
fprintf(" and\n 0 to exit.\n")
ok=input("input:");
end
end
%%
% title('Meteorologic Model: Silam')
%pnc='Individual_Models\W_fr-meteofrance,MODEL,SILAM+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc';
% title('Meteorologic Model: Match')
%pnc='Individual_Models\W_fr-meteofrance,MODEL,MATCH+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc';
% title('Meteorologic Model: Ensemble')
% pnc='Individual_Models\W_fr-meteofrance,MODEL,ENSEMBLE+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc';
% title('Meteorologic Model: Chimere')
% pnc='Individual_Models\W_fr-meteofrance,MODEL,CHIMERE+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc';
% title('Meteorologic Model: Eurad')
% pnc='Individual_Models\W_fr-meteofrance,MODEL,EURAD+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc';
% title('Meteorologic Model: Mocage')
% pnc='Individual_Models\W_fr-meteofrance,MODEL,MOCAGE+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc';
% title('Meteorologic Model: Emep')
% pnc='Individual_Models\W_fr-meteofrance,MODEL,EMEP+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc';