- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm sorry about the short description but with the example, I think it's better.
I have a strange behaviour with Intel Fortran compiler since ifort 11.xxx.xxx.
Here my code:
The length of the argument HMFILE is 1 and not 28 as expected.
When I compile with gfortran-4.4.4, I got the expected behaviour:
Can you tell where I'm wrong?
Thank you in advance.
Laurent,
I'm sorry about the short description but with the example, I think it's better.
I have a strange behaviour with Intel Fortran compiler since ifort 11.xxx.xxx.
Here my code:
[fortran]MODULE MODI_TURB contains SUBROUTINE TURB( & HLBCX, & HLBCY, & HTURBDIM, & HTURBLEN, & HTOM, & HTURBLEN_CL, & HINST_SFU, & HUVW_ADV_SCHEME, & HFMFILE, & HLUOUT, & PDXX, & PDYY, & PDZZ, & PDZX, & PDZY, & PZZ, & PCOSSLOPE, & PSINSLOPE, & PRHODJ, & PTHVREF, & PRTKES & ) IMPLICIT NONE CHARACTER(LEN=4),DIMENSION(2),INTENT(IN) :: HLBCX CHARACTER(LEN=4),DIMENSION(2),INTENT(IN) :: HLBCY CHARACTER*4 ,INTENT(IN) :: HTURBDIM CHARACTER*4 ,INTENT(IN) :: HTURBLEN CHARACTER*4 ,INTENT(IN) :: HTOM CHARACTER*4 ,INTENT(IN) :: HTURBLEN_CL CHARACTER*1 ,INTENT(IN) :: HINST_SFU CHARACTER(LEN=6) ,INTENT(IN) :: HUVW_ADV_SCHEME CHARACTER(LEN=*) ,INTENT(IN) :: HFMFILE CHARACTER(LEN=*) ,INTENT(IN) :: HLUOUT REAL, DIMENSION(:,:,:) ,INTENT(IN) :: PDXX REAL, DIMENSION(:,:,:) ,INTENT(IN) :: PDYY REAL, DIMENSION(:,:,:) ,INTENT(IN) :: PDZZ REAL, DIMENSION(:,:,:) ,INTENT(IN) :: PDZX REAL, DIMENSION(:,:,:) ,INTENT(IN) :: PDZY REAL, DIMENSION(:,:,:) ,INTENT(IN) :: PZZ REAL, DIMENSION(:,:) ,INTENT(IN) :: PCOSSLOPE REAL, DIMENSION(:,:) ,INTENT(IN) :: PSINSLOPE REAL, DIMENSION(:,:,:) ,INTENT(IN) :: PRHODJ REAL, DIMENSION(:,:,:) ,INTENT(IN) :: PTHVREF REAL, DIMENSION(:,:,:) ,INTENT(INOUT) :: PRTKES print*,"IN SUBROUTINE TURB :: LEN(HMFILE)=",LEN(HFMFILE) print*,"IN SUBROUTINE TURB :: LHMFILE=",HFMFILE END SUBROUTINE TURB end MODULE MODI_TURB program main use MODI_TURB implicit none CHARACTER(LEN=4),DIMENSION(:),POINTER :: HLBCX CHARACTER(LEN=4),DIMENSION(:),POINTER :: HLBCY CHARACTER*4 :: HTURBDIM CHARACTER*4 :: HTURBLEN CHARACTER*4 :: HTOM CHARACTER*4 :: HTURBLEN_CL CHARACTER*1 :: HINST_SFU CHARACTER(LEN=6) :: HUVW_ADV_SCHEME CHARACTER(LEN=16),POINTER :: HLUOUT REAL, DIMENSION(:,:,:), POINTER :: PDXX,PDYY,PDZZ,PDZX,PDZY REAL, DIMENSION(:,:,:), POINTER :: PZZ REAL, DIMENSION(:,:), POINTER :: PDIRCOSXW, PDIRCOSYW, PDIRCOSZW REAL, DIMENSION(:,:), POINTER :: PCOSSLOPE REAL, DIMENSION(:,:), POINTER :: PSINSLOPE REAL, DIMENSION(:,:,:), POINTER :: PRHODJ REAL, DIMENSION(:,:,:), POINTER :: PTHVREF REAL, DIMENSION(:,:,:), POINTER :: PRTKES CHARACTER(LEN=28),POINTER :: HFMFILE ALLOCATE(HFMFILE) ; HFMFILE = "abcdef_file " ALLOCATE (HLBCX(2)) ; HLBCX(:) = "CYCL" ALLOCATE (HLBCY(2)) ; HLBCY(:) = "CYCL" print*,"IN MAIN :: LEN(HMFILE)=",LEN(HFMFILE) print*,"IN MAIN :: LHMFILE=",HFMFILE call TURB( & HLBCX, & HLBCY, & HTURBDIM, & HTURBLEN, & HTOM, & HTURBLEN_CL, & HINST_SFU, & HUVW_ADV_SCHEME, & HFMFILE, & HLUOUT, & PDXX, & PDYY, & PDZZ, & PDZX, & PDZY, & PZZ, & PCOSSLOPE, & PSINSLOPE, & PRHODJ, & PTHVREF, & PRTKES & ) DEALLOCATE(HFMFILE) DEALLOCATE(HLBCX) DEALLOCATE(HLBCY) end program main [/fortran]And its output:
[bash]$ ifort -V;ifort -g prog.f90;./a.out Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.4.191 Build 20110427 Copyright (C) 1985-2011 Intel Corporation. All rights reserved. IN MAIN :: LEN(HMFILE)= 28 IN MAIN :: LHMFILE=abcdef_file IN SUBROUTINE TURB :: LEN(HMFILE)= 1 IN SUBROUTINE TURB :: LHMFILE=a [/bash]
The length of the argument HMFILE is 1 and not 28 as expected.
When I compile with gfortran-4.4.4, I got the expected behaviour:
[bash]$ gfortran prog.f90;./a.out IN MAIN :: LEN(HMFILE)= 28 IN MAIN :: LHMFILE=abcdef_file IN SUBROUTINE TURB :: LEN(HMFILE)= 28 IN SUBROUTINE TURB :: LHMFILE=abcdef_file [/bash]If I modify the source by delete argument from the subroutine TURB, I've got the correct behaviour. With Intel Fortran Compiler <11.xxx, it worked.
Can you tell where I'm wrong?
Thank you in advance.
Laurent,
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please refer to the following KB article:
This is a recently discovered bug in the compiler, but it has a workaround.
The fix is to add the following switch when compiling this code:
-switch fe_inline_all_arg_copy_inout
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please refer to the following KB article:
This is a recently discovered bug in the compiler, but it has a workaround.
The fix is to add the following switch when compiling this code:
-switch fe_inline_all_arg_copy_inout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Michael!
I thank you for the answer. I didn't find it because it was hard to describe for me.
Best Regards,
Laurent,
I thank you for the answer. I didn't find it because it was hard to describe for me.
Best Regards,
Laurent,
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page