c-----------------------------1. explaination-------------------------------- c c --- 1.test windgen direction c test windgen--| c --- 2.test windgen speed c c----------------------------------------------------------------------------- c c 2.test windgen speed c c source code output c c |--windgen_mid_speed.for -> windgen_mid_speed c test |--test_eachyear_speed.for -> test_eachyear_speed c windgen --|--test_allyear_speed.for -> test_allyear_speed c speed |--error_direction_speed.for -> error_direction_speed c |--error_month_speed.for -> error_month_speed c c c windgen_output ----| c | |->test_eachyear_speed c | | c | | |->error_direction_speed c v |->test_allyear_speed-| c windgen_mid_speed---| |->error_month_speed c c c c 1)."windgen_output": output file generated by bin>wind_gen, c should be in bin subdirectory. c ex: c bin>wind_gen -v -D -f ../../db/wind_gen.wdb c -s 25704 -y 100 c -o windgen_output c c 2)."windgen_mid_speed.for": from the "windgen_output", the program c generated a output file c "windgen_mid_speed" which is used for c internal process output. c 3)."test_eachyear_speed.for": from the "windgen_mid_speed" file, c the program generated a output file c "test_eachyear_speed" which is c used for detail by month/dir of c each year. c 4)."test_allyear_speed.for": from the "windgen_mid_speed" file, c the program generated a output file c "test_allyear_speed" which is c used for detail by month/dir of c all year (5, 10, 15, ...100 ...). c 5)."error_direction_speed.for": from the "test_allyear_speed" file, c the program generated a output file c "error_direction_speed" which c is used for the summary error in c each direction of years. c 6)."error_month_speed.for": from the "test_allyear_speed" file, c the program generated a output file c "error_month_speed" which is used c for the summary error in each month c of years c---------------------------------------------------------------------------- c------------------2. variable & i/o format------------------------------ c for variable c year: each year from beginning year to end year c no_years: number of years to simulate c pro: the percent of speed>=v c percent(12):the percent of speed>=v of 16 dir & calm respectively c in simulation database for each month integer year, no_years real pro, percent(12) c for output header 81 format ( 'No.1 "0" direction from windgen_output') 82 format ( 'No.2 "22.5" direction from windgen_output') 83 format ( 'No.3 "45" direction from windgen_output') 84 format ( 'No.4 "67.5" direction from windgen_output') 85 format ( 'No.5 "90" direction from windgen_output') 86 format ( 'No.6 "112.5" direction from windgen_output') 87 format ( 'No.7 "135" direction from windgen_output') 88 format ( 'No.8 "157.5" direction from windgen_output') 89 format ( 'No.9 "180" direction from windgen_output') 90 format ( 'No.10 "202.5" direction from windgen_output') 91 format ( 'No.11 "225" direction from windgen_output') 92 format ( 'No.12 "247.5" direction from windgen_output') 93 format ( 'No.13 "270" direction from windgen_output') 94 format ( 'No.14 "292.5" direction from windgen_output') 95 format ( 'No.15 "315" direction from windgen_output') 96 format ( 'No.16 "337.5" direction from windgen_output') 100 format ('The percent speed >= specific speed') 110 format ('yr/mon 1 2 3 4 5 6 7 8 +9 10 11 12') 130 format ('--------------------------------------------------------- +-------------------') c for output percent 200 format (i4, 12(2x,f4.2)) c for read format in 'windgen_mid_speed' file 400 format (6x, i4) 401 format (16x, f4.2) 402 format (21x, f4.2) 403 format (26x, f4.2) 404 format (31x, f4.2) 405 format (36x, f4.2) 406 format (41x, f4.2) 407 format (46x, f4.2) 408 format (51x, f4.2) 409 format (56x, f4.2) 410 format (61x, f4.2) 411 format (66x, f4.2) 412 format (71x, f4.2) 413 format (76x, f4.2) 414 format (81x, f4.2) 415 format (86x, f4.2) 416 format (91x, f4.2) integer k, i, m c for skip 500 format (1x) c------------------3. read and write file-------------------------- print*, "enter the number of years to simulate(100):" read*, no_years c write record to 'test_eachyear_speed' file open (8, file = 'test_eachyear_speed') write (8,100) write(8,500) do 30 k = 1, 16 if (k .eq. 1) then write(8,81) else if (k .eq. 2) then write(8,82) else if (k .eq. 3) then write(8,83) else if (k .eq. 4) then write(8,84) else if (k .eq. 5) then write(8,85) else if (k .eq. 6) then write(8,86) else if (k .eq. 7) then write(8,87) else if (k .eq. 8) then write(8,88) else if (k .eq. 9) then write(8,89) else if (k .eq. 10) then write(8,90) else if (k .eq. 11) then write(8,91) else if (k .eq. 12) then write(8,92) else if (k .eq. 13) then write(8,93) else if (k .eq. 14) then write(8,94) else if (k .eq. 15) then write(8,95) else if (k .eq. 16) then write(8,96) endif write(8,130) write(8,110) write(8,130) c read record from 'windgen_mid_speed' file c for simulation database information open(1,file='windgen_mid_speed', status='old') do 40 i=1, 5 read(1,500) 40 continue do 50 m = 1, no_years do 60 i = 1, 12 read(1, 400) year read(1, 500) if (k .eq. 1) then read (1, 401) pro else if (k .eq. 2) then read (1, 402) pro else if (k .eq. 3) then read (1, 403) pro else if (k .eq. 4) then read (1, 404) pro else if (k .eq. 5) then read (1, 405) pro else if (k .eq. 6) then read (1, 406) pro else if (k .eq. 7) then read (1, 407) pro else if (k .eq. 8) then read (1, 408) pro else if (k .eq. 9) then read (1, 409) pro else if (k .eq. 10) then read (1, 410) pro else if (k .eq. 11) then read (1, 411) pro else if (k .eq. 12) then read (1, 412) pro else if (k .eq. 13) then read (1, 413) pro else if (k .eq. 14) then read (1, 414) pro else if (k .eq. 15) then read (1, 415) pro else if (k .eq. 16) then read (1, 416) pro endif read(1,500) percent(i) = pro 60 continue write (8,200) year, (percent(i), i=1,12) 50 continue write (8,130) do 70 i = 1, 5 write (8,500) 70 continue close(1) 30 continue close(1) close(2) close(8) end