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

New Visual Studio

$
0
0

I have been using VS Enterprise 2015.  I have downloaded VS 2017 Community.  Do I need to uninstall FORTRAN and then re-install it to get the 2017 Community VS to recognize it?


UNICODE characters and getcwd()

$
0
0

Does the non-standard Fortran function getcwd() support UNICODE characters?

 

Regarding pointer to an array of items

$
0
0

module typedat
implicit none
    type :: dat
        integer :: trow,tcol,tnum,nin,nout
        type(dat),pointer,dimension(:)::next    !Pointer to an array of things of type dat,so find a way to store prev or next into array
        type(dat),pointer,dimension(:)::prev !Pointer to an array of things of type dat

    end type

end module
    
program multipleio
use typedat
implicit none
    integer,allocatable,dimension(:)::torder2,torder1,torder3,allt
    type(dat),target,dimension(:),allocatable::totdat
    type(dat),pointer::head,temp,temp1
    type(dat),pointer::first(:),last(:),prevdup(:),nextdup(:),prev1dup(:),next1dup(:)
    integer,dimension(:),allocatable :: a(:),b(:)

    open(17,file='tuborder.txt')
        do i=1,ttub
            allocate(a(totdat(i)%nin),b(totdat(i)%nout))
            read(17,*) a(1:totdat(i)%nin),b(1:totdat(i)%nout)
            allocate(prevdup(totdat(i)%nin,nextdup(totdat(i)%nout))
            if (totdat(i)%nin .gt. 0) then
                do j=1,totdat(i)%nin
                    do k=1,ttub
                        if (a(j)==totdat(k)%tnum) then
                            temp=>totdat(k)
                            prevdup(j)=temp
                        end if
                    end do
                end do
            end if
            totdat(i)%prev=>prevdup(1:totdat(i)%nin) !Linking the current tube as previous tube for next tube
            if (totdat(i)%nout .gt. 0) then
                do j=1,totdat(i)%nout
                    do k=1,ttub
                        if (b(j)==totdat(k)%tnum) then
                            temp=>totdat(k)
                            nextdup(j)=temp
                        end if
                    end do
                end do
            end if
            totdat(i)%next=>nextdup(1:totdat(i)%nout)!Linking the next tube to current tube
            deallocate(a,b)
        end do
    close(17)

I am trying to write a program to follow flow inside tubes. I planned to use linked list with  pointer "next" in my data structure shall point to the next tube of the path.I am facing a problem to link the various tubes when i am having multiple inlets or outlets for a tube. I want my current tube to point to next tube via next pointer and similarly to its previous tubes via prev pointer. If multiple inlets and outlets are there i am reading them into an arrays a,b and using them. Derived structure of "type (dat)" above contains tube information. The underlined lines above are the major concern for me. When i am using => in those lines i am getting an error of this kind

Error    1     error #8524: The syntax of this data pointer assignment is incorrect: either 'bound spec' or 'bound remapping' is expected in this context

and when i am just using = as above my pointers links are not coming correctly. I am new to Fortran and got stuck, kindly help me with this.

 

Mixed Language problem (Intel FORTRAN 18 and Visual Studio 2017)

$
0
0

I resolved the issue.  Don't know how to remove post though.

 

I have been migrating this code from several Intel FORTRAN compilers and versions of Visual Studio and this time I get unresolved externals.  I have CVF calling convention on the Fortran Library and __cdecl (/Gd) on the C++ side.  Linking the FORTRAN as a static library.  Code fragments below:

.h file

extern "C"

   {
   INT64 __stdcall MODULAR(INT64 Num1, float *Num2, char *FileName, INT_PTR NameLen, char *OutFile, INT_PTR OutLen);
   }

 

.cpp file

try

    {
    Num1 = MODULAR(tmplong, (float *)&tmpfloat, (char *)m_InputFile, (INT_PTR)strlen(m_InputFile), (char *)m_OutputFile,      (INT_PTR)strlen(m_OutputFile));
      }

 

.for file

      INTEGER(8) FUNCTION MODULAR[DLLEXPORT] (NX, X, INNAME, OUTNAME)
      INCLUDE "FOR2CPP.INC"
      INTEGER(8) NX [VALUE]
      REAL(4) X(NX) 
      CHARACTER(*) INNAME [REFERENCE] 
      CHARACTER(*) OUTNAME [REFERENCE]

 

Thanks for any assistance with this.

 

Visual Studio Auto Code Indentation

$
0
0

Hello

This concerns the auto indenting possible in Visual Studio via the Ctrl-K-D command. Current we have the indenting option set to the 'smart' in 'Tools | Options | Text Editor | Fortran | Tabs'.

There are two scenarios where the formatting is wrong:

1. Line continuations in an if condition. e.g.:

if (test == .true. .and. &
test2 == .true)
! Ctrl-K-D places the below inline with the if, no indent.
test = .false;
      ! Would prefer to be indented as below instead
      test = .false;
endif

2. Another issue is when we use the ';' to have an if statement on the one line (because we can!). Using Ctrl-K-D incorrectly indents the subsequent code.

if (test == .true.) then; test = .false.; else; test2 = .false.; endif
       ! Next line is indented when it should not be

 

Has anyone encountered this issue and found a solution?

 

 

Abaqus 6.13 fortran subroutine dll import is not working

$
0
0

Hi everyone!

I have a question about importing dll library in abaqus user subroutine.

I use abaqus 6.13-1, VS2012 and intell parallel studio XE 2013 to do some analysis.

But when I tried to use user subroutine that contains dll library, error is occured like this

-----------------------------------------------------------------------------------------------------------------------

IntSub.obj : error LNK2019: unresolved external symbol setupconnection reference
d in function uel.R
IntSub.obj : error LNK2019: unresolved external symbol UpdateMessageHeader refer
enced in function uel.R
IntSub.obj : error LNK2019: unresolved external symbol Initialization referenced
 in function uel.R
IntSub.obj : error LNK2019: unresolved external symbol UpdateCommand referenced
in function uel.R
IntSub.obj : error LNK2019: unresolved external symbol UpdateSubtype referenced
in function uel.R
IntSub.obj : error LNK2019: unresolved external symbol Command referenced in fun
ction uel.R
IntSub.obj : error LNK2019: unresolved external symbol indicator referenced in f
unction uel.R
IntSub.obj : error LNK2019: unresolved external symbol SendData referenced in fu
nction uel.R
IntSub.obj : error LNK2019: unresolved external symbol RecvData referenced in fu
nction uel.R
IntSub.obj : error LNK2019: unresolved external symbol UpdateNumStep referenced
in function uel.R
IntSub.obj : error LNK2019: unresolved external symbol terminate referenced in f
unction uel.R
standardU.dll : fatal error LNK1120: 11 unresolved externals
Abaqus Error: Problem during linking - Abaqus/Standard User Subroutines.
  This error may be due to a mismatch in the Abaqus user subroutine arguments.
  These arguments sometimes change from release to release, so user subroutines
  used with a previous release of Abaqus may need to be adjusted.
Abaqus/Analysis exited with errors

--------------------------------------------------------------------------------------------------------------------------------

I already put my .lib file in simple directory (C:\lib)

and I also added path of the .lib file in abaqus _v6.env but it's not working

Please help me !!! Give me any advice !!! 

 

AttachmentSize
Downloadimage/jpegintsub.jpg139.33 KB

How to create stand-alone exe file?

$
0
0

Dear Users: With my old Digital Fortran (DF) I could run any '.exe' file directly from a command line or from MATLAB. How can I do the same with Parallel Studio XE? I do not want to do anything fancy, just reading in and writing out ascii files. My old DF exe still runs on Win10, but not the newly created exe performing the same under Visual Studio but not alone. In the latter case I get a message: 'mkl_intel_thread.dll cannot be found'. I also noticed that the new exe is much smaller than the old (DF) exe that actually still runs separately. Any help would be greatly appreciated, Joe.

 

 

OpenMP-Directives

$
0
0

The following OpenMP directives in Intel Visual Fortran worked fine in version 2016 (16.0.4.246) but causes an error in 2017 (17.0.6.270)

                     !$omp parallel do default(none) if (parallel .and. nbsubnet>1) &

The error in version 2017 is:

error #5082: Syntax error, found '.AND.' when expecting one of: :

It would appear that the 2017 version of Intel's Fortran compiler no longer accepts .and. and yet the list of what it expects is empty. I have not tried this in the 2018 version. I believe the logic .and. should be accepted.

Thank you,

Lester

 


Structural program - very old Fortran Code

$
0
0

Dear All:

We are getting some really interesting results from bridge monitoring for vibration - particularly at higher frequencies.  We are starting to look at second order effects to explain some of the scatter in the results.

The standard structural analysis uses a first order analysis and does not allow for sway etc..  I found a neat little program in the 1973 Harrison book that does a second oder analysis.  A version of the program running on VS 2017 and latest Intel Fortran is attached. 

I have not seen this solution method for matrix inversion before, maybe I am missing something, but has anyone seen this solution technique before.  Harrison published the book whilst he was at Sydney University in Australia, but he appears to have done the bulk of the work in the USA at Lehigh Uni - a big steel place  in the late 1960s. I include the program notes.  He does not explain the technique and it is different to his other programs that appear more traditional linear algebra. 

My program is effectively the Harrison code with minimal changes to make it run, but the arithmetic ifs etc have not yet been cleaned out. 

I would aim to pull out Harrison's solver, make it 3D and then use Pardiso and then Feast. 

John

 

 

 

 

 

AttachmentSize
Downloadapplication/zipZeus.zip843.22 KB
Downloadapplication/pdfharr_0001.pdf888.36 KB

PSXE2018 update 2 broke MSVS integration??

$
0
0

Since installing PSXE2018 Update 2 this morning, I now have what appears to be either black text on black or no content displayed in my open source files.

Any ideas?

Intel(R) Parallel Studio XE 2018 Update 2: Issue with double-click on a Microsoft Visual Studio solution (.sln) file

$
0
0

With Parallel Studio XE 2018 Update 2, is anyone else experiencing a problem where double-clicking on a Visual Studio solution (.sln) file leads to Visual Studio 2017 "not responding"?

After a long wait at the above state, if one tries to close Visual Studio 2017, the following results. 

 

AttachmentSize
Downloadapplication/zipConsole1.zip1.6 KB

SUBROUTINE with Arbitrary Number of Variables

$
0
0

This is probably wishful thinking, but is there a way of passing multiple variables (unknown quantity) to a subroutine and then received by the subroutine as an array? I guess a good anology would be to minic something like the MAX function (where you have MAX(A,B,C, ...).

Below is an example subroutine that reduces entries in a vector based on its total sum.

 

  PURE SUBROUTINE VEC_ADJUST_MAXSUM(MAXSUM, VEC)
    DOUBLE PRECISION, INTENT(IN)::MAXSUM
    DOUBLE PRECISION,DIMENSION(:),INTENT(INOUT):: VEC
    INTEGER:: I,J,N
    DOUBLE PRECISION:: TOT
    !
    N = SIZE(VEC) - ONE
    TOT = SUM(VEC)
    !
    DO I=ONE, N
          IF(TOT > MAXSUM) THEN
              ASSOCIATE(VAL => VEC(I))
                  !
                  VAL = MAXSUM
                  DO CONCURRENT(J=I+ONE:N); VAL = VAL - VEC(J)
                  END DO
                  IF(VAL < DZ) VAL = DZ
                  !
                  TOT = SUM(VEC)
                  !
              END ASSOCIATE
          ELSE
              EXIT
          END IF
    END DO
    !
    IF(TOT > MAXSUM) THEN
        N = N + ONE  !MOVE TO LAST LOCATION
        !
        IF(MAXSUM < DZ) THEN
            VEC(N) = DZ
        ELSE
            VEC(N) = MAXSUM
        END IF
    END IF
    !
  END SUBROUTINE

The main goal of this is I have a set of variables (with the potential of more standalone ones being added such that the subroutine would called as:

PROGRAM TEST
IMPLICIT NONE
DOUBLE PRECISION:: MX, A,B,C,D,E

A  = 1D0 
B  = 2D0
C  = 3D0
D  = 4D
E  = 5D0
MX = 10D0

CALL VEC_ADJUST_MAXSUM(MX, [A,B,C,D,E])

END PROGRAM

The idea is that if the sum of the variables excedes the maxsum (MX) that A is first reduced, then B, then C, ect.

The code will eventually grow with additional variables, which is why this structure would be advantageous.

The suggested subroutine does not work (the INTENT causes it to fail and when I remove that it does not update the variables themselves)

Any suggestions on how to pass an arbitrary number of variables would be great (hopefully something beyond pre-specifying them as optional and having lots of IF(PRESENT()) checks.

Thanks

automatic coarray object with Intel Fortran

$
0
0

The Fortran standard, as far as I am aware, prohibits the use of automatic coarrays. However, I have noticed that Intel Fortran compiler 2018, allows such automatic object creations. For example, ifort happily compiles the following code in the debug mode and the code works totally fine:

program testAutoCoarray

implicit none

integer :: i
integer, parameter :: nd=10

call createAutoCoarray(nd)

end program testAutoCoarray

subroutine createAutoCoarray(nd)
  implicit none
  integer, intent(in) :: nd
  real, save :: AutoCoarray(nd)[*]
  if (this_image()==1) then
    AutoCoarray = -13.e0
    sync images(*)
  else
    AutoCoarray = AutoCoarray(:)[1]
    sync images(1)
  end if
  write(*,"(*(g0.4,''))") this_image(), AutoCoarray
end subroutine createAutoCoarray

Have I understood the Fortran 2008 standard incorrectly, or this is a bug in ifort. It is notable that ifort crashes with catastrophic internal error if I attempt to compile the same code as above in O2 or O3 modes. Here is the message:

E:\testAutomaticCoarray>ifort /O2 /Qcoarray=shared /standard-semantics /assume:realloc_lhs main.f90 -o run.exe
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.1.156 Build 20171018
Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

0_8000

E:\testAutomaticCoarray\main.f90(12): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
compilation aborted for main.f90 (code 1)

Thank you for your help and great work!

Trouble with multiline OpenMP directives

$
0
0

Hello,

I am trying to compile a fixed-form Fortran program, and I need to call a very long openMP directive. I tried to write it as a multi-line statement as follows:

      !$OMP PARALLEL PRIVATE(ithr1,igpIP,Tmats,TmatB,x8H,x8Ho,u8H) & 

      !$OMP& PRIVATE(v8H,a8H,kC8H,kini8H,fC8H,mC8H,dhistCB,dhistmatCB) & 

      !$OMP& PRIVATE(genstrs,genstrn,hnmatCB,h1matCB,qlam,depsAV) & 

      !$OMP& PRIVATE(sumweight,elsiz,elCvel,matCvel,Swmid,dt_el,y_Pc) & 

      !$OMP& PRIVATE(aw,w_cr,iSUPG, dloc,K_chksi,K_Cheta,K_Chzeta) & 

      !$OMP& PRIVATE(Porosity,rvC,Sw,Temperature,Tetaw,dspin1,Rrot) & 

      !$OMP& PRIVATE(Rold,Vten,Vold,Lten,nhmatNL,epsXYZ,epsROT) & 

      !$OMP& PRIVATE(sigMatNEW,initmatstif,isSolidMech) 

 

 

These are lines 1138-1145 for a routine isolve.for, of a project fe_program

My compilation always fails, and I am given the following messages:

 

1>C:\fe_program\v4-CONSTRAINT\iSolve.for(1138): error #5082: Syntax error, found '&' when expecting one of: PRIVATE REDUCTION FIRSTPRIVATE NUM_THREADS LASTPRIVATE ORDERED SCHEDULE COLLAPSE ...

1>C:\fe_program\v4-CONSTRAINT\iSolve.for(1139): error #7844: Invalid directive.

1>C:\fe_program\v4-CONSTRAINT\iSolve.for(1140): error #7844: Invalid directive.

1>C:\fe_program\v4-CONSTRAINT\iSolve.for(1141): error #7844: Invalid directive.

1>C:\fe_program\v4-CONSTRAINT\iSolve.for(1142): error #7844: Invalid directive.

1>C:\fe_program\v4-CONSTRAINT\iSolve.for(1143): error #7844: Invalid directive.

1>C:\fe_program\v4-CONSTRAINT\iSolve.for(1144): error #7844: Invalid directive.

1>C:\fe_program\v4-CONSTRAINT\iSolve.for(1145): error #7844: Invalid directive.

 

I tried to retain a single PRIVATE() statement, and break the lines accordingly. For example, lines 1139-1140 would be:

 

      !$OMP PARALLEL PRIVATE(ithr1,igpIP,Tmats,TmatB,x8H,x8Ho,u8H, & 
      !$OMP& v8H,a8H,kC8H,kini8H,fC8H,mC8H,dhistCB,dhistmatCB, & 

 

When I tried compiling, I got the error:  

 

 

1>C:\fe_program\v4-CONSTRAINT\iSolve.for(1138): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> /

 

I would be grateful if anyone could inform me on how to actually write the multi-line directive.

Thanks in advance!

C/Fortran Mixed-language Environment in Visual Studio 2015

$
0
0

I'm working with some legacy code to try and compile it in an updated development environment. This project contains C code which calls on the subroutines of Fortran code in the same project. I'm using the following:

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

I've verified that the Intel Compilers are recognized by Visual Studio and followed the steps described here ( https://software.intel.com/en-us/articles/configuring-visual-studio-for-mixed-language-applications/ ) to configure it for a mixed-language environment but it appears that the Fortran subroutines are not visible to the C code. For example, a .c file with the line:

extern void SETUP(void);

is in reference to a subroutine in a .f90 file in the same project:

SUBROUTINE SETUP

but Visual Studio indicates that the subroutine is not found with the message: "Function definition for 'SETUP' not found"

What is the best approach to verify Visual Studio is configured properly for mixed-language compilation and how to get the C code to recognize the Fortran?


Fortran DLL built with Intel Fortran 2018 causes Excel to crash when accessed through a VBA wrapper function

$
0
0

1. I have been using a Fortran DLL for the past several years (10+) which contains several utility functions. These functions are called in Excel VBA code via wrapper functions.
2. The DLL has always been created using the default project settings except

Configuration Properties -> Fortran -> External Procedures -> Calling Convention: CVF(/iface:cvf)
Configuration Properties -> Libraries -> Runtime Library: Debug Multithreaded (/libs:static /threads /dbglibs)

3. When the DLL was rebuilt using Intel® Parallel Studio XE 2018 with Microsoft Visual Studio Community 2017 last week, opening an Excel file that accesses the DLL generates the following error and causes Excel to crash.

_________________________________________________________________________

Microsoft Visual C++ Runtime Library
Debug Error!
Program: <Path to DLL>

Damage before 0x24DBE430 which was allocated by aligned routine

(Press Retry to debug the application).
_________________________________________________________________________

4. I have tested the DLL within Fortran by using a Fortran main program to call the same functions and it works without error. Somehow, the rebuilt DLL is incompatible with Excel.

5. Further, I had saved a copy of the same DLL built with Intel Parallel Studio 2017. Excel is able to access the functions in the same DLL built with the earlier version.

6. So somehow, IPS2018 seems to be causing a problem.

Your help will be greatly appreciated.

Problems after latest 2018 Update 2

$
0
0

I've just installed the latest update of the Visual Fortran Compiler for Windows. The installation completed with apparent no issues but when I open a project solution in Visual Studio 2015 (Update 3) the source file editor is not displaying any text. Only the file name is displayed on the tab at the top of the editor window and the remainder is blank dark blue. Resource file seem to be OK though.

Any help would be appreciated.

 

Thanks

How to resolve your Online Service Center login issues

$
0
0

Follow these steps to resolve your login issues:

  1. On the Online Service Center page, click Request Support, and then click Sign In. Make sure that your current language is set correctly and that Caps Lock is disabled on your keyboard.
  2. If you received the error message that your password or login ID is not correct, recover the login ID by clicking the Forgot your Intel username or password? links.
  3. If you don’t remember your login ID, click Forgot username to retrieve it. Enter the email address you used during the registration to receive the login ID.
  4. You can then click Forgot password to recover the password using the received login ID.

Still unable to sign in? Use this support option only if you are unable to reset your password and access your account:

  1. Go to our developer support page.
  2. Locate the Site support or Non-Technical Question section.
  3. Click the drop-down menu and select Registration / Login Issue.
  4. Fill in a support request. Make sure to provide your name and email address.

See Priority Support FAQ for additional information.

Impossible to associate pointer to array from submodule.

$
0
0

1>D:\temp\Fallo_compilador3\restricciones.f90(27): error #7994: A use associated object that has the PROTECTED attribute shall not appear as a target in a pointer-assignment-stmt.   [FI]

The mentioned error is obtained with the following piece of code in Intel Parallel Studio XE 2018 Update 2. I also include the code and the compilation results attached. Observe that it is possible to point from the module, but it is not possible from the submodule.

!C************************************************************
MODULE parent_module
IMPLICIT NONE
   
!> Private, public and public protected variables
REAL(8),DIMENSION(5),PROTECTED,TARGET::fi
REAL(8),POINTER,DIMENSION(:),PRIVATE::pfisub=>null(),pfimod=>null()

!> Submodule subroutine interface
INTERFACE
    MODULE SUBROUTINE modifSub
    END SUBROUTINE modifSub
END INTERFACE

CONTAINS

SUBROUTINE modif
    pfimod=>fi(1:3)
END SUBROUTINE modif
END MODULE parent_module
!C************************************************************
!C************************************************************
SUBMODULE (parent_module) submod1
IMPLICIT NONE
CONTAINS
MODULE SUBROUTINE modifSub
    pfisub=>fi(1:3)
END SUBROUTINE modifSub
END SUBMODULE submod1
!C************************************************************

AttachmentSize
Downloadapplication/zipFallo_compilador3.zip7.29 KB

Non-Default Data Type Benifit

$
0
0

With regards to the Intel Compiler (or if the code is used by another compiler), is there any benifit to using non-default data types beyond different memory storage?

For example default Logical (KIND=4) uses 32 bits of memory, but a Logical (KIND=1) only uses 8 bits of memory. To me it would seem better to always declare the logical variable as being LOGICAL(KIND=1) since it is just holding a TRUE/FALSE value.

Is there any penalty when doing this (such as the compiler is more optimized for processing 32 bits compared to 8 bits).

 

Another example is if I know I am only going to have an integer variable that is set to only -1, 0, and 1, would it be better to declare it as INTEGER(1) compared to INTEGER (which would default the kind to 4)? 

I have a simulation model that has very large LOGICAL and INTEGER arrays that are used mostly as flags (hence the -1, 0, and 1 example) and while it would be nice to reduce the memory foot print, the execution speed is my main concern.

 

Would there be a speed difference between any of the following, say I had to process it in a lot with setting its value to -1, 0, or 1 and the checking those values later and changing them again?

INTEGER(1),DIMENSION(10000):: A
INTEGER(2),DIMENSION(10000):: B
INTEGER(4),DIMENSION(10000):: C
INTEGER(8),DIMENSION(10000):: D

LOGICAL(1),DIMENSION(10000):: CHK1
LOGICAL(2),DIMENSION(10000):: CHK2
LOGICAL(4),DIMENSION(10000):: CHK3

I guess ultimately, with enough RAM, is there any benefit for declaring the smaller "kind" versions even though the full range of the default kind types are never used?

Viewing all 5691 articles
Browse latest View live


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