Re: Fortran Compling problem



N. Shamsundar wrote:
> hcchien420@xxxxxxxxx wrote:
>> I got a Fortran code called APEX1310.f and two codes called
>> APCM1310.f and APEXPARM.f are included in the the APEX1310.f.
>> APCM1310.f and APEXPARM.f seem to be a collection of variables used
>> in APEX1310.f. I have to compile the APEX1310.f under UNIX system. I
>> put the command ">f90 APEX1310.f", the UNIX system show me the
>> following message: +++++++++++++++++++++++++++
>> f90comp: 35428 SOURCE LINES
>> f90comp: 0 ERRORS, 1 WARNINGS, 0 OTHER MESSAGES, 0 ANSI
>> Undefined first referenced
>> symbol in file
>> getdat_ APEX1310.o
>> gettim_ APEX1310.o
>> ld: fatal: Symbol referencing errors. No output written to a.out
>> +++++++++++++++++++++++++++++
>> Could anyone help me solve this problem? How can I compile the
>> fortran code under UNIX? THANKS.
>>
>> ALEX
>>
> GETDAT() and GETTIM() are (probably) non-standard subroutines with
> CHARACTER*11 arguments into which the run-time put the system date and
> time in the mm/dd/yyyy and hh:mm:ss.uu formats.
>
> If you want the correct date and time, either replace the calls to
> these non-standard routines by calls to the Fortran-9X standard
> routines, or write your own GETDAT and GETTIM wrapper functions.
>
> N. Shamsundar
> University of Houston

GetDat and GetTim wrapper functions - example:

subroutine GetDat(iyr,imon,iday)
integer(2), intent(out):: iyr, imon, iday
character(8):: sdate
character(10):: stime
call date_and_time(sdate,stime)
read(sDate,"(I4,I2,I2)") iyr, imon, iday
end subroutine GetDat

subroutine GetTim(ihr,imin,isec,i100th)
integer(2), intent(out):: ihr, imin, isec, i100th
character(8):: sdate
character(10):: stime
call date_and_time(sdate,stime)
read(sTime,"(I2,I2,I2,1x,I3)") ihr, imin, isec, i100th
end subroutine GetTim


--
Aca.


.



Relevant Pages

  • Re: computing Bernoulli numbers
    ... Fortran code for evaluating a sequence of Bernoulli numbers and other special functions: ... -| subroutine bernoulli_series ... -|whether an extra term should be added or not is ...
    (comp.lang.fortran)
  • Re: matlab mex file (fortran)
    ... > I send you my hypothetical fortran code too. ... Program Celsius Table: Prints simple Fahrenheit-Celsius table ... >>Subroutine mexFunction(nlhs, plhs, nrhs, prhs) ...
    (comp.soft-sys.matlab)
  • Re: Recompilation of mex-files fails
    ... I used 'function' as the fortran code to be called is a ... changing 'function' to 'subroutine' avoids this warning. ... C The gateway routine ... subroutine mexFunction(nlhs, plhs, nrhs, prhs) ...
    (comp.soft-sys.matlab)
  • Calling a fortran subroutine from Visual C++
    ... the fortran code as a subroutine. ... The specifications for this project have ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vc)

Loading