diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index f48b27c3fe..259746c665 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -951,8 +951,8 @@ data: "broadleaf_evergreen_extratrop_shrub ", "broadleaf_hydrodecid_extratrop_shrub ", "broadleaf_colddecid_extratrop_shrub ", - "broadleaf_evergreen_extratrop_shrub ", - "broadleaf_colddecid_extratrop_shrub ", + " broadleaf_evergreen_arctic_shrub ", + " broadleaf_colddecid_arctic_shrub ", "arctic_c3_grass ", "cool_c3_grass ", "c4_grass " ; diff --git a/tools/modify_fates_paramfile.py b/tools/modify_fates_paramfile.py index cf86d2b48b..a2a31188b3 100755 --- a/tools/modify_fates_paramfile.py +++ b/tools/modify_fates_paramfile.py @@ -73,22 +73,29 @@ def main(): outputval = np.fromstring(args.val, sep=',', dtype=np.float64) else: - - try: - outputval = np.float64(args.val) - if args.changeshape: - raise Exception - except: + + # First check to see if we are modifying the pftname + if args.varname == 'fates_pftname': + rename_pft = True + else: try: - print('output variable not interpretable as real. trying array') - outputval = np.fromstring(args.val, sep=',', dtype=np.float64) - if len(outputval) == 0: - raise RuntimeError('output variable needs to have size greater than zero') + outputval = np.float64(args.val) + if args.changeshape: + raise Exception except: - if args.varname != 'fates_pftname': - raise RuntimeError('output variable not interpretable as real or array') - else: - rename_pft = True + try: + print('output variable not interpretable as real. trying array') + outputval = np.fromstring(args.val, sep=',', dtype=np.float64) + # Note that fromstring does not yet raise a ValueError for fates_pftname + # argument values. As such, the exception below will not trigger. + # Numpy warns that this will be a ValueError exception in a future update. + if len(outputval) == 0: + raise RuntimeError('output variable needs to have size greater than zero') + except: + if args.varname != 'fates_pftname': + raise RuntimeError('output variable not interpretable as real or array') + else: + rename_pft = True # # try: