Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Getting started using Fortran 90
Getting started using Fortran 90
I will be starting a class soon in high performance computing. One of the languages being used will be Fortran 90 and I would like to get it setup and learn a little about it. I have installed libnetcdf-dev which " includes everything needed for developing in C, C++, Fortran 77, and Fortran 90." Has anyone used this language on Debian and can you point me to documentation on how to get started? If there is some built in documentation, how can I access it? (Sorry .... I am a new Debian user ). Any help would be greatly appreciated.
Re: Getting started using Fortran 90
Hi.
I think you have installed a library that is suitable for dealing with netcdf: NetCDF (network Common Data Form) is an interface for scientific
data access
If you intend to use Fortran I suggest you install gfortran:
which will install the compiler, libraries, etc.
It, in turn, will probably cause other items it be installed, libraries, gcc, ld, etc.
When you think you are done, enter:
and you should see:
if it is not installed, you'll see something like:
There are other items that may be useful in the future, like make, etc. These are most easily installed with a package build-essential.
Other Fortran compilers are available (e.g Intel for personal use, g95, neither of which is in the repositories; gfortran is the easiest to install.)
Best wishes ... cheers, drl
A sample Fortran code, hi.f90:
when compiled with gfortran hi.90 will create a linked program a.out, which, when run as ./a.out xx yy zz will produce:
I think you have installed a library that is suitable for dealing with netcdf: NetCDF (network Common Data Form) is an interface for scientific
data access
If you intend to use Fortran I suggest you install gfortran:
Code: Select all
apt-get install gfortran
Code: Select all
Package: gfortran
...
Description-en: GNU Fortran 95 compiler
This is the GNU Fortran 95 compiler, which compiles Fortran 95 on platforms
supported by the gcc compiler. It uses the gcc backend to generate optimized
code.
When you think you are done, enter:
Code: Select all
gfortran
Code: Select all
gfortran: fatal error: no input files
Code: Select all
gfortran: command not found
Other Fortran compilers are available (e.g Intel for personal use, g95, neither of which is in the repositories; gfortran is the easiest to install.)
Best wishes ... cheers, drl
A sample Fortran code, hi.f90:
Code: Select all
program hi
! @(#) hi Demonstrate Fortran-90.
! http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gfortran/
! GET_005fCOMMAND.html TRIM.html GET_005fCOMMAND_005fARGUMENT.html
integer :: i
character (len=32) :: arg
integer :: count
character (len=255) :: cmd, line
!1234567890123456789012345678901234567890123456789012345678901234567890
! Default unit numbers: 0 STDERR, 5 STDIN, 6 STDOUT
! open(0,file="/dev/null") ! comment out to get debugging output
call get_command (cmd)
write (0,*) " Command line = ", trim (cmd)
count = command_argument_count ()
write (line, fmt="(a,i2)") " Argument count = ", count
write (0,*) trim (line)
if (count <= 0) then
write (0,*) " Hello, world from Fortran-90."
else
do i = 1, count
call get_command_argument (i, arg)
write (line, fmt="(a,i2,a,a,a)") " Argument ", i, " = ", trim &
& (arg)
write (0,*) trim (line)
end do
end if
!234567890123456789012345678901234567890123456789012345678901234567890
do 11111 i = 1, 3
write (*,*) " i = ", i
11111 continue
end
Code: Select all
$ ./a.out xx yy zz
Command line = ./a.out xx yy zz
Argument count = 3
Argument 1 = xx
Argument 2 = yy
Argument 3 = zz
i = 1
i = 2
i = 3
["Sure, I can help you with that." -- USBank voice recognition system.
( Mn, 2.6.x, AMD-64 3000+, ASUS A8V Deluxe, 3 GB, SATA + IDE, NV34 )
Debian Wiki | Packages | Backports | Netinstall
( Mn, 2.6.x, AMD-64 3000+, ASUS A8V Deluxe, 3 GB, SATA + IDE, NV34 )
Debian Wiki | Packages | Backports | Netinstall
Re: Getting started using Fortran 90
Hi.
That's good news -- keep us posted ... cheers, drljohnu1960 wrote:Thanks drl! So far so good.
["Sure, I can help you with that." -- USBank voice recognition system.
( Mn, 2.6.x, AMD-64 3000+, ASUS A8V Deluxe, 3 GB, SATA + IDE, NV34 )
Debian Wiki | Packages | Backports | Netinstall
( Mn, 2.6.x, AMD-64 3000+, ASUS A8V Deluxe, 3 GB, SATA + IDE, NV34 )
Debian Wiki | Packages | Backports | Netinstall