!___________________________________________________________________________________________________ ! Aleksandar Donev ! PHY201 Solutions to Worksheet ! December, 2000, MSU !___________________________________________________________________________________________________ ! PROGRAM Erf_Plot USE Precision USE Erf_Series, ONLY: error USE Erf_Timing USE SimpleGraphics USE FunGraphics IMPLICIT NONE ! We are in position to choose whether we want REAL or COMPLEX x: ! Comment one of these out: INTEGER :: i,k,status,n_points ! I/O status REAL(KIND=sp), PARAMETER :: x_min=0.0,x_max=4.5 ! Range of plot CHARACTER(50), DIMENSION(2) :: title CHARACTER(3), DIMENSION(2) :: spec UserInput: DO WRITE(UNIT=*,FMT="(A)",ADVANCE="NO") "Enter: n_points and error: " READ(UNIT=*,FMT=*,IOSTAT=status) n_points,error IF(status==0) EXIT UserInput ! Do not exit until the user enters acceptable numbers END DO UserInput title(1)="Timing benchmark for the function ErfSeries(x)" WRITE(title(2),*) "epsilon=",error,", A. Donev 1/10/00" ! We plot the curve both with points and with symbols: spec(1)="L-B" ! Line spec(2)="STR" ! Symbols CALL InitGraphics(file="Erf_Timing.PNG",file_type="CONS", & plot_title=title, & x_label="x",y_label="time (us)") CALL FunPlot2D(f_x=TimeErf,x_range=(/x_min,x_max/),num_points=n_points, & plot_spec=spec) CALL EndGraphics() END PROGRAM Erf_Plot !