Quantcast
Channel: Intel® Fortran Compiler
Viewing all 3270 articles
Browse latest View live

Derived type IO with private DT array component

$
0
0

I've run into a possible bug with derived type IO when I have a derived type with a private component array of derived types. I've included a example code snippet below that should reproduce the problem (I'm using ifort version 14.0.2.114). To summarize the problem, when I try to write my derived type using a formatted write statement it output the public component of the derived type, as expected, and then it outputs the first n-1 values of the component derived type, which is both private and not called in the main formatted write statement.

In the sample code below the write statement should output:

    1.0000

but instead outputs

    1.0000
    2.0000
    2.0000
    2.0000
    2.0000

Sample code:

module DTIO
  implicit none

  ! derived types:
  type T1
    private
    real :: x
  contains
    procedure, private :: T1_write_formatted
    generic :: write(formatted) => T1_write_formatted
  end type T1

  type T2
    private
    real :: x
    type(T1) :: y(5)
  contains
    procedure, private :: T2_write_formatted
    generic :: write(formatted) => T2_write_formatted
  end type T2

  ! interfaces:
  interface T1
    module procedure :: T1_constructor
  end interface T1

  interface T2
    module procedure :: T2_constructor
  end interface T2
contains


  pure function T1_constructor( x ) result( val )
    real, intent(in) :: x
    type(T1) :: val
    val%x = x
  end function T1_constructor

  pure function T2_constructor( x ) result( val )
    real, intent(in) :: x
    type(T2) :: val
    val%x = x
    val%y = T1(2.0*x)
  end function T2_constructor

  subroutine T1_write_formatted( self, unit, iotype, v_list, iostat, iomsg )
    class(T1), intent(in)    :: self
    integer     , intent(in)    :: unit
    character(*), intent(in)    :: iotype
    integer     , intent(in)    :: v_list(:)
    integer     , intent(out)   :: iostat
    character(*), intent(inout) :: iomsg
    ! local variables:
    character(:), allocatable :: fmt

    ! determine format
    if (len_trim(iotype) > 0) then
      if (iotype(1:2) == 'DT') then
        if (len_trim(iotype) > 2) then
          fmt = '('//iotype(3:)//')'
          write(unit, fmt=fmt, iostat=iostat, iomsg=iomsg) self%x
          deallocate(fmt)
        else
          write(unit, *, iostat=iostat, iomsg=iomsg) self%x
        end if
      else if (iotype == 'LISTDIRECTED') then
        write(unit, *, iostat=iostat, iomsg=iomsg) self%x
      else if (iotype == 'NAMELIST') then
        write(unit, *, iostat=iostat, iomsg=iomsg) self%x
      end if
    end if
  end subroutine T1_write_formatted

  subroutine T2_write_formatted( self, unit, iotype, v_list, iostat, iomsg )
    class(T2), intent(in)    :: self
    integer     , intent(in)    :: unit
    character(*), intent(in)    :: iotype
    integer     , intent(in)    :: v_list(:)
    integer     , intent(out)   :: iostat
    character(*), intent(inout) :: iomsg
    ! local variables:
    character(:), allocatable :: fmt

    ! determine format
    if (len_trim(iotype) > 0) then
      if (iotype(1:2) == 'DT') then
        if (len_trim(iotype) > 2) then
          fmt = '('//iotype(3:)//')'
          write(unit, fmt=fmt, iostat=iostat, iomsg=iomsg) self%x
          deallocate(fmt)
        else
          write(unit, *, iostat=iostat, iomsg=iomsg) self%x
        end if
      else if (iotype == 'LISTDIRECTED') then
        write(unit, *, iostat=iostat, iomsg=iomsg) self%x
      else if (iotype == 'NAMELIST') then
        write(unit, *, iostat=iostat, iomsg=iomsg) self%x
      end if
    end if
  end subroutine T2_write_formatted
end module DTIO

program main
  use DTIO
  implicit none
  ! local parameters:
  type(T2) :: var

  var = T2(1.0)
  write(*,'(A)') 'formatting: unspecified'
  write(*,*) var
  write(*,'(A)') ''
  write(*,'(A)') 'formatting: specified'
  write(*,'(DT"F10.4")') var
end program main

Problems about UMAT in ABAQUS when using Fortran

$
0
0

Hi there,

  I'm facing a very serious problem about how to use subroutines functionally now, so if you guys are so kind, please give some help and I really appreciate this!

Here is the deal, my software combo is VS2012+ABAQUS6.13+Intel Fortran2013 SP1, OS is WIN7-64bit, and I'm trying to do the research about RVE problems. The attachments are the codes and input files what I'm using now, and also including the picture of showing the error.

  As you can see from the fortran codes, if I separate them into two parts: subroutine(including UMAT, DISP, URDFIL and UEXTERNALDB) and user subroutine(including CMKirchhoff, IdentityTensor,  NodeCurrent, NodeInitial, NodesCoords, ReadKM, ReadRVEvolume, RVEvolume, StressM and StressTensors), the prompt will show "subroutine.obj: error  lnk2019 unresolved external symbol ***(which is the names of the user subroutines), this symbol is referenced in function ***(umat.R or urdfil and so on)". However, if I add these user subroutines into the subroutine code file, there will be other problems. So this make me confused.

   Anyway, I'm wondering that if anyone can help me get out of this annoying issue? many thx!

   BTW: All the codes and input files are included in the UMAT.rar showing in the attachment (because the forum can not allow me to upload .inp file...)

AttachmentSize
DownloadUMAT.rar147.8 KB

Relating two different arrays for table lookup

$
0
0

Hi,

    I have a table of daily data for 50 years (18262 data values), which I am able to read and write into an output file. I have another table of coefficients, which is actually yearly (50 data values). I would like to multiply the yearly coefficients with the 18262 data values, whenever the year matches.

Basically, I am looking for relating two arrays when they match (as I am trying to do from line 41 to 45 in the attached program). Attached herewith are also the two tables.

I am sorry if I am asking this same question many times, but this is the place I feel that I really need help with to move forward. Any ideas or suggestions to multiply the correct coefficient value (coeff(n,2) with tc to get the modified table of 18262 data values, would be greatly helpful to me.

Thank you.

AttachmentSize
Downloadtc_mod.7z31.96 KB

Executing a Windows program during a Fortran run

$
0
0

Hello everyone,

I am working on an optimization code, in which an external program should provide a data file, to be read by Fortran. My question is: how could I execute the external program during the Fortran run?

Thanks,

 

Paulo

 

VS2012 plus Fortran XE 2013 SP1 - redistributables

$
0
0

Hi

I have a C# console app calling a Fortran DLL.  Both are x64. (at least I thought so)

It runs fine on my PC but when I port it to another machine it falls over with Exception encountered An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B).

It seems when I examine the Fortran DLL with Dependency Walker that it's hoping to load c:\program files (x86)\common files\intel\shared libraries\redist\ia32\compiler\LIBIFCOREMDD.DLL etc.

how can I ensure that the correct 64 bit support is redistributed with the 64 bit Fortran dll...

I have checked the other posts on similar questions but it's not clear to me what I am missing.  

I am not even sure where to start looking :-}

