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
1 stars 4 forks source link

Define parameters per subbasin/grid instead of per tile/gru #65

Open MIsmlAhmed opened 2 months ago

MIsmlAhmed commented 2 months ago

I want to define PDMROF parameters (e.g., CMAX and B) per subbasin instead of per tile/gru, which the current default method.

I am aware that this can be done using the MESH_parameters.nc file, but cannot find a template or documentation to create it.

I am using nc drainage file (vector MESH).

fuadyassin commented 2 months ago

Here is a sample file for parameters.nc. You need to use the same order as the drainage database subbasins, and you can create any parameter in the parameter file as a function of subbasin order. The names have to match the recognized parameter names. If you already have a file, like a CSV, that associates the parameters with subbasin COMIDs, you can use the MESH preprocessing NetCDF writer library to write the parameter files. I will need to prepare example based on the file you have. MESH_parameters.zip

MIsmlAhmed commented 2 months ago

Thanks, Fuad! I can create a similar file for my case. I think I need to add the following to the run options file INPUTPARAMSFORMFLAG nc, right?

fuadyassin commented 2 months ago

That is right!

dprincz commented 2 months ago

@MIsmlAhmed Hi Mohamed, Can you confirm what version of code you're using.

MIsmlAhmed commented 2 months ago

I am using 1860

dprincz commented 2 months ago

Thanks Mohamed. It's r1860 and not r1860_ME or r1860_ME_ZT?

MIsmlAhmed commented 2 months ago

I was trying to create the MESH_parameters.nc file through Python with no success as MESH keeps giving me errors related lon and lat precision and units (even though I used them directly from the drainage file).

Anyway, I decided to switch to the regular text format. Here's my MESH_parameters.txt file (I want to define CMAX per subbasin):

! MESH parameter file per subbasin
!FIELD_NAME id Value1 Value2 ... ValueN
CMAX    subbasin  0.337708667   0.384617949 0.375435287 0.23428485  0.372925428 0.54666046  0.320213062 0.329418945 0.339572708 0.296278104 0.337803913 0   0.278200079

However, MESH gives me the following warning:

READING: MESH_parameters.txt
   WARNING: 'CMAX' is not recognized.
   Active parameters in file: 0

This means that it didn't recognize the parameter and the values will not be used in the simulation. That shouldn't happen, given that CMAX is an actual parameter inside MESH. Any idea what's going on?

MIsmlAhmed commented 2 months ago

it's r1860

dprincz commented 2 months ago

I was trying to create the MESH_parameters.nc file through Python with no success as MESH keeps giving me errors related lon and lat precision and units (even though I used them directly from the drainage file).

Anyway, I decided to switch to the regular text format. Here's my MESH_parameters.txt file (I want to define CMAX per subbasin):

! MESH parameter file per subbasin
!FIELD_NAME id Value1 Value2 ... ValueN
CMAX    subbasin  0.337708667 0.384617949 0.375435287 0.23428485  0.372925428 0.54666046  0.320213062 0.329418945 0.339572708 0.296278104 0.337803913 0   0.278200079

However, MESH gives me the following warning:

READING: MESH_parameters.txt
   WARNING: 'CMAX' is not recognized.
   Active parameters in file: 0

This means that it didn't recognize the parameter and the values will not be used in the simulation. That shouldn't happen, given that CMAX is an actual parameter inside MESH. Any idea what's going on?

Yes, the variables have to be exposed to the format. You will observe the same using the NetCDF format file. I've made a development branch and will work with @fuadyassin to address the issue.

MIsmlAhmed commented 2 months ago

Thanks, Dan! I am not sure what do you mean by

Yes, the variables have to be exposed to the format.

Can you please clarify?

Also, is the text file in the right format (to do what needs to be done)?

fuadyassin commented 2 months ago

It means the parameters I initially assumed would be recognized, but I just learned that PDMROF parameters have a different implementation and are not currently part of the recognized gridded parameters. Adjustments to the version you are using will be implemented with the help of @dprincz , and the parameters will be exposed to different input types. Once that's done, they will be recognized in the modified branch version.

MIsmlAhmed commented 2 months ago

Excellent! Thanks!

mee067 commented 2 months ago

That's what I suspected, PDMROF parameters are not recognizable as gridded but this can be implemented, soon I hope.