barakuda.sh 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  1. #!/usr/bin/env bash
  2. #==============================================================
  3. #
  4. # B A R A K U D A
  5. #
  6. # An OCEAN MONITORING python environment for NEMO
  7. #
  8. # L. Brodeau, 2009-2017
  9. #
  10. #===============================================================
  11. export script=barakuda
  12. [ -z ${BARAKUDA_ROOT+x} ] && export BARAKUDA_ROOT=${PWD}
  13. # Display available configs:
  14. list_conf="`\ls ${BARAKUDA_ROOT}/configs/config_*.sh | sed -e "s|${BARAKUDA_ROOT}/configs\/config_||g" -e s/'.sh'/''/g`"
  15. # User configs, potentially in the directory from which barakuda.sh is called:
  16. list_conf+=" `\ls ./config_*.sh 2>/dev/null | sed -e "s|.\/config_||g" -e s/'.sh'/''/g`"
  17. # Important bash functions:
  18. . ${BARAKUDA_ROOT}/src/bash/bash_functions.bash
  19. barakuda_init
  20. while getopts C:R:f:y:c:FeEh option ; do
  21. case $option in
  22. C) export CONFIG=${OPTARG} ;;
  23. R) export EXP=${OPTARG} ;;
  24. f) export IFREQ_SAV_YEARS=${OPTARG} ;;
  25. y) export YEAR0=${OPTARG} ; export LFORCE_YINI=true ;;
  26. c) export EXPREF=${OPTARG} ;;
  27. F) export LFORCEDIAG=true ;;
  28. e) export ISTAGE=2 ;;
  29. E) export ISTAGE=2 ; export l_clim_diag=true ;;
  30. h) barakuda_usage; exit ;;
  31. \?) barakuda_usage; exit ;;
  32. esac
  33. done
  34. barakuda_check
  35. # Time to source the config file:
  36. if [ -f ./config_${CONFIG}.sh ]; then
  37. # sourcing local configuration file if present:
  38. fconfig=./config_${CONFIG}.sh
  39. else
  40. # sourcing barakuda-distribution configuration file:
  41. fconfig=${BARAKUDA_ROOT}/configs/config_${CONFIG}.sh
  42. fi
  43. if [ -f ${fconfig} ]; then
  44. echo "Sourcing configuration file: ${fconfig} !"
  45. . ${fconfig}
  46. else
  47. echo "ERROR: cannot find file ${fconfig} !"; exit
  48. fi
  49. echo
  50. # If auto-submit experiment (ece_exp=10) then overides a few functions with:
  51. if [ ${ece_exp} -ge 10 ]; then
  52. echo "Sourcing ${BARAKUDA_ROOT}/src/bash/bash_functions_autosub.bash"
  53. . ${BARAKUDA_ROOT}/src/bash/bash_functions_autosub.bash
  54. fi
  55. # If 3D fieds are annual averaged then overides a few functions with:
  56. if [ ! "${ANNUAL_3D}" = "" ]; then
  57. . ${BARAKUDA_ROOT}/src/bash/bash_functions_1y.bash
  58. fi
  59. # List of CDFTOOLS executables needed for the diagnostics:
  60. export L_EXEC="cdfmaxmoc.x cdfmoc.x cdfvT.x cdftransportiz.x cdficeflux.x cdficediags.x cdfmhst.x cdfsigtrp.x"
  61. barakuda_setup
  62. echo
  63. echo " SETTINGS: "
  64. echo " *** CONFIG = ${CONFIG} "
  65. echo " *** NEMO_OUT_D = ${NEMO_OUT_D} "
  66. echo " *** CLIM_DIR = ${CLIM_DIR} "
  67. echo " *** TMP_DIR = ${TMP_DIR} "
  68. echo " *** GRID = ${ORCA} "
  69. echo " *** EXP = ${EXP} "
  70. echo " *** CPREF = ${CPREF} "
  71. echo " *** IFREQ_SAV_YEARS = ${IFREQ_SAV_YEARS} "
  72. echo " *** NCDF_DIR = ${NCDF_DIR} "
  73. echo
  74. if [ ${ISTAGE} -eq 1 ]; then
  75. barakuda_first_last_years ; # look at NEMO files to know what are first and last years available...
  76. echo ${IFREQ_SAV_YEARS} > ${DIAG_D}/numb_year_per_file.info
  77. echo ${YEAR_INI} > ${DIAG_D}/first_year.info
  78. else
  79. # -> this is stage 2 (plot generation) ISTAGE=2 !
  80. barakuda_init_plot
  81. fi
  82. cyear_ini=`printf "%04d" ${YEAR_INI}`
  83. cyear_end=`printf "%04d" ${YEAR_END}`
  84. # For proper python executables and scripts to be found:
  85. #export PATH=${PYBRKD_EXEC_PATH}:${BARAKUDA_ROOT}/src/bash:${PYTHON_HOME}/bin:${PATH}
  86. export PATH=${PYBRKD_EXEC_PATH}:${BARAKUDA_ROOT}/src/bash:${PATH}
  87. # setup over
  88. ######################################################################################
  89. jyear=${YEAR_INI}
  90. fcompletion=${DIAG_D}/last_year_done.info
  91. if [ -f ${fcompletion} ]; then jyear=`cat ${fcompletion}`; ((jyear++)); fi
  92. cd ${TMP_DIR}/
  93. barakuda_import_mesh_mask ; # Importing mesh_mask (+basin) files...
  94. if [ ${ISTAGE} -eq 1 ]; then
  95. # Importing cdftools executables:
  96. for ex in ${L_EXEC}; do rsync -v ${BARAKUDA_ROOT}/cdftools_light/bin/${ex} . ; done
  97. fi
  98. # L O O P A L O N G Y E A R S
  99. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100. lcontinue=true
  101. if ${LFORCEDIAG}; then lcontinue=false; fi
  102. while ${lcontinue}; do
  103. export cyear=`printf "%04d" ${jyear}`
  104. cpf=""
  105. #if [ ${ISTAGE} -eq 1 ] && [ ${ece_exp} -gt 0 ]; then
  106. iy=$((${jyear}-${YEAR_INI}+1+${YEAR_INI}-${YEAR_INI_F}))
  107. dir_ece=`printf "%03d" ${iy}`
  108. echo " *** ${cyear} => dir_ece = ${dir_ece}"
  109. cpf="${dir_ece}/"
  110. #fi
  111. i_get_file=0
  112. if [ $((${jyear}%${IFREQ_SAV_YEARS})) -eq 0 ]; then
  113. barakuda_check_year_is_complete ; # lcontinue might be updated to false!
  114. fi
  115. echo; echo
  116. export CRT1M=${CPREF}${cyear}${cmmdd1}_${cyear}${cmmdd2}
  117. if ${l_y2_j}; then export CRT1M=${CPREF}${cyear}${cmmdd1}_`printf "%04d" $((${jyear}+1))`${cmmdd2} ; fi
  118. if ${lcontinue}; then
  119. echo "Yeah! Year ${jyear} is saved..."; echo
  120. if [ ${ISTAGE} -eq 2 ]; then
  121. echo; echo "You cannot create figures and HTML pages yet!"
  122. echo " => finish treating the results first by launching barakuda.sh without the '-e' switch."
  123. exit
  124. fi
  125. echo; echo
  126. echo "*********************************************************************"
  127. echo " Experiment ${EXP}: Will generate diagnostics and data for year ${cyear}..."
  128. echo "*********************************************************************"
  129. echo; echo
  130. barakuda_import_files
  131. # Monthly files to work with for current year:
  132. ft1m=${CRT1M}_grid_T.nc
  133. fu1m=${CRT1M}_grid_U.nc
  134. fv1m=${CRT1M}_grid_V.nc
  135. fj1m=${CRT1M}_${FILE_ICE_SUFFIX}.nc ; # can be icemod or grid_T ....
  136. ff1m=${CRT1M}_${FILE_FLX_SUFFIX}.nc ; # file with surface fluxes
  137. #
  138. # Annual files to work with for current year:
  139. CRT1Y=`echo ${CRT1M} | sed -e s/"_${TSTAMP}_"/"_${ANNUAL_3D}_"/g`
  140. ft1y=${CRT1Y}_grid_T.nc
  141. fu1y=${CRT1Y}_grid_U.nc
  142. fv1y=${CRT1Y}_grid_V.nc
  143. fj1y=${CRT1Y}_${FILE_ICE_SUFFIX}.nc
  144. ff1y=${CRT1Y}_${FILE_FLX_SUFFIX}.nc
  145. CFG3D=${CRT1M}
  146. #
  147. # Files that contain the 3D fields (might be monthly or annaual sometimes (when "${ANNUAL_3D}" = "1y")
  148. ft3d=${ft1m}
  149. fu3d=${fu1m}
  150. fv3d=${fv1m}
  151. if [ "${ANNUAL_3D}" = "1y" ]; then
  152. [[ ${NEMO_SAVED_FILES_3D} =~ (^|[[:space:]])"grid_U"($|[[:space:]]) ]] \
  153. && CFG3D=${CRT1Y}; ft3d=${ft1y}; fu3d=${fu1y}; fv3d=${fv1y} \
  154. || echo "...default"
  155. echo ""
  156. fi
  157. fvt=${CFG3D}_VT.nc
  158. # -- time to compute diagnostics --
  159. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  160. # If coupled EC-Earth simu, attempting to compute ocean-averaged fluxes from IFS too (E, P, E-P)
  161. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  162. if [ ${ece_exp} -eq 2 ] && [ ${NBL} -eq 75 ] && [ ${i_do_ifs_flx} -eq 1 ]; then
  163. echo; echo; echo "Fluxes of freshwater at the surface from IFS..."
  164. echo " *** CALLING: extract_ifs_surf_fluxes.sh &"
  165. ${BARAKUDA_ROOT}/src/bash/misc_ifs/extract_ifs_surf_fluxes.sh &
  166. pid_flxl=$! ; echo
  167. fi
  168. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  169. # Computing time-series of spatially-averaged variables
  170. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  171. if [ ${i_do_mean} -eq 1 ]; then
  172. #
  173. echo; echo "3D-averaging for time series"
  174. echo " *** CALLING: mean_3d.py ${ft1m} ${jyear} T &"
  175. mean_3d.py ${ft1m} ${jyear} T &
  176. pid_mn3dt=$! ; echo
  177. #
  178. echo " *** CALLING: mean_3d.py ${ft1m} ${jyear} S &"
  179. mean_3d.py ${ft1m} ${jyear} S &
  180. pid_mn3ds=$! ; echo
  181. #
  182. echo; echo "2D-averaging for time series"
  183. echo " *** CALLING: mean_2d.py ${ft1m} ${jyear} &"
  184. mean_2d.py ${ft1m} ${jyear} &
  185. pid_mn2d=$! ; echo
  186. #
  187. echo; echo "2D-integration of some surface fluxes over basins"
  188. echo " *** CALLING: flux_int_basins.py ${ff1m} ${jyear} &"
  189. flux_int_basins.py ${ff1m} ${jyear} &
  190. pid_ssf=$! ; echo
  191. #
  192. fi
  193. # ~~~~~~~~~~~~~~~~~~~~~~~~~~
  194. # Creating VT file if needed
  195. # ~~~~~~~~~~~~~~~~~~~~~~~~~~
  196. if [ ${i_do_trsp} -gt 0 ] || [ ${i_do_mht} -eq 1 ]; then
  197. if [ ! -f ${fvt} ]; then
  198. echo; echo; echo " *** CALLING: ./cdfvT.x ${CFG3D} ${NN_T} ${NN_S} ${NN_U} ${NN_V} ${NN_U_EIV} ${NN_V_EIV} &"
  199. ./cdfvT.x ${CFG3D} ${NN_T} ${NN_S} ${NN_U} ${NN_V} ${NN_U_EIV} ${NN_V_EIV} &
  200. pid_vtvt=$! ; echo
  201. fi
  202. fi
  203. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  204. # 2D maps of NEMO - OBS for SST and SSS (for movies)
  205. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  206. if [ ${i_do_movi} -eq 1 ]; then
  207. echo; echo; echo "2D maps of NEMO - OBS for SST and SSS (for movies)"
  208. echo " *** CALLING: prepare_movies.py ${ft1m} ${jyear} sst &"
  209. prepare_movies.py ${ft1m} ${jyear} sst &
  210. pid_movt=$! ; echo
  211. echo " *** CALLING: prepare_movies.py ${ft1m} ${jyear} sss &"
  212. prepare_movies.py ${ft1m} ${jyear} sss &
  213. pid_movs=$! ; echo
  214. echo " *** CALLING: prepare_movies.py ${ft1m} ${jyear} mld &"
  215. prepare_movies.py ${ft1m} ${jyear} mld &
  216. pid_movm=$! ; echo
  217. echo " *** CALLING: prepare_movies.py ${fj1m} ${jyear} ice &"
  218. prepare_movies.py ${fj1m} ${jyear} ice &
  219. pid_movi=$! ; echo
  220. fi
  221. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  222. # Computing time-series of spatially-averaged variables
  223. # on boxes (saving the variable on 2D box too...
  224. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  225. if [ ${i_do_ssx_box} -eq 1 ]; then
  226. echo; echo; echo "Box monthly values"
  227. echo " *** CALLING: ssx_boxes ${ft1m} ${jyear} ${NN_SST} ${NN_SSS} &"
  228. ssx_boxes.py ${ft1m} ${jyear} ${NN_SST} ${NN_SSS} &
  229. pid_boxa=$! ; echo
  230. fi
  231. #~~~~~~~
  232. # MOC
  233. #~~~~~~~
  234. if [ ${i_do_amoc} -eq 1 ]; then
  235. echo; echo; echo "MOC"
  236. rm -f moc.nc *.tmp
  237. echo " *** CALLING: ./cdfmoc.x ${fv3d} ${NN_V} ${NN_V_EIV} &"
  238. ./cdfmoc.x ${fv3d} ${NN_V} ${NN_V_EIV} &
  239. pid_amoc=$! ; echo
  240. fi
  241. #~~~~~~~~~~~~~~~~~~~~~~~~~~~
  242. # Transport by sigma-class
  243. #~~~~~~~~~~~~~~~~~~~~~~~~~~~
  244. if [ ${i_do_sigt} -eq 1 ]; then
  245. echo; echo
  246. if [ ! -f ./dens_section.dat ]; then
  247. if [ -f ${DENSITY_SECTION_FILE} ]; then
  248. echo "Copying ${DENSITY_SECTION_FILE} to here: `pwd` !"; cp ${DENSITY_SECTION_FILE} ./dens_section.dat
  249. else
  250. echo; echo "WARNING: Can't do Transport by sigma-class: ${DENSITY_SECTION_FILE} is missing!!!"
  251. fi
  252. fi
  253. echo " *** CALLING: ./cdfsigtrp.x ${ft3d} ${fu3d} ${fv3d} 24.8 28.6 19 ${jyear} ${DIAG_D} ${NN_T} ${NN_S} ${NN_U} ${NN_V} &"; echo
  254. ./cdfsigtrp.x ${ft3d} ${fu3d} ${fv3d} 24.8 28.6 19 ${jyear} ${DIAG_D} ${NN_T} ${NN_S} ${NN_U} ${NN_V} &
  255. pid_sigt=$! ; echo
  256. fi
  257. echo
  258. echo " Gonna wait for level #1 to be done !"
  259. wait ${pid_vtvt}
  260. #wait
  261. echo " .... diag level #1 done...." ; echo
  262. echo
  263. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  264. # Meridional heat and salt transport
  265. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  266. if [ ${i_do_mht} -eq 1 ]; then
  267. echo; echo; echo "Meridional transport of heat and salt"
  268. fo=${DIAG_D}/merid_transport_T_S_${CONFEXP}.nc
  269. if [ ! -f ${fvt} ]; then
  270. echo "WARNING: file ${fvt} is not here, skipping meridional transports section"
  271. else
  272. rm -f merid_heat_trp.dat merid_salt_trp.dat
  273. echo " *** CALLING: ./cdfmhst.x ${fvt} ${fo} ${jyear} &"
  274. ./cdfmhst.x ${fvt} ${fo} ${jyear} &
  275. pid_mhst=$! ; echo
  276. fi
  277. fi
  278. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  279. # VOLUME, HEAT and SALT transports through specified section
  280. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  281. if [ ${i_do_trsp} -gt 0 ]; then
  282. echo; echo; echo "Transports of volume, heat and salt through different sections"
  283. if [ -z ${TRANSPORT_SECTION_FILE} ]; then
  284. echo "Please specify which TRANSPORT_SECTION_FILE to use into the config file!" ; exit
  285. fi
  286. if [ ! -f ./transportiz.dat ]; then
  287. check_if_file ${TRANSPORT_SECTION_FILE}
  288. cp ${TRANSPORT_SECTION_FILE} ./transportiz.dat
  289. fi
  290. if [ ${i_do_trsp} -eq 1 ]; then z1_trsp="" ; z2_trsp=""; fi
  291. if [ ! -f ${fvt} ]; then
  292. echo "WARNING: file ${fvt} is not here, skipping transport section!"
  293. else
  294. # Breaking transportiz file in several files so we can go parallel!
  295. rm -f transportiz_*.dat
  296. break_downn_section_file.py ./transportiz.dat 2 ; # => Max. 2 sections per file
  297. list=`\ls transportiz_*.dat`
  298. for fs in ${list}; do
  299. echo " *** CALLING: ./cdftransportiz.x ${fs} ${CFG3D} ${NN_U} ${NN_V} ${NN_U_EIV} ${NN_V_EIV} ${jyear} ${DIAG_D} ${z1_trsp} ${z2_trsp} &"
  300. ./cdftransportiz.x ${fs} ${CFG3D} ${NN_U} ${NN_V} ${NN_U_EIV} ${NN_V_EIV} ${jyear} ${DIAG_D} ${z1_trsp} ${z2_trsp} &
  301. echo
  302. done
  303. fi
  304. fi
  305. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  306. # Solid freshwater transport through sections due to sea-ice drift
  307. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  308. if [ ${i_do_ice} -gt 0 ] && [ ${i_do_trsp_ice} -eq 1 ]; then
  309. echo; echo; echo "Solid freshwater transport through sections due to sea-ice drift"
  310. if [ -z ${TRANSPORT_SECTION_FILE_ICE} ]; then
  311. echo "Please specify which TRANSPORT_SECTION_FILE_ICE to use into the config file!" ; exit
  312. fi
  313. if [ ! -f ./transport_ice.dat ]; then
  314. check_if_file ${TRANSPORT_SECTION_FILE_ICE}
  315. cp ${TRANSPORT_SECTION_FILE_ICE} ./transport_ice.dat
  316. fi
  317. #
  318. # Breaking transportiz file in several files so we can go parallel!
  319. rm -f transport_ice_*.dat
  320. break_downn_section_file.py ./transport_ice.dat 2 ; # => Max. 2 sections per file
  321. list=`\ls transport_ice_*.dat`
  322. for fs in ${list}; do
  323. echo " *** CALLING: ./cdficeflux.x ${fs} ${fj1m} ${NN_ICEF} ${NN_ICEU} ${NN_ICEV} ${NN_ICET} ${jyear} ${DIAG_D} &"
  324. ./cdficeflux.x ${fs} ${fj1m} ${NN_ICEF} ${NN_ICEU} ${NN_ICEV} ${NN_ICET} ${jyear} ${DIAG_D} &
  325. echo
  326. done
  327. fi
  328. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  329. # Deep Mixed Volume (DMV) on a given box
  330. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  331. if [ ! -z ${i_do_dmv} ] && [ ${i_do_dmv} -gt 0 ]; then
  332. if [ -z ${FILE_DEF_BOXES} ]; then
  333. echo "Please specify a FILE_DEF_BOXES to use into the config file!" ; exit
  334. fi
  335. echo " *** CALLING: dmv.py ${ft1m} ${cyear} &"
  336. dmv.py ${ft1m} ${cyear} &
  337. pid_dmvl=$! ; echo
  338. fi
  339. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  340. # Budget and other stuffs on a given rectangular box!
  341. # It provides time-series depending only on time (not depth)
  342. # budget_rectangle_box.py
  343. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  344. if [ ${i_do_bb} -gt 0 ]; then
  345. echo; echo; echo "Budget and other stuffs on rectangular boxes!"
  346. if [ -z ${FILE_DEF_BOXES} ]; then
  347. echo "Please specify a FILE_DEF_BOXES to use into the config file!" ; exit
  348. fi
  349. echo " *** CALLING: budget_rectangle_box.py ${cyear} 100 uv &"
  350. budget_rectangle_box.py ${cyear} 100 uv &
  351. pid_bbbb=$! ; echo
  352. fi
  353. echo " Gonna wait for level #2 to be done !"
  354. wait ${pid_amoc} ; # moc needs to be done to call cdfmaxmoc.x ...
  355. echo
  356. echo " .... diag level #2 done...." ; echo ; echo
  357. #~~~~~~~~~~~
  358. # Max AMOC
  359. #~~~~~~~~~~~
  360. if [ ${i_do_amoc} -eq 1 ]; then
  361. if [ -z "${LMOCLAT}" ]; then
  362. echo "AMOC => specify latitude bands with variable LMOCLAT into the config file!!!"; exit
  363. fi
  364. for clat in ${LMOCLAT}; do
  365. cslat=`echo ${clat} | sed -e s/'-'/' '/g`
  366. echo " *** ./cdfmaxmoc.x moc.nc atl ${cslat} 500 1500 ${jyear} ${DIAG_D}"
  367. ./cdfmaxmoc.x moc.nc atl ${cslat} 500 1500 ${jyear} ${DIAG_D}
  368. done
  369. fi
  370. #~~~~~~~~~
  371. # SEA-ICE
  372. #~~~~~~~~~
  373. if [ ${i_do_ice} -eq 1 ]; then
  374. echo; echo; echo "Sea-ice extent and volume..." ; rm -f tmp_ice.nc
  375. echo "ncks -A -v ${NN_ICEF} ${fj1m} -o tmp_ice.nc"
  376. ncks -A -v ${NN_ICEF} ${fj1m} -o tmp_ice.nc
  377. ncrename -v ${NN_ICEF},ice_frac tmp_ice.nc
  378. coic=""
  379. if [ -z ${NN_ICET} ]; then
  380. coic="oic" ; # means only ice concentration available!
  381. else
  382. echo "ncks -A -v ${NN_ICET} ${fj1m} -o tmp_ice.nc"
  383. ncks -A -v ${NN_ICET} ${fj1m} -o tmp_ice.nc
  384. ncrename -v ${NN_ICET},ice_thic tmp_ice.nc
  385. fi
  386. echo " *** CALLING: ./cdficediags.x tmp_ice.nc ${jyear} ${DIAG_D} ${coic} &"
  387. ./cdficediags.x tmp_ice.nc ${jyear} ${DIAG_D} ${coic} &
  388. fi
  389. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  390. # Temperature and Salinity on cross meridional/zonal sections
  391. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  392. if [ ${i_do_sect} -eq 1 ]; then
  393. check_if_file ${TS_SECTION_FILE}
  394. lst_sec=`cat ${TS_SECTION_FILE} | grep -v -E '(^#|EOF)' | awk -F ' ' '{print $1}'`
  395. echo; echo; echo "Cross-sections on specified transects:"
  396. echo "${lst_sec}"; echo
  397. echo " *** CALLING: cross_sections.py ${ft3d} ${jyear} &"
  398. cross_sections.py ${ft3d} ${jyear} &
  399. echo
  400. fi
  401. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  402. # Vertical profiles of T,S and density horizontally averaged
  403. # on rectangular boxes defined into FILE_DEF_BOXES
  404. # => creates time-series function of time and depth
  405. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  406. if [ ${i_do_box_TS_z} -gt 0 ]; then
  407. if [ -z ${FILE_DEF_BOXES} ]; then
  408. echo "Please specify a FILE_DEF_BOXES to use into the config file!" ; exit
  409. fi
  410. echo " *** CALLING: prof_TS_z_box.py ${cyear} &"
  411. prof_TS_z_box.py ${cyear} &
  412. echo;echo
  413. fi
  414. # --- end of stuffs that can be launched in bg ---
  415. echo
  416. echo " Waiting for backround jobs for current year (${jyear}) !"
  417. wait ${pid_mn3dt} ${pid_mn3ds} ${pid_movt} ${pid_movs} ${pid_movm} ${pid_movi} ${pid_mn2d} ${pid_ssf} ${pid_flxl}
  418. wait
  419. echo " Done waiting for year ${cyear} !"
  420. if [ ${i_do_movi} -eq 1 ]; then rsync -rv movies ${DIAG_D}/ ; fi
  421. rm -f *.tmp broken_line_* tmp_ice.nc
  422. rm -f ${CRT1M}_*.nc ${CRT1Y}_*.nc ; #debug
  423. echo
  424. echo " ---- DIAGS ARE DONE FOR YEAR ${cyear} ! ---"
  425. echo "${cyear}" > ${fcompletion}
  426. echo; echo
  427. fi ; # if ${lcontinue}; then
  428. #if ${LFORCE_YEND}; then
  429. # if [ ${jyear} -eq ${YEARN} ]; then lcontinue=false; fi
  430. #fi
  431. wait
  432. ((jyear++))
  433. # end loop years...
  434. done ; # while ${lcontinue}; do
  435. # PREPARING HTML PAGE
  436. # ~~~~~~~~~~~~~~~~~~~
  437. l_pclim=false
  438. if [ ${ISTAGE} -eq 2 ]; then
  439. rm -rf ${DIAG_D}/${EXP}
  440. y1=`cat ${DIAG_D}/first_year.info`
  441. y2=`cat ${DIAG_D}/last_year_done.info`
  442. nby=$((${y2}-${y1}+1))
  443. # Agreement between last year from output files and 'fcompletion' file:
  444. ydum=`cat ${fcompletion}`
  445. if [ -z ${YEARN} ]; then
  446. # (if YEARN is not set...)
  447. if [ ! ${ydum} -eq ${YEAR_END} ]; then
  448. echo;
  449. echo "###################################################################"
  450. echo "ERROR: in ${fcompletion} last_year = ${ydum}"
  451. echo " and from stored files files last_year = ${YEAR_END} !"
  452. echo "###################################################################"
  453. echo
  454. exit
  455. fi
  456. fi
  457. echo; echo; echo "EXP ${EXP}: creating plots"; echo
  458. #cd ${BARAKUDA_ROOT}/
  459. cd ${DIAG_D}/
  460. echo
  461. if [ ${i_do_movi} -eq 1 ]; then
  462. if [ "${iffmpeg_x264}" = "1" ]; then
  463. # FFMPEG compiled with x264 mp4 support is available on host:
  464. cd movies/
  465. for cc in dsst dsss mld icen ices; do
  466. hh=520 ; # height of image in pixels
  467. if [ "${cc}" = "icen" ]; then hh=576; fi
  468. if [ "${cc}" = "ices" ]; then hh=456; fi
  469. echo " *** CALLING: images2mp4.sh ${cc} ${FIG_FORM} ${hh} 8 &"
  470. images2mp4.sh ${cc} ${FIG_FORM} ${hh} 8 &
  471. echo
  472. done
  473. cd ${DIAG_D}/
  474. else
  475. # Faling back on GIF, with 'convert' of imageMagick:
  476. idelay=$((120-${nby}*8))
  477. if [ ${idelay} -lt 10 ]; then idelay=10; fi
  478. rm -f *_${CONFEXP}.gif
  479. for cc in dsst dsss mld icen ices; do
  480. echo " *** CALLING: convert -delay ${idelay} -loop 0 movies/${cc}_*.png ${cc}_${CONFEXP}.gif &"
  481. convert -delay ${idelay} -loop 0 movies/${cc}_*.png ${cc}_${CONFEXP}.gif &
  482. echo
  483. done
  484. fi
  485. fi
  486. # 1D plots to perform
  487. # ~~~~~~~~~~~~~~~~~~~
  488. DIAG_1D_LIST=""
  489. if [ ${i_do_mean} -eq 1 ]; then
  490. DIAG_1D_LIST="${DIAG_1D_LIST} 3d_so mean_sos 3d_thetao mean_tos mean_zos"
  491. if [ ! "${NN_MLD}" = "X" ]; then DIAG_1D_LIST="${DIAG_1D_LIST} mean_mld"; fi
  492. if [ ! "${NN_QNET}" = "X" ]; then DIAG_1D_LIST="${DIAG_1D_LIST} mean_htf"; fi
  493. if [ ! "${NN_FWF}" = "X" ]; then DIAG_1D_LIST="${DIAG_1D_LIST} mean_fwf"; fi
  494. fi
  495. if [ ${i_do_amoc} -eq 1 ]; then DIAG_1D_LIST="${DIAG_1D_LIST} amoc"; fi
  496. if [ ${i_do_ice} -eq 1 ]; then DIAG_1D_LIST="${DIAG_1D_LIST} seaice"; fi
  497. if [ ${i_do_trsp} -gt 0 ] || [ ${i_do_trsp_ice} -eq 1 ]; then DIAG_1D_LIST="${DIAG_1D_LIST} transport_sections" ; fi
  498. dy=$((${YEAR_END}-${YEAR_INI}+1)) ; export YF2=$((${YEAR_END}+1))
  499. # Doing 1D plots
  500. # ~~~~~~~~~~~~~~
  501. echo ; echo; echo "Going to perform the following 1D plots:"
  502. echo " => ${DIAG_1D_LIST}"; echo
  503. for fd in ${DIAG_1D_LIST}; do
  504. echo " *** CALLING: plot_time_series.py ${fd}"
  505. plot_time_series.py ${fd} ; echo
  506. echo
  507. done
  508. echo ; echo ; echo
  509. if [ ${i_do_mean} -eq 1 ]; then
  510. # 5-month-running mean SST anomaly over Nino region 3.4 graph:
  511. echo " *** CALLING: plot_enso.py Nino34_${CONFEXP}.nc ${NN_SST}"
  512. plot_enso.py Nino34_${CONFEXP}.nc ${NN_SST}
  513. echo; echo
  514. # Hovmuller of temperature and salinity
  515. echo " *** CALLING: plot_hovm_tz.py"
  516. plot_hovm_tz.py
  517. echo; echo
  518. if [ ${nby} -ge 70 ]; then
  519. # AMO aka 11-year-running mean SST anomaly over North Atlantic (0-70N)
  520. echo " *** CALLING: plot_amo.py mean_SST_NAtl_${CONFEXP}.nc ${NN_SST}"
  521. plot_amo.py mean_SST_NAtl_${CONFEXP}.nc ${NN_SST}
  522. echo; echo
  523. fi
  524. fi
  525. if [ ${i_do_sigt} -eq 1 ]; then
  526. # Transport by sigma-class
  527. echo " *** CALLING: plot_trsp_sigma.py"
  528. plot_trsp_sigma.py
  529. echo; echo; echo
  530. fi
  531. if [ ${i_do_mht} -eq 1 ]; then
  532. #
  533. # Hovmullers of advective meridional heat/salt transport
  534. echo; echo
  535. echo " *** CALLING: plot_hovm_merid_trsp.py"
  536. plot_hovm_merid_trsp.py
  537. echo; echo; echo
  538. #
  539. fi
  540. echo; echo; echo
  541. if ${l_clim_diag} ; then
  542. ###########################################################################
  543. # Climatology over X years (12-month file average of X consecutive years)
  544. # => has to be built with the 'build_clim.sh' script
  545. ###########################################################################
  546. echo; echo; echo "Checking for presence of ${DIAG_D}/clim/last_clim..."
  547. if [ -f ${DIAG_D}/clim/last_clim ]; then
  548. cat ${DIAG_D}/clim/last_clim
  549. export CLIM_PER=`cat ${DIAG_D}/clim/last_clim`
  550. ftcli=${DIAG_D}/clim/mclim_${CONFEXP}_${CLIM_PER}_grid_T.nc4
  551. ficli=${DIAG_D}/clim/mclim_${CONFEXP}_${CLIM_PER}_${FILE_ICE_SUFFIX}.nc4
  552. fcsbc=${DIAG_D}/clim/mclim_${CONFEXP}_${CLIM_PER}_${FILE_FLX_SUFFIX}.nc4
  553. fclvt=${DIAG_D}/clim/aclim_${CONFEXP}_${CLIM_PER}_VT.nc4
  554. fcmoc=${DIAG_D}/clim/aclim_${CONFEXP}_${CLIM_PER}_MOC.nc4
  555. fcpsi=${DIAG_D}/clim/aclim_${CONFEXP}_${CLIM_PER}_PSI.nc4
  556. fccrl=${DIAG_D}/clim/aclim_${CONFEXP}_${CLIM_PER}_TCURL.nc4
  557. iclyear=`echo ${CLIM_PER} | sed -e s/'-'/' '/g`
  558. else
  559. echo; echo "ERROR => you set l_clim_diag to true (probably by using '-E') but no file 'last_clim' was found in:"
  560. echo " ${DIAG_D}/clim/"
  561. echo " => then use '-e' instead!"; echo
  562. exit
  563. fi
  564. echo; echo; echo "Checking for presence of ${ftcli}..."
  565. if [ -f ${ftcli} ]; then
  566. echo; echo;
  567. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  568. echo "* Climatologies found !!!"
  569. echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  570. echo
  571. echo " => for years ${CLIM_PER}" ; echo " => using ${ftcli}"
  572. list_comp_2d="OBS"
  573. l_pclim=true
  574. lcomp_to_exp=false
  575. if [ ! -z ${EXPREF} ]; then
  576. lcomp_to_exp=true
  577. list_comp_2d="OBS ${EXPREF}"
  578. # Must check if climatology for exp ${EXPREF} is there:
  579. fclim_ref=`echo "${ftcli}" | sed -e "s|${EXP}|${EXPREF}|g"`
  580. check_if_file ${fclim_ref}
  581. echo "Going to compare also against exp ${fclim_ref}!"
  582. echo
  583. fi
  584. echo; echo
  585. for ff in ${F_T_OBS_3D_12} ${F_S_OBS_3D_12} ${F_SST_OBS_12}; do check_if_file ${ff} "name:${ff}"; done
  586. if [ ${i_do_ice} -gt 0 ]; then check_if_file ${F_ICE_OBS_12} "name:${F_ICE_OBS_12}" ; fi
  587. echo; echo
  588. #######################################
  589. # Diags that don't imply a comparison #
  590. #######################################
  591. export COMP2D="OBS"
  592. # Lat-Depth AMOC
  593. # ~~~~~~~~~~~~~~
  594. if [ -f ${fcmoc} ]; then
  595. echo; echo
  596. echo " Ploting lat-depth MOC !"
  597. cd ${DIAG_D}/
  598. export DIRS_2_EXP="${DIRS_2_EXP} moc"
  599. rm -rf moc; mkdir moc; cd moc/
  600. echo; echo; echo " *** CALLING: moc.py ${iclyear}"
  601. moc.py ${iclyear} &
  602. cd ../
  603. echo
  604. fi
  605. # March Mixed layer depth in Nordic Seas
  606. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  607. if [ `ipresent_var_in_ncf ${ftcli} ${NN_MLD}` -eq 1 ]; then
  608. echo; echo
  609. echo " Performing 2D mapping of March Mixed layer depth in Nordic Seas"
  610. cd ${DIAG_D}/
  611. export DIRS_2_EXP="${DIRS_2_EXP} mld"
  612. rm -rf mld; mkdir mld; cd mld/
  613. echo; echo; echo " *** CALLING: mld.py ${iclyear}"; echo
  614. mld.py ${iclyear} &
  615. cd ../
  616. echo
  617. fi
  618. # Sea-ice extent stereographic polar projection South and North
  619. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  620. if [ ${i_do_ice} -gt 0 ] && [ `ipresent_var_in_ncf ${ficli} ${NN_ICEF}` -eq 1 ]; then
  621. echo; echo
  622. echo " Performing 2D Sea-ice extent stereographic polar projection South and North"
  623. cd ${DIAG_D}/
  624. export DIRS_2_EXP="${DIRS_2_EXP} sea_ice"
  625. rm -rf sea_ice; mkdir sea_ice; cd sea_ice/
  626. echo; echo; echo " *** CALLING: ice.py ${iclyear}"; echo
  627. ice.py ${iclyear} &
  628. cd ../
  629. echo
  630. fi
  631. # Sea-surface height
  632. # ~~~~~~~~~~~~~~~~~~
  633. if [ `ipresent_var_in_ncf ${ftcli} ${NN_SSH}` -eq 1 ]; then
  634. echo; echo; echo " SSH map"
  635. export DIRS_2_EXP="${DIRS_2_EXP} ssh"
  636. cd ${DIAG_D}/
  637. rm -rf ssh; mkdir ssh; cd ssh/
  638. echo " *** CALLING: ssh.py ${iclyear}"; echo
  639. ssh.py ${iclyear} &
  640. cd ../ ; echo
  641. else
  642. echo; echo "WARNING: did not find ${NN_SSH} into ${ftcli} !!!!"; echo
  643. fi
  644. # Wind-stress module and curl
  645. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  646. if [ -f ${fccrl} ]; then
  647. echo; echo; echo " Wind-stress module and curl maps"
  648. if [ -x ${NN_TAUM} ]; then echo "ERROR: define variable NN_TAUM in ${fconfig}! ('X' if not present in NEMO output)"; exit; fi
  649. export DIRS_2_EXP="${DIRS_2_EXP} wind"
  650. cd ${DIAG_D}/
  651. rm -rf wind; mkdir wind; cd wind/
  652. echo " *** CALLING: wind.py ${iclyear}"; echo
  653. wind.py ${iclyear} &
  654. cd ../ ; echo
  655. else
  656. echo
  657. echo "WARNING: did not find file ${fccrl} !!!"
  658. echo " or did not find ${NN_TAUM} into ${fcsbc} !!!!"
  659. echo
  660. fi
  661. # Zonally-averaged surface heat fluxes
  662. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lolo
  663. if [ -f ${fcsbc} ]; then
  664. echo; echo; echo " Zonally-averaged surface heat fluxes"
  665. if [ -x ${NN_QSOL} ]; then echo "ERROR: define variable NN_QSOL in ${fconfig}! ('X' if not present in NEMO output)"; exit; fi
  666. export DIRS_2_EXP="${DIRS_2_EXP} sfluxes"
  667. cd ${DIAG_D}/
  668. rm -rf sfluxes; mkdir sfluxes; cd sfluxes/
  669. echo " *** CALLING: sfluxes.py ${iclyear}"; echo
  670. sfluxes.py ${iclyear} &
  671. cd ../ ; echo
  672. else
  673. echo
  674. echo "WARNING: did not find file ${fcsbc} !!!"
  675. echo " or did not find ${NN_QSOL} into ${fcsbc} !!!!"
  676. echo
  677. fi
  678. ##################################################
  679. # Diags that imply a comparison against "COMP2D" #
  680. ##################################################
  681. cd ${DIAG_D}/
  682. rm -rf temp_sal
  683. for COMP2D in ${list_comp_2d}; do
  684. export COMP2D=${COMP2D}
  685. echo; echo; echo "Clim. comparisons against ${COMP2D}"
  686. if [ "${COMP2D}" = "${EXPREF}" ]; then
  687. export F_T_OBS_3D_12=${fclim_ref}; check_if_file ${F_T_OBS_3D_12} "name:F_T_OBS_3D_12"
  688. export F_S_OBS_3D_12=${fclim_ref}; check_if_file ${F_S_OBS_3D_12} "name:F_S_OBS_3D_12"
  689. export F_SST_OBS_12=${fclim_ref} ; check_if_file ${F_SST_OBS_12} "name:F_SST_OBS_12"
  690. if [ ${i_do_ice} -gt 0 ]; then export F_ICE_OBS_12=${fclim_ref} ; check_if_file ${F_ICE_OBS_12} "name:F_ICE_OBS_12"; fi
  691. fi
  692. # Temperature and Salinity
  693. # ~~~~~~~~~~~~~~~~~~~~~~~~
  694. echo; echo
  695. echo " Creating maps and cross-sections (i_do_sect) of Temperature and Salinity"
  696. cd ${DIAG_D}/
  697. export DIRS_2_EXP="${DIRS_2_EXP} temp_sal"
  698. DIRS_2_EXP_RREF="${DIRS_2_EXP_RREF} temp_sal"
  699. mkdir -p temp_sal; cd temp_sal/
  700. echo; echo; echo " *** CALLING: temp_sal.py ${iclyear} &"; echo
  701. temp_sal.py ${iclyear} &
  702. cd ../
  703. echo
  704. done ; # for COMP2D in ${list_comp_2d}; do
  705. wait
  706. else
  707. echo; echo
  708. echo " No Climatologies found ...";
  709. echo " => you can use 'build_clim.sh' to build a climato of your experiment"
  710. echo; echo
  711. fi
  712. fi ; # if ${l_clim_diag}
  713. wait
  714. # Time for HTML stuff!
  715. export HTML_DIR=${DIAG_D}/${EXP}
  716. mkdir -p ${HTML_DIR}
  717. cd ${DIAG_D}/
  718. # Moving all figures to HTML_DIR:
  719. for fp in ${FIG_FORM} svg mp4 gif; do mv -f *.${fp} ${HTML_DIR}/ >/dev/null 2>/dev/null ; done
  720. mv -f ./merid_transport/*.${FIG_FORM} ${HTML_DIR}/ >/dev/null 2>/dev/null
  721. mv -f ${DIAG_D}/movies/movie_*.mp4 ${HTML_DIR}/ >/dev/null 2>/dev/null
  722. # Sign with logo?
  723. #cd ${HTML_DIR}/
  724. #list=`\ls *.png`
  725. #for ff in ${list}; do
  726. # sign_image ${ff} n_${ff}
  727. # mv -f n_${ff} ${ff}
  728. #done
  729. cd ${DIAG_D}/
  730. . ${BARAKUDA_ROOT}/src/bash/build_html.bash
  731. wait
  732. # Building main index.html
  733. build_index_html
  734. # If climatology built, sub 2D html pages
  735. if ${l_pclim}; then
  736. build_sub_html
  737. fi
  738. #==================================================================
  739. wait ; # likely waiting for the creation of the GIFs....
  740. echo; echo
  741. cp ${BARAKUDA_ROOT}/src/html/conf_*.html ${HTML_DIR}/
  742. if [ ${ece_exp} -eq 0 ]; then
  743. cp -L ${BARAKUDA_ROOT}/src/html/logo.*g ${HTML_DIR}/
  744. else
  745. cp -L ${BARAKUDA_ROOT}/src/html/logo_ece.svg ${HTML_DIR}/logo.svg
  746. cp -L ${BARAKUDA_ROOT}/src/html/logo_ece.png ${HTML_DIR}/logo.png
  747. fi
  748. mv -f index.html namelist*.html ${HTML_DIR}/
  749. cp -r ${DIRS_2_EXP} ${HTML_DIR}/ >/dev/null 2>/dev/null
  750. echo; echo; echo
  751. if [ ${ihttp} -eq 1 ]; then
  752. echo "Preparing to export to remote host!"; echo
  753. send_dir=`basename ${HTML_DIR}`
  754. tar cvf ${send_dir}.tar ${send_dir}
  755. ssh ${RUSER}@${RHOST} "mkdir -p ${RWWWD}"
  756. scp ${send_dir}.tar ${RUSER}@${RHOST}:${RWWWD}/
  757. ssh ${RUSER}@${RHOST} "cd ${RWWWD}/; rm -rf ${send_dir}; tar xf ${send_dir}.tar 2>/dev/null; rm -f ${send_dir}.tar; \
  758. chmod -R a+r ${send_dir}; cd ${send_dir}/"
  759. echo; echo
  760. echo "Diagnostic page installed on http://${RHOST}${RWWWD}/${send_dir}/ !"
  761. echo "( Also browsable on local host in ${DIAG_D}/${send_dir} )"
  762. rm -f ${send_dir}.tar
  763. else
  764. if [ ${ihttp} -eq 0 ]; then
  765. echo "Diagnostic page installed in ${HTML_DIR}/"
  766. echo " => you can view it with a web browser..."
  767. else
  768. echo "Error: \"ihttp\" must be either 0 or 1 !"
  769. fi
  770. fi
  771. echo; echo
  772. rm -rf *.eps
  773. else
  774. echo
  775. echo "Diagnostics built and saved! (${DIAG_D})"
  776. echo "Re-Run \"${script}.sh\" adding the \"-e\" or \"-E\" switch to create figure and HTML page..."
  777. echo
  778. fi
  779. #rm -rf ${TMP_DIR} 2>/dev/null ; #debug
  780. echo