|
|
Up |
|
|
  |
|
|
  |
Author: MichaelMichael
Date: Apr 30, 2008 14:05
Comp.lang.fortran Group Discussion
Hello,
I’m somewhat new to Fortran, so this is partly tutorial as well as
troubleshooting. Consider: we have a derived type looking something
like the following.
type grid
real(kind = rkind), pointer :: x(:)
real(kind = rkind), pointer :: y(:)
real(kind = rkind), pointer :: sigmaz(:)
real(kind = rkind), allocatable :: zg(:,:)
end type grid
We then declare a couple of variables using this as the type.
type (grid), allocatable, target, dimension(:) :: m_grid
type (grid), target :: c_grid
m_grid ends up being of a single dimension. On the other hand, c_grid
doesn’t appear to be allocated anywhere.
We pass the each grid through a couple of functions as a parameter
looking like the following,
type (grid), intent(out) :: grid_dat
|
| Show full article (2.50Kb) |
|
| |
16 Comments |
|
  |
Author: Dan NagleDan Nagle
Date: Apr 30, 2008 09:52
Hello,
Let me remind everyone that a Public Comment period
for the draft of the Fortran 2008 standard will be
during early June to eraly July. I don't know
the exact dates now, I will post them when I do know.
You may want to start reading the draft now, as it's
about 600 pages. The draft is 08-007r2.pdf on J3's site,
and N1623.pdf on WG5's.
Comments may be sent to J3 via an email address that
I will post when the comment period actually starts.
Those outside the USA may send their comments to their
national body. The definitive list is here:
I'll
>
post more when I know more. :-)
--
Cheers!
|
| Show full article (0.79Kb) |
|
2 Comments |
|
  |
Author: hiphophiphop
Date: Apr 30, 2008 08:52
If I have a vector: V(10000)
I am interested get index where (V > a) .AND. (V < b)
How do you do in fortran 90/95?
example:
Suppose V = (/103,102,103,104,105/)
a = 102
b = 105
I am interested get index for (V > a ) .AND. (V < b) ==> answer:
1,3, 4
|
| |
|
9 Comments |
|
  |
Author: Gib BogleGib Bogle
Date: Apr 29, 2008 00:57
Consider a derived type used thus:
type mytype
integer :: a,b,c
real :: x,y,z
real, allocatable :: mydata(:)
end type
type(mytype), allocatable :: cell(:)
type(mytype) :: acell
allocate(cell(1000))
do i = 1,1000
if (i <= 500) then
allocate(cell(i)%%mydata(10))
else
allocate(cell(i)%%mydata(100))
endif
enddo
acell = cell(100)
...
acell = cell(600)
|
| Show full article (0.92Kb) |
|
18 Comments |
|
  |
Author: EdEd
Date: Apr 28, 2008 19:24
Hello
Although some examples are shown at http://www.star.le.ac.uk/~cgp/dislinGUI.html,
I wonder whether someone out there would have a couple of more
examples on how to make GUIs with dislin (fortran).
Right row, I need to know how to create a GUI where I can enter real*8
values on two separate columns, one next to the other (something like
an excel sheet). Each column should hold 24 values.
Any help would be most appreciated.
Many thanks
Ed
|
| |
|
4 Comments |
|
  |
Author: Matthew HalfantMatthew Halfant
Date: Apr 28, 2008 06:53
I'm not sure if this posting is proper etiquette, but I believe that some
readers of this newsgroup will be interested in my Craig's list posting of
four vintage F77 compilers bundled at a low price. I can't ship these, so
it's a pickup-only cash transaction for Silicon Valley residents. See:
http://sfbay.craigslist.org/sby/sys/658489968.html
If someone informs me that this newsgroup posting is not proper, then I
apologize and promise not to do it again.
|
| |
|
3 Comments |
|
  |
Author: blitheliblitheli
Date: Apr 28, 2008 05:28
Is anybody can tell me what is wrong with this? Is this a fatal error
in fortran?
Thanks!
-------------------------------
module test
implicit none
type :: ccc
sequence
private
logical :: is_null=.true.
real(8):: A0=0d0,B0=0d0, Lambda0=0d0, H0=0d0
end type ccc
end module test
-------------------------------
The compile says:
Warning: The structure contains one or more misaligned fields.
[CCC]
|
| |
|
11 Comments |
|
  |
Author: James Van BuskirkJames Van Buskirk
Date: Apr 27, 2008 16:22
In attempting to create a digestible version of a program that gives
gfortran an ICE and causes incorrect output for ifort, the critical
factor for both seems to be a line such as:
implicit character(len=*,kind=kind('A')) (Q)
In the sense that if the LEN is changed to 3 both ifort and gfortran
get happy with the code. Is this syntactically incorrect or simply
obscure enough that it didn't get sufficient testing on either
compiler?
C:\gfortran\clf\startest>type startest.f90
module mod
implicit character(len=*,kind=kind('A')) (Q)
parameter(Q1 = 'Test Me!')
parameter(Q2 = 'Test Me Too!')
contains
subroutine sub(Q3)
write(*,*) '#'//Q3//'#'
end subroutine sub
end module mod
|
| Show full article (1.74Kb) |
|
13 Comments |
|
  |
|
|
  |
Author: Walter SpectorWalter Spector
Date: Apr 27, 2008 06:48
Fellow clfers,
Consider the following:
subroutine commonptr ()
implicit none
type wws_t ! No SEQUENCE and has default initialization
integer :: x = 1, y = 2, z = 3
end type
type (wws_t), pointer :: my_wwsptr
common /block/ my_wwsptr
allocate (my_wwsptr)
my_wwsptr = wws_t (3, 4, 5)
end subroutine
We all know that for a derived type object to reside in COMMON, it
must have a SEQUENCE attribue, and must not have default initialization
specified. These are documented in constraint C589 in § 5.5.2 of F2003:
"C589 (R558) If a common-block-object is of a derived type, it shall be
a sequence type or a type with the BIND attribute and it shall have no
default inititialization."
|
| Show full article (1.05Kb) |
|
4 Comments |
|
|
|
|