Changeset 72 for trunk/src


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

start to work on correction tools

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cronin_gustiness_ncdf.pro

    r50 r72  
    77; ========================= 
    88; 
     9; Cronin gustiness correction on corrected sst on OAFLUX grid 
     10; 
     11; :file:`${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc` have been produced by 
     12; :ref:`sst_correction_ncdf.pro`. 
     13; 
     14; Cronin gustiness corrected ++ on corrected sst on OAFLUX grid 
     15; is written in 
     16; :file:`${PROJECT_OD}/TropFlux_gustiness_19890101_20091231.nc` 
     17; if this file not already exists. 
     18; 
     19; This file will be used by :ref:`TropFlux_swr_BLND_19890101_20091231.pro` and 
     20; :ref:`TropFlux_19890101_20091231.pro`. 
     21; 
    922;     .. graphviz:: 
    1023; 
     
    1326;           rankdir="LR", 
    1427;           ] 
    15 ;           file_sst [shape=ellipse,fontname=Courier,label="/Volumes/Iomega_HDD/TropFlux/input_cor/full_cor/TropFlux_sst_19890101_20091231.nc"]; 
    16 ;           ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_gustiness_19890101_20091231_v50.nc"]; 
     28; 
     29;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc"]; 
     30;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_gustiness_19890101_20091231.nc"]; 
     31; 
    1732;           cronin_gustiness_ncdf [shape=box, 
    1833;           fontname=Courier, 
     
    2035;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/cronin_gustiness_ncdf.pro", 
    2136;           label="${PROJECT}/src/cronin_gustiness_ncdf.pro"]; 
    22 ;           {file_sst} -> {cronin_gustiness_ncdf} -> {ncfile} 
     37; 
     38;           {file_in} -> {cronin_gustiness_ncdf} -> {file_out} 
    2339;        } 
    2440; 
     
    3349; ======== 
    3450; 
     51; :ref:`project_profile.sh` 
     52; 
     53; :ref:`mooring_corrections` 
     54; 
     55; :ref:`sst_correction_ncdf.pro`. 
     56; 
    3557; :func:`initncdf <saxo:initncdf>` 
    3658; :func:`julday <saxo:julday>` 
     
    4062; ==== 
    4163; 
    42 ; hard coded directory - usage of ${PROJECT_ID} 
     64; coding rules 
    4365; 
    44 ; coding rules 
     66; why writing more than 1 timestep ? 
     67; 
     68; KNOWN ISSUES 
     69; ============ 
     70; 
     71; test of existence of fullfilename_in not very efficient because 
     72; MUST_EXIST keyword of :func:`isafile <saxo:isafile>` not yet implemented 
    4573; 
    4674; EVOLUTIONS 
    4775; ========== 
     76; 
     77; - fplod 20110808T144208Z aedon.locean-ipsl.upmc.fr (Darwin) 
     78; 
     79;   * usage of ${PROJECT_OD} 
     80;   * complete description 
     81;   * remove v50 in output filename 
     82;   * remove return statement 
    4883; 
    4984; - fplod 20101215T092619Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    6196;- 
    6297pro cronin_gustiness_ncdf 
    63 @common 
     98; 
     99@cm_4cal 
     100@cm_4data 
     101@cm_4mesh 
     102@cm_4data 
     103@cm_project 
     104; 
     105; test if ${PROJECT_OD} defined 
     106CASE project_od_env OF 
     107  '' : BEGIN 
     108         msg = 'eee : ${PROJECT_OD} is not defined' 
     109         ras = report(msg) 
     110       STOP 
     111       END 
     112  ELSE: BEGIN 
     113          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     114          ras = report(msg) 
     115        END 
     116 ENDCASE 
     117; 
     118; check if output data will be possible 
     119iodirout = isadirectory(project_od_env) 
     120; 
     121; existence and protection for reading 
     122IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     123   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
     124   ras = report(msg) 
     125   STOP 
     126ENDIF 
     127; 
     128; existence and protection for writing 
     129IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     130    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     131    ras = report(msg) 
     132    STOP 
     133ENDIF 
     134; 
    64135da1=19880101 & da2=20101231 
    65136date1=19890101 & date2=20081231 
    66  
    67 file_sst='/Volumes/Iomega_HDD/TropFlux/input_cor/full_cor/TropFlux_sst_19890101_20091231.nc' 
    68 initncdf, file_sst 
    69 sst=read_ncdf('sst',da1,da2,file=file_sst,/nostr) & sst=reform(sst-273.15) 
     137; 
     138; build data filename 
     139filename='TropFlux_sst_19890101_20091231.nc' 
     140; 
     141; check if this file exists 
     142fullfilename = isafile(iodirout + filename, NEW=0, /MUST_EXIST) 
     143IF fullfilename[0] EQ '' THEN BEGIN 
     144   msg = 'eee : the file ' + fullfilename + ' was not found.' 
     145   ras = report(msg) 
     146   STOP 
     147ENDIF 
     148; 
     149; build output filename 
     150filename_out = 'TropFlux_gustiness_19890101_20091231.nc' 
     151fullfilename_out = iodirout + filename_out 
     152; in order to avoid unexpected overwritten 
     153IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     154   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     155   ras = report(msg) 
     156   STOP 
     157ENDIF 
     158; 
     159initncdf, fullfilename 
     160sst=read_ncdf('sst',da1,da2,file=fullfilename,/nostr) & sst=reform(sst-273.15) 
    70161help, sst 
    71162 
     
    90181xlon=reform(glamt(*,0) ) & ylat=reform(gphit(0,*)) 
    91182 
    92 ncfile='!/Users/pkb/data/TropFlux/TropFlux_gustiness_19890101_20091231_v50.nc' 
     183ncfile='!' + fullfilename_out 
    93184lon_attr={units:'degrees_east',long_name:'Longitude'} 
    94185lat_attr={units:'degrees_north',long_name:'Latitude'} 
     
    105196@ncdf_quickwrite 
    106197 
    107 return 
    108198end 
  • trunk/src/d2m_to_q2m_erai.pro

    r50 r72  
    66; d2m_to_q2m_erai.pro 
    77; =================== 
     8; 
     9; Converstion of d2m to q2m on OAFLUX grid 
     10; 
     11; :file:`${PROJECT_OD}/erai_d2m_19890101_20091231_oafluxgrid.nc` have been  
     12; produced by :ref:`interp_erai_dewt_1989_2009.pro`. 
     13; 
     14; :file:`${PROJECT_OD}/erai_t2m_19890101_20091231_oafluxgrid.nc` have been  
     15; produced by :ref:`interp_erai_t2m_1989_2009.pro`. 
     16; 
     17; :file:`${PROJECT_OD}/erai_msl_19890101_20091231_oafluxgrid.nc` have been  
     18; produced by ++. 
     19; 
     20; q2m on OAFLUX grid is written in 
     21; :file:`${PROJECT_OD}/q2m_erai_19890101_20091231_oafluxgrid.nc` 
     22; if this file not already exists. 
     23; 
     24; This file will be used by :ref:`q2m_correction_ncdf.pro`. 
    825; 
    926;     .. graphviz:: 
     
    1330;           rankdir="LR", 
    1431;           ] 
    15 ;           file_d2m [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_d2m_19890101_20091231_oafluxgrid.nc"]; 
    16 ;           file_t2m [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_t2m_19890101_20091231_oafluxgrid.nc"]; 
    17 ;           file_msl [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_msl_19890101_20091231_oafluxgrid.nc"]; 
    18  
    19 ;           file_q2m [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/q2m_erai_19890101_20091231_oafluxgrid.nc"]; 
     32; 
     33;           file_d2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_d2m_19890101_20091231_oafluxgrid.nc"]; 
     34;           file_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_t2m_19890101_20091231_oafluxgrid.nc"]; 
     35;           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"]; 
    2037; 
    2138;           d2m_to_q2m_erai [shape=box, 
     
    2441;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/d2m_to_q2m_erai.pro", 
    2542;           label="${PROJECT}/src/d2m_to_q2m_erai.pro"]; 
     43; 
    2644;           {file_d2m file_t2m file_msl} -> {d2m_to_q2m_erai} -> {file_q2m} 
    2745;        } 
     
    2947; SEE ALSO 
    3048; ======== 
     49; 
     50; :ref:`project_profile.sh` 
     51; 
     52; :ref:`mooring_corrections` 
     53; 
     54; :ref:`interp_erai_dewt_1989_2009.pro` 
     55; :ref:`interp_erai_t2m_1989_2009.pro` 
     56; 
     57; :ref:`d2m_to_q2m_erai.pro` 
    3158; 
    3259; :func:`rh_to_spechum` 
     
    4673; ==== 
    4774; 
    48 ; hard coded directory - usage of ${PROJECT_ID} 
     75; I (fp) do not know how 
     76; ${PROJECT_OD}/erai_msl_19890101_20091231_oafluxgrid.nc is produced. 
     77; 
     78; es0 undefined 
    4979; 
    5080; coding rules 
     
    5383; ========== 
    5484; 
     85; - fplod 20110808T120234Z cratos (Linux) 
     86; 
     87;   * usage of ${PROJECT_OD} 
     88;   * complete description 
     89;   * remove return statement 
     90; 
    5591; - fplod 20101215T162933Z aedon.locean-ipsl.upmc.fr (Darwin) 
    5692; 
     
    71107;- 
    72108pro d2m_to_q2m_erai 
    73 @common 
    74 ;; reading erai dew point temperature 
     109; 
     110@cm_4cal 
     111@cm_4data 
     112@cm_4mesh 
     113@cm_4data 
     114@cm_project 
     115; 
     116; test if ${PROJECT_OD} defined 
     117CASE project_od_env OF 
     118  '' : BEGIN 
     119         msg = 'eee : ${PROJECT_OD} is not defined' 
     120         ras = report(msg) 
     121       STOP 
     122       END 
     123  ELSE: BEGIN 
     124          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     125          ras = report(msg) 
     126        END 
     127 ENDCASE 
     128; 
     129; check if output data will be possible 
     130iodirout = isadirectory(project_od_env) 
     131; 
     132; existence and protection for reading 
     133IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     134   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
     135   ras = report(msg) 
     136   STOP 
     137ENDIF 
     138; 
     139; existence and protection for writing 
     140IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     141    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     142    ras = report(msg) 
     143    STOP 
     144ENDIF 
     145; 
    75146d1=19881001 & d2=20101231 
    76  
    77 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_d2m_19890101_20091231_oafluxgrid.nc' 
    78 initncdf, file 
    79 td=read_ncdf("d2m", d1,d2, file=file,/nostr) 
    80  
    81 ;; reading erai air temperature 
    82 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_t2m_19890101_20091231_oafluxgrid.nc' 
    83 initncdf, file 
    84 t=read_ncdf("t2m", d1,d2, file=file,/nostr) 
     147; 
     148; build d2m filename 
     149filename_d2m='erai_d2m_19890101_20091231_oafluxgrid.nc' 
     150; 
     151; check if this file exists 
     152fullfilename_d2m = isafile(iodirout + filename_d2m, NEW=0, /MUST_EXIST) 
     153IF fullfilename_d2m[0] EQ '' THEN BEGIN 
     154   msg = 'eee : the file ' + fullfilename_d2m + ' was not found.' 
     155   ras = report(msg) 
     156   STOP 
     157ENDIF 
     158; 
     159; build t2m filename 
     160filename_t2m='erai_t2m_19890101_20091231_oafluxgrid.nc' 
     161; 
     162; check if this file exists 
     163fullfilename_t2m = isafile(iodirout + filename_t2m, NEW=0, /MUST_EXIST) 
     164IF fullfilename_t2m[0] EQ '' THEN BEGIN 
     165   msg = 'eee : the file ' + fullfilename_t2m + ' was not found.' 
     166   ras = report(msg) 
     167   STOP 
     168ENDIF 
     169; 
     170; build msl filename 
     171filename_msl='erai_msl_19890101_20091231_oafluxgrid.nc' 
     172; 
     173; check if this file exists 
     174fullfilename_msl = isafile(iodirout + filename_msl, NEW=0, /MUST_EXIST) 
     175IF fullfilename_msl[0] EQ '' THEN BEGIN 
     176   msg = 'eee : the file ' + fullfilename_msl + ' was not found.' 
     177   ras = report(msg) 
     178   STOP 
     179ENDIF 
     180; 
     181; build output filename 
     182filename_out = 'q2m_erai_19890101_20091231_oafluxgrid.nc' 
     183fullfilename_out = iodirout + filename_out 
     184; in order to avoid unexpected overwritten 
     185IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     186   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     187   ras = report(msg) 
     188   STOP 
     189ENDIF 
     190; 
     191; reading erai dew point temperature 
     192initncdf, fullfilename_d2m 
     193td=read_ncdf("d2m", d1,d2, file=fullfilename_d2m,/nostr) 
     194 
     195; reading erai air temperature 
     196initncdf, fullfilename_t2m 
     197t=read_ncdf("t2m", d1,d2, file=fullfilename_t2m,/nostr) 
    85198tt=time &jpt=n_elements(time) 
    86199help, t, td 
     
    99212t=t-273.15 
    100213 
    101 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_msl_19890101_20091231_oafluxgrid.nc' 
    102 initncdf, file 
    103 P=read_ncdf("msl", d1, d2, file=file,/nostr) 
     214initncdf, fullfilename_msl 
     215P=read_ncdf("msl", d1, d2, file=fullfilename_msl,/nostr) 
    104216help, P 
    105217q2m=rh_to_spechum(rh,t,P) 
    106218 
    107 ;;writing field 
    108 ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/q2m_erai_19890101_20091231_oafluxgrid.nc' 
     219;writing field 
     220ncfile='!' + fullfilename_out 
    109221time=timegen(7670, units='days', start=julday(1,1,1989)) & jpt=n_elements(time) 
    110222cda0=string(jul2date(time(0)),format='(i8.8)') 
     
    129241 
    130242@ncdf_quickwrite 
    131 return 
    132243end 
  • trunk/src/interp_erai_sst_1989_2009.pro

    r71 r72  
    7070; TODO 
    7171; ==== 
     72; 
     73; on cratos strange red data looking with ncview 
    7274; 
    7375; make it work : pb on loholt1:: 
  • trunk/src/lwr_correction_ncdf.pro

    r50 r72  
    66; lwr_correction_ncdf.pro 
    77; ======================= 
     8; 
     9; Correction of lwr on OAFLUX grid 
     10; 
     11; :file:`${PROJECT_OD}/erai_lwr_19890101_20091231_oafluxgrid.nc` have been 
     12; produced by :ref:`interp_erai_lwr_1989_2009.pro`. 
     13; 
     14; Corrected lwr on OAFLUX grid is written in 
     15; :file:`${PROJECT_OD}/TropFlux_lwr_19890101_20091231.nc` 
     16; if this file not already exists. 
     17; 
     18; This file will be used by :ref:`TropFlux_19890101_20091231.pro`. 
    819; 
    920;     .. graphviz:: 
     
    1425;           ] 
    1526; 
    16 ;           file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_lwr_19890102_20091231_oafluxgrid.nc"]; 
    17 ; 
    18 ;           ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_lwr_19890101_20091231_v1.nc"]; 
     27;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_lwr_19890101_20091231_oafluxgrid.nc"]; 
     28;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_lwr_19890101_20091231.nc"]; 
     29; 
    1930;           lwr_correction_ncdf [shape=box, 
    2031;           fontname=Courier, 
     
    2334;           label="${PROJECT}/src/lwr_correction_ncdf.pro"]; 
    2435; 
    25 ;           {file_in} -> {lwr_correction_ncdf} -> {ncfile} 
     36;           {file_in} -> {lwr_correction_ncdf} -> {file_out} 
    2637; 
    2738;        } 
     
    2940; SEE ALSO 
    3041; ======== 
     42; 
     43; :ref:`project_profile.sh` 
     44; 
     45; :ref:`mooring_corrections` 
     46; 
     47; :ref:`interp_erai_lwr_1989_2009.pro` 
    3148; 
    3249; :func:`initncdf <saxo:initncdf>` 
     
    4461;  IDL> lwr_correction_ncdf 
    4562; 
    46 ; 
    4763; TODO 
    4864; ==== 
    4965; 
    50 ; hard coded directory - usage of ${PROJECT_ID} 
    51 ; 
    5266; coding rules 
     67; 
     68; lwr long name 'Air Temperature at 2m" : ??? 
     69; 
     70; 19890101 is not provided in ERA-Intermim file str : a possible workaround is 
     71; to copy 19890102 
     72; dataset to 19890101 using nco before processing. see 
     73; ref:`compute_erai_daily_region_2d.sh` 
     74; 
     75; here I (fp) replace hard coded date 19890102 by 19890101. must check 
     76; consistency with this module and interp_erai_lwr_1989_2009.pro. 
     77; 
     78; KNOWN ISSUES 
     79; ============ 
     80; 
     81; test of existence of fullfilename_in not very efficient because 
     82; MUST_EXIST keyword of :func:`isafile <saxo:isafile>` not yet implemented 
    5383; 
    5484; EVOLUTIONS 
    5585; ========== 
    5686; 
     87; - fplod 20110808T120234Z cratos (Linux) 
     88; 
     89;   * usage of ${PROJECT_OD} 
     90;   * complete description 
     91;   * replace erai_lwr_19890102_20091231_oafluxgrid.nc by erai_lwr_19890101_20091231 
     92;   * remove v1 in output filename 
     93; 
    5794; - fplod 20101215T113707Z aedon.locean-ipsl.upmc.fr (Darwin) 
    5895; 
     
    69106;- 
    70107pro lwr_correction_ncdf 
    71 @common 
     108; 
     109@cm_4cal 
     110@cm_4data 
     111@cm_4mesh 
     112@cm_4data 
     113@cm_project 
     114; 
     115; test if ${PROJECT_OD} defined 
     116CASE project_od_env OF 
     117  '' : BEGIN 
     118         msg = 'eee : ${PROJECT_OD} is not defined' 
     119         ras = report(msg) 
     120       STOP 
     121       END 
     122  ELSE: BEGIN 
     123          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     124          ras = report(msg) 
     125        END 
     126 ENDCASE 
     127; 
     128; check if output data will be possible 
     129iodirout = isadirectory(project_od_env) 
     130; 
     131; existence and protection for reading 
     132IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     133   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
     134   ras = report(msg) 
     135   STOP 
     136ENDIF 
     137; 
     138; existence and protection for writing 
     139IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     140    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     141    ras = report(msg) 
     142    STOP 
     143ENDIF 
     144; 
    72145da1=19880101 & da2=20091231 
    73  
    74 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_lwr_19890102_20091231_oafluxgrid.nc' 
    75 initncdf, file 
    76 lwr=read_ncdf('lwr',da1,da2,file=file,/nostr) 
     146; 
     147; build data filename 
     148filename='erai_lwr_19890101_20091231_oafluxgrid.nc' 
     149; 
     150; check if this file exists 
     151fullfilename = isafile(iodirout + filename, NEW=0, /MUST_EXIST) 
     152IF fullfilename[0] EQ '' THEN BEGIN 
     153   msg = 'eee : the file ' + fullfilename + ' was not found.' 
     154   ras = report(msg) 
     155   STOP 
     156ENDIF 
     157; 
     158; build output filename 
     159filename_out = 'TropFlux_lwr_19890101_20091231.nc' 
     160fullfilename_out = iodirout + filename_out 
     161; in order to avoid unexpected overwritten 
     162IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     163   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     164   ras = report(msg) 
     165   STOP 
     166ENDIF 
     167; 
     168initncdf, fullfilename 
     169lwr=read_ncdf('lwr',da1,da2,file=fullfilename,/nostr) 
    77170help, lwr 
    78  
     171; 
    79172lwr_mean=grossemoyenne(lwr,'t',/nan) 
    80173help,lwr_mean 
     
    116209time=time-julday(1,1,1950) & jpt=n_elements(time) 
    117210 
    118 ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_lwr_19890101_20091231_v1.nc' 
     211ncfile='!' + fullfilename_out 
    119212lon_attr={units:'degrees_east',long_name:'Longitude'} 
    120213lat_attr={units:'degrees_north',long_name:'Latitude'} 
     
    123216globattr={source:'Basic data obtained from ERAI.  Mean correction for  bias and correction for variability are applied',timerange:cda0+' - '+cda1} 
    124217 
    125  
    126218ncfields = 'lwr[longitude,latitude,time]=lwr_new:lwr_attr; ' $ 
    127219                      + 'longitude[]=lon:lon_attr; ' $ 
  • trunk/src/q2m_correction_ncdf.pro

    r50 r72  
    66; q2m_correction_ncdf.pro 
    77; ======================= 
     8; 
     9; Correction of q2m on OAFLUX grid 
     10; 
     11; :file:`${PROJECT_OD}/erai_q2m_19890101_20091231_oafluxgrid.nc` have been 
     12; produced by :ref:`d2m_to_q2m.pro`. 
     13; 
     14; Corrected q2m on OAFLUX grid is written in 
     15; :file:`${PROJECT_OD}/TropFlux_q2m_19890101_20091231.nc` 
     16; if this file not already exists. 
     17; 
     18; This file will be used by :ref:`TropFlux_19890101_20091231.pro`. 
    819; 
    920;     .. graphviz:: 
     
    1425;           ] 
    1526; 
    16 ;           file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_q2m_19890101_20091231_oafluxgrid.nc"]; 
    17 ; 
    18 ;           ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_q2m_19890101_20091231_v20.nc"]; 
     27;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_q2m_19890101_20091231_oafluxgrid.nc"]; 
     28;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_q2m_19890101_20091231.nc"]; 
    1929; 
    2030;           q2m_correction_ncdf [shape=box, 
     
    2434;           label="${PROJECT}/src/q2m_correction_ncdf.pro"]; 
    2535; 
    26 ;           {file_in} -> {q2m_correction_ncdf} -> {ncfile} 
     36;           {file_in} -> {q2m_correction_ncdf} -> {file_out} 
    2737; 
    2838;        } 
     
    3040; SEE ALSO 
    3141; ======== 
     42; 
     43; :ref:`project_profile.sh` 
     44; 
     45; :ref:`mooring_corrections` 
     46; 
     47; :ref:`d2m_to_q2m.pro` 
    3248; 
    3349; :func:`initncdf <saxo:initncdf>` 
     
    4763; ==== 
    4864; 
    49 ; hard coded directory - usage of ${PROJECT_ID} 
     65; can be tested because d2m_to_q2m.pro pb 
    5066; 
    5167; coding rules 
     
    5470; ========== 
    5571; 
     72; - fplod 20110808T143129Z aedon.locean-ipsl.upmc.fr (Darwin) 
     73; 
     74;   * usage of ${PROJECT_OD} 
     75;   * remove v20 in output filename 
     76; 
    5677; - fplod 20101215T113945Z aedon.locean-ipsl.upmc.fr (Darwin) 
    5778; 
     
    6889;- 
    6990pro q2m_correction_ncdf 
    70 @common 
     91; 
     92@cm_4cal 
     93@cm_4data 
     94@cm_4mesh 
     95@cm_4data 
     96@cm_project 
     97; 
     98; 
     99; test if ${PROJECT_OD} defined 
     100CASE project_od_env OF 
     101  '' : BEGIN 
     102         msg = 'eee : ${PROJECT_OD} is not defined' 
     103         ras = report(msg) 
     104       STOP 
     105       END 
     106  ELSE: BEGIN 
     107          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     108          ras = report(msg) 
     109        END 
     110 ENDCASE 
     111; 
     112; check if output data will be possible 
     113iodirout = isadirectory(project_od_env) 
     114; 
     115; existence and protection for reading 
     116IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     117   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
     118   ras = report(msg) 
     119   STOP 
     120ENDIF 
     121; 
     122; existence and protection for writing 
     123IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     124    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     125    ras = report(msg) 
     126    STOP 
     127ENDIF 
     128; 
    71129da1=19880101 & da2=20101231 
    72  
    73 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_q2m_19890101_20091231_oafluxgrid.nc' 
    74 initncdf, file 
    75 q2m=read_ncdf('q2m',da1,da2,file=file,/nostr) 
     130; 
     131; build data filename 
     132filename='erai_q2m_19890101_20091231_oafluxgrid.nc' 
     133; 
     134; check if this file exists 
     135fullfilename = isafile(iodirout + filename, NEW=0, /MUST_EXIST) 
     136IF fullfilename[0] EQ '' THEN BEGIN 
     137   msg = 'eee : the file ' + fullfilename + ' was not found.' 
     138   ras = report(msg) 
     139   STOP 
     140ENDIF 
     141; 
     142; build output filename 
     143filename_out = 'TropFlux_q2m_19890101_20091231.nc' 
     144fullfilename_out = iodirout + filename_out 
     145; in order to avoid unexpected overwritten 
     146IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     147   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     148   ras = report(msg) 
     149   STOP 
     150ENDIF 
     151; 
     152initncdf, fullfilename 
     153q2m=read_ncdf('q2m',da1,da2,file=fullfilename,/nostr) 
    76154help, q2m 
    77155 
     
    114192time=time-julday(1,1,1950) & jpt=n_elements(time) 
    115193 
    116 ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_q2m_19890101_20091231_v20.nc' 
     194ncfile='!' + fullfilename_out 
    117195lon_attr={units:'degrees_east',long_name:'Longitude'} 
    118196lat_attr={units:'degrees_north',long_name:'Latitude'} 
     
    121199globattr={source:'Basic data obtained from ERAI.  Mean correction for bias and correction for variability are applied',timerange:cda0+' - '+cda1} 
    122200 
    123  
    124201ncfields = 'q2m[longitude,latitude,time]=q2m_new:q2m_attr; ' $ 
    125202                      + 'longitude[]=lon:lon_attr; ' $ 
  • trunk/src/sst_correction_ncdf.pro

    r50 r72  
    66; sst_correction_ncdf.pro 
    77; ======================= 
     8; 
     9; Correction of sst on OAFLUX grid 
     10; 
     11; :file:`${PROJECT_OD}/erai_sst_19890101_20091231_oafluxgrid.nc` have been 
     12; produced by :ref:`interp_erai_sst_1989_2009.pro`. 
     13; 
     14; Corrected sst on OAFLUX grid is written in 
     15; :file:`${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc` 
     16; if this file not already exists. 
     17; 
     18; This file will be used by :ref:`cronin_gustiness_ncdf.pro` and  
     19; :ref:`TropFlux_19890101_20091231.pro`. 
    820; 
    921;     .. graphviz:: 
     
    1426;           ] 
    1527; 
    16 ;           file_sst [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_sst_19890101_20091231_oafluxgrid.nc"]; 
    17 ; 
    18 ;           ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_sst_19890101_20091231_v20.nc"]; 
     28;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_sst_19890101_20091231_oafluxgrid.nc"]; 
     29;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc"]; 
    1930; 
    2031;           sst_correction_ncdf [shape=box, 
     
    2435;           label="${PROJECT}/src/sst_correction_ncdf.pro"]; 
    2536; 
    26 ;           {file_sst} -> {sst_correction_ncdf} -> {ncfile} 
     37;           {file_in} -> {sst_correction_ncdf} -> {file_out} 
    2738; 
    2839;        } 
     
    3142; SEE ALSO 
    3243; ======== 
     44; 
     45; :ref:`project_profile.sh` 
     46; 
     47; :ref:`mooring_corrections` 
     48; 
     49; :ref:`interp_erai_sst_1989_2009.pro` 
    3350; 
    3451; :func:`initncdf <saxo:initncdf>` 
     
    4865; ==== 
    4966; 
    50 ; hard coded directory - usage of ${PROJECT_ID} 
    51 ; 
    5267; coding rules 
     68; 
     69; temperature SI units = K : why + and - 273... 
     70; 
     71; hard coded coefficient correction. 
     72; 
     73; KNOWN ISSUES 
     74; ============ 
     75; 
     76; test of existence of fullfilename_in not very efficient because 
     77; MUST_EXIST keyword of :func:`isafile <saxo:isafile>` not yet implemented 
    5378; 
    5479; EVOLUTIONS 
    5580; ========== 
    5681; 
     82; - fplod 20110808T124236Z cratos (Linux) 
     83; 
     84;   * usage of ${PROJECT_OD} 
     85;   * complete description 
     86;   * remove v20 in output filename 
     87; 
    5788; - fplod 20101215T114224Z aedon.locean-ipsl.upmc.fr (Darwin) 
    5889; 
     
    69100;- 
    70101pro sst_correction_ncdf 
    71 @common 
     102; 
     103@cm_4cal 
     104@cm_4data 
     105@cm_4mesh 
     106@cm_4data 
     107@cm_project 
     108; 
     109; test if ${PROJECT_OD} defined 
     110CASE project_od_env OF 
     111  '' : BEGIN 
     112         msg = 'eee : ${PROJECT_OD} is not defined' 
     113         ras = report(msg) 
     114       STOP 
     115       END 
     116  ELSE: BEGIN 
     117          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     118          ras = report(msg) 
     119        END 
     120 ENDCASE 
     121; 
     122; check if output data will be possible 
     123iodirout = isadirectory(project_od_env) 
     124; 
     125; existence and protection for reading 
     126IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     127   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
     128   ras = report(msg) 
     129   STOP 
     130ENDIF 
     131; 
     132; existence and protection for writing 
     133IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     134    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     135    ras = report(msg) 
     136    STOP 
     137ENDIF 
     138; 
    72139da1=19880101 & da2=20091231 
    73  
    74 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_sst_19890101_20091231_oafluxgrid.nc' 
    75 initncdf, file 
    76 sst=read_ncdf('sst',da1,da2,file=file,/nostr) & sst=sst-273.15 
     140; 
     141; build data filename 
     142filename='erai_sst_19890101_20091231_oafluxgrid.nc' 
     143; 
     144; check if this file exists 
     145fullfilename = isafile(iodirout + filename, NEW=0, /MUST_EXIST) 
     146IF fullfilename[0] EQ '' THEN BEGIN 
     147   msg = 'eee : the file ' + fullfilename + ' was not found.' 
     148   ras = report(msg) 
     149   STOP 
     150ENDIF 
     151; 
     152; build output filename 
     153filename_out = 'TropFlux_sst_19890101_20091231.nc' 
     154fullfilename_out = iodirout + filename_out 
     155; in order to avoid unexpected overwritten 
     156IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     157   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     158   ras = report(msg) 
     159   STOP 
     160ENDIF 
     161; 
     162initncdf, fullfilename 
     163sst=read_ncdf('sst',da1,da2,file=fullfilename,/nostr) & sst=sst-273.15 
    77164help, sst 
    78165 
     
    116203time=time-julday(1,1,1950) & jpt=n_elements(time) 
    117204 
    118 ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_sst_19890101_20091231_v20.nc' 
     205ncfile='!' + fullfilename_out 
    119206lon_attr={units:'degrees_east',long_name:'Longitude'} 
    120207lat_attr={units:'degrees_north',long_name:'Latitude'} 
     
    123210globattr={source:'Basic data obtained from ERAI.  Bias and variability correction are applied',timerange:cda0+' - '+cda1} 
    124211 
    125  
    126212ncfields = 'sst[longitude,latitude,time]=sst_new:sst_attr; ' $ 
    127213                      + 'longitude[]=lon:lon_attr; ' $ 
  • trunk/src/t2m_correction_ncdf.pro

    r50 r72  
    1414; 
    1515; Corrected air temperature at 2 m height is written in 
    16 ; :file:`${PROJECT_OD}/TropFlux_t2m_19890101_20091231_v50.nc`. 
     16; :file:`${PROJECT_OD}/TropFlux_t2m_19890101_20091231.nc` 
     17; if this file not already exists. 
     18; 
     19; This file will be used by :ref:`TropFlux_19890101_20091231.pro`. 
    1720; 
    1821;     .. graphviz:: 
     
    2326;           ] 
    2427; 
    25 ;           file_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_t2m_19890101_20091231_oafluxgrid.nc"]; 
    26 ; 
    27 ;           ncfile [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_t2m_19890101_20091231_v50.nc"]; 
     28;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_t2m_19890101_20091231_oafluxgrid.nc"]; 
     29;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_t2m_19890101_20091231.nc"]; 
    2830; 
    2931;           t2m_correction_ncdf [shape=box, 
     
    3335;           label="${PROJECT}/src/t2m_correction_ncdf.pro"]; 
    3436; 
    35 ;           {file_t2m} -> {t2m_correction_ncdf} -> {ncfile} 
     37;           {file_in} -> {t2m_correction_ncdf} -> {file_out} 
    3638; 
    3739;        } 
     
    6567; ==== 
    6668; 
    67 ; make it work !! 
    68 ; 
    6969; coding rules 
    7070; 
     
    7575; hard coded time in module name and in output filename 
    7676; 
    77 ; why v50 in filename output 
    78 ; 
    7977; hard coded correction values 
    8078; 
     
    8280; 
    8381;    Probleme d'adequation entre les tailles du domaine nx*ny*jpt 350*60*1 et du tableau 350*60*7670 
    84 ; 
    8582; 
    8683; hard coded attributes 
     
    9693; EVOLUTIONS 
    9794; ========== 
     95; 
     96; - fplod 20110808T130628Z aedon.locean-ipsl.upmc.fr (Darwin) 
     97; 
     98;   * remove v50 in filename output 
     99;   * replace _ID by _OD (like other correction modules) 
    98100; 
    99101; - fplod 20110104T093758Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    124126pro t2m_correction_ncdf 
    125127; 
    126 @common 
     128@cm_4cal 
     129@cm_4data 
     130@cm_4mesh 
     131@cm_4data 
    127132@cm_project 
    128133; 
    129 ; check for input directory 
    130 ; 
    131 ; test if ${PROJECT_ID} defined 
     134; test if ${PROJECT_OD} defined 
    132135CASE project_id_env OF 
    133136    ''  :  BEGIN 
    134      msg = 'eee : ${PROJECT_ID} is not defined' 
     137     msg = 'eee : ${PROJECT_OD} is not defined' 
    135138     ras = report(msg) 
    136139     STOP 
    137140           END 
    138141 ELSE: BEGIN 
    139      msg = 'iii : ${PROJECT_ID} is ' + project_id_env 
     142     msg = 'iii : ${PROJECT_OD} is ' + project_id_env 
    140143     ras = report(msg) 
    141144       END 
    142145ENDCASE 
    143146; 
    144 iodirin = isadirectory(project_id_env) 
    145 ; 
    146 ; existence and protection of ${PROJECT_ID} 
    147 IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
    148    msg = 'eee : the directory' + iodirin  + ' is not accessible.' 
     147; check if output data will be possible 
     148iodirout = isadirectory(project_od_env) 
     149; 
     150; existence and protection for reading 
     151IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     152   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
    149153   ras = report(msg) 
    150154   STOP 
    151155ENDIF 
    152156; 
    153 ; build uncorrected t2 filename 
     157; existence and protection for writing 
     158IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     159    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     160    ras = report(msg) 
     161    STOP 
     162ENDIF 
     163; 
    154164da1=19890101 
    155165da2=20091231 
     166; 
     167; build uncorrected t2 filename 
    156168filename_t2_uncor='erai_t2m_'+ string(da1,format='(i8.8)')+'_'+ string(da2,format='(i8.8)')+'_oafluxgrid.nc' 
    157169; 
    158170; check if this file exists 
    159 fullfilename_t2_uncor = isafile(iodirin + filename_t2_uncor, NEW=0, /MUST_EXIST) 
     171fullfilename_t2_uncor = isafile(iodirout + filename_t2_uncor, NEW=0, /MUST_EXIST) 
    160172IF fullfilename_t2_uncor[0] EQ '' THEN BEGIN 
    161173   msg = 'eee : the file ' + fullfilename_t2_uncor + ' was not found.' 
     
    163175   STOP 
    164176ENDIF 
    165 ; test if ${PROJECT_OD} defined 
    166 CASE project_od_env OF 
    167   '' : BEGIN 
    168          msg = 'eee : ${PROJECT_OD} is not defined' 
    169          ras = report(msg) 
    170        STOP 
    171        END 
    172   ELSE: BEGIN 
    173           msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
    174           ras = report(msg) 
    175         END 
    176  ENDCASE 
    177 ; 
    178 ; check if output data will be possible 
    179 iodirout = isadirectory(project_od_env) 
    180 ; 
    181 ; existence and protection 
    182 IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
    183     msg = 'eee : the directory' + iodirout  + ' was not found.' 
    184     ras = report(msg) 
    185     STOP 
    186 ENDIF 
    187177; 
    188178; build output filename 
    189 filename_out='TropFlux_t2m_'+ string(da1,format='(i8.8)')+'_'+ string(da2,format='(i8.8)')+'_v50.nc' 
     179filename_out='TropFlux_t2m_'+ string(da1,format='(i8.8)')+'_'+ string(da2,format='(i8.8)')+'.nc' 
    190180fullfilename_out = iodirout + filename_out 
    191181; in order to avoid unexpected overwritten 
  • trunk/src/ws_correction_ncdf.pro

    r50 r72  
    66; ws_correction_ncdf.pro 
    77; ====================== 
     8; 
     9; Correction of ws on OAFLUX grid 
     10; 
     11; :file:`${PROJECT_OD}/erai_ws_19890101_20091231_oafluxgrid.nc` have been 
     12; produced by :ref:`interp_erai_ws_1989_2009.pro`. 
     13; 
     14; Corrected ws on OAFLUX grid is written in 
     15; :file:`${PROJECT_OD}/TropFlux_ws_19890101_20091231.nc` 
     16; if this file not already exists. 
     17; 
     18; This file will be used by :ref:`TropFlux_19890101_20091231.pro`. 
    819; 
    920;     .. graphviz:: 
     
    1324;           rankdir="LR", 
    1425;           ] 
    15 ;           file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc"]; 
    16 ;           ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_ws_19890101_20091231_v20.nc"]; 
     26; 
     27;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_ws_19890101_20091231_oafluxgrid.nc"]; 
     28;           file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_ws_19890101_20091231.nc"]; 
     29; 
    1730;           ws_correction_ncdf [shape=box, 
    1831;           fontname=Courier, 
     
    2134;           label="${PROJECT}/src/ws_correction_ncdf.pro"]; 
    2235; 
    23 ;           {file_in} -> {ws_correction_ncdf} -> {ncfile} 
     36;           {file_in} -> {ws_correction_ncdf} -> {file_out} 
    2437; 
    2538;          } 
     
    2841; ======== 
    2942; 
     43; :ref:`project_profile.sh` 
     44; 
     45; :ref:`mooring_corrections` 
     46; 
     47; :ref:`interp_erai_vs_1989_2009.pro` 
     48; 
     49; :func:`initncdf <saxo:initncdf>` 
     50; :func:`read_ncdf <saxo:read_ncdf>` 
     51; :func:`grossemoyenne <saxo:grossemoyenne>` 
     52; :func:`julday <saxo:julday>` 
     53; :func:`caldat <saxo:caldat>` 
     54; :func:`ncdf_quickwrite <saxo:ncdf_quickwrite>` 
     55; 
    3056; EXAMPLES 
    3157; ======== 
     
    3864; ==== 
    3965; 
    40 ; hard coded directory - usage of ${PROJECT_ID} 
    41 ; 
    4266; coding rules 
     67; 
     68; hard coded correction 
     69; 
     70; KNOWN ISSUES 
     71; ============ 
     72; 
     73; test of existence of fullfilename_in not very efficient because 
     74; MUST_EXIST keyword of :func:`isafile <saxo:isafile>` not yet implemented 
    4375; 
    4476; EVOLUTIONS 
    4577; ========== 
    4678; 
     79; - fplod 20110808T131954Z aedon.locean-ipsl.upmc.fr (Darwin) 
     80; 
     81;   * usage of ${PROJECT_OD} 
     82;   * complete description 
     83;   * remove v20 in output filename 
     84 
    4785; - fplod 20101215T115916Z aedon.locean-ipsl.upmc.fr (Darwin) 
    4886; 
     
    5997;- 
    6098pro ws_correction_ncdf 
    61 @common 
     99; 
     100@cm_4cal 
     101@cm_4data 
     102@cm_4mesh 
     103@cm_4data 
     104@cm_project 
     105; 
     106; test if ${PROJECT_OD} defined 
     107CASE project_od_env OF 
     108  '' : BEGIN 
     109         msg = 'eee : ${PROJECT_OD} is not defined' 
     110         ras = report(msg) 
     111       STOP 
     112       END 
     113  ELSE: BEGIN 
     114          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     115          ras = report(msg) 
     116        END 
     117 ENDCASE 
     118; 
     119; check if output data will be possible 
     120iodirout = isadirectory(project_od_env) 
     121; 
     122; existence and protection for reading 
     123IF (FILE_TEST(iodirout, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     124   msg = 'eee : the directory' + iodirout  + ' is not accessible.' 
     125   ras = report(msg) 
     126   STOP 
     127ENDIF 
     128; 
     129; existence and protection for writing 
     130IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     131    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     132    ras = report(msg) 
     133    STOP 
     134ENDIF 
     135; 
    62136da1=19880101 & da2=20101231 
    63  
    64 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc' 
    65 initncdf, file 
    66 u=read_ncdf('u10',da1,da2,file=file,/nostr) 
    67 v=read_ncdf('v10',da1,da2,file=file,/nostr) 
     137; 
     138; build data filename 
     139filename='erai_ws_19890101_20091231_oafluxgrid.nc' 
     140; 
     141; check if this file exists 
     142fullfilename = isafile(iodirout + filename, NEW=0, /MUST_EXIST) 
     143IF fullfilename[0] EQ '' THEN BEGIN 
     144   msg = 'eee : the file ' + fullfilename + ' was not found.' 
     145   ras = report(msg) 
     146   STOP 
     147ENDIF 
     148; 
     149; build output filename 
     150filename_out = 'TropFlux_ws_19890101_20091231.nc' 
     151fullfilename_out = iodirout + filename_out 
     152; in order to avoid unexpected overwritten 
     153IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     154   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     155   ras = report(msg) 
     156   STOP 
     157ENDIF 
     158; 
     159initncdf, fullfilename 
     160u=read_ncdf('u10',da1,da2,file=fullfilename,/nostr) 
     161v=read_ncdf('v10',da1,da2,file=fullfilename,/nostr) 
    68162w=sqrt(u*u+v*v) 
    69163 
     
    109203time=time-julday(1,1,1950) & jpt=n_elements(time) 
    110204 
    111 ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_ws_19890101_20091231_v20.nc' 
     205ncfile='!' + fullfilename_out 
    112206lon_attr={units:'degrees_east',long_name:'Longitude'} 
    113207lat_attr={units:'degrees_north',long_name:'Latitude'} 
     
    116210globattr={source:'Basic data obtained from ERAI. Bias and variability correction are applied',timerange:cda0+' - '+cda1} 
    117211 
    118  
    119212ncfields = 'ws[longitude,latitude,time]=w_new:w_attr; ' $ 
    120213                      + 'longitude[]=lon:lon_attr; ' $ 
Note: See TracChangeset for help on using the changeset viewer.