pass several filenames to the subroutine



Hi,

program main

character*80,allocatable :: fname(:)

allocate(fname(3))
fname(1)="a1.dat"
fname(2)="a2.dat"
fname(3)="a3.dat"
print *,fname
call tt(fname)

stop
end

subroutine tt(fname)
character*(*) fname(:)

print *,fname

return
end

After compiled, it shows
"Warning: In the call to TT, actual argument #1 is character valued and
is being passed to a non-character dummy argument."

I'd like to pass several filenames to the tt subroutine. What does the
warning message mean?

thank you very much.

Mike

.



Relevant Pages

  • Re: pass several filenames to the subroutine
    ... print *,fname ... error message its not the most helpful compiler to say the least. ... After I put subroutine tt into the module, ... or tt subroutine allocates the same memory? ...
    (comp.lang.fortran)
  • f77 vs g77 problem
    ... c9004_sub.for:217: warning: ... Iterative DO loop begin, end, and step-count values known to result in ... no iterations at ... c9004_sub.for: In subroutine `tauincfe2': ...
    (comp.lang.fortran)
  • Newbie question on ON WARNING
    ... When one issues a second ON WARNING in a procedure, ... does an ON WARNING/ERROR command inside a subroutine overwrite one ... Or must the calling code re-establish any/all ON conditions to ensure ...
    (comp.os.vms)
  • Re: pass several filenames to the subroutine
    ... subroutine tt ... print *,fname ... What matters is that it gets the allocation status and values ... I don't recall what compiler you are using and whether ...
    (comp.lang.fortran)
  • Re: Hashes and subroutines
    ... values but I get the warning "Odd number of elements in hash assignment ... It means that you have to assign an even number of elements to a hash. ... # ASOS sites are then runs the metarcode subroutine to ... Because you haven't modified $/ the value in $stations should have just one ...
    (comp.lang.perl.misc)