Difference between revisions of "Category:Pragmatic Programming"

From SourceWiki
Jump to navigation Jump to search
Line 18: Line 18:
 
=Course content=
 
=Course content=
  
 +
The following is a list of example-led tutorials which will be used to provide an engineering framework, upon which scientific programming can be profitably overlaid.
 +
 +
=====Thread1: Fortran and python programming=====
 +
 +
# [http://source.ggy.bris.ac.uk/wiki/Fortran1 Fortran1: Fortran for beginners].  This is friendly introduction to Fortran and will guide you from '''writing your first program''' through to using more advanced data-types, such as '''arrays'''.  Along the way, you will encounter Fortran's '''intrinsic data types''', logic such as '''conditionals''' and '''loops''', program structure and '''subroutines''' all the while providing pointers to '''good style''' and '''bug avoidance''' techniques.
 +
# [http://source.ggy.bris.ac.uk/wiki/Fortran2 Fortran2: Intermediate Fortran].  This tutorial follows on from Fortran1 and introduces features from Fortran90 which help us to write better, more maintainable programs.  The topics covered include; dynamic memory allocation using '''allocatable arrays'''; flexible and easily extensible data-types through the use of '''user-derived types'''; enhanced modularity, encapsulation and error checking provided by '''modules'''.  Linking your program to third party '''libraries''' is also covered, using '''NetCDF''' as an example.
 +
# Should you wish to go further [http://source.ggy.bris.ac.uk/wiki/Numerics Numerics], [http://source.ggy.bris.ac.uk/wiki/Profiling Profiling] and [http://source.ggy.bris.ac.uk/wiki/Debugging Debugging] provide examples of '''common numerical programming gotchas'''; tips to help you find and improve any '''slow running regions of your program'''; and hints and tips for '''avoiding, finding and correcting''' any '''bugs''' that find their way into your code.
 +
# [http://source.ggy.bris.ac.uk/wiki/NumericPython An introduction to Python and the numpy package] guides you through some first steps with python and highlights some of the very useful '''data manipulation and visualisation tools''' on offer.  The examples will focus on data held in 2-dimensional arrays.
 +
# [http://source.ggy.bris.ac.uk/wiki/Polyglot Polyglot] offers some concrete examples of '''mixed Fortran and C''' programming, including the new '''Fortran2003 interoperability features'''.  Mixed language programming provide huge time-savings if you have access to, say, a third party library of routines written in C which you would like to make use of inside your existing Fortran project.
 +
 +
=====Thread2: Tools for Managing your Code and your Project=====
 +
 +
# [http://source.ggy.bris.ac.uk/wiki/Subversion The Subversion version control system] is fantastic tool for '''collaborating''', '''debugging''', '''disaster recovery''' and, well, '''general sanity preservation!'''.  This tutorial gives you hands on practice for all the essential features.
 +
# [http://source.ggy.bris.ac.uk/wiki/Make Project building using Make] guides you step-by-step through the otherwise opaque magic of '''Makefiles''' and highlights how they can be brought into service not only for '''code compilation''', but also for '''automatic documentation''' creation and program '''testing'''.  The combination of Subversion and Make opens the door to a nightly build for your project--a proven way to catch and correct bugs.
 +
 +
<!--
 
* [[Linux1|Linux1]]
 
* [[Linux1|Linux1]]
 
* [[Fortran1|Fortran1]]
 
* [[Fortran1|Fortran1]]
Line 34: Line 50:
 
* [[UsingNetCDF|Using NetCDF]]
 
* [[UsingNetCDF|Using NetCDF]]
 
* [[UsingSSH|Using SSH]]
 
* [[UsingSSH|Using SSH]]
 +
-->

Revision as of 14:13, 23 July 2009


"Pragmatic Programming" is a course which was designed for new postgraduate students and members of staff in Geographical Sciences.

As well as being available year round on this wiki, the course is also given every year as series of monthly practicals starting in the Autumn term. The idea is to have a regular monthly programming skills session over the first year of a PhD. The course is open to postgraduates and postdocs in Geographical Sciences and elsewhere. If you are interested in attending the course, please contact the administrators.

Rationale

A few years back, there was a short course for physical geography postgraduate students providing core computer skills required for the many modelling activities in the department. It covered briefly the Linux operating system, Fortran programming and the use of numerical libraries. Although this course stopped a while ago, there is still a clear and vocalised need for that type of tuition today.

"Pragmatic Programming" was designed to fill that gap. The course was written specifically for Geographical Sciences postgrads and postdocs but will be relevant to many researchers. Since Fortran is used widely across physical geography research groups today, Fortran has been chosen as the main programming language. However, if demand is sufficient it would be possible to add an element on C/C++.

Credits

"Pragmatic Programming" was designed in 2008 by JP Renaud and Gethin Williams.

The design and running of the course is financed using is Roberts Skills money.

Course content

The following is a list of example-led tutorials which will be used to provide an engineering framework, upon which scientific programming can be profitably overlaid.

Thread1: Fortran and python programming
  1. Fortran1: Fortran for beginners. This is friendly introduction to Fortran and will guide you from writing your first program through to using more advanced data-types, such as arrays. Along the way, you will encounter Fortran's intrinsic data types, logic such as conditionals and loops, program structure and subroutines all the while providing pointers to good style and bug avoidance techniques.
  2. Fortran2: Intermediate Fortran. This tutorial follows on from Fortran1 and introduces features from Fortran90 which help us to write better, more maintainable programs. The topics covered include; dynamic memory allocation using allocatable arrays; flexible and easily extensible data-types through the use of user-derived types; enhanced modularity, encapsulation and error checking provided by modules. Linking your program to third party libraries is also covered, using NetCDF as an example.
  3. Should you wish to go further Numerics, Profiling and Debugging provide examples of common numerical programming gotchas; tips to help you find and improve any slow running regions of your program; and hints and tips for avoiding, finding and correcting any bugs that find their way into your code.
  4. An introduction to Python and the numpy package guides you through some first steps with python and highlights some of the very useful data manipulation and visualisation tools on offer. The examples will focus on data held in 2-dimensional arrays.
  5. Polyglot offers some concrete examples of mixed Fortran and C programming, including the new Fortran2003 interoperability features. Mixed language programming provide huge time-savings if you have access to, say, a third party library of routines written in C which you would like to make use of inside your existing Fortran project.
Thread2: Tools for Managing your Code and your Project
  1. The Subversion version control system is fantastic tool for collaborating, debugging, disaster recovery and, well, general sanity preservation!. This tutorial gives you hands on practice for all the essential features.
  2. Project building using Make guides you step-by-step through the otherwise opaque magic of Makefiles and highlights how they can be brought into service not only for code compilation, but also for automatic documentation creation and program testing. The combination of Subversion and Make opens the door to a nightly build for your project--a proven way to catch and correct bugs.