Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all 5691 articles
Browse latest View live

Help with dynamic assignment and select type

$
0
0

 

 

 

 

 

 

 

 

 

 

 

I need some help figuring out this new-fangled stuff.

Version 18.0.1.156 Build 20171018

I have tried to cut down the example as much as possible.

The commented-out assignment gives a syntax error. What is wrong? (The allocate works.)

And the program prints "Vehicle". I was expecting "Car". What is wrong there?

Thanks for the help.

module vehicle_module

implicit none

   private

   type, public :: vehicle_type
      real :: weight
   end type vehicle_type

   type, public, extends(vehicle_type) :: car_type
      logical :: is_a_taxi
   end type car_type

end module vehicle_module

program test

   use vehicle_module
   implicit none
   class(vehicle_type), dimension(:), allocatable :: aa
   class(vehicle_type), allocatable :: v

!aa = [ vehicle_type :: ]
   allocate (vehicle_type :: aa(0))

   v = car_type(2000.0, .false.)
   aa = [ aa, v ]

      select type (temp_v=>aa(1))
         type is (car_type)
            write (unit=*, fmt="(a9)", advance="no") "Car:"
         class default
            write (unit=*, fmt="(a9)", advance="no") "Vehicle:"
      end select

end program test


Dialog controls in a dll

$
0
0

Hello All,

Can anyone please furnish a simple Fortran Dialog code in a dll along with its calling program.The manuals are not very clear about them.

Thanks in advance

looking for a Fortran Compiler ....

$
0
0

I am an academic; I asked for a free license about a Fortran Compiler; May be I have not be explained;

Intel allowed me to install "system_studio" for windows;

I think that is a C++ compiler; Am I correct?

If it is the case, how can I change it?

Can CPU overclocking cause application crashes?

$
0
0

We have been reported by one of our customers that our application compiled with the compiler from IPS XE 2017 Update 2 crashes on random occasions while the calculation is running. We ran the same calculation with the same executable on several computers and did not experience any crashes. The customer has recently reported that the application stopped crashing after CPU overclocking was disabled on the computer that is Alienware.

Is it possible that CPU overclocking would cause application crashes?

Stack overflow on legacy MSIMSL f

$
0
0

I am trying to run the code from a 2006 economics paper that uses the now obsolete "use MSIMSL", which I have changed to "use numerical_libraries", to no avail. My hunch is that there is something else that needs to be updated from the old code, but it could also be an configuration or variable assignment issue.

Specifically, I can compile, but running the executable leads to a stack overflow error. Using the \traceback and \check:all options leads to several identical blocks where data is read into the program with the warning (406) ("In call to I/O Read routine, an array temporary was created for argument #1") referring to line 151 of the code, followed by the stack overflow error (severe 170) referring to lines 315 and 323. \heap-arrays seems to make no difference.

I have attached an image of what the warnings and errors look like, as well as the code itself. Notable details:
* Line 151 is the first instance where data is read into the program using a loop, so it makes sense that it's appearing many times.
* Line 316 calls the UMPOL function (minimization using the direct search polytope algorithm), and 323 is the beginning of the subroutine comprising the remainder of the code through line 2237.
* The program reads data from text files (totaling roughly 5.7MB), and includes the following IMSL functions (a minimization, three random numbers functions, and least squares): UMPOL, RNUN, RNNOA, RNPER, RLSE.

I'm running a Windows 7 machine with Visual Studio Community 2015, Intel Parallel Studio XE 2017u2, and the IMSL FNL 2018.0.0. I'm compiling with the standard flags (%F90% %F90FLAGS% estimation.f90 $LINK_FNL%) and executing on via command line (Intel 64 Visual Studio 2015 environment).

Thanks in advance.

AttachmentSize
Downloadimage/pngscreenshot.png107.69 KB
Downloadapplication/octet-streamestimation.f9054.71 KB

scan string for uper/lower case

$
0
0

I find our code is spending a lot of time assuring strings are lower case.   I hoped MAXVAL would scan a character string to see if it was all lowercase already but MAXVAL only works on character arrays, not strings.   If there is a faster way to convert strings to all lowercase or check to see if it has any uppercase characters already, that would be really helpful.

 

thanks

scott

 

UDDTIO with Allocatable Component

$
0
0

