intel-fortran

Sign of infinity on division by zero

ε祈祈猫儿з 提交于 2021-01-27 10:49:59
问题 I've implemented code to find the polar coordinates of a point in 2D space. if the point lies in the 1st or 2nd Quadrant, 0<=theta<=pi and if it lies in the 3rd or 4th Quadrant, -pi <= theta <= 0 . module thetalib contains real function comp_theta( x1, x2) implicit none real , intent(in) :: x1, x2 real :: x1p, x2p real :: x1_c=0.0, x2_c=0.0 real :: pi=4*atan(1.0) x1p = x1 - x1_c x2p = x2 - x2_c ! - Patch !if ( x1p == 0 .and. x2p /= 0 ) then ! comp_theta = sign(pi/2.0, x2p) !else ! comp_theta

Reading Binary on different Architectures - Fortran runtime error: I/O past end of record on unformatted file

折月煮酒 提交于 2020-07-10 10:27:19
问题 I am having some issues on reading a binary (unformatted restart file ~2GB ) written within a Fortran program, by the call here below: open(unit=1,file=opfile,status="unknown",form="unformatted") ! write(1) t ! write(1) Rho, Rho_ut, Rho_ur, Rho_uz, Rho_Ya ! close(1) that has been compiled with ifort on an Intel Xeon Phi 7250 CPU (KNL) architecture. When the same code, that has now been compiled with gfortran on an IBM POWER9 AC922 architecture, read this file with the call here below: open

Passing parameter as parameter in Fortran-90?

前提是你 提交于 2020-05-29 06:55:06
问题 Suppose I have a subroutine: subroutine foo(x, Nx) implicit none integer, intent(IN) :: x integer, intent(IN) :: Nx select case(x) case (1) write(*,*) "Minimum value" case (Nx) write(*,*) "Maximum value" case default write(*,*) "Somewhere in-between" end select end subroutine foo Suppose my driver looks like this: program main implicit none interface subroutine foo(x,Nx) integer, intent(IN) :: x integer, intent(IN) :: Nx end subroutine foo end interface integer, parameter :: Nx = 100 integer

Unrecognized token '&' in Fixed Fortran continuation lines

∥☆過路亽.° 提交于 2020-05-21 06:55:06
问题 I am editing an old project that uses fixed form Fortran and compiling with IVF compiler . The current issue I have is with continuation lines in a list: format(//, 10x,'*******************************************',/, & 10x,'* DIAGONALS OF THE RESIDUAL COV. MATRIX *',/, & 10x,'*******************************************',//, & 2x,'MEASUREMENT',7X,' RESIDUAL COVARIANCE', /) For some reason, the ampersand is not working for me and I keep getting the error: unrecognized token '&' skipped For

Ambiguous reference to variable

旧城冷巷雨未停 提交于 2020-04-03 09:46:51
问题 So I am doing 2 modules which are linking to the main program. The first one has all the variables defined in it and the second one is with the functions. Module1: module zmienne implicit none integer, parameter :: ngauss = 8 integer, parameter :: out_unit=1000 integer, parameter :: out_unit1=1001 integer, parameter :: out_unit2=1002, out_unit3=1003 real(10), parameter :: error=0.000001 real(10):: total_calka, division,tot_old,blad real(10),parameter:: intrange=7.0 real(10),dimension(ngauss)

Ambiguous reference to variable

浪尽此生 提交于 2020-04-03 09:46:20
问题 So I am doing 2 modules which are linking to the main program. The first one has all the variables defined in it and the second one is with the functions. Module1: module zmienne implicit none integer, parameter :: ngauss = 8 integer, parameter :: out_unit=1000 integer, parameter :: out_unit1=1001 integer, parameter :: out_unit2=1002, out_unit3=1003 real(10), parameter :: error=0.000001 real(10):: total_calka, division,tot_old,blad real(10),parameter:: intrange=7.0 real(10),dimension(ngauss)

Ambiguous reference to variable

天涯浪子 提交于 2020-04-03 09:39:25
问题 So I am doing 2 modules which are linking to the main program. The first one has all the variables defined in it and the second one is with the functions. Module1: module zmienne implicit none integer, parameter :: ngauss = 8 integer, parameter :: out_unit=1000 integer, parameter :: out_unit1=1001 integer, parameter :: out_unit2=1002, out_unit3=1003 real(10), parameter :: error=0.000001 real(10):: total_calka, division,tot_old,blad real(10),parameter:: intrange=7.0 real(10),dimension(ngauss)

Undefined references to cublas functions using ifort (cuBLAS Fortran Bindings)

谁说胖子不能爱 提交于 2020-02-05 07:29:05
问题 I have a sample cuBLAS Fortran binding routine provided from a previous question here. I'm running Ubuntu 13.10, IFORT 14.0.1, and Cuda 5.5. The code is below: cublas.f program cublas_fortran_example implicit none integer i, j c helper functions integer cublas_init integer cublas_shutdown integer cublas_alloc integer cublas_free integer cublas_set_vector integer cublas_get_vector c selected blas functions double precision cublas_ddot external cublas_daxpy external cublas_dscal external cublas

How can I make the loop counter not be greater than the final value?

偶尔善良 提交于 2020-02-03 16:48:41
问题 So sample loop: do i=1,1 print *,i enddo print *,i gives me 2 as the final value of i . How can I set up Intel Fortran for Visual Studio on Windows to give me a final value of 1 for i ? 回答1: You can't, because that's how DO works; it stops when the control variable exceeds the limit. In general, in pretty much any language with a FOR/DO counting loop, you should only use the loop control variable inside the loop body, and treat it as undefined elsewhere, even if you can't actually limit its

How can I make the loop counter not be greater than the final value?

回眸只為那壹抹淺笑 提交于 2020-02-03 16:47:51
问题 So sample loop: do i=1,1 print *,i enddo print *,i gives me 2 as the final value of i . How can I set up Intel Fortran for Visual Studio on Windows to give me a final value of 1 for i ? 回答1: You can't, because that's how DO works; it stops when the control variable exceeds the limit. In general, in pretty much any language with a FOR/DO counting loop, you should only use the loop control variable inside the loop body, and treat it as undefined elsewhere, even if you can't actually limit its