1 | ;+ |
---|
2 | ; |
---|
3 | ; .. _TropFlux_19890101_20091231.pro: |
---|
4 | ; |
---|
5 | ; ============================== |
---|
6 | ; TropFlux_19890101_20091231.pro |
---|
7 | ; ============================== |
---|
8 | ; |
---|
9 | ; This program computes net heat flux components on the 1° oaflux grid. |
---|
10 | ; |
---|
11 | ; all input variables are corrected for mean bias and variability. |
---|
12 | ; |
---|
13 | ; gustiness correction is applied for wind speed based on cronin's climatological |
---|
14 | ; gustiness values. |
---|
15 | ; |
---|
16 | ; SEE ALSO |
---|
17 | ; ======== |
---|
18 | ; |
---|
19 | ; EXAMPLES |
---|
20 | ; ======== |
---|
21 | ; |
---|
22 | ; :: |
---|
23 | ; |
---|
24 | ; IDL> tropflux_19890101_20091231 |
---|
25 | ; |
---|
26 | ; TODO |
---|
27 | ; ==== |
---|
28 | ; |
---|
29 | ; hard coded directory - usage of ${TROPFLUX_ID} |
---|
30 | ; |
---|
31 | ; coding rules |
---|
32 | ; |
---|
33 | ; EVOLUTIONS |
---|
34 | ; ========== |
---|
35 | ; |
---|
36 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
37 | ; |
---|
38 | ; * minimal header |
---|
39 | ; |
---|
40 | ; - pbk 2008 |
---|
41 | ; |
---|
42 | ; * creation |
---|
43 | ; |
---|
44 | ;- |
---|
45 | ; |
---|
46 | pro TropFlux_19890101_20091231 |
---|
47 | @common |
---|
48 | ;------------------------------------------------------------ |
---|
49 | ; |
---|
50 | |
---|
51 | da1=19880101 & da2=20101231 |
---|
52 | file='/Volumes/Iomega_HDD/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc' |
---|
53 | initncdf, file |
---|
54 | msk=ncdf_lec(file,var='msk') |
---|
55 | |
---|
56 | dir='/Volumes/Iomega_HDD/TropFlux/input_cor/full_cor/' |
---|
57 | dir1='/Users/pkb/data/TropFlux/' |
---|
58 | |
---|
59 | file_sst=dir+'TropFlux_sst_19890101_20091231_v20.nc' |
---|
60 | file_wind=dir+'TropFlux_ws_19890101_20091231_v20.nc' |
---|
61 | file_sw=dir1+'TropFlux_swr_19890101_20091231_BLND_v50.nc' |
---|
62 | file_lw=dir+'TropFlux_lwr_19890101_20091231_v2.nc' |
---|
63 | file_air=dir1+'TropFlux_t2m_19890101_20091231_v50.nc' |
---|
64 | file_q=dir+'TropFlux_q2m_19890101_20091231_v20.nc' |
---|
65 | file_wg=dir1+'TropFlux_gustiness_19890101_20091231_v50.nc' |
---|
66 | |
---|
67 | initncdf, file_sst |
---|
68 | |
---|
69 | ws=read_ncdf('ws',da1,da2,file=file_wind,/nostr) |
---|
70 | wg=read_ncdf('wg',da1-1,da2,file=file_wg,/nostr) |
---|
71 | tt=time & jpt=n_elements(time) |
---|
72 | sst=read_ncdf('sst',da1,da2,file=file_sst,/nostr) |
---|
73 | sst=reform(sst-273.15) |
---|
74 | swd=read_ncdf('swr',da1,da2,file=file_sw,/nostr) |
---|
75 | lw=read_ncdf('lwr',da1,da2,file=file_lw,/nostr) |
---|
76 | swd=swd/0.94 ;; converting from net swr to downward swr |
---|
77 | |
---|
78 | t2m=read_ncdf('t2m',da1,da2,file=file_air,/nostr)-273.15 ; in C |
---|
79 | q2m=read_ncdf('q2m',da1,da2,file=file_q,/nostr) ; in g/kg |
---|
80 | |
---|
81 | w=sqrt(ws*ws+wg*wg) ;; wind corrected for gustiness |
---|
82 | w=ws |
---|
83 | tmask=msk |
---|
84 | help, ws,w,wg,u,sst,swd,t2m,q2m |
---|
85 | ocean=where(msk eq 1,compl=land) |
---|
86 | valmask=1.e20 |
---|
87 | time=tt & jpt=n_elements(time) |
---|
88 | |
---|
89 | ; |
---|
90 | ;; Constants for flux computation |
---|
91 | ; |
---|
92 | zu=10. ; height of wind speed measurement (m) |
---|
93 | us=0. ; surf current (m/s) |
---|
94 | zt=2. ; Height of air T measurement (m) |
---|
95 | zq=2. ; height of humidity measurement (m) |
---|
96 | P=1008. ; Pressure |
---|
97 | zi=600. ; Inversion height (m) |
---|
98 | jcool=0 ; Compute cool-skin |
---|
99 | jwave=0 ; No waves |
---|
100 | twave=5. |
---|
101 | hwave=1. |
---|
102 | |
---|
103 | caldat, time,mon,day,yea |
---|
104 | swr=fltarr(jpi,jpj,jpt)+1.e20 |
---|
105 | lwr=fltarr(jpi,jpj,jpt)+1.e20 |
---|
106 | lat=fltarr(jpi,jpj,jpt)+1.e20 |
---|
107 | sen=fltarr(jpi,jpj,jpt)+1.e20 |
---|
108 | lwnet_clrk=fltarr(jpi,jpj,jpt)+1.e20 |
---|
109 | ;Ch=fltarr(jpi,jpj,jpt)+1.e20 |
---|
110 | ;Ce=fltarr(jpi,jpj,jpt)+1.e20 |
---|
111 | junk=fltarr(jpi,jpj,jpt)+1.e20 |
---|
112 | |
---|
113 | for jt=0,jpt-1 do begin |
---|
114 | jday=time(jt)-julday(1,1,yea(jt)) |
---|
115 | print, 'Computing Fluxes ',jt,' / ',jpt-1 |
---|
116 | ; |
---|
117 | ; P=msl(*,*,jt) & P=P(ocean) |
---|
118 | wn=w(*,*,jt) & wn=wn(ocean) ; wind speed (m/s) |
---|
119 | ts=sst(*,*,jt) & ts=ts(ocean) ; Bulk sst (°C) |
---|
120 | t=t2m(*,*,jt) & t=t(ocean) ; 2m Air T (°C) |
---|
121 | qs=qsee(ts,P) ; Sea surface sat. spec. humidity (g/kg) |
---|
122 | q=q2m(*,*,jt) & q=q(ocean) ; 2m AIr specific humidity (g/kg) |
---|
123 | Rs=swd(*,*,jt) & Rs=Rs(ocean) ; Downward solar flux (W/m2) |
---|
124 | ylat=gphit(ocean) |
---|
125 | ; cld=calc_cloud(jday,Rs,ylat) |
---|
126 | cld=calc_cloud_vlat(jday,Rs,ylat) |
---|
127 | ; Rl=lwdown_clark(ts,q,cld,t,P) ; Downward IR flux (W/m2) |
---|
128 | Rl=lw(*,*,jt) & Rl=Rl(ocean) |
---|
129 | rain=0. |
---|
130 | lw_clrk=-lwnet_clark(ts,q,cld,t,P) |
---|
131 | ; junk(*,*,jt)=lw_clrk |
---|
132 | ; |
---|
133 | ;stop |
---|
134 | y=cor30a(wn,us,ts,t,Qs,Q,Rs,Rl,rain,zi,P,zu,zt,zq,ylat,jcool,jwave,twave,hwave) |
---|
135 | ; |
---|
136 | |
---|
137 | ; A few punctual missing values (coare does not converge): filled by spatial extrapolation |
---|
138 | tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y(*,0)) & tab(ocean)=x & m=finite(tab) & tab=extrapolate(tab,m) & swr(*,*,jt)=tab*msk+valmask*(1-msk) |
---|
139 | tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y(*,1)) & tab(ocean)=x & m=finite(tab) & tab=extrapolate(tab,m) & lwr(*,*,jt)=tab*msk+valmask*(1-msk) |
---|
140 | tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y(*,2)) & tab(ocean)=x & m=finite(tab) & tab=extrapolate(tab,m) & lat(*,*,jt)=tab*msk+valmask*(1-msk) |
---|
141 | tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y(*,3)) & tab(ocean)=x & m=finite(tab) & tab=extrapolate(tab,m) & sen(*,*,jt)=tab*msk+valmask*(1-msk) |
---|
142 | ; tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(lw_clrk) & tab(ocean)=x & m=finite(tab) & tab=extrapolate(tab,m) & lwnet_clrk(*,*,jt)=tab*msk+valmask*(1-msk) |
---|
143 | ; tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y(*,6)) & tab(ocean)=x & m=finite(tab) & tab=extrapolate(tab,m) & Ch(*,*,jt)=tab*msk+valmask*(1-msk) |
---|
144 | ; tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y(*,7)) & tab(ocean)=x & m=finite(tab) & tab=extrapolate(tab,m) & Ce(*,*,jt)=tab*msk+valmask*(1-msk) |
---|
145 | endfor |
---|
146 | tt=time |
---|
147 | time=timegen(7670, start=julday(1,1,1989,0), units='days') & jpt=n_elements(time) |
---|
148 | ;------------------------------------------------------------ |
---|
149 | cda0=string(jul2date(time(0)),format='(i8.8)') |
---|
150 | cda1=string(jul2date(time(jpt-1)),format='(i8.8)') |
---|
151 | tt=time-julday(1,1,1950,00,00,00) |
---|
152 | xlon=reform(glamt(*,0) ) & ylat=reform(gphit(0,*)) |
---|
153 | |
---|
154 | ncfile='!/Users/pkb/data/TropFlux/TropFlux_19890101_20091231_v51.nc' |
---|
155 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
156 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
157 | swr_attr={units:'W/m2',missing_value:valmask,long_name:'Surface net shortwave radiation',short_name:'swr',axis:'TYX'} |
---|
158 | lwr_attr={units:'W/m2',missing_value:valmask,long_name:'Surface net longwave radiation',short_name:'lwr',axis:'TYX'} |
---|
159 | lwr_clrk_attr={units:'W/m2',missing_value:valmask,long_name:'Surface net longwave radiation from clark',short_name:'lwr',axis:'TYX'} |
---|
160 | lhf_attr={units:'W/m2',missing_value:valmask,long_name:'Surface latent flux',short_name:'lhf',axis:'TYX'} |
---|
161 | shf_attr={units:'W/m2',missing_value:valmask,long_name:'Surface sensible flux',short_name:'shf',axis:'TYX'} |
---|
162 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
163 | Ch_attr={units:'',missing_value:valmask,long_name:'heat transfer coefficient at zt',short_name:'Ch',axis:'TYX'} |
---|
164 | Ce_attr={units:'',missing_value:valmask,long_name:'moisture transfer coefficient at zq',short_name:'Ce',axis:'TYX'} |
---|
165 | |
---|
166 | globattr={source:'Fluxes for the Global Tropical Ocean - TropFlux',timerange:cda0+' - '+cda1} |
---|
167 | |
---|
168 | help, swr,lwr,lat,sen,tt,xlon,ylat |
---|
169 | |
---|
170 | ncfields = 'swr[longitude,latitude,time]=swr:swr_attr; ' $ |
---|
171 | ; +'lwr_coare[longitude,latitude,time]=lwr:lwr_attr; ' $ |
---|
172 | +'lwr[longitude,latitude,time]=lwnet_clrk:lwr_clrk_attr; ' $ |
---|
173 | +'lhf[longitude,latitude,time]=lat:lhf_attr; ' $ |
---|
174 | +'shf[longitude,latitude,time]=sen:shf_attr; ' $ |
---|
175 | ; +'Ch[longitude,latitude,time]=Ch:Ch_attr; ' $ |
---|
176 | ; +'Ce[longitude,latitude,time]=Ce:Ce_attr; ' $ |
---|
177 | + 'longitude[]=xlon:lon_attr; ' $ |
---|
178 | + 'latitude[]=ylat:lat_attr; ' $ |
---|
179 | + 'tt[*time]=tt:time_attr ' $ |
---|
180 | + ' @ globattr' |
---|
181 | |
---|
182 | @ncdf_quickwrite |
---|
183 | |
---|
184 | return |
---|
185 | end |
---|