User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » FORTRAN string manipulation Page [1]  
LimpyNuts
All American
16859 Posts
user info
edit post

This is not for FORTRAN class. I need to do thousands of MCNP runs on a Linux computer. I need to write a program that can:

- open an ASCII text file and put its contents into a character string (input file template)
- find and replace certain parts of the above string (to generate the input file)
- shell the MCNP command and wait for MCNP to finish before continuing execution
- copy the output file to a specified location
- open the output file and retrieve the appropriate data (needed output can be located by a specific phrase in the output file)
- delete the "runtpe" file that MCNP generates because I don't need it and they're 3 megs each.

I wrote an application for Windows that does this, but I need more CPU power or my runs won't be done in time.



This doesn't HAVE to be done in FORTRAN, but that's all I have experience with.

[Edited on March 1, 2006 at 4:19 PM. Reason : ]

3/1/2006 4:19:19 PM

DaveOT
All American
11945 Posts
user info
edit post

Perl would be perfect for something like this...

3/1/2006 4:25:28 PM

LimpyNuts
All American
16859 Posts
user info
edit post

I don't know any Perl. Would this be a hard Perl script?

3/1/2006 4:30:40 PM

DaveOT
All American
11945 Posts
user info
edit post

Not really. The hardest part would be learning the syntax.

http://learn.perl.org/library/beginning_perl/

I can also see writing this in C (again, the hardest part would be learning the syntax) if you needed more speed.

3/1/2006 4:33:42 PM

LimpyNuts
All American
16859 Posts
user info
edit post

holy crap that's not so hard at all

3/1/2006 8:20:47 PM

Jere
Suspended
4838 Posts
user info
edit post

I was in Tucker lab one night. I went there to use Espresso. It's basically typing in a shitload of binary numbers for minimization.

Anyways, this dude comes up to me, looking at my string of 1's and 0's, and asks "is that fortran?"

I shake my head. He asks "Oh, is it java?" No...

I told him that i was in CSC 316 (~java 3) and I expected the programming to be rather difficult. He told me that he was in Fortran and here comes the greatest part "Fortran is really hard. It's so much more tedious than HTML."








[Edited on March 1, 2006 at 8:53 PM. Reason : gawd, I'm so used to saying "all nighter"]

3/1/2006 8:51:37 PM

DaveOT
All American
11945 Posts
user info
edit post

Quote :
"holy crap that's not so hard at all"


Get it figured out?

3/2/2006 11:27:32 AM

LimpyNuts
All American
16859 Posts
user info
edit post

ive got the basic syntax. i've been working on another project i need to do as well.

3/2/2006 2:21:09 PM

 Message Boards » Study Hall » FORTRAN string manipulation Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.