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

Adds Fortran binding for adios2_inquire_variable_attribute (try #2) #2865

Merged
Merged
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
40 changes: 40 additions & 0 deletions bindings/Fortran/modules/adios2_io_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module adios2_io_mod
external adios2_available_attributes_f2c
external adios2_retrieve_namelist_f2c
external adios2_inquire_attribute_f2c
external adios2_inquire_variable_attribute_f2c
external adios2_inquire_variable_f2c
external adios2_io_engine_type_f2c
external adios2_io_engine_type_length_f2c
Expand Down Expand Up @@ -329,6 +330,45 @@ subroutine adios2_inquire_attribute(attribute, io, name, ierr)

end subroutine

subroutine adios2_inquire_variable_attribute(attribute, io, attribute_name, variable_name, separator, ierr)
type(adios2_attribute), intent(out) :: attribute
type(adios2_io), intent(in) :: io
character*(*), intent(in) :: attribute_name
character*(*), intent(in) :: variable_name
character*(*), intent(in) :: separator
integer, intent(out) :: ierr
!local
integer:: is_valueInt

call adios2_inquire_variable_attribute_f2c(attribute%f2c, io%f2c, &
TRIM(ADJUSTL(attribute_name))//char(0), &
TRIM(ADJUSTL(variable_name))//char(0), &
TRIM(ADJUSTL(separator))//char(0), &
ierr)

if(attribute%f2c > 0_8) then
attribute%valid = .true.
attribute%name = TRIM(variable_name)//TRIM(separator)//TRIM(attribute_name)
call adios2_attribute_type_f2c(attribute%type, attribute%f2c, ierr)
call adios2_attribute_length_f2c(attribute%length, attribute%f2c, &
ierr)
call adios2_attribute_is_value_f2c(is_valueInt, attribute%f2c, ierr)

if(is_valueInt == 0) then
attribute%is_value = .false.
else
attribute%is_value = .true.
end if

else
attribute%valid = .false.
attribute%name = ''
attribute%type = adios2_type_unknown
attribute%length = 0
end if

end subroutine


subroutine adios2_remove_attribute(result, io, name, ierr)
type(adios2_io), intent(in) :: io
Expand Down