Hi! In the project attached, derived-types KeyValuePair and Value are introduced. The difference between these are that components of KeyValuePair are ALLOCATABLE while those within Value are not. The NAMELIST read statements behaves differently due to that difference I think. How could I write the UDIO procedures If I still want to employ those ALLOCATABLE components ? Thanks for any help.

AttachmentSize
Downloadapplication/rarUddtio.rar3.62 KB

Intel Visual Fortran Compiler of Windows 2017 Update 7

$
0
0

Has anyone got any idea what has changed in this update? The release notes don't even list it.


Fortran Link Error to C Standard Library Methods

$
0
0

I'm having a linker issue when building a Fortran DLL. I'm using the following:

  • Visual Studio 2015 with Update 3
  • Parallel Studio 2016 with Update 3

The Fortran project has dependencies to C/C++ projects. All of the linker errors appear to be related to methods derived from the C Standard Library, similar to this:

error LNK2001: unresolved external symbol __imp___assert

What should I check to verify that the project is properly configured to link to the C Standard Libary?

overloaded subroutine of a type in a submodul

$
0
0

In a previous thread I asked for help because of a circular depenendy. I solved it by using submodules. Now I want to have a type bound overloaded subroutine in a submodul.

 

Current status which is working fine

PROJECT.f90

MODULE mProject
	IMPLICIT NONE
	PRIVATE
	
	PUBLIC :: tElement
	
	TYPE tElement
	CONTAINS
		PROCEDURE, PUBLIC :: other_subroutine => other_subroutine_element
	END TYPE tElement
  
	INTERFACE
		MODULE SUBROUTINE other_subroutine_element(this)
			IMPLICIT NONE
			CLASS(tElement), INTENT(INOUT) :: this
		END SUBROUTINE other_subroutine_element
	END INTERFACE
END MODULE mProject

ELMENT.f90

SUBMODULE (mProject) mElements
	IMPLICIT NONE

CONTAINS
	MODULE SUBROUTINE other_subroutine_element(this)
		IMPLICIT NONE
		CLASS(tElement), INTENT(INOUT) :: this
		! doing smth here
	END SUBROUTINE other_subroutine_element

END SUBMODULE

 

 

Now I want to add to tElement a overloaded type bound subroutine. How do i do that

MODULE mProject
	IMPLICIT NONE
	PRIVATE
	
	PUBLIC :: tElement
	
	TYPE tElement
	CONTAINS
		PROCEDURE, PUBLIC :: overloaded_subroutine => overloaded_subroutine_element
		PROCEDURE, PUBLIC :: other_subroutine => other_subroutine_element
	END TYPE tElement
  
	INTERFACE overloaded_subroutine_element
		MODULE PROCEDURE overloaded_sub1
		MODULE PROCEDURE overloaded_sub2
	END INTERFACE overloaded_subroutine_element
	
	INTERFACE
		MODULE SUBROUTINE other_subroutine_element(this)
			IMPLICIT NONE
			CLASS(tElement), INTENT(INOUT) :: this
		END SUBROUTINE other_subroutine_element
	
		MODULE SUBROUTINE overloaded_sub1(this, int)
			IMPLICIT NONE
			CLASS(tElement), INTENT(INOUT) :: this
			INTEGER(4), INTENT(IN) :: int
		END SUBROUTINE overloaded_sub1
	
		MODULE SUBROUTINE overloaded_sub2(this, real)
			IMPLICIT NONE
			CLASS(tElement), INTENT(INOUT) :: this
			REAL(8), INTENT(IN) :: real
		END SUBROUTINE overloaded_sub2
	END INTERFACE
END MODULE mProject

and for ELEMENT.f90

SUBMODULE (mProject) mElements
	IMPLICIT NONE

CONTAINS
	MODULE SUBROUTINE other_subroutine_element(this)
		IMPLICIT NONE
		CLASS(tElement), INTENT(INOUT) :: this
		! doing smth here
	END SUBROUTINE other_subroutine_element
	
	MODULE SUBROUTINE overloaded_sub1(this, int)
		IMPLICIT NONE
		CLASS(tElement), INTENT(INOUT) :: this
		INTEGER(4), INTENT(IN) :: int
		! doing smth here
	END SUBROUTINE overloaded_sub1
	
	MODULE SUBROUTINE overloaded_sub2(this, real)
		IMPLICIT NONE
		CLASS(tElement), INTENT(INOUT) :: this
		REAL(8), INTENT(IN) :: real
		! doing smth here
	END SUBROUTINE overloaded_sub2
