#! /bin/sh #+ # # .. _refdataget.sh: # # ============= # refdataget.sh # ============= # # ---------------------- # get all reference data # ---------------------- # # SYNOPSIS # ======== # # ``refdataget.sh`` # # DESCRIPTION # =========== # # Put in ${IRCAAM_ID} all the reference data files # # This includes : # # - ARPEGE data # 4 parameters (rlut_d zg_d pr_d) in 5 simulations experiences # (CtIV CtCl AfNQIVIV AsNQIVIV TrNQIVIV) between 1971 and 2000. # # You will need password from authorized people to access to ARPEGE # simulation files. # # - OLR observation between 1974 and now. # # If one of these files already exists (same name), it won't be download again # to avoid big transfert. # # It might be usefull to check revision of original data ... # # EXAMPLES # ======== # # If you are working on LOCEAN machine and you don't have any reference data, # you just have to run this tool :: # # $ refdataget.sh # # And look at log file with :: # # $ tlogd.sh refdataget # # and of course on files in ${IRCAAM_ID}. # # CAUTIONS # ======== # # how to know if there is enough place before ? # # SEE ALSO # ======== # # :ref:`ircaam_profile.sh` # # TODO # ==== # # ++ les fichiers de benjamin # # ++ la carte du monde # # ++ pb avec la saisie du mot de passe # # ++ et si je travaille sur une machine climserv ? # # ++ ajouter des options par dataset # # ++ unset # # EVOLUTIONS # ========== # # $Id$ # # - fplod 2009-01-08T10:40:55Z aedon.locean-ipsl.upmc.fr (Darwin) # # * creation from varamma_ws/src/paper01_pre.sh # #- system=$(uname) case "${system}" in AIX|IRIX64) echo " www : no specific posix checking" ;; *) set -o posix ;; esac unset system # LANG=POSIX # command=$(basename ${0}) log_date=$(date -u +"%Y%m%dT%H%M%SZ") # usage=" Usage : ${command}" # hostname=$(hostname) # set -u # # check for ${IRCAAM_LOG} definition if [ "${IRCAAM_LOG}" = "" ] then echo " eee : \${IRCAAM_LOG} not defined" exit 1 fi # # check for ${IRCAAM_LOG} existence if [ ! -d ${IRCAAM_LOG} ] then echo " eee : ${IRCAAM_LOG} not found" exit 1 fi # # check for permission access on IRCAAM_LOG if [ ! -x ${IRCAAM_LOG} ] then echo " eee : ${IRCAAM_LOG} not reachable" exit 1 fi # # check for write permission on IRCAAM_LOG if [ ! -w ${IRCAAM_LOG} ] then echo " eee : ${IRCAAM_LOG} not writable" exit 1 fi # log=${IRCAAM_LOG}/$(basename ${0} .sh).log.${log_date} echo "[Context]" 1>> ${log} echo "command=${command}" 1>> ${log} echo "hostname=${hostname}" 1>> ${log} echo "runtime=${log_date}" 1>> ${log} # # check for write permission on IRCAAM_ID if [ ! -w ${IRCAAM_ID} ] then echo " eee : ${IRCAAM_ID} not writable" exit 1 fi # ARPEGE list_param="rlut_d zg_d pr_d" list_simu="CtIV CtCl AfNQIVIV AsNQIVIV TrNQIVIV" year_min=1971 year_max=2000 dirrefb="http://www.cnrm.meteo.fr/dods-ensembles/Datasets/IRCAAM/" # read -s -p "enter ircaam-dods password : " dods_passwd # for simu in ${list_simu} do case ${simu} in CtIV|CtCl|AfNQIVIV) dirref="${dirrefb}/Sim/" ;; AsNQIVIV) dirref="${dirrefb}/Sim_As/" ;; TrNQIVIV) dirref="${dirrefb}/Sim_Tr/" ;; *) echo "eee : wrong \${simu}" exit 1 ;; esac dirref="${dirref}/${simu}/" for param in ${list_param} do year_i=${year_min} while [ ${year_i} -le ${year_max} ] do year_c=$(printf "%4.4d" ${year_i}') fileref=${param}.${simu}.${year_c}06-09.nc if [ -f ${IRCAAM_ID}/${fileref} ] then echo "iii : ${IRCAAM_ID}/${fileref} exist" ${log} 2>&1 echo "iii : nothing done" >> ${log} 2>&1 else wget --no-verbose --user=ircaam-dods --password=${dods_passwd} \ -P ${IRCAAM_ID} \ ${dirref}/${fileref} >> ${log} 2>&1 # ++ ok ? # ++ si climserv faire ln -s ${dirref}/${fileref} ${IRCAAM_ID}/ fi year_i=$(( ${year_i} + 1 )) done unset year_i done unset param done # OLR fileref=olr.day.mean.nc dirref=ftp://ftp.climserv.ipsl.polytechnique.fr/noaa-olr/ if [ -f ${IRCAAM_ID}/${fileref} ] then echo "iii : ${IRCAAM_ID}/${fileref} exist" >> ${log} 2>&1 echo "iii : nothing done" >> ${log} 2>&1 else wget --no-verbose -P ${IRCAAM_ID} ${dirref}/${fileref} >> ${log} # ++ ok ? fi unset fileref unset dirref # # end set exit 0