source: lmdz_wrf/WRFV3/tools/build_codebase @ 1

Last change on this file since 1 was 1, checked in by lfita, 10 years ago
  • -- --- Opening of the WRF+LMDZ coupling repository --- -- -

WRF: version v3.3
LMDZ: version v1818

More details in:

  • Property svn:executable set to *
File size: 3.3 KB
Line 
1#!/bin/csh
2
3
4set db=tools/code_dbase
5
6#goto skippy
7#goto sk1
8# set this to a value to speed up the subinfo calls; set with no value for normal
9set gofast       # default is not fast (no value given, but set)
10
11if ( $#argv == 1 ) then
12   if (  $argv[1] == "fast" ) then
13      set gofast=yes
14   endif
15endif
16
17if ( ! -d tools ) then
18  echo run $0 in top level WRF directory
19endif
20if ( ! -x tools/deftab || ! -x tools/nocontf90 || ! -x tools/subinfo_calls || ! -x tools/callgraph ) then
21  ( cd tools/CodeBase ; make )
22  if ( ! -x tools/deftab || ! -x tools/nocontf90 || ! -x tools/subinfo_calls || ! -x tools/callgraph ) then
23    echo some error building the tools in tools/CodeBase. Cannot continue.
24    exit(2)
25  endif
26endif
27
28/bin/rm -fr $db
29mkdir $db
30
31if ( ! -f frame/module_state_description.f ) then
32  echo
33  echo '*** ' code must be compiled first before code database can be built
34  echo '*** ' because it is based on the .f files
35  echo
36  exit(99)
37endif
38set dirs=( dyn_em frame main phys share )
39#set dirs=( dyn_nmm frame main phys share )
40#set dirs=( phys )
41#set dirs=( main )
42foreach d ( $dirs )
43  foreach f ( $d/*.f )
44    set ff=$f:t
45    echo $f
46    tools/nocontf90 < $f | expand |  \
47           sed                       \
48               -e 's/  */ /g'        \
49               -e 's/^ //'           \
50               -e '/^$/d'            \
51               -e 's/^real,/real ,/' \
52               -e 's/^integer,/integer ,/' \
53               -e 's/^type(/type (/' \
54               -e 's/^logical,/logical ,/' \
55               > $db/lm_${f:t}_1
56    tools/deftab $f < $db/lm_${f:t}_1
57    /bin/rm -f $db/lm_${f:t}_1
58  end
59end
60
61cat -n $db/calls | sort -u +1  > xxx
62sort -n +0 -1 xxx | awk '{print $2 " " $3 " " $4}'  > $db/calls
63
64############ pre-compute the subinfo html entries ##########
65
66skippy:
67
68foreach f ( `/bin/ls -1 $db | grep -v '\.html' | grep -v calls | grep -v '^lm_' | grep -v '^vv_' | grep -v '_descrip$'` )
69  echo creating html file for $f
70  tools/subinfo $f $gofast > $db/$f.html
71end
72
73#foreach f ( `/bin/ls -1 $db/[a-f]* | grep -v '\.html' | grep -v calls | grep -v '^lm_'` )
74#  echo creating html file for $f
75#  tools/subinfo $f:t > $f.html
76#end
77#foreach f ( `/bin/ls -1 $db/[g-m]* | grep -v '\.html' | grep -v calls | grep -v '^lm_'` )
78#  echo creating html file for $f
79#  tools/subinfo $f:t > $f.html
80#end
81#foreach f ( `/bin/ls -1 $db/[n-t]* | grep -v '\.html' | grep -v calls | grep -v '^lm_'` )
82#  echo creating html file for $f
83#  tools/subinfo $f:t > $f.html
84#end
85#foreach f ( `/bin/ls -1 $db/[u-z]* | grep -v '\.html' | grep -v calls | grep -v '^lm_'` )
86#  echo creating html file for $f
87#  tools/subinfo $f:t > $f.html
88#end
89
90echo "Creating $db/index.html"
91
92/bin/cp tools/callgraph.page1      $db/callgraph.html
93tools/callgraph wrf 7           >> $db/callgraph.html
94cat      tools/callgraph.page2  >> $db/callgraph.html
95/bin/cp tools/index.page           $db/index.html
96/bin/cp tools/collapsd.gif tools/daughter.gif tools/exploded.gif $db 
97
98sk1:
99#tools/callgraph wrf 0                 > $db/index.html
100#echo ct2.html
101#tools/callgraph wrf 1                 > $db/ct2.html
102#echo ct3.html
103#tools/callgraph wrf 2                 > $db/ct3.html
104#echo ct4.html
105#tools/callgraph wrf 3                 > $db/ct4.html
106#echo ct5.html
107#tools/callgraph wrf 4                 > $db/ct5.html
108#echo ctall.html
109#tools/callgraph wrf                   > $db/ctall.html
110
111echo "Done"
112
Note: See TracBrowser for help on using the repository browser.