CHLNDDEV / OceanMesh2D

A two-dimensional triangular mesh generator with pre- and post-processing utilities written in pure MATLAB (no toolboxes required) designed specifically to build models that solve shallow-water equations or wave equations in a coastal environment (ADCIRC, FVCOM, WaveWatch3, SWAN, SCHISM, Telemac, etc.).
https://github.com/sponsors/krober10nd
GNU General Public License v3.0
179 stars 65 forks source link

Expanding Manning's landcover option (CCAP and NLCD) #221

Closed WPringle closed 3 years ago

WPringle commented 3 years ago

Fixed

krober10nd commented 3 years ago

Talking with @zcobell over the months regarding this land cover business issue, it’s often better to use a grid scale averaging approach and my experience corroborates this as well. So perhaps we could look into enabling that capability here? I generally need to smooth out these small scale features from both the dem and the landcover fields in order to get good overland flooding.

WPringle commented 3 years ago

Yeah it would be easy to implement gridscale averaging since it calls the "interp" function already. We can just change method from nearest to CA. So if just add a varargin to this for the interp method type?

WPringle commented 3 years ago

Actually it won't be that easy since it is using the mapping from the integer land type classes. If we somehow convert the land class to Mannings first then it will be easy.

krober10nd commented 3 years ago

Yes perhaps convert to Manning’s and then treat it as raster DEM

krober10nd commented 3 years ago

Could make the LUTs a kwarg in GridData and then if the LUT is passed it’s used to convert the Integer to a continuous field.

krober10nd commented 3 years ago

LUTs may be generally useful to apply for example you could create your nodal attributes based on bathymetry

krober10nd commented 3 years ago

My other comment is to estimate the size of the data we are going to read in when interpolating and do a loop to prevent the user from exceeding RAM. This could just use the existing K index feature. I’ll have time to work on this today

krober10nd commented 3 years ago

Okay check out this...with NLCD landcover database on a subset of a mesh.

m2 = Calc_Mannings_Landcover(m,'nlcd_data.nc','nlcd','K',find(in));
plot(m2,'type','man','proj','lamb','subdomain',[  -73.8849  -73.6721 ;  40.5410   40.7288]);

produces this

default

And you can now use all the msh.interp options so here I enlarge the cell-averaging stencil by a factor of 10x.

m2 = Calc_Mannings_Landcover(m,'nlcd_data.nc','nlcd','K',find(in),'N',10);
plot(m2,'type','man','proj','lamb','subdomain',[  -73.8849  -73.6721 ;  40.5410   40.7288]);

CAx10

What I find is that typically the NLCD rasters come on what we've termed "irregular" structured grids and the way FindLinearIdx works, it hogs up large amounts of RAM. We should probably both find a way to use less memory in FindLinearIdx and/or address the problem with what I proposed in #223 by creating a generic decomposition function for structured grids.

krober10nd commented 3 years ago

Okay looks good. Now we need to run all examples and tests.

krober10nd commented 1 year ago

@WPringle do you recall where we obtained the Mannings n lookup table from landcover categories?

WPringle commented 1 year ago

Did we just get it from: Bunya, S., et al (2010). A High-Resolution Coupled Riverine Flow, Tide, Wind, Wind Wave, and Storm Surge Model for Southern Louisiana and Mississippi. Part I: Model Development and Validation. Monthly Weather Review, 138(2), 345–377. https://doi.org/10.1175/2009MWR2906.1?

WPringle commented 1 year ago

Also maybe from the f13 builder at adcirc.org? f13builderv8.3.zip

zcobell commented 1 year ago

I believe the CCAP was first used in Casey's Gustav paper. We've also used it for the Louisiana Master Plan since 2010 so it's possible you grabbed it from one of those too. I'd start with Casey's paper, though.

krober10nd commented 1 year ago

This seems to ring a bell. https://www.xmswiki.com/wiki/Landuse_Raster_to_Mannings_N_Tool