Fortran program produces empty output - fortran

For a college course I'm required to work with Fortran77 codes which I know nothing about. Programs are prewritten, we only change input. On my computer though programs produce no output (they create a file, but it's empty). The very same code works on other computers. I treid using FLUSH and it didn't work. I use Force 2.0 as my programming enviroment. Something I can do about this?

Related

C++ Terminal-Output not one after another

I'm sorry if this question sounds a little childish, but I'm very new to C++ and console applications.
I recently wrote a HTTP1.1-Client to down/upload files. Everything works fine. The Problem is that there are quite a lot of logs to be output on the terminal and there is also the content of the remote host that should be print to the terminal. At the end of the application some of the output is not well formed - sometimes the order ist not right and sometimes the messages are just broken apart.
The application does not use multithreading and uses the libraries SPDLOG and FMT::FORMAT to output the data. The code is way to big to be put in here but if you'd anyway like to see it i can as well post it here.
I'd be thankful for every suggestion about what I might have done wrong and what the problem might be. Thanks!

Program I just made is apparently a virus? C++

Okay so I just made a C++ program that is basically a notebook,
you write stuff in it and it saves it to a .dat file and then you can
read it later.
I compiled it with Microsoft Visual C++ and now I sent it to a friend and it's
saying that it is a virus? I scan it online and it also says that it's a virus.
I don't know why this is happening, as I literally just used some if/else statements, created some strings and used a couple getlines. (and fstream to create the .dat files).
This is the virus report: https://www.virustotal.com/en/file/a1b72280a32915429607fd5abeef1aad4f8310867df1feb7707ea0f7a404026e/analysis/1455735299/
Here is my code. (Its 400+ lines). And I'm almost certain there's nothing wrong
with it. http://pastebin.com/ZwJZrRSu
Any idea why this is happening?
Most probably your PC is already infected by a virus, which adds itself to any executable it can find on your machine. That would easily explain this behavior. Try to compile the same program on PC that is clean for sure and check your PC by antivirus.
I am not sure but I think it because you imported kernel32.dll
Again, it is hard to tell without the source
Also take a look at the file detail in the report

Looking for executable-based test framework

I've inherited an old program that works, but has pretty ugly source code. I need to make the code nicer without changing the functionality. This program takes an input file, performs all sorts of calculations and generates an output file.
The program is currently written in a C/C++ combination. At first I'm going to keep it a C++ program, but in the not-so-far future I'm going to convert it, or parts of it, to Python.
Naturally, the original developers haven't taken the time to create unit tests, or any other kind of test. Since I want to make sure my modifications haven't changed the program's behavior, I want to start by creating some tests. These will not be unit tests, but rather tests of the entire program.
I want each test to take one input file and a set of command line arguments, run the program and compare the output (which is the output file, stdout output and stderr output) to the expected output.
Since I need to support both C++ and Python, the test framework needs to be language agnostic - it should be able to run an executable, collect stdout and stderr and compare them, as well as another file, to the prerecorded outputs.
I couldn't find a test framework that can do that. Is there anything like that? I'd rather not develop one myself.
Well, off the top of my head, you could certainly run the executable with your desired inputs in python using subprocess or some similar module, parse the output and then use the unittest module to set expectations on what sort of output you're looking for.

TextWrangler not showing the correct column number when editing fixed-format Fortran

I am maintaining a program written mainly in fixed-format Fortran. I recently switched from a Windows PC to a Mac, and I'm now using TextWrangler to edit my code. I noticed that the indentation in the editor window does not always correspond to the actual structure of the code. For example, the following random lines are displayed like this by TextWrangler:
! The following lines start on column 5!
loadnam=dirstate(1:NN)//'updatestate.sav'
open (9876, file=loadnam, status='unknown', form='binary')
close (9876, status='delete')
if ((rank == root) .or. (doParallel == .false.))
* call messagerun (1,'Proceeding with updating!')
include 'updating_opt.inc'
end if
Clearly, this does not reflect the actual structure of the code, as fixed-format Fortran statements may not start before column 7 (with a few exceptions). However, the compiler does not complain, and when I open the file with another editor, the code appears in the correct format.
If I type in a new line, however, the compiler will abort compilation if it starts before column 7 (which is the normal behavior).
I don't really understand this behavior of TextWrangler. Is it intentional? TextWrangler did recognize the language automatically (as Fortran, not Fortran 9x), so I'm wondering why it doesn't take into account this important aspect of old Fortran code.
Is there a way to avoid this behavior (while maintaining the Fortran syntax highlighting)? As the program is quite long, I'd like to avoid rewriting it all to free-format Fortran.

What does 'directed to standard output (cout)' means?

I just downloaded this code in which it says in the manual that the 'main results are directed to standard output (cout)'. However, when I run the code as described in the manual, everything runs just fine but I don't see any results showing on the terminal (not being written to an output file either)
This is a Linux code so I tried to run it form both Ubuntu terminal and from cygwin but I'm having the same problem - nothing is showing.
Could it be that 'the main results are directed to a standard output (cout)' means anything else? Other that it's supposed to show the results on the terminal?
There's no other meaning that I can think of for "standard output (cout)" - it should be the terminal that's running the program. Are you sure the program produces output?
Unless you have the source code, it's a little difficult for you (or us) to tell if it may have another meaning ("directed to standard output (cout)" is a little hard to misinterpret however, there's no other sane reading of that snippet).
If you do have the source, you can look for the cout <<-type statements to ensure something is done. You may have to examine the logic closely to see why nothing is being output for your specific case.
If you can share the source with us, we could help out further but it doesn't appear you're comfortable with that so the "analyse the code yourself" is probably the best answer you'll get.
Of course, there's always the option of going back to the author if your analysis is not going well, or if you don't have the source.
Ensure that there is no "wrapper" script encapsulating the program, which is internally redirecting the standard output to a file.