END SUBMODULE

unfortunately this is not how its working.

 

PROJECT.f90(9): error #8182: The name is neither an abstract interface nor a procedure with an explicit interface.   [OVERLOADED_SUBROUTINE_ELEMENT]

PROJECT.f90(9): error #8258: The procedure name in a type-bound procedure declaration should be the name of an accessible module procedure or an external procedure that has an explicit interface.   [OVERLOADED_SUBROUTINE_ELEMENT]

 

Someone has any thoughts on this?

 

 

Cannot see any code after opening dsw Compaq Visual Fortran file

$
0
0

I cannot open or see any code opening a Compaq Visual Fortran dsw file. I installed Intel Parallel Studio 2017 XE Composer software. Then I downloaded a trial version of Visual Studio 2018. The dsw file was last worked with in 2007. Please advise. Thanks,

error in open in 2018 upd 2

$
0
0
I'm getting an error during execution on an open statement. There are two files and the first does exist while the second does not. 
The code segment follows:
C:\Users\Brooks\Desktop\Stats\Stats.txt
C:\Users\Brooks\Desktop\Stats\PRN.dat

forrtl: severe (29): file not found, unit 3, file \\.\PRN
Image              PC        Routine            Line        Source
libifcoremdd.dll   519D2617  Unknown               Unknown  Unknown
libifcoremdd.dll   519F9190  Unknown               Unknown  Unknown
MyStats.exe        0032F1BF  _MAIN__                    51  MyStats.f90
MyStats.exe        003354D3  Unknown               Unknown  Unknown
MyStats.exe        0033873E  Unknown               Unknown  Unknown
MyStats.exe        00338620  Unknown               Unknown  Unknown
MyStats.exe        003384CD  Unknown               Unknown  Unknown
MyStats.exe        00338758  Unknown               Unknown  Unknown
KERNEL32.DLL       759A8654  Unknown               Unknown  Unknown
ntdll.dll          77B64B17  Unknown               Unknown  Unknown
ntdll.dll          77B64AE7  Unknown               Unknown  Unknown

Code Segment:

    fName1 = "C:\Users\Brooks\Desktop\Stats\Stats.txt"
    write(6,*) fName1
    open (unit=2,file=fName1,status='REPLACE',form='FORMATTED',action="WRITE")
    rewind 2
    fName2 = "C:\Users\Brooks\Desktop\Stats\PRN.dat"
    write(6,*) fName2
    open (unit=3,file=fName2,status='REPLACE',form='FORMATTED',action="WRITE")  <=== Line 51

 

When status="REPLACE" I thought if the file does not exist then it creates one; but it bombs me out instead.

Thanks,

Brooks

Exporting commons

$
0
0

I am working on a program inversion 2108 of parallel fortran.  The program has a main executable communicating with a dll.  I used the information in the article "coding requirements for sharing data in DLL's".

I have a common named Reserves, and a subroutine call GetReserveFund.  The following statement was added to the main program:

       !Dec$ATTRIBUTE DLLEXPORT :: GETRESERVEFUND,  /Reserves/

I then added this code the main program:

       !Dec$ATTRIBUTE DLLIMPORT :: GETRESERVEFUND, /Reserves/

When I run the program I get the following run time error:

FortranTest.Exe - Entry Point Not Found.

The procedure entry point Reserves could not be located in the dynamic link library cfx_fortran_dll.dll.

I am trying to pass a common block, why does it think it is a procedure.  I followed the documentation and I am not sure why it is not working.

Thanks.

Michael

 

 

Procedure entry point mkl_serv_set_xerbla_interface could not be loaded

$
0
0

Hi,

 

I am using Intel FORTRAN compiler inside Microsoft Visual Studio 2015. In my code, I use MKL library to do matrix inversion. I can run my program inside VS environment but if I try to run it outside( double-clicking on the .exe file) it gives an error. The error says "Procedure entry point mkl_serv_set_xerbla_interface could not be loaded".

 

I am confused why the application cannot be run outside VS. If I comment the library functions (DGETRF and DGETRI), it works again. Can anybody help me on this issue?

 

Thank you 

