Changeset 175 for trunk/src/tropflux.pro


Ignore:
Timestamp:
03/22/12 14:40:17 (12 years ago)
Author:
pinsard
Message:

an other bunch of new functions

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/tropflux.pro

    • Property svn:keywords changed from URL to Id URL
    r174 r175  
    11;+ 
    22; 
    3 ; .. _TropFlux_19890101_20091231.pro: 
    4 ; 
    5 ; ============================== 
    6 ; TropFlux_19890101_20091231.pro 
    7 ; ============================== 
     3; ============ 
     4; tropflux.pro 
     5; ============ 
     6; 
     7; .. function:: tropflux(yyyymmddb,yyyymmdde) 
     8; 
     9; DESCRITION 
     10; ========== 
    811; 
    912; This program computes net heat flux components on the 1° oaflux grid. 
     
    2023; :func:`oaflux_mask_30n30s`. 
    2124; 
    22 ; :file:`${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc` 
     25; :file:`${PROJECT_OD}/TropFlux_sst_{yyyymmdd}_{yyyymmdd}.nc` 
    2326; containing 
    2427; sst corrected on OAFLUX grid 
    2528; has been produced by 
    26 ; :ref:`sst_correction_ncdf.pro`. 
    27 ; 
    28 ; :file:`${PROJECT_OD}/TropFlux_ws_19890101_20091231.nc` 
     29; :func:`sst_correction_ncdf`. 
     30; 
     31; :file:`${PROJECT_OD}/TropFlux_ws_{yyyymmdd}_{yyyymmdd}.nc` 
    2932; containing 
    3033; ws corrected on OAFLUX grid 
    3134; has been produced by 
    32 ; :ref:`ws_correction_ncdf.pro`. 
    33 ; 
    34 ; :file:`${PROJECT_OD}/TropFlux_gustiness_19890101_20091231.nc` 
     35; :func:`ws_correction_ncdf`. 
     36; 
     37; :file:`${PROJECT_OD}/TropFlux_gustiness_{yyyymmdd}_{yyyymmdd}.nc` 
    3538; containing 
    3639; ++ 
     
    3841; :func:`cronin_gustiness_ncdf`. 
    3942; 
    40 ; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20091231_BLND.nc` 
     43; :file:`${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_BLND.nc` 
    4144; containing 
    4245; ws corrected on OAFLUX grid 
     
    4447; :func:`tropflux_swr_blnd`. 
    4548; 
    46 ; :file:`${PROJECT_OD}/TropFlux_lwr_19890101_20091231.nc` 
     49; :file:`${PROJECT_OD}/TropFlux_lwr_{yyyymmdd}_{yyyymmdd}.nc` 
    4750; containing 
    4851; lwr corrected on OAFLUX grid 
    4952; has been produced by 
    50 ; :ref:`lwr_correction_ncdf.pro`. 
     53; :func:`lwr_correction_ncdf`. 
    5154; 
    5255; containing 
    5356; t2m corrected on OAFLUX grid 
    5457; has been produced by 
    55 ; :ref:`t2m_correction_ncdf.pro`. 
    56 ; 
    57 ; :file:`${PROJECT_OD}/TropFlux_q2m_19890101_20091231.nc` 
     58; :func:`t2m_correction_ncdf`. 
     59; 
     60; :file:`${PROJECT_OD}/TropFlux_q2m_{yyyymmdd}_{yyyymmdd}.nc` 
    5861; containing 
    5962; q2m corrected on OAFLUX grid 
     
    6265; 
    6366; net heat flux components are written 
    64 ; in :file:`${PROJECT_OD}/TropFlux_19890101_20091231_coarev3.nc` 
     67; in :file:`${PROJECT_OD}/TropFlux_{yyyymmdd}_{yyyymmdd}_coarev3.nc` 
    6568; if this file not already exists. 
    6669; 
    6770; This output file 
    68 ; :file:`${PROJECT_OD}/TropFlux_19890101_20091231_coarev3.nc` 
     71; :file:`${PROJECT_OD}/TropFlux_{yyyymmdd}_{yyyymmdd}_coarev3.nc` 
    6972; will be used by 
    7073; :ref:`TropFlux_NRT_ncdf.pro`. 
     
    7275;     .. graphviz:: 
    7376; 
    74 ;        digraph tropflux_19890101_20091231 { 
     77;        digraph tropflux { 
    7578; 
    7679;           mask [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/mask_oaflux_30N30S.nc"]; 
    77 ;           file_sst [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc"]; 
    78 ;           file_ws [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_ws_19890101_20091231.nc"]; 
    79 ;           file_wg [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_gustiness_19890101_20091231.nc"]; 
    80 ;           file_swr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_19890101_20091231_BLND.nc"]; 
    81 ;           file_lwr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_lwr_19890101_20091231.nc"]; 
    82 ;           file_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_t2m_19890101_20091231.nc"]; 
    83 ;           file_q2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_q2m_19890101_20091231.nc"]; 
    84 ; 
    85 ;           file_out[shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_19890101_20091231_coarev3.nc"]; 
    86 ; 
    87 ;           tropflux_19890101_20091231 [shape=box, 
     80;           file_sst [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_sst_{yyyymmdd}_{yyyymmdd}.nc"]; 
     81;           file_ws [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_ws_{yyyymmdd}_{yyyymmdd}.nc"]; 
     82;           file_wg [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_gustiness_{yyyymmdd}_{yyyymmdd}.nc"]; 
     83;           file_swr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_{yyyymmdd}_{yyyymmdd}_BLND.nc"]; 
     84;           file_lwr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_lwr_{yyyymmdd}_{yyyymmdd}.nc"]; 
     85;           file_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_t2m_{yyyymmdd}_{yyyymmdd}.nc"]; 
     86;           file_q2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_q2m_{yyyymmdd}_{yyyymmdd}.nc"]; 
     87; 
     88;           file_out[shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_{yyyymmdd}_{yyyymmdd}_coarev3.nc"]; 
     89; 
     90;           tropflux [shape=box, 
    8891;           fontname=Courier, 
    8992;           color=blue, 
    90 ;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/TropFlux_19890101_20091231.pro", 
    91 ;           label="${PROJECT}/src/TropFlux_19890101_20091231.pro"]; 
    92 ; 
    93 ;           {mask file_sst file_ws file_wg file_swr file_lwr file_t2m file_q2m} -> {tropflux_19890101_20091231} -> {file_out} 
     93;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/tropflux.pro", 
     94;           label="${PROJECT}/src/tropflux.pro"]; 
     95; 
     96;           {mask file_sst file_ws file_wg file_swr file_lwr file_t2m file_q2m} -> {tropflux} -> {file_out} 
    9497; 
    9598;        } 
     
    99102; 
    100103; :ref:`project_profile.sh` 
     104; 
     105; Used by :ref:`tropflux.sh` 
    101106; 
    102107; :func:`report <saxo:report>` 
     
    124129; :: 
    125130; 
    126 ;  IDL> .compile TropFlux_19890101_20091231 
    127 ;  IDL> tropflux_19890101_20091231 
    128 ; 
     131;  IDL> yyyymmddb = 20000101L 
     132;  IDL> yyyymmdde = 20001231L 
     133;  IDL> result = tropflux(yyyymmddb, yyyymmdde) 
     134;  IDL> print, result 
     135 
    129136; TODO 
    130137; ==== 
    131138; 
    132139; describe usage of tau 
     140; 
     141; compare time between all inputs after reading 
    133142; 
    134143; make it work :: 
     
    180189;   wg=read_ncdf('wg',da1-1,da2,file=fullfilename_wg,/nostr) 
    181190; 
    182 ; avoid mix lower/uppercase in pro name to avoid compile 
    183 ; 
    184191; coding rules 
    185192; 
     
    196203; 
    197204; $URL$ 
     205; 
     206; - fplod 20120322 
     207; 
     208;   * pro -> func 
     209;   * rename with lower case TropFlux_19890101_20091231 become tropflux 
     210;   * taking project_overwite into account 
     211;   * try to add compile_opt 
     212;   * hard coded da1 and da2 replaced by yyyymmddb and yyyymmdde parameters 
     213;   * get rid of timegen 
    198214; 
    199215; - fplod 20110830T135832Z cratos (Linux) 
     
    241257;- 
    242258; 
    243 pro TropFlux_19890101_20091231 
     259function tropflux $ 
     260         , yyyymmddb $ 
     261         , yyyymmdde 
     262; 
     263compile_opt idl2, strictarrsubs, logical_predicate 
    244264; 
    245265@cm_4cal 
     
    249269@cm_project 
    250270; 
     271; Return to caller if errors 
     272ON_ERROR, 2 
     273; 
     274result = -1 
     275; 
     276usage = 'result = tropflux_swr_nrt(yyyymmddb, yyyymmdde)' 
     277nparam = N_PARAMS() 
     278IF (nparam NE 2) THEN BEGIN 
     279    ras = report(['Incorrect number of arguments.' $ 
     280          + '!C' $ 
     281          + 'Usage : ' + usage]) 
     282    return, result 
     283ENDIF 
     284; 
    251285; check for input directory 
    252286; 
     
    256290     msg = 'eee : ${PROJECT_ID} is not defined' 
    257291     ras = report(msg) 
    258      STOP 
     292     return, result 
    259293           END 
    260294 ELSE: BEGIN 
     
    270304   msg = 'eee : the directory' + iodirin  + ' is not accessible.' 
    271305   ras = report(msg) 
    272    STOP 
     306   return, result 
    273307ENDIF 
    274308; 
     
    283317   msg = 'eee : the file ' + fullfilename_msk + ' was not found.' 
    284318   ras = report(msg) 
    285    STOP 
     319   return, result 
    286320ENDIF 
    287321; 
     
    291325         msg = 'eee : ${PROJECT_OD} is not defined' 
    292326         ras = report(msg) 
    293        STOP 
     327       return, result 
    294328       END 
    295329  ELSE: BEGIN 
     
    306340   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
    307341   ras = report(msg) 
    308    STOP 
     342   return, result 
    309343ENDIF 
    310344; 
     
    313347    msg = 'eee : the directory' + iodirout  + ' was not found.' 
    314348    ras = report(msg) 
    315     STOP 
     349    return, result 
    316350ENDIF 
    317351; 
    318352; build sst data filename 
    319 filename_sst='TropFlux_sst_19890101_20091231.nc' 
     353filename_sst='TropFlux_sst_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
    320354; 
    321355; check if this file exists 
     
    326360   msg = 'eee : the file ' + fullfilename_sst + ' was not found.' 
    327361   ras = report(msg) 
    328    STOP 
     362   return, result 
    329363ENDIF 
    330364; 
    331365; build ws data filename 
    332 filename_ws='TropFlux_ws_19890101_20091231.nc' 
     366filename_ws='TropFlux_ws_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
    333367; 
    334368; check if this file exists 
     
    339373   msg = 'eee : the file ' + fullfilename_ws + ' was not found.' 
    340374   ras = report(msg) 
    341    STOP 
     375   return, result 
    342376ENDIF 
    343377; 
    344378; build swr data filename 
    345 filename_swr='TropFlux_swr_19890101_20091231_BLND.nc' 
     379filename_swr='TropFlux_swr_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_BLND.nc' 
    346380; 
    347381; check if this file exists 
     
    352386   msg = 'eee : the file ' + fullfilename_swr + ' was not found.' 
    353387   ras = report(msg) 
    354    STOP 
     388   return, result 
    355389ENDIF 
    356390; 
    357391; build lwr data filename 
    358 filename_lwr='TropFlux_lwr_19890101_20091231.nc' 
     392filename_lwr='TropFlux_lwr_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
    359393; 
    360394; check if this file exists 
     
    365399   msg = 'eee : the file ' + fullfilename_lwr + ' was not found.' 
    366400   ras = report(msg) 
    367    STOP 
     401   return, result 
    368402ENDIF 
    369403; 
    370404; build t2m data filename 
    371 filename_t2m='TropFlux_t2m_19890101_20091231.nc' 
     405filename_t2m='TropFlux_t2m_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
    372406; 
    373407; check if this file exists 
     
    378412   msg = 'eee : the file ' + fullfilename_t2m + ' was not found.' 
    379413   ras = report(msg) 
    380    STOP 
     414   return, result 
    381415ENDIF 
    382416; 
    383417; build q2m data filename 
    384 filename_q2m='TropFlux_q2m_19890101_20091231.nc' 
     418filename_q2m='TropFlux_q2m_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
    385419; 
    386420; check if this file exists 
     
    391425   msg = 'eee : the file ' + fullfilename_q2m + ' was not found.' 
    392426   ras = report(msg) 
    393    STOP 
     427   return, result 
    394428ENDIF 
    395429; 
    396430; build wg data filename 
    397 filename_wg='TropFlux_gustiness_19890101_20091231.nc' 
     431filename_wg='TropFlux_gustiness_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
    398432; 
    399433; check if this file exists 
     
    404438   msg = 'eee : the file ' + fullfilename_wg + ' was not found.' 
    405439   ras = report(msg) 
    406    STOP 
     440   return, result 
    407441ENDIF 
    408442; 
    409443; build output filename 
    410 filename_out = 'TropFlux_19890101_20091231_coarev3.nc' 
     444filename_out = 'TropFlux_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_coarev3.nc' 
    411445fullfilename_out = iodirout + filename_out 
    412446; in order to avoid unexpected overwritten 
     
    414448   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
    415449   ras = report(msg) 
    416    STOP 
    417 ENDIF 
    418 ; 
    419 da1=19880101 
    420 da2=20101231 
     450   return, result 
     451ENDIF 
    421452; 
    422453initncdf, fullfilename_msk 
     
    425456initncdf, fullfilename_sst 
    426457; 
    427 ws=read_ncdf('ws',da1,da2,file=fullfilename_ws,/nostr) 
    428 wg=read_ncdf('wg',da1-1,da2,file=fullfilename_wg,/nostr) 
     458ws=read_ncdf('ws',yyyymmddb-.5d,yyyymmdde,file=fullfilename_ws,/nostr) 
     459timein=24.d*(time-julday(1,1,1957,0,0,0)) 
     460jpt=n_elements(timein) 
     461da=jul2date(time[0]) 
     462cda0=string(da,format='(i8.8)') 
     463da=jul2date(time[jpt-1]) 
     464cda1=string(da,format='(i8.8)') 
     465print, 'ws in tropflux first date ', cda0 
     466print, 'ws in ws_correction_ncdf last date ' , cda1 
     467; 
     468wg=read_ncdf('wg',yyyymmddb-.5d-1,yyyymmdde,file=fullfilename_wg,/nostr) 
     469timein=24.d*(time-julday(1,1,1957,0,0,0)) 
     470jpt=n_elements(timein) 
     471da=jul2date(time[0]) 
     472cda0=string(da,format='(i8.8)') 
     473da=jul2date(time[jpt-1]) 
     474cda1=string(da,format='(i8.8)') 
     475print, 'wg in tropflux first date ', cda0 
     476print, 'wg in ws_correction_ncdf last date ' , cda1 
    429477tt=time 
    430478jpt=n_elements(time) 
    431 sst=read_ncdf('sst',da1,da2,file=fullfilename_sst,/nostr) 
     479sst=read_ncdf('sst',yyyymmddb-.5d,yyyymmdde,file=fullfilename_sst,/nostr) 
     480timein=24.d*(time-julday(1,1,1957,0,0,0)) 
     481jpt=n_elements(timein) 
     482da=jul2date(time[0]) 
     483cda0=string(da,format='(i8.8)') 
     484da=jul2date(time[jpt-1]) 
     485cda1=string(da,format='(i8.8)') 
     486print, 'sst in tropflux first date ', cda0 
     487print, 'sst in ws_correction_ncdf last date ' , cda1 
    432488sst=reform(sst-273.15) 
    433 swd=read_ncdf('swr',da1,da2,file=fullfilename_swr,/nostr) 
    434 lw=read_ncdf('lwr',da1,da2,file=fullfilename_lwr,/nostr) 
     489swd=read_ncdf('swr',yyyymmddb-.5d,yyyymmdde,file=fullfilename_swr,/nostr) 
     490timein=24.d*(time-julday(1,1,1957,0,0,0)) 
     491jpt=n_elements(timein) 
     492da=jul2date(time[0]) 
     493cda0=string(da,format='(i8.8)') 
     494da=jul2date(time[jpt-1]) 
     495cda1=string(da,format='(i8.8)') 
     496print, 'swr in tropflux first date ', cda0 
     497print, 'swr in ws_correction_ncdf last date ' , cda1 
     498lw=read_ncdf('lwr',yyyymmddb-.5d,yyyymmdde,file=fullfilename_lwr,/nostr) 
     499timein=24.d*(time-julday(1,1,1957,0,0,0)) 
     500jpt=n_elements(timein) 
     501da=jul2date(time[0]) 
     502cda0=string(da,format='(i8.8)') 
     503da=jul2date(time[jpt-1]) 
     504cda1=string(da,format='(i8.8)') 
     505print, 'lwr in tropflux first date ', cda0 
     506print, 'lwr in ws_correction_ncdf last date ' , cda1 
    435507swd=swd/0.94  ; converting from net swr to downward swr 
    436508; 
    437 t2m=read_ncdf('t2m',da1,da2,file=fullfilename_t2m,/nostr)-273.15   ; in C 
    438 q2m=read_ncdf('q2m',da1,da2,file=fullfilename_q2m,/nostr)    ; in g/kg 
     509t2m=read_ncdf('t2m',yyyymmddb-.5d,yyyymmdde,file=fullfilename_t2m,/nostr)-273.15   ; in C 
     510timein=24.d*(time-julday(1,1,1957,0,0,0)) 
     511jpt=n_elements(timein) 
     512da=jul2date(time[0]) 
     513cda0=string(da,format='(i8.8)') 
     514da=jul2date(time[jpt-1]) 
     515cda1=string(da,format='(i8.8)') 
     516print, 't2m in tropflux first date ', cda0 
     517print, 't2m in ws_correction_ncdf last date ' , cda1 
     518q2m=read_ncdf('q2m',yyyymmddb-.5d,yyyymmdde,file=fullfilename_q2m,/nostr)    ; in g/kg 
     519timein=24.d*(time-julday(1,1,1957,0,0,0)) 
     520jpt=n_elements(timein) 
     521da=jul2date(time[0]) 
     522cda0=string(da,format='(i8.8)') 
     523da=jul2date(time[jpt-1]) 
     524cda1=string(da,format='(i8.8)') 
     525print, 'q2m in tropflux first date ', cda0 
     526print, 'q2m in ws_correction_ncdf last date ' , cda1 
    439527; 
    440528w=sqrt(ws*ws+wg*wg)  ; wind corrected for gustiness 
     
    471559; 
    472560for jt=0,jpt-1 do begin 
    473   jday=time(jt)-julday(1,1,yea(jt)) 
     561  jday=time[jt]-julday(1,1,yea[jt]) 
    474562  print, 'Computing Fluxes ',jt,' / ',jpt-1 
    475563; 
     
    478566; 
    479567  ; wind speed (m/s) 
    480   wn=w(*,*,jt) 
    481   wn=wn(ocean) 
     568  wn=w[*,*,jt] 
     569  wn=wn[ocean] 
    482570  ; Bulk sst (°C) 
    483   ts=sst(*,*,jt) 
    484   ts=ts(ocean) 
     571  ts=sst[*,*,jt] 
     572  ts=ts[ocean] 
    485573  ; 2m Air T (°C) 
    486   t=t2m(*,*,jt) 
    487   t=t(ocean) 
     574  t=t2m[*,*,jt] 
     575  t=t[ocean] 
    488576  ; Sea surface sat. spec. humidity (g/kg) 
    489577  qs=qsee(ts,P) 
    490578  ; 2m AIr specific humidity  (g/kg) 
    491   q=q2m(*,*,jt) 
    492   q=q(ocean) 
     579  q=q2m[*,*,jt] 
     580  q=q[ocean] 
    493581  ; Downward solar flux (W/m2) 
    494   Rs=swd(*,*,jt) 
    495   Rs=Rs(ocean) 
    496   ylat=gphit(ocean) 
     582  Rs=swd[*,*,jt] 
     583  Rs=Rs[ocean] 
     584  ylat=gphit[ocean] 
    497585  ;  cld=calc_cloud(jday,Rs,ylat) 
    498586  cld=calc_cloud_vlat(jday,Rs,ylat) 
    499587  ; Downward IR flux (W/m2) 
    500588  ;  Rl=lwdown_clark(ts,q,cld,t,P) 
    501   Rl=lw(*,*,jt) 
    502   Rl=Rl(ocean) 
     589  Rl=lw[*,*,jt] 
     590  Rl=Rl[ocean] 
    503591  rain=0. 
    504592  lw_clrk=-lwnet_clark(ts,q,cld,t,P) 
    505 ;  junk(*,*,jt)=lw_clrk 
     593;  junk[*,*,jt]=lw_clrk 
    506594; 
    507595;stop 
     
    509597; A few punctual missing values (coare does not converge): filled by spatial extrapolation 
    510598  tab=fltarr(jpi,jpj)+!values.f_nan 
    511   x=reform(y(*,0)) 
    512   tab(ocean)=x 
     599  x=reform(y[*,0]) 
     600  tab[ocean]=x 
    513601  m=finite(tab) 
    514602  help, tab, m, swr 
    515603  tab=extrapolate(tab,m) 
    516   swr(*,*,jt)=tab*msk+valmask*(1-msk) 
     604  swr[*,*,jt]=tab*msk+valmask*(1-msk) 
    517605; 
    518606  tab=fltarr(jpi,jpj)+!values.f_nan 
    519   x=reform(y(*,1)) 
    520   tab(ocean)=x 
     607  x=reform(y[*,1]) 
     608  tab[ocean]=x 
    521609  m=finite(tab) 
    522610  help, tab, m, lwr 
     
    524612  print, 'www : extrapolation for lwr is not done' 
    525613  tab=tab 
    526   lwr(*,*,jt)=tab*msk+valmask*(1-msk) 
     614  lwr[*,*,jt]=tab*msk+valmask*(1-msk) 
    527615; 
    528616  tab=fltarr(jpi,jpj)+!values.f_nan 
    529   x=reform(y(*,2)) 
    530   tab(ocean)=x 
     617  x=reform(y[*,2]) 
     618  tab[ocean]=x 
    531619  m=finite(tab) 
    532620  help, tab, m, lat 
     
    534622  print, 'www : extrapolation for lat is not done' 
    535623  tab=tab 
    536   lat(*,*,jt)=tab*msk+valmask*(1-msk) 
     624  lat[*,*,jt]=tab*msk+valmask*(1-msk) 
    537625  tab=fltarr(jpi,jpj)+!values.f_nan 
    538   x=reform(y(*,3)) 
    539   tab(ocean)=x 
     626  x=reform(y[*,3]) 
     627  tab[ocean]=x 
    540628  m=finite(tab) 
    541629  help, tab, m, sen 
     
    543631  print, 'www : extrapolation for sen is not done' 
    544632  tab=tab 
    545   sen(*,*,jt)=tab*msk+valmask*(1-msk) 
    546   ;  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) 
    547   tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y(*,5)) & tab(ocean)=x & m=finite(tab) & tab=extrapolate(tab,m) & tau(*,*,jt)=tab*msk+valmask*(1-msk) 
    548   ;  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) 
    549   ;  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) 
    550   tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y(*,8)) & tab(ocean)=x & m=finite(tab) & tab=extrapolate(tab,m) & wg(*,*,jt)=tab*msk+valmask*(1-msk) 
     633  sen[*,*,jt]=tab*msk+valmask*(1-msk) 
     634  ;  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) 
     635  tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y[*,5]) & tab[ocean]=x & m=finite(tab) & tab=extrapolate(tab,m) & tau[*,*,jt]=tab*msk+valmask*(1-msk) 
     636  ;  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) 
     637  ;  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) 
     638  tab=fltarr(jpi,jpj)+!values.f_nan & x=reform(y[*,8]) & tab[ocean]=x & m=finite(tab) & tab=extrapolate(tab,m) & wg[*,*,jt]=tab*msk+valmask*(1-msk) 
    551639endfor 
    552 time=timegen(7670, start=julday(1,1,1989,0), units='days') 
    553640jpt=n_elements(time) 
    554641; 
    555 cda0=string(jul2date(time(0)),format='(i8.8)') 
    556 cda1=string(jul2date(time(jpt-1)),format='(i8.8)') 
     642cda0=string(jul2date(time[0]),format='(i8.8)') 
     643cda1=string(jul2date(time[jpt-1]),format='(i8.8)') 
    557644time=time-julday(1,1,1950,00,00,00) 
    558 xlon=reform(glamt(*,0) ) 
    559 ylat=reform(gphit(0,*)) 
     645xlon=reform(glamt[*,0]) 
     646ylat=reform(gphit[0,*]) 
    560647; 
    561648ncfile='!' + fullfilename_out 
     
    590677@ncdf_quickwrite 
    591678; 
     679result = 0 
     680return, result 
     681; 
    592682end 
Note: See TracChangeset for help on using the changeset viewer.