From 992ef989b3522f007b65cbc5ee0f5d729f0a6168 Mon Sep 17 00:00:00 2001 From: Karl Hammond Date: Thu, 22 Dec 2022 22:09:20 -0600 Subject: [PATCH] Fixed warning message encountered with -std=f2003 --- fortran/lammps.f90 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fortran/lammps.f90 b/fortran/lammps.f90 index b99f1170ff..6c35105f30 100644 --- a/fortran/lammps.f90 +++ b/fortran/lammps.f90 @@ -333,6 +333,10 @@ MODULE LIBLAMMPS CLASS(*), POINTER :: caller => NULL() CLASS(lammps), POINTER :: lammps_instance => NULL() END TYPE fix_external_data + ! constructor to make Fortran 2003 compilers happy (F2008 should be OK) + INTERFACE fix_external_data + MODULE PROCEDURE construct_fix_external_data + END INTERFACE fix_external_data ! Array used to store Fortran-facing callback functions for fix external TYPE(fix_external_data), DIMENSION(:), ALLOCATABLE, TARGET, SAVE :: ext_data @@ -2786,6 +2790,12 @@ CONTAINS END IF END SUBROUTINE lmp_decode_image_flags_bigbig + ! constructor for fix_external_data that avoids a warning with Fortran 2003 + ! compilers + TYPE(fix_external_data) FUNCTION construct_fix_external_data() + construct_fix_external_data%id = '' + END FUNCTION construct_fix_external_data + ! equivalent function to lammps_set_fix_external_callback for -DSMALLSMALL ! note that "caller" is wrapped into a fix_external_data derived type along ! with the fix id and the Fortran calling function.