-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMOTORCLS
82 lines (78 loc) · 2.69 KB
/
MOTORCLS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
***********************************************************************
* CATEGORY.: ROCKET CALCULATIONS
* GROUP....: FORTRAN PROGRAMS
* AUTHOR...: LANCE HAYNIE <LANCE@HAYNIEMAIL.COM>
* DATE.....: 2017-09-14
* PURPOSE..: CONVERT NS TO MOTOR CLASSIFICATION
************************************************************************
* MODIFICATIONS
* 2017-09-14 - LHAYNIE - INITIAL VERSION
************************************************************************
PROGRAM MOTORCLS
REAL N
CHARACTER CLASS*5
CHARACTER*3 VER
VER = "1.0"
OPEN (UNIT=1,FILE="DATA")
READ (1,*) N
IF (N >= 0 .AND. N <= 0.3125) THEN
CLASS = "MICRO"
ELSE IF (N >= 0.3126 .AND. N <= 0.625) THEN
CLASS = "1/4A"
ELSE IF (N >= 0.626 .AND. N <= 1.25) THEN
CLASS = "1/2A"
ELSE IF (N >= 1.26 .AND. N <= 2.5) THEN
CLASS = "A"
ELSE IF (N >= 2.51 .AND. N <= 5) THEN
CLASS = "B"
ELSE IF (N >= 5.01 .AND. N <= 10) THEN
CLASS = "C"
ELSE IF (N >= 10.01 .AND. N <= 20) THEN
CLASS = "D"
ELSE IF (N >= 20.01 .AND. N <= 40) THEN
CLASS = "E"
ELSE IF (N >= 40.01 .AND. N <= 80) THEN
CLASS = "F"
ELSE IF (N >= 80.01 .AND. N <= 160) THEN
CLASS = "G"
ELSE IF (N >= 160.01 .AND. N <= 320) THEN
CLASS = "H"
ELSE IF (N >= 320 .AND. N <= 640) THEN
CLASS = "I"
ELSE IF (N >= 640 .AND. N <= 1280) THEN
CLASS = "J"
ELSE IF (N >= 1280 .AND. N <= 2560) THEN
CLASS = "K"
ELSE IF (N >= 2560 .AND. N <= 5120) THEN
CLASS = "L"
ELSE IF (N >= 5120 .AND. N <= 10240) THEN
CLASS = "M"
ELSE IF (N >= 10240 .AND. N <= 20560) THEN
CLASS = "N"
ELSE IF (N >= 20560 .AND. N <= 40960) THEN
CLASS = "O"
ELSE IF (N >= 40960 .AND. N <= 81920) THEN
CLASS = "P"
ELSE IF (N >= 81920 .AND. N <= 163840) THEN
CLASS = "Q"
ELSE IF (N >= 163840 .AND. N <= 327680) THEN
CLASS = "R"
ELSE IF (N >= 327680 .AND. N <= 655360) THEN
CLASS = "S"
ELSE IF (N > 655360) THEN
CLASS = "PROFESSIONAL"
ELSE
CLASS = "UNKNOWN"
END IF
OPEN (UNIT=2,FILE="RESULTS",STATUS="NEW")
WRITE (2,*) "HAYNIE RESEARCH & DEVELOPMENT"
WRITE (2,*) "ROCKET MOTOR CLASSIFICATION"
WRITE (2,*) "VERSION ", VER
WRITE (2,*) " "
WRITE (2,*) "-INPUT DATA-"
WRITE (2,*) "TOTAL IMPULSE (N):", N
WRITE (2,*) " "
WRITE (2,*) "-RESULTS-"
WRITE (2,*) "MOTOR CLASSIFICATION: ", CLASS
CLOSE (2)
END