[6] | 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 | ; |
---|
[85] | 16 | ; :file:`${PROJECT_ID}/mask_oaflux_30N30S.nc` |
---|
| 17 | ; containing |
---|
| 18 | ; OAFLUX grid |
---|
| 19 | ; has been produced by |
---|
| 20 | ; :ref:`oaflux_mask_30N30S.pro`. |
---|
[7] | 21 | ; |
---|
[85] | 22 | ; :file:`${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc` |
---|
| 23 | ; containing |
---|
| 24 | ; sst corrected on OAFLUX grid |
---|
| 25 | ; has been produced by |
---|
| 26 | ; :ref:`sst_correction_ncdf.pro`. |
---|
[74] | 27 | ; |
---|
[85] | 28 | ; :file:`${PROJECT_OD}/TropFlux_ws_19890101_20091231.nc` |
---|
| 29 | ; containing |
---|
| 30 | ; ws corrected on OAFLUX grid |
---|
| 31 | ; has been produced by |
---|
| 32 | ; :ref:`ws_correction_ncdf.pro`. |
---|
[74] | 33 | ; |
---|
[85] | 34 | ; :file:`${PROJECT_OD}/TropFlux_gustiness_19890101_20091231.nc` |
---|
| 35 | ; containing |
---|
| 36 | ; ++ |
---|
| 37 | ; has been produced by |
---|
| 38 | ; :ref:`cronin_gustiness_ncdf.pro`. |
---|
[74] | 39 | ; |
---|
[85] | 40 | ; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20091231_BLND.nc` |
---|
| 41 | ; containing |
---|
| 42 | ; ws corrected on OAFLUX grid |
---|
| 43 | ; has been produced by |
---|
| 44 | ; :ref:`TropFlux_swr_BLND_19890101_20091231.pro`. |
---|
[74] | 45 | ; |
---|
[85] | 46 | ; :file:`${PROJECT_OD}/TropFlux_lwr_19890101_20091231.nc` |
---|
| 47 | ; containing |
---|
| 48 | ; lwr corrected on OAFLUX grid |
---|
| 49 | ; has been produced by |
---|
| 50 | ; :ref:`lwr_correction_ncdf.pro`. |
---|
[74] | 51 | ; |
---|
[85] | 52 | ; :file:`${PROJECT_OD}/TropFlux_t2m_19890101_20091231.nc` |
---|
| 53 | ; containing |
---|
| 54 | ; t2m corrected on OAFLUX grid |
---|
| 55 | ; has been produced by |
---|
| 56 | ; :ref:`t2m_correction_ncdf.pro`. |
---|
[74] | 57 | ; |
---|
[85] | 58 | ; :file:`${PROJECT_OD}/TropFlux_q2m_19890101_20091231.nc` |
---|
| 59 | ; containing |
---|
| 60 | ; q2m corrected on OAFLUX grid |
---|
| 61 | ; has been produced by |
---|
| 62 | ; :ref:`d2m_to_q2m_erai.pro`. |
---|
[74] | 63 | ; |
---|
[85] | 64 | ; net heat flux components are written |
---|
[74] | 65 | ; in :file:`${PROJECT_OD}/TropFlux_19890101_20091231.nc` |
---|
| 66 | ; if this file not already exists. |
---|
[85] | 67 | ; |
---|
[7] | 68 | ; .. graphviz:: |
---|
| 69 | ; |
---|
[74] | 70 | ; digraph tropflux_19890101_20091231 { |
---|
[7] | 71 | ; graph [ |
---|
| 72 | ; rankdir="LR", |
---|
| 73 | ; ] |
---|
[74] | 74 | ; |
---|
[50] | 75 | ; mask [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/mask_oaflux_30N30S.nc"]; |
---|
[74] | 76 | ; file_sst [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc"]; |
---|
| 77 | ; file_ws [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_ws_19890101_20091231.nc"]; |
---|
| 78 | ; file_wg [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_gustiness_19890101_20091231.nc"]; |
---|
| 79 | ; file_swr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_19890101_20091231_BLND.nc"]; |
---|
| 80 | ; file_lwr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_lwr_19890101_20091231.nc"]; |
---|
| 81 | ; file_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_t2m_19890101_20091231.nc"]; |
---|
| 82 | ; file_q2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_q2m_19890101_20091231.nc"]; |
---|
[7] | 83 | ; |
---|
[74] | 84 | ; file_out[shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_19890101_20091231.nc"]; |
---|
[7] | 85 | ; |
---|
[74] | 86 | ; tropflux_19890101_20091231 [shape=box, |
---|
[7] | 87 | ; fontname=Courier, |
---|
| 88 | ; color=blue, |
---|
| 89 | ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/TropFlux_19890101_20091231.pro", |
---|
[50] | 90 | ; label="${PROJECT}/src/TropFlux_19890101_20091231.pro"]; |
---|
[7] | 91 | ; |
---|
[74] | 92 | ; {mask file_sst file_ws file_wg file_swr file_lwr file_t2m file_q2m} -> {tropflux_19890101_20091231} -> {file_out} |
---|
[9] | 93 | ; |
---|
[7] | 94 | ; } |
---|
| 95 | ; |
---|
[6] | 96 | ; SEE ALSO |
---|
| 97 | ; ======== |
---|
| 98 | ; |
---|
[50] | 99 | ; :ref:`project_profile.sh` |
---|
[19] | 100 | ; |
---|
[20] | 101 | ; :func:`report <saxo:report>` |
---|
| 102 | ; :func:`isadirectory <saxo:isadirectory>` |
---|
| 103 | ; :func:`isafile <saxo:isafile>` |
---|
| 104 | ; :func:`initncdf <saxo:initncdf>` |
---|
| 105 | ; :func:`ncdf_lec <saxo:ncdf_lec>` |
---|
| 106 | ; :func:`read_ncdf <saxo:read_ncdf>` |
---|
| 107 | ; :func:`caldat <saxo:caldat>` |
---|
| 108 | ; :func:`julday <saxo:julday>` |
---|
| 109 | ; :func:`ncdf_quickwrite <saxo:ncdf_quickwrite>` |
---|
| 110 | ; |
---|
[7] | 111 | ; :func:`cor30a` |
---|
| 112 | ; |
---|
[6] | 113 | ; EXAMPLES |
---|
| 114 | ; ======== |
---|
| 115 | ; |
---|
| 116 | ; :: |
---|
| 117 | ; |
---|
[74] | 118 | ; IDL> .compile TropFlux_19890101_20091231 |
---|
[6] | 119 | ; IDL> tropflux_19890101_20091231 |
---|
| 120 | ; |
---|
| 121 | ; TODO |
---|
| 122 | ; ==== |
---|
| 123 | ; |
---|
[85] | 124 | ; no ${PROJECT_OD}/TropFlux_swr_19890101_20091231_BLND.nc yet because of pb in |
---|
| 125 | ; TropFlux_swr_BLND_19890101_20091231.pro |
---|
[6] | 126 | ; |
---|
[74] | 127 | ; avoid mix lower/uppercase in pro name to avoid compile |
---|
| 128 | ; |
---|
[6] | 129 | ; coding rules |
---|
| 130 | ; |
---|
[19] | 131 | ; KNOWN ISSUES |
---|
| 132 | ; ============ |
---|
| 133 | ; |
---|
| 134 | ; test of existence of fullfilename_msk not very efficient because |
---|
| 135 | ; MUST_EXIST keyword of :func:`isafile <saxo:isafile>` not yet implemented |
---|
| 136 | ; |
---|
[6] | 137 | ; EVOLUTIONS |
---|
| 138 | ; ========== |
---|
| 139 | ; |
---|
[81] | 140 | ; $Id |
---|
| 141 | ; |
---|
| 142 | ; $URL$ |
---|
| 143 | ; |
---|
[74] | 144 | ; - fplod 20110809T110911Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 145 | ; |
---|
| 146 | ; * complete descritption |
---|
| 147 | ; * remove v* from filenames (in and out) |
---|
| 148 | ; * usage of ${PROJECT_OD} |
---|
| 149 | ; * remove return statement |
---|
| 150 | ; * add test on IO files |
---|
| 151 | ; |
---|
[19] | 152 | ; - fplod 20101217T140745Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 153 | ; |
---|
| 154 | ; * remove hard coded directory for mask_oaflux_30N30S.nc |
---|
| 155 | ; |
---|
[7] | 156 | ; - fplod 20101214T112131Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 157 | ; |
---|
| 158 | ; * add graph |
---|
| 159 | ; |
---|
[6] | 160 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 161 | ; |
---|
| 162 | ; * minimal header |
---|
| 163 | ; |
---|
| 164 | ; - pbk 2008 |
---|
| 165 | ; |
---|
| 166 | ; * creation |
---|
| 167 | ; |
---|
| 168 | ;- |
---|
| 169 | ; |
---|
[5] | 170 | pro TropFlux_19890101_20091231 |
---|
[74] | 171 | ; |
---|
| 172 | @cm_4cal |
---|
| 173 | @cm_4data |
---|
| 174 | @cm_4mesh |
---|
| 175 | @cm_4data |
---|
[50] | 176 | @cm_project |
---|
[19] | 177 | ; |
---|
[20] | 178 | ; check for input directory |
---|
[19] | 179 | ; |
---|
[50] | 180 | ; test if ${PROJECT_ID} defined |
---|
| 181 | CASE project_id_env OF |
---|
[19] | 182 | '' : BEGIN |
---|
[50] | 183 | msg = 'eee : ${PROJECT_ID} is not defined' |
---|
[19] | 184 | ras = report(msg) |
---|
| 185 | STOP |
---|
| 186 | END |
---|
| 187 | ELSE: BEGIN |
---|
[50] | 188 | msg = 'iii : ${PROJECT_ID} is ' + project_id_env |
---|
[19] | 189 | ras = report(msg) |
---|
| 190 | END |
---|
| 191 | ENDCASE |
---|
| 192 | ; |
---|
[50] | 193 | iodirin = isadirectory(project_id_env) |
---|
[19] | 194 | ; |
---|
[50] | 195 | ; existence and protection of ${PROJECT_ID} |
---|
[19] | 196 | IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN |
---|
| 197 | msg = 'eee : the directory' + iodirin + ' is not accessible.' |
---|
| 198 | ras = report(msg) |
---|
| 199 | STOP |
---|
| 200 | ENDIF |
---|
| 201 | ; |
---|
| 202 | ; build mask filename |
---|
| 203 | filename_msk='mask_oaflux_30N30S.nc' |
---|
| 204 | ; |
---|
| 205 | ; check if this file exists |
---|
[74] | 206 | msg='iii : looking for ' + filename_msk |
---|
| 207 | ras = report(msg) |
---|
[19] | 208 | fullfilename_msk = isafile(iodirin + filename_msk, NEW=0, /MUST_EXIST) |
---|
| 209 | IF fullfilename_msk[0] EQ '' THEN BEGIN |
---|
| 210 | msg = 'eee : the file ' + fullfilename_msk + ' was not found.' |
---|
| 211 | ras = report(msg) |
---|
| 212 | STOP |
---|
| 213 | ENDIF |
---|
[74] | 214 | ; |
---|
| 215 | ; test if ${PROJECT_OD} defined |
---|
| 216 | CASE project_od_env OF |
---|
| 217 | '' : BEGIN |
---|
| 218 | msg = 'eee : ${PROJECT_OD} is not defined' |
---|
| 219 | ras = report(msg) |
---|
| 220 | STOP |
---|
| 221 | END |
---|
| 222 | ELSE: BEGIN |
---|
| 223 | msg = 'iii : ${PROJECT_OD} is ' + project_od_env |
---|
| 224 | ras = report(msg) |
---|
| 225 | END |
---|
| 226 | ENDCASE |
---|
| 227 | ; |
---|
| 228 | ; check if output data will be possible |
---|
| 229 | iodirout = isadirectory(project_od_env) |
---|
| 230 | ; |
---|
| 231 | ; existence and protection for reading |
---|
| 232 | IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN |
---|
| 233 | msg = 'eee : the directory' + iodirout + ' is not accessible.' |
---|
| 234 | ras = report(msg) |
---|
| 235 | STOP |
---|
| 236 | ENDIF |
---|
| 237 | ; |
---|
| 238 | ; existence and protection for writing |
---|
| 239 | IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN |
---|
| 240 | msg = 'eee : the directory' + iodirout + ' was not found.' |
---|
| 241 | ras = report(msg) |
---|
| 242 | STOP |
---|
| 243 | ENDIF |
---|
| 244 | ; |
---|
| 245 | ; build sst data filename |
---|
| 246 | filename_sst='TropFlux_sst_19890101_20091231.nc' |
---|
| 247 | ; |
---|
| 248 | ; check if this file exists |
---|
| 249 | msg='iii : looking for ' + filename_sst |
---|
| 250 | ras = report(msg) |
---|
| 251 | fullfilename_sst = isafile(iodirout + filename_sst, NEW=0, /MUST_EXIST) |
---|
| 252 | IF fullfilename_sst[0] EQ '' THEN BEGIN |
---|
| 253 | msg = 'eee : the file ' + fullfilename_sst + ' was not found.' |
---|
| 254 | ras = report(msg) |
---|
| 255 | STOP |
---|
| 256 | ENDIF |
---|
| 257 | ; |
---|
| 258 | ; build ws data filename |
---|
| 259 | filename_ws='TropFlux_ws_19890101_20091231.nc' |
---|
| 260 | ; |
---|
| 261 | ; check if this file exists |
---|
| 262 | msg='iii : looking for ' + filename_ws |
---|
| 263 | ras = report(msg) |
---|
| 264 | fullfilename_ws = isafile(iodirout + filename_ws, NEW=0, /MUST_EXIST) |
---|
| 265 | IF fullfilename_ws[0] EQ '' THEN BEGIN |
---|
| 266 | msg = 'eee : the file ' + fullfilename_ws + ' was not found.' |
---|
| 267 | ras = report(msg) |
---|
| 268 | STOP |
---|
| 269 | ENDIF |
---|
| 270 | ; |
---|
| 271 | ; build swr data filename |
---|
| 272 | filename_swr='TropFlux_swr_19890101_20091231_BLND.nc' |
---|
| 273 | ; |
---|
| 274 | ; check if this file exists |
---|
| 275 | msg='iii : looking for ' + filename_swr |
---|
| 276 | ras = report(msg) |
---|
| 277 | fullfilename_swr = isafile(iodirout + filename_swr, NEW=0, /MUST_EXIST) |
---|
| 278 | IF fullfilename_swr[0] EQ '' THEN BEGIN |
---|
| 279 | msg = 'eee : the file ' + fullfilename_swr + ' was not found.' |
---|
| 280 | ras = report(msg) |
---|
| 281 | STOP |
---|
| 282 | ENDIF |
---|
| 283 | ; |
---|
| 284 | ; build lwr data filename |
---|
| 285 | filename_lwr='TropFlux_lwr_19890101_20091231.nc' |
---|
| 286 | ; |
---|
| 287 | ; check if this file exists |
---|
| 288 | msg='iii : looking for ' + filename_lwr |
---|
| 289 | ras = report(msg) |
---|
| 290 | fullfilename_lwr = isafile(iodirout + filename_lwr, NEW=0, /MUST_EXIST) |
---|
| 291 | IF fullfilename_lwr[0] EQ '' THEN BEGIN |
---|
| 292 | msg = 'eee : the file ' + fullfilename_lwr + ' was not found.' |
---|
| 293 | ras = report(msg) |
---|
| 294 | STOP |
---|
| 295 | ENDIF |
---|
| 296 | ; |
---|
| 297 | ; build t2m data filename |
---|
| 298 | filename_t2m='TropFlux_t2m_19890101_20091231.nc' |
---|
| 299 | ; |
---|
| 300 | ; check if this file exists |
---|
| 301 | msg='iii : looking for ' + filename_t2m |
---|
| 302 | ras = report(msg) |
---|
| 303 | fullfilename_t2m = isafile(iodirout + filename_t2m, NEW=0, /MUST_EXIST) |
---|
| 304 | IF fullfilename_t2m[0] EQ '' THEN BEGIN |
---|
| 305 | msg = 'eee : the file ' + fullfilename_t2m + ' was not found.' |
---|
| 306 | ras = report(msg) |
---|
| 307 | STOP |
---|
| 308 | ENDIF |
---|
| 309 | ; |
---|
| 310 | ; build q2m data filename |
---|
| 311 | filename_q2m='TropFlux_q2m_19890101_20091231.nc' |
---|
| 312 | ; |
---|
| 313 | ; check if this file exists |
---|
| 314 | msg='iii : looking for ' + filename_q2m |
---|
| 315 | ras = report(msg) |
---|
| 316 | fullfilename_q2m = isafile(iodirout + filename_q2m, NEW=0, /MUST_EXIST) |
---|
| 317 | IF fullfilename_q2m[0] EQ '' THEN BEGIN |
---|
| 318 | msg = 'eee : the file ' + fullfilename_q2m + ' was not found.' |
---|
| 319 | ras = report(msg) |
---|
| 320 | STOP |
---|
| 321 | ENDIF |
---|
| 322 | ; |
---|
| 323 | ; build wg data filename |
---|
| 324 | filename_wg='TropFlux_gustiness_19890101_20091231.nc' |
---|
| 325 | ; |
---|
| 326 | ; check if this file exists |
---|
| 327 | msg='iii : looking for ' + filename_wg |
---|
| 328 | ras = report(msg) |
---|
| 329 | fullfilename_wg = isafile(iodirout + filename_wg, NEW=0, /MUST_EXIST) |
---|
| 330 | IF fullfilename_wg[0] EQ '' THEN BEGIN |
---|
| 331 | msg = 'eee : the file ' + fullfilename_wg + ' was not found.' |
---|
| 332 | ras = report(msg) |
---|
| 333 | STOP |
---|
| 334 | ENDIF |
---|
| 335 | ; |
---|
[5] | 336 | da1=19880101 & da2=20101231 |
---|
[19] | 337 | ; |
---|
[20] | 338 | initncdf, fullfilename_msk |
---|
[19] | 339 | msk=ncdf_lec(fullfilename_msk,var='msk') |
---|
[5] | 340 | |
---|
[74] | 341 | initncdf, fullfilename_sst |
---|
[5] | 342 | |
---|
[74] | 343 | ws=read_ncdf('ws',da1,da2,file=fullfilename_ws,/nostr) |
---|
| 344 | wg=read_ncdf('wg',da1-1,da2,file=fullfilename_wg,/nostr) |
---|
[5] | 345 | tt=time & jpt=n_elements(time) |
---|
[74] | 346 | sst=read_ncdf('sst',da1,da2,file=fullfilename_sst,/nostr) |
---|
[5] | 347 | sst=reform(sst-273.15) |
---|
[74] | 348 | swd=read_ncdf('swr',da1,da2,file=fullfilename_swr,/nostr) |
---|
| 349 | lw=read_ncdf('lwr',da1,da2,file=fullfilename_lwr,/nostr) |
---|
[5] | 350 | swd=swd/0.94 ;; converting from net swr to downward swr |
---|
| 351 | |
---|
[74] | 352 | t2m=read_ncdf('t2m',da1,da2,file=fullfilename_t2m,/nostr)-273.15 ; in C |
---|
| 353 | q2m=read_ncdf('q2m',da1,da2,file=fullfilename_q2m,/nostr) ; in g/kg |
---|
[5] | 354 | |
---|
| 355 | w=sqrt(ws*ws+wg*wg) ;; wind corrected for gustiness |
---|
| 356 | w=ws |
---|
| 357 | tmask=msk |
---|
| 358 | help, ws,w,wg,u,sst,swd,t2m,q2m |
---|
| 359 | ocean=where(msk eq 1,compl=land) |
---|
| 360 | valmask=1.e20 |
---|
| 361 | time=tt & jpt=n_elements(time) |
---|
| 362 | |
---|
| 363 | ; |
---|
| 364 | ;; Constants for flux computation |
---|
| 365 | ; |
---|
| 366 | zu=10. ; height of wind speed measurement (m) |
---|
| 367 | us=0. ; surf current (m/s) |
---|
| 368 | zt=2. ; Height of air T measurement (m) |
---|
| 369 | zq=2. ; height of humidity measurement (m) |
---|
| 370 | P=1008. ; Pressure |
---|
| 371 | zi=600. ; Inversion height (m) |
---|
| 372 | jcool=0 ; Compute cool-skin |
---|
| 373 | jwave=0 ; No waves |
---|
| 374 | twave=5. |
---|
| 375 | hwave=1. |
---|
| 376 | |
---|
| 377 | caldat, time,mon,day,yea |
---|
| 378 | swr=fltarr(jpi,jpj,jpt)+1.e20 |
---|
| 379 | lwr=fltarr(jpi,jpj,jpt)+1.e20 |
---|
| 380 | lat=fltarr(jpi,jpj,jpt)+1.e20 |
---|
| 381 | sen=fltarr(jpi,jpj,jpt)+1.e20 |
---|
| 382 | lwnet_clrk=fltarr(jpi,jpj,jpt)+1.e20 |
---|
| 383 | ;Ch=fltarr(jpi,jpj,jpt)+1.e20 |
---|
| 384 | ;Ce=fltarr(jpi,jpj,jpt)+1.e20 |
---|
| 385 | junk=fltarr(jpi,jpj,jpt)+1.e20 |
---|
| 386 | |
---|
| 387 | for jt=0,jpt-1 do begin |
---|
| 388 | jday=time(jt)-julday(1,1,yea(jt)) |
---|
| 389 | print, 'Computing Fluxes ',jt,' / ',jpt-1 |
---|
| 390 | ; |
---|
| 391 | ; P=msl(*,*,jt) & P=P(ocean) |
---|
| 392 | wn=w(*,*,jt) & wn=wn(ocean) ; wind speed (m/s) |
---|
| 393 | ts=sst(*,*,jt) & ts=ts(ocean) ; Bulk sst (°C) |
---|
| 394 | t=t2m(*,*,jt) & t=t(ocean) ; 2m Air T (°C) |
---|
| 395 | qs=qsee(ts,P) ; Sea surface sat. spec. humidity (g/kg) |
---|
| 396 | q=q2m(*,*,jt) & q=q(ocean) ; 2m AIr specific humidity (g/kg) |
---|
| 397 | Rs=swd(*,*,jt) & Rs=Rs(ocean) ; Downward solar flux (W/m2) |
---|
| 398 | ylat=gphit(ocean) |
---|
| 399 | ; cld=calc_cloud(jday,Rs,ylat) |
---|
| 400 | cld=calc_cloud_vlat(jday,Rs,ylat) |
---|
| 401 | ; Rl=lwdown_clark(ts,q,cld,t,P) ; Downward IR flux (W/m2) |
---|
| 402 | Rl=lw(*,*,jt) & Rl=Rl(ocean) |
---|
| 403 | rain=0. |
---|
| 404 | lw_clrk=-lwnet_clark(ts,q,cld,t,P) |
---|
| 405 | ; junk(*,*,jt)=lw_clrk |
---|
| 406 | ; |
---|
| 407 | ;stop |
---|
| 408 | y=cor30a(wn,us,ts,t,Qs,Q,Rs,Rl,rain,zi,P,zu,zt,zq,ylat,jcool,jwave,twave,hwave) |
---|
| 409 | ; |
---|
| 410 | |
---|
| 411 | ; A few punctual missing values (coare does not converge): filled by spatial extrapolation |
---|
| 412 | 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) |
---|
| 413 | 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) |
---|
| 414 | 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) |
---|
| 415 | 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) |
---|
| 416 | ; 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) |
---|
| 417 | ; 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) |
---|
| 418 | ; 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) |
---|
| 419 | endfor |
---|
| 420 | tt=time |
---|
| 421 | time=timegen(7670, start=julday(1,1,1989,0), units='days') & jpt=n_elements(time) |
---|
[7] | 422 | ; |
---|
[5] | 423 | cda0=string(jul2date(time(0)),format='(i8.8)') |
---|
| 424 | cda1=string(jul2date(time(jpt-1)),format='(i8.8)') |
---|
| 425 | tt=time-julday(1,1,1950,00,00,00) |
---|
| 426 | xlon=reform(glamt(*,0) ) & ylat=reform(gphit(0,*)) |
---|
| 427 | |
---|
[74] | 428 | ncfile='!${PROJECT_OD}/TropFlux_19890101_20091231.nc' |
---|
[5] | 429 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
| 430 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
| 431 | swr_attr={units:'W/m2',missing_value:valmask,long_name:'Surface net shortwave radiation',short_name:'swr',axis:'TYX'} |
---|
| 432 | lwr_attr={units:'W/m2',missing_value:valmask,long_name:'Surface net longwave radiation',short_name:'lwr',axis:'TYX'} |
---|
| 433 | lwr_clrk_attr={units:'W/m2',missing_value:valmask,long_name:'Surface net longwave radiation from clark',short_name:'lwr',axis:'TYX'} |
---|
| 434 | lhf_attr={units:'W/m2',missing_value:valmask,long_name:'Surface latent flux',short_name:'lhf',axis:'TYX'} |
---|
| 435 | shf_attr={units:'W/m2',missing_value:valmask,long_name:'Surface sensible flux',short_name:'shf',axis:'TYX'} |
---|
| 436 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
| 437 | Ch_attr={units:'',missing_value:valmask,long_name:'heat transfer coefficient at zt',short_name:'Ch',axis:'TYX'} |
---|
| 438 | Ce_attr={units:'',missing_value:valmask,long_name:'moisture transfer coefficient at zq',short_name:'Ce',axis:'TYX'} |
---|
| 439 | |
---|
| 440 | globattr={source:'Fluxes for the Global Tropical Ocean - TropFlux',timerange:cda0+' - '+cda1} |
---|
| 441 | |
---|
| 442 | help, swr,lwr,lat,sen,tt,xlon,ylat |
---|
| 443 | |
---|
| 444 | ncfields = 'swr[longitude,latitude,time]=swr:swr_attr; ' $ |
---|
| 445 | ; +'lwr_coare[longitude,latitude,time]=lwr:lwr_attr; ' $ |
---|
| 446 | +'lwr[longitude,latitude,time]=lwnet_clrk:lwr_clrk_attr; ' $ |
---|
| 447 | +'lhf[longitude,latitude,time]=lat:lhf_attr; ' $ |
---|
| 448 | +'shf[longitude,latitude,time]=sen:shf_attr; ' $ |
---|
| 449 | ; +'Ch[longitude,latitude,time]=Ch:Ch_attr; ' $ |
---|
| 450 | ; +'Ce[longitude,latitude,time]=Ce:Ce_attr; ' $ |
---|
| 451 | + 'longitude[]=xlon:lon_attr; ' $ |
---|
| 452 | + 'latitude[]=ylat:lat_attr; ' $ |
---|
| 453 | + 'tt[*time]=tt:time_attr ' $ |
---|
| 454 | + ' @ globattr' |
---|
| 455 | |
---|
| 456 | @ncdf_quickwrite |
---|
| 457 | |
---|
| 458 | end |
---|