Changeset 155 for trunk


Ignore:
Timestamp:
03/06/12 14:29:04 (12 years ago)
Author:
pinsard
Message:

interp_erai_t2m is now a function

Location:
trunk
Files:
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/adm/guides/data_content.rst

    r110 r155  
    131131 - :ref:`get_oaflux.sh` 
    132132 
    133  - :ref:`oaflux_mask_30N30S.pro` 
     133 - :func:`oaflux_mask_30n30s` 
    134134 
    135135 - :ref:`TropFlux_19890101_20091231.pro` 
     
    138138 - :ref:`interp_erai_lwr_1989_2009.pro` 
    139139 - :ref:`interp_erai_sst_1989_2009.pro` 
    140  - :ref:`interp_erai_t2m_1989_2009.pro` 
     140 - :func:`interp_erai_t2m` 
    141141 - :ref:`interp_erai_ws_1989_2009.pro` 
    142142 - :ref:`interp_olr_30n30s_1989_2009.pro` 
  • trunk/adm/guides/generate_tropflux.rst

    r110 r155  
    6969 
    7070   - :ref:`get_oaflux.sh` 
    71    - :ref:`oaflux_mask_30N30S.pro` 
     71   - :func:`oaflux_mask_30n30s` 
    7272 
    7373ERA-I data 
     
    101101 - :ref:`interp_erai_sst_1989_2009.pro` 
    102102 - :ref:`interp_erai_msl_1989_2009.pro` 
    103  - :ref:`interp_erai_t2m_1989_2009.pro` 
     103 - :func:`interp_erai_t2m` 
    104104 - :ref:`interp_erai_ws_1989_2009.pro` 
    105105 
  • trunk/src/d2m_to_q2m_erai.pro

    r100 r155  
    1919; ++ 
    2020; has been produced by 
    21 ; :ref:`interp_erai_t2m_1989_2009.pro`. 
     21; :func:`interp_erai_t2m`. 
    2222; 
    2323; :file:`${PROJECT_OD}/erai_msl_19890101_20091231_oafluxgrid.nc` 
     
    7676; :ref:`interp_erai_dewt_1989_2009.pro` 
    7777; :ref:`interp_erai_msl_1989_2009.pro` 
    78 ; :ref:`interp_erai_t2m_1989_2009.pro` 
     78; :func:`interp_erai_t2m` 
    7979; 
    8080; :ref:`q2m_correction_ncdf.pro` 
  • trunk/src/interp_erai_t2m.pro

    r153 r155  
    11;+ 
    22; 
    3 ; .. _interp_erai_t2m_1989_2009.pro: 
    4 ; 
    5 ; ============================= 
    6 ; interp_erai_t2m_1989_2009.pro 
    7 ; ============================= 
     3; =================== 
     4; interp_erai_t2m.pro 
     5; =================== 
     6; 
     7; .. function interp_erai_t2m(yyyymmddb,yyyymmdde) 
    88; 
    99; DESCRIPTION 
     
    2525; Interpolated t2 
    2626; is written in 
    27 ; :file:`${PROJECT_OD}/erai_t2m_19890101_20091231_oafluxgrid.nc` 
     27; :file:`${PROJECT_OD}/erai_t2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 
    2828; if this file not already exists. 
    2929; 
    3030; This output file 
    31 ; :file:`${PROJECT_OD}/erai_t2m_19890101_20091231_oafluxgrid.nc` 
     31; :file:`${PROJECT_OD}/erai_t2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 
    3232; must be processed after by 
    3333; :ref:`t2m_correction_ncdf.pro`. 
     
    4141;     .. graphviz:: 
    4242; 
    43 ;        digraph interp_erai_t2m_1989_2009 { 
     43;        digraph interp_erai_t2m { 
    4444; 
    4545;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/20c3m_erai_t2_TROP_1989_2009.nc"]; 
    4646;           mask [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/mask_oaflux_30N30S.nc"]; 
    47 ;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_t2m_19890101_20091231_oafluxgrid.nc"]; 
    48 ; 
    49 ;           interp_erai_t2m_1989_2009 [shape=box, 
     47;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_t2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc"]; 
     48; 
     49;           interp_erai_t2m [shape=box, 
    5050;           fontname=Courier, 
    5151;           color=blue, 
    52 ;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_t2m_1989_2009.pro", 
    53 ;           label="${PROJECT}/src/interp_erai_t2m_1989_2009.pro"]; 
    54 ; 
    55 ;           {file_in mask} -> {interp_erai_t2m_1989_2009} -> {file_out} 
     52;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_t2m.pro", 
     53;           label="${PROJECT}/src/interp_erai_t2m.pro"]; 
     54; 
     55;           {file_in mask} -> {interp_erai_t2m} -> {file_out} 
    5656; 
    5757;        } 
     
    8787; 
    8888;  IDL> .compile file_interp 
    89 ;  IDL> interp_erai_t2m_1989_2009 
     89;  IDL> yyyymmddb = 19890101 
     90;  IDL> yyyymmdde = 20091231 
     91;  IDL> result = interp_erai_t2m(yyyymmddb, yyymmdde) 
     92;  IDL> print, result 
    9093; 
    9194; TODO 
    9295; ==== 
     96; 
     97; scientific validation (starnge look of data with ncview now) 
     98; 
     99; check [yyyymmddb,yyyymmdde] validity 
     100; 
     101; check if [yyyymmddb,yyyymmdde] is included in ERA-I file 
     102; 
     103; what happen if yyyymmdde > 20091231 : need to read an other ERA-I file 
     104; 
     105; add an example with only one month (ie 200912) 
    93106; 
    94107; make it work : pb on loholt1 idl8 
     
    125138; see :func:`file_interp <saxo:file_interp>` 
    126139; 
    127 ; use as input a file produced by compute_erai_daily_region_2d.sh 
     140; use as input a file produced by compute_erai_daily_region_2d.sh or  
     141; get_erai.py + grib to netcdf conversion 
    128142; 
    129143; coding rules 
     
    150164; $Id$ 
    151165; 
    152 ; $URL: svn+ssh://pinsard@forge.ipsl.jussieu.fr/ipsl/forge/projets/tropflux/svn/trunk/src/interp_erai_t2m_1989_2009.pro $ 
     166; $URL: svn+ssh://pinsard@forge.ipsl.jussieu.fr/ipsl/forge/projets/tropflux/svn/trunk/src/interp_erai_t2m.pro $ 
     167; 
     168; - fplod 20120306 
     169; 
     170;   * pro -> function 
    153171; 
    154172; - pinsard 2011-08-23T09:09:16Z loholt1.ipsl.polytechnique.fr (Linux) 
     
    213231; 
    214232;- 
    215 pro interp_erai_t2m_1989_2009 
     233function interp_erai_t2m $ 
     234         , yyyymmddb $ 
     235         , yyyymmdde 
    216236; 
    217237@cm_4cal 
     
    221241@cm_project 
    222242; 
     243; Return to caller if errors 
     244ON_ERROR, 2 
     245; 
     246result = -1 
     247; 
     248usage = 'result = interp_erai_t2m(yyyymmddb, yyyymmdde) 
     249nparam = N_PARAMS() 
     250IF (nparam NE 2) THEN BEGIN 
     251   ras = report(['Incorrect number of arguments.' $ 
     252         + '!C' $ 
     253         + 'Usage : ' + usage]) 
     254   return, -1 
     255ENDIF 
     256 
    223257; check for input directory 
    224258; 
     
    228262     msg = 'eee : ${PROJECT_ID} is not defined' 
    229263     ras = report(msg) 
    230      STOP 
     264     return, result 
    231265           END 
    232266 ELSE: BEGIN 
     
    242276   msg = 'eee : the directory' + iodirin  + ' is not accessible.' 
    243277   ras = report(msg) 
    244    STOP 
     278   return, result 
    245279ENDIF 
    246280; 
     
    255289   msg = 'eee : the file ' + fullfilename_msk + ' was not found.' 
    256290   ras = report(msg) 
    257    STOP 
     291   return, result 
    258292ENDIF 
    259293; 
     
    268302   msg = 'eee : the file ' + fullfilename_t2 + ' was not found.' 
    269303   ras = report(msg) 
    270    STOP 
     304   return, result 
    271305ENDIF 
    272306; 
     
    276310         msg = 'eee : ${PROJECT_OD} is not defined' 
    277311         ras = report(msg) 
    278        STOP 
     312       return, result 
    279313       END 
    280314  ELSE: BEGIN 
     
    291325    msg = 'eee : the directory' + iodirout  + ' was not found.' 
    292326    ras = report(msg) 
    293     STOP 
     327    return, result 
    294328ENDIF 
    295329; 
    296330; build output filename 
    297 filename_out = 'erai_t2m_19890101_20091231_oafluxgrid.nc' 
     331filename_out = 'erai_t2m_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_oafluxgrid.nc' 
    298332fullfilename_out = iodirout + filename_out 
    299333; in order to avoid unexpected overwritten 
     
    301335   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
    302336   ras = report(msg) 
    303    STOP 
     337   return, result 
    304338ENDIF 
    305339; 
     
    387421@ncdf_quickwrite 
    388422; 
     423result = 0 
     424return, result 
     425; 
    389426end 
  • trunk/src/oaflux_mask_30n30s.pro

    r153 r155  
    4747; 
    4848; Environement : 
    49 ; :ref:`project_profile.sh`,  
     49; :ref:`project_profile.sh`, 
    5050; :ref:`project_init.pro`, 
    5151; :ref:`cm_project.pro` 
     
    6666; :ref:`interp_erai_lwr_1989_2009.pro`, 
    6767; :ref:`interp_erai_sst_1989_2009.pro`, 
    68 ; :ref:`interp_erai_t2m_1989_2009.pro`, 
     68; :func:`interp_erai_t2m`, 
    6969; :ref:`interp_erai_ws_1989_2009.pro`, 
    7070; :ref:`interp_olr_30n30s_1989_2009.pro` 
     
    147147   ras = report(['Incorrect number of arguments.' $ 
    148148         + '!C' $ 
    149         + 'Usage : ' + usage]) 
    150    return, -1 
     149        + 'Usage : ' + usage]) 
     150   return, result 
    151151ENDIF 
    152152; 
     
    162162   msg = 'eee : the file ' + fullfilename_in + ' was not found.' 
    163163   ras = report(msg) 
    164    return, -1 
     164   return, result 
    165165ENDIF 
    166166; 
     
    170170   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
    171171   ras = report(msg) 
    172    return, -1 
     172   return, result 
    173173ENDIF 
    174174; 
  • trunk/src/t2m_correction_ncdf.pro

    r100 r155  
    1414; air temperature at 2 m height from ERA-I interpolated on OAFLUX grid 
    1515; has been produced by 
    16 ; :ref:`interp_erai_t2m_1989_2009.pro`. 
     16; :func:`interp_erai_t2m`. 
    1717; 
    1818; Corrected air temperature at 2 m height 
     
    5656; :ref:`mooring_corrections` 
    5757; 
    58 ; :ref:`interp_erai_t2m_1989_2009.pro` 
     58; :func:`interp_erai_t2m` 
    5959; 
    6060; :func:`initncdf <saxo:initncdf>` 
  • trunk/src/tropflux.sh

    r153 r155  
    6565#   $ tropflux.sh -b 20060801 -e 20060802 
    6666# 
     67# A more global example:: 
     68# 
     69#   $ tropflux.sh -b 19890101 -e 20091231 
     70# 
    6771# And look at log file with :: 
    6872# 
     
    106110# 
    107111# $URL$ 
     112# 
     113# - pinsard 20120306 
     114# 
     115#   * create a pro IDL program to introduce LOGICAL_PREDICATE 
     116#     thanks to http://www.idlcoyote.com/code_tips/bitwiselogical.html 
    108117# 
    109118# - pinsard 20120305 
     
    267276# 
    268277cat >> ${PROJECT}/src/tropflux_${$}.pro << EOF 
    269 .compile file_interp 
     278pro tropflux_${$} 
     279compile_opt idl2, strictarrsubs, logical_predicate 
    270280result = oaflux_mask_30n30s() 
    271 if (result NE 0) THEN BEGIN 
    272    msg = 'eee : pb after oaflux_mask_30n30s' 
     281IF result < 0 THEN BEGIN 
     282   msg = 'eee : pb after oaflux_mask_30n30s' + string(result) 
    273283   err = report(msg) 
    274284   exit 
     
    278288;interp_erai_msl_1989_2009 
    279289;interp_erai_sst_1989_2009 
    280 ;interp_erai_t2m_1989_2009 
     290result = interp_erai_t2m(${yyyymmddb}, ${yyyymmdde}) 
     291IF result < 0 THEN BEGIN 
     292   msg = 'eee : pb after interp_erai_t2m' + string(result) 
     293   err = report(msg) 
     294   exit 
     295ENDIF 
    281296;interp_erai_ws_1989_2009 
    282297;interp_olr_30n30s_1989_2009 
     
    284299;++Program caused arithmetic error: Floating overflow 
    285300;++ Program caused arithmetic error: Floating illegal operand 
    286 .compile TropFlux_swr_DT_19890101_20071231 
    287 tropflux_swr_dt_19890101_20071231 
    288 .compile TropFlux_swr_NRT_19890101_20091231 
    289 tropflux_swr_nrt_19890101_20091231 
    290 .compile TropFlux_swr_BLND_19890101_20091231 
    291 tropflux_swr_blnd_19890101_20091231 
    292 lwr_correction_ncdf 
    293 q2m_correction_ncdf 
    294 sst_correction_ncdf 
    295 t2m_correction_ncdf 
    296 ws_correction_ncdf 
    297 cronin_gustiness_ncdf 
    298 .compile TropFlux_19890101_20091231 
    299 tropflux_19890101_20091231 
    300 .compile TropFlux_NRT_ncdf 
    301 tropflux_nrt_ncdf 
    302 exit 
     301;.compile TropFlux_swr_DT_19890101_20071231 
     302;tropflux_swr_dt_19890101_20071231 
     303;.compile TropFlux_swr_NRT_19890101_20091231 
     304;tropflux_swr_nrt_19890101_20091231 
     305;.compile TropFlux_swr_BLND_19890101_20091231 
     306;tropflux_swr_blnd_19890101_20091231 
     307;lwr_correction_ncdf 
     308;q2m_correction_ncdf 
     309;sst_correction_ncdf 
     310;t2m_correction_ncdf 
     311;ws_correction_ncdf 
     312;cronin_gustiness_ncdf 
     313;.compile TropFlux_19890101_20091231 
     314;tropflux_19890101_20091231 
     315;.compile TropFlux_NRT_ncdf 
     316;tropflux_nrt_ncdf 
     317end 
    303318EOF 
    304319# 
    305320# run IDL or equivalent 
    306321${IDL_CMD} << EOF >> ${log} 2>&1 
    307 @tropflux_${$} 
     322.compile file_interp 
     323tropflux_${$} 
    308324EOF 
    309325status=${?} 
Note: See TracChangeset for help on using the changeset viewer.