Changeset 35


Ignore:
Timestamp:
11/26/07 16:20:37 (16 years ago)
Author:
pinsard
Message:

work in progress

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/detectbarotropicmode.sh

    r34 r35  
    1 #!/bin/sh -x 
     1#!/bin/sh 
    22# 
    33# module : 
    4 # build file for detection of barotrope mode 
    5 # 
    6 # usage : 
    7 # $ detectbarotropemode.sh -l list 
     4# build file for detection of barotropic mode 
    85# 
    96# example : 
    10 # $ detectbarotropemode.sh -l ${GEOMAG_OD}/list_G42 
     7# $ detectbarotropicmode.sh -l ${GEOMAG_OD}/list_G42 -r ORCA025 -exp G42 -g gridT \ 
     8# -latmin -50 -latmax -30 -longmin 295 -longmax 335 
    119# 
    1210# update : 
     
    2018# fplod 2007-11-23T17:02:56Z aedon.locean-ipsl.upmc.fr (Darwin) 
    2119# creation 
    22 #  
    23 command=detectbarotopemode.sh 
    2420# 
    25 # ++ simulation parametres 
    26 yearmin=8 
    27 yearmax=10 
    28 latmin=-50 
    29 latmax=-30 
    30 longmin=295 
    31 longmax=335 
    32 grid=gridT 
    33 orcares=ORCA025 
    34 DRAKKAR_EXP=G42 
     21command=detectbarotropicmode.sh 
    3522# 
    36 usage=" Usage : ${command} -f list" 
     23usage=" Usage : ${command} -l list -r orcares -exp drakkar_exp -g grid -latmin latmin -latmax latmax -longmin longmin -longmax longmax" 
    3724# 
    3825while [ ! -z "${1}" ] # ++ pb bash 
     
    4330    shift 
    4431 ;; 
    45  
     32 -r) 
     33    orcares=${2} 
     34    shift 
     35 ;; 
     36 -exp) 
     37    drakkar_exp=${2} 
     38    shift 
     39 ;; 
     40 -g) 
     41    grid=${2} 
     42    shift 
     43 ;; 
     44 -latmin) 
     45    latmin=${2} 
     46    shift 
     47 ;; 
     48 -latmax) 
     49    latmax=${2} 
     50    shift 
     51 ;; 
     52 -longmin) 
     53    longmin=${2} 
     54    shift 
     55 ;; 
     56 -longmax) 
     57    longmax=${2} 
     58    shift 
     59 ;; 
    4660 *) # other choice 
    4761    echo "${usage}" 
     
    6175# ++ blindage en tout genre 
    6276# 
    63 #  
     77case ${grid} in 
     78gridT) 
     79  echo "iii : grid=${orcares}" 
     80 ;; 
     81*) 
     82  echo "eee : pb \${grid} = ${grid}" 
     83  exit 1 
     84;; 
     85esac 
     86# 
     87case ${orcares} in 
     88ORCA025) 
     89  echo "iii : orcares=${orcares}" 
     90 ;; 
     91*) 
     92  echo "eee : pb \${orcares} = ${orcares}" 
     93  exit 1 
     94;; 
     95esac 
     96# 
     97case ${drakkar_exp} in 
     98G42) 
     99  echo "iii : drakkar_exp=${drakkar_exp}" 
     100 ;; 
     101*) 
     102  echo "eee : pb \${drakkar_exp} = ${drakkar_exp}" 
     103  exit 1 
     104;; 
     105esac 
     106# 
    64107# ++ conversion of latitude and longitude in x and y indexes 
    65 case in ${orcares} in 
     108case ${orcares} in 
    66109ORCA025) 
    67    xmin=10 
    68    xmax=30 
    69    ymin=10 
    70    ymax=40 
    71 ; 
     110   xmin=529 
     111   xmax=689 
     112   ymin=266 
     113   ymax=372 
     114   echo "iii : forcage xmin xmax ymin ymax : ${xmin} ${xmax} ${ymin} ${ymax}" 
     115;; 
    72116*) 
    73117  echo "eee : pb conversion lat,long to x,y" 
     
    80124for file in  `cat ${list}` 
    81125do 
    82  fileb=`basename ${file}` 
    83  filessh=`basename ${file} .nc`_ssh.nc 
    84  rm -f ${GEOMAG_OD}/${filessh} 2> /dev/null 
    85  ncks --dimension x,${xmin},${xmax} --dimension y,${ymin},${ymax}  \ 
    86        -v sossheig \ 
    87  ${GEOMAG_ID}/${fileb} ${GEOMAG_OD}/${filessh} 
     126 echo "iii : extraction from ${file}" # ++ voir seulement si debug demandé 
     127 filessh=${GEOMAG_OD}/`basename ${file} .nc`_ssh.nc 
     128 rm -f ${filessh} 2> /dev/null 
     129 ncks --dimension x,${xmin},${xmax} --dimension y,${ymin},${ymax}  -v sossheig,nav_lon,nav_lat \ 
     130 ${file} ${filessh} 
    88131 status_ncks=${?} 
    89132 if [ ${status_ncks} -ne 0 ] 
     
    92135    exit 1 
    93136 else 
    94     list_ssh="${list_ssh} ${file_ssh}" 
     137    list_ssh="${list_ssh} ${filessh}" 
    95138 fi 
    96139done 
     140line=`head -n 1  ${list}` 
     141bfile=`basename ${line}` 
     142datemin=`echo ${bfile}  | awk -F "_" '{print $2}'` 
     143line=`tail -n 1  ${list}` 
     144bfile=`basename ${line}` 
     145datemax=`echo ${bfile}  | awk -F "_" '{print $2}'` 
    97146# 
    98 datemin=19980101#++ 
    99 datemax=19991231#++ 
    100 # concatenation ++ 
    101 varlist=`cat ${list_ssh}` 
    102 filetot=ssh_zone_${datemin}_${datemax}_${orcares}_${DRAKKAR_EXP}.nc 
    103 ncrcat ${varlist} ${filetot} 
     147# concatenation 
     148filetot=${GEOMAG_OD}/${orcares}-${drakkar_exp}_${datemin}_${datemax}_${grid}_ssh.nc 
     149rm -f  ${filetot} 2> /dev/null 
     150ncrcat ${list_ssh} ${filetot} 
    104151status_ncrcat=${?} 
    105152if [ ${status_ncrcat} -ne 0 ] 
     
    107154   echo "eee : pb with ncrcat" 
    108155   exit 1 
     156else 
     157   echo "iii : result in ${filetot}" 
    109158fi 
    110 #  
    111 # menage 
    112 rm ${list} 
     159# 
     160# ++ global attributes 
     161# ++ convention 
     162# ++ nedtcf output or ascii 
     163# clean 
    113164rm ${list_ssh} 
    114165# 
    115166# end 
    116 exit 1 
     167exit 0 
  • trunk/getmodelout.sh

    r33 r35  
    1 #!/bin/sh -x 
     1#!/bin/sh 
    22# 
    33# module : 
     
    55# 
    66# usage : 
    7 # $ getmodelout.sh -o list ++ 
     7# $ getmodelout.sh -r orcares -exp drakkar_exp -g grid -yearmin yyyy -yearmax yyyy -o list 
    88# 
    99# example : 
    10 # $ getmodelout.sh -o ${GEOMAG_OD}/list_G42 
     10# $ getmodelout.sh -r ORCA025 -exp G42 -g gridT -yearmin 9 -yearmax 10 -o ${GEOMAG_OD}/list_G42 
    1111# 
    1212# update : 
     
    1818command=getmodelout.sh 
    1919# 
    20 # ++ simulation parametres 
    21 yearmin=8 
    22 yearmax=10 
    23 grid=gridT 
    24 orcares=ORCA025 
    25 DRAKKAR_EXP=G42 
    26 # 
    27 usage=" Usage : ${command} -o list" 
     20usage=" Usage : ${command} -r orcares -exp drakkar_exp -g grid -o list" 
    2821# 
    2922while [ ! -z "${1}" ] # ++ pb bash 
    3023do 
    3124 case ${1} in 
     25 -r) 
     26    orcares=${2} 
     27    shift 
     28 ;; 
     29 -exp) 
     30    drakkar_exp=${2} 
     31    shift 
     32 ;; 
     33 -g) 
     34    grid=${2} 
     35    shift 
     36 ;; 
     37 -yearmin)  
     38   yearmin=${2} 
     39   shift 
     40 ;; 
     41 -yearmax)  
     42   yearmax=${2} 
     43   shift 
     44 ;; 
    3245 -o)  
    3346   list=${2} 
     
    4962 exit 1 
    5063fi 
     64# 
     65if [ -f ${list} ] 
     66then 
     67  echo "eee : ${list} exist" 
     68  exit 1 
     69fi 
    5170# ++ blindage en tout genre 
    5271# 
     72case ${orcares} in 
     73ORCA025) 
     74   dirref=/u/rech/cli/rcli002/ # sur l'idris 
     75;; 
     76*) 
     77   echo "eee : pb \${orcares} = ${orcares}" 
     78;; 
     79esac 
     80# 
     81listfull=${GEOMAG_LOG}/lisfull${$} 
     82# 
    5383iyear=${yearmin} 
    54 while [ ${iyear} -lt ${yearmax} ] 
     84while [ ${iyear} -le ${yearmax} ] 
    5585do  
    5686  cyear=`printf "%4.4d" ${iyear}` 
    57   ls /u/rech/cli/rcli002/${orcares}/${orcares}-${DRAKKAR_EXP}-S/${cyear}/${orcares}-${DRAKKAR_EXP}_y${cyear}m??d??_${grid}.nc >> ${list} 
     87  ls ${dirref}/${orcares}/${orcares}-${drakkar_exp}-S/${cyear}/${orcares}-${drakkar_exp}_y${cyear}m??d??_${grid}.nc >> ${listfull} 
    5888  # ++ calcul taille cf myls dans faq es dods 
    59    
    6089  # iyear=$(( ${iyear} + 1 )) ++ pas ok sur rhodes 
    6190  # iyear=$(expr  ${iyear} + 1 )  ++ pas ok sur rhodes 
     
    6594# print total size of model files 
    6695# ++ pb syntaxe unitsop="1024**2" # Mo 
    67 #ls -l `cat ${list}` | \ 
     96#ls -l `cat ${listfull}` | \ 
    6897#awk 'NF>4 {print $5, $9}' | \ 
    6998#awk 'sum=$1/'$unitsop'+sum {printf("%08.3f '$units' -- %s\n",$1/'$unitsop', $2)}  
     
    72101# ++ ln cp ou scp  
    73102# ++ -f ou test si deja existant  
    74 for file in  `cat ${list}` 
     103for file in  `cat ${listfull}` 
    75104do 
    76105  ln -sf ${file} ${GEOMAG_ID} 
     106  echo ${GEOMAG_ID}/`basename ${file}` >> ${list} 
    77107done  
    78108# 
Note: See TracChangeset for help on using the changeset viewer.