Changeset 72 for trunk/src/lwr_correction_ncdf.pro
- Timestamp:
- 08/08/11 17:08:15 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lwr_correction_ncdf.pro
r50 r72 6 6 ; lwr_correction_ncdf.pro 7 7 ; ======================= 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`. 8 19 ; 9 20 ; .. graphviz:: … … 14 25 ; ] 15 26 ; 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 ; 19 30 ; lwr_correction_ncdf [shape=box, 20 31 ; fontname=Courier, … … 23 34 ; label="${PROJECT}/src/lwr_correction_ncdf.pro"]; 24 35 ; 25 ; {file_in} -> {lwr_correction_ncdf} -> { ncfile}36 ; {file_in} -> {lwr_correction_ncdf} -> {file_out} 26 37 ; 27 38 ; } … … 29 40 ; SEE ALSO 30 41 ; ======== 42 ; 43 ; :ref:`project_profile.sh` 44 ; 45 ; :ref:`mooring_corrections` 46 ; 47 ; :ref:`interp_erai_lwr_1989_2009.pro` 31 48 ; 32 49 ; :func:`initncdf <saxo:initncdf>` … … 44 61 ; IDL> lwr_correction_ncdf 45 62 ; 46 ;47 63 ; TODO 48 64 ; ==== 49 65 ; 50 ; hard coded directory - usage of ${PROJECT_ID}51 ;52 66 ; 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 53 83 ; 54 84 ; EVOLUTIONS 55 85 ; ========== 56 86 ; 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 ; 57 94 ; - fplod 20101215T113707Z aedon.locean-ipsl.upmc.fr (Darwin) 58 95 ; … … 69 106 ;- 70 107 pro 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 116 CASE 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 129 iodirout = isadirectory(project_od_env) 130 ; 131 ; existence and protection for reading 132 IF (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 136 ENDIF 137 ; 138 ; existence and protection for writing 139 IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 140 msg = 'eee : the directory' + iodirout + ' was not found.' 141 ras = report(msg) 142 STOP 143 ENDIF 144 ; 72 145 da1=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 148 filename='erai_lwr_19890101_20091231_oafluxgrid.nc' 149 ; 150 ; check if this file exists 151 fullfilename = isafile(iodirout + filename, NEW=0, /MUST_EXIST) 152 IF fullfilename[0] EQ '' THEN BEGIN 153 msg = 'eee : the file ' + fullfilename + ' was not found.' 154 ras = report(msg) 155 STOP 156 ENDIF 157 ; 158 ; build output filename 159 filename_out = 'TropFlux_lwr_19890101_20091231.nc' 160 fullfilename_out = iodirout + filename_out 161 ; in order to avoid unexpected overwritten 162 IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 163 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 164 ras = report(msg) 165 STOP 166 ENDIF 167 ; 168 initncdf, fullfilename 169 lwr=read_ncdf('lwr',da1,da2,file=fullfilename,/nostr) 77 170 help, lwr 78 171 ; 79 172 lwr_mean=grossemoyenne(lwr,'t',/nan) 80 173 help,lwr_mean … … 116 209 time=time-julday(1,1,1950) & jpt=n_elements(time) 117 210 118 ncfile='! /Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_lwr_19890101_20091231_v1.nc'211 ncfile='!' + fullfilename_out 119 212 lon_attr={units:'degrees_east',long_name:'Longitude'} 120 213 lat_attr={units:'degrees_north',long_name:'Latitude'} … … 123 216 globattr={source:'Basic data obtained from ERAI. Mean correction for bias and correction for variability are applied',timerange:cda0+' - '+cda1} 124 217 125 126 218 ncfields = 'lwr[longitude,latitude,time]=lwr_new:lwr_attr; ' $ 127 219 + 'longitude[]=lon:lon_attr; ' $
Note: See TracChangeset
for help on using the changeset viewer.