Changeset 80 for trunk/src


Ignore:
Timestamp:
08/11/11 17:29:34 (13 years ago)
Author:
pinsard
Message:

progress on humidity processing

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/d2m_to_q2m_erai.pro

    r77 r80  
    1919; 
    2020; q2m on OAFLUX grid is written in 
    21 ; :file:`${PROJECT_OD}/q2m_erai_19890101_20091231_oafluxgrid.nc` 
     21; :file:`${PROJECT_OD}/erai_q2m_19890101_20091231_oafluxgrid.nc` 
    2222; if this file not already exists. 
    2323; 
     
    3434;           file_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_t2m_19890101_20091231_oafluxgrid.nc"]; 
    3535;           file_msl [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_msl_19890101_20091231_oafluxgrid.nc"]; 
    36 ;           file_q2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_erai_19890101_20091231_oafluxgrid.nc"]; 
     36;           file_q2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_q2m_19890101_20091231_oafluxgrid.nc"]; 
    3737; 
    3838;           d2m_to_q2m_erai [shape=box, 
     
    4848; ======== 
    4949; 
     50; [Gill:AP:1982]_ 
     51; 
     52; [AOMIP]_ 
     53; 
    5054; :ref:`project_profile.sh` 
    5155; 
     
    7478; ==== 
    7579; 
    76 ; es0 undefined 
     80; pb on cratos idl7 even if output file is written:: 
     81; 
     82;   % Program caused arithmetic error: Floating overflow 
     83;   % Program caused arithmetic error: Floating illegal operand 
     84; 
     85; related to occurence of NaNf in ncdump output ? do no yet 
     86; 
     87; pk also see these error messages ... 
     88; 
     89; check for NaN value in P return by reading Netcdf msl file 
     90; solution is may be to apply *mskout to q2m like  in interp* tools 
     91; not yet done to keep close as possible to pk processing 
    7792; 
    7893; coding rules 
     
    8499;  
    85100; $URL$ 
     101; 
     102; - fplod 20110811T114932Z aedon.locean-ipsl.upmc.fr (Darwin) 
     103; 
     104;   * add es0 value 
     105;   * add reference 
     106;   * replace q2m_erai by erai_q2m in output filename 
    86107; 
    87108; - fplod 20110809T154249Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    186207; 
    187208; build output filename 
    188 filename_out = 'q2m_erai_19890101_20091231_oafluxgrid.nc' 
     209filename_out = 'erai_q2m_19890101_20091231_oafluxgrid.nc' 
    189210fullfilename_out = iodirout + filename_out 
    190211; in order to avoid unexpected overwritten 
     
    205226help, t, td 
    206227 
    207 ;;since the t2m and d2m are already in K, no need for conversion 
    208  
     228;since the t2m and d2m are already in K, no need for conversion 
     229es0=6.11 
    209230e=es0*exp((25.e5/461.5)*((1/273.15)-(1/td))) 
    210231es=es0*exp((25.e5/461.5)*((1/273.15)-(1/t))) 
     
    221242P=read_ncdf("msl", d1, d2, file=fullfilename_msl,/nostr) 
    222243help, P 
     244; ++ for debug ftp error  
     245; ++print,P(0:1,0,0) 
     246; ++stop 
    223247q2m=rh_to_spechum(rh,t,P) 
    224248 
     
    239263globattr={source:'Surface specific humidity at 2m calculated from dew point temperature',timerange:cda0+' - '+cda1} 
    240264 
    241 ncfields = 'q2m[longitude,latitude,time]=q2m:q2m_attr; ' $ 
     265ncfields = i'q2m[longitude,latitude,time]=q2m:q2m_attr; ' $ 
    242266                      + 'longitude[]=xlon:lon_attr; ' $ 
    243267                      + 'latitude[]=ylat:lat_attr; ' $ 
  • trunk/src/interp_erai_msl_1989_2009.pro

    r76 r80  
    7373; ==== 
    7474; 
    75 ; no input file available 
    76 ; 
    77 ; hard coded scale factor ? mslin=mslin/100 
    78 ; 
    7975; msl_attr={units:'milibars' .. millibar at least, hPa will be probably 
    8076; more SI 
     
    8278; why 19880101,20100930 as dates 
    8379; 
     80; first step time 14245.5 (days since 1950-01-01 00:00:00) : correct ? 
     81; 
    8482; KNOWN ISSUES 
    8583; ============ 
     
    9492; 
    9593; $URL$ 
     94; 
     95; - fplod 20110811T113646Z aedon.locean-ipsl.upmc.fr (Darwin) 
     96; 
     97;   * check for units in original file before conversion 
    9698; 
    9799; - fplod 20110809T145539Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    217219print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0) 
    218220mskout=read_ncdf("msk", file=fullfilename_msk,/nostr) 
    219 mslin=mslin/100 
     221 
     222; conversion to hPa 
     223ncdf_getatt, fullfilename, 'msl', units=units 
     224CASE units OF 
     225    'Pascal': BEGIN 
     226        mslin=mslin/100 
     227    END 
     228    ELSE: BEGIN 
     229        msg = 'eee : ' + units + ' unknown' 
     230        ras = report(msg) 
     231        STOP 
     232    END 
     233ENDCASE 
    220234 
    221235help, mslin,lonin,latin,mskin,lonout,latout,mskout 
  • trunk/src/lwr_correction_ncdf.pro

    r72 r80  
    7070; 19890101 is not provided in ERA-Intermim file str : a possible workaround is 
    7171; to copy 19890102 
    72 ; dataset to 19890101 using nco before processing. see 
    73 ; ref:`compute_erai_daily_region_2d.sh` 
     72; dataset to 19890101 using nco before processing. 
     73; 
     74; here is the sequence used by pk wher erai_lwr_19890102_20091231_oafluxgrid.nc is the regridded (interpolated output) 
     75;  
     76;   $ ncks -d time,0,0 erai_lwr_19890102_20091231_oafluxgrid.nc erai_lwr_step0.nc 
     77; 
     78; This will combine the two files :: 
     79; 
     80;   $ ncrcat erai_lwr_step0.nc erai_lwr_19890102_20091231_oafluxgrid.nc erai_lwr_19890101_20091231_oafluxgrid.nc. 
     81; 
     82; must be put in a shell script or find IDL equivalent 
    7483; 
    7584; here I (fp) replace hard coded date 19890102 by 19890101. must check 
  • trunk/src/q2m_correction_ncdf.pro

    r77 r80  
    2121; 
    2222;        digraph q2m_correction_ncdf { 
    23 ;           graph [ 
    24 ;           rankdir="LR", 
    25 ;           ] 
    2623; 
    2724;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_q2m_19890101_20091231_oafluxgrid.nc"]; 
     
    6360; ==== 
    6461; 
    65 ; can be tested because d2m_to_q2m.pro pb 
     62; work on cratos idl7 even if NaNf values in erai_q2m_19890101_20091231_oafluxgrid.nc written by 
     63; d2m_to_q2m.pro. 
     64;  
     65; No way ... NaNf also in this output !! 
    6666; 
    6767; coding rules 
     
    9595@cm_4data 
    9696@cm_project 
    97 ; 
    9897; 
    9998; test if ${PROJECT_OD} defined 
     
    133132; 
    134133; check if this file exists 
     134msg='iii : looking for ' + filename 
     135ras = report(msg) 
    135136fullfilename = isafile(iodirout + filename, NEW=0, /MUST_EXIST) 
    136137IF fullfilename[0] EQ '' THEN BEGIN 
  • trunk/src/qsat.pro

    r79 r80  
    1 ;-------------------------------------------------------- 
    2 function qsat, T,P 
     1;+ 
    32; 
    4 ; Air humidity at saturation (g/kg) 
    5 ; T: SST (degC) 
    6 ; P : surface pressure (mb) 
    7 ;-------------------------------------------------------- 
     3; ======== 
     4; qsat.pro 
     5; ======== 
     6; 
     7; .. function:: qsat(T,P) 
     8; 
     9;     :param T: SST (degC) 
     10;     :param P: surface pressure (mb) 
     11;  
     12;     :returns: Air humidity at saturation (g/kg) 
     13;      
     14; EXAMPLES 
     15; ======== 
     16; 
     17; :: 
     18; 
     19;  IDL> T=+todo+ 
     20;  IDL> P=+todo+ 
     21;  IDL> result=qsat(T,P) 
     22; 
     23; TODO 
     24; ==== 
     25; 
     26; coding rules 
     27; 
     28; complete example 
     29; 
     30; get rid of uppercase 
     31; 
     32; SEE ALSO 
     33; ======== 
     34; 
     35; :func:`rh_to_spechum` 
     36; 
     37; EVOLUTIONS 
     38; ========== 
     39; 
     40; $Id$ 
     41; 
     42; $URL$ 
     43; 
     44; - fplod 20110811T131113Z aedon.locean-ipsl.upmc.fr (Darwin) 
     45; 
     46;   * add minimal header to pk release given today (!) 
     47; 
     48; - pbk 2008 
     49; 
     50;   * creation 
     51; 
     52;- 
     53function qsat, T, P 
     54; 
    855x=T 
    956es=6.112*exp(17.502*x/(x+241.))*(1.0007+3.46e-6*p) 
     
    1360 
    1461end 
    15 ;-------------------------------------------------------- 
    16  
  • trunk/src/rh_to_spechum.pro

    r50 r80  
    11;+ 
    22; 
    3 ; ============= 
    4 ; rh_to_spechum 
    5 ; ============= 
     3; ================= 
     4; rh_to_spechum.pro 
     5; ================= 
    66; 
    77; .. function:: rh_to_spechum(rh,ta,P) 
     
    2626; ==== 
    2727; 
    28 ; hard coded directory - usage of ${PROJECT_ID} 
     28; coding rules 
    2929; 
    30 ; coding rules 
     30; complete example 
     31; 
     32; SEE ALSO 
     33; ======== 
     34; 
     35; called by :ref:`d2m_to_q2m_erai.pro` 
     36; 
     37; use :func:`qsat` 
    3138; 
    3239; EVOLUTIONS 
    3340; ========== 
     41; 
     42; $Id$ 
     43; 
     44; $URL$ 
     45; 
     46; - fplod 20110811T130223Z aedon.locean-ipsl.upmc.fr (Darwin) 
     47; 
     48;   * add reference to qsat function 
    3449; 
    3550; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) 
Note: See TracChangeset for help on using the changeset viewer.