Changeset 50 for trunk/src/project_profile.sh
- Timestamp:
- 04/29/11 11:09:12 (13 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/project_profile.sh
r47 r50 1 #! /bin/sh -x1 #! /bin/sh 2 2 #+ 3 3 # 4 # .. program:: tropflux_profile.sh5 # 6 # .. _ tropflux_profile.sh:4 # .. program:: project_profile.sh 5 # 6 # .. _project_profile.sh: 7 7 # 8 8 # ================================================== 9 # tropflux_profile.sh -- define TROPFLUXenvironment9 # project_profile.sh -- define PROJECT environment 10 10 # ================================================== 11 11 # … … 15 15 # Online usage:: 16 16 # 17 # $ . ./ tropflux_profile.sh -d directory -i indir -o outdir -t tempdir -s saxo_dir17 # $ . ./project_profile.sh -d directory -i indir -o outdir -t tempdir -s saxo_dir 18 18 # 19 19 # In ${HOME}/.profile, add the following line:: 20 20 # 21 # . tropflux_profile.sh -d directory -i indir -o outdir -t tempdir -s saxo_dir21 # . project_profile.sh -d directory -i indir -o outdir -t tempdir -s saxo_dir 22 22 # 23 23 # DESCRIPTION … … 30 30 # .. option:: -s <saxo_dir> 31 31 # 32 # define TROPFLUXenvironment33 # 34 # ${ TROPFLUX} is the base directory of tools.35 # 36 # ${ TROPFLUX_LOG} is the directory where log files will be written.37 # 38 # ${ TROPFLUX_ID} is the directory where input files must be.39 # 40 # ${ TROPFLUX_OD} is the directory where output files will be written.32 # define PROJECT environment 33 # 34 # ${PROJECT} is the base directory of tools. 35 # 36 # ${PROJECT_LOG} is the directory where log files will be written. 37 # 38 # ${PROJECT_ID} is the directory where input files must be. 39 # 40 # ${PROJECT_OD} is the directory where output files will be written. 41 41 # 42 42 # ${SAXO_DIR} is the base directory of SAXO tools 43 43 # 44 # PATH is completed with ${TROPFLUX}. 44 # IDL_STARTUP is set to tell IDL where find tools. 45 # 46 # PATH is completed with ${PROJECT}. 45 47 # 46 48 # SEE ALSO 47 49 # ======== 48 50 # 49 # :ref:`tropflux_init.pro` 50 # 51 # :ref:`cm_tropflux.pro` 51 # for IDL/gdl and SAXO environment : 52 # 53 # :ref:`project_init.pro` 54 # :ref:`cm_project.pro` 52 55 # 53 56 # EXAMPLES … … 57 60 # 58 61 # $ cd /usr/home/fplod/incas/tropflux/tropflux_ws/ 59 # $ . ./src/ tropflux_profile.sh \62 # $ . ./src/project_profile.sh \ 60 63 # -d $(pwd) \ 61 64 # -i /usr/temp/${LOGNAME}/tropflux_d/ \ … … 67 70 # 68 71 # $ cd ${HOME}/incas/tropflux/tropflux_ws/ 69 # $ . ./src/ tropflux_profile.sh \72 # $ . ./src/project_profile.sh \ 70 73 # -d $(pwd) \ 71 74 # -i /usr/temp/${LOGNAME}/tropflux_d/ \ … … 77 80 # 78 81 # $ cd ${HOME}/tropflux/ 79 # $ . ./src/ tropflux_profile.sh \82 # $ . ./src/project_profile.sh \ 80 83 # -d $(pwd) \ 81 84 # -i /homedata/${LOGNAME}/tropflux_d/ \ … … 97 100 # EVOLUTIONS 98 101 # ========== 102 # 103 # - fplod 20110429T090524Z aedon.locean-ipsl.upmc.fr (Darwin) 104 # 105 # * set IDL_STARTUP 99 106 # 100 107 # - fplod 20110413T151541Z cratos.locean-ipsl.upmc.fr (Linux) … … 121 128 # 122 129 # as this script might be launch in .profile, command is forced. 123 command= tropflux_profile.sh130 command=project_profile.sh 124 131 # 125 132 usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir -s saxo_dir" … … 180 187 fi 181 188 # 182 TROPFLUX=${directory}183 export TROPFLUX189 PROJECT=${directory} 190 export PROJECT 184 191 unset drectory 185 192 # 186 # add TROPFLUXtools to PATH193 # add PROJECT tools to PATH 187 194 # if not already done 188 suppath=$(echo ${ TROPFLUX}/src | tr -s "/")195 suppath=$(echo ${PROJECT}/src | tr -s "/") 189 196 echo ${PATH} | grep -q "${suppath}:" 190 197 test_path=${?} … … 199 206 unset test_path 200 207 # 201 # add TROPFLUXmanuals to MANPATH208 # add PROJECT manuals to MANPATH 202 209 # if not already done 203 suppath=$(echo ${ TROPFLUX}/doc/man | tr -s "/")210 suppath=$(echo ${PROJECT}/doc/man | tr -s "/") 204 211 echo ${MANPATH} | grep -q "${suppath}:" 205 212 test_manpath=${?} … … 215 222 unset suppath 216 223 # 217 TROPFLUX_LOG=${tempdir}218 export TROPFLUX_LOG224 PROJECT_LOG=${tempdir} 225 export PROJECT_LOG 219 226 unset tempdir 220 if [ ! -d ${ TROPFLUX_LOG} ]221 then 222 mkdir -p ${ TROPFLUX_LOG}227 if [ ! -d ${PROJECT_LOG} ] 228 then 229 mkdir -p ${PROJECT_LOG} 223 230 status=${?} 224 231 if [ ${status} -ne 0 ] 225 232 then 226 echo "${command} : eee : can not create \${ TROPFLUX_LOG}"233 echo "${command} : eee : can not create \${PROJECT_LOG}" 227 234 # nb : no exit because this file should be launched by login process 228 235 else 229 echo "${command} : iii : creation of \${ TROPFLUX_LOG}"236 echo "${command} : iii : creation of \${PROJECT_LOG}" 230 237 fi 231 238 unset status 232 239 fi 233 # check for permission on TROPFLUX_LOG234 if [ ! -x ${ TROPFLUX_LOG} ]235 then 236 echo " eee : ${ TROPFLUX_LOG} not reachable"237 # nb : no exit because this file should be launched by login process 238 fi 239 # 240 # check for permission on TROPFLUX_LOG241 if [ ! -w ${ TROPFLUX_LOG} ]242 then 243 echo " eee : ${ TROPFLUX_LOG} not writable"240 # check for permission on PROJECT_LOG 241 if [ ! -x ${PROJECT_LOG} ] 242 then 243 echo " eee : ${PROJECT_LOG} not reachable" 244 # nb : no exit because this file should be launched by login process 245 fi 246 # 247 # check for permission on PROJECT_LOG 248 if [ ! -w ${PROJECT_LOG} ] 249 then 250 echo " eee : ${PROJECT_LOG} not writable" 244 251 # nb : no exit because this file shouldreachable be launched by login process 245 252 fi … … 249 256 # 250 257 # io directories 251 TROPFLUX_ID=${indir}252 export TROPFLUX_ID258 PROJECT_ID=${indir} 259 export PROJECT_ID 253 260 unset indir 254 if [ ! -d ${ TROPFLUX_ID} ]255 then 256 mkdir -p ${ TROPFLUX_ID}257 echo "${command} : iii : creation of \${ TROPFLUX_ID}"258 fi 259 # check for permission on TROPFLUX_ID260 if [ ! -x ${ TROPFLUX_ID} ]261 then 262 echo " eee : ${ TROPFLUX_ID} not reachable"263 # nb : no exit because this file should be launched by login process 264 fi 265 # 266 TROPFLUX_OD=${outdir}267 export TROPFLUX_OD261 if [ ! -d ${PROJECT_ID} ] 262 then 263 mkdir -p ${PROJECT_ID} 264 echo "${command} : iii : creation of \${PROJECT_ID}" 265 fi 266 # check for permission on PROJECT_ID 267 if [ ! -x ${PROJECT_ID} ] 268 then 269 echo " eee : ${PROJECT_ID} not reachable" 270 # nb : no exit because this file should be launched by login process 271 fi 272 # 273 PROJECT_OD=${outdir} 274 export PROJECT_OD 268 275 unset outdir 269 if [ ! -d ${ TROPFLUX_OD} ]270 then 271 mkdir -p ${ TROPFLUX_OD}272 echo "${command} : iii : creation of \${ TROPFLUX_OD}"273 fi 274 # check for permission on TROPFLUX_OD275 if [ ! -x ${ TROPFLUX_OD} ]276 then 277 echo " eee : ${ TROPFLUX_OD} not reachable"278 # nb : no exit because this file should be launched by login process 279 fi 280 if [ ! -w ${ TROPFLUX_OD} ]281 then 282 echo " eee : ${ TROPFLUX_OD} not writable"276 if [ ! -d ${PROJECT_OD} ] 277 then 278 mkdir -p ${PROJECT_OD} 279 echo "${command} : iii : creation of \${PROJECT_OD}" 280 fi 281 # check for permission on PROJECT_OD 282 if [ ! -x ${PROJECT_OD} ] 283 then 284 echo " eee : ${PROJECT_OD} not reachable" 285 # nb : no exit because this file should be launched by login process 286 fi 287 if [ ! -w ${PROJECT_OD} ] 288 then 289 echo " eee : ${PROJECT_OD} not writable" 283 290 # nb : no exit because this file should be launched by login process 284 291 fi … … 288 295 unset saxo_dir 289 296 # 297 # IDL startup 298 IDL_STARTUP=${PROJECT}/src/project_init.pro 299 export IDL_STARTUP 300 # 290 301 # end 291 302 unset command
Note: See TracChangeset
for help on using the changeset viewer.