Class 11 Tue, 2017-10-10 FORTRAN I (HW03)

the "what are they doing?" question
FORTRAN: only Fortran, Cobol, and C (ANSI C) are truly standardized
Versions: Fortran 66, f77, f90/95, f2000/2003: newer versions are almost perfectly backward compatible
the compile chain: syntax analysis/parsing --> metacode --> assembly code --> sharable objects --> linked into executable (a.out)
simple code: "Hello World"; show compiler output, look at assembler
Interlude: computer memory hierarchy: physical memory
virtual memory space versus physicsl memory , caching, paging, swapping, show 'top'
FILE:code.fortran1 simple f77 code sytax, declarations, implicit declarations, compile process


Homework 03: due Thursday, October 18, 2017 (HW03)


UNH has a weather station , which gives you nice graphs of current and historical weather parameters. The data are also available from a web server. According to Mark Maciolek, who runs the server:

 
The radiation sensor was dead for a few years at least all of 2014,2015 till July 2016 
The wind data is bad for most of 2015 till July of 2016 when the hardware was replaced. Also the layout of the files changed with the new hardware. 
This page explains the changes: 
http://www.weather.unh.edu/display.mp?FILE=about 

I have put the data files on http://jr.sr.unh.edu/~jraeder/weatherdata/.
  1. Write a Perl script that automatically downloads the data.
  2. For each of the variables (temperature,wind_speed,wind_direction) extract the data and store them in a file where each record (line) consists of date/time (both UTC in ISO8601 format and UNIX time) and the corresponding value. Watch out for "fill values" that may be inserted for missing data. Also, the time is local time. Make sure you properly convert to UTC.
  3. The data come in 1 minute averages. Average the data to a given (longer) interval DT. The times of the averaged data should be properly centered, i.e., the average at T should be from the data of T-0.5*DT to T+0.5*DT. If there are no data available for an averaging interval, leave a gap in the output. Do the averaging in a Perl sub that you can eventually reuse.
  4. Fill the data gaps by linear interpolation. Again, write a sub that can be reused.
  5. Do not turn in the data files, just the code.