Anda di halaman 1dari 2

Lab Exam 1- Radioactive decay CGS2421L- Fall 2010 An archeologist is trying to date a site using carbon dating.

She has taken several samples from various bone implements found at the site. She believes that all the implements were created around the same time by the inhabitants of the site, but she is not sure so she has taken several samples from which she will find the average date. Radioactive decay. All organisms contain radioactive materials which decay after their death. Because radioactive decay occurs at a known rate it can be used to measure the time from which decay started in an organism. The decay constant of carbon 14 is well known and accurately measured having a decay constant = 0.00012097. The amount of carbon 14 present at a future time t after death is given by (where Q0 is the initial amount of carbon 14 present, assuming time of death is at t=0): = 0 (1)

Thus if the current amount of carbon 14 is known Q(t) as well as Q0, it is easy to find the time since death of the organism by =
1

ln (

(2)

TO DO: 0) Menu- see the attached executable for the menu. Note that it does NOT include an error check in options B-D to check whether or not data has been entered. 1) Choice A- Data Entry. The first thing that the data entry reads in is the initial carbon level Q0. Error check- this value must be numeric and positive. Then all the data values for remaining carbon quantities (Q(i)) are read in. Store these values in an ARRAY Q. Error check- these values must be numeric and positive. You should also keep track of the number of data points entered here. 2) Write a module that contains a CONSTANT and also Q0. The module should also contain functions that calculate equations 1 and 2 with signatures REAL FUNCTION REMAININGCARBON(T) and REAL FUNCTION TIMESINCEDEATH(Q) 3) Write functions to calculate equations 1 and 2 and place them in the module. The signatures must be exactly as given below: REAL FUNCTION REMAININGCARBON(T) and REAL FUNCTION TIMESINCEDEATH(Q) 4) Choice B- printing out a table of the expected remaining carbon at times steps T given Q0. When choice B is called prompt the user to enter the time T which is the max value they would like to print out

the table for. Error check- this value is numeric and positive. This choice then calls subroutine PRINTTABLE. 5) Write a subroutine SUBROUTINE PRINTTABLE(T) that prints the table when choice B is selected. This subroutine will call the function REMAININGCARBON from the module. The table should print in integer increments of 500 years from 0 up to less than or equal to the value specified by the user. Use some FORMATs to print your table neatly. 6) Choice C- prints out the time since death for one sample. When choice C is selected, prompt the user to enter which sample ID they would like to calculate the time since death for. Error check- this value is INTEGER and positive. Choice C should then call the function TIMESINCEDEATH for Q(ID). 7) Choice D- this choice calculates the average time since death for all the samples stored in array Q. This choice should call function AVERAGETIME. 8) Write to calculate the average time since death over all the samples in an array. The signature should look like: REAL FUNCTION AVERAGETIME(A,N) INTEGER,INTENT(IN)::N REAL, INTENT(IN)::A(N) 9) Write a subroutine to do numeric checks for data input. SUBROUTINE ISNUMBER(VALUE, isReal, NUM) implicit none CHARACTER(LEN=*),INTENT(IN)::VALUE LOGical, INTENT(OUT):: isReal REAL,INTENT(OUT)::NUM 10) Write a subroutine to check for integer inputs for input data SUBROUTINE ISINTEGER(VALUE, isINT, NUM) implicit none CHARACTER(LEN=*),INTENT(IN)::VALUE LOGical, INTENT(OUT):: isINT INTEGER,INTENT(OUT)::NUM

HINTS: 1) Do the exam IN THE ORDER GIVEN. 2) With the exception of all the error checking which should be done LAST 3) For parts 9/10 the code can be found in your project 4.

Anda mungkin juga menyukai