[CSC 330] A small extension... and a hint..

Andrew J. Pounds pounds_aj at mercer.edu
Tue Oct 10 18:24:24 EDT 2023


So after talking to several of you today in class it appears that 
Fortran is the language that is causing you the most grief.  I really 
want everyone to do well on the project so I will give you an extension 
until MONDAY NIGHT (October 15) to get this done. Thursday of this week 
will be a workday, but on Tuesday of next week I am going to get you 
started with Julia and maybe Go and I need you focused on that.

Fortran and LISP are both extremely powerful languages (hence the reason 
people still develop new code in them after 60 years!) but mastering 
them takes time.   It appears to me that most of the problems you are 
having with Fortran are related to reading files and parsing the text.  
If you remember, a few weeks ago we did two separate exercises.  One was 
related to building a comma separated values (CSV) parser in fortran and 
one was related to reading long input lines.   You should be able to 
combine the ideas from those two exercises to build a file reader that 
parses comma separated data to then build card objects.

If you want to retrieve these files for testing (with a fresh set of 
eyes) then on cobra do a:

cp /pub/pounds/CSC330/csvtokenizer.f90  csvtokenizer.f90

You had to modify this program so it printed the output WITHOUT the commas.


I also gave you access to another example to process command line 
arguments and to do some string processing.

cp /pub/pounds/CSC330/stringprocess.f90  stringprocess.f90

You might want to take a look at these again and see if they help you 
inplement reading and processing the input data file for Fortran.

And here is the example reader that we used to read in a long line of 
text...

program readtest

     character(80) :: lineOfText
     character(len=*), parameter :: filename="testhands"
     character(len=*), parameter :: path="/pub/pounds/CSC330/poker/"
     character(:), allocatable :: fullpath

     ! Concatenate the path and filename together
     fullpath = path // filename

     open(unit=5,file=fullpath,status="old")
     read (5,"(a80)") lineOfText
     print *, lineOfText
     close(5)

end program readtest

I am starting to get a lot of questions so as you hit problems, push the 
code to Anvil and open an issue where you clearly describe the problem 
and where you think it is in your code (like with file and line 
number).  I'll do my best to respond as quickly as possible.

That reminds me, I took a quick look at some of the repos and many of 
you need to start putting code on Anvil -- some of you only have a 
README and maybe part of one language.  It is YOUR responsibility to 
make sure that I can clone your code and that I have directions 
explaining how to compile and run it on cobra.


-- 
*/Andrew J. Pounds, Ph.D./*
/Professor of Chemistry and Computer Science/
/Director of the Computational Science Program/
/Mercer University/
/1501 Mercer University Drive, Macon, GA 31207 /
/(478) 301-5627/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc330/attachments/20231010/e701f71e/attachment.html>


More information about the csc330 mailing list