fortran95 Questions

3

Solved

I would like to program some procedure that will work with different types. I am planning to use the "include" method used in flibs described here and here. I give here a simple exemple. ! ------...
Kincardine asked 5/6, 2014 at 15:46

8

Solved

I've been trying to find a standards-compliant way to check for Infinite and NaN values in Fortran 90/95 but it proved harder than I thought. I tried to manually create Inf and NaN variables usin...
Lactoprotein asked 30/6, 2013 at 11:36

2

Solved

I have a .dat file , from which I am trying to read line by line and print it. Can anyone please help about how to do it in fortran? Thanks in advance! Data: REMARK GENERATED BY TRJCONV TITLE UN...
Fremd asked 9/7, 2017 at 21:47

2

Suppose I have the following code program fortran open(900, FILE='SOMETHING') write(900, *) '21' end program fortran The file form will be 21 that is, there is a space before the number....
Windowsill asked 30/7, 2014 at 18:58

3

Solved

I just want to know if the return statement in Fortran 2008 is obsolete, because it seems to be unnecessary to write it at the end of subroutines and functions. Does it have some other utility?
Saw asked 12/4, 2018 at 16:47

2

I'm trying to incorporate error checking within a pure procedure I am writing. I would like something like: pure real function func1(output_unit,a) implicit none integer :: a, output_unit if (...
Sclerenchyma asked 7/1, 2012 at 3:50

1

Solved

Unless I'm mistaken, there is no way in Fortran to write a function or subroutine with an arbitrary number of arguments (known more succinctly as a variadic function). For example: RESULT = FUNC(...

3

Solved

I'm working on a project that needs to implement few numerical methods in Fortran. For this, I need to write some recursive functions. Here is my code. ! ! File: main.F95 ! RECURSIVE FUNCTION in...
Telegraphone asked 5/8, 2012 at 12:19

2

Solved

When I compile the program below, I have an error and a warning in the call Coor_Trans command line as Warning: Line truncated Error: Syntax error in argument list I compile the program several t...
Tuttle asked 10/12, 2015 at 5:46

4

I have been tasked with writing a Fortran 95 program that will read character input from a file, and then (to start with) simply spit it back out again. The tricky part is that these lines of input...
Surfboat asked 8/2, 2013 at 3:49

1

Solved

In Fortran, there are two standard ways to return a result from a function. The first one is by assigning the return value of the function to the function name. function foo() integer :: foo fo...
Floreneflorentia asked 25/6, 2015 at 21:58

1

Solved

I installed gfortran on my Ubuntu 15.04 system. While compiling Fortran code, the DO loop asks to take integer parameters only and not real values or variables. That includes the loop variable and ...
Vitrescent asked 8/6, 2015 at 11:13

3

Solved

program Test implicit none character (LEN=100) :: input character (LEN=100) :: output print *,"Please input your message: " read *, input For every character, I encrypt it in Ceaser's Cipher Ca...
Killoran asked 15/2, 2013 at 0:56

1

Solved

I have multiple subroutines with a parameter p which is an array of explicit size like subroutine foo(p) integer,dimension(2),intent(in) ::p end subroutine foo subroutine bar(p) integer,dimension...
Gradygrae asked 3/6, 2015 at 12:49

2

Solved

I'm currently delving into Fortran and I've come across the pure keyword specifying functions/subroutines that have no side effects. I have a book, Fortran 90/95 by S Chapman which introduces the ...
Selvage asked 15/5, 2015 at 16:46

2

Fortran is completely new for me, can anybody help me to solve the follwing problem? I want to find out all the integer kind numbers and the largest and the smallest value for each kind number on m...
Laurasia asked 5/3, 2012 at 15:58

2

Solved

Suppose I have a subroutine which accepts two arrays as input. One is given intent(in) and the other is given intent(out). The latter is derived from the former in an arbitrary manner. However, wha...
Golanka asked 22/8, 2011 at 1:0

1

Solved

I would like to know what is the different between this statement: open(unit=11,file="something.TXT",status="unknown"), which is Fortran's default status (i.e., the previous statement is the same ...
Remorse asked 25/3, 2014 at 13:24

2

Solved

I have a Fortran program which I need to modify, so I'm reading it and trying to understand. Can you please explain what the formatting string in the following statement means: write(*,'(1p,(5x,3(...
Swap asked 12/3, 2014 at 11:29

2

Solved

I have a derived type (wrapper) containing an other derived type (over). For the latter the assignment operator have been overloaded. As the assignment of derived types happens per default componen...
Nursemaid asked 28/9, 2013 at 6:38

3

How do I get the contents of a directory in Fortran 95?
Sinewy asked 17/1, 2012 at 10:6

2

Solved

I have the following Fortran code: Program Strange Real(Kind=8)::Pi1=3.1415926535897932384626433832795028841971693993751058209; Real(Kind=8)::Pi2=3.1415926535897932384626433832795028841971693993...
Jacobina asked 4/5, 2013 at 3:11

2

This program crashes with Illegal instruction: 4 on MacOSX Lion and ifort (IFORT) 12.1.0 20111011 program foo real, pointer :: a(:,:), b(:,:) allocate(a(5400, 5400)) allocate(b(5400, 3600)) a=...
Maury asked 28/8, 2012 at 21:7

1

Solved

New to Fortran (just started today), having trouble with the natural logarithm: PROGRAM log IMPLICIT NONE REAL :: x PRINT *, "Enter a number:" READ *, x x = log (x) PRINT *, "The natural log of...
Corporeal asked 27/10, 2012 at 21:21

1

Solved

I am looking for a library for dealing with sparse matrices in fortran 90/95. I only need very basic operations like matrix-vector multiplication. What do you suggest I use? I have searched around...
Nonlinearity asked 8/9, 2012 at 6:6

© 2022 - 2024 — McMap. All rights reserved.