- Timestamp:
- 04/29/11 13:56:15 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/compute_erai_daily_region_2d.sh
r50 r51 16 16 # :: 17 17 # 18 # $ compute_erai_daily_region_2d.sh [--debug] [--diff_cmd arg] 18 # $ compute_erai_daily_region_2d.sh [--debug] [--diff_cmd arg] -b yyyymmdd -e yyyymmdd 19 19 # 20 20 # DESCRIPTION … … 23 23 # .. option:: --diff_cmd <arg> 24 24 # 25 # by default :samp:`ncflint` command is used to compute difference between NetCDF files26 # 27 # if :samp:`cdo` is specified here, this command will be used instead.25 # By default :samp:`ncflint` command is used to compute difference between NetCDF files 26 # 27 # If :samp:`cdo` is specified here, this command will be used instead. 28 28 # 29 29 # .. option:: --debug 30 30 # 31 # if this option is set, :samp:`ncdump -v time` will be added to log file 32 # 33 # 34 # Put in ${PROJECT_ID} ERA-Intermin reference files 31 # If this option is set, :samp:`ncdump -v time` will be added to log file 32 # 33 # .. option:: -b beginning date <yyyymmdd> 34 # .. option:: -e end date <yyyymmdd> 35 # 36 # Put in ${PROJECT_ID} ERA-Intermin reference files. 35 37 # 36 38 # Log file is written on :file:`${PROJECT_LOG}/compute_erai_daily_region_2d.log.{YYYYMMDDTHHMMSSZ}` … … 78 80 # you just have to run this tool :: 79 81 # 80 # $ compute_erai_daily_region_2d.sh 82 # $ compute_erai_daily_region_2d.sh -b 19890101 -e 20091231 81 83 # 82 84 # And look at log file with :: … … 85 87 # 86 88 # and of course on files in ${PROJECT_ID}. 87 #88 89 # 89 90 # SEE ALSO … … 115 116 # ==== 116 117 # 118 # adjust yyyymmddb_min and yyyymmddb_max 119 # 117 120 # trouble with cdo reference (extra %23name in generated url using sphinx1.0.7) 118 121 # 119 122 # minimize use of generic characters (*) to avoid ambiguity 120 123 # 121 # parametrisation of year min and year max122 #123 124 # split get and process files 124 125 # … … 135 136 # ncrcat: WARNING Intra-file non-monotonicity. Record coordinate "time" does not monotonically decrease between (input file /homedata/pinsard/log//compute_erai_daily_region_2d.20110126T154235Z.temp//temp_int_str_199012.nc record indices: 29, 30) (output file /homedata/pinsard/tropflux_d//erai_TROP_1d_19900101_19901231_str_gridOrig.nc record indices 363, 364) record coordinate values -0.000278, -0.000278 136 137 # 137 #138 138 # this seems to be solved by using cdo instead of ncflint. to be confirmed ! 139 #140 139 # 141 140 # no files *19890101* in /bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/1989/01/ : … … 157 156 # 158 157 # $URL$ 158 # 159 # - fplod 20110429T114649Z aedon.locean-ipsl.upmc.fr (Darwin) 160 # 161 # * add -b and -e parameters 159 162 # 160 163 # - fplod 20110203T101720Z aedon.locean-ipsl.upmc.fr (Darwin) … … 214 217 AIX|IRIX64) 215 218 echo "www : no specific posix checking" 219 date_cmd=date 220 ;; 221 Darwin) 222 set -o posix 223 date_cmd=gdate 224 ;; 225 Linux) 226 set -o posix 227 date_cmd=date 216 228 ;; 217 229 *) … … 226 238 log_date=$(date -u +"%Y%m%dT%H%M%SZ") 227 239 # 228 usage=" Usage : ${command} --debug --diff_cmd [ncflint|cdo]"240 usage=" Usage : ${command} [--debug] [--diff_cmd [ncflint|cdo]] -b yyyymmdd -e yyyymmdd" 229 241 # 230 242 hostname=$(hostname) 243 # 244 yyyymmddb_min=19890101 245 yyyymmdde_max=20091231 246 # 231 247 # default 232 248 diff_cmd=ncflint 233 249 debug=0 234 # 235 minargcount=0 250 yyyymmddb=19890101 251 yyyymmdde=20091231 252 # 253 minargcount=4 236 254 if [ ${#} -lt ${minargcount} ] 237 255 then … … 250 268 --diff_cmd) 251 269 diff_cmd=${2} 270 shift 271 ;; 272 -b) 273 # first date to get 274 yyyymmddb=${2} 275 shift 276 ;; 277 -e) 278 # last date to get 279 yyyymmdde=${2} 252 280 shift 253 281 ;; … … 264 292 # 265 293 set -u 294 # check parameters 295 # 296 ${date_cmd} -d "${yyyymmddb}" > /dev/null 297 status_date=${?} 298 if [ ${status_date} -ne 0 ] 299 then 300 echo "${command} : eee : yyyymmddb ${yyyymmddb} argument invalid" 301 exit 1 302 fi 303 unset status_date 304 # 305 if [[ "${yyyymmddb}" < "${yyyymmddb_min}" ]] 306 then 307 echo "${command} : eee : yyyymmddb ${yyyymmddb} must be equal or greater than ${yyyymmddb_min}" 308 exit 1 309 fi 310 # 311 ${date_cmd} -d "${yyyymmdde}" > /dev/null 312 status_date=${?} 313 if [ ${status_date} -ne 0 ] 314 then 315 echo "${command} : eee : yyyymmdde ${yyyymmdde} argument invalid" 316 exit 1 317 fi 318 unset status_date 319 # 320 if [[ "${yyyymmdde}" > "${yyyymmdde_max}" ]] 321 then 322 echo "${command} : eee : yyyymmdde ${yyyymmdde} must be lower or equal to ${yyyymmdde_max}" 323 exit 1 324 fi 325 # 326 # 327 if [[ "${yyyymmdde}" < "${yyyymmddb}" ]] 328 then 329 echo "${command} : eee : yyyymmdde ${yyyymmdde} must be equal or greater than yyyymmddb ${yyyymmddb}" 330 exit 1 331 fi 332 # 266 333 # test if diff_cmd valid 267 334 case ${diff_cmd} in … … 344 411 maxlon=360. 345 412 reg=TROP 346 yearmin= 1989347 yearmax= 2009348 monthmin= 1349 monthmax= 12413 yearmin=$(${date_cmd} -d "${yyyymmddb}" +%Y) 414 yearmax=$(${date_cmd} -d "${yyyymmdde}" +%Y) 415 monthmin=$(${date_cmd} -d "${yyyymmddb}" +%m) 416 monthmax=$(${date_cmd} -d "${yyyymmdde}" +%m) 350 417 cmonthmin=$(printf "%2.2d" ${monthmin}) 351 418 cmonthmax=$(printf "%2.2d" ${monthmax})
Note: See TracChangeset
for help on using the changeset viewer.