Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple programming enquiry: using fortran for unit conversions.

Status
Not open for further replies.

willb5016

Programmer
Jan 22, 2011
2
GB
Hi all,
I'm trying to analyze some data and produce graphs in a png or gif format which wasn't a problem as I'm a dab hand at gnuplot.

I realized when reviewing the, very pretty graphs, that the units aren't what he asked for.

I am using ascii data files with a x:y style reference

I need a quick solution for converting my first column from julian days into hours (I know the conversion factor) and another column needs to simply be multiplied 10^12.

I have fortran but haven't dabbled much
I need to know how to write a simple program that says
open data file
take first number from column one * x
and do this for all numbers in column one

take first number from column x and *10^12
and do this for all numbers in column x

and then save the changes to the data file.

Nice and easy?

(I had a look for some help on here re. ASCII files and saw that sometimes people respond with "this is a homework question" It isn't, I'm testing a computer model and need to compare my results with the previous owners results.
I'm not familiar with the FORTRAN language and I'm not making any kind of profit from this. If I can't get an answer then I just have a long haul of taking this file back to windows converting it and manually applying formula for each column and doing this for all 8 data files. which will take me about 4 hours. If you have a solution then not only will you be helping me out but you will also be teaching me something. Double bonus :) )


 
Looks like I've resolved this for now, any advice will still be greatly received, but I found the subprogram that created the output file and I edited that so that it printed time the way a I want it and other things in the correct unit.
 
It seems the most interesting counter-question:

Why Fortran?..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top