Many thanks for your help!

Best wishes
Paul

reg query commands in scripting failing due to users not having admin rights

$
0
0

I perform sys ad work in a classified environment that is very restrictive with user rights/permissions.  The sequence of scripts called when executing C:\Program Files (x86)\Intel\Composer XE 2013\bin\ipsxe-comp-vars.bat fails because it tiers down into scripts that perform "reg query" commands to set environment variables.  Group policy has been set up to "Prevent access to registry editing tools" and no regular users will ever be granted admin rights.  The only way I could make this work was to hard code all the environment variables the "reg query" commands set.  This is a very tedious process especially when software versions are updated regularly.

Does anyone have a easier approach to remedy this issue other than sequentially commenting out all the calls to code that performs "reg query" commands and hard coding environment variables?

More threads than cores

$
0
0

Steve, Colleagues,

What does a Release-2015-compiler-produced executable do if it wants 4 cores [ CALL OMP_SET_NUM_THREADS(4) ] and it is run on a machine with an old Intel chip there are only two cores? We're trying to predict behavior on user machines that date back a while.

David

is it possible for two users to write a common Direct Access file?

$
0
0

It means the two(or more) users write different records to the same file by different programs.

How to write to the shared file by Fortran implementation?


fortcom.exe not found; How to set up command line for 64 bit builds?

