forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem by using DATE_AND_TIME

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
FK_GER



Joined: 26 Oct 2017
Posts: 35
Location: University of Kassel,Germany

PostPosted: Wed Nov 01, 2017 11:15 am    Post subject: Problem by using DATE_AND_TIME Reply with quote

Hello,
in a subroutine DATUM are set the following lines:

INTEGER DTVAL(8)
CHARACTER DAT*8,TIM*10,ZON*5

CALL DATE_AND_TIME (DAT,TIM,ZON,DTVAL)

After starting appears the following error:

Runtime error from program:d:\kippen_2017\kipein\checkmate\win32\kipein.exe
Run-time Error
Attempt to call a routine with argument number two containing too few array elements

DATUM - in file datum.f95 at line 242 [+007c]
MAIN - in file kipein.for at line 151 [+29db]


The used declaration of variables matches with die description in the instruction manual, or?
Where is the error??

Thanks for help
FK
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Nov 01, 2017 1:28 pm    Post subject: Reply with quote

It runs OK for me. What version of FTN95 are you using and which platform (Win32, .NET or x64)?
Back to top
View user's profile Send private message AIM Address
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Nov 01, 2017 1:31 pm    Post subject: Reply with quote

I was only testing DATE_AND_TIME earlier today.
I have no problem with it's use.
The following program date.f95 can run as:
ftn95 date /lgo
ftn95 date /lgo /64
ftn95 date /lgo /64 /check
etc
Code:
 character string*128, date_str*8, time_str*10, ZONE_str*5

  write (*,*) ' '
!  write (*,*) 'Compiler Version    : ', compiler_version ()
!  write (*,*) 'Compiler Options    : ', compiler_options ()
  call get_environment_variable ('f95_dir', string)
  write (*,*) 'Compiler Directory  : ', trim(string)
  call get_environment_variable ('f95.ver', string)
  write (*,*) 'Compiler Version    : ', trim(string)
  call get_environment_variable ('processor_description', string)
  write (*,*) 'Processor           : ', trim(string)
!
  call DATE_AND_TIME (date_str, time_str, ZONE_str)
  write (*,*) 'Date and Time       : ', date_str,' ', time_str,' ', ZONE_str
  call date_and_time_string (string)
  write (*,*) trim(string), len_trim(string)
!
   end

   subroutine date_and_time_string (string)
   character string*(*)
   character :: months(12)*3 = (/ 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' /)
   integer value(8)

   call DATE_AND_TIME (values=value)
   write (string,11) value(3),months(value(2)),value(1), value(5:8)
11 format ('Run on ',i0,'-',a,'-',i4,' at ',i0,':',i2.2,':',i2.2,'.',i3)
   end

   subroutine get_environment_variable (variable, string)
   character*(*)  variable
   character*(*)  string
   character*1024 getenv@
   external       getenv@
   string = GETENV@ (variable)
   end subroutine get_environment_variable


Note I have extra environment variables:
set pf_32=C:\Program Files (x86)
set f95.ver=_8.10
set f95_dir=%pf_32%\Silverfrost\ftn95%f95.ver%
set PROCESSOR_DESCRIPTION=Intel(R) Core(TM) i5-2300 CPU @ 2.80GHz 4 Cores 8.0 GB mem 6 MB cache
Back to top
View user's profile Send private message
FK_GER



Joined: 26 Oct 2017
Posts: 35
Location: University of Kassel,Germany

PostPosted: Sat Dec 02, 2017 4:30 pm    Post subject: Reply with quote

Sorry, that I come forward only now. In the past weeks I was present to migrate a part of my Fortran-programs from my old Compaq-compiler under XP to the Silverfrost-platform under WIN7. And thereby, the problem with DATE_AND_TIME was one of the smallest.
Yesterday at last, I have tested the example of John. Following I have modified my old FOR-subroutine, which does approximately the same as the proposal of John, into the F95-standard. And now, at least one of the smallest problems is done.
Thanks for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group