Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drought deciduous phenology updates #958

Merged
merged 51 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f9d9220
Changes and updates to drought deciduous phenology to improve process…
mpaiao Dec 1, 2022
046fea5
Merge branch 'main' into mpaiao-drgt-decid
mpaiao Dec 3, 2022
f17e871
Merge branch 'main' into mpaiao-drgt-decid
mpaiao Dec 4, 2022
f785cf0
Fix units for soil matric potential in the output.
mpaiao Dec 6, 2022
8b8b7dc
Minor update to carbon allocation for deciduous PFTs.
mpaiao Dec 6, 2022
1638b65
Bug fixes in the revised carbon allocation.
mpaiao Dec 7, 2022
74a5c61
Drought thresholds are now PFT-specific. Also moved some phenology pa…
mpaiao Dec 21, 2022
b570b36
Bug fix in PRTParamsFATESMod.F90. Missing allocation of phen_moist_th…
mpaiao Dec 21, 2022
95c4a07
Documented and fixed the additional meaning of leaf life span for dro…
mpaiao Mar 6, 2023
010d95a
Multiple updates following PR revision.
mpaiao Apr 4, 2023
b42a6ce
A few bug fixes in the code.
mpaiao Apr 15, 2023
f9af3cc
Merge branch 'main' into mpaiao-pr-drgt-decid
mpaiao Apr 25, 2023
8c76111
Update to the crown damage recovery procedure for drought deciduous. …
mpaiao May 1, 2023
0c2d335
Add parameter patch file
glemieux May 10, 2023
9ec5545
update UpdateParamAPI tool
glemieux May 16, 2023
ea5d83a
update parameter file
glemieux May 16, 2023
21c573b
correct indexing for elongation factor
glemieux May 19, 2023
934ad20
Changed defaults for drought deciduous.
mpaiao May 24, 2023
befe7dd
Adding the fates_rad_model to the parameter file
rgknox Jun 6, 2023
5956465
Merge pull request #2 from rgknox/mpaiao-pr-drgt-decid
mpaiao Jun 6, 2023
afb8194
Added TRS recruitment parameters
rgknox Jun 6, 2023
894206b
Small syntax updates to trs parameter long-names
rgknox Jun 6, 2023
4a14057
Merged in Adam HBs definitions for pft parameters
rgknox Jun 6, 2023
fea2085
Merged in more regeneration parameter definitions and the model switc…
rgknox Jun 6, 2023
fb05618
Merge pull request #3 from rgknox/mpaiao-pr-drgt-decid
mpaiao Jun 6, 2023
074c043
Added AHB parameters to parteh
rgknox Jun 7, 2023
4aae59a
Merge branch 'mpaiao-pr-drgt-decid' of github.com:mpaiao/fates into m…
rgknox Jun 7, 2023
49c30b0
Merge pull request #4 from rgknox/mpaiao-pr-drgt-decid
mpaiao Jun 7, 2023
091627e
Updated memory needed for phenoology restart
rgknox Jun 7, 2023
fad6947
Merge pull request #5 from rgknox/mpaiao-pr-drgt-decid
mpaiao Jun 7, 2023
efde58c
Fix to the restart order issue
rgknox Jun 23, 2023
49f82ab
moved nlevsclass calculation earlier in subroutine
rgknox Jun 23, 2023
180ba13
Moved restart calls for new phen variables to different location
rgknox Jun 26, 2023
fa431f5
removed change of vcmax parameter
rgknox Jun 26, 2023
bd82b5f
updating the default parameter file per fixes in the api update xml t…
rgknox Jun 26, 2023
facbf55
fix to the parameter file
rgknox Jun 27, 2023
0a3c66c
Added future parameters for addressing issue 1014 in an upcoming pull…
mpaiao Jun 27, 2023
6aba10c
Merge resolution
rgknox Jun 27, 2023
59f56ee
reapplied parameter update from xml, something got lost in a merge
rgknox Jun 27, 2023
cbf0d69
add seed dispersal parameters for PR 1005
glemieux Jun 28, 2023
a6008b9
adds two new parameters to address issue 1014
glemieux Jun 28, 2023
e4cf214
provisions for frozen/arid conditions on drought deciduous suction tr…
rgknox Jun 28, 2023
6f44d03
Merge branch 'mpaiao-pr-drgt-decid' of github.com:mpaiao/fates into m…
rgknox Jun 28, 2023
8d2d765
Updating parameter file
rgknox Jun 28, 2023
1864070
simple conflict resolution
rgknox Jun 28, 2023
f87ea87
fixed parameter name
rgknox Jun 28, 2023
5830b35
Update EDPhysiologyMod.F90
mpaiao Jun 28, 2023
a1f3dc5
Merge pull request #6 from rgknox/mpaiao-pr-drgt-decid
mpaiao Jun 28, 2023
6da2d85
correct values assignment error for param patch
glemieux Jun 28, 2023
693061b
Merge branch 'drdt-decid-seed-disp-cp' into mpaiao-pr-drgt-decid
glemieux Jun 28, 2023
516c7e8
fix default param name in file
glemieux Jun 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update UpdateParamAPI tool
This allows for dimensionality updates using the variable_change flag
  • Loading branch information
glemieux committed May 16, 2023
commit 9ec55457128a60cbcc76996f202ab1ace761589d
7 changes: 5 additions & 2 deletions parameter_files/archive/api25.4.0_041023_pr958.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0"?>
<all>
<!-- This parameter patch file updates the parameter file with the necessary changes -->
<!-- per PR 995. This makes the following changes: -->
<!-- per PR 958. This makes the following changes: -->
<!-- - updates the meta data for the initial seed density -->

