- Timestamp:
- 03/21/12 16:27:38 (12 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/docs_dev/makefile_non_sphinx
r168 r174 40 40 # thanks to 41 41 # http://morlockhq.blogspot.fr/2008/09/bash-tip-reverse-sorting-lists-revisted.html 42 # - fplod 2012031943 #44 42 # * fix ferret and odv errors 45 43 # -
trunk/docs/docs_dev/source/guides/generate_tropflux.rst
r172 r174 130 130 131 131 tools : 132 - : ref:`TropFlux_swr_DT_19890101_20071231.pro`, :ref:`TropFlux_swr_NRT_19890101_20091231.pro`, :ref:`TropFlux_swr_BLND_19890101_20091231.pro`132 - :func:`tropflux_swr_dt`, :func:`tropflux_swr_nrt`, :func:`tropflux_swr_blnd` 133 133 - :ref:`lwr_correction_ncdf.pro` 134 134 - :ref:`q2m_correction_ncdf.pro` … … 147 147 148 148 tools : 149 - : ref:`cronin_gustiness_ncdf.pro`149 - :func:`cronin_gustiness_ncdf` 150 150 - :ref:`TropFlux_19890101_20091231.pro` (:func:`cor30a`), :ref:`TropFlux_NRT_ncdf.pro` 151 151 -
trunk/src/TropFlux_19890101_20091231.pro
r172 r174 36 36 ; ++ 37 37 ; has been produced by 38 ; : ref:`cronin_gustiness_ncdf.pro`.38 ; :func:`cronin_gustiness_ncdf`. 39 39 ; 40 40 ; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20091231_BLND.nc` … … 42 42 ; ws corrected on OAFLUX grid 43 43 ; has been produced by 44 ; : ref:`TropFlux_swr_BLND_19890101_20091231.pro`.44 ; :func:`tropflux_swr_blnd`. 45 45 ; 46 46 ; :file:`${PROJECT_OD}/TropFlux_lwr_19890101_20091231.nc` -
trunk/src/TropFlux_NRT_ncdf.pro
r100 r174 11 11 ; ws corrected on OAFLUX grid 12 12 ; has been produced by 13 ; : ref:`TropFlux_swr_BLND_19890101_20091231.pro`.13 ; :func:`tropflux_swr_blnd`. 14 14 ; 15 15 ; :file:`${PROJECT_OD}/TropFlux_lwr_19890101_20091231.nc` -
trunk/src/cronin_gustiness_ncdf.pro
- Property svn:keywords set to Id URL
r100 r174 1 1 ;+ 2 ;3 ; .. _cronin_gustiness_ncdf.pro:4 2 ; 5 3 ; ========================= … … 7 5 ; ========================= 8 6 ; 7 ; .. function:: cronin_gustiness_ncdf(yyyymmddb,yyyymmdde) 8 ; 9 ; DESCRIPTION 10 ; =========== 11 ; 9 12 ; Cronin gustiness correction on corrected sst on OAFLUX grid 10 13 ; … … 14 17 ; Cronin gustiness corrected ++ on corrected sst on OAFLUX grid 15 18 ; is written in 16 ; :file:`${PROJECT_OD}/TropFlux_gustiness_ 19890101_20091231.nc`19 ; :file:`${PROJECT_OD}/TropFlux_gustiness_{yyyymmdd}_{yyyymmdd}.nc` 17 20 ; if this file not already exists. 18 21 ; 19 22 ; This file will be used by 20 ; : ref:`TropFlux_swr_BLND_19890101_20091231.pro`23 ; :func:`tropflux_swr_blnd` 21 24 ; and 22 25 ; :ref:`TropFlux_19890101_20091231.pro`. … … 27 30 ; 28 31 ; file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc"]; 29 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_gustiness_ 19890101_20091231.nc"];32 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_gustiness_{yyyymmdd}_{yyyymmdd}.nc"]; 30 33 ; 31 34 ; cronin_gustiness_ncdf [shape=box, … … 43 46 ; :: 44 47 ; 45 ; IDL> cronin_gustiness_ncdf 48 ; IDL> yyyymmddb = 20000101L 49 ; IDL> yyyymmdde = 20001231L 50 ; IDL> result = cronin_gustiness_ncdf(yyyymmddb, yyyymmdde) 51 ; IDL> print, result 46 52 ; 47 53 ; SEE ALSO … … 61 67 ; ==== 62 68 ; 69 ; going on time parametrization 70 ; 63 71 ; coding rules 64 72 ; … … 78 86 ; 79 87 ; $URL$ 88 ; 89 ; - fplod 20120321 90 ; 91 ; * pro -> func 92 ; * taking project_overwite into account 80 93 ; 81 94 ; - fplod 20110830T140029Z cratos (Linux) … … 103 116 ; 104 117 ;- 105 pro cronin_gustiness_ncdf 118 function cronin_gustiness_ncdf $ 119 , yyyymmddb $ 120 , yyyymmdde 121 ; 122 ;++ compile_opt idl2, strictarrsubs, logical_predicate 106 123 ; 107 124 @cm_4cal … … 111 128 @cm_project 112 129 ; 130 ; Return to caller if errors 131 ON_ERROR, 2 132 ; 133 result = -1 134 ; 135 usage = 'result = tropflux_swr_nrt(yyyymmddb, yyyymmdde)' 136 nparam = N_PARAMS() 137 IF (nparam NE 2) THEN BEGIN 138 ras = report(['Incorrect number of arguments.' $ 139 + '!C' $ 140 + 'Usage : ' + usage]) 141 return, result 142 ENDIF 143 ; 113 144 ; test if ${PROJECT_OD} defined 114 145 CASE project_od_env OF … … 116 147 msg = 'eee : ${PROJECT_OD} is not defined' 117 148 ras = report(msg) 118 STOP149 return, result 119 150 END 120 151 ELSE: BEGIN … … 131 162 msg = 'eee : the directory' + iodirout + ' is not accessible.' 132 163 ras = report(msg) 133 STOP164 return, result 134 165 ENDIF 135 166 ; … … 138 169 msg = 'eee : the directory' + iodirout + ' was not found.' 139 170 ras = report(msg) 140 STOP171 return, result 141 172 ENDIF 142 173 ; … … 152 183 msg = 'eee : the file ' + fullfilename + ' was not found.' 153 184 ras = report(msg) 154 STOP185 return, result 155 186 ENDIF 156 187 ; 157 188 ; build output filename 158 filename_out = 'TropFlux_gustiness _19890101_20091231.nc'189 filename_out = 'TropFlux_gustiness' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 159 190 fullfilename_out = iodirout + filename_out 160 191 ; in order to avoid unexpected overwritten 161 IF ( FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN192 IF ((FILE_TEST(fullfilename_out) EQ 1) AND (project_overwrite EQ 0)) THEN BEGIN 162 193 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 163 194 ras = report(msg) 164 STOP195 return, result 165 196 ENDIF 166 197 ; … … 207 238 @ncdf_quickwrite 208 239 ; 240 result = 0 241 return, result 242 ; 209 243 end -
trunk/src/d2m_to_q2m_erai.pro
- Property svn:keywords set to Id URL
r173 r174 104 104 ; ==== 105 105 ; 106 ; compare time between d2m and t2m after reading 106 ; fix time pb:: 107 ; 108 ; % the time axis has no date before date 2: 20000302 109 ; d2m first date 29811221 110 ; d2m last date 29851224 111 ; 112 ; compare time between d2m and t2m and msl after reading 107 113 ; 108 114 ; pb on cratos idl7 even if output file is written:: … … 181 187 ; 182 188 ; Return to caller if errors 183 ON_ERROR, 2189 ;+++ ON_ERROR, 2 184 190 ; 185 191 result = -1 186 192 ; 187 usage = 'result = interp_erai_t2m(yyyymmddb, yyyymmdde)'193 usage = 'result = d2m_to_q2m_erai(yyyymmddb, yyyymmdde)' 188 194 nparam = N_PARAMS() 189 195 IF (nparam NE 2) THEN BEGIN … … 294 300 da=jul2date(time[jpt-1]) 295 301 cda1=string(da,format='(i8.8)') 296 print, 't2m first date ', cda0297 print, 't2m last date ' , cda1302 print, 't2m in d2m_to_q2m_erai first date ', cda0 303 print, 't2m in d2m_to_q2m_erai last date ' , cda1 298 304 299 305 help, t, td … … 314 320 initncdf, fullfilename_msl 315 321 P=read_ncdf("msl", yyyymmddb, yyyymmdde, file=fullfilename_msl,/nostr) 322 timein=24.d*(time-julday(1,1,1957,0,0,0)) 323 jpt=n_elements(timein) 324 da=jul2date(time[0]) 325 cda0=string(da,format='(i8.8)') 326 da=jul2date(time[jpt-1]) 327 cda1=string(da,format='(i8.8)') 328 print, 'msl in d2m_to_q2m_erai first date ', cda0 329 print, 'msl in d2m_to_q2m_erai last date ' , cda1 316 330 help, P 317 331 ; ++ for debug ftp error -
trunk/src/interp_erai_dewt.pro
r173 r174 291 291 da=jul2date(time[jpt-1]) 292 292 cda1=string(da,format='(i8.8)') 293 print, ' first date ', cda0294 print, ' last date ' , cda1293 print, 'dewt first date ', cda0 294 print, 'dewt last date ' , cda1 295 295 ; 296 296 tab=d2min[*,*,0] -
trunk/src/interp_erai_lwr.pro
r173 r174 81 81 ; 82 82 ; :: 83 ;84 83 ; IDL> .compile file_interp 85 84 ; IDL> yyyymmddb = 20000101L … … 91 90 ; ==== 92 91 ; 92 ; lwr first date 19991231 vs yyyymmddb = 20000101L 93 ; 93 94 ; make it work : pb on loholt1 idl8: 94 95 ; … … 111 112 ; 19890101 is not provided in ERA-Intermim file str : a possible workaround is to copy 19890102 112 113 ; dataset to 19890101 using nco after this processing. see :ref:`compute_erai_daily_region_2d.sh` 113 ;114 ; st and en not used115 114 ; 116 115 ; check if there is the same issue with 19790101 vs 19790102. … … 314 313 da=jul2date(time[jpt-1]) 315 314 cda1=string(da,format='(i8.8)') 316 print, ' first date ', cda0317 print, 'l ast date ' , cda1315 print, 'lwr first date ', cda0 316 print, 'lwr last date ' , cda1 318 317 ; 319 318 initncdf, fullfilename -
trunk/src/interp_erai_msl.pro
r173 r174 272 272 da=jul2date(time[jpt-1]) 273 273 cda1=string(da,format='(i8.8)') 274 print, ' first date ', cda0275 print, ' last date ' , cda1274 print, 'msl first date ', cda0 275 print, 'msl last date ' , cda1 276 276 ; 277 277 tab=mslin[*,*,0] -
trunk/src/interp_erai_sst.pro
r173 r174 281 281 da=jul2date(time[jpt-1]) 282 282 cda1=string(da,format='(i8.8)') 283 print, ' first date ', cda0284 print, ' last date ' , cda1283 print, 'sst first date ', cda0 284 print, 'sst last date ' , cda1 285 285 ; 286 286 tab=sstkin[*,*,0] -
trunk/src/interp_erai_t2m.pro
r173 r174 386 386 da=jul2date(time[jpt-1]) 387 387 cda1=string(da,format='(i8.8)') 388 print, ' first date ', cda0389 print, ' last date ' , cda1388 print, 't2m first date ', cda0 389 print, 't2m last date ' , cda1 390 390 help, t2min 391 391 ; -
trunk/src/interp_olr_30n30s.pro
r173 r174 25 25 ; 26 26 ; This output file will be used by 27 ; : ref:`TropFlux_swr_NRT_19890101_20091231.pro`.27 ; :func:`tropflux_swr_nrt`. 28 28 ; 29 29 ; .. graphviz:: … … 79 79 ; ==== 80 80 ; 81 ; hard coded attributes for time origine 82 ; 81 83 ; how can we avoid this message :: 82 84 ; … … 114 116 ; 115 117 ; $URL$ 118 ; 119 ; - fplod 20120321 120 ; 121 ; * add timerange in global attributes 122 ; * change time origne 1950 -> 1957 to homogenize wih others fields 116 123 ; 117 124 ; - fplod 20120320 … … 262 269 olrin=read_ncdf("olr",yyyymmddb-.5d,yyyymmdde, file=fullfilename,/nostr) 263 270 ; 264 timein=time 265 jptin=jpt 271 timein=24.d*(time-julday(1,1,1957,0,0,0)) 272 jptin=n_elements(timein) 273 da=jul2date(time[0]) 274 cda0=string(da,format='(i8.8)') 275 da=jul2date(time[jptin-1]) 276 cda1=string(da,format='(i8.8)') 277 print, 'olr first date ', cda0 278 print, 'olr last date ' , cda1 279 266 280 mskin=glamt*0.+1. 267 281 ; … … 290 304 endfor 291 305 ; 292 timein=timein-julday(1,1,1950,00,00)293 ;294 306 lat=latout 295 307 lon=lonout … … 297 309 lon_attr={units:'degrees_east',long_name:'Longitude'} 298 310 lat_attr={units:'degrees_north',long_name:'Latitude'} 299 time_attr={units:'days since 195 0-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'}300 globattr={source:'NOAA OLR, cf http://www.cdc.noaa.gov/cdc/data.interp_OLR.html, interpolated to 1x1 degree grid and with oaflux mask' }311 time_attr={units:'days since 1957-01-01 00:00:00',long_name:'Time axis',time_origin:'1957-JAN-01 00:00:00'} 312 globattr={source:'NOAA OLR, cf http://www.cdc.noaa.gov/cdc/data.interp_OLR.html, interpolated to 1x1 degree grid and with oaflux mask', timerange:cda0+' - '+cda1} 301 313 olr_attr={units:'w/m^2',missing_value:1e20,long_name:'Outgoing Longwave Radiation',short_name:'olr',axis:'TYX'} 302 314 ; -
trunk/src/paper01/fig13/net_flux_validation_scatter_2000_2007.pro
r99 r174 11 11 ; This program will create the text files with statistics of respective variables 12 12 ; 13 ; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20071231_DT.nc` 13 ; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20071231_DT.nc` ++dates 14 14 ; containing ++ 15 15 ; has been produced by 16 ; : ref:`TropFlux_swr_DT_19890101_20071231.pro`.16 ; :func:`tropflux_swr_dt`. 17 17 ; 18 18 ; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20091231_NRT.nc` 19 19 ; containing ++ 20 20 ; has been produced by 21 ; : ref:`TropFlux_swr_NRT_19890101_20091231.pro`.21 ; :func:`tropflux_swr_nrt`. 22 22 ; 23 23 ; :file:`${PROJECT_OD}/TropFlux_19890101_20091231.nc` -
trunk/src/sst_correction_ncdf.pro
r173 r174 23 23 ; :file:`${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc` 24 24 ; will be used by 25 ; : ref:`cronin_gustiness_ncdf.pro`25 ; :func:`cronin_gustiness_ncdf` 26 26 ; and 27 27 ; :ref:`TropFlux_19890101_20091231.pro`. -
trunk/src/tropflux.sh
r172 r174 114 114 # 115 115 # $URL$ 116 # 117 # - pinsard 20120321 118 # 119 # * TropFlux_swr_DT_19890101_20071231 replace by tropflux_swr_dt 120 # which is now a function 121 # * TropFlux_swr_NRT_19890101_20071231 replace by tropflux_swr_nrt 122 # which is now a function 123 # * TropFlux_swr_BLND_19890101_20071231 replace by tropflux_swr_blnd 124 # which is now a function 125 # * corrrection of messages when return badly 126 # * reorder for gustiness before tropflux_swr_blnd 127 # * cronin_gustiness_ncdf is now a function 116 128 # 117 129 # - pinsard 20120320 … … 304 316 result = oaflux_mask_30n30s() 305 317 IF result < 0 THEN BEGIN 306 msg = 'eee : pb after oaflux_mask_30n30s ' + string(result)318 msg = 'eee : pb after oaflux_mask_30n30s ' + string(result) 307 319 err = report(msg) 308 320 exit … … 310 322 result = interp_erai_dewt(${yyyymmddb}, ${yyyymmdde}) 311 323 IF result < 0 THEN BEGIN 312 msg = 'eee : pb after interp_erai_dewt ' + string(result)324 msg = 'eee : pb after interp_erai_dewt ' + string(result) 313 325 err = report(msg) 314 326 exit … … 316 328 result = interp_erai_lwr(${yyyymmddb}, ${yyyymmdde}) 317 329 IF result < 0 THEN BEGIN 318 msg = 'eee : pb after interp_erai_lwr ' + string(result)330 msg = 'eee : pb after interp_erai_lwr ' + string(result) 319 331 err = report(msg) 320 332 exit … … 322 334 result = interp_erai_msl(${yyyymmddb}, ${yyyymmdde}) 323 335 IF result < 0 THEN BEGIN 324 msg = 'eee : pb after interp_erai_msl ' + string(result)336 msg = 'eee : pb after interp_erai_msl ' + string(result) 325 337 err = report(msg) 326 338 exit … … 328 340 result = interp_erai_sst(${yyyymmddb}, ${yyyymmdde}) 329 341 IF result < 0 THEN BEGIN 330 msg = 'eee : pb after interp_erai_ t2m' + string(result)342 msg = 'eee : pb after interp_erai_sst ' + string(result) 331 343 err = report(msg) 332 344 exit … … 334 346 result = interp_erai_t2m(${yyyymmddb}, ${yyyymmdde}) 335 347 IF result < 0 THEN BEGIN 336 msg = 'eee : pb after interp_erai_t2m ' + string(result)348 msg = 'eee : pb after interp_erai_t2m ' + string(result) 337 349 err = report(msg) 338 350 exit … … 340 352 result = interp_erai_ws(${yyyymmddb}, ${yyyymmdde}) 341 353 IF result < 0 THEN BEGIN 342 msg = 'eee : pb after interp_erai_ t2m' + string(result)354 msg = 'eee : pb after interp_erai_ws ' + string(result) 343 355 err = report(msg) 344 356 exit … … 346 358 result = interp_olr_30n30s(${yyyymmddb}, ${yyyymmdde}) 347 359 IF result < 0 THEN BEGIN 348 msg = 'eee : pb after interp_ erai_t2m' + string(result)360 msg = 'eee : pb after interp_olr_30n30s ' + string(result) 349 361 err = report(msg) 350 362 exit … … 352 364 result = d2m_to_q2m_erai(${yyyymmddb}, ${yyyymmdde}) 353 365 IF result < 0 THEN BEGIN 354 msg = 'eee : pb after interp_erai_t2m' + string(result) 355 err = report(msg) 356 exit 357 ENDIF 358 ;++Program caused arithmetic error: Floating overflow 359 ;++ Program caused arithmetic error: Floating illegal operand 360 ;.compile TropFlux_swr_DT_19890101_20071231 361 ;tropflux_swr_dt_19890101_20071231 362 ;.compile TropFlux_swr_NRT_19890101_20091231 363 ;tropflux_swr_nrt_19890101_20091231 364 ;.compile TropFlux_swr_BLND_19890101_20091231 365 ;tropflux_swr_blnd_19890101_20091231 366 msg = 'eee : pb after d2m_to_q2m_erai ' + string(result) 367 err = report(msg) 368 ;++Program caused arithmetic error: Floating overflow 369 ;++ Program caused arithmetic error: Floating illegal operand 370 ;++exit 371 ENDIF 372 result = tropflux_swr_dt(${yyyymmddb}, ${yyyymmdde}) 373 IF result < 0 THEN BEGIN 374 msg = 'eee : pb after tropflux_swr_dt ' + string(result) 375 err = report(msg) 376 exit 377 ENDIF 378 result = tropflux_swr_nrt(${yyyymmddb}, ${yyyymmdde}) 379 IF result < 0 THEN BEGIN 380 msg = 'eee : pb after tropflux_swr_nrt ' + string(result) 381 err = report(msg) 382 exit 383 ENDIF 384 ;sst_correction_ncdf 385 result = cronin_gustiness_ncdf(${yyyymmddb}, ${yyyymmdde}) 386 IF result < 0 THEN BEGIN 387 msg = 'eee : pb after cronin_gustiness_ncdf ' + string(result) 388 err = report(msg) 389 exit 390 result = tropflux_swr_blnd(${yyyymmddb}, ${yyyymmdde}) 391 IF result < 0 THEN BEGIN 392 msg = 'eee : pb after tropflux_swr_blnd ' + string(result) 393 err = report(msg) 394 exit 366 395 ;lwr_correction_ncdf 367 396 ;q2m_correction_ncdf 368 ;sst_correction_ncdf369 397 ;t2m_correction_ncdf 370 398 ;ws_correction_ncdf 371 ;cronin_gustiness_ncdf372 399 ;.compile TropFlux_19890101_20091231 373 400 ;tropflux_19890101_20091231 -
trunk/src/tropflux_swr_blnd.pro
r170 r174 1 1 ;+ 2 2 ; 3 ; .. _TropFlux_swr_BLND_19890101_20091231.pro:4 ; 5 ; ===================== ==================6 ; TropFlux_swr_BLND_19890101_20091231.pro7 ; =======================================3 ; ===================== 4 ; tropflux_swr_blnd.pro 5 ; ===================== 6 ; 7 ; .. function:: tropflux_swr_blnd(yyyymmddb,yyyymmdde) 8 8 ; 9 9 ; DESCRIPTION 10 10 ; =========== 11 11 ; 12 ; :file:`${PROJECT_OD}/TropFlux_swr_ 19890101_20071231_DT.nc`12 ; :file:`${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_DT.nc` 13 13 ; containing ++ 14 14 ; has been produced by 15 ; : ref:`TropFlux_swr_DT_19890101_20071231.pro`.16 ; 17 ; :file:`${PROJECT_OD}/TropFlux_swr_ 19890101_20091231_NRT.nc`15 ; :func:`tropflux_swr_dt`. 16 ; 17 ; :file:`${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_NRT.nc` 18 18 ; containing ++ 19 19 ; has been produced by 20 ; : ref:`TropFlux_swr_NRT_19890101_20091231.pro`.21 ; 22 ; :file:`${PROJECT_OD}/TropFlux_gustiness_ 19890101_20091231.nc` containing ++20 ; :func:`tropflux_swr_nrt`. 21 ; 22 ; :file:`${PROJECT_OD}/TropFlux_gustiness_{yyyymmdd}_{yyyymmdd}.nc` containing ++ 23 23 ; has been produced by 24 ; : ref:` cronin_gustiness_ncdf.pro`.24 ; :func:`cronin_gustiness_ncdf`. 25 25 ; 26 26 ; ++ are written 27 ; in :file:`${PROJECT_OD}/TropFlux_swr_ 19890101_20091231_BLND.nc`27 ; in :file:`${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_BLND.nc` 28 28 ; if this file not already exists. 29 29 ; … … 33 33 ; .. graphviz:: 34 34 ; 35 ; digraph tropflux_swr_blnd _19890101_20091231{36 ; 37 ; file_dt [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_ 19890101_20071231_DT.nc"];38 ; file_nrt [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_ 19890101_20091231_NRT.nc"];39 ; file_gustiness [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_gustiness_ 19890101_20091231.nc"];40 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_ 19890101_20091231_blnd.nc"];41 ; 42 ; tropflux_swr_blnd _19890101_20091231[shape=box,35 ; digraph tropflux_swr_blnd { 36 ; 37 ; file_dt [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_DT.nc"]; 38 ; file_nrt [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_NRT.nc"]; 39 ; file_gustiness [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_gustiness_{yyyymmdd}_{yyyymmdd}.nc"]; 40 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_blnd.nc"]; 41 ; 42 ; tropflux_swr_blnd [shape=box, 43 43 ; fontname=Courier, 44 44 ; color=blue, 45 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/ TropFlux_swr_BLND_19890101_20091231.pro",46 ; label="${PROJECT}/src/ TropFlux_swr_BLND_19890101_20091231.pro"];47 ; 48 ; {file_dt file_nrt file_gustiness} -> {tropflux_swr_blnd _19890101_20091231} -> {file_out}45 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/tropflux_swr_blnd.pro", 46 ; label="${PROJECT}/src/tropflux_swr_blnd.pro"]; 47 ; 48 ; {file_dt file_nrt file_gustiness} -> {tropflux_swr_blnd} -> {file_out} 49 49 ; 50 50 ; } … … 71 71 ; :: 72 72 ; 73 ; IDL> .compile TropFlux_swr_BLND_19890101_20091231 74 ; IDL> tropflux_swr_blnd_19890101_20091231 73 ; IDL> yyyymmddb = 20000101L 74 ; IDL> yyyymmdde = 20001231L 75 ; IDL> result = tropflux_swr_blnd(yyyymmddb, yyyymmdde) 76 ; IDL> print, result 75 77 ; 76 78 ; TODO 77 79 ; ==== 78 80 ; 81 ; handling date > 20071231 82 ; 83 ; read_ncdf usage of yyyymmddb yyyymmdde 84 ; 85 ; get rid of timegen 86 ; 79 87 ; submit read_ncdf with 19890101 pb to saxo-dev 80 88 ; 81 ; avoid mix lower/uppercase in pro name to avoid compile82 ;83 89 ; coding rules 84 90 ; … … 90 96 ; 91 97 ; according to pk 20110811 we can include this process in 92 ; TropFlux_swr_NRT_19890101_20091231.pro ... later98 ; tropflux_swr_nrt.pro ... later 93 99 ; 94 100 ; KNOWN ISSUES … … 101 107 ; ========== 102 108 ; 103 ; $Id: TropFlux_swr_BLND_19890101_20091231.pro 88 2011-08-19 15:40:14Z pinsard $109 ; $Id: tropflux_swr_blnd.pro 88 2011-08-19 15:40:14Z pinsard $ 104 110 ; 105 111 ; $URL$ 112 ; 113 ; - fplod 20120321 114 ; 115 ; * pro -> func 116 ; * rename with lower case TropFlux_swr_BLND_19890101_20091231.pro become 117 ; tropflux_swr_blnd.pro 118 ; * taking project_overwite into account 106 119 ; 107 120 ; - fplod 20110819T120412Z aedon.locean-ipsl.upmc.fr (Darwin) … … 119 132 ; 120 133 ; problably because 6938+731=7669 and not 7670 when 121 ; :samp:`dt=read_ncdf( "swr", 19890101, 20071231, file=fullfilename_dt,/nostr)`134 ; :samp:`dt=read_ncdf('swr', 19890101, 20071231, file=fullfilename_dt,/nostr)` 122 135 ; was used :: 123 136 ; … … 142 155 ; 143 156 ; IDL> fullfilename_dt='TropFlux_swr_19890101_20071231_DT.nc' 144 ; IDL> dt=read_ncdf( "swr", 19890100, 20071231, file=fullfilename_dt,/nostr)157 ; IDL> dt=read_ncdf('swr', 19890100, 20071231, file=fullfilename_dt,/nostr) 145 158 ; IDL> print, 'first time step (should crash with invalid date)', jul2date(time[0]) 146 159 ; first time step (should be 19890101) 19890101. 147 ; IDL> dt=read_ncdf( "swr", 19890101, 20071231, file=fullfilename_dt,/nostr)160 ; IDL> dt=read_ncdf('swr', 19890101, 20071231, file=fullfilename_dt,/nostr) 148 161 ; IDL> print, 'first time step (should be 19890101)', jul2date(time[0]) 149 162 ; first time step (should be 19890101) 19890102. … … 170 183 ; 171 184 ;- 172 pro TropFlux_swr_BLND_19890101_20091231 185 function tropflux_swr_blnd $ 186 , yyyymmddb $ 187 , yyyymmdde 188 ; 189 compile_opt idl2, strictarrsubs, logical_predicate 173 190 ; 174 191 @cm_4cal … … 178 195 @cm_project 179 196 ; 197 ; Return to caller if errors 198 ON_ERROR, 2 199 ; 200 result = -1 201 ; 202 usage = 'result = tropflux_swr_blnd(yyyymmddb, yyyymmdde)' 203 nparam = N_PARAMS() 204 IF (nparam NE 2) THEN BEGIN 205 ras = report(['Incorrect number of arguments.' $ 206 + '!C' $ 207 + 'Usage : ' + usage]) 208 return, result 209 ENDIF 210 ; 180 211 ; test if ${PROJECT_OD} defined 181 212 CASE project_od_env OF … … 183 214 msg = 'eee : ${PROJECT_OD} is not defined' 184 215 ras = report(msg) 185 STOP216 return, result 186 217 END 187 218 ELSE: BEGIN … … 198 229 msg = 'eee : the directory' + iodirout + ' is not accessible.' 199 230 ras = report(msg) 200 STOP231 return, result 201 232 ENDIF 202 233 ; … … 205 236 msg = 'eee : the directory' + iodirout + ' was not found.' 206 237 ras = report(msg) 207 STOP238 return, result 208 239 ENDIF 209 240 ; 210 241 ; build dt data filename 211 filename_dt= "TropFlux_swr_19890101_20071231_DT.nc"242 filename_dt='TropFlux_swr_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_DT.nc' 212 243 ; 213 244 ; check if this file exists … … 218 249 msg = 'eee : the file ' + fullfilename_dt + ' was not found.' 219 250 ras = report(msg) 220 STOP251 return, result 221 252 ENDIF 222 253 ; 223 254 ; build nrt data filename 224 filename_nrt= "TropFlux_swr_19890101_20091231_NRT.nc"255 filename_nrt='TropFlux_swr_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_NRT.nc' 225 256 ; 226 257 ; check if this file exists … … 231 262 msg = 'eee : the file ' + fullfilename_nrt + ' was not found.' 232 263 ras = report(msg) 233 STOP264 return, result 234 265 ENDIF 235 266 ; 236 267 ; build wg data filename 237 filename_wg= "TropFlux_gustiness_19890101_20091231.nc"268 filename_wg='TropFlux_gustiness_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 238 269 ; 239 270 ; check if this file exists … … 244 275 msg = 'eee : the file ' + fullfilename_wg + ' was not found.' 245 276 ras = report(msg) 246 STOP277 return, result 247 278 ENDIF 248 279 ; 249 280 ; build output filename 250 filename_out = 'TropFlux_swr_ 19890101_20091231_BLND.nc'281 filename_out = 'TropFlux_swr_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_BLND.nc' 251 282 fullfilename_out = iodirout + filename_out 252 283 ; in order to avoid unexpected overwritten 253 IF ( FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN284 IF ((FILE_TEST(fullfilename_out) EQ 1) AND (project_overwrite EQ 0)) THEN BEGIN 254 285 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 255 286 ras = report(msg) 256 STOP287 return, result 257 288 ENDIF 258 289 ; 259 290 initncdf, fullfilename_dt 260 dt=read_ncdf( "swr", 19890100, 20071231, file=fullfilename_dt,/nostr)291 dt=read_ncdf('swr', 19890100, 20071231, file=fullfilename_dt,/nostr) 261 292 print, 'www : should crash with invalide date 19890100' 262 293 help, dt … … 265 296 ; 266 297 initncdf, fullfilename_nrt 267 nrt=read_ncdf( "sw", 20080100, 20100112, file=fullfilename_nrt,/nostr)298 nrt=read_ncdf('sw', 20080100, 20100112, file=fullfilename_nrt,/nostr) 268 299 help, nrt 269 300 ; 270 swr_nrt=read_ncdf( "sw", 19880101, 20100112, file=fullfilename_nrt,/nostr)301 swr_nrt=read_ncdf('sw', 19880101, 20100112, file=fullfilename_nrt,/nostr) 271 302 ; 272 303 swr_dt=[[[dt]],[[nrt]]] … … 281 312 a=((a > 0.) < 1.) 282 313 for jt=0,jpt-1 do begin 283 swr_merged (*,*,jt)=swr_dt(*,*,jt)*a(jt)+(1-a(jt))*swr_nrt(*,*,jt)314 swr_merged[*,*,jt]=swr_dt[*,*,jt]*a[jt]+(1-a[jt])*swr_nrt[*,*,jt] 284 315 endfor 285 316 ; … … 287 318 time=timegen(7670, units='days', start=julday(1,1,1989,0)) 288 319 jpt=n_elements(time) 289 lat=reform(gphit (0,0:jpj-1))290 lon=reform(glamt (0:jpi-1,0))291 cda0=string(jul2date(time (0)),format='(i8.8)')292 cda1=string(jul2date(time (jpt-1)),format='(i8.8)')320 lat=reform(gphit[0,0:jpj-1]) 321 lon=reform(glamt[0:jpi-1,0]) 322 cda0=string(jul2date(time[0]),format='(i8.8)') 323 cda1=string(jul2date(time[jpt-1]),format='(i8.8)') 293 324 ; 294 325 time=time-julday(1,1,1950,00,00) -
trunk/src/tropflux_swr_dt.pro
r170 r174 1 1 ;+ 2 2 ; 3 ; .. _TropFlux_swr_DT_19890101_20071231.pro:4 ; 5 ; =================== ==================6 ; TropFlux_swr_DT_19890101_20071231.pro7 ; =====================================3 ; =================== 4 ; tropflux_swr_dt.pro 5 ; =================== 6 ; 7 ; .. function:: tropflux_swr_dt(yyyymmddb,yyyymmdde) 8 8 ; 9 9 ; DESCRIPTION … … 17 17 ; Corrected swr delay on OAFLUX grid 18 18 ; is written in 19 ; :file:`${PROJECT_OD}/TropFlux_swr_ 19890101_20071231_DT.nc`19 ; :file:`${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_DT.nc` 20 20 ; if this file not already exists. 21 21 ; 22 ; This file will be used by23 ; :ref:`TropFlux_swr_BLND_19890101_20091231.pro`.24 ;25 22 ; .. graphviz:: 26 23 ; 27 ; digraph tropflux_swr_dt _19890101_20071231{24 ; digraph tropflux_swr_dt { 28 25 ; 29 26 ; file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/swr_oafluxgrid_1985_2007.nc"]; 30 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_ 19890101_20071231_DT.nc"];31 ; 32 ; tropflux_swr_dt _19890101_20071231[shape=box,27 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_DT.nc"]; 28 ; 29 ; tropflux_swr_dt [shape=box, 33 30 ; fontname=Courier, 34 31 ; color=blue, 35 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/ TropFlux_swr_DT_19890101_20071231.pro",36 ; label="${PROJECT}/src/ TropFlux_swr_DT_19890101_20071231.pro"];37 ; 38 ; {file_in}-> {tropflux_swr_dt _19890101_20071231} -> {file_out}32 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/tropflux_swr_dt.pro", 33 ; label="${PROJECT}/src/tropflux_swr_dt.pro"]; 34 ; 35 ; {file_in}-> {tropflux_swr_dt} -> {file_out} 39 36 ; 40 37 ; } … … 43 40 ; ======== 44 41 ; 42 ; :ref:`mooring_corrections` 43 ; 44 ; Used by :ref:`tropflux.sh` 45 ; 45 46 ; :ref:`project_profile.sh` 46 ;47 ; :ref:`mooring_corrections`48 47 ; 49 48 ; :ref:`data_in_swr` … … 61 60 ; :: 62 61 ; 63 ; IDL> .compile TropFlux_swr_DT_19890101_20071231 64 ; IDL> tropflux_swr_dt_19890101_20071231 62 ; IDL> yyyymmddb = 20000101L 63 ; IDL> yyyymmdde = 20001231L 64 ; IDL> result = tropflux_swr_dt(yyyymmddb, yyyymmdde) 65 ; IDL> print, result 65 66 ; 66 67 ; TODO 67 68 ; ==== 68 69 ; 70 ; handlind yyyymmdde > 20071231 71 ; 72 ; first date 19991231 vs yyyymmddb = 20000101L 73 ; 69 74 ; NaNf values in ouptut file while 1.e20 in input file !! 70 75 ; 71 76 ; coding rules 72 ;73 ; why compile is needed ? uppercase in file name74 ;75 ; any way change the name to swr_dt_correction_ndcf.pro76 ; to homogenize names of tools77 77 ; 78 78 ; use the output of concat_swr.sh to be written. 79 79 ; now use swr_oafluxgrid_1985_2007.nc provided by pk 20110811 80 ; stored in :file:`cratos:/usr/lodyc/incas/fplod/tropflux_d/from_pk/stage_0/swr_oafluxgrid_1985_2007.nc` 80 81 ; 81 82 ; KNOWN ISSUES … … 88 89 ; ========== 89 90 ; 90 ; $Id: TropFlux_swr_DT_19890101_20071231.pro 88 2011-08-19 15:40:14Z pinsard $91 ; $Id: tropflux_swr_dt.pro 88 2011-08-19 15:40:14Z pinsard $ 91 92 ; 92 93 ; $URL$ 94 ; 95 ; - fplod 20120321 96 ; 97 ; * pro -> func 98 ; * rename with lower case TropFlux_swr_DT_19890101_20071231.pro become 99 ; tropflux_swr_dt.pro 100 ; * taking project_overwite into account 101 ; * try to add compile_opt seems to be incompatible with ncdf_quickwrite 102 ; * start to homogenize time handling and netcdf writing 93 103 ; 94 104 ; - fplod 20110830T135743Z cratos (Linux) … … 115 125 ; 116 126 ;- 117 pro TropFlux_swr_DT_19890101_20071231 127 function tropflux_swr_dt $ 128 , yyyymmddb $ 129 , yyyymmdde 130 ; 131 ;++compile_opt idl2, strictarrsubs, logical_predicate 118 132 ; 119 133 @cm_4cal … … 123 137 @cm_project 124 138 ; 139 ; Return to caller if errors 140 ON_ERROR, 2 141 ; 142 result = -1 143 ; 144 usage = 'result = tropflux_swr_dt(yyyymmddb, yyyymmdde)' 145 nparam = N_PARAMS() 146 IF (nparam NE 2) THEN BEGIN 147 ras = report(['Incorrect number of arguments.' $ 148 + '!C' $ 149 + 'Usage : ' + usage]) 150 return, result 151 ENDIF 152 125 153 ; test if ${PROJECT_OD} defined 126 154 CASE project_od_env OF … … 128 156 msg = 'eee : ${PROJECT_OD} is not defined' 129 157 ras = report(msg) 130 STOP158 return, result 131 159 END 132 160 ELSE: BEGIN … … 143 171 msg = 'eee : the directory' + iodirout + ' is not accessible.' 144 172 ras = report(msg) 145 STOP173 return, result 146 174 ENDIF 147 175 ; … … 150 178 msg = 'eee : the directory' + iodirout + ' was not found.' 151 179 ras = report(msg) 152 STOP180 return, result 153 181 ENDIF 154 182 ; … … 163 191 msg = 'eee : the file ' + fullfilename + ' was not found.' 164 192 ras = report(msg) 165 STOP193 return, result 166 194 ENDIF 167 195 ; 168 196 ; build output filename 169 filename_out = 'TropFlux_swr_ 19890101_20071231_DT.nc'197 filename_out = 'TropFlux_swr_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_DT.nc' 170 198 fullfilename_out = iodirout + filename_out 171 199 ; in order to avoid unexpected overwritten 172 IF ( FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN200 IF ((FILE_TEST(fullfilename_out) EQ 1) AND (project_overwrite EQ 0)) THEN BEGIN 173 201 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 174 202 ras = report(msg) 175 STOP203 return, result 176 204 ENDIF 177 205 ; 178 206 initncdf, filename 179 207 ; 180 sw=read_ncdf("swr", 19890101, 20071231, file=filename,/nostr) 208 sw=read_ncdf("swr", yyyymmddb-.5d,yyyymmdde, file=filename,/nostr) 209 timein=24.d*(time-julday(1,1,1957,0,0,0)) 210 jptin=n_elements(timein) 211 da=jul2date(time[0]) 212 cda0=string(da,format='(i8.8)') 213 da=jul2date(time[jptin-1]) 214 cda1=string(da,format='(i8.8)') 215 print, 'first date ', cda0 216 print, 'last date ' , cda1 181 217 help, sw 182 218 ; … … 190 226 ; 191 227 for jt=0,jpt-1 do begin 192 jtt=(time (jt)-julday(1,1,yea(jt))) < 364193 swr=reform(sw_mean (*,*))194 sw_m (*,*,jt)=swr195 sw_bias (*,*,jt)=(((swr-295.4)*18.36/(200.-295.4)) > 0.) < 18.37228 jtt=(time[jt]-julday(1,1,yea[jt])) < 364 229 swr=reform(sw_mean[*,*]) 230 sw_m[*,*,jt]=swr 231 sw_bias[*,*,jt]=(((swr-295.4)*18.36/(200.-295.4)) > 0.) < 18.37 196 232 endfor 197 233 ; … … 203 239 ; 204 240 ; writing field 205 cda0=string(jul2date(time (0)),format='(i8.8)')206 cda1=string(jul2date(time (jpt-1)),format='(i8.8)')207 ; 208 lat=reform(gphit (0,0:jpj-1))209 lon=reform(glamt (0:jpi-1,0))241 cda0=string(jul2date(time[0]),format='(i8.8)') 242 cda1=string(jul2date(time[jpt-1]),format='(i8.8)') 243 ; 244 lat=reform(gphit[0,0:jpj-1]) 245 lon=reform(glamt[0:jpi-1,0]) 210 246 time=time-julday(1,1,1950) 211 247 jpt=n_elements(time) … … 218 254 sw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Shortwave Radiation',short_name:'swr',axis:'TYX'} 219 255 ; 220 ncfields = 'swr[longitude,latitude, time]=swr:sw_attr; ' $256 ncfields = 'swr[longitude,latitude,*time]=swr:sw_attr; ' $ 221 257 + 'longitude[]=lon:lon_attr; ' $ 222 258 + 'latitude[]=lat:lat_attr; ' $ 223 + 'time[ *time]=time:time_attr ' $259 + 'time[]=timein:time_attr ' $ 224 260 + ' @ globattr' 225 261 ; 226 262 @ncdf_quickwrite 227 263 ; 264 result = 0 265 return, result 266 ; 228 267 end -
trunk/src/tropflux_swr_nrt.pro
r170 r174 1 1 ;+ 2 2 ; 3 ; .. _TropFlux_swr_NRT_19890101_20091231.pro:4 ; 5 ; ==================== ==================6 ; TropFlux_swr_NRT_19890101_20091231.pro7 ; ======================================3 ; ==================== 4 ; tropflux_swr_nrt.pro 5 ; ==================== 6 ; 7 ; .. function:: tropflux_swr_nrt(yyyymmddb,yyyymmdde) 8 8 ; 9 9 ; DESCRITION … … 12 12 ; Correction of swr near real time on OAFLUX grid 13 13 ; 14 ; :file:`${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_DT.nc` 15 ; containing 14 16 ; Corrected swr delay on OAFLUX grid 15 17 ; has been produced by 16 ; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20071231_DT.nc` 17 ; 18 ; :file:`${PROJECT_OD}/olr_oafluxgrid_30n30s_19890101_20091231.nc` 19 ; have been produced ++by pk 18 ; :func:`tropflux_swr_dt`. 19 ; 20 ; :file:`${PROJECT_OD}/olr_oafluxgrid_30n30s_{yyyymmdd}_{yyyymmdd}.nc` 21 ; have been produced 22 ; :func:`interp_olr_30n30s`. 20 23 ; 21 24 ; Corrected swr near real time on OAFLUX grid 22 25 ; ; is written in 23 ; :file:`${PROJECT_OD}/TropFlux_swr_ 19890101_20091231_NRT.nc`26 ; :file:`${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_NRT.nc` 24 27 ; if this file not already exists. 25 28 ; 26 ; This file will be used by27 ; :ref:`TropFlux_swr_BLND_19890101_20091231.pro`.28 ;29 29 ; .. graphviz:: 30 30 ; 31 ; digraph tropflux_swr_nrt _19890101_200912311{32 ; 33 ; file_swr_dt [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_ 19890101_20071231_DT.nc"];34 ; file_olr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/olr_oafluxgrid_30n30s_ 19890101_20091231.nc"];35 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_ 19890101_20091231_NRT.nc"];36 ; 37 ; tropflux_swr_nrt _19890101_200912311[shape=box,31 ; digraph tropflux_swr_nrt { 32 ; 33 ; file_swr_dt [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_DT.nc"]; 34 ; file_olr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/olr_oafluxgrid_30n30s_{yyyymmdd}_{yyyymmdd}.nc"]; 35 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_NRT.nc"]; 36 ; 37 ; tropflux_swr_nrt [shape=box, 38 38 ; fontname=Courier, 39 39 ; color=blue, 40 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/ TropFlux_swr_NRT_19890101_200912311.pro",41 ; label="${PROJECT}/src/ TropFlux_swr_NRT_19890101_200912311.pro"];42 ; 43 ; {file_swr_dt file_olr}-> {tropflux_swr_nrt _19890101_200912311} -> {file_out}40 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/tropflux_swr_nrt.pro", 41 ; label="${PROJECT}/src/tropflux_swr_nrt.pro"]; 42 ; 43 ; {file_swr_dt file_olr}-> {tropflux_swr_nrt} -> {file_out} 44 44 ; } 45 45 ; … … 64 64 ; :: 65 65 ; 66 ; IDL> .compile TropFlux_swr_NRT_19890101_20091231 67 ; IDL> tropflux_swr_nrt_19890101_20091231 66 ; IDL> yyyymmddb = 20000101L 67 ; IDL> yyyymmdde = 20001231L 68 ; IDL> result = tropflux_swr_nrt(yyyymmddb, yyyymmdde) 69 ; IDL> print, result 68 70 ; 69 71 ; TODO 70 72 ; ==== 71 73 ; 74 ; handlind yyyymmdde > 20071231 75 ; 72 76 ; remove NaNf values in ouptut file (may be not because of this module) 73 77 ; … … 75 79 ; 76 80 ; coding rules 77 ;78 ; why compile is needed ? uppercase in file name79 ;80 ; change the name to swr_nrt_correction_ncdf.pro81 ; to homogenize names of tools82 81 ; 83 82 ; KNOWN ISSUES … … 90 89 ; ========== 91 90 ; 92 ; $Id: TropFlux_swr_NRT_19890101_20091231.pro 88 2011-08-19 15:40:14Z pinsard $91 ; $Id: tropflux_swr_nrt.pro 88 2011-08-19 15:40:14Z pinsard $ 93 92 ; 94 93 ; $URL$ 95 94 ; 95 ; - fplod 20120321 96 ; 97 ; * pro -> func 98 ; * rename with lower case TropFlux_swr_NRT_19890101_20091231.pro become 99 ; tropflux_swr_nrt.pro 100 ; * taking project_overwite into account 101 ; * try to add compile_opt seems to be incompatible with ncdf_quickwrite 102 ; 96 103 ; - fplod 20110830T135938Z cratos (Linux) 97 104 ; 98 105 ; * replace tt by time 99 ; * fill empty time_origin :wq106 ; * fill empty time_origin 100 107 ; 101 108 ; - fplod 20110812T075406Z aedon.locean-ipsl.upmc.fr (Darwin) … … 118 125 ; 119 126 ;- 120 pro TropFlux_swr_NRT_19890101_20091231 127 function tropflux_swr_nrt $ 128 , yyyymmddb $ 129 , yyyymmdde 130 ; 131 compile_opt idl2, strictarrsubs, logical_predicate 121 132 ; 122 133 @cm_4cal … … 126 137 @cm_project 127 138 ; 139 ; Return to caller if errors 140 ON_ERROR, 2 141 ; 142 result = -1 143 ; 144 usage = 'result = tropflux_swr_nrt(yyyymmddb, yyyymmdde)' 145 nparam = N_PARAMS() 146 IF (nparam NE 2) THEN BEGIN 147 ras = report(['Incorrect number of arguments.' $ 148 + '!C' $ 149 + 'Usage : ' + usage]) 150 return, result 151 ENDIF 152 ; 128 153 ; test if ${PROJECT_OD} defined 129 154 CASE project_od_env OF … … 131 156 msg = 'eee : ${PROJECT_OD} is not defined' 132 157 ras = report(msg) 133 STOP158 return, result 134 159 END 135 160 ELSE: BEGIN … … 145 170 msg = 'eee : the directory' + iodirout + ' is not accessible.' 146 171 ras = report(msg) 147 STOP172 return, result 148 173 ENDIF 149 174 ; … … 152 177 msg = 'eee : the directory' + iodirout + ' was not found.' 153 178 ras = report(msg) 154 STOP179 return, result 155 180 ENDIF 156 181 ; 157 182 ; build swr dt data filename 158 filename_swr_dt='TropFlux_swr_ 19890101_20071231_DT.nc'183 filename_swr_dt='TropFlux_swr_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_DT.nc' 159 184 ; 160 185 ; check if this file exists … … 165 190 msg = 'eee : the file ' + fullfilename_swr_dt + ' was not found.' 166 191 ras = report(msg) 167 STOP192 return, result 168 193 ENDIF 169 194 ; 170 195 ; build olr data filename 171 filename_olr='olr_oafluxgrid_30n30s_ 19890101_20091231.nc'196 filename_olr='olr_oafluxgrid_30n30s_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 172 197 ; 173 198 ; check if this file exists … … 178 203 msg = 'eee : the file ' + fullfilename_olr + ' was not found.' 179 204 ras = report(msg) 180 STOP205 return, result 181 206 ENDIF 182 207 ; 183 208 ; build output filename 184 filename_out = 'TropFlux_swr_ 19890101_20091231_NRT.nc'209 filename_out = 'TropFlux_swr_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_NRT.nc' 185 210 fullfilename_out = iodirout + filename_out 186 211 ; in order to avoid unexpected overwritten 187 IF ( FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN212 IF ((FILE_TEST(fullfilename_out) EQ 1) AND (project_overwrite EQ 0)) THEN BEGIN 188 213 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 189 214 ras = report(msg) 190 STOP215 return, result 191 216 ENDIF 192 217 ; 193 218 initncdf, fullfilename_swr_dt 194 sw=read_ncdf("swr", 19890101, 20071231, file=fullfilename_swr_dt,/nostr) 195 ; 219 sw=read_ncdf("swr", yyyymmddb-.5d, yyyymmdde, file=fullfilename_swr_dt,/nostr) 196 220 swi=sw 221 timein=24.d*(time-julday(1,1,1957,0,0,0)) 222 jptin=n_elements(timein) 223 da=jul2date(timein[0]) 224 cda0=string(da,format='(i8.8)') 225 da=jul2date(timein[jptin-1]) 226 cda1=string(da,format='(i8.8)') 227 print, 'swr_dt first date ', cda0 228 print, 'swr_dt last date ' , cda1 197 229 ; 198 230 initncdf, fullfilename_olr 199 olr=read_ncdf('olr',19890100, 20071231, file=fullfilename_olr,/nost) 231 olr=read_ncdf('olr', yyyymmddb-.5d, yyyymmdde, file=fullfilename_olr,/nost) 232 timein=24.d*(time-julday(1,1,1957,0,0,0)) 233 jptin=n_elements(timein) 234 da=jul2date(timein[0]) 235 cda0=string(da,format='(i8.8)') 236 da=jul2date(timein[jptin-1]) 237 cda1=string(da,format='(i8.8)') 238 print, 'olr first date ', cda0 239 print, 'olr last date ' , cda1 200 240 ; 201 241 help, sw, olr … … 203 243 ;creating climatology 204 244 ; 205 ny=(2007-1989)+1 245 ny=(2007-1989)+1 ;+++ 206 246 nt=365*ny 207 olri=total(reform(olr (*,*,0:nt-1),nxt,nyt,365,ny),4)/ny208 swi=total(reform(swi (*,*,0:nt-1),nxt,nyt,365,ny),4)/ny247 olri=total(reform(olr[*,*,0:nt-1],nxt,nyt,365,ny),4)/ny 248 swi=total(reform(swi[*,*,0:nt-1],nxt,nyt,365,ny),4)/ny 209 249 ; 210 250 help, olri, swi … … 216 256 olri=[[[olri]],[[olri]],[[olri]]] 217 257 si=size(sw) 218 n1=si (1)219 n2=si (2)258 n1=si[1] 259 n2=si[2] 220 260 ; 221 261 for j=0,n2-1 do begin 222 262 for i=0,n1-1 do begin 223 x=reform(swi (i,j,*))224 y=reform(olri (i,j,*))225 swi (i,j,*)=smooth(x,nsmooth)226 olri (i,j,*)=smooth(y,nsmooth)263 x=reform(swi[i,j,*]) 264 y=reform(olri[i,j,*]) 265 swi[i,j,*]=smooth(x,nsmooth) 266 olri[i,j,*]=smooth(y,nsmooth) 227 267 endfor 228 268 endfor … … 233 273 ; 234 274 initncdf, fullfilename_olr 235 olr=read_ncdf('olr', 19890100, 20091231, box=box, file=fullfilename_olr,/nostr) 275 olr=read_ncdf('olr', yyyymmddb-.5d,yyyymmdde, box=box, file=fullfilename_olr,/nostr) 276 timein=24.d*(time-julday(1,1,1957,0,0,0)) 277 jptin=n_elements(timein) 278 da=jul2date(timein[0]) 279 cda0=string(da,format='(i8.8)') 280 da=jul2date(timein[jptin-1]) 281 cda1=string(da,format='(i8.8)') 282 print, 'olr 2 first date ', cda0 283 print, 'olr 2 last date ' , cda1 284 236 285 jpt=n_elements(time) 237 286 caldat, time,mon,day,yea … … 239 288 olrm=olr*0. 240 289 for jt=0,jpt-1 do begin 241 jtt=(time (jt)-julday(1,1,yea(jt))) < 364242 swm (*,*,jt)=swi(*,*,jtt)243 olrm (*,*,jt)=olri(*,*,jtt)290 jtt=(time[jt]-julday(1,1,yea[jt])) < 364 291 swm[*,*,jt]=swi[*,*,jtt] 292 olrm[*,*,jt]=olri[*,*,jtt] 244 293 endfor 245 294 ; … … 250 299 ; 251 300 ; writing field 252 time=timegen(7670, start=julday(1,1,1989,0), units='days') 253 cda0=string(jul2date(time (0)),format='(i8.8)')254 cda1=string(jul2date(time (jpt-1)),format='(i8.8)')255 ; 256 lat=reform(gphit (0,0:jpj-1))257 lon=reform(glamt (0:jpi-1,0))301 time=timegen(7670, start=julday(1,1,1989,0), units='days') ;+++ 302 cda0=string(jul2date(time[0]),format='(i8.8)') 303 cda1=string(jul2date(time[jpt-1]),format='(i8.8)') 304 ; 305 lat=reform(gphit[0,0:jpj-1]) 306 lon=reform(glamt[0:jpi-1,0]) 258 307 time=time-julday(1,1,1950) 259 308 jpt=n_elements(time) … … 266 315 sw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Shortwave Radiation',short_name:'swr',axis:'TYX'} 267 316 ; 268 ;269 317 ncfields = 'sw[longitude,latitude,time]=rec:sw_attr; ' $ 270 318 + 'longitude[]=lon:lon_attr; ' $ … … 275 323 @ncdf_quickwrite 276 324 ; 325 result = 0 326 return, result 327 ; 277 328 end
Note: See TracChangeset
for help on using the changeset viewer.