[6] | 1 | ;+ |
---|
| 2 | ; |
---|
| 3 | ; .. _q2m_correction_ncdf.pro: |
---|
| 4 | ; |
---|
| 5 | ; ======================= |
---|
| 6 | ; q2m_correction_ncdf.pro |
---|
| 7 | ; ======================= |
---|
| 8 | ; |
---|
[9] | 9 | ; .. graphviz:: |
---|
| 10 | ; |
---|
| 11 | ; digraph q2m_correction_ncdf { |
---|
| 12 | ; graph [ |
---|
| 13 | ; rankdir="LR", |
---|
| 14 | ; ] |
---|
| 15 | ; |
---|
| 16 | ; file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_q2m_19890101_20091231_oafluxgrid.nc"]; |
---|
| 17 | ; |
---|
| 18 | ; ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_q2m_19890101_20091231_v20.nc"]; |
---|
| 19 | ; |
---|
| 20 | ; q2m_correction_ncdf [shape=box, |
---|
| 21 | ; fontname=Courier, |
---|
| 22 | ; color=blue, |
---|
| 23 | ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/q2m_correction_ncdf.pro", |
---|
| 24 | ; label="${TROPFLUX}/src/q2m_correction_ncdf.pro"]; |
---|
| 25 | ; |
---|
| 26 | ; {file_in} -> {q2m_correction_ncdf} -> {ncfile} |
---|
| 27 | ; |
---|
| 28 | ; } |
---|
| 29 | ; |
---|
[6] | 30 | ; SEE ALSO |
---|
| 31 | ; ======== |
---|
| 32 | ; |
---|
| 33 | ; EXAMPLES |
---|
| 34 | ; ======== |
---|
| 35 | ; |
---|
| 36 | ; :: |
---|
| 37 | ; |
---|
| 38 | ; IDL> q2m_correction_ncdf |
---|
| 39 | ; |
---|
| 40 | ; TODO |
---|
| 41 | ; ==== |
---|
| 42 | ; |
---|
| 43 | ; hard coded directory - usage of ${TROPFLUX_ID} |
---|
| 44 | ; |
---|
| 45 | ; coding rules |
---|
| 46 | ; |
---|
| 47 | ; EVOLUTIONS |
---|
| 48 | ; ========== |
---|
| 49 | ; |
---|
[9] | 50 | ; - fplod 20101215T113945Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 51 | ; |
---|
| 52 | ; * add graph in header |
---|
| 53 | ; |
---|
[6] | 54 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 55 | ; |
---|
| 56 | ; * minimal header |
---|
| 57 | ; |
---|
| 58 | ; - pbk 2008 |
---|
| 59 | ; |
---|
| 60 | ; * creation |
---|
| 61 | ; |
---|
| 62 | ;- |
---|
[5] | 63 | pro q2m_correction_ncdf |
---|
| 64 | @common |
---|
| 65 | da1=19880101 & da2=20101231 |
---|
| 66 | |
---|
| 67 | file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_q2m_19890101_20091231_oafluxgrid.nc' |
---|
| 68 | initncdf, file |
---|
| 69 | q2m=read_ncdf('q2m',da1,da2,file=file,/nostr) |
---|
| 70 | help, q2m |
---|
| 71 | |
---|
| 72 | q2m_mean=grossemoyenne(q2m,'t',/nan) |
---|
| 73 | help, q2m_mean |
---|
| 74 | |
---|
| 75 | tt=time & jpt=n_elements(time) |
---|
| 76 | caldat, time,mon,day,yea |
---|
| 77 | q2m_m=q2m*0. |
---|
| 78 | |
---|
| 79 | for jt=0,jpt-1 do begin |
---|
| 80 | jtt=(time(jt)-julday(1,1,yea(jt))) < 364 |
---|
| 81 | q=reform(q2m_mean(*,*)) |
---|
| 82 | q2m_m(*,*,jt)=q |
---|
| 83 | endfor |
---|
| 84 | help, q2m_m |
---|
| 85 | |
---|
| 86 | q2m_ano=q2m-q2m_m |
---|
| 87 | |
---|
| 88 | ;; correction for mean based on scatter |
---|
| 89 | ;q2m_m=q2m_m+0.815445 ;; (2000-2008) |
---|
| 90 | q2m_m=q2m_m+0.792717 ;; (2000-2009) |
---|
| 91 | help, q2m_ano |
---|
| 92 | |
---|
[7] | 93 | ;; applying the correction for variability based on the scatter |
---|
[5] | 94 | ;q2m_ano=q2m_ano*(1/0.919333) ;; (2000-2008) |
---|
| 95 | q2m_ano=q2m_ano*(1/0.924674) ;; (2000-2009) |
---|
| 96 | |
---|
| 97 | q2m_new=q2m_m+q2m_ano |
---|
| 98 | help, q2m_new |
---|
| 99 | |
---|
| 100 | ;writing field |
---|
| 101 | lat=reform(gphit(0,0:jpj-1)) |
---|
| 102 | lon=reform(glamt(0:jpi-1,0)) |
---|
| 103 | time=timegen(7670, units='days', start=julday(1,1,1989,0)) & jpt=n_elements(time) |
---|
| 104 | |
---|
| 105 | cda0=string(jul2date(time(0)),format='(i8.8)') |
---|
| 106 | cda1=string(jul2date(time(jpt-1)),format='(i8.8)') |
---|
| 107 | |
---|
| 108 | time=time-julday(1,1,1950) & jpt=n_elements(time) |
---|
| 109 | |
---|
| 110 | ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_q2m_19890101_20091231_v20.nc' |
---|
| 111 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
| 112 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
| 113 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'} |
---|
| 114 | q2m_attr={units:'g/kg',missing_value:1.e20,long_name:'Specific humidity at 2m height',short_name:'q2m',axis:'TYX'} |
---|
| 115 | globattr={source:'Basic data obtained from ERAI. Mean correction for bias and correction for variability are applied',timerange:cda0+' - '+cda1} |
---|
| 116 | |
---|
| 117 | |
---|
| 118 | ncfields = 'q2m[longitude,latitude,time]=q2m_new:q2m_attr; ' $ |
---|
| 119 | + 'longitude[]=lon:lon_attr; ' $ |
---|
| 120 | + 'latitude[]=lat:lat_attr; ' $ |
---|
| 121 | + 'time[*time]=time:time_attr ' $ |
---|
| 122 | + ' @ globattr' |
---|
| 123 | |
---|
| 124 | @ncdf_quickwrite |
---|
| 125 | |
---|
| 126 | end |
---|