Open Watcom Fortran: ETIME, FDATE, FLUSH, GETENV

  • Permalink
  • submit to reddit
  • Email
  • Follow


Hi,

I need to call the following routines in my OW Fortran programs and I
understand that the way to handle it under windows (since it is not
implemented in OW) is to use c wrappers.

The problem is that I am not really a specialist of c wrappers. Has
anyone already implemented these? 

Thanks in advance 

Victor

0
Reply victor.camus (3) 12/16/2005 2:00:39 PM

See related articles to this posting


victor wrote:

>Hi,
>
>I need to call the following routines in my OW Fortran programs and I
>understand that the way to handle it under windows (since it is not
>implemented in OW) is to use c wrappers.
>
>The problem is that I am not really a specialist of c wrappers. Has
>anyone already implemented these? 
>
>Thanks in advance 
>
>Victor
>
>  
>
The online Fortran 77 users guide is a good place to start. Try to look 
for the following  -   gettim, getdat, flushunit, fgetenv 



0
Reply jdoe4201 (18) 12/16/2005 2:31:22 PM

Thank you John.

It is indeed there on page 92.
http://openwatcom.mirrors.pair.com/11.0c/docs/f77userguide.pdf

And it works on my platform (Windows)

0
Reply victor.camus (3) 12/16/2005 3:10:45 PM

victor wrote:

>Thank you John.
>
>It is indeed there on page 92.
>http://openwatcom.mirrors.pair.com/11.0c/docs/f77userguide.pdf
>
>And it works on my platform (Windows)
>
>  
>
It  is not hard to duplicate "etime" using "gettim".  The "fdate" thing 
using "getdat" may be trickier, especially  if you need to get day of 
week.  It might turn out easier to use a function written in C, 
shamelessly plagiarized from the internet.

/*   fdate.c */
#include<time.h>
int fdate(utime)
char utime[24];
{
        int i;
        time_t t;
        t=time (NULL);
        for (i=0; i<24; i++) utime[i]= *(ctime(&t)+i);
        return 1;
}

Called from fortran like this -

c test1.for
*$pragma aux fdate "!_" parm (value)
       character*30 string
       external fdate
       integer fdate
       i=fdate(string)
       print *,string
       pause
       end
    

0
Reply jdoe4201 (18) 12/16/2005 11:31:27 PM
comp.lang.fortran 10922 articles. 36 followers. Post

3 Replies
210 Views

Similar Articles

