Hello
I am using gfortran and I intended to do thiis:
Code:
Module variables
character(len=:), dimension(:), allocatable, array
end module variables
Sub test
use variables
integer (max_len)
max_len=len_trim("something here")
if(.not.allocated(array)) &
allocate(character = max_len :: array(3))
array = (/'jonas', 'sssssssssssssss','q' /)
end sub test
gfortran compilation gives this errors:
Code:
- max_len can not be used in this context:
allocate(character = max_len :: array(3)) &
- Different character lenghts in array constructor:
array = (/'jonas', 'sssssssssssssss','q' /)
I solved this using a number instead of max_len for the first error;
The second error can only be solved if all strings have the same lenght but this is not desired.
with a different compiler no error is displayed.
Moderator's Comments:
Please use code tags
Last edited by jim mcnamara; 12-06-2012 at 09:12 AM..
Hi there,
im having issue with comparing two variables, in a bash script.
im trying to do the following:
- get a word from user 1
- split the word into array
- get a character from user2
trying to compare the character entered by user 2 with every single character in the array... (2 Replies)
Hi There,
Code:
Number=10
i=1
while
do
echo "$i"
Check=`find $viewing -name $File_Pattern -type f -Print`
i=`expr ${i} + 1`
done
Unable to store the values in variable 'Check', when i display i am getting Check nothing... (1 Reply)
Hi!
I have a program in fortran77. This program was compiled with pgf90, but now, I need compiled it with gfortran.
I show a bit of code.
program hello
PARAMETER(a=100)
integer a
write(*,*)'value ', a
end program hello
What's the problem?
Thanks (2 Replies)
if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
Hey all,
This is my first post, and I am relatively new to linux/unix scripts. I am writing a bash script in which I am trying to extract one line from another file and parse specific words from the line into an array. So for example, I have a file called SortScans in which the first 5 lines... (9 Replies)
I am a INTEL fortran user recently migrated to linux and installed gfortran on my system.
I run numerical models as part of my research.
my question is on optimization of the fortran code.
I used the - vectorize option to compile for reducing the run time considerably and was happy. But... (1 Reply)
Hello everyone,
I'm trying since a few days to compile a f90 program with gfortran (on Ubuntu) with a makefile. The fortran program calls 2 routines written in C.
Here is my makefile:
FC = gfortran
SFC = gfortran
FFLAGS = -ffree-form -O... (21 Replies)
Hi to everyone,
Please some help over here.
Hi have array a with 6 elements and array b with 3 elements as shown inside BEGIN{} statement.
I need help to get the correct sintax (the part in red) to compare if string from array b is in array a and print the number
related for each match.... (3 Replies)
I have the following code and for some reason when I call the program using
/home/tcdata/tatsh/trunk/hstmy/bin/bash/raytrac.bash --cmod=jcdint.cmod
I get
hasArgument =
hasArgument = true
Somehow the array element is returning even though I have not chosen the option.
... (41 Replies)
Please could someone have a look at the code below and spot the cause of the error.
Thanks in advance.
CODE BELOW: (code tags now added) My apologies please, that was my first time here.:)
#! /bin/bash
# file: whileloop.sh
arr1=(2 4 6 8)
arr2=(3 6 9 12)
arr3=()
indextotal=(${#arr1})... (4 Replies)
Discussion started by: Chiadi
4 Replies
LEARN ABOUT PHP
spltempfileobject
SPLTEMPFILEOBJECT(3) 1 SPLTEMPFILEOBJECT(3)The SplTempFileObject classINTRODUCTION
The SplTempFileObject class offers an object oriented interface for a temporary file.
CLASS SYNOPSIS
SplTempFileObject
SplTempFileObjectextends
SplFileObjectSeekableIteratorRecursiveIterator
Methods
o public SplTempFileObject::__construct ([int $max_memory])
Inherited methods
o public SplFileObject::__construct (string $filename, [string $open_mode = "r"], [bool $use_include_path = false], [resource $con-
text])
o public string|array SplFileObject::current (void )
o public bool SplFileObject::eof (void )
o public bool SplFileObject::fflush (void )
o public string SplFileObject::fgetc (void )
o public array SplFileObject::fgetcsv ([string $delimiter = ","], [string $enclosure = "
o public string SplFileObject::fgets (void )
o public string SplFileObject::fgetss ([string $allowable_tags])
o public bool SplFileObject::flock (int $operation, [int &$wouldblock])
o public int SplFileObject::fpassthru (void )
o public int SplFileObject::fputcsv (array $fields, [string $delimiter = ","], [string $enclosure = '"'], [string $escape = "
o public string SplFileObject::fread (int $length)
o public mixed SplFileObject::fscanf (string $format, [mixed &$...])
o public int SplFileObject::fseek (int $offset, [int $whence = SEEK_SET])
o public array SplFileObject::fstat (void )
o public int SplFileObject::ftell (void )
o public bool SplFileObject::ftruncate (int $size)
o public int SplFileObject::fwrite (string $str, [int $length])
o public void SplFileObject::getChildren (void )
o public array SplFileObject::getCsvControl (void )
o public int SplFileObject::getFlags (void )
o public int SplFileObject::getMaxLineLen (void )
o public bool SplFileObject::hasChildren (void )
o public int SplFileObject::key (void )
o public void SplFileObject::next (void )
o public void SplFileObject::rewind (void )
o public void SplFileObject::seek (int $line_pos)
o public void SplFileObject::setCsvControl ([string $delimiter = ","], [string $enclosure = "
o public void SplFileObject::setFlags (int $flags)
o public void SplFileObject::setMaxLineLen (int $max_len)
o public void SplFileObject::__toString (void )
o public bool SplFileObject::valid (void )
PHP Documentation Group SPLTEMPFILEOBJECT(3)