• Civilization 7 has been announced. For more info please check the forum here .

Computer Questions Not Worth Their Own Thread II

An external optical USB drive can be a good investment for situations like this. they are extremely portable and easy to attach to your PC via USB.

Edit: Nvm, I see Zelig already answered your question.
 
okay, so I probably will be using a free ANSI FORTRAN 95 compiler called g95 (http://www.g95.org; user manual http://ftp.g95.org/G95Manual.pdf) and I think I understand the very very very basics of how it runs at the moment, but I have basic question about code compiling in general/FORTRAN. My programming experience is simple java editor application or MATLAB application, and those are both programs you run and can interact with compared to what I seem to understand FORTRAN as. For instance, just briefly googling how to plot with FORTRAN code you are supposed to write in the code to call up a separate plotting program--fortran is not an application but just the language.

Anyways, so this is my understanding for Windows OS for this program specifically but I think it's also about any code compiler; questions in bold:
(1) you write the code as text wherever I suppose (in a brief example of calculating pi with monte carlo i.e. random simulation method it was just in notepad) and save it as ".f90" file extension or whatever is appropriate (whether it's an old fortran 77 file, a free application, etc; this is described in the user manual)

(2) you go to the right directories/etc in the cmd prompt and compile the code in some manner. You get the ".f90" file and compile it into a .exe with the "[filenames] -o [futureFileName.exe]" command; however, there are -x language to compile into another language (C or C++), but what are the -c ("Compile and assemble, but do not link), -S ("Compile only), -E (Preprocess but don't compile), etc. Basically what does it mean to "assemble" or "link" for compiling code

(3) you run the newly compiled file in the right language (the .exe program) from the cmd prompt. However, how do you debug code or find errors? Java will tell you "error line 121" when you compile, Matlab will also tell you "error line 121" or whatever when it runs or you can put a break in the function and go through everything step-by-step, but this FORTRAN compiler just spits out a .exe you run.

I have not played around with it yet, but if there is an error in your code how will it display (will it not compile or does it fail on running the .exe)? How can you find errors in your code?


(4) Question: the "Option Synopsis" section of the user manual, it has other commands that I guess are supposed to be used for that kind of information. [-g] and [-pg] are listed as debug options, etc etc.

Are these put in your code such as like how a "write to" or something command in other languages are? There is an [-o outfile] so can you put that in your code so that in (2) above you just write "g95 [filename].f90" instead of "g95 [filename].f90 -o [filename].exe", or if I compile a .f90 file with [-g] at the end of it I go into some debug mode?


edit- I should say I have 0 experience with fortran and am unaware of any functions/how to use it. I have to learn how to use so, so I currently have 0 knowledge.
 
Fortran eh? Why that language?

Also, if you have the option to use anything but Windows instead of Windows for this, I think I'd recommend that.

(1) you write the code as text wherever I suppose (in a brief example of calculating pi with monte carlo i.e. random simulation method it was just in notepad) and save it as ".f90" file extension or whatever is appropriate (whether it's an old fortran 77 file, a free application, etc; this is described in the user manual)
Yes. I would recommend not to use the default notepad, but some editor more specifically tuned to programming (with syntax highlighting), e.g. Notepad++ for Windows.

(2) you go to the right directories/etc in the cmd prompt and compile the code in some manner. You get the ".f90" file and compile it into a .exe with the "[filenames] -o [futureFileName.exe]" command; however, there are -x language to compile into another language (C or C++), but what are the -c ("Compile and assemble, but do not link), -S ("Compile only), -E (Preprocess but don't compile), etc. Basically what does it mean to "assemble" or "link" for compiling code
Compiling turns your code from something you can read to something the computer can execute. This happens in several steps. For bigger projects, it is often useful to divide your code into different files and you might even want to use your file a.f90 for different projects. It is possible to turn your code into something which is not executable itself, but which is already written more towards machine code, so that other files can use it (without having to compile it at that moment).
I'd recommend you to read a good manual on this when you get to the level where you need this.
http://www.g95.org/docs.shtml gives some examples in its basic options.
(3) you run the newly compiled file in the right language (the .exe program) from the cmd prompt. However, how do you debug code or find errors? Java will tell you "error line 121" when you compile, Matlab will also tell you "error line 121" or whatever when it runs or you can put a break in the function and go through everything step-by-step, but this FORTRAN compiler just spits out a .exe you run.
Code might not compile, giving you an error message about what went wrong (and line number). Code might also crash during runtime, giving you an error message (hopefully with some useful info).
A break is not generally possible, but it is possible to spew out information about the state of the system prior to the crash manually.
How can you find errors in your code?
A nice mix of experience in decoding error messages, google and black magic.

I recommend you to use the -Wall compile option, it will warn you when you do things which are not 100% kosher but might work, it is usually better to fix these things (or at least understand them), since they might lead to unexpected results otherwise.
 
Wow, Fortran. I hope you have a good reason, 'cos I expect you will find it painfull. I have never used it, but I suspect the coding / debugging issues are similar to C. Adding to what dutchfire said, I would try and find an IDE that does fortran, some are mentioned here I would probably start with Visual Studio + Resharper. I would expect that to have a debugger so you can step through your code and stop at certain points and examine the state.

Failing that, what I frequently end up when the program is crashing at run time doing is putting in commands that output a string to screen, and the program is crashing somewhere between the last one that was printed and the first one that is not. I would estimate this to take 10's of times longer than doing it with a proper debuger however.

Good luck, if you really need to do as you are describing you have my sympathy. If you are doing it for fun I think you are mad ;)
 
yeah I have to learn fortran for my major; the department's computer lab has all product licensing but I'm also looking for stuff for my laptop so I can do work on my own (and if everyone wanted to use the ~20 computers at once, it'd be a rough competition!)

IDE was the word I was looking for when trying to describe my matlab/java experience (though java was really simple). It looks like I am able to get the NAG Fortran Compiler from my school for free though: http://www.nag.com/nagware/np.asp, but hopefully that can come with the NAG Fortran Builder that looks to be a fortran IDE: http://www.nag.com/nagware/NP/fortranbuilder.asp. Don't know if the computer cluster has an IDE, though it probably does.

don't know how expensive those products are, but I'd like to take a free route before getting a $50++ license.
 
My new hard drive's chattering is very high pitched noise. (I did a SMART and chkdsk and both came up clean.) This hurts my ears. Is there any way to make a hard drive quieter? Defragging wouldn't do much, really, considering its only at 1% fragmentation.

I assume the answer is no but thought Id ask anyways.
 
My new hard drive's chattering is very high pitched noise. (I did a SMART and chkdsk and both came up clean.) This hurts my ears. Is there any way to make a hard drive quieter? Defragging wouldn't do much, really, considering its only at 1% fragmentation.

I assume the answer is no but thought Id ask anyways.

I do not know much about these things, but I would make sure you had a backup of anything you care about on that drive.
 
I said the chkdsk and SMART cane up clean.
 
HDDs can fail at any time for any reason and yours sounds unstable.
 
I said the chkdsk and SMART cane up clean.

These are checking the electronic status of the disk. When you described the problem I thought of the bearing, which could fail fatally any time. As I said I do not really know though.
 
My new hard drive's chattering is very high pitched noise. (I did a SMART and chkdsk and both came up clean.) This hurts my ears. Is there any way to make a hard drive quieter? Defragging wouldn't do much, really, considering its only at 1% fragmentation.

I assume the answer is no but thought Id ask anyways.

The way drives are mounted will affect their sound.

http://www.silentpcreview.com/article8-page2.html

My general recommendation is only SSDs in PCs, HDDs in file servers.
 
Yeah I thought about the drive bearings but then I looked up the noises and it did not sound at all like any of those. It just actually sounds like a normal drive chattering, but higher-pitched.
 
Differs from drive to drive.

My 10.000rpm drive is fairly loud, and the sound is disturbingly harsh, high-pitched and metallic... no sign of real trouble in 6 years though.
 
Anyways something weird. I cleaned out the dust in the fans and suddenly it made much quieter. Maybe I mistaked the fans for the hard drive or the dust did something that made it seem louder.
 
The dust will make the fans work harder to achieve the same affect and therefore be louder. Maybe
 
Normal drive chattering? None of my HDDs ever made noise :|
 
Well the drive properties says SCSI but that's because of weird drivers on my system. I'm pretty sure it's SATA though.

Anyways, question here: I know there are programs that let you divide up a folder of files into multiple folders of the same size approximately. (I use Folder Axe myself.) Is there a program that does the same thing, but retains the directory structure when there are multiple subfolders? Such a thing would be useful for backing up.

I suppose I could use multi-part archives but I was never a big fan of them

Or, since these are going on DVDs, if it is built into a program that makes optical burnings I don't mind that

Edit: Ok with a lucky google I found a program called DVD Span. But it is trialware. Free alternative?

Another edit: Ok, with "disk spanning" I found this: http://www.howtogeek.com/76264/how-to-burn-data-across-multiple-dvd-or-cd-discs/
So I guess I will go install CDBurnerXP! (I have not gotten around to putting it in. I usually use ImgBurn but sometimes the other one because alternatives are good sometimes.) I will keep here in case it helps someone else
 
Top Bottom