- Timestamp:
- 03/26/12 11:35:23 (12 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tropflux.pro
r175 r179 71 71 ; :file:`${PROJECT_OD}/TropFlux_{yyyymmdd}_{yyyymmdd}_coarev3.nc` 72 72 ; will be used by 73 ; : ref:`TropFlux_NRT_ncdf.pro`.73 ; :func:`tropflux_nrt_ncdf`. 74 74 ; 75 75 ; .. graphviz:: -
trunk/src/tropflux.sh
r175 r179 96 96 # :func:`t2m_correction_ncdf`, :func:`ws_correction_ncdf`, 97 97 # :func:`tropflux_swr_dt`, :func:`tropflux_swr_nrt`, :func:`tropflux_swr_blnd`, 98 # :func:`tropflux_nrt_cdf`, 98 99 # etc. 99 100 # … … 117 118 # 118 119 # $URL$ 120 # 121 # - pinsard 20120326 122 # 123 # * TropFlux_NRT_ncdf replace by tropflux_nrt_ncdf which is now a function 119 124 # 120 125 # - pinsard 20120322 … … 435 440 exit 436 441 ENDIF 437 ;.compile TropFlux_19890101_20091231438 442 result = tropflux(${yyyymmddb}, ${yyyymmdde}) 439 443 IF result < 0 THEN BEGIN … … 442 446 exit 443 447 ENDIF 444 ;.compile TropFlux_NRT_ncdf 445 ;tropflux_nrt_ncdf 448 result = tropflux_nrt_ncf(${yyyymmddb}, ${yyyymmdde}) 449 IF result < 0 THEN BEGIN 450 msg = 'eee : pb after tropflux_nrt_ncdf' + string(result) 451 err = report(msg) 452 exit 453 ENDIF 446 454 end 447 455 EOF -
trunk/src/tropflux_nrt_ncdf.pro
r176 r179 1 1 ;+ 2 2 ; 3 ; .. _TropFlux_NRT_ncdf.pro:4 ;5 3 ; ===================== 6 ; TropFlux_NRT_ncdf.pro4 ; tropflux_nrt_ncdf.pro 7 5 ; ===================== 8 6 ; 9 ; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20091231_BLND.nc` 7 ; .. function:: tropflux_nrt_ncdf(yyyymmddb, yyyymmdde) 8 ; 9 ; :file:`${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_BLND.nc` 10 10 ; containing 11 11 ; ws corrected on OAFLUX grid … … 13 13 ; :func:`tropflux_swr_blnd`. 14 14 ; 15 ; :file:`${PROJECT_OD}/TropFlux_lwr_ 19890101_20091231.nc`15 ; :file:`${PROJECT_OD}/TropFlux_lwr_{yyyymmdd}_{yyyymmdd}.nc` 16 16 ; containing 17 17 ; lwr corrected on OAFLUX grid … … 19 19 ; :func:`lwr_correction_ncdf`. 20 20 ; 21 ; :file:`${PROJECT_OD}/TropFlux_ 19890101_20091231_coare3.nc`21 ; :file:`${PROJECT_OD}/TropFlux_{yyyymmdd}_{yyyymmdd}_coare3.nc` 22 22 ; containing 23 23 ; ++ … … 26 26 ; 27 27 ; ++ are written 28 ; in :file:`${PROJECT_OD}/TropFlux_ 19890101_20091231.nc`28 ; in :file:`${PROJECT_OD}/TropFlux_{yyyymmdd}_{yyyymmdd}.nc` 29 29 ; if this file not already exists. 30 30 ; … … 33 33 ; digraph tropflux_nrt_ncdf { 34 34 ; 35 ; file_swr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_ 19890101_20091231_BLND.nc"];36 ; file_lwr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_lwr_ 19890101_200912310.nc"];37 ; file_coare [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_ 19890101_20091231_coarev3.nc"];38 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_ 19890101_20091231.nc"];35 ; file_swr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_BLND.nc"]; 36 ; file_lwr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_lwr_{yyyymmdd}_{yyyymmdd}.nc"]; 37 ; file_coare [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_{yyyymmdd}_{yyyymmdd}_coarev3.nc"]; 38 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_{yyyymmdd}_{yyyymmdd}.nc"]; 39 39 ; 40 40 ; tropflux_nrt_ncdf [shape=box, 41 41 ; fontname=Courier, 42 42 ; color=blue, 43 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/ TropFlux_NRT_ncdf.pro",44 ; label="${PROJECT}/src/ TropFlux_NRT_ncdf.pro" ];43 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/tropflux_nrt_ncdf.pro", 44 ; label="${PROJECT}/src/tropflux_nrt_ncdf.pro" ]; 45 45 ; 46 46 ; {file_swr file_lwr file_coare} -> {tropflux_nrt_ncdf} -> {file_out} … … 50 50 ; SEE ALSO 51 51 ; ======== 52 ; 53 ; Used by :ref:`tropflux.sh` 54 ; 55 ; :ref:`project_profile.sh` 52 56 ; 53 57 ; :func:`initncdf <saxo:initncdf>` … … 62 66 ; :: 63 67 ; 64 ; IDL> .compile TropFlux_NRT_ncdf 65 ; IDL> tropflux_nrt_ncdf 68 ; yyyymmddb = 20000101L 69 ; yyyymmdde = 20001231L 70 ; result = tropflux_nrt_ncdf(yyyymmddb, yyyymmdde) 71 ; print, result 66 72 ; 67 73 ; TODO 68 74 ; ==== 69 75 ; 76 ; handlind yyyymmdde > 20071231 see attributes also 77 ; 70 78 ; coding rules 71 ;72 ; get rid of uppercase to avoid compile73 79 ; 74 80 ; create 4 files instead of one now … … 77 83 ; ========== 78 84 ; 79 ; $Id: TropFlux_NRT_ncdf.pro 88 2011-08-19 15:40:14Z pinsard $85 ; $Id: tropflux_nrt_ncdf.pro 88 2011-08-19 15:40:14Z pinsard $ 80 86 ; 81 87 ; $URL$ 88 ; 89 ; - fplod 20120326 90 ; 91 ; * pro -> func 92 ; * rename with lower case TropFlux_NRT_ncdf.pro become tropflux_nrt_ncdf.pro 93 ; * taking project_overwite into account 94 ; * try to add compile_opt seems to be incompatible with ncdf_quickwrite 95 ; * hard coded st and en replaced by yyyymmddb and yyyymmdde parameters 96 ; * get rid of timegen 82 97 ; 83 98 ; - fplod 20110809T133815Z cratos (Linux) … … 100 115 ; 101 116 ;- 102 pro TropFlux_NRT_ncdf 117 function tropflux_nrt_ncdf $ 118 , yyyymmddb $ 119 , yyyymmdde 120 ; 121 compile_opt idl2, strictarrsubs, logical_predicate 103 122 ; 104 123 @cm_4cal … … 108 127 @cm_project 109 128 ; 129 ; Return to caller if errors 130 ON_ERROR, 2 131 ; 132 result = -1 133 ; 134 usage = 'result = tropflux_swr_dt(yyyymmddb, yyyymmdde)' 135 nparam = N_PARAMS() 136 IF (nparam NE 2) THEN BEGIN 137 ras = report(['Incorrect number of arguments.' $ 138 + '!C' $ 139 + 'Usage : ' + usage]) 140 return, result 141 ENDIF 142 ; 110 143 ; test if ${PROJECT_OD} defined 111 144 CASE project_od_env OF … … 113 146 msg = 'eee : ${PROJECT_OD} is not defined' 114 147 ras = report(msg) 115 STOP148 return, result 116 149 END 117 150 ELSE: BEGIN … … 128 161 msg = 'eee : the directory' + iodirout + ' is not accessible.' 129 162 ras = report(msg) 130 STOP163 return, result 131 164 ENDIF 132 165 ; … … 135 168 msg = 'eee : the directory' + iodirout + ' was not found.' 136 169 ras = report(msg) 137 STOP170 return, result 138 171 ENDIF 139 172 ; 140 173 ; build SWR blnd data filename 141 filename_swr_blnd="TropFlux_swr_ 19890101_20091231_BLND.nc"174 filename_swr_blnd="TropFlux_swr_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_BLND.nc" 142 175 ; 143 176 ; check if this file exists … … 148 181 msg = 'eee : the file ' + fullfilename_swr_blnd + ' was not found.' 149 182 ras = report(msg) 150 STOP183 return, result 151 184 ENDIF 152 185 ; 153 186 ; build LWR data filename 154 filename_lwr="TropFlux_lwr_ 19890101_20091231.nc"187 filename_lwr="TropFlux_lwr_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc" 155 188 ; 156 189 ; check if this file exists … … 161 194 msg = 'eee : the file ' + fullfilename_lwr + ' was not found.' 162 195 ras = report(msg) 163 STOP196 return, result 164 197 ENDIF 165 198 ; 166 199 ; build COARE data filename 167 filename_coare="TropFlux_ 19890101_20091231_coarev3.nc"200 filename_coare="TropFlux_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_coarev3.nc" 168 201 ; 169 202 ; check if this file exists … … 174 207 msg = 'eee : the file ' + fullfilename_coare + ' was not found.' 175 208 ras = report(msg) 176 STOP177 ENDIF 178 ; 179 filename_out='TropFlux_ 19890101_20091231.nc'209 return, result 210 ENDIF 211 ; 212 filename_out='TropFlux_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 180 213 fullfilename_out = iodirout + filename_out 181 214 ; in order to avoid unexpected overwritten 182 IF ( FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN215 IF ((FILE_TEST(fullfilename_out) EQ 1) AND (project_overwrite EQ 0)) THEN BEGIN 183 216 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 184 217 ras = report(msg) 185 STOP 186 ENDIF 187 ; 188 st=19800101 189 en=20101231 218 return, result 219 ENDIF 190 220 ; 191 221 initncdf, fullfilename_swr_blnd 192 222 ; 193 swr=read_ncdf("swr", st, en, file=fullfilename_swr_blnd,/nostr) 223 swr=read_ncdf("swr", yyyymmddb - .5d, yyyymmdde, file=fullfilename_swr_blnd,/nostr) 224 timein=24.d*(time-julday(1,1,1957,0,0,0)) 225 jpt=n_elements(timein) 226 da=jul2date(time[0]) 227 cda0=string(da,format='(i8.8)') 228 da=jul2date(time[jpt-1]) 229 cda1=string(da,format='(i8.8)') 230 print, 'swr in tropflux_nrt_ncdf first date ', cda0 231 print, 'swr in tropflux_nrt_ncdf last date ' , cda1 194 232 ; 195 233 initncdf, fullfilename_lwr 196 lwr=read_ncdf("lwr", st, en, file=fullfilename_lwr,/nostr) 234 lwr=read_ncdf("lwr", yyyymmddb - .5d, yyyymmdde, file=fullfilename_lwr,/nostr) 235 timein=24.d*(time-julday(1,1,1957,0,0,0)) 236 jpt=n_elements(timein) 237 da=jul2date(time[0]) 238 cda0=string(da,format='(i8.8)') 239 da=jul2date(time[jpt-1]) 240 cda1=string(da,format='(i8.8)') 241 print, 'lwr in tropflux_nrt_ncdf first date ', cda0 242 print, 'lwr in tropflux_nrt_ncdf last date ' , cda1 197 243 ; 198 244 initncdf, fullfilename_coare 199 lhf=read_ncdf("lhf", st, en, file=fullfilename_coare,/nostr) 200 shf=read_ncdf("shf", st, en, file=fullfilename_coare,/nostr) 245 lhf=read_ncdf("lhf", yyyymmddb - .5d, yyyymmdde, file=fullfilename_coare,/nostr) 246 timein=24.d*(time-julday(1,1,1957,0,0,0)) 247 jpt=n_elements(timein) 248 da=jul2date(time[0]) 249 cda0=string(da,format='(i8.8)') 250 da=jul2date(time[jpt-1]) 251 cda1=string(da,format='(i8.8)') 252 print, 'lhf in tropflux_nrt_ncdf first date ', cda0 253 print, 'lhf in tropflux_nrt_ncdf last date ' , cda1 254 ; 255 shf=read_ncdf("shf", yyyymmddb - .5d, yyyymmdde, file=fullfilename_coare,/nostr) 256 timein=24.d*(time-julday(1,1,1957,0,0,0)) 257 jpt=n_elements(timein) 258 da=jul2date(time[0]) 259 cda0=string(da,format='(i8.8)') 260 da=jul2date(time[jpt-1]) 261 cda1=string(da,format='(i8.8)') 262 print, 'shf in tropflux_nrt_ncdf first date ', cda0 263 print, 'shf in tropflux_nrt_ncdf last date ' , cda1 201 264 ; 202 265 help, swr, lwr, lhf, shf 203 266 ; 204 time=timegen(7670, start=julday(1,1,1989,0), units='days') 205 jpt=n_elements(time) 206 ; 207 cda0=string(jul2date(time(0)),format='(i8.8)') 208 cda1=string(jul2date(time(jpt-1)),format='(i8.8)') 209 ; 210 time=time-julday(1,1,1950,00,00) 211 ; 212 lat=reform(gphit(0,0:jpj-1)) 213 lon=reform(glamt(0:jpi-1,0)) 267 lat=reform(gphit[0,0:jpj-1]) 268 lon=reform(glamt[0:jpi-1,0]) 214 269 ; 215 270 ncfile='!' + fullfilename_out … … 223 278 lh_attr={units:'w/m^2',missing_value:1.e20,long_name:'Latent Heat Flux',short_name:'lhf',axis:'TYX'} 224 279 ; 225 ncfields = 'swr[longitude,latitude, time]=swr:sw_attr; ' $226 +'lwr[longitude,latitude, time]=lwr:lw_attr; ' $227 +'lhf[longitude,latitude, time]=lhf:lh_attr; ' $228 +'shf[longitude,latitude, time]=shf:sh_attr; ' $280 ncfields = 'swr[longitude,latitude,*time]=swr:sw_attr; ' $ 281 +'lwr[longitude,latitude,*time]=lwr:lw_attr; ' $ 282 +'lhf[longitude,latitude,*time]=lhf:lh_attr; ' $ 283 +'shf[longitude,latitude,*time]=shf:sh_attr; ' $ 229 284 + 'longitude[]=lon:lon_attr; ' $ 230 285 + 'latitude[]=lat:lat_attr; ' $ 231 + 'time[ *time]=time:time_attr ' $286 + 'time[]=timein:time_attr ' $ 232 287 + ' @ globattr' 233 288 ; 234 289 @ncdf_quickwrite 235 290 ; 291 result = 0 292 return, result 293 ; 236 294 end -
trunk/src/tropflux_swr_blnd.pro
r175 r179 29 29 ; 30 30 ; This file will be used by 31 ; : ref:`TropFlux_NRT_ncdf.pro`.31 ; :func:`tropflux_nrt_ncdf`. 32 32 ; 33 33 ; .. graphviz:: … … 66 66 ; :func:`ncdf_quickwrite <saxo:ncdf_quickwrite>` 67 67 ; 68 ; : ref:`Tropflux_NRT_ncdf.pro`68 ; :func:`tropflux_nrt_ncdf` 69 69 ; 70 70 ; EXAMPLES
Note: See TracChangeset
for help on using the changeset viewer.