Changeset 167 for trunk/src


Ignore:
Timestamp:
03/19/12 18:51:42 (12 years ago)
Author:
pinsard
Message:

interp_erai_lwr is now a function

Location:
trunk/src
Files:
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/add_19890101.sh

    r101 r167  
    3131# ++ 
    3232# has been produced by 
    33 # :ref:`interp_erai_lwr_1989_2009.pro`. 
     33# :func:`interp_erai_lwr`. 
    3434# repeat the first time step in  
    3535# 
  • trunk/src/compute_erai_daily_region_2d.sh

    r164 r167  
    106106# :func:`divc <cdo:divc>` 
    107107# 
    108 # :ref:`interp_erai_dewt_1989_2009.pro` 
    109 # :ref:`interp_erai_lwr_1989_2009.pro` 
     108# :func:`interp_erai_dewt` 
     109# :func:`interp_erai_lwr` 
    110110# :ref:`interp_erai_sst_1989_2009.pro` 
    111111# :func:`interp_erai_t2m` 
  • trunk/src/d2m_to_q2m_erai.pro

    r166 r167  
    2626; has been 
    2727; produced by 
    28 ; :ref:`interp_erai_msl_1989_2009.pro`. 
     28; :func:`interp_erai_msl`. 
    2929; 
    3030; q2m on OAFLUX grid 
  • trunk/src/interp_erai_dewt.pro

    r166 r167  
    183183result = -1 
    184184; 
    185 usage = 'result = interp_erai_t2m(yyyymmddb, yyyymmdde) 
     185usage = 'result = interp_erai_dewt(yyyymmddb, yyyymmdde) 
    186186nparam = N_PARAMS() 
    187187IF (nparam NE 2) THEN BEGIN 
  • trunk/src/interp_erai_lwr.pro

    r164 r167  
    11;+ 
    22; 
    3 ; .. _interp_erai_lwr_1989_2009.pro: 
    4 ; 
    5 ; ============================= 
    6 ; interp_erai_lwr_1989_2009.pro 
    7 ; ============================= 
     3; 
     4; =================== 
     5; interp_erai_lwr.pro 
     6; =================== 
     7; 
     8; .. function:: interp_erai_lwr(yyyymmddb,yyyymmdde) 
    89; 
    910; DESCRIPTION 
     
    2425; Interpolated str 
    2526; is written in 
    26 ; :file:`${PROJECT_OD}/erai_lwr_19890102_20091231_oafluxgrid.nc` 
     27; :file:`${PROJECT_OD}/erai_lwr_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 
    2728; if this file not already exists. 
    2829; 
    2930; This output file 
    30 ; :file:`${PROJECT_OD}/erai_lwr_19890102_20091231_oafluxgrid.nc` 
     31; :file:`${PROJECT_OD}/erai_lwr_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 
    3132; must be processed after by 
    3233; :ref:`add_19890101.sh`. 
     
    4041;     .. graphviz:: 
    4142; 
    42 ;        digraph interp_erai_lwr_1989_2009 { 
     43;        digraph interp_erai_lwr { 
    4344; 
    4445;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/20c3m_erai_str_TROP_1989_2009.nc"]; 
    4546;           mask [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/mask_oaflux_30N30S.nc"]; 
    46 ;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_lwr_19890102_20091231_oafluxgrid.nc"]; 
    47 ; 
    48 ;           interp_erai_lwr_1989_2009 [shape=box, 
     47;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_lwr_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc"]; 
     48; 
     49;           interp_erai_lwr [shape=box, 
    4950;           fontname=Courier, 
    5051;           color=blue, 
    51 ;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_lwr_1989_2009.pro", 
    52 ;           label="${PROJECT}/src/interp_erai_lwr_1989_2009.pro"]; 
    53 ; 
    54 ;           {file_in mask} -> {interp_erai_lwr_1989_2009} -> {file_out} 
     52;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_lwr.pro", 
     53;           label="${PROJECT}/src/interp_erai_lwr.pro"]; 
     54; 
     55;           {file_in mask} -> {interp_erai_lwr} -> {file_out} 
    5556; 
    5657;        } 
     
    6061; 
    6162; :ref:`interpolate_data` 
     63; 
     64; Used by :ref:`tropflux.sh` 
    6265; 
    6366; :ref:`project_profile.sh` 
     
    8083; 
    8184;  IDL> .compile file_interp 
    82 ;  IDL> interp_erai_lwr_1989_2009 
     85;  IDL> yyyymmddb = 19890101 
     86;  IDL> yyyymmdde = 20091231 
     87;  IDL> result = interp_erai_lwr(yyyymmddb, yyymmdde) 
     88;  IDL> print, result 
    8389; 
    8490; TODO 
     
    9298; 
    9399;   lwr[longitude,latitude,time]=lwrout:lwr_attr; longitude[]=xlon:lon_attr; latitude[]=ylat:lat_attr; tt[*time]=tt:time_attr  @ globattr 
    94 ;   % NCDF_VARPUT: Operation Failed, bad file (4) or variable (0) id ? 
     100;   % NCDF_VARPUT: Operation Failed, bad file (4) or variable [0] id ? 
    95101;                  (NC_ERROR=-31) 
    96102;   % Stop encountered: INTERP_ERAI_LWR_1989_2009    1 
     
    106112; dataset to 19890101 using nco after this processing. see :ref:`compute_erai_daily_region_2d.sh` 
    107113; 
     114; st and en not used 
     115; 
     116; check if there is the same issue with 19790101 vs 19790102. 
     117; 
    108118; coding rules 
    109119; 
     
    119129; $Id$ 
    120130; 
    121 ; $URL: svn+ssh://pinsard@forge.ipsl.jussieu.fr/ipsl/forge/projets/tropflux/svn/trunk/src/interp_erai_lwr_1989_2009.pro $ 
     131; $URL: svn+ssh://pinsard@forge.ipsl.jussieu.fr/ipsl/forge/projets/tropflux/svn/trunk/src/interp_erai_lwr.pro $ 
     132; 
     133; - fplod 20120319 
     134; 
     135;   * taking project_overwite into account 
     136;   * try to add compile_opt seems to be incompatible with ncdf_quickwrite 
     137;   * pro -> function 
    122138; 
    123139; - fplod 20110830T145010Z cratos (Linux) 
     
    173189; 
    174190;- 
    175 pro interp_erai_lwr_1989_2009 
     191function interp_erai_lwr $ 
     192         , yyyymmddb $ 
     193         , yyyymmdde 
     194; 
     195;++compile_opt idl2, strictarrsubs, logical_predicate 
    176196; 
    177197@cm_4cal 
     
    181201@cm_project 
    182202; 
     203; Return to caller if errors 
     204ON_ERROR, 2 
     205; 
     206result = -1 
     207; 
     208usage = 'result = interp_erai_lwr(yyyymmddb, yyyymmdde) 
     209nparam = N_PARAMS() 
     210IF (nparam NE 2) THEN BEGIN 
     211   ras = report(['Incorrect number of arguments.' $ 
     212         + '!C' $ 
     213         + 'Usage : ' + usage]) 
     214   return, result 
     215ENDIF 
     216; 
    183217; check for input directory 
    184218; 
     
    188222     msg = 'eee : ${PROJECT_ID} is not defined' 
    189223     ras = report(msg) 
    190      STOP 
     224     return, result 
    191225           END 
    192226 ELSE: BEGIN 
     
    202236   msg = 'eee : the directory' + iodirin  + ' is not accessible.' 
    203237   ras = report(msg) 
    204    STOP 
     238   return, result 
    205239ENDIF 
    206240; 
     
    215249   msg = 'eee : the file ' + fullfilename_msk + ' was not found.' 
    216250   ras = report(msg) 
    217    STOP 
     251   return, result 
    218252ENDIF 
    219253; 
     
    231265   msg = 'eee : the file ' + fullfilename + ' was not found.' 
    232266   ras = report(msg) 
    233    STOP 
     267   return, result 
    234268ENDIF 
    235269; 
     
    239273         msg = 'eee : ${PROJECT_OD} is not defined' 
    240274         ras = report(msg) 
    241        STOP 
     275       return, result 
    242276       END 
    243277  ELSE: BEGIN 
     
    254288    msg = 'eee : the directory' + iodirout  + ' was not found.' 
    255289    ras = report(msg) 
    256     STOP 
     290    return, result 
    257291ENDIF 
    258292; 
    259293; build output filename 
    260 filename_out = 'erai_lwr_19890102_20091231_oafluxgrid.nc' 
     294filename_out = 'erai_lwr_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_oafluxgrid.nc' 
    261295fullfilename_out = iodirout + filename_out 
    262296; in order to avoid unexpected overwritten 
    263 IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     297IF ((FILE_TEST(fullfilename_out) EQ 1)  AND (project_overwrite EQ 0)) THEN BEGIN 
    264298   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
    265299   ras = report(msg) 
    266    STOP 
     300   return, result 
    267301ENDIF 
    268302; 
     
    273307initncdf, fullfilename 
    274308domdef 
    275 latin=reform(gphit(0,*)) 
    276 lonin=reform(glamt(*,0)) 
    277 print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) 
    278 print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) 
     309latin=reform(gphit[0,*]) 
     310lonin=reform(glamt[*,0]) 
     311print, 'lat grid ',min(latin),max(latin),latin[1]-latin[0] 
     312print, 'lon grid ',min(lonin),max(lonin),lonin[1]-lonin[0] 
    279313; 
    280314jptin=jpt 
    281 tab=lwrin(*,*,0) 
     315tab=lwrin[*,*,0] 
    282316mskin=glamt*0.+1. 
    283317; 
    284318initncdf, fullfilename_msk 
    285319domdef 
    286 latout=reform(gphit(0,*)) 
    287 lonout=reform(glamt(*,0)) 
    288 print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0) 
    289 print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0) 
     320latout=reform(gphit[0,*]) 
     321lonout=reform(glamt[*,0]) 
     322print, 'lat grid ',min(latout),max(latout),latout[1]-latout[0] 
     323print, 'lon grid ',min(lonout),max(lonout),lonout[1]-lonout[0] 
    290324mskout=read_ncdf("msk", file=fullfilename_msk,/nostr) 
    291325; 
     
    295329  ; ++print, 'Interpolation jt=',jt,' / ',jptin-1 
    296330; 
    297   tab=reform(lwrin(*,*,jt)) 
    298   lwrout(*,*,jt)=call_interp2d(tab,lonin,latin,mskin $ 
     331  tab=reform(lwrin[*,*,jt]) 
     332  lwrout[*,*,jt]=call_interp2d(tab,lonin,latin,mskin $ 
    299333      , lonout,latout,method='bilinear' $ 
    300334      , OUTMASK_IND=mskout, SET_OUTMSKVAL=mskout) 
    301   lwrout(*,*,jt)=lwrout(*,*,jt)*mskout+(1.-mskout)*1.e20 
     335  lwrout[*,*,jt]=lwrout[*,*,jt]*mskout+(1.-mskout)*1.e20 
    302336; 
    303337endfor 
     
    305339time=timegen(7669, start=julday(1,2,1989,0), units='days') 
    306340jpt=n_elements(time) 
    307 cda0=string(jul2date(time(0)),format='(i8.8)') 
    308 cda1=string(jul2date(time(jpt-1)),format='(i8.8)') 
     341cda0=string(jul2date(time[0]),format='(i8.8)') 
     342cda1=string(jul2date(time[jpt-1]),format='(i8.8)') 
    309343time=time-julday(1,1,1950,00,00,00) 
    310344; 
     
    326360@ncdf_quickwrite 
    327361; 
     362result = 0 
     363return, result 
     364; 
    328365end 
  • trunk/src/lwr_correction_ncdf.pro

    r100 r167  
    1313; ++ 
    1414; have been produced by 
    15 ; :ref:`add_19890101.sh`. 
     15; :func:`interp_erai_lwr` and :ref:`add_19890101.sh`. 
    1616; 
    1717; Corrected lwr on OAFLUX grid 
     
    5555; :ref:`mooring_corrections` 
    5656; 
    57 ; :ref:`add_19890101.sh` 
     57; :func:`interp_erai_lwr` and :ref:`add_19890101.sh` 
    5858; 
    5959; :func:`initncdf <saxo:initncdf>` 
     
    9797; - fplod 20110819T105050Z aedon.locean-ipsl.upmc.fr (Darwin) 
    9898; 
    99 ;   * replace previous step :ref:`interp_erai_lwr_1989_2009.pro` 
     99;   * replace previous step interp_erai_lwr_1989_2009.pro 
    100100;     by :ref:`add_19890101.sh` 
    101101;   * change 19890102 to 19890101 
  • trunk/src/oaflux_mask_30n30s.pro

    r166 r167  
    6464; :ref:`TropFlux_19890101_20091231.pro`, 
    6565; :func:`interp_erai_dewt`, 
    66 ; :ref:`interp_erai_lwr_1989_2009.pro`, 
     66; :func:`interp_erai_lwr`, 
    6767; :ref:`interp_erai_sst_1989_2009.pro`, 
    6868; :func:`interp_erai_t2m`, 
  • trunk/src/tropflux.sh

    r166 r167  
    9090# Use : 
    9191# :func:`oaflux_mask_30n30s`, :func:`interp_erai_t2m`,  
    92 # :func:`interp_erai_msl`, :func:`interp_erai_dewt`, etc. 
     92# :func:`interp_erai_msl`, :func:`interp_erai_dewt`, :func:`interp_erai_lwr`, 
     93# etc. 
    9394# 
    9495# Next step : +validation ++ comparison 
     
    117118#   * handling error of inter_erai_msl (now function) 
    118119#   * handling error of inter_erai_dewt (now function) 
     120#   * handling error of inter_erai_lwr (now function) 
    119121# 
    120122# - pinsard 20120306 
     
    303305   exit 
    304306ENDIF 
    305 ;interp_erai_lwr_1989_2009 
     307result = interp_erai_lwr(${yyyymmddb}, ${yyyymmdde}) 
     308IF result < 0 THEN BEGIN 
     309   msg = 'eee : pb after interp_erai_lwr' + string(result) 
     310   err = report(msg) 
     311   exit 
     312ENDIF 
    306313result = interp_erai_msl(${yyyymmddb}, ${yyyymmdde}) 
    307314IF result < 0 THEN BEGIN 
Note: See TracChangeset for help on using the changeset viewer.