GEO 391: Land-Atmosphere Interaction Dynamics Programming Exercise 1

Please do all the four following exercises using FORTRAN 90, due before Sept 14 class begins. You may also want to see a cool website about Solar Position Calculator at  http://solardat.uoregon.edu/SolarPositionCalculator.html, although it includes some materials that are not taught in our course.

1. Modify my sample FORTRAN code (austin_solar2.pdf) that computes daily mean top-of-the-atmosphere (TOA) solar radiation. My code uses the hourly interval. Please modify the code to use a series of different time intervals and then find at what interval the discrete solution is within 0.01 Wm-2 of the analytical solution. You may want to program the code so that it searches the desired solution automatically.

[Sample answers: Xitian Cai; Gang Zhang; more volunteers are needed here]

2. Modify the above code to calculate the length of sunlight during the day for the first day of each month from January through December given an input of city name and its latitude. For example, the daylight length at 30ºN (Austin) on October 1 (DOY=274) is 11 hours and 41 minutes. You need to have your output similar to the content in DayLengthAustin.pdf

[Sample answers: Xitian Cai; Gang Zhang; more volunteers are needed here]

3.Modify the code in #2 to calculate the length of sunlight during the day for the first day of each season (spring, summer, fall, and winter). You need to have your output similar to the content in DayLength_LatSeason.pdf

[Sample answers: Xitian Cai; Gang Zhang; more volunteers are needed here]

4. Modify the code (austin_solar5.pdf) to compute the daily average insolation at the top of the atmosphere as a function of latitude and season (i.e. the mid-month of each month from January to December). Your output should have a format similar to that in TOA_Insolation_LatMon.pdf. Compare your results with Figure 2.6 in Hartmann. Draw a figure from your output using NCL (preferred).

[Sample answers: Xitian Cai's FORTRAN; FORTRAN code by W. Fu, NCL code by W. Fu, K. Wang's NCL, NCL by Xitian Cai, figure by W. Fu ; FORTRAN code by Gang Zhang, matlab code by Gang Zhang, figure by Gang Zhang ; more volunteers are needed here]

Useful links:

Websites with overview of unix and vi commands (Courtesy of Lindsey Gulden):

Here's a tutorial-style intro to unix: http://www.ee.surrey.ac.uk/Teaching/Unix/

This one lists commonly used unix commands: http://www.bsd.org/unixcmds.html

This site gives a good written overview of vi (the "MS Word" of UNIX). http://www.eng.hawaii.edu/Tutor/vi.html#intro

These sites summarize/list vi commands:

http://www.cs.rit.edu/~cslab/vi.html

http://www.bo.infn.it/alice/alice-doc/mll-doc/linux/vi-ex/node59.html

If using vi makes you see red, try emacs, which has a more user-friendly interface and is more MS-Word like. type "emacs [filename]" at the command prompt.

FORTRAN 77 tutorial

FORTRAN90 tutorial:

http://www.stanford.edu/class/me200c/tutorial_90/

http://www.phy.cmich.edu/people/fornari/pdf/f90tutor.pdf

http://www.owlnet.rice.edu/~ceng303/manuals/fortran/index.html

F77 to F90: http://www.nsc.liu.se/~boein/f77to90/a3.html