Changeset 81 for trunk/src


Ignore:
Timestamp:
08/12/11 12:25:19 (13 years ago)
Author:
pinsard
Message:

progress on swr and olr processing

Location:
trunk/src
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/TropFlux_19890101_20091231.pro

    r77 r81  
    9292; ==== 
    9393; 
    94 ; I (fp) do not know how 
    95 ; ${PROJECT_OD}/TropFlux_swr_19890101_20091231_BLND.nc is produced. 
     94; no ${PROJECT_OD}/TropFlux_swr_19890101_20091231_BLND.nc yet because of pb in  
     95; TropFlux_swr_BLND_19890101_20091231.pro  
    9696; 
    9797; avoid mix lower/uppercase in pro name to avoid compile 
     
    107107; EVOLUTIONS 
    108108; ========== 
     109; 
     110; $Id 
     111; 
     112; $URL$ 
    109113; 
    110114; - fplod 20110809T110911Z aedon.locean-ipsl.upmc.fr (Darwin) 
  • trunk/src/TropFlux_NRT_ncdf.pro

    r78 r81  
    5454; EVOLUTIONS 
    5555; ========== 
     56; 
     57; $Id$ 
     58;  
     59; $URL$ 
    5660; 
    5761; - fplod 20110809T133815Z cratos (Linux) 
  • trunk/src/TropFlux_swr_BLND_19890101_20091231.pro

    r78 r81  
    77; ======================================= 
    88; 
     9; DESCRIPTION 
     10; =========== 
     11; 
    912; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20071231_DT.nc` 
    1013; containing ++ 
     
    2225; if this file not already exists. 
    2326; 
    24 ; This file will be used by :ref:`TropFlux_19890101_20091231.pro`. 
     27; This file will be used by :ref:`TropFlux_NRT_cfd.pro`. 
    2528; 
    2629;     .. graphviz:: 
    2730; 
    2831;        digraph tropflux_swr_blnd_19890101_20091231 { 
    29 ;           graph [ 
    30 ;           rankdir="LR", 
    31 ;           ] 
    3232; 
    3333;           file_dt [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_19890101_20071231_DT.nc"]; 
     
    4949; ======== 
    5050; 
     51; :ref:`project_profile.sh` 
     52; 
     53; :ref:`mooring_corrections` 
     54; 
     55; :ref:`data_in_swr` 
     56; 
    5157; :func:`initncdf <saxo:initncdf>` 
    5258; :func:`read_ncdf <saxo:read_ncdf>` 
     
    5460; :func:`ncdf_quickwrite <saxo:ncdf_quickwrite>` 
    5561; 
     62; :ref:`Tropflux_NRT_cdf.pro` 
     63; 
    5664; EXAMPLES 
    5765; ======== 
     
    6270;  IDL> tropflux_swr_blnd_19890101_20091231 
    6371; 
    64 ; 
    6572; TODO 
    6673; ==== 
    6774; 
     75; resolve crash on cratos idl7:: 
     76; 
     77;   % Attempt to subscript SWR_DT with JT is out of range. 
     78; 
     79; line:: 
     80; 
     81;    for jt=0,jpt-1 do swr_merged(*,*,jt)=swr_dt(*,*,jt)*a(jt)+(1-a(jt))*swr_nrt(*,*,jt) 
     82; 
    6883; avoid mix lower/uppercase in pro name to avoid compile 
    6984; 
     
    86101; EVOLUTIONS 
    87102; ========== 
     103; 
     104; $Id$ 
     105;  
     106; $URL$ 
    88107; 
    89108; - fplod 20110809T115747Z aedon.locean-ipsl.upmc.fr (Darwin) 
  • trunk/src/TropFlux_swr_DT_19890101_20071231.pro

    r78 r81  
    77; ===================================== 
    88; 
     9; DESCRIPTION 
     10; =========== 
     11; 
     12; Correction of swr delay time on OAFLUX grid 
     13; 
     14; :file:`${PROJECT_OD}/swr_oafluxgrid_1985_2007.nc` 
     15; have been produced ++by pk 
     16; 
     17; Corrected swr delay on OAFLUX grid  
     18; is written in 
     19; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20071231_DT.nc` 
     20; if this file not already exists. 
     21; 
     22; This file will be used by :ref:`TropFlux_swr_BLND_19890101_20091231.pro`. 
    923; 
    1024;     .. graphviz:: 
    1125; 
    1226;        digraph tropflux_swr_dt_19890101_20071231 { 
    13 ;           graph [ 
    14 ;           rankdir="LR", 
    15 ;           ] 
    16 ; 
    17 ;           file_swr [shape=ellipse,fontname=Courier,label="/Volumes/Iomega_HDD/work/flux_reconstruction/OAFLX_GRID/swr_oafluxgrid_1985_2007.nc"]; 
    18 ; 
    19 ;           ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc"]; 
     27; 
     28;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/swr_oafluxgrid_1985_2007.nc"]; 
     29;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_19890101_20071231_DT.nc"]; 
    2030; 
    2131;           tropflux_swr_dt_19890101_20071231 [shape=box, 
     
    2535;           label="${PROJECT}/src/TropFlux_swr_DT_19890101_20071231.pro"]; 
    2636; 
    27 ;           {file_swr}-> {tropflux_swr_dt_19890101_20071231} -> {ncfile} 
     37;           {file_in}-> {tropflux_swr_dt_19890101_20071231} -> {file_out} 
    2838; 
    2939;        } 
     
    3141; SEE ALSO 
    3242; ======== 
     43; 
     44; :ref:`project_profile.sh` 
     45; 
     46; :ref:`mooring_corrections` 
     47; 
     48; :ref:`data_in_swr` 
    3349; 
    3450; :func:`initncdf <saxo:initncdf>` 
     
    4460; :: 
    4561; 
     62;  IDL> .compile TropFlux_swr_DT_19890101_20071231 
    4663;  IDL> tropflux_swr_dt_19890101_20071231 
    4764; 
     
    4966; ==== 
    5067; 
    51 ; hard coded directory - usage of ${PROJECT_ID} 
     68; NaNf values in ouptut file while 1.e20 in input file !! 
    5269; 
    5370; coding rules 
    5471; 
    55 ; change the name to swr_dt_correction_ndcf.pro 
     72; why compile is needed ? uppercase in file name 
     73; 
     74; any way change the name to swr_dt_correction_ndcf.pro 
     75; to homogenize names of tools 
     76; 
     77; use the output of concat_swr.sh to be written. 
     78; now use swr_oafluxgrid_1985_2007.nc provided by pk 20110811 
     79; 
     80; KNOWN ISSUES 
     81; ============ 
     82; 
     83; test of existence of fullfilename not very efficient because 
     84; MUST_EXIST keyword of :func:`isafile <saxo:isafile>` not yet implemented 
    5685; 
    5786; EVOLUTIONS 
    5887; ========== 
    5988; 
     89; $Id$ 
     90; 
     91; $URL$ 
     92; 
     93; - fplod 20110812T073138Z aedon.locean-ipsl.upmc.fr (Darwin) 
     94; 
     95;   * usage of ${PROJECT_OD} 
     96;   * complete description 
     97;   * remove v50 in output filename 
     98; 
    6099; - fplod 20101215T091726Z aedon.locean-ipsl.upmc.fr (Darwin) 
    61100; 
     
    72111;- 
    73112pro TropFlux_swr_DT_19890101_20071231 
    74 @common 
    75 file='/Volumes/Iomega_HDD/work/flux_reconstruction/OAFLX_GRID/swr_oafluxgrid_1985_2007.nc' 
    76 initncdf, file 
    77  
    78 sw=read_ncdf("swr", 19890101, 20071231, file=file,/nostr) 
     113; 
     114@cm_4cal 
     115@cm_4data 
     116@cm_4mesh 
     117@cm_4data 
     118@cm_project 
     119; 
     120; test if ${PROJECT_OD} defined 
     121CASE project_od_env OF 
     122  '' : BEGIN 
     123         msg = 'eee : ${PROJECT_OD} is not defined' 
     124         ras = report(msg) 
     125       STOP 
     126       END 
     127  ELSE: BEGIN 
     128          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     129          ras = report(msg) 
     130        END 
     131 ENDCASE 
     132; 
     133; check if output data will be possible 
     134iodirout = isadirectory(project_od_env) 
     135; 
     136; existence and protection for reading 
     137IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     138   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
     139   ras = report(msg) 
     140   STOP 
     141ENDIF 
     142; 
     143; existence and protection for writing 
     144IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     145    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     146    ras = report(msg) 
     147    STOP 
     148ENDIF 
     149; 
     150; build data filename 
     151filename='swr_oafluxgrid_1985_2007.nc' 
     152; 
     153; check if this file exists 
     154msg='iii : looking for ' + filename 
     155ras = report(msg) 
     156fullfilename = isafile(iodirout + filename, NEW=0, /MUST_EXIST) 
     157IF fullfilename[0] EQ '' THEN BEGIN 
     158   msg = 'eee : the file ' + fullfilename + ' was not found.' 
     159   ras = report(msg) 
     160   STOP 
     161ENDIF 
     162; 
     163; build output filename 
     164filename_out = 'TropFlux_swr_19890101_20071231_DT.nc' 
     165fullfilename_out = iodirout + filename_out 
     166; in order to avoid unexpected overwritten 
     167IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     168   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     169   ras = report(msg) 
     170   STOP 
     171ENDIF 
     172; 
     173initncdf, filename 
     174 
     175sw=read_ncdf("swr", 19890101, 20071231, file=filename,/nostr) 
    79176help, sw 
    80177 
     
    107204time=time-julday(1,1,1950) & jpt=n_elements(time) 
    108205 
    109 ncfile='!/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc' 
     206ncfile='!' + fullfilename_out 
    110207lon_attr={units:'degrees_east',long_name:'Longitude'} 
    111208lat_attr={units:'degrees_north',long_name:'Latitude'} 
     
    114211globattr={source:'Obtained from ISCCP.  Corrections has been done on mean bias and variability',timerange:cda0+' - '+cda1} 
    115212 
    116  
    117213ncfields = 'swr[longitude,latitude,time]=swr:sw_attr; ' $ 
    118214                      + 'longitude[]=lon:lon_attr; ' $ 
  • trunk/src/TropFlux_swr_NRT_19890101_20091231.pro

    r78 r81  
    77; ====================================== 
    88; 
     9; DESCRITION 
     10; ========== 
     11; 
     12; Correction of swr near real time on OAFLUX grid 
     13; 
     14; Corrected swr delay on OAFLUX grid 
     15; has been produced by 
     16; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20071231_DT.nc` 
     17; 
     18; :file:`${PROJECT_OD}/olr_oafluxgrid_30n30s_19890101_20091231.nc` 
     19; have been produced ++by pk 
     20; 
     21; Corrected swr near real time on OAFLUX grid 
     22; ; is written in 
     23; :file:`${PROJECT_OD}/TropFlux_swr_19890101_20091231_NRT.nc` 
     24; if this file not already exists. 
     25; 
     26; This file will be used by :ref:`TropFlux_swr_BLND_19890101_20091231.pro`. 
    927; 
    1028;     .. graphviz:: 
    1129; 
    1230;        digraph tropflux_swr_nrt_19890101_200912311 { 
    13 ;           graph [ 
    14 ;           rankdir="LR", 
    15 ;           ] 
    16 ;           file_sw [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc"]; 
    17 ;           file_olr [shape=ellipse,fontname=Courier,label="/Users/pkb/data/heat_budget/NOAA_OLR/olr_oafluxgrid_30n30s_19890101_20091231.nc"]; 
    18 ;           ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_NRT_v50.nc"]; 
     31; 
     32;           file_swr_dt [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_19890101_20071231_DT.nc"]; 
     33;           file_olr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/olr_oafluxgrid_30n30s_19890101_20091231.nc"]; 
     34;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_swr_19890101_20091231_NRT.nc"]; 
    1935; 
    2036;           tropflux_swr_nrt_19890101_200912311 [shape=box, 
     
    2440;           label="${PROJECT}/src/TropFlux_swr_NRT_19890101_200912311.pro"]; 
    2541; 
    26 ;           {file_sw file_olr}-> {tropflux_swr_nrt_19890101_200912311} -> {ncfile} 
     42;           {file_swr_dt file_olr}-> {tropflux_swr_nrt_19890101_200912311} -> {file_out} 
    2743;       } 
    2844; 
    2945; SEE ALSO 
    3046; ======== 
     47; 
     48; :ref:`project_profile.sh` 
     49; 
     50; :ref:`mooring_corrections` 
     51; 
     52; :ref:`data_in_swr` 
     53; :ref:`data_in_olr` 
    3154; 
    3255; :func:`initncdf <saxo:initncdf>` 
     
    4063; :: 
    4164; 
     65;  IDL> .compile TropFlux_swr_NRT_19890101_20091231 
    4266;  IDL> tropflux_swr_nrt_19890101_20091231 
    4367; 
     
    4569; ==== 
    4670; 
    47 ; hard coded directory - usage of ${PROJECT_ID} 
     71; remove NaNf values in ouptut file (may be not because of this module) 
     72; 
     73; why two sequence initcdf et read_ndcf on olr file ? 
    4874; 
    4975; coding rules 
    5076; 
     77; why compile is needed ? uppercase in file name 
     78; 
    5179; change the name to swr_nrt_correction_ncdf.pro 
     80; to homogenize names of tools 
     81; 
     82; KNOWN ISSUES 
     83; ============ 
     84; 
     85; test of existence of fullfilename not very efficient because 
     86; MUST_EXIST keyword of :func:`isafile <saxo:isafile>` not yet implemented 
    5287; 
    5388; EVOLUTIONS 
    5489; ========== 
    5590; 
     91; $Id$ 
     92; 
     93; $URL$ 
     94; 
     95; - fplod 20110812T075406Z aedon.locean-ipsl.upmc.fr (Darwin) 
     96; 
     97;   * usage of ${PROJECT_OD} 
     98;   * complete description 
     99;   * remove v50 in filenames 
     100; 
    56101; - fplod 20101215T092145Z aedon.locean-ipsl.upmc.fr (Darwin) 
    57102; 
     
    68113;- 
    69114pro TropFlux_swr_NRT_19890101_20091231 
    70 @common 
    71 file='/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc' 
    72 initncdf, file 
    73 sw=read_ncdf("swr", 19890101, 20071231, file=file,/nostr) 
     115; 
     116@cm_4cal 
     117@cm_4data 
     118@cm_4mesh 
     119@cm_4data 
     120@cm_project 
     121; 
     122; test if ${PROJECT_OD} defined 
     123CASE project_od_env OF 
     124  '' : BEGIN 
     125         msg = 'eee : ${PROJECT_OD} is not defined' 
     126         ras = report(msg) 
     127       STOP 
     128       END 
     129  ELSE: BEGIN 
     130          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     131          ras = report(msg) 
     132        END 
     133 ENDCASE 
     134; check if output data will be possible 
     135iodirout = isadirectory(project_od_env) 
     136; 
     137; existence and protection for reading 
     138IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     139   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
     140   ras = report(msg) 
     141   STOP 
     142ENDIF 
     143; 
     144; existence and protection for writing 
     145IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     146    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     147    ras = report(msg) 
     148    STOP 
     149ENDIF 
     150; 
     151; build swr dt data filename 
     152filename_swr_dt='TropFlux_swr_19890101_20071231_DT.nc' 
     153; 
     154; check if this file exists 
     155msg='iii : looking for ' + filename_swr_dt 
     156ras = report(msg) 
     157fullfilename_swr_dt = isafile(iodirout + filename_swr_dt, NEW=0, /MUST_EXIST) 
     158IF fullfilename_swr_dt[0] EQ '' THEN BEGIN 
     159   msg = 'eee : the file ' + fullfilename_swr_dt + ' was not found.' 
     160   ras = report(msg) 
     161   STOP 
     162ENDIF 
     163; 
     164; build olr data filename 
     165filename_olr='olr_oafluxgrid_30n30s_19890101_20091231.nc' 
     166; 
     167; check if this file exists 
     168msg='iii : looking for ' + filename_olr 
     169ras = report(msg) 
     170fullfilename_olr = isafile(iodirout + filename_olr, NEW=0, /MUST_EXIST) 
     171IF fullfilename_olr[0] EQ '' THEN BEGIN 
     172   msg = 'eee : the file ' + fullfilename_olr + ' was not found.' 
     173   ras = report(msg) 
     174   STOP 
     175ENDIF 
     176; 
     177; build output filename 
     178filename_out = 'TropFlux_swr_19890101_20091231_NRT.nc' 
     179fullfilename_out = iodirout + filename_out 
     180; in order to avoid unexpected overwritten 
     181IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     182   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     183   ras = report(msg) 
     184   STOP 
     185ENDIF 
     186; 
     187initncdf, fullfilename_swr_dt 
     188sw=read_ncdf("swr", 19890101, 20071231, file=fullfilename_swr_dt,/nostr) 
    74189 
    75190swi=sw 
    76 file_olr='/Users/pkb/data/heat_budget/NOAA_OLR/olr_oafluxgrid_30n30s_19890101_20091231.nc' 
    77  
    78 initncdf,file_olr 
    79 olr=read_ncdf('olr',19890100, 20071231,file=file_olr,/nost) 
     191 
     192initncdf, fullfilename_olr 
     193olr=read_ncdf('olr',19890100, 20071231, file=fullfilename_olr,/nost) 
    80194 
    81195help, sw, olr 
     
    108222help, swi 
    109223 
    110 initncdf, file_olr 
    111 olr=read_ncdf('olr', 19890100, 20091231, box=box, file=file_olr,/nostr) 
     224initncdf, fullfilename_olr 
     225olr=read_ncdf('olr', 19890100, 20091231, box=box, file=fullfilename_olr,/nostr) 
    112226tt=time & jpt=n_elements(time) 
    113227caldat, time,mon,day,yea 
     
    132246time=time-julday(1,1,1950) & jpt=n_elements(time) 
    133247 
    134 ncfile='!/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_NRT_v50.nc' 
     248ncfile='!' + fullfilename_out 
    135249lon_attr={units:'degrees_east',long_name:'Longitude'} 
    136250lat_attr={units:'degrees_north',long_name:'Latitude'} 
  • trunk/src/cor30a.pro

    r74 r81  
    77; .. function:: cor30a(u,us,ts,t,Qs,Q,Rs,Rl,rain,zi,P,zu,zt,zq,lat,jcool,jwave,twave,hwave) 
    88; 
     9; DESCRIPTION 
     10; =========== 
    911; 
    1012; COARE v3 algorithm to compute fluxes 
     
    7476; coding rules 
    7577; 
     78; check for the new module provide by pk 20110811 by mail to fp 
     79; "You can use this coare algorithm in your depositary.  It is same as the one you 
     80; have, but with some functions activated, which will be useful in the next stage." 
     81; 
    7682; EVOLUTIONS 
    7783; ========== 
     84; 
     85; $Id$ 
     86; 
     87; $URL$ 
    7888; 
    7989; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) 
  • trunk/src/cronin_gustiness_ncdf.pro

    r72 r81  
    2323; 
    2424;        digraph cronin_gustiness_ncdf { 
    25 ;           graph [ 
    26 ;           rankdir="LR", 
    27 ;           ] 
    2825; 
    2926;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc"]; 
     
    7471; EVOLUTIONS 
    7572; ========== 
     73; 
     74; $Id$ 
     75; 
     76; $URL$ 
    7677; 
    7778; - fplod 20110808T144208Z aedon.locean-ipsl.upmc.fr (Darwin) 
  • trunk/src/get_olr.sh

    r50 r81  
    66# .. _get_olr.sh: 
    77# 
    8 # ================================================= 
    9 # get_olr.sh -- get OLR interpolated reference file 
    10 # ================================================= 
     8# ========== 
     9# get_olr.sh 
     10# ========== 
    1111#  
    1212# SYNOPSIS 
     
    2525# ======== 
    2626# 
    27 # :ref:`guide data OLR <data_in_olr>` 
     27# :ref:`data_in_olr` 
    2828# 
    2929# :ref:`get_olrnint.sh` 
     
    3232# ==== 
    3333# 
    34 # trace 
    35 # 
    36 # hard coded directory - usage of ${PROJECT_ID} 
     34# homogenize with get_oaflux.sh for trace, environnement and so on 
    3735# 
    3836# coding rules 
     
    4038# EVOLUTIONS 
    4139# ========== 
     40# 
     41# - fplod 20110812T092412Z aedon.locean-ipsl.upmc.fr (Darwin) 
     42# 
     43#   * usage of ${PROJECT_ID} 
    4244# 
    4345# - fplod 20101213T155858Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    5052# 
    5153#- 
    52 DIR_DATA='/Users/jv/data/OLR/' 
    5354 
    54 cd $DIR_DATA 
    55  
    56 mv olr.day.mean.nc olr.day.mean.nc.old 
    57  
    58 wget ftp://ftp.cdc.noaa.gov/Datasets/interp_OLR/olr.day.mean.nc 
     55wget  --tries=1 --no-verbose -P ${PROJECT_ID} \ 
     56     ftp://ftp.cdc.noaa.gov/Datasets/interp_OLR/olr.day.mean.nc 
    5957 
    6058#ftp -n <<@DELIM 
     
    6866#@DELIM 
    6967 
    70 ls -l 
    71  
     68exit 0 
  • trunk/src/get_swr.sh

    r80 r81  
    22#+ 
    33# 
    4 # .. program:: get_rama_netcdf.sh 
    5 # 
    6 # .. _get_rama_netcdf.sh: 
    7 # 
    8 # ============================================== 
    9 # get_rama_netcdf.sh -- get RAMA reference files 
    10 # ============================================== 
     4# .. program:: get_swr.sh 
     5# 
     6# .. _get_swr.sh: 
     7# 
     8# ========== 
     9# get_swr.sh 
     10# ========== 
    1111# 
    1212# SYNOPSIS 
     
    1515# :: 
    1616# 
    17 #  $ get_rama_netcdf.sh 
     17#  $ get_swr.sh 
    1818# 
    1919# DESCRIPTION 
    2020# =========== 
    2121# 
    22 # ``get_rama_netcdf.sh`` get RAMA reference files 
    23 # 
    24 # bf 
    25 #   buoyancy flux 
    26 # d 
    27 #   sigma-theta 
    28 # dyn 
    29 #   dynamic height 
    30 # emp 
    31 #   e-p 
    32 # iso 
    33 #   20C depth 
    34 # met 
    35 #   wind (u,v,speed,direction),  airT, hum rel, SST   (= w + airt + rh) 
    36 # pos 
    37 #   lon, lat 
    38 # rad 
    39 #   shortwave down 
    40 # rf 
    41 #   rain heat flux 
    42 # w 
    43 #   wind 
    44 # 
    45 # Log file is written on :file:`${PROJECT_LOG}/get_rama_netcdf.log.{YYYYMMDDTHHMMSSZ}` 
     22# ``get_swr.sh`` get SWR reference files. 
     23# 
     24# Log file is written on :file:`${PROJECT_LOG}/get_swr.log.{YYYYMMDDTHHMMSSZ}` 
    4625# 
    4726#     .. graphviz:: 
    4827# 
    49 #        digraph get_rama_netcdf { 
     28#        digraph get_swr { 
    5029#           graph [ 
    5130#           rankdir="TB", 
    5231#           ] 
    5332# 
    54 #           rama_ref [shape=diamond,fontname=Courier,label="ftp://ftp.pmel.noaa.gov/cdf/sites/daily/*_*_dy.cdf"]; 
    55 # 
    56 #           file_rama  [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/*_*_dy.cdf"]; 
    57 # 
    58 #           get_rama_netcdf [shape=box, 
     33#           swr_ref [shape=diamond,fontname=Courier,label="ftp://ftp.whoi.edu/pub/science/oaflux/data_v3/daily/radiation_1985-2007/sw_icssp_yyyy.nc.gz"]; 
     34# 
     35#           file_swr [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/sw_icssp_yyyy.nc"]; 
     36# 
     37#           get_swr [shape=box, 
    5938#           fontname=Courier, 
    6039#           color=blue, 
    61 #           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_rama_netcdf.sh" 
    62 #           label="${PROJECT}/src/get_rama_netcdf.sh"]; 
    63 # 
    64 #           {rama_ref} -> {get_rama_netcdf} -> {file_rama} 
     40#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_swr.sh" 
     41#           label="${PROJECT}/src/get_swr.sh"]; 
     42# 
     43#           {swr_ref} -> {get_swr} -> {file_swr} 
    6544# 
    6645#          } 
     
    7150# You don't have any RAMA reference data, you just have to run this tool :: 
    7251# 
    73 #  $ get_rama_netcdf.sh 
     52#  $ get_swr.sh 
    7453# 
    7554# And look at log file with :: 
    7655# 
    77 #  $ tlogd.sh get_rama_netcdf 
     56#  $ tlogd.sh get_swr 
    7857# 
    7958# and of course on files in ${PROJECT_ID}. 
     
    8261# ======== 
    8362# 
    84 # :ref:`guide data RAMA <data_in_rama>` 
     63# :ref:`data_in_swr` 
    8564# 
    8665# :ref:`project_profile.sh` 
     
    8968# ==== 
    9069# 
    91 # list of variables and sites in DESCRIPTION 
    92 # 
    93 # do we really need all these variables and sites 
    94 # 
    95 # Liste complète de RAMA:: 
    96 # 
    97 #  sitelist="                   16s55e    12s55e    8s55e    4s55e    1.5s55e    0n55e    1.5n55e    4n55e" 
    98 #  sitelist="${sitelist}                                                                               15n65e" 
    99 #  sitelist="${sitelist}                    12s67e     8s67e    4s67e    1.5s67e    0n67e     1.5n67e    4n67e    8n67e" 
    100 #  sitelist="${sitelist}  16s80.5e 12s80.5e 8s80.5e 4s80.5e 1.5s80.5e 0n80.5e 1.5n80.5e 4n80.5e" 
    101 #  sitelist="${sitelist}               1.5s90e 0n90e 1.5n90e 4n90e 8n90e 12n90e 15n90e 
    102 #  sitelist="${sitelist}  16s95e 12s95e 8s95e  5s95e" 
     70# complete description 
     71# 
     72# Eventually: we should retrieve them from ISCCP page 
     73# (ftp://isccp.giss.nasa.gov/pub/data/FC/ ) and interpolate them we need FD${YYYY}${MM}__${SS}${FF}SFC.EQ files where: 
     74# 
     75#  - YYYY and MM are year and month 
     76#  - SS is LW (longwave) and SW (shortwave) 
    10377# 
    10478# study wget status (no exit now on non null wget status) 
     79# 
     80# chain to concatenation and geobox reduction .. and rename sw\_ to swr file 
     81# variable name ?? to swr 
    10582# 
    10683# EVOLUTIONS 
     
    10986# $Id$ 
    11087# 
    111 # - fplod 20110421T133632Z aedon.locean-ipsl.upmc.fr (Darwin) 
    112 # 
    113 #   * consolidation 
    114 # 
    115 # - fplod 20101213T160928Z aedon.locean-ipsl.upmc.fr (Darwin) 
    116 # 
    117 #   * minimal header 
    118 # 
    119 # - jv 2008 
     88# $URL$ 
     89# 
     90# - fplod 20110811T153513Z aedon.locean-ipsl.upmc.fr (Darwin) 
    12091# 
    12192#   * creation 
     
    12697   AIX|IRIX64) 
    12798      echo "www : no specific posix checking" 
     99      date_cmd=date 
     100   ;; 
     101   Darwin) 
     102      set -o posix 
     103      date_cmd=gdate 
     104   ;; 
     105   Linux) 
     106      set -o posix 
     107      date_cmd=date 
    128108   ;; 
    129109   *) 
     
    195175echo "" 1>> ${log} 
    196176# 
    197 varlist="adcp airt bf bp cur d dyn emp evap heat iso lw lwnet met pos qlat qnet qsen rad rain rf rh s ssd sss sst swnet t tau w" 
    198 # 
    199 sitelist="12s55e 8s55e 8s67e 8s80.5e 4s80.5e 1.5s80.5e 0n80.5e 1.5n80.5e 1.5s90e 0n90e 1.5n90e 4n90e 8n90e 12n90e 15n90e 5s95e" 
    200  
    201 # 
    202 #Liste complète de RAMA: 
    203 #sitelist="                   16s55e    12s55e    8s55e    4s55e    1.5s55e    0n55e    1.5n55e    4n55e" 
    204 #sitelist="${sitelist}                                                                               15n65e" 
    205 #sitelist="${sitelist}                    12s67e     8s67e    4s67e    1.5s67e    0n67e     1.5n67e    4n67e    8n67e" 
    206 #sitelist="${sitelist}  16s80.5e 12s80.5e 8s80.5e 4s80.5e 1.5s80.5e 0n80.5e 1.5n80.5e 4n80.5e" 
    207 #sitelist="${sitelist}               1.5s90e 0n90e 1.5n90e 4n90e 8n90e 12n90e 15n90e 
    208 #sitelist="${sitelist}  16s95e 12s95e 8s95e  5s95e" 
    209 # 
    210 # 
    211 locref="ftp://ftp.pmel.noaa.gov/cdf/sites/daily" 
     177yearmin=1985 
     178yearmax=2007 
     179# 
     180varlist="sw" 
     181# 
     182locref="ftp://ftp.whoi.edu/pub/science/oaflux/data_v3/daily/radiation_1985-2007/" 
    212183# 
    213184list_url="" 
    214185# 
    215 # build URL = f(site,var) 
    216 for site in ${sitelist} 
     186# build URL = f(year,var) 
     187yyyy=${yearmin} 
     188while [ ${yyyy} -le ${yearmax} ] 
    217189do 
    218190   for var in ${varlist} 
    219191   do 
    220        list_url="${list_url} ${locref}/${var}${site}_dy.cdf" 
     192       list_url="${list_url} ${locref}/${var}_isccp_${yyyy}.nc.gz" 
    221193   done 
     194   unset var 
     195   yyyy=$(( ${yyyy} + 1 )) 
    222196done 
    223 unset site 
    224 unset var 
    225197unset varlist 
    226 unset sitelist 
    227198unset locref 
    228199# 
    229 # if file is not already in ${PROJECT_ID}, get it 
     200# if file_gz is not already in ${PROJECT_ID}, get it 
    230201for url in ${list_url} 
    231202do 
    232   file=${PROJECT_ID}/$(basename ${url}) 
     203  file_gz=${PROJECT_ID}/$(basename ${url}) 
     204  file=${PROJECT_ID}/$(basename ${file_gz} .gz) 
    233205  if [ ! -f ${file} ] 
    234206  then 
    235      wget --tries=1 --no-verbose -P ${PROJECT_ID} \ 
    236         --user=taopmelftp \ 
    237         --password=G10b@LCh@Ng3 \ 
    238         ${url} >> ${log} 2>&1 
    239      wget_status=${?} 
    240      if [ ${wget_status} -ne 0 ] 
    241      then 
    242         echo "${command} : eee : ${url} not found" >> ${log} 2>&1 
    243         # ++ exit 1 
    244      else 
    245         echo "${command} : iii : ${url} found" >> ${log} 2>&1 
    246      fi 
    247      unset wget_status 
    248   else 
    249      echo "iii : ${file} exists" >> ${log} 
    250   fi 
     207      if [ ! -f ${file_gz} ] 
     208      then 
     209         wget --tries=1 --no-verbose -P ${PROJECT_ID} \ 
     210            ${url} >> ${log} 2>&1 
     211         wget_status=${?} 
     212         if [ ${wget_status} -ne 0 ] 
     213         then 
     214            echo "${command} : eee : ${url} not found" >> ${log} 2>&1 
     215            # ++ exit 1 
     216         else 
     217            echo "${command} : iii : ${url} found" >> ${log} 2>&1 
     218         fi 
     219         unset wget_status 
     220      else 
     221         echo "iii : ${file_gz} exists" >> ${log} 
     222         gunzip -c ${file_gz} > ${file} 
     223      fi 
     224   else 
     225      echo "iii : ${file} exists" >> ${log} 
     226   fi 
    251227done 
     228unset file_gz 
    252229unset file 
    253230unset url 
  • trunk/src/interp_olr_30n30s_1989_2009.pro

    r78 r81  
    77; =============================== 
    88; 
     9; DESCRIPTION 
     10; =========== 
     11; 
     12; Interpolation of OLR to OAFLUX grid 
     13; 
     14; :file:`${PROJECT_ID}/olr.day.mean.nc` 
     15; have been produced by 
     16; :ref:`get_olr.sh` 
     17; 
     18; :file:`${PROJECT_ID}/mask_oaflux_30N30S.nc` containing OAFLUX grid 
     19; have been produced by 
     20; :ref:`oaflux_mask_30N30S.pro`. 
     21; 
     22; Interpolated OLR is written in 
     23; :file:`${PROJECT_OD}/${PROJECT_OD}/olr_oafluxgrid_30n30s_19890101_20091231.nc` 
     24; if this file not already exists. 
     25; 
     26; This output file will be used by 
     27; :ref:`TropFlux_swr_NRT_19890101_20091231.pro`. 
     28; 
    929;     .. graphviz:: 
    1030; 
    1131;        digraph interp_olr_30n30s_1989_2009{ 
    12 ;           graph [ 
    13 ;           rankdir="LR", 
    14 ;           ] 
    15 ;           file_in [shape=ellipse,fontname=Courier,label="/Users/pkb/data/heat_budget/NOAA_OLR/new/olr.day.mean_new.nc"]; 
    16 ; 
     32; 
     33;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/olr.day.mean_new.nc"]; 
    1734;           mask [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/mask_oaflux_30N30S.nc"]; 
    18 ; 
    19 ;           ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/heat_budget/NOAA_OLR/newolr_oafluxgrid_30n30s_19890101_20091231.nc"]; 
     35;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/olr_oafluxgrid_30n30s_19890101_20091231.nc"]; 
    2036; 
    2137;           interp_olr_30n30s_1989_2009 [shape=box, 
     
    2541;           label="${PROJECT}/src/interp_olr_30n30s_1989_2009.pro"]; 
    2642; 
    27 ;           {file_in mask} -> {interp_olr_30n30s_1989_2009} -> {ncfile} 
     43;           {file_in mask} -> {interp_olr_30n30s_1989_2009} -> {file_out} 
    2844; 
    2945;         } 
     
    3349; 
    3450; :ref:`project_profile.sh` 
     51; 
     52; :ref:`interpolate_data` 
     53; 
     54; :ref:`data_in_olr`, :ref:`get_olr.sh` 
    3555; 
    3656; :func:`report <saxo:report>` 
     
    4868; :: 
    4969; 
     70;  IDL> .compile file_interp 
    5071;  IDL> interp_olr_30n30s_1989_2009 
    5172; 
     
    5374; ==== 
    5475; 
    55 ; hard coded directory - usage of ${PROJECT_ID} 
     76; how can we avoid this message :: 
     77; 
     78;   % initncdf: the zaxis was not found..., check the use of ZAXISNAME keyword if you want to find one... 
     79;  
     80; I think we do not need any zaxis 
     81; 
     82; strange second value (1) in the file produced on cratos idl 7 20110812:: 
     83; 
     84;   $ ncdump $PROJECT_OD/olr_oafluxgrid_30n30s_19890101_20091231.nc 
     85;     olr = 
     86;     1e+20, 1, 258.15, 264.882, 271.614, 273.8116, 271.4748, 269.138, 266.6868,  
    5687; 
    5788; coding rules 
     89; 
     90; check OUTMASK_IND and SET_OUTMSKVAL added to call_interp2d call 
     91; 
     92; pb with mixing interpolated and uninterpolated OLR data 
     93; check if the input file is the right one (interpolated with get_olr.sh vs non interpolated with get_olr_int.sh) 
     94; 
     95; uninterpolated OLR is more timely 
     96; 
     97; cf. pk and jv to solve this issue 
    5898; 
    5999; KNOWN ISSUES 
    60100; ============ 
    61101; 
    62 ; pb with mixing interpolated and uninterpolated OLR data  
    63 ; 
    64 ; uninterpolated OLR is more timely 
    65 ;  
    66 ; cf. pk and jv to solve this issue 
    67 ; 
    68102; test of existence of fullfilename_msk not very efficient because 
    69103; MUST_EXIST keyword of :func:`isafile <saxo:isafile>` not yet implemented 
     
    72106; ========== 
    73107; 
     108; $Id$ 
     109; 
     110; $URL$ 
     111; 
     112; - fplod 20110812T084449Z aedon.locean-ipsl.upmc.fr (Darwin) 
     113; 
     114;   * remove new from filename 
     115;   * usage of $PROJECT_ID and $PROJECT_OD 
     116;   * add OUTMASK_IND and SET_OUTMSKVAL to call_interp2d call 
     117;   * complete description 
     118; 
    74119; - fplod 20101217T140745Z aedon.locean-ipsl.upmc.fr (Darwin) 
    75120; 
     
    90135;- 
    91136pro interp_olr_30n30s_1989_2009 
    92 @common 
     137; 
     138@cm_4cal 
     139@cm_4data 
     140@cm_4mesh 
     141@cm_4data 
     142@cm_project 
    93143; 
    94144; check for input directory 
     
    120170; 
    121171; check if this file exists 
     172msg='iii : looking for ' + filename_msk 
     173ras = report(msg) 
    122174fullfilename_msk = isafile(iodirin + filename_msk, NEW=0, /MUST_EXIST) 
    123175IF fullfilename_msk[0] EQ '' THEN BEGIN 
     
    126178   STOP 
    127179ENDIF 
    128  
    129 filein='/Users/pkb/data/heat_budget/NOAA_OLR/new/olr.day.mean_new.nc' 
    130  
    131 initncdf, filein 
     180; 
     181; build data filename 
     182filename='olr.day.mean.nc' 
     183; 
     184; check if this file exists 
     185msg='iii : looking for ' + filename 
     186ras = report(msg) 
     187fullfilename = isafile(iodirin + filename, NEW=0, /MUST_EXIST) 
     188IF fullfilename[0] EQ '' THEN BEGIN 
     189   msg = 'eee : the file ' + fullfilename + ' was not found.' 
     190   ras = report(msg) 
     191   STOP 
     192ENDIF 
     193; 
     194; test if ${PROJECT_OD} defined 
     195CASE project_od_env OF 
     196  '' : BEGIN 
     197         msg = 'eee : ${PROJECT_OD} is not defined' 
     198         ras = report(msg) 
     199       STOP 
     200       END 
     201  ELSE: BEGIN 
     202          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     203          ras = report(msg) 
     204        END 
     205 ENDCASE 
     206; 
     207; check if output data will be possible 
     208iodirout = isadirectory(project_od_env) 
     209; 
     210; existence and protection 
     211IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     212    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     213    ras = report(msg) 
     214    STOP 
     215ENDIF 
     216; 
     217; build output filename 
     218filename_out = 'olr_oafluxgrid_30n30s_19890101_20091231.nc' 
     219fullfilename_out = iodirout + filename_out 
     220; in order to avoid unexpected overwritten 
     221IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     222   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     223   ras = report(msg) 
     224   STOP 
     225ENDIF 
     226; 
     227initncdf, fullfilename 
    132228domdef 
    133229latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0)) 
    134230print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) 
    135231print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) 
    136 olrin=read_ncdf("olr",19881231, 20091231, file=filein,/nostr) 
     232olrin=read_ncdf("olr",19881231, 20091231, file=fullfilename,/nostr) 
    137233 
    138234mskin=glamt*0.+1. 
     
    156252  tab_olr=reform(olrin(*,*,jt)) 
    157253 
    158   olrout(*,*,jt)=call_interp2d(tab_olr,lonin,latin,mskin,lonout,latout,method='bilinear') 
    159  
     254  olrout(*,*,jt)=call_interp2d(tab_olr,lonin,latin,mskin $ 
     255      , lonout,latout,method='bilinear'  $ 
     256      , OUTMASK_IND=mskout, SET_OUTMSKVAL=mskout) 
    160257  olrout(*,*,jt)=olrout(*,*,jt)*mskout+(1.-mskout)*1.e20 
    161258 
     
    169266lat=latout 
    170267lon=lonout 
    171 ncfile='!/Users/pkb/data/heat_budget/NOAA_OLR/newolr_oafluxgrid_30n30s_19890101_20091231.nc' 
     268ncfile='!' + fullfilename_out 
    172269lon_attr={units:'degrees_east',long_name:'Longitude'} 
    173270lat_attr={units:'degrees_north',long_name:'Latitude'} 
     
    177274globattr={source:'NOAA OLR, cf http://www.cdc.noaa.gov/cdc/data.interp_OLR.html, interpolated to 1x1 degree grid and with oaflux mask'} 
    178275 
    179  
    180276ncfields = 'olr[longitude,latitude,time]=olrout:olr_attr; ' $ 
    181277                      + 'longitude[]=lon:lon_attr; ' $ 
     
    186282@ncdf_quickwrite 
    187283 
    188  
    189284end 
  • trunk/src/q2m_correction_ncdf.pro

    r80 r81  
    77; ======================= 
    88; 
     9; DESCRIPTION 
     10; =========== 
     11; 
    912; Correction of q2m on OAFLUX grid 
    1013; 
    1114; :file:`${PROJECT_OD}/erai_q2m_19890101_20091231_oafluxgrid.nc` have been 
    12 ; produced by :ref:`d2m_to_q2m.pro`. 
     15; produced by :ref:`d2m_to_q2m_erai.pro`. 
    1316; 
    1417; Corrected q2m on OAFLUX grid is written in 
     
    6972; EVOLUTIONS 
    7073; ========== 
     74; 
     75; $Id$ 
     76; 
     77; $URL$ 
    7178; 
    7279; - fplod 20110808T143129Z aedon.locean-ipsl.upmc.fr (Darwin) 
Note: See TracChangeset for help on using the changeset viewer.