The tool modify_fates_paramfile.py could change the variable have other dimension? #1015
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @LianGong98 , This is a great question and might help other users, so I'll re-open. Sorry for the delay. Below is a patch file I created to demonstrate how I would do this. In the example, I want to change the hydraulic vulnerability parameter "fates_hydro_avuln_node". This is a 2d array, with dimensions PFT x hydraulic-organ. There are 4 hydraulic organs, and they are leaves, stems, transporting roots and absorbing roots (in that order). Note that this parameter, and every other 2D parameter in the parameter file, assumes that the PFT dimension is the outer dimension. I create a "patch" file, that will direct a python script to read in a base CDL file "ie base_file", make the changes that are specified, and generate the results in a new file "ie new_file". In the first manipulation, it will get rid of the PFTs in the base file that the user isn't interested in. In this example, I suppose we are not interested in anything but tropical PFTs, so set it to only keep the "broadleaf_evergreen_tropical tree", the "broadleaf_hydrodecid_tropical_tree" and the "c4_grass". After it culls the rest, they are now considered PFT 1, 2 and 3 (in that order). In the second manipulation, it will update the vulnerability parameters (for all four organs), but I tell it to only make changes to the "broadleaf_evergreen_tropical _tree" and the "c4_grass" (which are now PFT 1 and 3 respectively). The comments in the script explain the convention used. To execute this script, you must have python installed, and then change to the directory "fates/parameter_files/". Issue the command:
Here is the contents of the file "patch_hydro_example.xml":
Alternatively, you could call modify_fates_paramfile.py directly to make change. This script works on the binary form of the parameter file (ie the .nc extension) and not the text version (ie. the cdl extension). Lets say that I want to now change the vulnerability of all four organs, for the "broadleaf_hydrodecid_tropical_tree" from the file I generated above, from 2 to 1. First, I would convert the result to the binary form:
Then I would call the python script:
If I dump out the file and look at the vulnerability, it should look like this:
|
Beta Was this translation helpful? Give feedback.
Hi @LianGong98 , This is a great question and might help other users, so I'll re-open. Sorry for the delay. Below is a patch file I created to demonstrate how I would do this.
In the example, I want to change the hydraulic vulnerability parameter "fates_hydro_avuln_node". This is a 2d array, with dimensions PFT x hydraulic-organ. There are 4 hydraulic organs, and they are leaves, stems, transporting roots and absorbing roots (in that order). Note that this parameter, and every other 2D parameter in the parameter file, assumes that the PFT dimension is the outer dimension.
I create a "patch" file, that will direct a python script to read in a base CDL file "ie base_file", make the changes …