Subversion Repositories lagranto.wrf

Rev

Rev 2 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 11
1
#!/bin/csh
1
#!/bin/csh
2
 
2
 
3
# ---------------------------------------------------------------------------
3
# ---------------------------------------------------------------------------
4
# Set parameters - handle arguments 
4
# Set parameters - handle arguments 
5
# ---------------------------------------------------------------------------
5
# ---------------------------------------------------------------------------
6
 
6
 
-
 
7
# Set Lagranto 
-
 
8
set LAGRANTO = ${LAGRANTOBASE}.${MODEL}/
-
 
9
 
7
set dir    = ${LAGRANTO}/docu/
10
set dir    = ${LAGRANTO}/docu/
8
set viewer = xpdf
11
set viewer = xpdf
9
set nargv  = ${#argv}
12
set nargv  = ${#argv}
10
 
13
 
11
if ( (${#argv} == 0) ) then
14
if ( (${#argv} == 0) ) then
12
    nroff -man ${dir}/man/lagrantohelp.0 | less
15
    nroff -man ${dir}/man/lagrantohelp.0 | less
13
    exit 0
16
    exit 0
14
endif
17
endif
15
 
18
 
16
if ( "${nargv}" == "1" ) then
19
if ( "${nargv}" == "1" ) then
17
   set mode = "$1"
20
   set mode = "$1"
18
   set verb = "long"
21
   set verb = "long"
19
else if ( "${nargv}" == "2" ) then
22
else if ( "${nargv}" == "2" ) then
20
   set mode = "$1"
23
   set mode = "$1"
21
   set verb = "$2"
24
   set verb = "$2"
22
endif
25
endif
23
 
26
 
24
# ---------------------------------------------------------------------------
27
# ---------------------------------------------------------------------------
25
# Tutorial, Reference, Presentation, Future Plans
28
# Tutorial, Reference, Presentation, Future Plans
26
# ---------------------------------------------------------------------------
29
# ---------------------------------------------------------------------------
27
 
30
 
28
if ( "$mode" == "future" ) then
31
if ( "$mode" == "future" ) then
29
    nroff -man ${dir}/man/futureplans.0 | less
32
    nroff -man ${dir}/man/futureplans.0 | less
30
    exit 0
33
    exit 0
31
endif
34
endif
32
 
35
 
33
if ( "$mode" == "tutorial" ) then
36
if ( "$mode" == "tutorial" ) then
34
    ${viewer} ${dir}/tutorial/tutorial.pdf 
37
    ${viewer} ${dir}/tutorial/tutorial.pdf 
35
    exit 0
38
    exit 0
36
endif
39
endif
37
 
40
 
38
if ( "$mode" == "reference" ) then
41
if ( "$mode" == "reference" ) then
39
    ${viewer} ${dir}/reference/reference.pdf
42
    ${viewer} ${dir}/reference/reference.pdf
40
    exit 0
43
    exit 0
41
endif
44
endif
42
 
45
 
43
if ( "$mode" == "presentation" ) then
46
if ( "$mode" == "presentation" ) then
44
    ${viewer} ${dir}/presentation/presentation.pdf
47
    ${viewer} ${dir}/presentation/presentation.pdf
45
    exit 0
48
    exit 0
46
endif
49
endif
47
 
50
 
48
# ---------------------------------------------------------------------------
51
# ---------------------------------------------------------------------------
49
# Manual
52
# Manual
50
# ---------------------------------------------------------------------------
53
# ---------------------------------------------------------------------------
51
 
54
 
52
if ( "${verb}" == "long" ) then
55
if ( "${verb}" == "long" ) then
53
    nroff -man ${dir}/man/${mode}.0 | less
56
    nroff -man ${dir}/man/${mode}.0 | less
54
    exit 0
57
    exit 0
55
endif
58
endif
56
 
59
 
57
if ( "${verb}" == "short" ) then
60
if ( "${verb}" == "short" ) then
58
    echo
61
    echo
59
    nroff -man ${dir}/man/${mode}.0 | grep -A 1 SYNOPSIS
62
    nroff -man ${dir}/man/${mode}.0 | grep -A 1 SYNOPSIS
60
    echo
63
    echo
61
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES | awk -F ":" '{print $1}'`
64
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES | awk -F ":" '{print $1}'`
62
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n AUTHOR   | awk -F ":" '{print $1}'`
65
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n AUTHOR   | awk -F ":" '{print $1}'`
63
    set i1 = `echo "$i1 - 1" | bc`  
66
    set i1 = `echo "$i1 - 1" | bc`  
64
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
67
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
65
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
68
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
66
    endif
69
    endif
67
endif
70
endif
68
 
71
 
69
if ( "${verb}" == "synopsis" ) then
72
if ( "${verb}" == "synopsis" ) then
70
    echo
73
    echo
71
    nroff -man ${dir}/man/${mode}.0 | grep -A 1 SYNOPSIS
74
    nroff -man ${dir}/man/${mode}.0 | grep -A 1 SYNOPSIS
72
    echo
75
    echo
73
    exit 0
76
    exit 0
74
endif
77
endif
75
 
78
 
76
if ( "${verb}" == "parameter" ) then
79
if ( "${verb}" == "parameter" ) then
77
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n PARAMETERS | awk -F ":" '{print $1}'`
80
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n PARAMETERS | awk -F ":" '{print $1}'`
78
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES   | awk -F ":" '{print $1}'`
81
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES   | awk -F ":" '{print $1}'`
79
    set i1 = `echo "$i1 - 1" | bc`
82
    set i1 = `echo "$i1 - 1" | bc`
80
    echo $i0
83
    echo $i0
81
    echo $i1
84
    echo $i1
82
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
85
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
83
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
86
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
84
    endif
87
    endif
85
    exit 0
88
    exit 0
86
endif
89
endif
87
 
90
 
88
if ( "${verb}" == "examples" ) then
91
if ( "${verb}" == "examples" ) then
89
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES | awk -F ":" '{print $1}'`
92
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES | awk -F ":" '{print $1}'`
90
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n AUTHOR   | awk -F ":" '{print $1}'`
93
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n AUTHOR   | awk -F ":" '{print $1}'`
91
    set i1 = `echo "$i1 - 1" | bc`  
94
    set i1 = `echo "$i1 - 1" | bc`  
92
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
95
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
93
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
96
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
94
    endif
97
    endif
95
    exit 0
98
    exit 0
96
endif
99
endif
97
 
100
 
98
 
101
 
99
exit 0
102
exit 0