{"base_revision":"git-v1:fdc8b39b2cbe4ea2b3498ceafcecbcc092c8c857","content":"diff --git a/CMakeLists.txt b/CMakeLists.txt\nindex b27886d..4887845 100755\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -28,6 +28,17 @@ ecbuild_enable_fortran( REQUIRED MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/module )\n ecbuild_check_fortran( FEATURES finalization )\n \n set( FEATURE_FINAL_DEFAULT ON )\n+set( PGIBUG_ATLAS_197 0 )\n+if( CMAKE_Fortran_COMPILER_ID MATCHES \"PGI|NVHPC\" )\n+  if( ${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS 19.4 )\n+      set( PGIBUG_ATLAS_197 1 )\n+  endif()\n+  if( ${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS 19.10 )\n+    # Compilation works, but runtime segmentation faults occur (tested with pgi/17.7)\n+    set( FEATURE_FINAL_DEFAULT OFF )\n+  endif()\n+endif()\n+\n \n ecbuild_add_option( FEATURE FINAL\n                     DESCRIPTION \"Enable automatic finalisation for derived types (destructors)\"\ndiff --git a/VERSION b/VERSION\nindex 44e24d3..bb1540b 100644\n--- a/VERSION\n+++ b/VERSION\n@@ -1,2 +1,2 @@\n-0.14.4\n+0.14.2\n \ndiff --git a/cmake/fckit_install_venv.cmake b/cmake/fckit_install_venv.cmake\nindex 1e19372..f7de71a 100644\n--- a/cmake/fckit_install_venv.cmake\n+++ b/cmake/fckit_install_venv.cmake\n@@ -20,13 +20,25 @@ macro( fckit_install_venv )\n            VENV_ACTIVATE_CONTENT \"${VENV_ACTIVATE_CONTENT}\")\n     file(WRITE ${VENV_PATH}/bin/activate ${VENV_ACTIVATE_CONTENT} )\n \n-    set( FCKIT_VENV_PYTHON_EXECUTABLE \"${VENV_PATH}/bin/python3\" )\n+    # Change the context of the search to only find the venv\n+    set( Python3_FIND_VIRTUALENV ONLY )\n+    set( Python3_EXECUTABLE_CACHE ${Python3_EXECUTABLE} )\n \n-    # Make sure the venv has (sufficiently recent) pip\n-    execute_process( COMMAND ${FCKIT_VENV_PYTHON_EXECUTABLE} -m ensurepip -U OUTPUT_QUIET )\n+    # Unset Python3_EXECUTABLE because it is also an input variable\n+    #  (see documentation, Artifacts Specification section)\n+    unset( Python3_EXECUTABLE )\n+    # To allow cmake to discover the newly created venv if Python3_ROOT_DIR\n+    # was passed as an argument at build-time\n+    set( Python3_ROOT_DIR \"${VENV_PATH}\" )\n+\n+    # Find newly created python venv\n+    find_package( Python3 COMPONENTS Interpreter REQUIRED )\n+\n+    # Make sure the Python installation has (sufficiently recent) pip\n+    execute_process( COMMAND ${Python3_EXECUTABLE} -m ensurepip -U OUTPUT_QUIET )\n \n     if( Python3_VERSION VERSION_EQUAL 3.8 )\n-       execute_process( COMMAND ${FCKIT_VENV_PYTHON_EXECUTABLE} -m pip --disable-pip-version-check\n+       execute_process( COMMAND ${Python3_EXECUTABLE} -m pip --disable-pip-version-check\n                         install --upgrade pip OUTPUT_QUIET ERROR_QUIET )\n     endif()\n \n@@ -47,48 +59,23 @@ macro( fckit_install_venv )\n     # install virtual environment from requirements, which includes fypp\n     set( _pkg_name \"fckit_yaml_reader\")\n     ecbuild_info( \"Install fckit_yaml_reader and fypp in virtual environment ${VENV_PATH}\" )\n-\n-    # Stage the package into the build tree so concurrent builds sharing the same\n-    # source checkout don't race on setuptools' in-tree build/ and *.egg-info/ dirs.\n-    set( _pkg_src \"${CMAKE_CURRENT_SOURCE_DIR}/src/fckit/${_pkg_name}\" )\n-    set( _pkg_bld \"${CMAKE_CURRENT_BINARY_DIR}/${_pkg_name}\" )\n-    file( REMOVE_RECURSE \"${_pkg_bld}\" )\n-    file( COPY \"${_pkg_src}/\" DESTINATION \"${_pkg_bld}\"\n-          PATTERN \"build\"       EXCLUDE\n-          PATTERN \"*.egg-info\"  EXCLUDE\n-          PATTERN \"dist\"        EXCLUDE\n-          PATTERN \"__pycache__\" EXCLUDE )\n-\n-    execute_process( COMMAND ${FCKIT_VENV_PYTHON_EXECUTABLE} -m pip\n-                     install ${PIP_OPTIONS} \"${_pkg_bld}\"\n-                     RESULT_VARIABLE _pip_result\n-                     OUTPUT_QUIET )\n-    if( NOT _pip_result EQUAL 0 )\n-        ecbuild_error( \"pip install of ${_pkg_name} failed (exit ${_pip_result})\" )\n-    endif()\n+    execute_process( COMMAND ${Python3_EXECUTABLE} -m pip\n+                     install ${PIP_OPTIONS} ${CMAKE_CURRENT_SOURCE_DIR}/src/fckit/${_pkg_name} OUTPUT_QUIET )\n \n     if( HAVE_FCKIT_VENV_INSTALL )\n        install( DIRECTORY ${VENV_PATH} DESTINATION . PATTERN \"bin/*\" PERMISSIONS ${install_permissions} )\n-    elseif( HAVE_FCKIT_VENV )\n-        # Create a symlink in the install directory pointing to the build-directory, could possibly dangle!\n-        install(CODE \"\n-        set( link_source \\\"${CMAKE_CURRENT_BINARY_DIR}/fckit_venv\\\" )\n-        set( link_target \\\"\\$ENV{DESTDIR}\\${CMAKE_INSTALL_PREFIX}/fckit_venv\\\" )\n-        if(EXISTS \\${link_target} )\n-            message(STATUS \\\"Up-to-date: \\${link_target} (WARNING: symlink to \\${link_source})\\\")\n-        else()\n-            message(STATUS \\\"Installing: \\${link_target} (WARNING: symlink to \\${link_source})\\\")\n-            execute_process(COMMAND \\${CMAKE_COMMAND} -E create_symlink \\${link_source} \\${link_target})\n-        endif()\n-        \")\n     endif()\n \n     # add python interpreter of venv as executable target\n-    set( FCKIT_VENV_EXE ${FCKIT_VENV_PYTHON_EXECUTABLE} )\n+    set( FCKIT_VENV_EXE ${Python3_EXECUTABLE} )\n \n     # compute relative path to venv to aid with installation\n     string(REPLACE \"${CMAKE_CURRENT_BINARY_DIR}/\" \"\" rel_venv_exe_path ${FCKIT_VENV_EXE})\n \n     set( FYPP ${CMAKE_CURRENT_SOURCE_DIR}/tools/fckit-eval.sh ${FCKIT_VENV_EXE} -m fypp )\n \n+    # reset Python3_EXECUTABLE to the system install\n+    set( Python3_EXECUTABLE ${Python3_EXECUTABLE_CACHE} )\n+\n endmacro()\n+\ndiff --git a/cmake/fckit_preprocess_fypp.cmake b/cmake/fckit_preprocess_fypp.cmake\nindex b1cbfea..e2b58e5 100644\n--- a/cmake/fckit_preprocess_fypp.cmake\n+++ b/cmake/fckit_preprocess_fypp.cmake\n@@ -52,8 +52,7 @@ endfunction()\n #                                [SOURCES file1 [file2]... ]\n #                                [FYPP_ARGS arg1 [arg2]... ]\n #                                [FYPP_ARGS_EXCLUDE arg1 [arg2]... ]\n-#                                [DEPENDS dep1 [dep2]... ]\n-#                                [OUTPUT_SUFFIX suffix] )\n+#                                [DEPENDS dep1 [dep2]... ] )\n #    Purpose:\n #        Preprocess source files with fypp\n #\n@@ -63,7 +62,6 @@ endfunction()\n #        [FYPP_ARGS arg1 [arg2]...]          Arguments passed to fypp\n #        [FYPP_ARGS_EXCLUDE arg1 [arg2]...]  Arguments excluded from being passed to fypp; accepts bash-compatible regex\n #        [DEPENDS dep1 [dep2]... ]           Dependencies before processing files\n-#        [OUTPUT_SUFFIX suffix]              Optional suffix appended to generated basenames before .F90\n #\n #    Notes:\n #        The include flags and compile flags of targets with the DEPENDS argument\n@@ -72,7 +70,7 @@ endfunction()\n function( fckit_preprocess_fypp_sources output )\n \n   set( options NO_LINE_NUMBERING )\n-  set( single_value_args OUTPUT_SUFFIX )\n+  set( single_value_args \"\" )\n   set( multi_value_args SOURCES FYPP_ARGS FYPP_ARGS_EXCLUDE DEPENDS )\n   cmake_parse_arguments( _PAR \"${options}\" \"${single_value_args}\" \"${multi_value_args}\"  ${_FIRST_ARG} ${ARGN} )\n \n@@ -91,7 +89,7 @@ function( fckit_preprocess_fypp_sources output )\n     if( dir )\n       set( outfile \"${outfile}/${dir}\" )\n     endif()\n-    set( outfile \"${outfile}/${base}${_PAR_OUTPUT_SUFFIX}.F90\" )\n+    set( outfile \"${outfile}/${base}.F90\" )\n \n     list( APPEND outfiles ${outfile} )\n \n@@ -127,9 +125,9 @@ function( fckit_preprocess_fypp_sources output )\n     endforeach()\n \n     if( dir )\n-      set( short_outfile \"${dir}/${base}${_PAR_OUTPUT_SUFFIX}.F90\" )\n+      set( short_outfile \"${dir}/${base}.F90\" )\n     else()\n-      set( short_outfile \"${base}${_PAR_OUTPUT_SUFFIX}.F90\")\n+      set( short_outfile \"${base}.F90\")\n     endif()\n \n     get_source_file_property( _depends ${filename} OBJECT_DEPENDS )\n@@ -156,7 +154,7 @@ function( fckit_preprocess_fypp_sources output )\n                    OVERRIDE_COMPILE_FLAGS_${CMAKE_BUILD_TYPE_CAPS} )\n       get_source_file_property( ${filename}_${_prop} ${filename} ${_prop} )\n       if( ${filename}_${_prop} )\n-        set_source_files_properties(${outfile} PROPERTIES ${_prop} \"${${filename}_${_prop}}\" )\n+        set_source_files_properties(${outfile} PROPERTIES ${_prop} ${${filename}_${_prop}} )\n       endif()\n     endforeach()\n \n@@ -175,10 +173,7 @@ endfunction()\n # fckit_target_preprocess_fypp( target\n #                               [FYPP_ARGS arg1 [arg2]... ]\n #                               [FYPP_ARGS_EXCLUDE arg1 [arg2]... ]\n-#                               [DEPENDS dep1 [dep2]... ]\n-#                               [OUTPUT_SUFFIX suffix]\n-#                               [OUTPUT_SOURCES src_list]\n-#                               [NO_TARGET_DEPENDS] )\n+#                               [DEPENDS dep1 [dep2]... ] )\n #    Purpose:\n #        Preprocess source files in the target with the extensions\n #        {.fypp, .fypp.F90, .F90.fypp}\n@@ -188,25 +183,16 @@ endfunction()\n #        [FYPP_ARGS arg1 [arg2]...]           Arguments passed to fypp\n #        [FYPP_ARGS_EXCLUDE arg1 [arg2]... ]  Arguments excluded from being passed to fypp; accepts bash-compatible regex\n #        [DEPENDS dep1 [dep2]... ]            Dependencies before processing files\n-#        [OUTPUT_SUFFIX suffix]               Optional suffix appended to generated basenames before .F90\n-#        [OUTPUT_SOURCES src_list]            Returns a list of generated .F90 paths in the caller's scope\n-#        [NO_TARGET_DEPENDS]                  Prevent adding a dependency between the target and generated files.\n #\n #    Notes:\n #        The include flags and compile flags of current target and targets\n #        within the DEPENDS argument will be automatically deduced\n-#        and added to the fypp command.\n-#\n-#        Unless NO_TARGET_DEPENDS is specified, an ordering dependency is\n-#        established so that all fypp preprocessing completes before any source\n-#        in the target is compiled. This can prevent build failures due to the\n-#        Ninja generator's dynamic Fortran module dependency scanning, which\n-#        will fail to find modules that are generated by fypp.\n+#        and added to the fypp command\n \n function( fckit_target_preprocess_fypp _PAR_TARGET )\n \n-  set( options NO_LINE_NUMBERING NO_TARGET_DEPENDS )\n-  set( single_value_args OUTPUT_SUFFIX OUTPUT_SOURCES )\n+  set( options NO_LINE_NUMBERING )\n+  set( single_value_args \"\" )\n   set( multi_value_args FYPP_ARGS FYPP_ARGS_EXCLUDE DEPENDS )\n   cmake_parse_arguments( _PAR \"${options}\" \"${single_value_args}\" \"${multi_value_args}\"  ${_FIRST_ARG} ${ARGN} )\n \n@@ -266,27 +252,10 @@ function( fckit_target_preprocess_fypp _PAR_TARGET )\n           FYPP_ARGS ${_PAR_FYPP_ARGS} ${args}\n           FYPP_ARGS_EXCLUDE ${_PAR_FYPP_ARGS_EXCLUDE}\n           DEPENDS ${preprocessed_depends} ${_PAR_DEPENDS}\n-          OUTPUT_SUFFIX ${_PAR_OUTPUT_SUFFIX}\n       )\n \n       target_sources( ${_PAR_TARGET} PRIVATE ${preprocessed_sources} )\n \n-      # Use a custom target to ensure all fypp custom commands finish before any\n-      # source in the target is compiled.\n-      # Not applied if the same target is invoked a second time.\n-      if( NOT _PAR_NO_TARGET_DEPENDS AND preprocessed_sources )\n-        set( _fypp_order_target ${_PAR_TARGET}_fypp_order )\n-        if( NOT TARGET ${_fypp_order_target} )\n-          add_custom_target( ${_fypp_order_target} DEPENDS ${preprocessed_sources} )\n-        endif()\n-        add_dependencies( ${_PAR_TARGET} ${_fypp_order_target} )\n-      endif()\n-\n-      # Return generated file list to caller if requested\n-      if( _PAR_OUTPUT_SOURCES )\n-        set( ${_PAR_OUTPUT_SOURCES} ${preprocessed_sources} PARENT_SCOPE )\n-      endif()\n-\n       ### Extra stuff required to add correct flags\n       if( COMMAND ecbuild_target_flags )\n         list( APPEND ${_PAR_TARGET}_fortran_srcs ${preprocessed_sources} )\ndiff --git a/debian/changelog b/debian/changelog\nindex 91172e1..542a616 100644\n--- a/debian/changelog\n+++ b/debian/changelog\n@@ -1,11 +1,10 @@\n-fckit (0.14.4-1) unstable; urgency=medium\n+fckit (0.14.2-5) UNRELEASED; urgency=medium\n \n-  * New  upstream release\n   * Add CPPFLAGS for hardening\n   * Build with dh-fortran >= 0.72\n   * Standards-Version: 4.7.4\n \n- -- Alastair McKinstry <mckinstry@debian.org>  Fri, 21 Aug 2026 14:29:12 +0100\n+ -- Alastair McKinstry <mckinstry@debian.org>  Wed, 01 Apr 2026 09:18:09 +0100\n \n fckit (0.14.2-4) unstable; urgency=medium\n \ndiff --git a/src/fckit/fckit.h.in b/src/fckit/fckit.h.in\nindex b8a1ad1..293e263 100644\n--- a/src/fckit/fckit.h.in\n+++ b/src/fckit/fckit.h.in\n@@ -40,13 +40,35 @@ does it submit to any jurisdiction.\n associate( unused_ => X ); \\\n end associate\n \n+#define PGIBUG_ATLAS_197 @PGIBUG_ATLAS_197@\n #if 0\n-Following 2 macros were for a workaround PGI bug (PGI_BUG_ATLAS_197) which prevents the use of function c_ptr()\n+Following is to workaround PGI bug which prevents the use of function c_ptr()\n PGI bug present from version 17.10, fixed since version 19.4\n-The definitions are only remaining for downstream code that may still reference these.\n #endif\n+#if PGIBUG_ATLAS_197\n+#define CPTR_PGIBUG_A cpp_object_ptr\n+#define CPTR_PGIBUG_B shared_object_%cpp_object_ptr\n+#else\n #define CPTR_PGIBUG_A c_ptr()\n #define CPTR_PGIBUG_B c_ptr()\n+#endif\n+\n+#define PGIBUG_ATLAS_197_DEBUG 0\n+#if 0\n+When above PGIBUG_ATLAS_197_DEBUG==1 then the c_ptr() member functions are disabled from compilation,\n+to detect possible dangerous use cases when the PGI bug ATLAS-197 is present.\n+#endif\n+\n+#define XLBUG_FCKIT_14 1\n+#if 0\n+Following is to workaround XL bug where allocate( character(len=xxx,kind=c_char ) :: string )\n+does not compile\n+#endif\n+#if XLBUG_FCKIT_14\n+#define FCKIT_ALLOCATE_CHARACTER( VARIABLE, SIZE ) allocate( character(len=(SIZE)) :: VARIABLE )\n+#else\n+#define FCKIT_ALLOCATE_CHARACTER( VARIABLE, SIZE ) allocate( character(len=(SIZE),kind=c_char) :: VARIABLE )\n+#endif\n \n #if 0\n // clang-format on\ndiff --git a/src/fckit/fckit_yaml_reader/pyproject.toml b/src/fckit/fckit_yaml_reader/pyproject.toml\nindex 4d011af..82baef9 100644\n--- a/src/fckit/fckit_yaml_reader/pyproject.toml\n+++ b/src/fckit/fckit_yaml_reader/pyproject.toml\n@@ -10,7 +10,7 @@ name = \"fckit_yaml_reader\"\n version = \"0.0.1\"\n requires-python = \">=3.8\"\n dependencies = [\n-  \"ruamel.yaml>=0.18.6\",\n+  \"ruamel.yaml==0.18.6\",\n   \"ruamel.yaml.clib>=0.2.8\",\n   \"fypp>=3.2\"\n ]\ndiff --git a/src/fckit/module/fckit_C_interop.F90 b/src/fckit/module/fckit_C_interop.F90\nindex b080f2e..3a380ae 100644\n--- a/src/fckit/module/fckit_C_interop.F90\n+++ b/src/fckit/module/fckit_C_interop.F90\n@@ -151,7 +151,7 @@ function c_str_to_string(s) result(string)\n      i = i + 1\n   enddo\n   nchars = i - 1  ! Exclude null character from Fortran string\n-  allocate( character(len=(nchars),kind=c_char) :: string )\n+  FCKIT_ALLOCATE_CHARACTER(string,nchars)\n   do i=1,nchars\n     string(i:i) = s(i)\n   enddo\n@@ -168,7 +168,7 @@ subroutine copy_c_str_to_string(s,string)\n      if (s(i) == c_null_char) exit\n   enddo\n   nchars = i - 1  ! Exclude null character from Fortran string\n-  allocate( character(len=(nchars),kind=c_char) :: string )\n+  FCKIT_ALLOCATE_CHARACTER(string,nchars)\n   do i=1,nchars\n     string(i:i) = s(i)\n   enddo\ndiff --git a/src/fckit/module/fckit_buffer.F90 b/src/fckit/module/fckit_buffer.F90\nindex 8bf38dd..186216c 100644\n--- a/src/fckit/module/fckit_buffer.F90\n+++ b/src/fckit/module/fckit_buffer.F90\n@@ -101,8 +101,8 @@ function str(this)\n   integer(c_int32_t) :: errcode\n   integer(c_size_t) :: str_size\n   type(c_ptr) :: str_cptr\n-  errcode = c_fckit_buffer_str(this%c_ptr(),str_cptr,str_size)\n-  allocate( character(len=(str_size),kind=c_char) :: str )\n+  errcode = c_fckit_buffer_str(this%CPTR_PGIBUG_B,str_cptr,str_size)\n+  FCKIT_ALLOCATE_CHARACTER(str,str_size)\n   str = c_ptr_to_string(str_cptr)\n   call c_ptr_free(str_cptr)\n end function\ndiff --git a/src/fckit/module/fckit_configuration.F90 b/src/fckit/module/fckit_configuration.F90\nindex 634665b..54aae21 100644\n--- a/src/fckit/module/fckit_configuration.F90\n+++ b/src/fckit/module/fckit_configuration.F90\n@@ -404,7 +404,7 @@ function ctor_from_buffer(buffer) result(this)\n   use fckit_c_interop_module, only : c_str\n   type(fckit_Configuration) :: this\n   type(fckit_buffer), intent(in) :: buffer\n-  call this%reset_c_ptr( c_fckit_configuration_new_from_buffer(buffer%c_ptr()), &\n+  call this%reset_c_ptr( c_fckit_configuration_new_from_buffer(buffer%CPTR_PGIBUG_B), &\n     & fckit_c_deleter(c_fckit_configuration_delete) )\n   call buffer%consumed() ! If buffer was constructed inline, this will delete the buffer\n   call this%return()\n@@ -414,7 +414,7 @@ function fckit_configuration_size(this) result(val)\n   use fckit_c_interop_module, only : c_str\n   class(fckit_Configuration), intent(in) :: this\n   integer(c_int32_t) :: val\n-  val =  c_fckit_configuration_size(this%c_ptr())\n+  val =  c_fckit_configuration_size(this%CPTR_PGIBUG_B)\n   write(0,*) \"fckit_configuration_size \" , val\n end function\n \n@@ -424,7 +424,7 @@ function has(this, name) result(value)\n   character(kind=c_char,len=*), intent(in) :: name\n   logical :: value\n   integer(c_int32_t) :: value_int\n-  value_int =  c_fckit_configuration_has(this%c_ptr(), c_str(name) )\n+  value_int =  c_fckit_configuration_has(this%CPTR_PGIBUG_B, c_str(name) )\n   if( value_int == 1 ) then\n     value = .True.\n   else\n@@ -439,8 +439,8 @@ function key(this, index) result(key_str)\n   integer(c_int32_t), intent(in) :: index\n   type(c_ptr) :: key_cptr\n   integer(c_size_t) :: key_size\n-  call c_fckit_configuration_key(this%c_ptr(), index, key_cptr, key_size)\n-  allocate( character(len=(key_size),kind=c_char) :: key_str )\n+  call c_fckit_configuration_key(this%CPTR_PGIBUG_B, index, key_cptr, key_size)\n+  FCKIT_ALLOCATE_CHARACTER(key_str, key_size)\n   key_str = c_ptr_to_string(key_cptr)\n   call c_ptr_free(key_cptr)\n end function\n@@ -450,7 +450,7 @@ function get_size(this, name) result(val)\n   class(fckit_Configuration), intent(in) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   integer(c_int32_t) :: val\n-  val = c_fckit_configuration_get_size(this%c_ptr(), c_str(name) )\n+  val = c_fckit_configuration_get_size(this%CPTR_PGIBUG_B, c_str(name) )\n end function\n \n subroutine set_config(this, name, value)\n@@ -458,7 +458,7 @@ subroutine set_config(this, name, value)\n   class(fckit_Configuration), intent(inout) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   class(fckit_Configuration), intent(in) :: value\n-  call c_fckit_configuration_set_config(this%c_ptr(), c_str(name), value%c_ptr() )\n+  call c_fckit_configuration_set_config(this%CPTR_PGIBUG_B, c_str(name), value%CPTR_PGIBUG_B )\n end subroutine\n \n subroutine set_config_list(this, name, value)\n@@ -471,9 +471,9 @@ subroutine set_config_list(this, name, value)\n   integer(c_int32_t) :: j\n   if( size(value) > 0 ) then\n     do j=1,size(value)\n-      value_cptrs(j) = value(j)%c_ptr()\n+      value_cptrs(j) = value(j)%CPTR_PGIBUG_B\n     enddo\n-    call c_fckit_configuration_set_config_list(this%c_ptr(), c_str(name),  &\n+    call c_fckit_configuration_set_config_list(this%CPTR_PGIBUG_B, c_str(name),  &\n       c_loc(value_cptrs(1)), size(value_cptrs,kind=c_size_t) )\n   endif\n end subroutine\n@@ -490,7 +490,7 @@ subroutine set_logical(this, name, value)\n   else\n     value_int = 0\n   end if\n-  call c_fckit_configuration_set_bool(this%c_ptr(), c_str(name), value_int )\n+  call c_fckit_configuration_set_bool(this%CPTR_PGIBUG_B, c_str(name), value_int )\n end subroutine\n \n subroutine set_int32(this, name, value)\n@@ -498,7 +498,7 @@ subroutine set_int32(this, name, value)\n   class(fckit_Configuration), intent(inout) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   integer(c_int32_t), intent(in) :: value\n-  call c_fckit_configuration_set_int32(this%c_ptr(), c_str(name), value)\n+  call c_fckit_configuration_set_int32(this%CPTR_PGIBUG_B, c_str(name), value)\n end subroutine\n \n subroutine set_int64(this, name, value)\n@@ -506,7 +506,7 @@ subroutine set_int64(this, name, value)\n   class(fckit_Configuration), intent(inout) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   integer(c_int64_t), intent(in) :: value\n-  call c_fckit_configuration_set_int64(this%c_ptr(), c_str(name), value)\n+  call c_fckit_configuration_set_int64(this%CPTR_PGIBUG_B, c_str(name), value)\n end subroutine\n \n subroutine set_real32(this, name, value)\n@@ -514,7 +514,7 @@ subroutine set_real32(this, name, value)\n   class(fckit_Configuration), intent(inout) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   real(c_float), intent(in) :: value\n-  call c_fckit_configuration_set_float(this%c_ptr(), c_str(name) ,value)\n+  call c_fckit_configuration_set_float(this%CPTR_PGIBUG_B, c_str(name) ,value)\n end subroutine\n \n subroutine set_real64(this, name, value)\n@@ -522,7 +522,7 @@ subroutine set_real64(this, name, value)\n   class(fckit_Configuration), intent(inout) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   real(c_double), intent(in) :: value\n-  call c_fckit_configuration_set_double(this%c_ptr(), c_str(name) ,value)\n+  call c_fckit_configuration_set_double(this%CPTR_PGIBUG_B, c_str(name) ,value)\n end subroutine\n \n subroutine set_string(this, name, value)\n@@ -530,7 +530,7 @@ subroutine set_string(this, name, value)\n   class(fckit_Configuration), intent(inout) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   character(kind=c_char,len=*), intent(in) :: value\n-  call c_fckit_configuration_set_string(this%c_ptr(), c_str(name) , c_str(value) )\n+  call c_fckit_configuration_set_string(this%CPTR_PGIBUG_B, c_str(name) , c_str(value) )\n end subroutine\n \n subroutine set_array_string(this, name, value)\n@@ -549,7 +549,7 @@ subroutine set_array_string(this, name, value)\n     do ii = 1, size(value)\n       flatvalue((ii-1)*length+1:ii*length) = value(ii)\n     enddo\n-    call c_fckit_configuration_set_array_string(this%c_ptr(), c_str(name), &\n+    call c_fckit_configuration_set_array_string(this%CPTR_PGIBUG_B, c_str(name), &\n       &  c_str(flatvalue), length, size(value,kind=c_size_t) )\n   endif\n end subroutine\n@@ -559,7 +559,7 @@ subroutine set_array_int32(this, name, value)\n   class(fckit_Configuration), intent(in) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   integer(c_int32_t), intent(in) :: value(:)\n-  call c_fckit_configuration_set_array_int32(this%c_ptr(), c_str(name), value, size(value,kind=c_size_t) )\n+  call c_fckit_configuration_set_array_int32(this%CPTR_PGIBUG_B, c_str(name), value, size(value,kind=c_size_t) )\n end subroutine\n \n subroutine set_array_int64(this, name, value)\n@@ -567,7 +567,7 @@ subroutine set_array_int64(this, name, value)\n   class(fckit_Configuration), intent(in) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   integer(c_int64_t), intent(in) :: value(:)\n-  call c_fckit_configuration_set_array_int64(this%c_ptr(), c_str(name), value, size(value,kind=c_size_t) )\n+  call c_fckit_configuration_set_array_int64(this%CPTR_PGIBUG_B, c_str(name), value, size(value,kind=c_size_t) )\n end subroutine\n \n subroutine set_array_real32(this, name, value)\n@@ -575,7 +575,7 @@ subroutine set_array_real32(this, name, value)\n   class(fckit_Configuration), intent(in) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   real(c_float), intent(in) :: value(:)\n-  call c_fckit_configuration_set_array_float(this%c_ptr(), c_str(name), value, size(value,kind=c_size_t) )\n+  call c_fckit_configuration_set_array_float(this%CPTR_PGIBUG_B, c_str(name), value, size(value,kind=c_size_t) )\n end subroutine\n \n subroutine set_array_real64(this, name, value)\n@@ -583,7 +583,7 @@ subroutine set_array_real64(this, name, value)\n   class(fckit_Configuration), intent(in) :: this\n   character(kind=c_char,len=*), intent(in) :: name\n   real(c_double), intent(in) :: value(:)\n-  call c_fckit_configuration_set_array_double(this%c_ptr(), c_str(name), value, size(value,kind=c_size_t) )\n+  call c_fckit_configuration_set_array_double(this%CPTR_PGIBUG_B, c_str(name), value, size(value,kind=c_size_t) )\n end subroutine\n \n function get_config(this, name, value) result(found)\n@@ -594,8 +594,8 @@ function get_config(this, name, value) result(found)\n   class(fckit_Configuration), intent(inout) :: value\n   integer(c_int32_t) :: found_int\n   value = fckit_Configuration()\n-  found_int = c_fckit_configuration_get_config(this%c_ptr(), &\n-    c_str(name), value%c_ptr() )\n+  found_int = c_fckit_configuration_get_config(this%CPTR_PGIBUG_B, &\n+    c_str(name), value%CPTR_PGIBUG_B )\n   found = .False.\n   if (found_int == 1) then\n     found = .True.\n@@ -623,7 +623,7 @@ function get_config_list(this, name, value) result(found)\n   integer(c_size_t) :: j\n   call deallocate_fckit_configuration(value)\n   value_list_cptr = c_null_ptr\n-  found_int = c_fckit_configuration_get_config_list(this%c_ptr(), c_str(name), &\n+  found_int = c_fckit_configuration_get_config_list(this%CPTR_PGIBUG_B, c_str(name), &\n     & value_list_cptr, value_list_size)\n   found = .False.\n   if( found_int == 1 ) then\n@@ -652,7 +652,7 @@ function get_logical(this, name, value) result(found)\n   logical, intent(inout) :: value\n   integer(c_int32_t) :: value_int\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_bool(this%c_ptr(),c_str(name), value_int )\n+  found_int = c_fckit_configuration_get_bool(this%CPTR_PGIBUG_B,c_str(name), value_int )\n   found = .False.\n   if (found_int == 1) found = .True.\n   if (found) then\n@@ -678,7 +678,7 @@ function get_int32(this, name, value) result(found)\n   character(kind=c_char,len=*), intent(in) :: name\n   integer(c_int32_t), intent(inout) :: value\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_int32(this%c_ptr(), c_str(name), value )\n+  found_int = c_fckit_configuration_get_int32(this%CPTR_PGIBUG_B, c_str(name), value )\n   found = .False.\n   if (found_int == 1) found = .True.\n end function\n@@ -697,7 +697,7 @@ function get_int64(this, name, value) result(found)\n   character(kind=c_char,len=*), intent(in) :: name\n   integer(c_int64_t), intent(inout) :: value\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_int64(this%c_ptr(), c_str(name), value )\n+  found_int = c_fckit_configuration_get_int64(this%CPTR_PGIBUG_B, c_str(name), value )\n   found = .False.\n   if (found_int == 1) found = .True.\n end function\n@@ -716,7 +716,7 @@ function get_real32(this, name, value) result(found)\n   character(kind=c_char,len=*), intent(in) :: name\n   real(c_float), intent(inout) :: value\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_float(this%c_ptr(), c_str(name), value )\n+  found_int = c_fckit_configuration_get_float(this%CPTR_PGIBUG_B, c_str(name), value )\n   found = .False.\n   if (found_int == 1) found = .True.\n end function\n@@ -735,7 +735,7 @@ function get_real64(this, name, value) result(found)\n   character(kind=c_char,len=*), intent(in) :: name\n   real(c_double), intent(inout) :: value\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_double(this%c_ptr(), c_str(name), value )\n+  found_int = c_fckit_configuration_get_double(this%CPTR_PGIBUG_B, c_str(name), value )\n   found = .False.\n   if (found_int == 1) found = .True.\n end function\n@@ -756,10 +756,10 @@ function get_string(this, name, value) result(found)\n   type(c_ptr) :: value_cptr\n   integer(c_int32_t) :: found_int\n   integer(c_size_t) :: value_size\n-  found_int = c_fckit_configuration_get_string(this%c_ptr(),c_str(name),value_cptr,value_size)\n+  found_int = c_fckit_configuration_get_string(this%CPTR_PGIBUG_B,c_str(name),value_cptr,value_size)\n   if( found_int == 1 ) then\n     if( allocated(value) ) deallocate(value)\n-    allocate( character(len=(value_size),kind=c_char) :: value )\n+    FCKIT_ALLOCATE_CHARACTER(value,value_size)\n     if ( value_size > 0 ) then\n       value = c_ptr_to_string(value_cptr)\n       call c_ptr_free(value_cptr)\n@@ -788,7 +788,7 @@ function get_array_logical(this, name, value) result(found)\n   integer(c_size_t) :: j, value_size\n   integer(c_int32_t), allocatable :: value_int(:)\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_array_int32(this%c_ptr(), c_str(name), &\n+  found_int = c_fckit_configuration_get_array_int32(this%CPTR_PGIBUG_B, c_str(name), &\n    & value_cptr, value_size )\n   if( found_int == 1 ) then\n     call c_f_pointer(value_cptr,value_fptr,(/value_size/))\n@@ -827,7 +827,7 @@ function get_array_int32(this, name, value) result(found)\n   integer(c_int32_t), pointer :: value_fptr(:)\n   integer(c_size_t) :: value_size\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_array_int32(this%c_ptr(), c_str(name), &\n+  found_int = c_fckit_configuration_get_array_int32(this%CPTR_PGIBUG_B, c_str(name), &\n    & value_cptr, value_size )\n   if( found_int == 1 ) then\n     call c_f_pointer(value_cptr,value_fptr,(/value_size/))\n@@ -858,7 +858,7 @@ function get_array_int64(this, name, value) result(found)\n   integer(c_int64_t), pointer :: value_fptr(:)\n   integer(c_size_t) :: value_size\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_array_int64(this%c_ptr(), c_str(name), &\n+  found_int = c_fckit_configuration_get_array_int64(this%CPTR_PGIBUG_B, c_str(name), &\n    & value_cptr, value_size )\n   if( found_int == 1 ) then\n     call c_f_pointer(value_cptr,value_fptr,(/value_size/))\n@@ -889,7 +889,7 @@ function get_array_real32(this, name, value) result(found)\n   real(c_float), pointer :: value_fptr(:)\n   integer(c_size_t) :: value_size\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_array_float(this%c_ptr(), c_str(name), &\n+  found_int = c_fckit_configuration_get_array_float(this%CPTR_PGIBUG_B, c_str(name), &\n    & value_cptr, value_size )\n   if( found_int == 1 ) then\n     call c_f_pointer(value_cptr,value_fptr,(/value_size/))\n@@ -920,7 +920,7 @@ function get_array_real64(this, name, value) result(found)\n   real(c_double), pointer :: value_fptr(:)\n   integer(c_size_t) :: value_size\n   integer(c_int32_t) :: found_int\n-  found_int = c_fckit_configuration_get_array_double(this%c_ptr(), c_str(name), &\n+  found_int = c_fckit_configuration_get_array_double(this%CPTR_PGIBUG_B, c_str(name), &\n    & value_cptr, value_size )\n   if( found_int == 1 ) then\n     call c_f_pointer(value_cptr,value_fptr,(/value_size/))\n@@ -958,7 +958,7 @@ function get_array_string(this,name,value) result(found)\n   integer(c_size_t) :: elemlen\n   integer(c_size_t) :: j\n   character(len=:), allocatable :: flatvalue\n-  found_int =   c_fckit_configuration_get_array_string(this%c_ptr(), c_str(name), &\n+  found_int =   c_fckit_configuration_get_array_string(this%CPTR_PGIBUG_B, c_str(name), &\n    & value_cptr, value_size, offsets_cptr, value_numelem)\n   if( found_int == 1 ) then\n     ! Get flat character array\n@@ -1010,8 +1010,8 @@ function json(this) result(jsonstr)\n   class(fckit_Configuration), intent(in) :: this\n   type(c_ptr) :: json_cptr\n   integer(c_size_t) :: json_size\n-  call c_fckit_configuration_json(this%c_ptr(),json_cptr,json_size)\n-  allocate( character(len=(json_size),kind=c_char) :: jsonstr )\n+  call c_fckit_configuration_json(this%CPTR_PGIBUG_B,json_cptr,json_size)\n+  FCKIT_ALLOCATE_CHARACTER(jsonstr,json_size)\n   jsonstr = c_ptr_to_string(json_cptr)\n   call c_ptr_free(json_cptr)\n end function\ndiff --git a/src/fckit/module/fckit_exception.F90 b/src/fckit/module/fckit_exception.F90\nindex 340c4af..01e7ec2 100644\n--- a/src/fckit/module/fckit_exception.F90\n+++ b/src/fckit/module/fckit_exception.F90\n@@ -200,7 +200,7 @@ function what()\n   integer(c_int32_t) :: error_code\n \n   error_code = fckit__exception_what(what_c_ptr,what_size)\n-  allocate( character(len=(what_size),kind=c_char) :: what )\n+  FCKIT_ALLOCATE_CHARACTER(what,what_size)\n   what = c_ptr_to_string(what_c_ptr)\n   call c_ptr_free(what_c_ptr)\n end function\n@@ -236,7 +236,7 @@ function location_file() result(file)\n   integer(c_int32_t) :: error_code\n \n   error_code = fckit__exception_file(file_c_ptr,file_size)\n-  allocate( character(len=(file_size),kind=c_char) :: file )\n+  FCKIT_ALLOCATE_CHARACTER(file,file_size)\n   file = c_ptr_to_string(file_c_ptr)\n   call c_ptr_free(file_c_ptr)\n end function\n@@ -269,7 +269,7 @@ function location_function() result(function)\n   integer(c_int32_t) :: error_code\n \n   error_code = fckit__exception_function(function_c_ptr,function_size)\n-  allocate( character(len=(function_size),kind=c_char) :: function )\n+  FCKIT_ALLOCATE_CHARACTER(function,function_size)\n   function = c_ptr_to_string(function_c_ptr)\n   call c_ptr_free(function_c_ptr)\n end function\n@@ -290,7 +290,7 @@ function callstack()\n   integer(c_int32_t) :: error_code\n \n   error_code = fckit__exception_callstack(callstack_c_ptr,callstack_size)\n-  allocate( character(len=(callstack_size),kind=c_char) :: callstack )\n+  FCKIT_ALLOCATE_CHARACTER(callstack,callstack_size)\n   callstack = c_ptr_to_string(callstack_c_ptr)\n   call c_ptr_free(callstack_c_ptr)\n end function\ndiff --git a/src/fckit/module/fckit_main.F90 b/src/fckit/module/fckit_main.F90\nindex 3919ec3..e77bcb4 100644\n--- a/src/fckit/module/fckit_main.F90\n+++ b/src/fckit/module/fckit_main.F90\n@@ -208,7 +208,7 @@ subroutine main_name(name)\n   integer(c_size_t) :: name_size\n   integer(c_int32_t) :: error_code\n   error_code = fckit__main_name(name_c_ptr,name_size)\n-  allocate( character(len=(name_size),kind=c_char) :: name )\n+  FCKIT_ALLOCATE_CHARACTER(name,name_size)\n   name = c_ptr_to_string(name_c_ptr)\n   call c_ptr_free(name_c_ptr)\n end subroutine\n@@ -222,7 +222,7 @@ subroutine displayname(name)\n   integer(c_size_t) :: name_size\n   integer(c_int32_t) :: error_code\n   error_code = fckit__main_displayname(name_c_ptr,name_size)\n-  allocate( character(len=(name_size),kind=c_char) :: name )\n+  FCKIT_ALLOCATE_CHARACTER(name,name_size)\n   name = c_ptr_to_string(name_c_ptr)\n   call c_ptr_free(name_c_ptr)\n end subroutine\ndiff --git a/src/fckit/module/fckit_mpi.fypp b/src/fckit/module/fckit_mpi.fypp\nindex c6a862a..462acb4 100644\n--- a/src/fckit/module/fckit_mpi.fypp\n+++ b/src/fckit/module/fckit_mpi.fypp\n@@ -688,7 +688,7 @@ end function\n subroutine delete(this)\n   use fckit_c_interop_module\n   class(fckit_mpi_comm), intent(inout) :: this\n-  call fckit__mpi__comm_delete(this%c_ptr())\n+  call fckit__mpi__comm_delete(this%CPTR_PGIBUG_A)\n   call this%reset_c_ptr()\n end subroutine\n \n@@ -703,7 +703,7 @@ function split( this, colour, name )\n   integer(c_int32_t), intent(in) :: colour\n   character(len=*) :: name\n   call split%reset_c_ptr( &\n-      & fckit__mpi__comm_split( this%c_ptr(), colour, c_str(name) ) )\n+      & fckit__mpi__comm_split( this%CPTR_PGIBUG_A, colour, c_str(name) ) )\n   call split%return()\n end function\n \n@@ -716,7 +716,7 @@ function name(this)\n   character(len=:), allocatable :: name\n   type(c_ptr) :: name_c_ptr\n   integer(c_int32_t) :: name_size\n-  call fckit__mpi__comm_name( this%c_ptr(), name_c_ptr, name_size )\n+  call fckit__mpi__comm_name( this%CPTR_PGIBUG_A, name_c_ptr, name_size )\n   allocate(character(len=name_size) :: name )\n   name = c_ptr_to_string(name_c_ptr)\n   call c_ptr_free(name_c_ptr)\n@@ -726,7 +726,7 @@ end function\n \n subroutine set_default(this)\n   class(fckit_mpi_comm), intent(inout) :: this\n-  call fckit__mpi__comm_set_default( this%c_ptr() )\n+  call fckit__mpi__comm_set_default( this%CPTR_PGIBUG_A )\n end subroutine\n \n !---------------------------------------------------------------------------------------\n@@ -735,7 +735,7 @@ function communicator(this)\n   use, intrinsic :: iso_c_binding, only : c_int32_t\n   integer(c_int32_t) :: communicator\n   class(fckit_mpi_comm), intent(in) :: this\n-  communicator = fckit__mpi__comm_communicator(this%c_ptr())\n+  communicator = fckit__mpi__comm_communicator(this%CPTR_PGIBUG_A)\n end function\n \n !---------------------------------------------------------------------------------------\n@@ -744,7 +744,7 @@ function fckit_mpi__rank(this) result(rank)\n   use, intrinsic :: iso_c_binding, only : c_int32_t\n   integer(c_int32_t) :: rank\n   class(fckit_mpi_comm), intent(in) :: this\n-  rank = fckit__mpi__rank(this%c_ptr())\n+  rank = fckit__mpi__rank(this%CPTR_PGIBUG_A)\n end function\n \n !---------------------------------------------------------------------------------------\n@@ -753,7 +753,7 @@ function fckit_mpi__size(this) result(size)\n   use, intrinsic :: iso_c_binding, only : c_int32_t\n   integer(c_int32_t) :: size\n   class(fckit_mpi_comm), intent(in) :: this\n-  size = fckit__mpi__size(this%c_ptr())\n+  size = fckit__mpi__size(this%CPTR_PGIBUG_A)\n end function\n \n !---------------------------------------------------------------------------------------\n@@ -762,7 +762,7 @@ function anytag(this)\n   use, intrinsic :: iso_c_binding, only : c_int32_t\n   integer(c_int32_t) :: anytag\n   class(fckit_mpi_comm), intent(in) :: this\n-  anytag = fckit__mpi__anytag(this%c_ptr())\n+  anytag = fckit__mpi__anytag(this%CPTR_PGIBUG_A)\n end function\n \n !---------------------------------------------------------------------------------------\n@@ -771,14 +771,14 @@ function anysource(this)\n   use, intrinsic :: iso_c_binding, only : c_int32_t\n   integer(c_int32_t) :: anysource\n   class(fckit_mpi_comm), intent(in) :: this\n-  anysource = fckit__mpi__anysource(this%c_ptr())\n+  anysource = fckit__mpi__anysource(this%CPTR_PGIBUG_A)\n end function\n \n !---------------------------------------------------------------------------------------\n \n subroutine barrier(this)\n   class(fckit_mpi_comm), intent(in) :: this\n-  call fckit__mpi__barrier(this%c_ptr())\n+  call fckit__mpi__barrier(this%CPTR_PGIBUG_A)\n end subroutine\n \n !---------------------------------------------------------------------------------------\n@@ -788,9 +788,9 @@ subroutine fckit_mpi__abort(this,error_code)\n   class(fckit_mpi_comm), intent(in) :: this\n   integer(c_int32_t), intent(in), optional :: error_code\n   if( present(error_code) ) then\n-    call fckit__mpi__abort(this%c_ptr(),error_code)\n+    call fckit__mpi__abort(this%CPTR_PGIBUG_A,error_code)\n   else\n-    call fckit__mpi__abort(this%c_ptr(),-1)\n+    call fckit__mpi__abort(this%CPTR_PGIBUG_A,-1)\n   endif\n end subroutine\n \n@@ -811,7 +811,7 @@ subroutine allgather_${dtype}$_r0(this,in,out)\n   ${btype}$ :: mold\n   view_in => array_view1d(in,mold)\n   view_out => array_view1d(out,mold)\n-  call fckit__mpi__allgather_${dtype}$(this%c_ptr(),view_in(1),view_out)\n+  call fckit__mpi__allgather_${dtype}$(this%CPTR_PGIBUG_A,view_in(1),view_out)\n end subroutine\n \n !---------------------------------------------------------------------------------------\n@@ -885,7 +885,7 @@ subroutine allgather_${dtype}$_r${rank}$(this,in,out,sendcount)\n   view_out => array_view1d(out,mold)\n   view_rc => array_view1d(recvcounts)\n   view_dp => array_view1d(displs)\n-  call fckit__mpi__allgatherv_${dtype}$(this%c_ptr(),view_in,view_out,int(sendcount,c_size_t),view_rc,view_dp)\n+  call fckit__mpi__allgatherv_${dtype}$(this%CPTR_PGIBUG_A,view_in,view_out,int(sendcount,c_size_t),view_rc,view_dp)\n   deallocate(recvcounts,displs)\n end subroutine\n \n@@ -907,7 +907,7 @@ subroutine allgatherv_${dtype}$_r${rank}$(this,in,out,sendcount,recvcounts,displ\n   view_out => array_view1d(out,mold)\n   view_rc => array_view1d(recvcounts)\n   view_dp => array_view1d(displs)\n-  call fckit__mpi__allgatherv_${dtype}$(this%c_ptr(),view_in,view_out,int(sendcount,c_size_t),view_rc,view_dp)\n+  call fckit__mpi__allgatherv_${dtype}$(this%CPTR_PGIBUG_A,view_in,view_out,int(sendcount,c_size_t),view_rc,view_dp)\n end subroutine\n \n !---------------------------------------------------------------------------------------\n@@ -916,10 +916,10 @@ subroutine alltoallv_${dtype}$_r${rank}$(this,in,scounts,sdispl,out,rcounts,rdis\n   use, intrinsic :: iso_c_binding\n   use fckit_array_module, only: array_view1d\n   class(fckit_mpi_comm), intent(in) :: this\n-  ${ftype}$, intent(in), target :: in${dim[rank]}$\n-  integer(c_int32_t), intent(in), target :: scounts(:), sdispl(:)\n-  ${ftype}$, intent(inout), target :: out${dim[rank]}$\n-  integer(c_int32_t), intent(in), target :: rcounts(:), rdispl(:)\n+  ${ftype}$, intent(in) :: in${dim[rank]}$\n+  integer(c_int32_t), intent(in) :: scounts(:), sdispl(:)\n+  ${ftype}$, intent(inout) :: out${dim[rank]}$\n+  integer(c_int32_t), intent(in) :: rcounts(:), rdispl(:)\n   ${btype}$, pointer :: view_in(:), view_out(:)\n   ${btype}$ :: mold\n   integer(c_int32_t), pointer :: view_sc(:), view_sd(:)\n@@ -930,7 +930,7 @@ subroutine alltoallv_${dtype}$_r${rank}$(this,in,scounts,sdispl,out,rcounts,rdis\n   view_sd => array_view1d(sdispl)\n   view_rc => array_view1d(rcounts)\n   view_rd => array_view1d(rdispl)\n-  call fckit__mpi__alltoallv_${dtype}$(this%c_ptr(),view_in,view_sc,view_sd,view_out,view_rc,view_rd)\n+  call fckit__mpi__alltoallv_${dtype}$(this%CPTR_PGIBUG_A,view_in,view_sc,view_sd,view_out,view_rc,view_rd)\n end subroutine\n \n !---------------------------------------------------------------------------------------\n@@ -963,7 +963,7 @@ subroutine broadcast_string(this,buffer,root)\n      enddo\n      c_string(len(buffer)+1) = c_null_char\n   endif\n-  call fckit__mpi__broadcast_string(this%c_ptr(),c_string,int(len(buffer)+1,c_size_t),int(root,c_size_t))\n+  call fckit__mpi__broadcast_string(this%CPTR_PGIBUG_A,c_string,int(len(buffer)+1,c_size_t),int(root,c_size_t))\n   do j=1,len(buffer)\n      buffer(j:j) = c_string(j)\n   enddo\n@@ -987,7 +987,7 @@ function broadcast_file(this,path,root) result(buffer)\n   integer(c_int32_t), intent(in) :: root\n     !! MPI rank that reads and broadcasts file\n \n-  buffer = fckit_buffer( fckit__mpi__broadcast_file(this%c_ptr(),c_str(path),int(root,c_size_t)), share=.true. )\n+  buffer = fckit_buffer( fckit__mpi__broadcast_file(this%CPTR_PGIBUG_A,c_str(path),int(root,c_size_t)), share=.true. )\n   call buffer%return()\n end function\n \n@@ -1017,7 +1017,7 @@ subroutine allreduce_${dtype}$_r${rank}$(this,in,out,operation)\n   ${btype}$ :: mold\n   view_in  => array_view1d(in,mold)\n   view_out => array_view1d(out,mold)\n-  call fckit__mpi__allreduce_${dtype}$(this%c_ptr(),view_in,view_out, &\n+  call fckit__mpi__allreduce_${dtype}$(this%CPTR_PGIBUG_A,view_in,view_out, &\n     int(ubound(view_in,1),c_size_t),operation)\n end subroutine\n \n@@ -1039,7 +1039,7 @@ subroutine allreduce_inplace_${dtype}$_r${rank}$(this,inout,operation)\n   ${btype}$, pointer :: view_inout(:)\n   ${btype}$ :: mold\n   view_inout => array_view1d(inout,mold)\n-  call fckit__mpi__allreduce_inplace_${dtype}$(this%c_ptr(),view_inout, &\n+  call fckit__mpi__allreduce_inplace_${dtype}$(this%CPTR_PGIBUG_A,view_inout, &\n     int(ubound(view_inout,1),c_size_t),operation)\n end subroutine\n \n@@ -1061,7 +1061,7 @@ subroutine broadcast_${dtype}$_r${rank}$(this,buffer,root)\n   ${btype}$, pointer :: view_buffer(:)\n   ${btype}$ :: mold\n   view_buffer  => array_view1d(buffer,mold)\n-  call fckit__mpi__broadcast_${dtype}$(this%c_ptr(),view_buffer, &\n+  call fckit__mpi__broadcast_${dtype}$(this%CPTR_PGIBUG_A,view_buffer, &\n     int(ubound(view_buffer,1),c_size_t),int(root,c_size_t))\n end subroutine\n \n@@ -1085,7 +1085,7 @@ subroutine send_${dtype}$_r${rank}$(this,buffer,dest,tag)\n   ${btype}$, pointer :: view_buffer(:)\n   ${btype}$ :: mold\n   view_buffer  => array_view1d(buffer,mold)\n-  call fckit__mpi__send_${dtype}$(this%c_ptr(),view_buffer, &\n+  call fckit__mpi__send_${dtype}$(this%CPTR_PGIBUG_A,view_buffer, &\n     int(ubound(view_buffer,1),c_size_t),dest,tag)\n end subroutine\n \n@@ -1115,10 +1115,10 @@ subroutine receive_${dtype}$_r${rank}$(this,buffer,source,tag,status)\n   if( present(tag) ) then\n     tag_opt = tag\n   else\n-    tag_opt = fckit__mpi__anytag(this%c_ptr())\n+    tag_opt = fckit__mpi__anytag(this%CPTR_PGIBUG_A)\n   endif\n   view_buffer  => array_view1d(buffer,mold)\n-  call fckit__mpi__receive_${dtype}$(this%c_ptr(),view_buffer, &\n+  call fckit__mpi__receive_${dtype}$(this%CPTR_PGIBUG_A,view_buffer, &\n     int(ubound(view_buffer,1),c_size_t),source,tag_opt,status_out%status)\n   if( present(status) ) status = status_out\n end subroutine\n@@ -1146,7 +1146,7 @@ function isend_${dtype}$_r${rank}$(this,buffer,dest,tag) result(request)\n   ${btype}$, pointer :: view_buffer(:)\n   ${btype}$ :: mold\n   view_buffer  => array_view1d(buffer,mold)\n-  request = fckit__mpi__isend_${dtype}$(this%c_ptr(),view_buffer, &\n+  request = fckit__mpi__isend_${dtype}$(this%CPTR_PGIBUG_A,view_buffer, &\n     int(ubound(view_buffer,1),c_size_t),dest,tag)\n end function\n \n@@ -1176,10 +1176,10 @@ function ireceive_${dtype}$_r${rank}$(this,buffer,source,tag) result(request)\n   if( present(tag) ) then\n     tag_opt = tag\n   else\n-    tag_opt = fckit__mpi__anytag(this%c_ptr())\n+    tag_opt = fckit__mpi__anytag(this%CPTR_PGIBUG_A)\n   endif\n   view_buffer  => array_view1d(buffer,mold)\n-  request = fckit__mpi__ireceive_${dtype}$(this%c_ptr(),view_buffer, &\n+  request = fckit__mpi__ireceive_${dtype}$(this%CPTR_PGIBUG_A,view_buffer, &\n     int(ubound(view_buffer,1),c_size_t),source,tag_opt)\n end function\n \n@@ -1203,7 +1203,7 @@ subroutine wait(this,request,status)\n     !! MPI status\n \n   type(fckit_mpi_status) :: status_out\n-  call fckit__mpi__wait(this%c_ptr(),request,status_out%status)\n+  call fckit__mpi__wait(this%CPTR_PGIBUG_A,request,status_out%status)\n   if( present(status) ) status = status_out\n end subroutine\n \ndiff --git a/src/fckit/module/fckit_object.F90 b/src/fckit/module/fckit_object.F90\nindex cf2d3f1..944e454 100644\n--- a/src/fckit/module/fckit_object.F90\n+++ b/src/fckit/module/fckit_object.F90\n@@ -27,7 +27,11 @@ public fckit_object\n type, extends(fckit_final) :: fckit_object\n   !! Abstract base class for objects that wrap a C++ object\n \n+#if !PGIBUG_ATLAS_197\n   type(c_ptr), private :: cpp_object_ptr = c_null_ptr\n+#else\n+  type(c_ptr), public :: cpp_object_ptr = c_null_ptr\n+#endif\n \n   type(c_funptr), private :: deleter = c_null_funptr\n     !! Internal C pointer\n@@ -39,8 +43,10 @@ contains\n   procedure, public :: is_null\n     !! Check if internal C pointer is set\n \n+#if !PGIBUG_ATLAS_197\n   procedure, public :: c_ptr   => fckit_object__c_ptr\n     !! Access to internal C pointer\n+#endif\n \n   procedure, public :: reset_c_ptr\n     !! Nullify internal C pointer\ndiff --git a/src/fckit/module/fckit_owned_object.F90 b/src/fckit/module/fckit_owned_object.F90\nindex 9885240..028cedb 100644\n--- a/src/fckit/module/fckit_owned_object.F90\n+++ b/src/fckit/module/fckit_owned_object.F90\n@@ -35,7 +35,11 @@ public fckit_owned_object\n type :: fckit_owned_object\n   !! Abstract base class for objects that wrap a C++ object\n \n+#if !PGIBUG_ATLAS_197\n   type(c_ptr), private :: cpp_object_ptr = c_null_ptr\n+#else\n+  type(c_ptr), public :: cpp_object_ptr = c_null_ptr\n+#endif\n   type(c_funptr), private :: deleter = c_null_funptr\n     !! Internal C pointer\n \n@@ -46,8 +50,10 @@ contains\n   procedure, public :: is_null\n     !! Check if internal C pointer is set\n \n+#if !PGIBUG_ATLAS_197_DEBUG\n   procedure, public :: c_ptr   => fckit_owned_object__c_ptr\n     !! Access to internal C pointer\n+#endif\n \n   procedure, public :: reset_c_ptr\n     !! Nullify internal C pointer\ndiff --git a/src/fckit/module/fckit_pathname.F90 b/src/fckit/module/fckit_pathname.F90\nindex d1122d6..b728330 100644\n--- a/src/fckit/module/fckit_pathname.F90\n+++ b/src/fckit/module/fckit_pathname.F90\n@@ -56,7 +56,7 @@ function fckit_pathname__str(this) result(str)\n   class(fckit_pathname) :: this\n   integer(c_int32_t) :: i, nchars\n   nchars = size(this%string)\n-  allocate( character(len=(nchars),kind=c_char) :: str )\n+  FCKIT_ALLOCATE_CHARACTER(str,nchars)\n   do i=1,nchars\n     str(i:i) = this%string(i)\n   enddo\ndiff --git a/src/fckit/module/fckit_refcount.F90 b/src/fckit/module/fckit_refcount.F90\nindex 235609c..33190e5 100644\n--- a/src/fckit/module/fckit_refcount.F90\n+++ b/src/fckit/module/fckit_refcount.F90\n@@ -128,7 +128,7 @@ subroutine allocate_fckit_refcount_owned(refcount,shared_ptr)\n   allocate( fckit_refcount_owned::refcount )\n   select type( shared_ptr )\n     class is( fckit_object )\n-      cptr = shared_ptr%c_ptr()\n+      cptr = shared_ptr%CPTR_PGIBUG_A\n   end select\n   select type( refcount )\n     class is( fckit_refcount_owned )\ndiff --git a/src/fckit/module/fckit_resource.F90 b/src/fckit/module/fckit_resource.F90\nindex efe8bda..c9dde43 100644\n--- a/src/fckit/module/fckit_resource.F90\n+++ b/src/fckit/module/fckit_resource.F90\n@@ -138,7 +138,7 @@ subroutine resource_get_string(resource_str,default_value,value)\n   integer(c_size_t) :: value_size\n   integer(c_int32_t) :: error_code\n   error_code = fckit__resource_string(c_str(resource_str),c_str(default_value),value_c_ptr,value_size)\n-  allocate( character(len=(value_size),kind=c_char) :: value )\n+  FCKIT_ALLOCATE_CHARACTER(value,value_size)\n   value = c_ptr_to_string(value_c_ptr)\n   call c_ptr_free(value_c_ptr)\n end subroutine\ndiff --git a/src/fckit/module/fckit_shared_object.F90 b/src/fckit/module/fckit_shared_object.F90\nindex 5d32018..7ae7e1f 100644\n--- a/src/fckit/module/fckit_shared_object.F90\n+++ b/src/fckit/module/fckit_shared_object.F90\n@@ -46,7 +46,9 @@ contains\n \n   procedure, public :: reset_c_ptr\n \n+#if !PGIBUG_ATLAS_197_DEBUG\n   procedure, public  :: c_ptr => fckit_shared_object_c_ptr\n+#endif\n \n   procedure, private :: fckit_shared_object_c_ptr\n \n@@ -143,7 +145,7 @@ function fckit_shared_object_c_ptr(this) result(cptr)\n   use, intrinsic :: iso_c_binding, only : c_ptr\n   type(c_ptr) :: cptr\n   class(fckit_shared_object) :: this\n-  cptr = this%shared_object_%c_ptr()\n+  cptr = this%shared_object_%CPTR_PGIBUG_A\n end function\n \n end module\ndiff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt\nindex f23b465..7a676c6 100644\n--- a/src/tests/CMakeLists.txt\n+++ b/src/tests/CMakeLists.txt\n@@ -155,11 +155,8 @@ foreach( _test ${FCKIT_QUARANTAINED_TESTS} )\n endforeach()\n \n ### Test downstream find_package(fckit) projects\n-add_subdirectory( test_downstream_fctest )\n add_subdirectory( test_downstream_fypp )\n-add_subdirectory( test_downstream_fypp_list_options )\n-add_subdirectory( test_downstream_fypp_ordering )\n-add_subdirectory( test_downstream_fypp_output_sources )\n+add_subdirectory( test_downstream_fctest )\n \n ### Test fckit_yaml_reader\n if( HAVE_FCKIT_VENV )\ndiff --git a/src/tests/test_downstream_fctest/test-downstream.sh.in b/src/tests/test_downstream_fctest/test-downstream.sh.in\nindex 21af3b9..63deb8a 100755\n--- a/src/tests/test_downstream_fctest/test-downstream.sh.in\n+++ b/src/tests/test_downstream_fctest/test-downstream.sh.in\n@@ -29,7 +29,6 @@ set -x\n rm -rf $BUILD\n \n export fckit_DIR=@PROJECT_BINARY_DIR@\n-export eckit_DIR=@eckit_DIR@\n export ecbuild_DIR=@ecbuild_DIR@\n \n # Build\ndiff --git a/src/tests/test_downstream_fypp/downstream/CMakeLists.txt b/src/tests/test_downstream_fypp/downstream/CMakeLists.txt\nindex 3d15969..3f71038 100644\n--- a/src/tests/test_downstream_fypp/downstream/CMakeLists.txt\n+++ b/src/tests/test_downstream_fypp/downstream/CMakeLists.txt\n@@ -12,12 +12,6 @@ ecbuild_add_library(\n     SOURCES downstream.fypp downstream_override.fypp\n     PUBLIC_LIBS fckit\n     DEFINITIONS _POSIX_C_SOURCE=200809L exclude_from_fypp)\n-\n-set( _fypp_args FYPP_ARGS_EXCLUDE \"exclude_from_fypp\" )\n-if( DEFINED DOWNSTREAM_FYPP_OUTPUT_SUFFIX )\n-  list( APPEND _fypp_args OUTPUT_SUFFIX \"${DOWNSTREAM_FYPP_OUTPUT_SUFFIX}\" )\n-endif()\n-\n-fckit_target_preprocess_fypp( downstream ${_fypp_args} )\n+fckit_target_preprocess_fypp( downstream FYPP_ARGS_EXCLUDE \"exclude_from_fypp\" )\n \n ecbuild_add_executable( TARGET main SOURCES main.F90 LIBS fckit downstream )\ndiff --git a/src/tests/test_downstream_fypp/test-downstream.sh.in b/src/tests/test_downstream_fypp/test-downstream.sh.in\nindex e5c713d..3a1c30b 100755\n--- a/src/tests/test_downstream_fypp/test-downstream.sh.in\n+++ b/src/tests/test_downstream_fypp/test-downstream.sh.in\n@@ -8,7 +8,7 @@\n #   test-individual.sh [CMAKE_ARGUMENTS]\n \n SOURCE=@CMAKE_CURRENT_SOURCE_DIR@/downstream\n-BUILD_ROOT=@CMAKE_CURRENT_BINARY_DIR@\n+BUILD=@CMAKE_CURRENT_BINARY_DIR@/downstream\n \n # Error handling\n function test_failed {\n@@ -25,49 +25,23 @@ trap test_failed EXIT\n set -e -o pipefail\n set -x\n \n+# Start with clean build\n+rm -rf $BUILD\n+\n export fckit_DIR=@PROJECT_BINARY_DIR@\n-export eckit_DIR=@eckit_DIR@\n export ecbuild_DIR=@ecbuild_DIR@\n \n-COMMON_CMAKE_ARGS=(\n-  -DCMAKE_BUILD_TYPE=RelWithDebInfo\n-  -DECBUILD_2_COMPAT=OFF\n-  -DECBUILD_COMPILE_FLAGS=@CMAKE_CURRENT_SOURCE_DIR@/compile_flags.cmake\n+# Build\n+mkdir -p $BUILD && cd $BUILD\n+cmake $SOURCE \\\n+  -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\n+  -DECBUILD_2_COMPAT=OFF \\\n+  -DECBUILD_COMPILE_FLAGS=@CMAKE_CURRENT_SOURCE_DIR@/compile_flags.cmake \\\n   \"$@\"\n-)\n-\n-function build_and_check {\n-  local variant=$1\n-  local output_suffix=$2\n-  local build_dir=${BUILD_ROOT}/downstream_${variant}\n-\n-  rm -rf \"$build_dir\"\n-  mkdir -p \"$build_dir\"\n-  cd \"$build_dir\"\n-\n-  local cmake_args=(\"${COMMON_CMAKE_ARGS[@]}\")\n-  if [ -n \"$output_suffix\" ]; then\n-    cmake_args+=(\"-DDOWNSTREAM_FYPP_OUTPUT_SUFFIX=${output_suffix}\")\n-  fi\n \n-  cmake \"$SOURCE\" \"${cmake_args[@]}\"\n-  make VERBOSE=1\n-\n-  if [ -n \"$output_suffix\" ]; then\n-    test -f \"downstream${output_suffix}.F90\"\n-    test -f \"downstream_override${output_suffix}.F90\"\n-    test ! -e \"downstream.F90\"\n-    test ! -e \"downstream_override.F90\"\n-  else\n-    test -f \"downstream.F90\"\n-    test -f \"downstream_override.F90\"\n-  fi\n-\n-  bin/main\n-}\n+make VERBOSE=1\n \n-build_and_check default \"\"\n-build_and_check suffixed \"_custom\"\n+bin/main\n \n { set +ex; } 2>/dev/null\n echo \"+++++++++++++++++\"\ndiff --git a/src/tests/test_downstream_fypp_list_options/CMakeLists.txt b/src/tests/test_downstream_fypp_list_options/CMakeLists.txt\ndeleted file mode 100644\nindex 454d33f..0000000\n--- a/src/tests/test_downstream_fypp_list_options/CMakeLists.txt\n+++ /dev/null\n@@ -1,28 +0,0 @@\n-\n-# This test configures a downstream package that calls fckit_preprocess_fypp_sources\n-# with a list-valued COMPILE_OPTIONS property set on an fypp source file.\n-#\n-# Test created in response to a bug where source file properties were being\n-# expanded unquoted, resulting in a CMake configuration error.\n-\n-if( HAVE_TESTS )\n-\n-  configure_file( test-downstream.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test-downstream.sh @ONLY )\n-\n-  unset( _test_args )\n-  if( CMAKE_TOOLCHAIN_FILE )\n-    if( NOT IS_ABSOLUTE ${CMAKE_TOOLCHAIN_FILE})\n-      set( CMAKE_TOOLCHAIN_FILE \"${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}\" )\n-    endif()\n-    list( APPEND _test_args \"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}\" )\n-  endif()\n-  foreach( lang C CXX Fortran )\n-    if( CMAKE_${lang}_COMPILER )\n-      list( APPEND _test_args \"-DCMAKE_${lang}_COMPILER=${CMAKE_${lang}_COMPILER}\" )\n-    endif()\n-  endforeach()\n-\n-  add_test( NAME fckit_test_downstream_fypp_list_options\n-            COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-downstream.sh ${_test_args} )\n-\n-endif()\ndiff --git a/src/tests/test_downstream_fypp_list_options/downstream/CMakeLists.txt b/src/tests/test_downstream_fypp_list_options/downstream/CMakeLists.txt\ndeleted file mode 100644\nindex 79c287e..0000000\n--- a/src/tests/test_downstream_fypp_list_options/downstream/CMakeLists.txt\n+++ /dev/null\n@@ -1,15 +0,0 @@\n-cmake_minimum_required( VERSION 3.12 FATAL_ERROR )\n-\n-find_package( ecbuild REQUIRED )\n-\n-project( downstream_fypp_list_options VERSION 0.1.0 LANGUAGES Fortran )\n-\n-find_package( fckit REQUIRED )\n-\n-# Set COMPILE_OPTIONS to a multi-element CMake list:\n-set_source_files_properties( test_source.fypp\n-    PROPERTIES COMPILE_OPTIONS \"-DFOO;-DBAR\" )\n-\n-unset( _output_sources )\n-fckit_preprocess_fypp_sources( _output_sources\n-    SOURCES test_source.fypp )\ndiff --git a/src/tests/test_downstream_fypp_list_options/downstream/test_source.fypp b/src/tests/test_downstream_fypp_list_options/downstream/test_source.fypp\ndeleted file mode 100644\nindex b75b686..0000000\n--- a/src/tests/test_downstream_fypp_list_options/downstream/test_source.fypp\n+++ /dev/null\n@@ -1,10 +0,0 @@\n-! Minimal fypp source used by test_downstream_fypp_list_options.\n-! This file is not built; it exists only so that fckit_preprocess_fypp_sources\n-! has a real source path to register in add_custom_command.\n-module test_source\n-implicit none\n-contains\n-subroutine hello()\n-  write(0,*) \"hello\"\n-end subroutine\n-end module\ndiff --git a/src/tests/test_downstream_fypp_list_options/test-downstream.sh.in b/src/tests/test_downstream_fypp_list_options/test-downstream.sh.in\ndeleted file mode 100755\nindex 8e170fb..0000000\n--- a/src/tests/test_downstream_fypp_list_options/test-downstream.sh.in\n+++ /dev/null\n@@ -1,47 +0,0 @@\n-#!/usr/bin/env bash\n-\n-# Description:\n-#   Configure a downstream project that calls fckit_preprocess_fypp_sources\n-#   with a list-valued COMPILE_OPTIONS property on a fypp source file.\n-#\n-# Usage:\n-#   test-downstream.sh [CMAKE_ARGUMENTS]\n-\n-SOURCE=@CMAKE_CURRENT_SOURCE_DIR@/downstream\n-BUILD_ROOT=@CMAKE_CURRENT_BINARY_DIR@\n-\n-function test_failed {\n-  EXIT_CODE=$?\n-  { set +ex; } 2>/dev/null\n-  if [ $EXIT_CODE -ne 0 ]; then\n-    echo \"+++++++++++++++++\"\n-    echo \"Test failed\"\n-    echo \"+++++++++++++++++\"\n-  fi\n-  exit $EXIT_CODE\n-}\n-trap test_failed EXIT\n-set -e -o pipefail\n-set -x\n-\n-export fckit_DIR=@PROJECT_BINARY_DIR@\n-export eckit_DIR=@eckit_DIR@\n-export ecbuild_DIR=@ecbuild_DIR@\n-\n-COMMON_CMAKE_ARGS=(\n-  -DCMAKE_BUILD_TYPE=RelWithDebInfo\n-  -DECBUILD_2_COMPAT=OFF\n-  \"$@\"\n-)\n-\n-build_dir=${BUILD_ROOT}/downstream\n-rm -rf \"$build_dir\"\n-mkdir -p \"$build_dir\"\n-cd \"$build_dir\"\n-\n-cmake \"$SOURCE\" \"${COMMON_CMAKE_ARGS[@]}\"\n-\n-{ set +ex; } 2>/dev/null\n-echo \"+++++++++++++++++\"\n-echo \"Test passed\"\n-echo \"+++++++++++++++++\"\ndiff --git a/src/tests/test_downstream_fypp_ordering/CMakeLists.txt b/src/tests/test_downstream_fypp_ordering/CMakeLists.txt\ndeleted file mode 100644\nindex c60695c..0000000\n--- a/src/tests/test_downstream_fypp_ordering/CMakeLists.txt\n+++ /dev/null\n@@ -1,31 +0,0 @@\n-#\n-# This test builds a package that requires fypp processing\n-# It verifies the target-ordering behaviour and NO_TARGET_DEPENDS option.\n-#\n-# Test created alongside addition of the target ordering functionality.\n-\n-if( HAVE_TESTS )\n-\n-  configure_file( test-downstream.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test-downstream.sh @ONLY )\n-\n-  unset( _test_args )\n-  if( CMAKE_TOOLCHAIN_FILE )\n-    if( NOT IS_ABSOLUTE ${CMAKE_TOOLCHAIN_FILE} )\n-      set( CMAKE_TOOLCHAIN_FILE \"${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}\" )\n-    endif()\n-    list( APPEND _test_args \"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}\" )\n-  endif()\n-  foreach( lang C CXX Fortran )\n-    if( CMAKE_${lang}_COMPILER )\n-      list( APPEND _test_args \"-DCMAKE_${lang}_COMPILER=${CMAKE_${lang}_COMPILER}\" )\n-    endif()\n-    if( CMAKE_${lang}_FLAGS )\n-      string(REPLACE \"--coverage\" \"\" CMAKE_${lang}_FLAGS \"${CMAKE_${lang}_FLAGS}\")\n-      list( APPEND _test_args \"-DECBUILD_${lang}_FLAGS=${CMAKE_${lang}_FLAGS}\" )\n-    endif()\n-  endforeach()\n-\n-  add_test( NAME fckit_test_downstream_fypp_ordering\n-            COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-downstream.sh ${_test_args} )\n-\n-endif()\ndiff --git a/src/tests/test_downstream_fypp_ordering/downstream/CMakeLists.txt b/src/tests/test_downstream_fypp_ordering/downstream/CMakeLists.txt\ndeleted file mode 100644\nindex 4e3f296..0000000\n--- a/src/tests/test_downstream_fypp_ordering/downstream/CMakeLists.txt\n+++ /dev/null\n@@ -1,54 +0,0 @@\n-cmake_minimum_required( VERSION 3.12 FATAL_ERROR )\n-\n-find_package( ecbuild REQUIRED )\n-\n-project( downstream_ordering VERSION 0.1.0 LANGUAGES Fortran )\n-\n-find_package( fckit REQUIRED )\n-\n-\n-# --- Library with ordering dependency (default behaviour) ---\n-#\n-# fckit_target_preprocess_fypp should create a 'libwithorder_fypp_order'\n-# custom target and add it as a build dependency of 'libwithorder'.\n-\n-ecbuild_add_library(\n-    TARGET libwithorder\n-    SOURCES module_a.fypp )\n-\n-fckit_target_preprocess_fypp( libwithorder )\n-\n-# Verify ordering target was created.\n-if( NOT TARGET libwithorder_fypp_order )\n-  message( FATAL_ERROR\n-    \"fckit_target_preprocess_fypp did not create the expected \"\n-    \"'libwithorder_fypp_order' ordering target.\" )\n-endif()\n-get_target_property( _libwithorder_deps libwithorder MANUALLY_ADDED_DEPENDENCIES )\n-if( NOT \"libwithorder_fypp_order\" IN_LIST _libwithorder_deps )\n-  message( FATAL_ERROR\n-    \"fckit_target_preprocess_fypp did not add 'libwithorder_fypp_order' as a \"\n-    \"dependency of the 'libwithorder' target.\" )\n-endif()\n-\n-\n-# --- Library with NO_TARGET_DEPENDS (ordering dependency suppressed) ---\n-#\n-# When NO_TARGET_DEPENDS is passed, fckit_target_preprocess_fypp must not\n-# create an ordering target.\n-\n-ecbuild_add_library(\n-    TARGET libnodep\n-    SOURCES module_b.fypp )\n-\n-fckit_target_preprocess_fypp( libnodep NO_TARGET_DEPENDS )\n-\n-# Verify ordering target was NOT created.\n-if( TARGET libnodep_fypp_order )\n-  message( FATAL_ERROR\n-    \"fckit_target_preprocess_fypp created 'libnodep_fypp_order' despite \"\n-    \"NO_TARGET_DEPENDS being set.\" )\n-endif()\n-\n-\n-ecbuild_add_executable( TARGET main SOURCES main.F90 LIBS libwithorder libnodep )\ndiff --git a/src/tests/test_downstream_fypp_ordering/downstream/main.F90 b/src/tests/test_downstream_fypp_ordering/downstream/main.F90\ndeleted file mode 100644\nindex aee1ef4..0000000\n--- a/src/tests/test_downstream_fypp_ordering/downstream/main.F90\n+++ /dev/null\n@@ -1,9 +0,0 @@\n-program main\n-use module_a_mod\n-use module_b_mod\n-implicit none\n-\n-call greet_from_a()\n-call greet_from_b()\n-\n-end program\ndiff --git a/src/tests/test_downstream_fypp_ordering/downstream/module_a.fypp b/src/tests/test_downstream_fypp_ordering/downstream/module_a.fypp\ndeleted file mode 100644\nindex b4e0b44..0000000\n--- a/src/tests/test_downstream_fypp_ordering/downstream/module_a.fypp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-module module_a_mod\n-implicit none\n-public\n-\n-contains\n-\n-subroutine greet_from_a()\n-  write(*,*) 'Hello from module_a_mod'\n-end subroutine\n-\n-end module\ndiff --git a/src/tests/test_downstream_fypp_ordering/downstream/module_b.fypp b/src/tests/test_downstream_fypp_ordering/downstream/module_b.fypp\ndeleted file mode 100644\nindex 2c58f54..0000000\n--- a/src/tests/test_downstream_fypp_ordering/downstream/module_b.fypp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-module module_b_mod\n-implicit none\n-public\n-\n-contains\n-\n-subroutine greet_from_b()\n-  write(*,*) 'Hello from module_b_mod'\n-end subroutine\n-\n-end module\ndiff --git a/src/tests/test_downstream_fypp_ordering/test-downstream.sh.in b/src/tests/test_downstream_fypp_ordering/test-downstream.sh.in\ndeleted file mode 100755\nindex c611b52..0000000\n--- a/src/tests/test_downstream_fypp_ordering/test-downstream.sh.in\n+++ /dev/null\n@@ -1,53 +0,0 @@\n-#!/usr/bin/env bash\n-\n-# Description:\n-#   Build downstream project verifying fckit_target_preprocess_fypp\n-#   target-ordering and NO_TARGET_DEPENDS behaviour\n-#\n-# Usage:\n-#   test-downstream.sh [CMAKE_ARGUMENTS]\n-\n-SOURCE=@CMAKE_CURRENT_SOURCE_DIR@/downstream\n-BUILD_ROOT=@CMAKE_CURRENT_BINARY_DIR@\n-\n-# Error handling\n-function test_failed {\n-  EXIT_CODE=$?\n-  { set +ex; } 2>/dev/null\n-  if [ $EXIT_CODE -ne 0 ]; then\n-    echo \"+++++++++++++++++\"\n-    echo \"Test failed\"\n-    echo \"+++++++++++++++++\"\n-  fi\n-  exit $EXIT_CODE\n-}\n-trap test_failed EXIT\n-set -e -o pipefail\n-set -x\n-\n-export fckit_DIR=@PROJECT_BINARY_DIR@\n-export eckit_DIR=@eckit_DIR@\n-export ecbuild_DIR=@ecbuild_DIR@\n-\n-BUILD_DIR=${BUILD_ROOT}/downstream_ordering\n-rm -rf \"$BUILD_DIR\"\n-mkdir -p \"$BUILD_DIR\"\n-cd \"$BUILD_DIR\"\n-\n-cmake \"$SOURCE\" \\\n-  -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\n-  -DECBUILD_2_COMPAT=OFF \\\n-  \"$@\"\n-\n-make VERBOSE=1\n-\n-# Verify generated .F90 files exist in the build directory\n-test -f \"module_a.F90\"\n-test -f \"module_b.F90\"\n-\n-bin/main\n-\n-{ set +ex; } 2>/dev/null\n-echo \"+++++++++++++++++\"\n-echo \"Test passed\"\n-echo \"+++++++++++++++++\"\ndiff --git a/src/tests/test_downstream_fypp_output_sources/CMakeLists.txt b/src/tests/test_downstream_fypp_output_sources/CMakeLists.txt\ndeleted file mode 100644\nindex a20c0b0..0000000\n--- a/src/tests/test_downstream_fypp_output_sources/CMakeLists.txt\n+++ /dev/null\n@@ -1,31 +0,0 @@\n-\n-# This test builds a package that requires fypp processing\n-# It verifies that OUTPUT_SOURCES returns the list of generated .F90 file paths.\n-\n-# Test created alongside addition of the new functionality.\n-\n-if( HAVE_TESTS )\n-\n-  configure_file( test-downstream.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test-downstream.sh @ONLY )\n-\n-  unset( _test_args )\n-  if( CMAKE_TOOLCHAIN_FILE )\n-    if( NOT IS_ABSOLUTE ${CMAKE_TOOLCHAIN_FILE} )\n-      set( CMAKE_TOOLCHAIN_FILE \"${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}\" )\n-    endif()\n-    list( APPEND _test_args \"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}\" )\n-  endif()\n-  foreach( lang C CXX Fortran )\n-    if( CMAKE_${lang}_COMPILER )\n-      list( APPEND _test_args \"-DCMAKE_${lang}_COMPILER=${CMAKE_${lang}_COMPILER}\" )\n-    endif()\n-    if( CMAKE_${lang}_FLAGS )\n-      string(REPLACE \"--coverage\" \"\" CMAKE_${lang}_FLAGS \"${CMAKE_${lang}_FLAGS}\")\n-      list( APPEND _test_args \"-DECBUILD_${lang}_FLAGS=${CMAKE_${lang}_FLAGS}\" )\n-    endif()\n-  endforeach()\n-\n-  add_test( NAME fckit_test_downstream_fypp_output_sources\n-            COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-downstream.sh ${_test_args} )\n-\n-endif()\ndiff --git a/src/tests/test_downstream_fypp_output_sources/downstream/CMakeLists.txt b/src/tests/test_downstream_fypp_output_sources/downstream/CMakeLists.txt\ndeleted file mode 100644\nindex 6136625..0000000\n--- a/src/tests/test_downstream_fypp_output_sources/downstream/CMakeLists.txt\n+++ /dev/null\n@@ -1,30 +0,0 @@\n-cmake_minimum_required( VERSION 3.12 FATAL_ERROR )\n-\n-find_package( ecbuild REQUIRED )\n-\n-project( downstream_output_sources VERSION 0.1.0 LANGUAGES Fortran )\n-\n-find_package( fckit REQUIRED )\n-\n-\n-ecbuild_add_library(\n-    TARGET downstream\n-    SOURCES module_a.fypp )\n-\n-fckit_target_preprocess_fypp( downstream OUTPUT_SOURCES _downstream_generated )\n-\n-# Verify OUTPUT_SOURCES: returned list must be non-empty and every entry must be\n-# a generated .F90 path.\n-if( NOT _downstream_generated )\n-  message( FATAL_ERROR\n-    \"fckit_target_preprocess_fypp OUTPUT_SOURCES returned an empty list. \"\n-    \"Expected a generated .F90 file for module_a.fypp.\" )\n-endif()\n-foreach( _gen ${_downstream_generated} )\n-  if( NOT _gen MATCHES \"\\\\.F90$\" )\n-    message( FATAL_ERROR\n-      \"fckit_target_preprocess_fypp OUTPUT_SOURCES entry '${_gen}' does not end in .F90\" )\n-  endif()\n-endforeach()\n-\n-ecbuild_add_executable( TARGET main SOURCES main.F90 LIBS downstream )\ndiff --git a/src/tests/test_downstream_fypp_output_sources/downstream/main.F90 b/src/tests/test_downstream_fypp_output_sources/downstream/main.F90\ndeleted file mode 100644\nindex 593fa44..0000000\n--- a/src/tests/test_downstream_fypp_output_sources/downstream/main.F90\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-program main\n-use module_a_mod\n-implicit none\n-\n-call greet_from_a()\n-\n-end program\ndiff --git a/src/tests/test_downstream_fypp_output_sources/downstream/module_a.fypp b/src/tests/test_downstream_fypp_output_sources/downstream/module_a.fypp\ndeleted file mode 100644\nindex b4e0b44..0000000\n--- a/src/tests/test_downstream_fypp_output_sources/downstream/module_a.fypp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-module module_a_mod\n-implicit none\n-public\n-\n-contains\n-\n-subroutine greet_from_a()\n-  write(*,*) 'Hello from module_a_mod'\n-end subroutine\n-\n-end module\ndiff --git a/src/tests/test_downstream_fypp_output_sources/test-downstream.sh.in b/src/tests/test_downstream_fypp_output_sources/test-downstream.sh.in\ndeleted file mode 100755\nindex 67627f1..0000000\n--- a/src/tests/test_downstream_fypp_output_sources/test-downstream.sh.in\n+++ /dev/null\n@@ -1,51 +0,0 @@\n-#!/usr/bin/env bash\n-\n-# Description:\n-#   Build downstream project verifying fckit_target_preprocess_fypp\n-#   OUTPUT_SOURCES returns the list of generated .F90 file paths\n-#\n-# Usage:\n-#   test-downstream.sh [CMAKE_ARGUMENTS]\n-\n-SOURCE=@CMAKE_CURRENT_SOURCE_DIR@/downstream\n-BUILD_ROOT=@CMAKE_CURRENT_BINARY_DIR@\n-\n-# Error handling\n-function test_failed {\n-  EXIT_CODE=$?\n-  { set +ex; } 2>/dev/null\n-  if [ $EXIT_CODE -ne 0 ]; then\n-    echo \"+++++++++++++++++\"\n-    echo \"Test failed\"\n-    echo \"+++++++++++++++++\"\n-  fi\n-  exit $EXIT_CODE\n-}\n-trap test_failed EXIT\n-set -e -o pipefail\n-set -x\n-\n-export fckit_DIR=@PROJECT_BINARY_DIR@\n-export eckit_DIR=@eckit_DIR@\n-export ecbuild_DIR=@ecbuild_DIR@\n-\n-BUILD_DIR=${BUILD_ROOT}/downstream_output_sources\n-rm -rf \"$BUILD_DIR\"\n-mkdir -p \"$BUILD_DIR\"\n-cd \"$BUILD_DIR\"\n-\n-cmake \"$SOURCE\" \\\n-  -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\n-  -DECBUILD_2_COMPAT=OFF \\\n-  \"$@\"\n-\n-make VERBOSE=1\n-\n-test -f \"module_a.F90\"\n-\n-bin/main\n-\n-{ set +ex; } 2>/dev/null\n-echo \"+++++++++++++++++\"\n-echo \"Test passed\"\n-echo \"+++++++++++++++++\"\ndiff --git a/src/tests/test_shared_ptr.F90 b/src/tests/test_shared_ptr.F90\nindex 13bc4d2..ac5105a 100644\n--- a/src/tests/test_shared_ptr.F90\n+++ b/src/tests/test_shared_ptr.F90\n@@ -128,7 +128,7 @@ end function\n function ObjectCXX_id(this) result(id)\n   class(ObjectCXX) :: this\n   integer :: id\n-  id = Object__id( this%c_ptr() )\n+  id = Object__id( this%CPTR_PGIBUG_B )\n end function\n \n FCKIT_FINAL subroutine ObjectCXX_final_auto(this)\n","content_type":"text/plain","diff_type":"vcs","new_revision":"git-v1:6799c4d16b7d0d45ffe381bab36345bcbc9d5c57"}