$
0
0

Hello,

I am running ifort via command line (via the windows start menu). I am receiving the following error:

ifort: error #10037: could not find 'fortcom'

ifort: error #10273: Fatal error in fortcom, terminated by 0Xffffffff

I have noticed that fortcom.exe is not within bin/intel64. However, there is a copy in bin/ia32. I'm guessing my install is not setup for 64 bit builds. How do I set it up to do so? Can I simply copy fortcom.exe over to bin/intel64.

Note that everything worked fine until I did an intel software update...

Thanks!

String encrypting in Fortran

Why my fortran jobs got killed?

$
0
0

Hi,

I have encountered a very strange problem while running my fortran code on a ubuntu system. I was using the PARDISO to solve a very 'huge' system using the OOC mode. For a first case, according to iparm(17), it required 680G harddisk storage. And the problem was solved without any issue. For the second case, the matrix size is even bigger, almost twice of the previous one, but the harddisk usage is not increased much, around 700G according to iparm(17). And this is the only difference between these two problems. But the job of the second problem was killed after phase 22. I have used phase 11, 22 and 33 in my code. For both cases, I have set the ulimit to unlimited and the KMP_STACKSIZE to 5G. So, what should be the problem? Why the second job was killed by the system. Any suggestion will be much appreciated.

By the way, the machine I was using has 250G RAM, but for large problems I still needs to use the OOC mode.

incompatibilty between libifcore.a between ifort 15.0.0 and 15.0.2

$
0
0

The following affects one of our Library builds, built using ifort 15.0.0 when compiling and linking a main program against

the shared library using ifort.15.0.2 .......

Using ifort 15.0.0 compile up the following in file nag_test_io.f90  and turn into archive 

  Subroutine nag_test_io(string)
      Character (*) string
      Write(6,*) string
    End Subroutine nag_test_io

ifort -O3 -w -auto -fPIC -axAVX,SSE2 -threads -fexceptions -fp-model precise -c  nag_test_io.f90 -o nag_test_io.o

ar rvf libnag_test.a nag_test_io.o

and make shared

icc -w -fPIC -m64 -axAVX,SSE2 -DPOINTER64 -fp-model precise -DLONG_CHARLEN -fexceptions -shared -Wl,-rpath=\$ORIGIN,-z,origin -Wl,-soname,libnag_test.so -o libnag_test.so -Wl,--whole-archive libnag_test.a -Wl,--no-whole-archive -Wl,--no-undefined /opt/intel/composer_xe_2015.0.090/compiler/lib/intel64/libifcoremt_pic.a /opt/intel/composer_xe_2015.0.090/compiler/lib/intel64/libsvml.a /opt/intel/composer_xe_2015.0.090/compiler/lib/intel64/libimf.a /opt/intel/composer_xe_2015.0.090/compiler/lib/intel64/libirc.a -lpthread -lpthread -lm -L/opt/intel/composer_xe_2015.0.090/compiler/lib/intel64 -liomp5

Compile the follwing in file test_ifort.f90 

    Program test_ifort_io_compat

     Call nag_test_io('testing ifort io compatibility')

    End Program test_ifort_io_compat

ifort -O3 -w -auto -fPIC -axAVX,SSE2 -threads -fexceptions -fp-model precise -c -I/home/nag/linthouse/lawrence/BUILD_linux_ifort_64/modules test_ifort.f90 -o test_ifort.o

Using ifort.15.0.2 link using 15.0.2 libifcore.a explicitly 

