- Timestamp:
- 02/03/11 10:39:51 (13 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/compute_erai_daily_region_2d.sh
r32 r33 16 16 # :: 17 17 # 18 # $ compute_erai_daily_region_2d.sh 18 # $ compute_erai_daily_region_2d.sh [--debug] [--diff_cmd arg] 19 19 # 20 20 # DESCRIPTION 21 21 # =========== 22 # 23 # .. option:: --diff_cmd <arg> 24 # 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 # 29 # .. option:: --debug 30 # 31 # if this option is set, :samp:`ncdump -v time` will be added to log file 32 # 22 33 # 23 34 # Put in ${TROPFLUX_ID} ERA-Intermin reference files … … 31 42 # rankdir="LR", 32 43 # ] 33 # filein_str [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/str.yyyymmdd *"];34 # filein_msl [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/m m/msl.yyyymm.ashei.GLOBAL_075.nc"];35 # filein_sstk [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/ mm/sstk.yyyymm.ashei.GLOBAL_075.nc"];36 # filein_t2 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/ mm/t2.yyyymm.ashei.GLOBAL_075.nc"];37 # filein_d2 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/ mm/d2.yyyymm.ashei.GLOBAL_075.nc"];38 # filein_u10 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/ mm/u10.yyyymm.ashei.GLOBAL_075.nc"];39 # filein_v10 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/ mm/v10.yyyymm.ashei.GLOBAL_075.nc"];44 # filein_str [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/yyyy/mm/str.yyyymmdd.fshei.GLOBAL_075.nc"]; 45 # filein_msl [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/msl.yyyymm.ashei.GLOBAL_075.nc"]; 46 # filein_sstk [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/sstk.yyyymm.ashei.GLOBAL_075.nc"]; 47 # filein_t2 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/t2.yyyymm.ashei.GLOBAL_075.nc"]; 48 # filein_d2 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/d2.yyyymm.ashei.GLOBAL_075.nc"]; 49 # filein_u10 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/u10.yyyymm.ashei.GLOBAL_075.nc"]; 50 # filein_v10 [shape=ellipse,fontname=Courier,label="/bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/AN_SF/yyyy/v10.yyyymm.ashei.GLOBAL_075.nc"]; 40 51 # 41 52 # fileout_str [shape=ellipse,fontname=Courier,label="${TROPFLUX_ID}/erai_TROP_1d_yyyy0101_yyyy1231_str_gridOrig.nc"]; … … 101 112 # ==== 102 113 # 114 # add cdo reference 115 # 116 # minimize use of generic characters (*) to avoid ambiguity 117 # 103 118 # parametrisation of year min and year max 104 119 # 105 # explication on ncflint arguments106 #107 120 # split get and process files 108 121 # 109 122 # coding rules 110 123 # 111 # correction of min and max of latitude field (still -90,+90 !)124 # correction of min and max values of latitude attributes (still -90,+90 !) in output files 112 125 # 113 126 # are cmonthmin and cmonthmax the real info to put in output file name ? may be not because if input files do not exist 114 127 # 128 # same idea for day min and max - some time hard coded with 01 or 31 (avoid yyyy0231 !!) 115 129 # 116 130 # solve this kind of warning:: … … 118 132 # 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 119 133 # 134 # 135 # this seems to be solved by using cdo instead of ncflint. to be confirmed ! 136 # 137 # 138 # no files *19890101* in /bdd/ERAI/NETCDF/GLOBAL_075/4xdaily/FC_SF/1989/01/ : 139 # is it normal ? 140 # 141 # check units of str :: 142 # 143 # str:long_name = "Surface thermal radiation" ; 144 # str:units = "W/m^2 s" 145 # 146 # still true after ncflint/cdo arithmetic ? 147 # 148 # Modify global attributes : Still CF ? no more "five time values per day " in Forecast attributes 149 # 150 # enrich info in log file 120 151 # 121 152 # EVOLUTIONS 122 153 # ========== 154 # 155 # $URL$ 156 # 157 # - pinsard 2011-02-02T16:11:07Z loholt1.ipsl.polytechnique.fr (Linux) 158 # 159 # * add parameter --debug 160 # * add parameter --diff_cmd to choose between ncflint and cdo 161 # * usage of :samp:`cdo sub` and :samp: cdo divc,86400.` if parameter --diff_cmd is set to cdo 162 # thanks to https://code.zmaw.de/embedded/cdo/1.4.7/cdo.html#x1-2280002.7.4 163 # * add natural language explanation on ncflit usage provided by Matthieu 164 # 165 # - fplod 20110127T142038Z 166 # 167 # * correction of path of input files in header 123 168 # 124 169 # - fplod 20110126T132641Z … … 174 219 log_date=$(date -u +"%Y%m%dT%H%M%SZ") 175 220 # 176 usage=" Usage : ${command} "221 usage=" Usage : ${command} --debug --diff_cmd [ncflint|cdo]" 177 222 # 178 223 hostname=$(hostname) 179 224 # default 180 # N.A. because no parameters 225 diff_cmd=ncflint 226 debug=0 227 # 228 minargcount=0 229 if [ ${#} -lt ${minargcount} ] 230 then 231 echo "${command} : eee : not enought arguments" 232 echo "${usage}" 233 exit 1 234 fi 235 # 236 set +u 237 while [ ! -z "${1}" ] 238 do 239 case ${1} in 240 --debug) 241 debug=1 242 ;; 243 --diff_cmd) 244 diff_cmd=${2} 245 shift 246 ;; 247 *) 248 # anything else 249 echo "${command} : eee : unknown option ${1}" 250 echo "${command} : eee : ${usage}" 251 exit 1 252 ;; 253 esac 254 # next flag 255 shift 256 done 181 257 # 182 258 set -u 183 # 259 # test if diff_cmd valid 260 case ${diff_cmd} in 261 ncflint) 262 # test if ncflint available 263 tool=ncflint 264 type ${tool} 1> /dev/null 2>&1 265 status=${?} 266 if [ ${status} -ne 0 ] 267 then 268 echo "${command} : eee : ${tool} not found" 269 exit 1 270 fi 271 unset status 272 ;; 273 cdo) 274 # test if cdo available 275 tool=cdo 276 type ${tool} 1> /dev/null 2>&1 277 status=${?} 278 if [ ${status} -ne 0 ] 279 then 280 echo "${command} : eee : ${tool} not found" 281 exit 1 282 fi 283 unset status 284 ;; 285 *) 286 echo "${command} : eee : diff_cmd ${diff_cmd} argument invalid" 287 exit 1 288 esac 289 184 290 # check for ${TROPFLUX_LOG} definition 185 291 if [ "${TROPFLUX_LOG}" = "" ] … … 219 325 echo "runtime=${log_date}" 1>> ${log} 220 326 unset log_date 327 # 221 328 echo "" 1>> ${log} 329 echo "[Parameters]" 1>> ${log} 330 echo "diff_cmd=${diff_cmd}" 1>> ${log} 331 echo "" 1>> ${log} 332 # 222 333 # 223 334 minlat=-36. … … 262 373 do 263 374 cday=$(printf "%2.2d" ${day}) 264 if [ -f ${dirin}/FC_SF/${yyyy}/${cmonth}/${var}.${yyyy}${cmonth}${cday} *]375 if [ -f ${dirin}/FC_SF/${yyyy}/${cmonth}/${var}.${yyyy}${cmonth}${cday}.fshei.GLOBAL_075.nc ] 265 376 then 266 ncpdq -U ${dirin}/FC_SF/${yyyy}/${cmonth}/${var}.${yyyy}${cmonth}${cday}* ${dirtemp}/${var}.${yyyy}${cmonth}${cday}.temp.GLOBAL_075.nc 377 if [ ${debug} -eq 1 ] 378 then 379 ncdump -v time ${dirin}/FC_SF/${yyyy}/${cmonth}/${var}.${yyyy}${cmonth}${cday}.fshei.GLOBAL_075.nc >> ${log} 2>&1 380 fi 381 ncpdq -U ${dirin}/FC_SF/${yyyy}/${cmonth}/${var}.${yyyy}${cmonth}${cday}.fshei.GLOBAL_075.nc ${dirtemp}/${var}.${yyyy}${cmonth}${cday}.temp.GLOBAL_075.nc 382 if [ ${debug} -eq 1 ] 383 then 384 ncdump -v time ${dirtemp}/${var}.${yyyy}${cmonth}${cday}.temp.GLOBAL_075.nc >> ${log} 2>&1 385 fi 267 386 else 268 387 echo "${command} : iii : no files ${dirin}/FC_SF/${yyyy}/${cmonth}/${var}.${yyyy}${cmonth}${cday}*" >> ${log} … … 273 392 if [ "${exist_temp_files}" != "" ] 274 393 then 275 ncrcat -O ${dirtemp}/${var}.${yyyy}${cmonth}*temp* ${dirtemp}/${var}.${yyyy}${cmonth}.fshei.GLOBAL_075.nc 276 rm ${dirtemp}/${var}.${yyyy}${cmonth}*temp* 2> /dev/null 394 # concatenation of daily files 395 ncrcat -O ${dirtemp}/${var}.${yyyy}${cmonth}??.temp.GLOBAL_075.nc ${dirtemp}/${var}.${yyyy}${cmonth}.fshei.GLOBAL_075.nc 396 if [ ${debug} -eq 1 ] 397 then 398 ncdump -v time ${dirtemp}/${var}.${yyyy}${cmonth}.fshei.GLOBAL_075.nc >> ${log} 2>&1 399 fi 400 rm ${dirtemp}/${var}.${yyyy}${cmonth}??.temp.GLOBAL_075.nc 2> /dev/null 277 401 ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,0,,5 ${dirtemp}/${var}.${yyyy}${cmonth}.fshei.GLOBAL_075.nc ${dirtemp}/temp_time0.nc 402 if [ ${debug} -eq 1 ] 403 then 404 ncdump -v time ${dirtemp}/temp_time0.nc >> ${log} 2>&1 405 fi 278 406 ncks -d lat,${minlat},${maxlat} -d lon,${minlon},${maxlon} -d time,4,,5 ${dirtemp}/${var}.${yyyy}${cmonth}.fshei.GLOBAL_075.nc ${dirtemp}/temp_time4.nc 279 ncflint -w 1.1574074,-1.1574074 ${dirtemp}/temp_time0.nc ${dirtemp}/temp_time4.nc ${dirtemp}/temp_time.nc 280 ncflint -w 0.00001,0.0 ${dirtemp}/temp_time.nc ${dirtemp}/temp_time.nc ${dirtemp}/temp_int_${var}_${yyyy}${cmonth}.nc 407 if [ ${debug} -eq 1 ] 408 then 409 ncdump -v time ${dirtemp}/temp_time4.nc >> ${log} 2>&1 410 fi 411 case "${diff_cmd}" in 412 ncflint) 413 # différence entre les forcast a 36 et a 12h (pour avoir des flux par jour) et la constante suivant le -w permet de se ramener a des unites connues 414 ncflint -w 1.1574074,-1.1574074 ${dirtemp}/temp_time0.nc ${dirtemp}/temp_time4.nc ${dirtemp}/temp_time.nc 415 if [ ${debug} -eq 1 ] 416 then 417 ncdump -v time ${dirtemp}/temp_time.nc >> ${log} 2>&1 418 fi 419 # La deuxieme permet uniquement de passer en seconde. 1.1574074*.00001=1/86400. (jour a seconde) 420 ncflint -w 0.00001,0.0 ${dirtemp}/temp_time.nc ${dirtemp}/temp_time.nc ${dirtemp}/temp_int_${var}_${yyyy}${cmonth}.nc 421 if [ ${debug} -eq 1 ] 422 then 423 ncdump -v time ${dirtemp}/temp_int_${var}_${yyyy}${cmonth}.nc >> ${log} 2>&1 424 fi 425 ;; 426 cdo) 427 cdo sub ${dirtemp}/temp_time0.nc ${dirtemp}/temp_time4.nc ${dirtemp}/temp_time.nc >> ${log} 2>&1 428 if [ ${debug} -eq 1 ] 429 then 430 ncdump -v time ${dirtemp}/temp_time.nc >> ${log} 2>&1 431 fi 432 cdo divc,86400. ${dirtemp}/temp_time.nc ${dirtemp}/temp_int_${var}_${yyyy}${cmonth}.nc >> ${log} 2>&1 433 if [ ${debug} -eq 1 ] 434 then 435 ncdump -v time ${dirtemp}/temp_int_${var}_${yyyy}${cmonth}.nc >> ${log} 2>&1 436 fi 437 ;; 438 esac 281 439 rm ${dirtemp}/temp_time* 2> /dev/null 282 440 rm ${dirtemp}/${var}.${yyyy}${cmonth}.fshei.GLOBAL_075.nc 2> /dev/null … … 287 445 month=$(( ${month} + 1 )) 288 446 done 289 ncrcat -O ${dirtemp}/temp_int_${var}_${yyyy}* ${TROPFLUX_ID}/erai_${reg}_1d_${yyyy}${cmonthmin}01_${yyyy}${cmonthmax}31_${var}_gridOrig.nc 447 # concatenation of monthly files 448 if [ ${debug} -eq 1 ] 449 then 450 ncdump -v time ${dirtemp}/temp_int_${var}_${yyyy}??.nc 1>> ${log} 2>&1 451 fi 452 ncrcat -O ${dirtemp}/temp_int_${var}_${yyyy}??.nc ${TROPFLUX_ID}/erai_${reg}_1d_${yyyy}${cmonthmin}01_${yyyy}${cmonthmax}31_${var}_gridOrig.nc 1>> ${log} 2>&1 290 453 rm ${dirtemp}/temp_int_${var}_${yyyy}* 2> /dev/null 291 454 yyyy=$(( ${yyyy} + 1 )) … … 307 470 do 308 471 cmonth=$(printf "%2.2d" ${month}) 309 if [ -f ${dirin}/AN_SF/${yyyy}/${var}.${yyyy}${cmonth}.ashei.GLOBAL_075.nc ] 472 if [ -f ${dirin}/AN_SF/${yyyy}/${var}.${yyyy}${cmonth}.ashei.GLOBAL_075.nc ] 310 473 then 311 474 ncpdq -U ${dirin}/AN_SF/${yyyy}/${var}.${yyyy}${cmonth}.ashei.GLOBAL_075.nc ${dirtemp}/${var}.${yyyy}${cmonth}.ashei.GLOBAL_075.nc … … 322 485 fi 323 486 done 324 ncrcat -O ${dirtemp}/temp_int_${yyyy}* ${TROPFLUX_ID}/erai_${reg}_1d_${yyyy}${cmonthmin}01_${yyyy}${cmonthmax}31_${var}_gridOrig.nc 487 # concatenation of monthly files 488 if [ ${debug} -eq 1 ] 489 then 490 ncdump -v time ${dirtemp}/temp_int_${yyyy}??.nc >> ${log} 2>&1 491 fi 492 ncrcat -O ${dirtemp}/temp_int_${yyyy}??.nc ${TROPFLUX_ID}/erai_${reg}_1d_${yyyy}${cmonthmin}01_${yyyy}${cmonthmax}31_${var}_gridOrig.nc >> ${log} 2>&1 325 493 rm ${dirtemp}/temp_int_${yyyy}* 2> /dev/null 326 494 yyyy=$(( ${yyyy} + 1 )) 327 495 done 328 496 done 329 # 497 # debug to check if clean is done 498 if [ ${debug} -eq 1 ] 499 then 500 ls ${dirtemp}/ >> ${log} 2>&1 501 fi 330 502 # end 331 503 exit 0 -
trunk/src/get_oaflux.sh
r16 r33 77 77 # 78 78 # :ref:`tropflux_profile.sh` 79 # 80 # :ref:`oaflux_mask_30N30S.pro` 79 81 # 80 82 # EVOLUTIONS -
trunk/src/interp_erai_t2m_1989_2009.pro
r27 r33 318 318 319 319 320 ncfields = 't2m[longitude,latitude,time]=t2mout:t2m_attr; ' $ 321 + 'longitude[]=lon:lon_attr; ' $ 322 + 'latitude[]=lat:lat_attr; ' $ 323 + 'time[*time]=timein:time_attr ' $ 324 + ' @ globattr' 325 320 help, t2mout 321 help, timein 322 ;ncfields = 't2m[longitude,latitude,*time]=t2mout:t2m_attr; ' $ 323 ; + 'longitude[]=lon:lon_attr; ' $ 324 ; + 'latitude[]=lat:lat_attr; ' $ 325 ; + 'time[]=timein:time_attr ' $ 326 ; + ' @globattr' 327 328 ; ok ncfields = 'longitude[]=lon:lon_attr;latitude[]=lat:lat_attr' 329 ; ok ncfields = 'longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[]=timein:time_attr' 330 ; ok ncfields = 'longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[*]=timein:time_attr' 331 ; ok ncfields = 'longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[*]=timein:time_attr@globattr' 332 ; pas ok ncfields = 't2m[longitude,latitude,*time]=t2mout:t2m_attr;longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[*]=timein:time_attr@globattr' 333 ; pas ok ncfields = 'longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[*]=timein:time_attr;t2m[longitude,latitude,*time]=t2mout:t2m_attr@globattr' 334 335 ; the simpliest one 336 nlat=73 337 nlon=96 338 latitudetp=findgen(nlat) 339 longitudetp=findgen(nlon) 340 timetp=findgen(2) 341 pressure3d=findgen(nlon,nlat,2) 342 patts = {units:'pascal',missing_value:1e10} 343 globatts={source:'my program',version:2} 344 NCFIELDS = 'pressure3d[longitudetp,latitudetp,*timetp]=pressure3d:patts;longitudetp[];latitudetp[];timetp[]@globatts' 345 ncfile='my4.nc' 326 346 @ncdf_quickwrite 327 347 348 timepb=findgen(2) 349 t2m=findgen(350,60,2) 350 help, lat 351 help, lon 352 help, t2m 353 help, time 354 help, timein 355 help, timepb 356 ncfile='!' + fullfilename_out 357 ; pas ok ncfields = 'longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[]=timein:time_attr;t2m[longitude,latitude,*time]' 358 ; pas ok ncfields = 't2m[longitude,latitude,*time];longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[]=timein:time_attr' 359 ; ok avec timepb=findgen(2) ncfields = 't2m[longitude,latitude,*time];longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[]=timepb:time_attr' 360 ; ok 361 ;timepb=findgen(2) 362 ;timepb[0]=280512. 363 ;timepb[1]=280536. 364 ;ncfields = 't2m[longitude,latitude,*time];longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[]=timepb:time_attr' 365 366 timepb=findgen(7670) 367 ncfields = 't2m[longitude,latitude,*time];longitude[]=lon:lon_attr;latitude[]=lat:lat_attr;time[]=timepb:time_attr' 368 @ncdf_quickwrite 369 328 370 329 371 end -
trunk/src/test/read.jnl
r31 r33 30 30 ! ======== 31 31 ! 32 ! matlab/octave similar program 33 ! 34 ! :ref:`read.m` 32 ! matlab/octave similar program : :ref:`read.m` 35 33 ! 34 ! IDL+SAXO similar program : :ref:`read.pro` 36 35 ! 37 36 ! TODO
Note: See TracChangeset
for help on using the changeset viewer.