<!-- To use this patch file run the following command: -->

<!-- Run `python ../tools/UpdateParamAPI.py -\-f archive/api25.3.0_032223_pr995.xml` -->
<!-- Run `python ../tools/UpdateParamAPI.py -\-f archive/api25.3.0_032223_pr958.xml` -->

<!-- To update a different CDL parameter file, change the file listed the `base_file`. -->
<!-- This requires that said file is up to date with API 25.3. -->
Expand Down Expand Up @@ -36,14 +36,17 @@
<mod type="variable_change" name="fates_phen_drought_threshold">
<di> fates_pft </di>
<val> -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4, -152957.4 </val>
<ln> threshold for drought phenology (or lower threshold for semi-deciduous PFTs); the quantity depends on the sign: if positive, the threshold is volumetric soil moisture (m3/m3). If negative, the threshold is soil matric potentical (mm) </ln>
</mod>
<mod type="variable_change" name="fates_phen_moist_threshold">
<di> fates_pft </di>
<val> -122365.9, -122365.9, -122365.9, -122365.9, -122365.9, -122365.9, -122365.9, -122365.9, -122365.9, -122365.9, -122365.9, -122365.9 </val>
<ln> upper threshold for drought phenology (only for drought semi-deciduous PFTs); the quantity depends on the sign: if positive, the threshold is volumetric soil moisture (m3/m3). If negative, the threshold is soil matric potentical (mm) </ln>
</mod>
<mod type="variable_change" name="fates_phen_mindaysoff">
<di> fates_pft </di>
<val> 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 </val>
<ln> day threshold compared against days since leaves abscised (shed) </ln>
</mod>
<mod type="variable_del">
<na> fates_phen_drought_model </na>
Expand Down
74 changes: 60 additions & 14 deletions tools/UpdateParamAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def main():

sel_values = selectvalues(ncfile,list(dimnames),ipft_list,values,dcode)

[ncfile,ncvar] = createvar(ncfile,paramname,dimnames,units,longname,dcode,sel_values)
[ncfile,ncvar] = reatevar(ncfile,paramname,dimnames,units,longname,dcode,sel_values)
ncfile.flush()
ncfile.close()

Expand All @@ -373,25 +373,71 @@ def main():

ncfile = netcdf.netcdf_file(base_nc,"a",mmap=False)
ncvar_o = ncfile.variables[paramname_o]
dims_o = ncvar_o.dimensions
# dims_o = ncvar_o.dimensions
dtype_o = ncvar_o.typecode()
units_o = ncvar_o.units.decode("utf-8")
longname_o = ncvar_o.long_name.decode("utf-8")


# Check for a parameter name change
try:
paramname = mod.find('na').text.strip()
newparamname = mod.find('na').text.strip()
except:
newparamname = None

# Check for a dimensionality change
try:
dimnames = tuple(mod.find('di').text.replace(" ","").split(','))
except:
paramname = None
dimnames = None

# Change the parameter's name
if(not isinstance(paramname,type(None))):
if not dims_o:
[ncfile,ncvar] = createvar(ncfile,paramname,dims_o,units_o,longname_o,dtype_o,float(ncvar_o.data))
# Change the parameter's name and/or the dimensionality
if(not isinstance(newparamname,type(None)) or not isinstance(dimnames,type(None))):

# Initialize the parameter name to pass to the create variable function
# If this is None, a dimension update is happening and this will be updated
# below
paramname = newparamname

# If no dimension change, use the previous dimensions
if not dimnames:
dims_o = ncvar_o.dimensions
else:
# If dimension to change to is scalar, set dims_o to an empty list
if(dimnames[0]=='scalar' or dimnames[0]=='none' or dimnames[0]==''):
dims_o = ()
else:
dims_o = dimnames

# If there is no dimension change grab the original data
if (isinstance(dimnames,type(None))):
if not dims_o:
ncvardata = float(ncvar_o.data)
# [ncfile,ncvar] = createvar(ncfile,paramname,dims_o,units_o,longname_o,dtype_o,float(ncvar_o.data))
else:
ncvardata = ncvar_o[:].copy()
# [ncfile,ncvar] = createvar(ncfile,paramname,dims_o,units_o,longname_o,dtype_o,ncvar_o[:].copy())
# If there is a dimension change create zero filled data
else:
[ncfile,ncvar] = createvar(ncfile,paramname,dims_o,units_o,longname_o,dtype_o,ncvar_o[:].copy())
# If there isn't a parameter name change, grab the old name
if (isinstance(paramname,type(None))):
paramname = paramname_o

# If changing to scalar
if not dims_o:
ncvardata = 0.
# read the dimensions and create a
else:
dimsize = []
for idim,name in enumerate(dimnames):
dimsize.append(ncfile.dimensions[name])
ncvardata = np.zeros(dimsize)

# Create the new variable
[ncfile,ncvar] = createvar(ncfile,paramname,dims_o,units_o,longname_o,dtype_o,ncvardata)

else:
ncvar = ncvar_o

# Change the metadata:
try:
units = mod.find('un').text.strip()
Expand Down Expand Up @@ -426,9 +472,9 @@ def main():
ncfile.close()

# Finally, if we did perform a re-name, and
# created a new variable. We need to delete the
# old one
if(not isinstance(paramname,type(None))):
# created a new variable. We need to delete the old one
# This is not necessary for a dimension only change
if(not isinstance(newparamname,type(None))):
removevar(base_nc,paramname_o)
paramname = paramname_o

Expand Down