MESH-Model / MESH-Dev

This repository contains the official MESH development code, which is the basis for the 'tags' listed under the MESH-Releases repository. The same tags are listed under this repository. Legacy branches and utilities have also been ported from the former SVN (Subversion) repository. Future developments must create 'forks' from this repository.
Other
2 stars 3 forks source link

distributed soil texture for vector setups #55

Open mee067 opened 2 months ago

mee067 commented 2 months ago

I scripted part of the processing of soil texture from various datasets in MATLAB. Trying to write MESH_parameters.nc, sand 1, 2, ... are turned to sand_1, sand_2, etc. in the nc file as variable names cannot have spaces (as it seems). I am not sure MESH will recognize them as such. In r2c format, it parses another variable called "ilvl" if available (using space as a delimiter) to properly assign them to the different levels. This does not look to be implemented for netcdf unless I am mistaken.

Can it read the level as a 2nd dim? but in such case, how will it interpret the first field that does not have a level (which used for all layers below the max level given).

The "_" that replaced the space in the variable names in nc format means soil texture parameters for different levels won't be recognized if MESH_parameters.nc was to be used for a gridded setup too.

@dprincz

mee067 commented 2 months ago

summarizing the email communication in response to the above:

for MESH_paramaters.nc, soil texture should be provided with an additional dimension called "nsol" corresponding to the number of levels/layers. This means 3D (lat, lon, level) for gridded setups, and 2D (subbasin, level) for vector setups.

The code expects though, that values are provided for all levels as per "MESH_input_soil_levels.txt" which means it behaves differently than using MESH_parameters.r2c or CLASS.ini. If the number of soil levels is large (as for permafrost applications) this is not very convenient. It also means experimenting with the number of soil levels comes requires recreating the texture parameters for each change.

In MESH_parameters.nc, %Sand, for example, is provided with parameters: sand, sand 1. sand 2, ... sand n. the first field is assigned to all layers then sand 1 overrides it for layer 1, sand 2 overrides it for layer 2; thus sand is used for all layers > n+1.

Similarly if texture is read from CLASS.ini, there is the NRSOILAYEREADFLAG to specify how many layers of data to be provided in CLASS.ini file. If there are more layers, they get assigned the value of the last layer as per NRSOILAYEREADFLAG.

In my opinion, behavior should be consistent weather soil texture data are supplied in CLASS.ini, MESH_parameters.r2c or MESH_parameters.nc. The three formats are not mutually exclusive. Special GRUs (with MID>100) keep their parameter values that were taken from CLASS,ini. One can supply INPUTPARAMSFORMFLAG r2c nc txt so it will read three additional parameter sets from those three files and will do all sorts of overrides.