Dilshan

 

PS:  I have attached a screen capture of the error message and how the project properties.

Need extension in evaluation duration of Intel Parallel Studio

$
0
0

Hello all

I have downloaded and installed Intel Parallel Studio XE 2018 update 2 cluster edition. I used it for few days and uninstalled. Now, my evaluation license key have got expired and i have got serial number to install full software. Problem is, when i am trying to use this serial key during installation process, it does not let me install software and gives error message. 

In my friends system, he was still using evaluation version and when he put serial number, it accepts. Seems like I should be using software when I use new serial number. So, can I get my evaluation copy extended using another key so that I can use new key?

How can I solve this issue? Please help.


Access violation after read beyond end of formatted file

$
0
0

After switching part of my code to use 64-bit reals as opposed to 32-bit reals,  I have been experiencing crashes.

The traceback starts as follows:
forrtl: severe (157): Program Exception - access violation
Image              PC                Routine            Line        Source
libifcoremdd.dll   000007FEDE2F6AA6  Unknown               Unknown  Unknown
libifcoremdd.dll   000007FEDE3331DD  Unknown               Unknown  Unknown
....

And then refers to a routine that is modelled by the below routine:

SUBROUTINE ReadAFile(cFile)
CHARACTER(*), INTENT(IN) :: cFile
CHARACTER(2048) :: cRemain
INTEGER :: iStat
OPEN(9, FILE = cFile, ACTION = 'READ', STATUS = 'OLD', IOSTAT = iStat)
IF (iStat .NE. 0) RETURN
DO
READ(9, '(A)', IOSTAT = iStat) cRemain ! Traceback refers to this line of code
IF (iStat .EQ. -1) EXIT
IF (iStat .NE. 0) RETURN
! PRINT *, TRIM(cRemain)
! Do stuff with cRemain
END DO
CLOSE(9, IOSTAT = iStat)
IF (iStat .NE. 0) RETURN
END SUBROUTINE ReadAFile

The crash is only happening on the 64th call to this routine.  All runtime checks are selected but no other error occurs.  While investigating this I noticed that READ is not returning an IOSTAT of -1 at the end of the file when the crash occurs. By printing cRemain after the READ I get "0" for the blank line at the end of the file than gibberish for some extra lines (depends on compilation options 1 more line for 32-bit, 5 lines for 64-bit binary).  I'm guessing that somehow the stack has been corrupted but I have can't see why this would be the case.  The program crashes when compiled under Intel Visual Fortran Compiler 18.0.2.185 and Intel Visual Fortran Compiler XE 14.0.6.241; it does not crash when compiled with gfortran.  I tried putting all arrays on the heap and boosting the stack size in the linker options but this did not help. Does anyone have any suggestions how this could be further debugged?

OpenMP speedup not realized due to spin time

$
0
0

I am attempting to speed up a large program. I have identified the hot spots using profiling, but when I use OpenMP to parallelize the key loops, I get only a slight speed-up (about 30%), instead of the ideal factor of 8, for the key loops.

I created a smaller test program to figure out what is happening. This is the part containing the OpenMP loops (the complete program is attached).

!$OMP PARALLEL DEFAULT(SHARED)
!$OMP DO  PRIVATE(iRadius)
        DO iRadius = 1, nRadii
            Dradius(iRadius)=DiffCoeff(iSpecies, iRadius, concTotal(iRadius, 1:3)) ! diffusion coefficient at iRadius
            sRadius(iRadius)=SedCoeff(iSpecies, iRadius, concTotal(iRadius, 1:3)) ! if compression, this will account for it
        END DO
!$OMP END DO
!$OMP END PARALLEL

!$OMP PARALLEL DEFAULT(SHARED)
!$OMP DO PRIVATE(iRadius)

        L_R2_Parallel: &
            DO iRadius = 1, nRadii
                Z(iRadius)=ZCalc(iRadius, iSpecies)
                G(iRadius, 1)=Dradius(iRadius-1)*dt*A1(iRadius, 1)+B(iRadius, 1)-sRadius(iRadius-1)*omSqRun*dt*A2(iRadius, 1)
                G(iRadius, 2)=Dradius(iRadius)*dt*A1(iRadius, 2)+B(iRadius, 2)-sRadius(iRadius)*omSqRun*dt*A2(iRadius, 2)
                G(iRadius, 3)=Dradius(iRadius+1)*dt*A1(iRadius, 3)+B(iRadius, 3)-sRadius(iRadius+1)*omSqRun*dt*A2(iRadius, 3)
            END DO L_R2_Parallel
        nThreads=omp_get_num_threads()
