Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug information to fglob function #2830

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- If file path length exceeds ESMF_MAXSTR, add _FAIL in subroutine fglob
- Add GNU UFS-like CI test

### Changed
Expand All @@ -35,8 +36,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Update `FindESMF.cmake` to match that in ESMF 8.6.1
- Add timer to the sampler code
### Changed

- Set required version of ESMF to 8.6.1
- Update `components.yaml`
- ESMA_cmake v3.45.0
Expand Down
7 changes: 6 additions & 1 deletion base/MAPL_ObsUtil.F90
Original file line number Diff line number Diff line change
Expand Up @@ -941,11 +941,16 @@ subroutine fglob(search_name, filename, rc) ! give the last name

character(kind=C_CHAR, len=:), allocatable :: c_search_name
character(kind=C_CHAR, len=512) :: c_filename
integer slen
integer :: slen, lenmax

c_search_name = trim(search_name)//C_NULL_CHAR
rc = f_call_c_glob(c_search_name, c_filename, slen)
filename=""
lenmax = len(filename)
if (lenmax < slen) then
if (MAPL_AM_I_ROOT()) write(6,*) 'pathlen vs filename_max_char_len: ', slen, lenmax
_FAIL ('PATHLEN is greater than filename_max_char_len')
end if
if (slen>0) filename(1:slen)=c_filename(1:slen)

return
Expand Down