liu-jincan / study-fpm Goto Github PK
View Code? Open in Web Editor NEW学习fortran-package-manager(fpm)的过程记录~~
学习fortran-package-manager(fpm)的过程记录~~
1
1
First of all, thank you so much for developing this tool, it is very useful!
Is your feature request related to a problem? Please describe.
I want to create a globalized unstructured grid for WAVEWATCH3 to run, and the code to generate the grid is as follows (using the Example_7 program as a template):
min_el = 20e3; % pdf 3.1, minimum resolution in meters.
bbox = [-180 180;-89 90]; % pdf 2.4, lon min lon max; lat min lat max
max_el = 120e3; % pdf 3.1, maximum resolution in meters.
wl = 30; % pdf 3.4, 30 elements resolve M2 wavelength.
dt = 0; % pdf 4.2, Only reduces res away from coast
grade = 0.35; % pdf 4.1, mesh grade in decimal percent.
R = 3; % pdf 3.3.2, Number of elements to resolve feature.
slp = 10; % pdf 3.5, slope of 10
dem = 'SRTM15+.nc'; %
coastline = {'GSHHS_f_L1','GSHHS_f_L6'};
gdat1 = geodata('shp',coastline,'dem',dem,...
'bbox',bbox,'h0',min_el);
fh1 = edgefx('geodata',gdat1,...
'fs',R,'wl',wl,'max_el',max_el,...
'slp',slp,'dt',dt,'g',grade);
mshopts = meshgen('ef',fh1,'bou',gdat1,'nscreen',10,'plot_on',1,'proj','stereo');
mshopts = mshopts.build;
m = mshopts.grd; % get out the msh object
m = interp(m,gdat1,'nan','fill','mindepth',1);
When I run write(m,'Global','ww3')
, it shows an error in the function writeww3
, this is because the variable opedat
may be empty, so I modified part of the code of writeww3
, (is this a bug?)
if(isempty(opedat))
fprintf(fid,'%d\n', length(EToV(:,1)));
m=0;
else
fprintf(fid,'%d\n', length(EToV(:,1))+opedat.neta);
m=0;
for i=1:opedat.nope
for j=1:opedat.nvdll(i)
m=m+1;
fprintf(fid,['%d %s %d %s %d %s %d %s %d %s %d\n'], m,'',15,'',2,'',0,'',0,'',opedat.nbdv(j,i));
end
end
end
I use the obtained mesh as input grid for WAVEWATCH3, the final output Netcdf file of WAVEWATCH3 shows the mesh is problematic,
This may be due to the fact that the generated grid surrounds the whole Earth. Steven R. Brus
(https://gmd.copernicus.org/articles/14/2917/2021/) also points out the need to modify elements that straddle the −180–+180∘ boundary.
Describe the solution you'd like
Is it possible to remove the grid elements around -180 (or 180)?
Describe alternatives you've considered
stereo
to Robinson
.meshgen.m
, you need to set h0
to very small for global meshes (stereo
does not need to set h0
to very small to get global meshes).% kjr Oct 2018 use outer coarsest box for
% multiscale meshing
lon_mi = obj.bbox{1}(1,1)-obj.h0(1)/1110;
lon_ma = obj.bbox{1}(1,2)+obj.h0(1)/1110;
lat_mi = obj.bbox{1}(2,1)-obj.h0(1)/1110;
lat_ma = obj.bbox{1}(2,2)+obj.h0(1)/1110;
Additional context
This is the first time I submit an issue on github, there may be problems with the format of the question, and I'm looking forward to getting a reply, thanks~~
First of all, thank you so much for developing this tool, it is very useful!
Is your feature request related to a problem? Please describe.
I want to create a globalized unstructured grid for WAVEWATCH3 to run, and the code to generate the grid is as follows (using the Example_7 program as a template):
min_el = 20e3; % pdf 3.1, minimum resolution in meters.
bbox = [-180 180;-89 90]; % pdf 2.4, lon min lon max; lat min lat max
max_el = 120e3; % pdf 3.1, maximum resolution in meters.
wl = 30; % pdf 3.4, 30 elements resolve M2 wavelength.
dt = 0; % pdf 4.2, Only reduces res away from coast
grade = 0.35; % pdf 4.1, mesh grade in decimal percent.
R = 3; % pdf 3.3.2, Number of elements to resolve feature.
slp = 10; % pdf 3.5, slope of 10
dem = 'SRTM15+.nc'; %
coastline = {'GSHHS_f_L1','GSHHS_f_L6'};
gdat1 = geodata('shp',coastline,'dem',dem,...
'bbox',bbox,'h0',min_el);
fh1 = edgefx('geodata',gdat1,...
'fs',R,'wl',wl,'max_el',max_el,...
'slp',slp,'dt',dt,'g',grade);
mshopts = meshgen('ef',fh1,'bou',gdat1,'nscreen',10,'plot_on',1,'proj','stereo');
mshopts = mshopts.build;
m = mshopts.grd; % get out the msh object
m = interp(m,gdat1,'nan','fill','mindepth',1);
When I run write(m,'Global','ww3')
, it shows an error in the function writeww3
, this is because the variable opedat
may be empty, so I modified part of the code of writeww3
, (is this a bug?)
if(isempty(opedat))
fprintf(fid,'%d\n', length(EToV(:,1)));
m=0;
else
fprintf(fid,'%d\n', length(EToV(:,1))+opedat.neta);
m=0;
for i=1:opedat.nope
for j=1:opedat.nvdll(i)
m=m+1;
fprintf(fid,['%d %s %d %s %d %s %d %s %d %s %d\n'], m,'',15,'',2,'',0,'',0,'',opedat.nbdv(j,i));
end
end
end
I use the obtained mesh as input grid for WAVEWATCH3, the final output Netcdf file of WAVEWATCH3 shows the mesh is problematic,
This may be due to the fact that the generated grid surrounds the whole Earth. Steven R. Brus
(https://gmd.copernicus.org/articles/14/2917/2021/) also points out the need to modify elements that straddle the −180–+180∘ boundary.
Describe the solution you'd like
Is it possible to remove the grid elements around -180 (or 180)?
Describe alternatives you've considered
stereo
to Robinson
.meshgen.m
, you need to set h0
to very small for global meshes (stereo
does not need to set h0
to very small to get global meshes).% kjr Oct 2018 use outer coarsest box for
% multiscale meshing
lon_mi = obj.bbox{1}(1,1)-obj.h0(1)/1110;
lon_ma = obj.bbox{1}(1,2)+obj.h0(1)/1110;
lat_mi = obj.bbox{1}(2,1)-obj.h0(1)/1110;
lat_ma = obj.bbox{1}(2,2)+obj.h0(1)/1110;
Additional context
This is the first time I submit an issue on github, there may be problems with the format of the question, and I'm looking forward to getting a reply, thanks~~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.