!$OMP END PARALLEL

VTune shows a large amount of time was spent in __kmp_fork_barrier and _kmpc_barrier. I don't understand why any significant time is being spent at barriers, since an even division of the workload for each of the loops should result in all threads finishing at the same time. Task Manager shows 100% CPU usage while the program is running, as expected. I have attached the VTune summary; it also shows a large "spin time" which is mostly the sum of these two.

Compiled under Visual Studio as x64 release build, with option /Qopenmp.

3.4 GHz Haswell (8 logical CPUs), Windows 7 64-bit, Visual Studio 2017 15.6.7, Intel XE2018 update 1.

 

 

 

 

 

 
 

 

Assigning variable of derived type - conformant code or not

$
0
0

With the following code 

module m_1
    implicit none

    type t_1
        integer i
    contains
        procedure, private :: t1_ass_i
        generic   :: assignment(=) => t1_ass_i
    end type

    contains

        elemental subroutine t1_ass_i( var, expr )
            class(t_1),       intent(out) :: var
            integer, intent(in)  :: expr
            var%i = expr
        end subroutine
end module

module m2
    use m_1
    implicit none

    type :: T_2
        LOGICAL :: a_flag
    end type
    
    type:: T_3
        type(t_1) :: a_date
    end type
    
    type :: T_4
    end type
    
    type, public::  T_5
        type(T_2) :: v_t2
        type(T_3) :: v_t3
        type(T_4) :: v_t4
    end type
end module

program test
    use m2
    implicit none

    type(T_5) :: a1, a2
    a1%v_t2%a_flag = .true.
    a2 = a1
    print *, a1%v_t2%a_flag
    print *, a2%v_t2%a_flag
end program test

the result I expect is:

T
T

but we get:

T
F

the fact that commenting the line 

        type(T_4) :: v_t4

leads to the expected result makes me think this is a compiler bug, but I am not 100% of my interpretation of the standard re components with defined assignment.

I am currently using ifort v17.0.4.210 Build 20170411

failed computer restore to new disk/computer, license not available

$
0
0

Had disk/computer failure & restored BU clone to new disk/computer now when compiling get error below

i only use/need on this one computer is there any documentation of steps to deactivate the others so this new/replacement works?

thank you

this at end

ifort: error #10052: could not checkout FLEXlm licens

and this at beginning of build

1>------ Build started: Project: Shared_Globals_DLL 3D_2014, Configuration: Release Win32 ------
1>Compiling with Intel(R) Visual Fortran Compiler 16.0 [IA-32]...
1>mod_versionID.f90
1>Error: A license for Comp-FW is not available (-9,57).
1>License file(s) used were (in this order):
1>    1.  Trusted Storage
1>    2.  C:\Program Files (x86)\Common Files\\Intel\Licenses\COM_W__CPPFOR_RC8D-KKBZHX4C.lic
1>    3.  C:\Program Files (x86)\Common Files\\Intel\Licenses\COM_W__CPPFOR_RTTV-D9XWKRL2.lic
1>    4.  C:\Program Files (x86)\Common Files\\Intel\Licenses\w_3XN6TCF8.lic
1>    5.  C:\Program Files (x86)\Common Files\\Intel\Licenses\w_KKBZHX4C.lic
1>    6.  C:\Program Files (x86)\Common Files\\Intel\Licenses\w_S5W5SD59.lic
1>    7.  C:\Program Files\Common Files\Intel\Licenses
1>    8.  C:\PROGRA~2\INTELS~1\COMPIL~1\windows\bin\ia32\*.lic
1>Please visit http://software.intel.com/sites/support/ if you require technical assistance.
1>ifort: error #10052: could not checkout FLEXlm license

 

Problem to install

$
0
0

Hi, I'm trying to install Intel Fortran Compiler 2016 with update 4 to use Visual Studio, but it does not complete the installation.

I extract the file, and sometimes it starts the installation, locking at some stage, but sometimes the installation does not even start.

 

What could it be?

Viewing all 5691 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>