1 | #!/bin/bash |
---|
2 | # |
---|
3 | # Lancement d'un install_lmdz.sh immédiatement apres un commit |
---|
4 | # pour tester la compilation et l'execution. Retour d'un code erreur adequat |
---|
5 | # au serveur svn pour notifier qui de droit |
---|
6 | |
---|
7 | set -vx |
---|
8 | |
---|
9 | REV="$1" |
---|
10 | |
---|
11 | TMP_OUT=/u/lmdz/WWW/Distrib/OUT |
---|
12 | TMP_D=/tmp/lmdz/test_rev_${REV}_$$ ; mkdir -p $TMP_D |
---|
13 | ncdfdir=/u/lmdz/Netcdf/lmdz-cq_20230902 |
---|
14 | |
---|
15 | resolution=48x36x39 |
---|
16 | physiq=NPv6.0.14splith |
---|
17 | # Changed on 15/03/2023 r4473 |
---|
18 | physiq=NPv6.3 |
---|
19 | |
---|
20 | cd $TMP_D |
---|
21 | cp /u/lmdz/WWW/pub/install_lmdz.sh . |
---|
22 | #chmod 755 /u/lmdz/WWW/pub/install_lmdz.sh |
---|
23 | chmod +x install_lmdz.sh |
---|
24 | #./install_lmdz.sh -SCM -unstable -debug -d $resolution -r $REV -physiq $physiq > ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ 2>&1 |
---|
25 | #./install_lmdz.sh -SCM -unstable -debug -d $resolution -r $REV -netcdf /u/lmdz/Netcdf/lmdz-cq_9.4.0_ubunutu20.04/ -rad oldrad -parallel mpi_omp -physiq $physiq \ |
---|
26 | ./install_lmdz.sh -SCM -unstable -debug -d $resolution -r $REV -netcdf $ncdfdir -rad oldrad -parallel mpi_omp -benchphysiq $physiq \ |
---|
27 | -arch local-gfortran9-parallel -arch_dir /u/lmdz/WWW/Distrib/arch.local \ |
---|
28 | > ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ 2>&1 |
---|
29 | # |
---|
30 | # menage: si ca a marche on efface le repertoire dans /tmp/lmdz |
---|
31 | # |
---|
32 | grep 'Everything is cool' ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
33 | RET=$? |
---|
34 | # checking 1D results |
---|
35 | cd LMDZ*${REV}*/1D/EXEC/6AL79/ |
---|
36 | listecas="ARMCU/REF RICO/SHORT SANDU/REF" |
---|
37 | ((ret1d=0)) |
---|
38 | for cas in $listecas ; do |
---|
39 | ((ret1d=$ret1d*10)) |
---|
40 | gunzip -dc "$cas"/listing.gz |grep -i cool |
---|
41 | retcas=$? |
---|
42 | ((ret1d=$ret1d+$retcas)) |
---|
43 | done |
---|
44 | # checking isotope compilation |
---|
45 | if [[ -v LD_LIBRARY_PATH ]]; then |
---|
46 | echo "export LD_LIBRARY_PATH=$ncdfdir/lib:$LD_LIBRARY_PATH" >> icosalmdz.env |
---|
47 | else |
---|
48 | echo "export LD_LIBRARY_PATH=$ncdfdir/lib" >> icosalmdz.env |
---|
49 | fi |
---|
50 | export PATH=$ncdfdir/bin:$PATH |
---|
51 | |
---|
52 | cd $TMP_D |
---|
53 | cd LMDZ*${REV}*/modipsl/modeles/LMDZ/ |
---|
54 | ./makelmdz_fcm -debug -arch local -j 8 -rad rrtm -d $resolution -v false -p lmdiso -isotopes true -isoverif true gcm > ./compile_iso.out 2>&1 |
---|
55 | ls bin/*iso* |
---|
56 | retiso=$? |
---|
57 | |
---|
58 | if [ ${RET} -eq 0 ] && [ ${ret1d} -eq 0 ] && [ ${retiso} -eq 0 ] ; then |
---|
59 | echo "Everything is cool for revision ${REV}" >> ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
60 | echo "Cleaning up /tmp/lmdz/test_rev_${REV}_$$" >> ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
61 | \rm -rf /tmp/lmdz/test_rev_${REV}_$$ |
---|
62 | else |
---|
63 | echo "There is a problem. QC is run in this directory /tmp/lmdz/test_rev_${REV}_$$ on lmdz-cq" |
---|
64 | fi |
---|
65 | # |
---|
66 | # sorties retour nécessaires pour envoyer le message a la liste |
---|
67 | # |
---|
68 | echo "Sortie dans" ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
69 | if [ ${RET} -eq 0 ] ; then |
---|
70 | echo "Bench 3D ok" |
---|
71 | fi |
---|
72 | if [ ${ret1d} -eq 0 ] ; then |
---|
73 | echo "Bench 1D ok" |
---|
74 | fi |
---|
75 | if [ ${retiso} -eq 0 ] ; then |
---|
76 | echo "Compilation iso ok" |
---|
77 | fi |
---|
78 | |
---|
79 | #grep 'Everything is cool' ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ |
---|
80 | exit |
---|