- Timestamp:
- 03/19/12 17:22:36 (12 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/d2m_to_q2m_erai.pro
r155 r165 75 75 ; 76 76 ; :ref:`interp_erai_dewt_1989_2009.pro` 77 ; : ref:`interp_erai_msl_1989_2009.pro`77 ; :func:`interp_erai_msl` 78 78 ; :func:`interp_erai_t2m` 79 79 ; -
trunk/src/interp_erai_msl.pro
r163 r165 1 1 ;+ 2 2 ; 3 ; .. _interp_erai_msl_1989_2009.pro:4 ; 5 ; =================== ==========6 ; interp_erai_msl_1989_2009.pro7 ; =============================3 ; =================== 4 ; interp_erai_msl.pro 5 ; =================== 6 ; 7 ; .. function:: interp_erai_msl(yyyymmddb,yyyymmdde) 8 8 ; 9 9 ; DESCRIPTION … … 26 26 ; Interpolated msl 27 27 ; is written in 28 ; :file:`${PROJECT_OD}/erai_msl_ 19890101_20091231_oafluxgrid.nc`28 ; :file:`${PROJECT_OD}/erai_msl_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 29 29 ; if this file not already exists. 30 30 ; 31 31 ; This output file 32 ; :file:`${PROJECT_OD}/erai_msl_ 19890101_20091231_oafluxgrid.nc`32 ; :file:`${PROJECT_OD}/erai_msl_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 33 33 ; must be processed after by 34 34 ; :ref:`d2m_to_q2m_erai.pro`. … … 42 42 ; .. graphviz:: 43 43 ; 44 ; digraph interp_erai_msl _1989_2009{44 ; digraph interp_erai_msl { 45 45 ; 46 46 ; file_in [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/20c3m_erai_msl_TROP_1989_2009.nc"]; 47 47 ; mask [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/mask_oaflux_30N30S.nc"]; 48 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_msl_ 19890101_20091231_oafluxgrid.nc"];49 ; 50 ; interp_erai_msl _1989_2009[shape=box,48 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_msl_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc"]; 49 ; 50 ; interp_erai_msl [shape=box, 51 51 ; fontname=Courier, 52 52 ; color=blue, 53 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_msl _1989_2009.pro",54 ; label="${PROJECT}/src/interp_erai_msl _1989_2009.pro"];55 ; 56 ; {file_in mask} -> {interp_erai_msl _1989_2009} -> {file_out}53 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_msl.pro", 54 ; label="${PROJECT}/src/interp_erai_msl.pro"]; 55 ; 56 ; {file_in mask} -> {interp_erai_msl} -> {file_out} 57 57 ; 58 58 ; } … … 64 64 ; 65 65 ; :ref:`project_profile.sh` 66 ; 67 ; Used by :ref:`tropflux.sh` 66 68 ; 67 69 ; :func:`report <saxo:report>` … … 82 84 ; 83 85 ; IDL> .compile file_interp 84 ; IDL> interp_erai_msl_1989_2009 86 ; IDL> yyyymmddb = 20000101 87 ; IDL> yyyymmdde = 20000302 88 ; IDL> result = interp_erai_msl(yyyymmddb, yyymmdde) 89 ; IDL> print, result 85 90 ; 86 91 ; TODO 87 92 ; ==== 88 93 ; 89 ; use real output of :ref:`compute_erai_daily_region_2d.sh`. 94 ; use real output of :ref:`compute_erai_daily_region_2d.sh` 95 ; 96 ; get_erai.py + grib to netcdf conversion 90 97 ; 91 98 ; msl_attr={units:'milibars' .. millibar at least, hPa will be probably 92 99 ; more SI 93 100 ; 94 ; why 19880101,20100930 as dates 101 ; why 19880101,20100930 as dates in read_ncdf. 102 ; now (20120319) should be yyyymmddb and yyymmdde but desastrous side effect 95 103 ; 96 104 ; first step time 14245.5 (days since 1950-01-01 00:00:00) : correct ? … … 105 113 ; ========== 106 114 ; 107 ; $Id: interp_erai_msl _1989_2009.pro 88 2011-08-19 15:40:14Z pinsard $115 ; $Id: interp_erai_msl.pro 88 2011-08-19 15:40:14Z pinsard $ 108 116 ; 109 117 ; $URL$ 118 ; 119 ; - fplod 20120319 120 ; 121 ; * taking project_overwite into account 122 ; * pro -> function 110 123 ; 111 124 ; - pinsard 2011-08-23T09:09:16Z loholt1.ipsl.polytechnique.fr (Linux) … … 131 144 ; 132 145 ;- 133 pro interp_erai_msl_1989_2009 146 function interp_erai_msl $ 147 , yyyymmddb $ 148 , yyyymmdde 149 ; 150 ;++compile_opt idl2, strictarrsubs, logical_predicate 134 151 ; 135 152 @cm_4cal … … 139 156 @cm_project 140 157 ; 158 ; Return to caller if errors 159 ON_ERROR, 2 160 ; 161 result = -1 162 ; 163 usage = 'result = interp_erai_msl(yyyymmddb, yyyymmdde) 164 nparam = N_PARAMS() 165 IF (nparam NE 2) THEN BEGIN 166 ras = report(['Incorrect number of arguments.' $ 167 + '!C' $ 168 + 'Usage : ' + usage]) 169 return, result 170 ENDIF 171 ; 141 172 ; check for input directory 142 173 ; … … 146 177 msg = 'eee : ${PROJECT_ID} is not defined' 147 178 ras = report(msg) 148 STOP179 return, result 149 180 END 150 181 ELSE: BEGIN … … 160 191 msg = 'eee : the directory' + iodirin + ' is not accessible.' 161 192 ras = report(msg) 162 STOP193 return, result 163 194 ENDIF 164 195 ; … … 173 204 msg = 'eee : the file ' + fullfilename_msk + ' was not found.' 174 205 ras = report(msg) 175 STOP206 return, result 176 207 ENDIF 177 208 ; … … 186 217 msg = 'eee : the file ' + fullfilename + ' was not found.' 187 218 ras = report(msg) 188 STOP219 return, result 189 220 ENDIF 190 221 ; … … 194 225 msg = 'eee : ${PROJECT_OD} is not defined' 195 226 ras = report(msg) 196 STOP227 return, result 197 228 END 198 229 ELSE: BEGIN … … 209 240 msg = 'eee : the directory' + iodirout + ' was not found.' 210 241 ras = report(msg) 211 STOP242 return, result 212 243 ENDIF 213 244 ; 214 245 ; build output filename 215 filename_out = 'erai_msl_ 19890101_20091231_oafluxgrid.nc'246 filename_out = 'erai_msl_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_oafluxgrid.nc' 216 247 fullfilename_out = iodirout + filename_out 217 248 ; in order to avoid unexpected overwritten 218 IF ( FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN249 IF ((FILE_TEST(fullfilename_out) EQ 1) AND (project_overwrite EQ 0)) THEN BEGIN 219 250 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 220 251 ras = report(msg) 221 STOP252 return, result 222 253 ENDIF 223 254 ; 224 255 initncdf, fullfilename 225 256 domdef 226 latin=reform(gphit(0,*)) 227 lonin=reform(glamt(*,0)) 228 print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) 229 print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) 257 latin=reform(gphit[0,*]) 258 lonin=reform(glamt[*,0]) 259 print, 'lat grid ',min(latin),max(latin),latin[1]-latin[0] 260 print, 'lon grid ',min(lonin),max(lonin),lonin[1]-lonin[0] 261 ;++mslin=read_ncdf("msl",yyyymmddb,yyymmdde,file=fullfilename,/nostr) 230 262 mslin=read_ncdf("msl",19880101,20100930,file=fullfilename,/nostr) 263 ; 231 264 ; 232 265 timein=time 233 266 jptin=jpt 234 tab=mslin (*,*,0)267 tab=mslin[*,*,0] 235 268 mskin=glamt*0.+1. 236 269 ; 237 270 initncdf, fullfilename_msk 238 271 domdef 239 latout=reform(gphit (0,*))240 lonout=reform(glamt (*,0))241 print, 'lat grid ',min(latout),max(latout),latout (1)-latout(0)242 print, 'lon grid ',min(lonout),max(lonout),lonout (1)-lonout(0)272 latout=reform(gphit[0,*]) 273 lonout=reform(glamt[*,0]) 274 print, 'lat grid ',min(latout),max(latout),latout[1]-latout[0] 275 print, 'lon grid ',min(lonout),max(lonout),lonout[1]-lonout[0] 243 276 mskout=read_ncdf("msk", file=fullfilename_msk,/nostr) 244 277 ; … … 252 285 msg = 'eee : ' + units + ' unknown' 253 286 ras = report(msg) 254 STOP287 return, result 255 288 END 256 289 ENDCASE … … 261 294 for jt=0,jptin-1 do begin 262 295 ; ++ print, 'Interpolation jt=',jt,' / ',jptin-1 263 tab=reform(mslin (*,*,jt))264 mslout (*,*,jt)=call_interp2d(tab,lonin,latin,mskin $296 tab=reform(mslin[*,*,jt]) 297 mslout[*,*,jt]=call_interp2d(tab,lonin,latin,mskin $ 265 298 , lonout,latout,method='bilinear' $ 266 299 , OUTMASK_IND=mskout, SET_OUTMSKVAL=mskout) 267 mslout (*,*,jt)=mslout(*,*,jt)*mskout+(1.-mskout)*1.e20300 mslout[*,*,jt]=mslout[*,*,jt]*mskout+(1.-mskout)*1.e20 268 301 endfor 269 302 ; 270 303 initncdf, fullfilename_msk 271 304 time=timegen(jptin, start=julday(1,1,1989,0), units='days') 272 cda0=string(jul2date(time (0)),format='(i8.8)')305 cda0=string(jul2date(time[0]),format='(i8.8)') 273 306 cda1=string(jul2date(time(jpt-1)),format='(i8.8)') 274 307 timein=time-julday(1,1,1950,00,00) -
trunk/src/interp_erai_t2m.pro
r164 r165 5 5 ; =================== 6 6 ; 7 ; .. function interp_erai_t2m(yyyymmddb,yyyymmdde)7 ; .. function:: interp_erai_t2m(yyyymmddb,yyyymmdde) 8 8 ; 9 9 ; DESCRIPTION … … 61 61 ; 62 62 ; :ref:`interpolate_data` 63 ; 64 ; Used by :ref:`tropflux.sh` 63 65 ; 64 66 ; :ref:`project_profile.sh` … … 260 262 + '!C' $ 261 263 + 'Usage : ' + usage]) 262 return, -1264 return, result 263 265 ENDIF 264 266 -
trunk/src/tropflux.sh
r164 r165 61 61 # 62 62 # You already used :ref:`get_erai.sh` to get ERAI data, etc., 63 # during [200 60801, 20060802[ and you want to produce NetCDF files::64 # 65 # $ tropflux.sh -b 200 60801 -e 2006080263 # during [20000101, 20000302[ and you want to produce NetCDF files:: 64 # 65 # $ tropflux.sh -b 20000101 -e 20000302 66 66 # 67 67 # A more global example:: … … 89 89 # 90 90 # Use : 91 # :func:`oaflux_mask_30n30s`, :func:`inter_erai_t2m`, etc. 91 # :func:`oaflux_mask_30n30s`, :func:`interp_erai_t2m`, 92 # :func:`interp_erai_msl`, etc. 92 93 # 93 94 # Next step : +validation ++ comparison … … 114 115 # 115 116 # * add project_overwrite usage 117 # * handling error of inter_erai_msl (now function) 116 118 # 117 119 # - pinsard 20120306 … … 162 164 # default 163 165 debug=0 164 yyyymmddb=200 60420165 yyyymmdde=200 60420166 yyyymmddb=20000101 167 yyyymmdde=20000302 166 168 # 167 169 minargcount=4 … … 296 298 ;interp_erai_dewt_1989_2009 297 299 ;interp_erai_lwr_1989_2009 298 ;interp_erai_msl_1989_2009 300 result = interp_erai_msl(${yyyymmddb}, ${yyyymmdde}) 301 IF result < 0 THEN BEGIN 302 msg = 'eee : pb after interp_erai_msl' + string(result) 303 err = report(msg) 304 exit 305 ENDIF 299 306 ;interp_erai_sst_1989_2009 300 307 result = interp_erai_t2m(${yyyymmddb}, ${yyyymmdde})
Note: See TracChangeset
for help on using the changeset viewer.