Skip to content

Ndims error in set_paramfile #3559

@samsrabin

Description

@samsrabin

Brief summary of bug

I'm getting RuntimeError: Incorrect N dims: Expected 1, got 0 when I try to change mxmat for some CFTs. Working on this now.

General bug information

CTSM version you are using: ctsm5.3.080

Does this bug cause significantly incorrect results in the model's science? No

Important details of your setup / configuration so we can reproduce the bug

paramfile_in=/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/paramdata/ctsm5.3.041.Nfix_params.v13.c250221_upplim250.nc
paramfile_out=/glade/work/samrabin/clm6_crop_reparam_outputs/ctsm5.3.041.Nfix_params.v13.c250221_upplim250.mxmat360.nc
cft_list="temperate_corn,irrigated_temperate_corn,spring_wheat,irrigated_spring_wheat,winter_wheat,irrigated_winter_wheat,temperate_soybean,irrigated_temperate_soybean,barley,irrigated_barley,winter_barley,irrigated_winter_barley,rye,irrigated_rye,winter_rye,irrigated_winter_rye,cotton,irrigated_cotton,rice,irrigated_rice,sugarcane,irrigated_sugarcane,miscanthus,irrigated_miscanthus,switchgrass,irrigated_switchgrass,tropical_corn,irrigated_tropical_corn,tropical_soybean,irrigated_tropical_soybean"

tools/param_utils/set_paramfile -i ${paramfile_in} -o ${paramfile_out} -p ${cft_list} mxmat=360

Important output or errors that show the problem

Traceback (most recent call last):
  File "/glade/work/samrabin/ctsm/tools/param_utils/set_paramfile", line 18, in <module>
    main()
    ~~~~^^
  File "/glade/work/samrabin/ctsm/tools/param_utils/../../python/ctsm/param_utils/set_paramfile.py", line 375, in main
    ds_out = apply_new_value_to_parameter(args, ds_out, var, new_value, var_encoding, chg=chg)
  File "/glade/work/samrabin/ctsm/tools/param_utils/../../python/ctsm/param_utils/set_paramfile.py", line 315, in apply_new_value_to_parameter
    check_correct_ndims(da_to_check, new_value, throw_error=True)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/glade/work/samrabin/ctsm/tools/param_utils/../../python/ctsm/param_utils/set_paramfile.py", line 135, in check_correct_ndims
    raise RuntimeError(f"Incorrect N dims: Expected {expected}, got {actual}")
RuntimeError: Incorrect N dims: Expected 1, got 0

Metadata

Metadata

Assignees

Labels

bfbbit-for-bitbugsomething is working incorrectly

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions