Conversation
Co-authored-by: hansec <821577+hansec@users.noreply.github.com>
…tent ADJUSTL usage Co-authored-by: hansec <821577+hansec@users.noreply.github.com>
src/CMakeLists.txt
Outdated
| add_definitions( -DHAVE_XML ) | ||
| endif() | ||
| # LibXml2 | ||
| find_package( OFT_LibXml2 ) |
There was a problem hiding this comment.
Modify so that either FoX or LIBXML2 is found but not both, with LIBXML2 as the default.
There was a problem hiding this comment.
Done in b410a6f. LibXml2 is now tried first via CMake's built-in find_package(LibXml2); FoX is only searched if LibXml2 is not found.
src/base/oft_xml.F90
Outdated
| !--------------------------------------------------------------------------------- | ||
| !> Parse an XML file from a given file path. | ||
| !! | ||
| !! @param[in] filepath Path to the XML file |
There was a problem hiding this comment.
Throughout this module, only provide documentation of function/subroutine arguments inline with the variable declaration, not in the comment header using '@param'
There was a problem hiding this comment.
Done in b410a6f. All @param lines have been removed from comment headers throughout the module; argument documentation is now inline with variable declarations only.
src/base/oft_xml.F90
Outdated
| END IF | ||
| END SUBROUTINE oft_xml_free | ||
| #endif | ||
| !=============================================================================== |
There was a problem hiding this comment.
Remove comments indicating subroutine/functions groupings.
There was a problem hiding this comment.
Done in b410a6f. Removed the !===... grouping comment blocks.
src/cmake/FindOFT_LibXml2.cmake
Outdated
| @@ -0,0 +1,25 @@ | |||
| # FindOFT_LibXml2.cmake | |||
There was a problem hiding this comment.
Remove OFT-specific find script for LIBXML2 and utilize builtin find_lbixml2 module in CMAKE
There was a problem hiding this comment.
Done in b410a6f. Removed FindOFT_LibXml2.cmake and replaced with a direct find_package(LibXml2) call in CMakeLists.txt.
…dOFT_LibXml2 script, clean up doc comments Co-authored-by: hansec <821577+hansec@users.noreply.github.com>
hansec
left a comment
There was a problem hiding this comment.
Add subroutines in C and corresponding Fortran interfaces to parse 32-bit integer, 64-bit floating point, or boolean values into corresponding arrays. Values in strings should be assumed to be comma separated and optionally newline delimited as well to indicate 2 dimensional array data. Data should always be read into a flat array, but a 2-component shape value should be returned indicating the size and shape of the data.
Co-authored-by: hansec <821577+hansec@users.noreply.github.com>
…n wrappers Co-authored-by: hansec <821577+hansec@users.noreply.github.com>
Adds C-backed array parsing functions for int/real/logical types supporting comma-and-newline-delimited 2D data, returning a flat array plus a 2-component shape
[nrows, ncols]. Also syncs with updated base branch that allows FoX and LibXml2 to coexist.Primary changes
src/base/oft_xml_c.c— new unconditional (noHAVE_LIBXML2guard) C functions:oft_xml_parse_int_array_c— comma+newline → flatint32_t[]+shape[2]oft_xml_parse_real_array_c— comma+newline → flatdouble[]+shape[2]oft_xml_parse_logical_array_c— comma+newline → flatint32_t[](0/1) +shape[2]src/base/oft_xml.F90— updated Fortran module:BIND(C)interface declarations for the three new C functions (unconditional)oft_xml_parse_int_array,oft_xml_parse_real_array,oft_xml_parse_logical_arrayrewritten as C-backed wrappers; now returnshape(2)(nrows, ncols) instead of scalarnTypical usage:
Secondary changes
src/CMakeLists.txt: synced with base branch — FoX is now searched unconditionally alongside LibXml2 (both may be present simultaneously).gitignore: added entries to exclude build environment artifacts (/libs/,/oft_venv/, etc.)API changes
oft_xml_parse_int_array,oft_xml_parse_real_array, andoft_xml_parse_logical_arrayreplace then(count) output argument withshape(2)(nrows, ncols). These routines had no callers outsideoft_xml.F90itself at the time of this change.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.