esmf-org / esmf

The Earth System Modeling Framework (ESMF) is a suite of software tools for developing high-performance, multi-component Earth science modeling applications.
https://earthsystemmodeling.org/
Other
156 stars 75 forks source link

NUOPC_CompAttributeIngest fails (quietly) if line has spaces #293

Open danrosen25 opened 3 weeks ago

danrosen25 commented 3 weeks ago

Discussed in https://github.com/orgs/esmf-org/discussions/291

Using ESMF_Config with a list of items isn't working unless items do not have whitespace and are parsed in user code. Reproducer attached

What's broken

<COMP>_attributes::
      restart_fh = 0.05,0.25,0.5,3,6
 ::

Lists aren't working. This is seen as a single string.

<COMP>_attributes::
      restart_fh = 0.05, 0.25, 0.5, 3, 6
 ::

Spaces are breaking ESMF_Info. So NUOPC attributes doesn't store restart_fhat all. This is also true for restart_fh = "0.05, 0.25, 0.5, 3, 6". reproducer_info.tar.gz

Issue Source

NUOPC_CompAttributeIngest does not ingest attributes from a NUOPC_FreeFormat if they do not have exactly 3 tokens. First token is the Info label, second token is =, third token is value up until first space. If a 4th token is found then it silently skips the line. https://github.com/esmf-org/esmf/blob/4bbe0ebe7e7617d5a16a4e027e17fca893f9d4a2/src/addon/NUOPC/src/NUOPC_Comp.F90#L1724