serialbox: enable building with NAG 7.1 (#32883)

This commit is contained in:
Sergey Kosukhin 2022-09-28 23:57:51 +02:00 committed by GitHub
parent 81f9a5b732
commit 266453ce24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,54 @@
# This patch is applicable starting version 2.3.1
--- a/src/serialbox-fortran/m_serialize.f90
+++ b/src/serialbox-fortran/m_serialize.f90
@@ -634,11 +634,14 @@ SUBROUTINE fs_get_serializer_metainfo_b(serializer, key, val)
USE, INTRINSIC :: iso_c_binding
TYPE(C_PTR), INTENT(IN), VALUE :: serializer
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: key
- LOGICAL, INTENT(OUT) :: val
+ INTEGER(KIND=C_INT), INTENT(OUT) :: val
END SUBROUTINE fs_get_serializer_metainfo_b_
END INTERFACE
- CALL fs_get_serializer_metainfo_b_(serializer%serializer_ptr, TRIM(key)//C_NULL_CHAR, val)
+ INTEGER(KIND=C_INT) :: c_val
+ CALL fs_get_serializer_metainfo_b_(serializer%serializer_ptr, TRIM(key)//C_NULL_CHAR, c_val)
+
+ val = c_val /= 0
END SUBROUTINE fs_get_serializer_metainfo_b
SUBROUTINE fs_get_serializer_metainfo_i(serializer, key, val)
@@ -950,11 +953,14 @@ SUBROUTINE fs_get_field_metainfo_b(serializer, fieldname, key, val)
USE, INTRINSIC :: iso_c_binding
TYPE(C_PTR), INTENT(IN), VALUE :: serializer
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: fieldname, key
- LOGICAL, INTENT(OUT) :: val
+ INTEGER(KIND=C_INT), INTENT(OUT) :: val
END SUBROUTINE fs_get_field_metainfo_b_
END INTERFACE
- CALL fs_get_field_metainfo_b_(serializer%serializer_ptr, TRIM(fieldname)//C_NULL_CHAR, TRIM(key)//C_NULL_CHAR, val)
+ INTEGER(KIND=C_INT) :: c_val
+ CALL fs_get_field_metainfo_b_(serializer%serializer_ptr, TRIM(fieldname)//C_NULL_CHAR, TRIM(key)//C_NULL_CHAR, c_val)
+
+ val = c_val /= 0
END SUBROUTINE fs_get_field_metainfo_b
SUBROUTINE fs_get_field_metainfo_i(serializer, fieldname, key, val)
@@ -1466,11 +1472,14 @@ SUBROUTINE fs_get_savepoint_metainfo_b(savepoint, key, val)
USE, INTRINSIC :: iso_c_binding
TYPE(C_PTR), INTENT(IN), VALUE :: savepoint
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: key
- LOGICAL, INTENT(OUT) :: val
+ INTEGER(KIND=C_INT), INTENT(OUT) :: val
END SUBROUTINE fs_get_savepoint_metainfo_b_
END INTERFACE
- CALL fs_get_savepoint_metainfo_b_(savepoint%savepoint_ptr, TRIM(key)//C_NULL_CHAR, val)
+ INTEGER(KIND=C_INT) :: c_val
+ CALL fs_get_savepoint_metainfo_b_(savepoint%savepoint_ptr, TRIM(key)//C_NULL_CHAR, c_val)
+
+ val = c_val /= 0
END SUBROUTINE fs_get_savepoint_metainfo_b
SUBROUTINE fs_get_savepoint_metainfo_i(savepoint, key, val)

View file

@ -62,6 +62,7 @@ class Serialbox(CMakePackage):
patch("nag/interface.patch", when="@2.0.1:%nag+fortran")
patch("nag/examples.patch", when="@2.3.1:%nag+fortran+examples")
patch("nag/ftg.patch", when="@2.3.1:%nag+ftg")
patch("nag/bool_getters.patch", when="@2.3.1:%nag@7.1:+fortran")
# Add missing include directives
# (part of https://github.com/GridTools/serialbox/pull/259):