[PageSpeed] 53


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Fortran/TK (using Open Watcom Fortran 77)
I have not tried the software below (and won't be since I program in Fortran 95), but maybe it will interest some readers. I wonder if something similar could be done with Fortran 95 and Python, using the g95 compiler. http://programmingtools.rosihanari.net/fortran-tools/fortrantk-a-free-fortr= an-compiler.php FORTRAN/TK is, an easy to learn, powerful cross-platform (OS/2 Warp and Windows 9x/NT) widget toolkit for the Open Watcom FORTRAN/77 compiler. Technically it=92s a kind of wrapper to Rexx/Tk but it does not rely on a Rexx interpreter. Although it is possible to embed FORTRAN consol...

compiling error with fortran open watcom
while trying to compile a Fortran code using mex i got following error what might be causing this error? mex RFregression.f Open Watcom C32 Optimizing Compiler Version 1.1 Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved. Source code is available under the Sybase Open Watcom Public License. See http://www.openwatcom.org/ for details. Error! E1073: Invalid option '-7' RFRegression.f(1): Error! E1022: Missing or misspelled data type near 'subroutine' RFRegression.f(2): Error! E1022: Missing or misspelled data type near 'integer' RFRegression.f(2): Error...

Open Watcom Fortran compiler help needed
The Open Watcom open source compiler project, www.openwatcom.org , needs help in improving the Fortran compiler from F77 to F90/F95/F2k3. Also needed is help in porting the Fortran compiler runtime library to Linux and to AMD64. Most of the compiler internals and runtime library are written in C code. The Open Watcom compilers and linker currently support Dos16, Dos32, Win16, Win32, OS/2 and Netware 4. The Linux porting project is about 75% complete but needs a lot of "cleanup". An article on improving the C and C++ compilers is at http://www.theinquirer.net/?article=29332 . ...

Fortran MEX files with OPEN Watcom Compiler
In the Technical Solutions, Solution Number: 1-155BQG it is explained how to use the Open Watcom compiler to create Fortran MEX files for MATLAB 7.0 (R14) on Windows. For the given yprime example it works fine. But I obtain an "Unable to load mex file- segementation error" when running a compiled file that includes WRITE/READ/OPEN or CLOSE in the Fortran file. During compilation the errors Warning! W1027: file clib3s.lib(mainwnt): redefinition of __Is_DLL ignored Warning! W1027: file clib3s.lib(crwdata): redefinition of _LpDllName ignored Warning! W1027: file clib3s.lib(crwdata): r...

watcom fortran compiler to mex fortran code in matlab
hi, I would like to know whether watcom fortran compiler can be used to run fortran mex files in matlab. Thanks Sunnam No. http://www.mathworks.com/support/solutions/data/1-19F84.html?solution=1-19F84 But we do support other FORTRAN compilers (see the above link for details). "sunnam" <sunnamhb@clarkson.edu> wrote in message news:ef25be7.-1@webx.raydaftYaTP... > hi, > I would like to know whether > watcom fortran compiler can be used to > run fortran mex files in matlab. > > Thanks > Sunnam Hi, I could figure out how to use watcom compiler to mex...

Open Watcom
Anyone here tried Open Watcom for C++? I'm wondering if it's decent. ...

Open Watcom
Does anyone at all use Open Watcom? I have a couple of issues I have to iron out before I can get to work. The newsgroup seems to be long dead (server doesn't respond) Nickolai In article <gb84oj$ju2$1@aioe.org>, Nickolai Leschov <nleschov@gmail.com> wrote: >Does anyone at all use Open Watcom? Apparently, you do. >I have a couple of issues I have to iron out before I can get to work. >The newsgroup seems to be long dead (server doesn't respond) This newsgroup (comp.lang.c) is also dead, but it continues its ghostly existence. And that (what I wrote above)...

Watcom fortran compiler to mex fortran code in Matlab #2
Dear Matlab users, I am trying use to Watcom fortran compiler to run fortran-mex files in matlab. I cannot run the files as the watcopts.bat file of Matlab supports only c-mex files to run on matlab. Is there any way i can run fortran-mex files to in Matlab. I suppose some changes have to be made to watcopts.bat file like to change the compiler and linker options. Any suggestions of how to do these changes. Thankyou Himabindu ...

Fortran openings in Chicago
We have a FORTRAN opportunity with one of our large clients in Chicago. We are looking for someone that has FORTRAN experience ideally with UNISYS Mainframe, but not required. Please contact me if interested at jupierce@teksystems.com ...

Open Watcom installation
Can't seem to access the OW news server at present but I am having trouble with the 1.1 installation I have. I can get things going from the command line but the IDE has me stumped. It complains about no targets being installed and if I open one of the sample projects it says the target is obsolete and to rename the target. Of course that can't be done as theres no targets installed..... Is this simply fixed or have I a major trouble to fix? Is there something missing from the ide.cfg? Craig On Tue, 28 Oct 2003 08:07:59 +0000, Craig wrote: :>Can't seem to ac...

Open Watcom IDE (again)
I'm trying to use the OW 1.2 ide but initially it wouldn't load the options into the ide. Copied the ide.cfg from binw to binp and thats fixed but the ide now starts up saying it can't load the source control dll. I have checked all the relevant paths are correct and beginlib points to binp\dll but to no avail. Anyone have a clue how to fix this. I can't understand why this type of poblem still exists. These issues should have been sorted in the beta phase I would have thought? Craig Suddenly, Craig sprang forth and uttered these pithy words: > I'm t...

(Open) Watcom LibMain()
Hello, I'm trying to find out how many people have their own LibMain() in DLLs built with Watcom 11 or Open Watcom. The reason is that I just discovered that the documentation does not match reality. The docs imply that the prototype is unsigned LibMain(unsigned handle, unsigned reason); while in reality it is unsigned APIENTRY LibMain(unsigned handle, unsigned reason); which causes serious confusion. The thing is, there is really no reason why LibMain should be APIENTRY and it would be IMO preferable if it wasn't. So I'm trying to find out ...

Makefile from Open Watcom
Hi Folks, For my research I have a piece of software written in C. I originally used VAC, then gcc and am now happily developing it with Open Watcom. I'd like to be able to send an executable to a colleague who uses Linux. Is there a way of getting Open Watcom to generate a makefile which I could use with, say, Gnu make/gcc under Linux? Ian On 6 Mar 2005 09:13:51 GMT, Ian Johnston wrote: :>Hi Folks, :> :>For my research I have a piece of software written in C. I originally :>used VAC, then gcc and am now happily developing it with Open Watcom. :&g...

Open Watcom F77 problem...
Its been a while, but I've run into a problem using Open Watcom 1.1 to compile some old Fortran code... I'm able to reproduce my problem with the following bit of code CHARACTER CH READ *, CH PRINT *, CH END When I reach the READ statement, and enter a single letter and hit return, I get the following error: *ERR* IO-07 bad character in input field I've compiled the EXACT same code using the Salford Personal F77 compiler and it works fine. Also, if I change CH from CHARACTER to INTEGER, it works fine... Am I overlooking something, or does this appear to be a problem w...

Odd behavior of Open Watcom
I'm using the 1.3 release. The target is a 16-bit DOS executable. I've narrowed the problem down to one single line of code: CALL _setvidemode( _TEXTC40 ) Under Windows and under DOS w/ EMM386, it fails with an invalid opcode, but opening up the executable or the object file in a hex editor and searching for the hex string it reports yields nothing, suggesting that a frameshift error has somehow occured. Any idea what's going on? In a previous article, Bob Goatse <admin@microsoft.com> wrote: >I'm using the 1.3 release. The target is a 16-bit DOS executable. &...

Flushing mexprintf outputs in fortran
I am using a series of mexprintf("Check n") statements to identify the point where I get a segmentation fault in a fortran program linked to matab via mex. However, it seems that sometimes the crash happens before mexprintf outputs its messages to the screen. If this where C, I guess I could use a flush statement of sorts to force the mexprintf messages to be outputted as they were created. Is there a way to force the flushing of mexprintf messages in FORTRAN? Thanks, G. "Guilherme Rocha" <gvrocha@gmail.com> wrote in message <i53c...

how to flush a file opened by DCL ?
I use the TEE.COM described in the PIPE help. as the PIPEd/tee-ed command is quite long to execute, I modified the OPEN from OPEN/WRITE to OPEN/WRITE/SHARE=READ to be able to TYPE the content of the tee-ed file while being created (see below) $ open/write/share=read TEE_FILE 'P1' $ loop: $ read/end_of_file=exit sys$pipe line $ write SYS$OUTPUT line ! send it out to next stage of the pipeline $ write TEE_FILE line ! log output to the log file $ goto loop $ exit: $ close TEE_FILE $ exit but of course, the tee-ed file is never flushed and ...

ADO From Fortran
Hello everyone, I am trying to use ADO from Compaq Visual Fortran v6.1. I have created a Fortran ADO module with the Fortran Module Wizard and have some base code that compiles and links. When running the code, my ADO connection and recordset are created without errors. The connection opens without errors. But when I try to use the $Recordset_Open subroutine, I get an unknown status code (-2147352567). Does anyone know what I'm doing wrong? The code is below: program main USE DFWIN USE DFLIB USE TestADO USE DFCOM USE DFAUTO USE DFCOMTY ...

NLEQ1 and open source Fortran
Hello I've been having some troubles trying to solve al large scale nonlinear system using nleq1. When I compile it using Intel's Fortran Compiler everything works properly, but since I'm trying not to use comercial software I tried compiling my program using GNU's (gcc) GFortran. When doing this I get the solver stops due to singular matrix problems. I've checked that the SMALL and EPMACH values are the right ones for my machine, and I'm using the files downloaded right from http://www.zib.de/Numerik/numsoft/CodeLib/codes/nleq1/. And besides that, the solver works fine...

opening multiple files in fortran
I'm trying to do something which really should be done with perl or python, but I've hit my computer's limit on memory usage because of the number of files that I need to have open at once, so I'm making a pathetic attempt to do this with fortran. The problem is this: I have 14,000 files, each with 10,000 numbers that I want to read in, and then re-group and write out to 10,000 files with 14,000 numbers. The fortran code for that so far is just me opening a large array (outnu(,) --14,000 by 10,000), filling all the entries from my input files, and then creating 10,000 output f...

Uninstalling Open Watcom F77
I Subject, but the uninstall left behind C:\WATCOM and three sub-folders. I suspect that's typical. I would think now I can re-install. On Aug 30, 2:07=A0am, "W. eWatson" <wolftra...@invalid.com> wrote: > I Subject, but the uninstall left behind C:\WATCOM and three > sub-folders. I suspect that's typical. I would think now I can re-install= .. You could always delete those too, pripr to re-installing. ...

Watcom Fortran and mex-files
Hello all, Has anyone succeeded in creating mex files with the Watcom Fortran compiler? If so can you tell me how to change the "watcopts.bat" that produces a .dll file of a fortran-mex code. Thanks Hima ...

Open Watcom and JNI question
Hi, I am trying to get a very basic dll built that will allow me to use JNI (the Java Native Interface). I am using Open Watcom. This is not a JNI question per se, but one relating to the building of dlls and their usage. When I use the defaults to make the dll in Watcom, all seems to go smoothly -- no warnings or error of any sort and the dll is residing where it should. When I attempt to execute the java program, I get the following java.lang.UnsatisfiedLinkError: D:\dev\projects\jqhome\java\jni\HelloWorld\HelloWorld.dll: Error 123 loading D:\dev\projects\jqhome\java\jni\Hel...

open watcom 1.4
Hi, I've just installed open watcom 1.4 I didn't let the installer modify the config.sys as I intended to run the programs via a batch file when I checked the copy of the modified config.sys file in the installation directory I noticed it has a: RUN=...NMPBIND.EXE I searched all files in the installation directory but could not find any reference to NMPBIND does anybody know what is the purpose of that program ? thanks -- bye Alessandro On Tue, 17 Jan 2006 07:41:53 UTC @tin.it (Alessandro) wrote: > Hi, > > I've just installed open watcom 1....