/[MITgcm]/MITgcm/verification/cpl_aim+ocn/run_cpl_test_itrda
ViewVC logotype

Contents of /MITgcm/verification/cpl_aim+ocn/run_cpl_test_itrda

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Thu Jul 28 21:52:57 2005 UTC (16 years ago) by jmc
Branch: MAIN
Changes since 1.2: +2 -3 lines
use standard optfile

1 #! /bin/sh
2
3 # $Header: /u/gcmpack/MITgcm/verification/cpl_aim+ocn/run_cpl_test_itrda,v 1.2 2004/11/17 02:50:11 edhill Exp $
4 # $Name: $
5
6 Np=3
7 if [ $# -lt 1 ]
8 then
9 echo 'Usage:'`basename $0`' step '
10 echo ' => test coupled set-up on myrinet cluster'
11 echo 'step = 0 : clean all directories'
12 echo 'step = 1 : compile the 3 executables (cpl,ocn,atm)'
13 echo 'step = 2 : copy input files and dir(s)'
14 echo "step = 3 : run on $Np processor"
15 echo 'step = 4 : check the results'
16 exit
17 fi
18 kpr=$1
19 dir=`pwd`
20
21 #- only works from a 3 nodes PBS bach session ( qsub -I -l nodes=3:p4 )
22 # on myrinet cluster:
23 #xx=`hostname | sed 's/[0-9]/X/g'`
24 #if test $xx != 'myrinet-X-XX'
25 #then
26 # echo ' hostname='`hostname`
27 # echo 'for now, works only on myrinet cluster'
28 # exit 9
29 #fi
30 if test 'dummy'$PBS_NODEFILE = 'dummy'
31 then
32 echo ' $PBS_NODEFILE not defined'
33 echo "for now, works only from a $Np nodes PBS bach session"
34 exit 8
35 else ncpus=`wc -l $PBS_NODEFILE | awk '{print $1}'`
36 if test $ncpus != $Np ; then
37 echo ' Nb of nodes from $PBS_NODEFILE =' $ncpus
38 echo "for now, works only from a $Np nodes PBS bach session"
39 exit 8
40 fi
41 fi
42
43 #============================================================================
44
45 if test $kpr = 0
46 then
47 rm -f genmake_optfile pr_group std_outp
48 rm -f build_???/TTT.*make.* build_???/TTT.mkdepend.*
49 /bin/rm -r -f rank_0 rank_1 rank_2
50 if test -f build_cpl/Makefile ; then cd build_cpl ; make CLEAN ; cd .. ; fi
51 if test -f build_ocn/Makefile ; then cd build_ocn ; make CLEAN ; cd .. ; fi
52 if test -f build_atm/Makefile ; then cd build_atm ; make CLEAN ; cd .. ; fi
53 fi
54
55 if test $kpr = 1
56 then
57
58 cp -p ../../tools/build_options/linux_ia32_g77+mpi_itrda genmake_optfile
59 echo '==== compile coupler:'
60 cd build_cpl
61 echo ' --- genmake2 (cpl):'
62 ../../../tools/genmake2 -of ../genmake_optfile -mpi -ieee > TTT.genmake.$$
63 tail -5 TTT.genmake.$$
64 echo ' --- make depend (cpl):'
65 make depend > TTT.mkdepend.$$
66 tail -5 TTT.mkdepend.$$
67 echo ' --- make (cpl):'
68 make -j 2 > TTT.make.$$ 2>&1
69 tail -10 TTT.make.$$
70 echo ' ' ; cd $dir
71
72 echo '==== compile OGCM:'
73 cd build_ocn
74 echo ' --- genmake2 (ocn):'
75 ../../../tools/genmake2 -of ../genmake_optfile -mpi -ieee > TTT.genmake.$$
76 tail -5 TTT.genmake.$$
77 echo ' --- make depend (ocn):'
78 make depend > TTT.mkdepend.$$
79 tail -10 TTT.mkdepend.$$
80 echo ' --- make (ocn):'
81 make -j 2 > TTT.make.$$ 2>&1
82 tail -10 TTT.make.$$
83 echo ' ' ; cd $dir
84
85 echo '==== compile AGCM:'
86 cd build_atm
87 echo ' --- genmake2 (atm):'
88 ../../../tools/genmake2 -of ../genmake_optfile -mpi -ieee > TTT.genmake.$$
89 tail -5 TTT.genmake.$$
90 echo ' --- make depend (atm):'
91 make depend > TTT.mkdepend.$$
92 tail -10 TTT.mkdepend.$$
93 echo ' --- make (atm):'
94 make -j 2 > TTT.make.$$ 2>&1
95 tail -10 TTT.make.$$
96 echo ' ' ; cd $dir
97
98 ls -l build_???/mitgcmuv
99
100 fi
101
102 if test $kpr = 2
103 then
104 cp -p -r input_cpl rank_0
105 cp -p -r input_ocn rank_1
106 cp -p -r input_atm rank_2
107
108 cd rank_1
109 ./IMPORT_INPUT_FILES
110 cd $dir
111
112 cd rank_2
113 ./SHARE_OCN_GRID '../rank_1'
114 cd $dir
115
116 rm -rf cpl ocn atm
117 mkdir cpl ocn atm
118 if test -f build_cpl/mitgcmuv ; then cp -p build_cpl/mitgcmuv cpl
119 else echo 'file: build_cpl/mitgcmuv not found => stop'; exit; fi
120 if test -f build_ocn/mitgcmuv ; then cp -p build_ocn/mitgcmuv ocn
121 else echo 'file: build_ocn/mitgcmuv not found => stop'; exit; fi
122 if test -f build_atm/mitgcmuv ; then cp -p build_atm/mitgcmuv atm
123 else echo 'file: build_atm/mitgcmuv not found => stop'; exit; fi
124
125 fi
126
127 if test $kpr = 3
128 then
129 ROOTDIR=$dir
130 rm -f rank_?/pickup*.ckptA.00?.00?.??ta
131 echo $ROOTDIR
132 tmpfil=TTT.$$
133
134 echo $PBS_NODEFILE
135 list=`cat $PBS_NODEFILE`
136 rm -f pr_group ; touch pr_group
137 nc=0 ; dd1=cpl ;
138 for xx in $list
139 do
140 echo $xx $nc $dir/build_$dd1/mitgcmuv >> pr_group
141 if test $nc = 0 ; then dd1=ocn ; else dd1=atm ; fi
142 nc=1
143 done
144
145 cd $ROOTDIR
146 # /usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpirun.ch_gm -pg pr_group -wd $ROOTDIR --gm-kill 5 -v ./build_cpl/mitgcmuv > std_outp 2>&1
147 mpirun -p4pg pr_group -v ./build_cpl/mitgcmuv > std_outp 2>&1
148 tail -20 std_outp
149 ls -l rank_?/pickup*.ckptA.001.001.data
150
151 fi
152
153 if test $kpr = 4
154 then
155
156 if test -f rank_1/STDOUT.0000
157 then echo '==> check Ocean output:'
158 /home/jmc/bin/comp_res rank_1/STDOUT.0000 results/ocnSTDOUT.0000
159 echo ' '
160 else echo 'No Ocean output file in rank_1' ; fi
161
162 if test -f rank_2/STDOUT.0000
163 then
164 echo '==> check Atmos output:'
165 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000
166 echo '==> check Land output:'
167 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 L
168 echo '==> check thSIce output:'
169 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 I
170 echo ' '
171 else echo 'No Atmos output file in rank_1' ; fi
172
173 fi
174
175 exit 0

  ViewVC Help
Powered by ViewVC 1.1.22