1 | #!/bin/bash |
---|
2 | |
---|
3 | # NEMO directory where to fetch compiled STATION_ASF nemo.exe + setup: |
---|
4 | NEMO_DIR=`pwd | sed -e "s|/tests/STATION_ASF/EXPREF||g"` |
---|
5 | |
---|
6 | echo "Using NEMO_DIR=${NEMO_DIR}" |
---|
7 | |
---|
8 | # what directory inside "tests" actually contains the compiled test-case? |
---|
9 | TC_DIR="STATION_ASF2" |
---|
10 | |
---|
11 | # => so the executable to use is: |
---|
12 | NEMO_EXE="${NEMO_DIR}/tests/${TC_DIR}/BLD/bin/nemo.exe" |
---|
13 | |
---|
14 | # Directory where to run the simulation: |
---|
15 | WORK_DIR="${HOME}/tmp/STATION_ASF" |
---|
16 | |
---|
17 | |
---|
18 | # FORC_DIR => Directory containing sea-surface + atmospheric forcings |
---|
19 | # (get it there https://drive.google.com/file/d/1MxNvjhRHmMrL54y6RX7WIaM9-LGl--ZP/): |
---|
20 | if [ `hostname` = "merlat" ]; then |
---|
21 | FORC_DIR="/MEDIA/data/STATION_ASF/input_data_STATION_ASF_2016-2018" |
---|
22 | elif [ `hostname` = "luitel" ]; then |
---|
23 | FORC_DIR="/data/gcm_setup/STATION_ASF/input_data_STATION_ASF_2016-2018" |
---|
24 | elif [ `hostname` = "ige-meom-cal1" ]; then |
---|
25 | FORC_DIR="/mnt/meom/workdir/brodeau/STATION_ASF/input_data_STATION_ASF_2016-2018" |
---|
26 | elif [ `hostname` = "salvelinus" ]; then |
---|
27 | FORC_DIR="/opt/data/STATION_ASF/input_data_STATION_ASF_2016-2018" |
---|
28 | else |
---|
29 | echo "Boo!"; exit |
---|
30 | fi |
---|
31 | #====================== |
---|
32 | mkdir -p ${WORK_DIR} |
---|
33 | |
---|
34 | |
---|
35 | if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled nemo.exe found into ${NEMO_DIR}/tests/STATION_ASF/BLD/bin !"; exit; fi |
---|
36 | |
---|
37 | echo |
---|
38 | echo " *** Using the following NEMO executable:" |
---|
39 | echo " ${NEMO_EXE} " |
---|
40 | echo |
---|
41 | |
---|
42 | |
---|
43 | NEMO_EXPREF="${NEMO_DIR}/tests/STATION_ASF/EXPREF" |
---|
44 | if [ ! -d ${NEMO_EXPREF} ]; then echo " Mhhh, no EXPREF directory ${NEMO_EXPREF} !"; exit; fi |
---|
45 | |
---|
46 | rsync -avP ${NEMO_EXE} ${WORK_DIR}/ |
---|
47 | |
---|
48 | for ff in "context_nemo.xml" "domain_def_nemo.xml" "field_def_nemo-oce.xml" "file_def_nemo-oce.xml" "grid_def_nemo.xml" "iodef.xml" "namelist_ref"; do |
---|
49 | if [ ! -f ${NEMO_EXPREF}/${ff} ]; then echo " Mhhh, ${ff} not found into ${NEMO_EXPREF} !"; exit; fi |
---|
50 | rsync -avPL ${NEMO_EXPREF}/${ff} ${WORK_DIR}/ |
---|
51 | done |
---|
52 | |
---|
53 | # Copy forcing to work directory: |
---|
54 | rsync -avP ${FORC_DIR}/Station_PAPA_50N-145W*.nc ${WORK_DIR}/ |
---|
55 | |
---|
56 | for CASE in "ECMWF" "COARE3p6" "NCAR" "ECMWF-noskin" "COARE3p6-noskin"; do |
---|
57 | |
---|
58 | echo ; echo |
---|
59 | echo "=============================" |
---|
60 | echo " Going for ${CASE} experiment" |
---|
61 | echo "=============================" |
---|
62 | echo |
---|
63 | |
---|
64 | scase=`echo "${CASE}" | tr '[:upper:]' '[:lower:]'` |
---|
65 | |
---|
66 | rm -f ${WORK_DIR}/namelist_cfg |
---|
67 | rsync -avPL ${NEMO_EXPREF}/namelist_${scase}_cfg ${WORK_DIR}/namelist_cfg |
---|
68 | |
---|
69 | cd ${WORK_DIR}/ |
---|
70 | echo |
---|
71 | echo "Launching NEMO !" |
---|
72 | ./nemo.exe 1>out_nemo.out 2>err_nemo.err |
---|
73 | echo "Done!" |
---|
74 | echo |
---|
75 | |
---|
76 | # Moving output files: |
---|
77 | mkdir -p output |
---|
78 | mv -f STATION_ASF-${CASE}_*_grid*.nc output/ |
---|
79 | |
---|
80 | # Saving logs: |
---|
81 | mkdir -p ${CASE}_log |
---|
82 | mv -f *.out *.err ocean.output output.namelist.dyn ${CASE}_log/ |
---|
83 | |
---|
84 | done |
---|