ifort -fPIC -threads test_ifort.o /opt/intel/composer_xe_2015.0.2/lib/intel64/libifcore.a libnag_test.so -o test_ifort.exe

/test_ifort.exe                                                              forrtl: severe (257): formatted I/O to unit open for unformatted transfers, unit 6, file /dev/pts/16
Image              PC                Routine            Line        Source             
test_ifort.exe     000000000041E7B4  Unknown               Unknown  Unknown
libnag_test.so     00007F5868D794A6  Unknown               Unknown  Unknown
libnag_test.so     00007F5868D786AB  Unknown               Unknown  Unknown
test_ifort.exe     0000000000406280  Unknown               Unknown  Unknown
test_ifort.exe     000000000040623E  Unknown               Unknown  Unknown
libc.so.6          00000038A341FFE0  Unknown               Unknown  Unknown
test_ifort.exe     0000000000406139  Unknown               Unknown  Unknown
*** Error in `./test_ifort.exe': free(): invalid pointer: 0x00000000006887c0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x38a347850e]
/lib64/libc.so.6(cfree+0x5b5)[0x38a3484165]
./test_ifort.exe(for__free_vm+0x2a)[0x40adca]
./test_ifort.exe[0x42479b]
./test_ifort.exe(for__deallocate_lub+0x105)[0x423f95]
./test_ifort.exe(for__exit_handler+0x1d4)[0x422ae4]
./test_ifort.exe(for__issue_diagnostic+0x75e)[0x41f16e]
./test_ifort.exe(for__io_return+0x9a4)[0x41e7b4]
/home/nag/linthouse/lawrence/libnag_test.so(for_write_seq_lis+0xdf6)[0x7f5868d794a6]
/home/nag/linthouse/lawrence/libnag_test.so(nag_test_io_+0x3b)[0x7f5868d786ab]
./test_ifort.exe[0x406280]
./test_ifort.exe[0x40623e]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x38a341ffe0]
./test_ifort.exe[0x406139]
======= Memory map: ========
00400000-00485000 r-xp 00000000 fd:02 11534875                           /home/nag/linthouse/lawrence/test_ifort.exe
00684000-00685000 r--p 00084000 fd:02 11534875                           /home/nag/linthouse/lawrence/test_ifort.exe
00685000-00688000 rw-p 00085000 fd:02 11534875                           /home/nag/linthouse/lawrence/test_ifort.exe
00688000-0068f000 rw-p 00000000 00:00 0 
019dc000-019fd000 rw-p 00000000 00:00 0                                  [heap]
38a3000000-38a3021000 r-xp 00000000 fd:00 394510                         /usr/lib64/ld-2.20.so
38a3221000-38a3222000 r--p 00021000 fd:00 394510                         /usr/lib64/ld-2.20.so
38a3222000-38a3223000 rw-p 00022000 fd:00 394510                         /usr/lib64/ld-2.20.so
38a3223000-38a3224000 rw-p 00000000 00:00 0 
38a3400000-38a35b4000 r-xp 00000000 fd:00 394521                         /usr/lib64/libc-2.20.so
38a35b4000-38a37b3000 ---p 001b4000 fd:00 394521                         /usr/lib64/libc-2.20.so
38a37b3000-38a37b7000 r--p 001b3000 fd:00 394521                         /usr/lib64/libc-2.20.so
38a37b7000-38a37b9000 rw-p 001b7000 fd:00 394521                         /usr/lib64/libc-2.20.so
38a37b9000-38a37bd000 rw-p 00000000 00:00 0 
38a3800000-38a3803000 r-xp 00000000 fd:00 420714                         /usr/lib64/libdl-2.20.so
38a3803000-38a3a02000 ---p 00003000 fd:00 420714                         /usr/lib64/libdl-2.20.so
38a3a02000-38a3a03000 r--p 00002000 fd:00 420714                         /usr/lib64/libdl-2.20.so
38a3a03000-38a3a04000 rw-p 00003000 fd:00 420714                         /usr/lib64/libdl-2.20.so
38a3c00000-38a3c17000 r-xp 00000000 fd:00 399707                         /usr/lib64/libpthread-2.20.so
38a3c17000-38a3e16000 ---p 00017000 fd:00 399707                         /usr/lib64/libpthread-2.20.so
38a3e16000-38a3e17000 r--p 00016000 fd:00 399707                         /usr/lib64/libpthread-2.20.so
38a3e17000-38a3e18000 rw-p 00017000 fd:00 399707                         /usr/lib64/libpthread-2.20.so
38a3e18000-38a3e1c000 rw-p 00000000 00:00 0 
38a4400000-38a4507000 r-xp 00000000 fd:00 407855                         /usr/lib64/libm-2.20.so
38a4507000-38a4706000 ---p 00107000 fd:00 407855                         /usr/lib64/libm-2.20.so
38a4706000-38a4707000 r--p 00106000 fd:00 407855                         /usr/lib64/libm-2.20.so
38a4707000-38a4708000 rw-p 00107000 fd:00 407855                         /usr/lib64/libm-2.20.so
38a5800000-38a5816000 r-xp 00000000 fd:00 414832                         /usr/lib64/libgcc_s-4.9.2-20141101.so.1
38a5816000-38a5a15000 ---p 00016000 fd:00 414832                         /usr/lib64/libgcc_s-4.9.2-20141101.so.1
38a5a15000-38a5a16000 r--p 00015000 fd:00 414832                         /usr/lib64/libgcc_s-4.9.2-20141101.so.1
38a5a16000-38a5a17000 rw-p 00016000 fd:00 414832                         /usr/lib64/libgcc_s-4.9.2-20141101.so.1
7f5867499000-7f586749c000 rw-p 00000000 00:00 0 
7f586749c000-7f58674f5000 r-xp 00000000 00:28 20967365                   /fserver/intel/opt/intel/composer_xe_2015.2.164/compiler/lib/intel64/libintlc.so.5
7f58674f5000-7f58676f4000 ---p 00059000 00:28 20967365                   /fserver/intel/opt/intel/composer_xe_2015.2.164/compiler/lib/intel64/libintlc.so.5
7f58676f4000-7f58676f6000 rw-p 00058000 00:28 20967365                   /fserver/intel/opt/intel/composer_xe_2015.2.164/compiler/lib/intel64/libintlc.so.5
7f58676f6000-7f58676f7000 rw-p 00000000 00:00 0 
7f58676f7000-7f58676fc000 r-xp 00000000 fd:00 3163927                    /opt/NAG/fll6i25dc/rtl/intel64/libirng.so
7f58676fc000-7f58678fc000 ---p 00005000 fd:00 3163927                    /opt/NAG/fll6i25dc/rtl/intel64/libirng.so
7f58678fc000-7f58678fe000 rw-p 00005000 fd:00 3163927                    /opt/NAG/fll6i25dc/rtl/intel64/libirng.so
7f58678fe000-7f58678ff000 rw-p 00000000 00:00 0 
7f58678ff000-7f5868317000 r-xp 00000000 fd:00 3163929                    /opt/NAG/fll6i25dc/rtl/intel64/libsvml.so
7f5868317000-7f5868517000 ---p 00a18000 fd:00 3163929                    /opt/NAG/fll6i25dc/rtl/intel64/libsvml.so
7f5868517000-7f586854e000 rw-p 00a18000 fd:00 3163929                    /opt/NAG/fll6i25dc/rtl/intel64/libsvml.so
7f586854e000-7f58687c7000 r-xp 00000000 fd:00 3163923                    /opt/NAG/fll6i25dc/rtl/intel64/libimf.so
7f58687c7000-7f58689c6000 ---p 00279000 fd:00 3163923                    /opt/NAG/fll6i25dc/rtl/intel64/libimf.so
7f58689c6000-7f5868a08000 rw-p 00278000 fd:00 3163923                    /opt/NAG/fll6i25dc/rtl/intel64/libimf.so
7f5868a08000-7f5868afc000 r-xp 00000000 fd:00 3163924                    /opt/NAG/fll6i25dc/rtl/intel64/libiomp5.so
7f5868afc000-7f5868cfc000 ---p 000f4000 fd:00 3163924                    /opt/NAG/fll6i25dc/rtl/intel64/libiomp5.so
7f5868cfc000-7f5868d07000 rw-p 000f4000 fd:00 3163924                    /opt/NAG/fll6i25dc/rtl/intel64/libiomp5.so
7f5868d07000-7f5868d35000 rw-p 00000000 00:00 0 
7f5868d6a000-7f5868d6b000 rw-p 00000000 00:00 0 
7f5868d6b000-7f5868e00000 r-xp 00000000 fd:02 11534883                   /home/nag/linthouse/lawrence/libnag_test.so
7f5868e00000-7f5869000000 ---p 00095000 fd:02 11534883                   /home/nag/linthouse/lawrence/libnag_test.so
7f5869000000-7f5869003000 r--p 00095000 fd:02 11534883                   /home/nag/linthouse/lawrence/libnag_test.so
7f5869003000-7f5869007000 rw-p 00098000 fd:02 11534883                   /home/nag/linthouse/lawrence/libnag_test.so
7f5869007000-7f5869010000 rw-p 00000000 00:00 0 
7fff38af6000-7fff38b19000 rw-p 00000000 00:00 0                          [stack]
7fff38bb5000-7fff38bb7000 r--p 00000000 00:00 0                          [vvar]
7fff38bb7000-7fff38bb9000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Abort (core dumped)

 

 

no license sent with evaluation version

$
0
0

Hi,

I just downloaded the evaluation version of the fortran compiler, but I didn't get the license that goes with it so I can't install it. Please can someone at Intel send it to me?

Thanks, Ben

Annoying warning #8753

$
0
0

Since I use the 2013 Fortran compiler I get an annoying warning:

warning #8753: A CHARACTER component of an interoperable derived type must have length 1.

It is caused by following type which is an equivalent to a simple C data structure of a DLL:

type, bind(C) :: MDSLConfigA
    character(MDSL_APPNAME_LEN, C_CHAR) :: szAppName   
    character(MDSL_MAXPATH_LEN, C_CHAR) :: szLocalPath 
    character(MDSL_MAXPATH_LEN, C_CHAR) :: szGlobalPath
    character(MDSL_MAXPATH_LEN, C_CHAR) :: szHelpFile  
    integer(C_INT)                      :: iLangID     
end type MDSLConfigA
typedef struct MDSLConfigA_ {
    char    szAppName[MDSL_APPNAME_LEN];
    char    szLocalPath[_MAX_PATH];    
    char    szGlobalPath[_MAX_PATH];   
    char    szHelpFile[_MAX_PATH];     
    int     iLangID;                   
} MDSLConfigA;                         

Is there a way to disable the warning or to avoid it?

Thanks in advance for all comments.

 

fatal error LNK1104: cannot open file 'ifconsol.lib

$
0
0

Hello:

I have installed the 30-day trial Intel Parallel Studio XE Composer.  I also installed Microsoft Visual 12. I am new to using a compiler.  I am new at troubleshooting issues concerning computers.  I am a new beginner at using Visual C++ or fortran.  I have read other forum entries to learn about similar situations.   I have had IT support for these types of projects at school or work.  Expect, I am trying to install on my home computer with the hopes of using a compiler.  I am trying to compile a ANSYS fortran user subroutine using these products.  I keep getting the following error: LINK: fatal error LNK1104: cannot open file 'ifconsol.lib'.  I have located the file at this location: C:\\Program Files (x86)\Intel\Composer XE 2015\ compile\lib\intel64

I would like to have some success with this product.  But, so far the trial product is very hard to get configured for use.

Can someone help me with this error.

Regards,

Julie D


IFLOGM dialog scroll bar position problem

$
0
0

I was making an update to my last remaining program that uses IFLOGM for dialogs rather than the Windows SDK. Consider the small routine below which gets the handle for a list box on a modeless dialog, gets the min / max range of the vertical scroll bar and then sets the current position to the max position such that you can see the info that has been put there.

This works fine in that the 'get' returns the correct values, and 'set' returns with the correct position before the update, however irrespective of where the slider thumb was or has been set to the dialog is always then displayed with the thumb moved to position zero. IE my set has no effect. 

Is my code wrong? Is it just a 'feature' of the IFLOGM implementation of dialogs? Is there a simple alternative method?

Any ideas would be appreciated. Best Regards, Andrew 

subroutine update_scroll_pos()
    use             :: ifwin, only: bool, LPINT, GetScrollRange, TRUE, SetScrollPos, &
                                    SB_VERT, SINT, GetDlgItem, handle, SB_CTL
    use             :: dku, only: gdlg, IDC_LIST_MESG
    use, intrinsic  :: iso_c_binding, only: c_loc
    implicit none
    integer(handle) :: Hwnd
    integer(bool)   :: bret
    integer         :: ipmin, ipmax
    integer(SINT)   :: ipos
    hwnd = GetDlgItem(gdlg%hwnd,IDC_LIST_MESG)
    bret = GetScrollRange( Hwnd, SB_VERT, &
                           transfer(C_loc(ipmin),hwnd),&
                           transfer(C_loc(ipmax),hwnd)     )
    if(bret /= 0) ipos = SetScrollPos( Hwnd, SB_VERT, int(ipmax, sint) , TRUE )
end subroutine update_scroll_pos 

 

Read hex byte into character(1)

$
0
0

I have a character variable of length 2, eg ch2 = '4f', which I want to read into a character variable of length 1, ch1, which must contain the ASCII representation of the 2-char string, ie. Z'4f' ie. ch1='O'.  Is there an elegant way to do this in a READ / FORMAT statement?  Something like read(ch2,'(z2)') ch1?

demo code specifically dll_shared_data

$
0
0

I recently downloaded composer edition XE 2015 update 2 for trial and I am trying to get 2 programs to share data, I have tried several things that I saw online to accomplish this, the 2 programs both will link but they do not share the data (i.e. the variable has one value in one program and a different value in the other)... I specifically have been trying a dll and the !DEC$ ATTRIBUTES DLLEXPORT (and DLLIMPORT) method 

I see there is a sample program called dll_shared_data taht is supposed to illustrate this functionality, but this solution does not appear to be included in what I downloaded... can anyone post this code snippet or tell me where it is available?

Thanks

15.0.2.179 and Multithread libraries problem

$
0
0

Hello,

Today I started to have a problem when trying to run my code.
The code must read an HDF5 file and at some point, return the biggest value on one specific dataset.

The dataset is set to 0.0 on all its values, but the value found was much bigger.

I try to run the code in DEBUG to find the error, as there was some changes in the code since the last time I compiled, but in DEBUG, the error goes away.
I thought that could be a problem with OpenMP, so I disabled the OpenMP on Release mode. But the error was still there.
After many tests, I could determine that the error only happens when I use the Multithread option in the Compiler Runtime Libraries. Even in Release Mode, if I change it to Debug Multithread, the program seems to works as supposed, like when in Debug mode.

Could you give me some advice on how to look to this problem?
I'll try to compile the code without changes and than add the different pieces of code until I find the culprit, but I would like to know if a broken code could cause a problem when using the Runtime Multithread libraries without cause the same problems when using the Debug Multithread runtime libraries.
 

Thanks for your time :)
Eduardo

error #8055

$
0
0

Error 8055 occurred in my code.

program main
    integer,allocatable::a(:)
    integer n
    n=4
    allocate(a(n))
    call func(a,n)
    endprogram

    subroutine func(a,n)
    integer n
    integer,target::a(n)
    a(1)=1
    endsubroutine

Error    1     error #8055: The procedure has a dummy argument that has the ALLOCATABLE, ASYNCHRONOUS, OPTIONAL, POINTER, TARGET, VALUE or VOLATILE attribute. Required explicit interface is missing from original source.   [A]   

The above is just demonstration I wrote for my original code.

 

Viewing all 3270 articles
Browse latest View live