- Timestamp:
- 04/30/12 15:35:40 (12 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cresamsu.pro
r543 r544 1 1 ; docformat = 'rst' 2 2 ;+ 3 ; .. _cresamsu.pro:4 3 ; 5 4 ; ============ … … 7 6 ; ============ 8 7 ; 8 ; .. function: cresamsu(numch, yyyyb, mmb, ddb, yyyye, mme, dde, lonmin, lonmax, latmin, latmax, temp, rtemp, rhdeg) 9 ; 9 10 ; DESCRIPTION 10 11 ; =========== 11 12 ; 12 13 ; programme d'interpolation avec algorithme de Cressmann 14 ; 15 ; grille de sortie en long / lat 16 ; recoit en entree les jours de l'annee jdeb et jfin correspondant au debut et la fin du mois 13 17 ; 14 18 ; adaptation aux donnees Tb AMSU lues avec la nouvelle chaîne de lecture … … 64 68 ; rtemp = 0.5 65 69 ; rhdeg = 1. 66 ; cresamsu,numch, yyyyb, mmb, ddb $70 ; result = cresamsu(numch, yyyyb, mmb, ddb $ 67 71 ; , yyyye, mme, dde $ 68 72 ; , lonmin, lonmax, latmin, latmax $ 69 ; , temp, rtemp, rhdeg 73 ; , temp, rtemp, rhdeg) 70 74 ; 71 75 ; SEE ALSO … … 113 117 ; - fplod 20120430 114 118 ; 119 ; * pro -> function 120 ; * idl_amsu_netcdf is a function 115 121 ; * add digraph 116 122 ; … … 165 171 ;- 166 172 167 procresamsu $173 function cresamsu $ 168 174 , numch $ 169 175 , yyyyb $ … … 177 183 , latmin $ 178 184 , latmax $ 179 , temp $ 185 , temp $ 180 186 , rtemp $ 181 187 , rhdeg 182 183 ; grille de sortie en long / lat184 ; recoit en entree les jours de l'annee jdeb et jfin correspondant au debut et la fin du mois185 188 186 189 compile_opt idl2, strictarrsubs … … 193 196 if key_performance EQ 1 THEN BEGIN 194 197 time1 = SYSTIME(1) 198 ENDIF 199 ; 200 ; Return to caller if errors 201 ON_ERROR, 2 202 result = -1 203 ; 204 usage = 'result = cresamsu(numch, yyyyb, mmb, ddb, yyyye, mme, dde, lonmin, lonmax, latmin, latmax, temp, rtemp, rhdeg)' 205 ; 206 nparam = N_PARAMS() 207 IF (nparam NE 14) THEN BEGIN 208 ras = report(['Incorrect number of arguments.' $ 209 + '!C' $ 210 + 'Usage : ' + usage]) 211 return, result 195 212 ENDIF 196 213 ; … … 223 240 ;rtemp=0.5 ;en jours rayon de Cressmann (0.25, 0.5, 1, 2,... - nb entiers!) 224 241 rtemphor=rtemp*24. ; en heures 225 print,'rayon temporel en heures',rtemphor 242 msg = report(['iii : ' + routine + ' : rayon temporel en heures' + string(rtemphor)]) 226 243 ; valeurs utiles et conversions degres / radians 227 244 vbidon=-999. … … 248 265 hrdeb=jdeb*24 249 266 hrfin=jfin*24 250 print,'debut et fin', jdeb,jfin 267 msg = report(['iii : ' + routine + ' : debut et fin = ' + string(jdeb) + ' ' + string(jfin)]) 251 268 252 269 ; grille des donnees en sortie … … 255 272 la1=latmin+rhdeg 256 273 la2=latmax-rhdeg 257 print,"bornes de la grille de sortie",lo1,lo2,la1,la2,jdeb,jfin 274 msg = report(['iii : ' + routine + ' : bornes de la grille de sortie = ' + string(lo1) + ' ' + string(lo2)+ ' ' + string(la1) + ' ' + string(la2) + ' ' + string(jdeb) + ' ' + string(jfin)]) 258 275 kmax=fix((lo2-lo1)/pash) ; pour valeurs de 0 a kmax 259 276 nblon=kmax+1 … … 262 279 jmax=fix((hrfin-hrdeb)/pasthor) ; valeurs de 0 a jmax 263 280 nbjour=jmax+1 264 print,'nb pas de temps',nbjour, ' nb lat',nblat,' nblon',nblon 281 msg = report(['iii : ' + routine + ' : nb pas de temps = ' + string(nbjour)]) 282 msg = report(['iii : ' + routine + ' : nb lat = ' + string(nblat)]) 283 msg = report(['iii : ' + routine + ' : nb lon = ' + string(nblon)]) 265 284 266 285 ;____________________________________ … … 276 295 la2=max(yylat) 277 296 hrfin=max(jjours)*24. 278 print, 'pas de temps du fichier ncdf en jours decimaux',jjours 279 print,'derniers points de la grille',max(xxlon),max(yylat),hrfin 297 msg = report(['iii : ' + routine + ' : pas de temps du fichier ncdf en jours decimaux= ' + string(jjours)]) 298 msg = report(['iii : ' + routine + ' : derniers points de la grille (lon) = ' + string(max(xxlon))]) 299 msg = report(['iii : ' + routine + ' : derniers points de la grille (lat) = ' + string(max(yylat))]) 300 msg = report(['iii : ' + routine + ' : derniers points de la grille (temps) = ' + string(max(hrfin))]) 280 301 ;----------------------------------- 281 302 t=indgen(nbjour)*pasthor+hrdeb ; en heures 282 print,'t',t 303 msg = report(['iii : ' + routine + ' : t = ' + string(t)]) 283 304 284 305 ; initialisation des tableaux de sortie (s valeurs, z poids, kont nb points) … … 312 333 if yyyy eq yyyye then mmye=mme 313 334 endif 314 print,"traitement annee ",yyyy,'mois ',mmyb,'a ',mmye335 msg = report(['iii : ' + routine + ' : traitement annee ' + string(yyyy) + ' ' + string(mmyb) + ' a ' + string(mmye)]) 315 336 for mm=mmyb,mmye do begin 316 337 if (mme ne mmb) then begin … … 320 341 if mm eq mme then ddme=dde 321 342 endif 322 print,"mois ",mm,"jours ",ddmb,"a ",ddme343 msg = report(['iii : ' + routine + ' : mois' + string(mm) + ' ' + string(ddmb) + ' a ' + string(ddme)]) 323 344 for dd=ddmb,ddme do begin 324 print, 'iii : traitement du jour ',yyyy,mm,dd345 msg = report(['iii : ' + routine + ' : traitement du jour ' + string(yyyy) + string(mm) + string(dd)]) 325 346 ; lecture du fichier journalier 326 347 result=file_amsu_t2_to_mem( yyyy, mm, dd, numch $ … … 405 426 goto, nextday 406 427 nofile: 407 print, 'www : no data to read for this day'428 msg = report(['www : ' + routine + ' : no data to read for this day']) 408 429 goto, nextday 409 430 … … 421 442 if nbfile GT 0 THEN BEGIN 422 443 good=where (kont1 ge 1,nb) 423 print,'points valides',nb444 msg = report(['iii : ' + routine + ' : points valides = ' + string(nb)]) 424 445 if (nb ne 0) then tb1fin[good]=stb1[good]/z1[good] 425 446 bad=where (kont1 eq 0,nbad) 426 print,'bad',nbad447 msg = report(['iii : ' + routine + ' : nb bad = ' + string(nbad)]) 427 448 if (nbad ne 0) then tb1fin[bad]=!values.f_Nan 428 449 ; print,tb1fin 429 print,'extremes du compteur',min(kont1),max(kont1)430 450 msg = report(['iii : ' + routine + ' : extremes du compteur = ' + string(min(kont1)) + ' ' + string(max(kont1))]) 451 431 452 ;toto=reform(tb1fin[*,*,0]) 432 453 ;plt,xxlon,yylat,toto 433 idl_amsu_netcdf, numch, temp,rtemp,rhdeg, tb1fin, yylat, xxlon, jjours 454 result = idl_amsu_netcdf(numch, temp,rtemp,rhdeg, tb1fin, yylat, xxlon, jjours) 455 result_type=size(result,/type) 456 IF (result_type EQ 3) THEN BEGIN 457 IF (result NE 0) THEN BEGIN 458 msg = report(['eee : ' + routine + ' : pb idl_amsu_netcdf']) 459 ;return, result 460 STOP 461 ENDIF 462 ENDIF 463 434 464 ENDIF ELSE BEGIN 435 print, 'www : no files at all'465 msg = report(['www : ' + routine + 'no files at all']) 436 466 goto, realend 437 467 ENDELSE … … 439 469 realend: 440 470 IF key_performance EQ 1 THEN BEGIN 441 PRINT, 'ppp : durée totale cresamsu', SYSTIME(1)-time1, format='(a, 1x, F12.6)' 471 msg = report(['ppp : ' + routine $ 472 + ' : durée totale = ' $ 473 + string(SYSTIME(1)-time1, format='(a, 1x, F12.6)')]) 442 474 ENDIF 443 475 444 print,'fin cresamsu' 445 476 msg = report(['iii : ' + routine + ': fin']) 477 478 result = 0 479 return, result 446 480 end -
trunk/src/cresamsu.sh
r543 r544 40 40 # :file:`${PROJECT_ID}/AMSU/{numch}{temp}rt{rtemp}rh{rhdeg}_{yyyymmdd}_{yyyymmdd}_{geomin}_{geomax}_03150e4150n.nc` 41 41 # 42 # : ref:`cresamsu` is launched here using ${IDL_CMD} command42 # :func:`cresamsu` is launched here using ${IDL_CMD} command 43 43 # (see :ref:`varamma_profile.sh` to know how to set this environnement variable). 44 44 # … … 103 103 # 104 104 # Use : 105 # :ref:`cresamsu.pro` 106 # :ref:`geolocation_to_string_sh.sh` 105 # :func:`cresamsu` 107 106 # 108 107 # .. todo:: … … 132 131 # - fplod 20120430 133 132 # 133 # * cresamsu is now a function 134 134 # * creation 135 135 # … … 371 371 result = -1 372 372 ; 373 cresamsu,'${numch}', ${yyyyb}, ${mmb}, ${ddb} $373 result_cresamsu = cresamsu('${numch}', ${yyyyb}, ${mmb}, ${ddb} $ 374 374 , ${yyyye}, ${mme}, ${dde} $ 375 375 , ${lonmin}, ${lonmax}, ${latmin}, ${latmax} $ 376 , '${temp}' , ${rtemp} , ${rhdeg} 376 , '${temp}' , ${rtemp} , ${rhdeg}) 377 result_type=size(result_cresamsu,/type) 378 result_type=size(result_cresamsu,/type) 379 IF (result_type EQ 3) THEN BEGIN 380 IF (result_cresamsu NE 0) THEN BEGIN 381 print, 'eee : pb cresamsu' 382 return, result_cresamsu 383 ENDIF 384 ENDIF 377 385 result = 0 378 386 ; … … 409 417 Profiler 410 418 result = cresamsu_${$}() 419 print, 'result : ', result 411 420 print, 'ppp : profiler report begin' 412 421 Profiler, /REPORT … … 443 452 # 444 453 # end 445 set454 #set 446 455 exit -
trunk/src/idl_amsu_netcdf.pro
r542 r544 1 ;2 1 ;+ 3 ;4 ; .. _idl_amsu_netcdf.pro:5 2 ; 6 3 ; =================== 7 4 ; idl_amsu_netcdf.pro 8 5 ; =================== 6 ; 7 ; .. function:: idl_amsu_netcdf(numch, temp, rtemp, rhdeg, datain, lats, lons, timesin) 9 8 ; 10 9 ; DESCRIPTION … … 27 26 ; lats [shape=tab, label="latitude 1d array"] 28 27 ; timesin [shape=tab, label="time 1d array"] 29 ; 30 ; amsu_t5 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/AMSU/numch_yyyymmdd_yyyymmdd_geomin_geomax.nc"]; 28 ; temp [shape=tab, label="temp"] 29 ; rtemp [shape=tab, label="rtemp"] 30 ; rhdeg [shape=tab, label="rhdeg"] 31 ; 32 ; amsu_t5 [shape=ellipse, 33 ; fontname=Courier, 34 ; label="${PROJECT_OD}/AMSU/numch_temprtrtemprhrhdeg_yyyymmdd_yyyymmdd_geomin_geomax.nc"]; 31 35 ; 32 36 ; idl_amsu_netcdf [shape=box, … … 47 51 ; 48 52 ; numch = 'a5' 53 ; temp = 'm' 54 ; rtemp = 0.5 55 ; rhdeg = 1. 49 56 ; lons = findgen(10) - 10 50 57 ; lats = findgen(11) + 20 51 58 ; timesin = indgen(12) + julday(8,1,2006L) 52 59 ; datain = findgen(size(lons,/dim), size(lats,/dim), size(timesin,/dim)) 53 ; idl_amsu_netcdf, numch , datain, lats, lons, timesin60 ; result = idl_amsu_netcdf(numch, temp, rtemp, rhdeg, datain, lats, lons, timesin) 54 61 ; 55 62 ; TIPS … … 65 72 ; :ref:`data_amsu` 66 73 ; 67 ; Called by : ref:`cresamsu_cdf.pro`74 ; Called by :func:`cresamsu` 68 75 ; 69 76 ; use :func:`geolocation_to_string_idl`, :func:`jul2date <saxo:jul2date>` … … 84 91 ; coding rules 85 92 ; 86 ; replace pro by function87 ;88 93 ; check time in netcdf 89 94 ; … … 101 106 ; - fplod 20120430 102 107 ; 108 ; * add temp, rtemp, rhdeg in example 109 ; * pro -> function 103 110 ; * time unlimited 104 111 ; * time origine is a ttribute of time not of tb … … 156 163 ; 157 164 ;- 158 proidl_amsu_netcdf, numch, temp, rtemp, rhdeg, datain, lats, lons, timesin165 function idl_amsu_netcdf, numch, temp, rtemp, rhdeg, datain, lats, lons, timesin 159 166 ; 160 167 compile_opt idl2, strictarrsubs 161 168 ; 162 169 @cm_project 170 ; 171 s = size(SCOPE_TRACEBACK(/STRUCTURE),/DIMENSION) 172 routine = (SCOPE_TRACEBACK(/STRUCTURE))[s-1].Routine 173 ; 174 key_performance=0 175 if key_performance EQ 1 THEN BEGIN 176 time1 = SYSTIME(1) 177 ENDIF 178 ; 179 ; Return to caller if errors 180 ON_ERROR, 2 181 ; 182 result = -1 183 ; 184 usage = 'result = idl_amsu_netcdf(numch, temp, rtemp, rhdeg, datain, lats, lons, timesin)' 185 nparam = N_PARAMS() 186 IF (nparam NE 8) THEN BEGIN 187 ras = report(['Incorrect number of arguments.' $ 188 + '!C' $ 189 + 'Usage : ' + usage]) 190 return, result 191 ENDIF 163 192 ; 164 193 nblat = size(lats,/dim) … … 205 234 moyenne_tb[ind]=-9999. 206 235 endif 207 print,"nb valeurs manquantes", nnbad 236 msg = report(['iii : ' + routine + ' : nb valeurs manquantes = ' + string(nnbad)]) 208 237 ; 209 238 ; ++ test si toutes les valeurs sont des valeurs manquantes/aberantes … … 221 250 ENDIF 222 251 ; 223 print, 'ouverture pour ecriture de ', cdfout 252 msg = report(['iii : ' + routine + ' : ouverture pour ecriture de ' + cdfout]) 224 253 id = ncdf_create(cdfout,/clobber) 225 254 ncdf_control, id, /nofill … … 274 303 ncdf_close, id 275 304 ; 305 result = 0 306 return, result 307 ; 276 308 end
Note: See TracChangeset
for help on using the changeset viewer.