fortran90

Fortran 90 - to transmit values from main subroutine to the functions and other subroutines

醉酒当歌 提交于 2020-01-15 05:14:11
问题 I hope everyone's doing good. I presently have a project at work and I'm having a hard time dealing with some programming techniques. To summarize my project, I have to modify some codes on Fortran so that it can be adapted to be used on a simulation software called PRO/II. All the functions and subroutines have already been written. However, to make the codes compatible with PRO/II, I have to change the way of assigning some input data (input by the user himself) on Fortran. In fact, before,

How to read a matrix and write certain values to a new file in Fortran

有些话、适合烂在心里 提交于 2020-01-14 05:42:08
问题 I am doing a chemistry research project and presently have a 378 x 378 matrix of zeros and ones in a file called Connectivity-M.txt . I am trying to write a simple program to read down each column of the matrix and look for entries with a value of one. Since the matrix is of the format A(i,j) I want to program to write the i , j location for each value of one that it finds to a new file, Wires.txt . Here is my code so far: program connectivity_matrixread IMPLICIT none integer :: i , j INTEGER

Using MPI_Send/Recv to handle chunk of multi-dim array in Fortran 90

心已入冬 提交于 2020-01-14 04:07:08
问题 I have to send and receive (MPI) a chunk of a multi-dimensional array in FORTRAN 90. The line MPI_Send(x(2:5,6:8,1),12,MPI_Real,....) is not supposed to be used, as per the book "Using MPI..." by Gropp, Lusk, and Skjellum. What is the best way to do this? Do I have to create a temporary array and send it or use MPI_Type_Create_Subarray or something like that? 回答1: The reason not to use array sections with MPI_SEND is that the compiler has to create a temporary copy with some MPI

Using Gatherv for 2d Arrays in Fortran

我与影子孤独终老i 提交于 2020-01-14 02:02:28
问题 I have a number of 2d arrays of size = (2,9) on different processes, which I want to concatenate using MPI_Gatherv in a global array of size = (2*nProcs,9) on the root process. For this I'm trying to adapt this post: Sending 2D arrays in Fortran with MPI_Gather But I do really understand what they are doing and my example isn't working: program testing use mpi implicit none integer(4), allocatable :: local(:,:) integer(4), allocatable :: global(:,:), displs(:), counts(:) integer(4) :: me,

Identify version of Fortran of this code for the LF compiler

痴心易碎 提交于 2020-01-13 20:49:13
问题 I'm new to Fortran. I was given a file that is supposed to be in Fortran 90, but written to be compiled with the Lahey Fujitsu compiler (the sparse documentation states that it should be compiled with lf95 filename.f -out compiled_name @imsllf95.cmd ). However, some lines are commented with c , which as I understand was the way to comment in Fortran 77. Also, matrices are declared like REAL*8, DIMENSION(23,8) :: xxx19 , which again I think is from Fortran 77. For the most part, I can compile

Identify version of Fortran of this code for the LF compiler

試著忘記壹切 提交于 2020-01-13 20:49:00
问题 I'm new to Fortran. I was given a file that is supposed to be in Fortran 90, but written to be compiled with the Lahey Fujitsu compiler (the sparse documentation states that it should be compiled with lf95 filename.f -out compiled_name @imsllf95.cmd ). However, some lines are commented with c , which as I understand was the way to comment in Fortran 77. Also, matrices are declared like REAL*8, DIMENSION(23,8) :: xxx19 , which again I think is from Fortran 77. For the most part, I can compile

How to add new element to dynamical array in Fortran90

萝らか妹 提交于 2020-01-13 19:26:44
问题 [SOLVED] by francescalus. Working code for double precision dynamical arrays is: module DynamicalArrays contains subroutine AddToList(list, element) IMPLICIT NONE integer :: i, isize double precision, intent(in) :: element double precision, dimension(:), allocatable, intent(inout) :: list double precision, dimension(:), allocatable :: clist if(allocated(list)) then isize = size(list) allocate(clist(isize+1)) do i=1,isize clist(i) = list(i) end do clist(isize+1) = element deallocate(list) call

converter software for fortran 77 to fortran 90 [closed]

泄露秘密 提交于 2020-01-12 02:18:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . i have coding for fortran 77 but i want to converted to fortran 90..where can i donwload the converter software?? 回答1: The first hit on a Google query for "fortran 77 convert 90" returned this page, which has 3 free tools and 2 commercial ones listed (after clicking the link for "Subprograms, Converters, Key

Scope of variables in case of modules used by modules in Fortran

久未见 提交于 2020-01-11 10:03:46
问题 I've noticed that variables in a (child) module, which are used by a parent modules are accessible in a main program through just the parent module. This is one concept which clearly distinguishes use statement in Fortran from include statement in C/C++. The following programs clearly illustrate this concept. a.f90 module a_mod use b_mod implicit none integer :: a end module b.f90 module b_mod use c_mod implicit none integer :: b end module c.f90 module c_mod implicit none integer :: c = 10

Unable to implement MPI_Intercomm_create

ⅰ亾dé卋堺 提交于 2020-01-07 07:44:06
问题 I am trying to implement an MPI_intercomm in Fortran between 2 inter communicators, one which has first 2 process and the other having the rest. I need to perform send, recv operations between the newly created communicators. The code: program hello include 'mpif.h' integer tag,ierr,rank,numtasks,color,new_comm,inter1,inter2 tag = 22 call MPI_Init(ierr) call MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) call MPI_COMM_SIZE(MPI_COMM_WORLD,numtasks,ierr) if (rank < 2) then color = 0 else color = 1 end