csdms / help-desk

The CSDMS Help Desk. Ask questions. Get answers (about CSDMS products and services).
MIT License
6 stars 1 forks source link

update seed input on Rafem #31

Open hunjhunj opened 4 years ago

hunjhunj commented 4 years ago

Hi,

I am using the coupled CEM-RAFEM model and updates seed number in the run_model.py file as the screen shot below:

image

However, the rand_seed number in the input.yaml from the output of the experiment was not updated (as the figure below):

image

Would you like to look into it? Thank you for your help!

mcflugen commented 4 years ago

@hunjhunj I can look into adding this capability. It should just be a matter of updating the rafem metadata in the pymt-lab/pymt_rafem. To see which input file values you can change through the setup method, you can look at the parameters attribute or help(rafem). Here is how you might do it with parameters,

>>> from pprint import pprint
>>> from pymt.models import Rafem
>>> rafem = Rafem()
>>> pprint(dict(rafem.parameters))  # input parameter names and default values
{'channel_depth': 1.0,
 'channel_discharge': 10.0,
 'channel_width': 10.0,
 'dx': 0.1,
 'dy': 0.1,
 'initial_slope': 0.001,
 'n_cols': 120,
 'n_rows': 100,
 'sea_level_initial': 0.0,
 'sea_level_rise_rate': 0.0,
 'sediment_bed_concentration': 1.0,
 'sediment_specific_gravity': 2.65,
 'subsidence_rate': 0.0,
 'time_step': 0.05,
 'upstream_elevation': 5.0,
 'wetland_distance': 0.0,
 'wetland_elevation': 0.0}

To add rand_seed to this list, you would have to update the parameters.yaml and input.yaml in pymt-lab/pymt_rafem.

hunjhunj commented 4 years ago

@hunjhunj I can look into adding this capability. It should just be a matter of updating the rafem metadata in the _pymt-lab/pymtrafem. To see which input file values you can change through the setup method, you can look at the parameters attribute or help(rafem). Here is how you might do it with parameters,

>>> from pprint import pprint
>>> from pymt.models import Rafem
>>> rafem = Rafem()
>>> pprint(dict(rafem.parameters))  # input parameter names and default values
{'channel_depth': 1.0,
 'channel_discharge': 10.0,
 'channel_width': 10.0,
 'dx': 0.1,
 'dy': 0.1,
 'initial_slope': 0.001,
 'n_cols': 120,
 'n_rows': 100,
 'sea_level_initial': 0.0,
 'sea_level_rise_rate': 0.0,
 'sediment_bed_concentration': 1.0,
 'sediment_specific_gravity': 2.65,
 'subsidence_rate': 0.0,
 'time_step': 0.05,
 'upstream_elevation': 5.0,
 'wetland_distance': 0.0,
 'wetland_elevation': 0.0}

To add _randseed to this list, you would have to update the parameters.yaml and input.yaml in _pymt-lab/pymtrafem.

Thank you!