When processing YAML file, some scientific notations that are valid for Fortran namelist variable will render as a string but not a float number.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
set a variable in templates/FV3.input.yml, for example, nssl_cccn: 0.6e9;
run generate_FV3LAM_wflow.sh;
we will get nssl_cccn: '0.6e9' in file input.nml.
Additional Context
I did a search and found a way to get around the problem. The problem lies in the fact how YAML Resolves floats. For scientific notation, it requires a decimal dot in the base and a sign symbol in the exponent after "e or E", for example, nssl_cccn: 0.6e+9 will work properly.
My suggestion is to add a regex check before processing the YAML file to prevent users from using invalid values in the YAML template file and avoid surprise when running FV3 model.
Description
When processing YAML file, some scientific notations that are valid for Fortran namelist variable will render as a string but not a float number.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
nssl_cccn: 0.6e9
;nssl_cccn: '0.6e9'
in file input.nml.Additional Context
I did a search and found a way to get around the problem. The problem lies in the fact how YAML Resolves floats. For scientific notation, it requires a decimal dot in the base and a sign symbol in the exponent after "
e
orE
", for example,nssl_cccn: 0.6e+9
will work properly.My suggestion is to add a regex check before processing the YAML file to prevent users from using invalid values in the YAML template file and avoid surprise when running FV3 model.