Changeset 106 for trunk/SRC/Documentation/idldoc_html_output/search.js
- Timestamp:
- 06/12/06 16:49:30 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/idldoc_html_output/search.js
r104 r106 35 35 a[33] = new Array("./Interpolation/clickincell.html", "clickincell.pro", "", " file_comments click on a map and find in which cell the click was categories finding where is a point on a grid examples res clickincell Click with the left button to select a cell Clicking one more time in the same cell remove the cell from the selection Click on the right button to quit keyword CELLTYPE T W U V or F This this the type of point that is located in the center of the cell which the click is located default is T type of cell with corner defined by F points keyword DRAWCELL to draw the cell in which we clicked keyword COLOR the color used to draw the cells Clicking one more time in the same cell will draw the cell with the white color keyword ORIGINAL to get the position of the cell regarding the original grid with no key_shift ixminmesh iyminmesh keyword IJ see outpus keyword _EXTRA to pass extra keywords to inquad and plot when drawcell returns the index of the selected cells regarding to the grid which is in memory in the variable of the common If ij keyword is activated give 2D array 2 n which are the i j position of the n selected cells uses common pro examples IDL plt findgen jpi jpj nodata map 90 0 0 ortho IDL print clickincell draw color 150 xy history Sebastien Masson smasson lodyc jussieu fr August 2003 FUNCTION clickincell CELLTYPE celltype DRAWCELL drawcell COLOR color ORIGINAL original IJ ij _EXTRA extra common initialization cellnum 1L selected 0 Cell list get the grid parameter according to celltype oldgrid vargrid IF NOT keyword_set celltype THEN celltype T CASE strupcase celltype OF T :vargrid F W :vargrid F U :vargrid V V :vargrid U F :vargrid T ENDCASE grille 1 glam gphi 1 nx ny nz firstx firsty firstz lastx lasty lastz vargrid oldgrid define the corner of the cells in the clockwise direction IF keyword_set key_periodic AND nx EQ jpi THEN BEGIN x1 glam 0:ny 2 y1 gphi 0:ny 2 x2 glam 1:ny 1 y2 gphi 1:ny 1 x3 shift glam 1:ny 1 1 0 y3 shift gphi 1:ny 1 1 0 x4 shift glam 0:ny 2 1 0 y4 shift gphi 0:ny 2 1 0 ENDIF ELSE BEGIN x1 glam 0:nx 2 0:ny 2 y1 gphi 0:nx 2 0:ny 2 x2 glam 0:nx 2 1:ny 1 y2 gphi 0:nx 2 1:ny 1 x3 glam 1:nx 1 1:ny 1 y3 gphi 1:nx 1 1:ny 1 x4 glam 1:nx 1 0:ny 2 y4 gphi 1:nx 1 0:ny 2 ENDELSE glam 1 free memory gphi 1 free memory get mousse position on the reference map cursor x y data up while mouse button ne 4 do BEGIN IF finite x finite x EQ 0 THEN GOTO outwhile case mouse button of 1:BEGIN What is the longitude WHILE x GT x range 1 DO x x 360 WHILE x LT x range 0 DO x x 360 IF x GT x range 1 THEN GOTO outwhile IF y GT y range 1 THEN GOTO outwhile IF y LT y range 0 THEN GOTO outwhile cell inquad x y x1 y1 x2 y2 x3 y3 x4 y4 onsphere _extra extra IF cell 0 EQ 1 OR n_elements cell GT 1 THEN GOTO outwhile cell cell 0 already where cellnum EQ cell 0 IF already EQ 1 THEN BEGIN cellnum cellnum cell selected selected 1 already n_elements selected 1 ENDIF ELSE selected already 1 selected already IF keyword_set drawcell THEN BEGIN oplot x1 cell x2 cell x3 cell x4 cell x1 cell y1 cell y2 cell y3 cell y4 cell y1 cell color color selected already d n_colors 255 1 selected already _extra extra ENDIF END 2: middle button ELSE: ENDCASE get mousse position on the reference map outwhile: cursor x y data up ENDWHILE good where selected NE 0 IF good 0 EQ 1 THEN RETURN 1 cellnum cellnum good yy cellnum nx 1 key_periodic nx EQ jpi xx cellnum MOD nx 1 key_periodic nx EQ jpi CASE strupcase celltype OF T :BEGIN xx xx firstx 1 yy yy firsty 1 END W :BEGIN xx xx firstx 1 yy yy firsty 1 END U :BEGIN xx xx firstx yy yy firsty 1 END V :BEGIN xx xx firstx 1 yy yy firsty END F :BEGIN xx xx firstx yy yy firsty END ENDCASE bad where xx GE jpi IF bad 0 NE 1 THEN BEGIN xx bad xx bad jpi yy bad yy bad 1 ENDIF bad where yy GE jpj IF bad 0 NE 1 THEN stop IF keyword_set original THEN BEGIN xx xx key_shift bad where xx LT 0 IF bad 0 NE 1 THEN xx bad xx bad jpi xx xx MOD jpi xx xx ixminmesh yy yy iyminmesh ENDIF ncell n_elements xx IF keyword_set ij THEN RETURN reform xx 1 ncell over reform yy 1 ncell over IF keyword_set original THEN RETURN xx jpiglo yy ELSE RETURN xx jpi yy END "); 36 36 a[34] = new Array("./Interpolation/compute_fromreg_bilinear_weigaddr.html", "compute_fromreg_bilinear_weigaddr.pro", "", " file_comments compute the weight and address neede to interpolate data from a regular grid to any grid using the bilinear method categories interpolation param alonin in required longitudeof the input data param alatin in required latitude of the input data param olonin in required longitude of the output data param olat in required latitude of the output data keyword NONORTHERNLINE activate if you don t whant to take into account the northen line of the input data when perfoming the keyword NOSOUTHERNLINE activate if you don t whant to take into account the southern line of the input data when perfoming the interpolation returns weig addr: 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpio jpjo over restrictions the input grid must be a regular grid defined as a grid for which each lontitudes lines have the same latitude and each latitudes columns have the same longitude We supposed the data are located on a sphere with a periodicity along the longitude points located out of the southern and northern boundaries are interpolated using a linear interpolation only along the longitudinal direction history November 2005: Sebastien Masson smasson lodyc jussieu fr PRO compute_fromreg_bilinear_weigaddr alonin alatin olonin olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt strictarr strictarrsubs alon alonin alat alatin olon olonin jpia n_elements alon jpja n_elements alat jpio size olon dimensions 0 jpjo size olon dimensions 1 alon minalon min alon max maxalon IF maxalon minalon GE 360 THEN stop alon must be monotonically increasing IF array_equal sort alon lindgen jpia NE 1 THEN BEGIN shiftx where alon EQ min alon 0 alon shift alon shiftx IF array_equal sort alon lindgen jpia NE 1 THEN stop ENDIF ELSE shiftx 0 for longitude periodic bondary condition we add the fist column on the right side of the array and alon alon alon 0 360 jpia jpia 1L alat revy alat 0 GT alat 1 IF revy THEN alat reverse alat alat must be monotonically increasing IF array_equal sort alat lindgen jpja NE 1 THEN stop if keyword_set nonorthernline then BEGIN jpja jpja 1L alat alat 0: jpja 1L ENDIF if keyword_set nosouthernline then BEGIN alat alat 1: jpja 1L jpja jpja 1L ENDIF olon between minalon et minalon 360 out where olon LT minalon WHILE out 0 NE 1 DO BEGIN olon out olon out 360 out where olon LT minalon ENDWHILE out where olon GE minalon 360 WHILE out 0 NE 1 DO BEGIN olon out olon out 360 out where olon GE minalon 360 ENDWHILE make sure that all values of olon are located within values of alon IF min olon max ma LT minalon THEN stop IF ma GE minalon 360 THEN stop we want to do biliear interpolation for each ocean point we must find in which atm cell it is located if the ocean point is out of the atm grid we use closest neighbor interpolation for each T point of oce grid we find in which armospheric cell it is located As the atmospheric grid is regular we can use inrecgrid instead of inquad pos inrecgrid olon olat alon 0:jpia 2L alat 0:jpja 2L checkout alon jpia 1L alat jpja 1L output2d checks for longitude each ocean points must be located in atm cell IF where pos 0 EQ 1 0 NE 1 THEN stop no ocean point should be located westward of the left bondary of the atm cell in which it is supposed to be located IF total olon LT alon pos 0 NE 0 THEN stop no ocean point should be located eastward of the right bondary of the atm cell in which it is supposed to be located IF total olon GT alon pos 0 1 NE 0 THEN stop we use bilinear interpolation we change the coordinates of each ocean points to fit into a rectangle defined by: y2 y1 x1 x2 X x x1 x2 x1 Y y y1 y2 y1 indx pos 0 indy temporary pos 1 points located out of the atmospheric grid too much northward or southward bad where indy EQ 1 indy 0 indy IF max indx GT jpia 2 THEN stop checks IF max indy GT jpja 2 THEN stop checks x coordinates of the atm cell x1 alon indx x2 alon indx 1 new x coordinates of the ocean points in each cell divi temporary x2 x1 glamnew olon x1 temporary divi x1 1 free memory olon 1 free memory y coordinates of the atm cell y1 alat indy y2 alat indy 1 new y coordinates of the ocean points in each cell divi temporary y2 y1 zero where divi EQ 0 IF zero 0 NE 1 THEN divi zero 1 gphinew olat y1 temporary divi y1 1 free memory checks IF min glamnew LT 0 THEN stop IF max glamnew GT 1 THEN stop weight and address array used for bilinear interpolation xaddr lonarr 4 jpio jpjo xaddr 0 indx xaddr 1 indx 1L xaddr 2 indx 1L xaddr 3 indx yaddr lonarr 4 jpio jpjo yaddr 0 indy yaddr 1 indy yaddr 2 indy 1L yaddr 3 indy 1L compute the weight for the bilinear interpolation weig fltarr 4 jpio jpjo weig 0 1 glamnew 1 gphinew weig 1 glamnew 1 gphinew weig 2 glamnew gphinew weig 3 1 glamnew gphinew free memory gphinew 1 IF bad 0 EQ 1 THEN glamnew 1 ELSE glamnew temporary glamnew bad we work now on the bad points linear interpolation only along the longitudinal direction IF bad 0 NE 1 THEN BEGIN ybad olat bad the ocean points that are not located into an atm cell should be located northward of the northern boudary of the atm grid or southward of the southern boudary of the atm grid IF total ybad GE min alat AND ybad LE max alat GE 1 THEN stop weig 0 bad 1 glamnew weig 1 bad temporary glamnew weig 2 bad 0 weig 3 bad 0 south where ybad LT alat 0 IF south 0 NE 1 THEN yaddr bad temporary south 0L north where ybad GT alat jpja 1 IF north 0 NE 1 THEN yaddr bad temporary north 0L ybad 1 bad 1 free memory ENDIF check totalweight 1 totalweig abs 1 total weig 1 IF where temporary totalweig GE 1 e 5 0 NE 1 THEN stop come back to the original atm grid without longitudinal overlap jpia jpia 1L xaddr temporary xaddr MOD jpia take into account shiftx if needed IF shiftx NE 0 THEN xaddr temporary xaddr shiftx MOD jpia take into account nosouthernline and nonorthernline if keyword_set nosouthernline then BEGIN yaddr temporary yaddr 1L jpja jpja 1L ENDIF if keyword_set nonorthernline then jpja jpja 1L take into account revy if needed IF revy EQ 1 THEN yaddr jpja 1L temporary yaddr addr temporary yaddr jpia temporary xaddr return end "); 37 a[35] = new Array("./Interpolation/compute_fromreg_imoms3_weigaddr.html", "compute_fromreg_imoms3_weigaddr.pro", "", " file_comments compute the weight and address neede to interpolate data from a regular grid to any grid using the imoms3 method categories interpolation PRO compute_fromreg_imoms3_weigaddr alonin alatin olonin olat weig addrparam alonin in required longitude of the input data param alatin in required latitude of the input data param olonin in required longitude of the output data param olat in required latitude of the output data keyword NONORTHERNLINE and NOSOUTHERNLINE activate if you don t whant to take into account the northen southern line of the input data when perfoming the interpolation returns weig addr: 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpio jpjo over restrictions the input grid must be a regular rectangular grid defined as a grid for which each lontitudes lines have the same latitude and each latitudes columns have the same longitude We supposed the data are located on a sphere with a periodicity along the longitude points located between the first last 2 lines are interpolated using a imoms3 interpolation along the longitudinal direction and linear interpolation along the latitudinal direction points located out of the southern and northern boundaries are interpolated using a imoms3 interpolation only along the longitudinal direction history November 2005: Sebastien Masson smasson lodyc jussieu fr March 2006: works for rectangular grids PRO compute_fromreg_imoms3_weigaddr alonin alatin olonin olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt strictarr strictarrsubs alon alonin alat alatin olon olonin jpia n_elements alon jpja n_elements alat jpio size olon dimensions 0 jpjo size olon dimensions 1 alon minalon min alon max maxalon IF maxalon minalon GE 360 THEN stop alon must be monotonically increasing IF array_equal sort alon lindgen jpia NE 1 THEN BEGIN shiftx where alon EQ min alon 0 alon shift alon shiftx IF array_equal sort alon lindgen jpia NE 1 THEN stop ENDIF ELSE shiftx 0 alon is it regularly spaced step alon shift alon 1 step 0 step 0 360 IF total step step 0 GE 1 e 6 NE 0 THEN noregx 1 we extend the longitude range of alon easy interpolation even near minalon et maxalon toadd 10 jpia 360 1 alon alon jpia toadd:jpia 1 360 alon alon 0:toadd 1 360 jpia jpia 2 toadd alat revy alat 0 GT alat 1 IF revy THEN alat reverse alat alat must be monotonically increasing IF array_equal sort alat lindgen jpja NE 1 THEN stop alat is it regularly spaced step alat shift alat 1 step step 1:jpja 1L IF total step step 0 GE 1 e 6 NE 0 THEN noregy 1 if keyword_set nonorthernline then BEGIN jpja jpja 1L alat alat 0: jpja 1L ENDIF if keyword_set nosouthernline then BEGIN alat alat 1: jpja 1L jpja jpja 1L ENDIF olon between minalon et minalon 360 out where olon LT minalon WHILE out 0 NE 1 DO BEGIN olon out olon out 360 out where olon LT minalon ENDWHILE out where olon GE minalon 360 WHILE out 0 NE 1 DO BEGIN olon out olon out 360 out where olon GE minalon 360 ENDWHILE make sure that all values of olon are located within values of alon IF min olon max ma LT minalon THEN stop IF ma GE minalon 360 THEN stop xaddr lonarr 16 jpio jpjo yaddr lonarr 16 jpio jpjo weig fltarr 16 jpio jpjo indexlon value_locate alon olon IF total alon indexlon GT olon NE 0 THEN stop IF total alon indexlon 1L LE olon NE 0 THEN stop IF where indexlon LE 1L 0 NE 1 THEN stop IF where indexlon GE jpia 3L 0 NE 1 THEN stop indexlat value_locate alat olat for the ocean points located below the atm line jpja 2 and above the line 1 for those points we can always find 16 neighbors imoms interpolation along longitude and latitude short where indexlat LT jpja 2L AND indexlat GE 1L ilon indexlon short ilat indexlat short IF NOT keyword_set noregy THEN BEGIN delta alat ilat 1L alat ilat IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alat ilat 1L olat short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wy0 imoms3 temporary d0 d1 alat ilat olat short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wy1 imoms3 temporary d1 d2 alat ilat 1L olat short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wy2 imoms3 temporary d2 d3 alat ilat 2L olat short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wy3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wy0 fltarr nele wy1 fltarr nele wy2 fltarr nele wy3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlat spl_incr alat ilat i 1L:ilat i 2L 1 0 1 2 olat short i IF newlat LE 0 THEN stop IF newlat GT 1 THEN stop wy0 i imoms3 newlat 1 wy1 i imoms3 newlat wy2 i imoms3 1 newlat wy3 i imoms3 2 newlat ENDFOR ENDELSE mi min wy0 wy1 wy2 wy3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop IF NOT keyword_set noregx THEN BEGIN delta alon ilon alon ilon 1L IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alon ilon 1L olon short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wx0 imoms3 temporary d0 d1 alon ilon olon short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wx1 imoms3 temporary d1 d2 alon ilon 1L olon short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wx2 imoms3 temporary d2 d3 alon ilon 2L olon short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wx3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wx0 fltarr nele wx1 fltarr nele wx2 fltarr nele wx3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlon spl_incr alon ilon i 1L:ilon i 2L 1 0 1 2 olon short i IF newlon LE 0 THEN stop IF newlon GT 1 THEN stop wx0 i imoms3 newlon 1 wx1 i imoms3 newlon wx2 i imoms3 1 newlon wx3 i imoms3 2 newlon ENDFOR ENDELSE mi min wx0 wx1 wx2 wx3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop line 0 xaddr 0 short ilon 1L xaddr 1 short ilon xaddr 2 short ilon 1L xaddr 3 short ilon 2L yaddr 0 short ilat 1L yaddr 1 short yaddr 0 short yaddr 2 short yaddr 0 short yaddr 3 short yaddr 0 short weig 0 short wx0 wy0 weig 1 short wx1 wy0 weig 2 short wx2 wy0 weig 3 short wx3 wy0 line 1 xaddr 4 short ilon 1L xaddr 5 short ilon xaddr 6 short ilon 1L xaddr 7 short ilon 2L yaddr 4 short ilat yaddr 5 short ilat yaddr 6 short ilat yaddr 7 short ilat weig 4 short wx0 wy1 weig 5 short wx1 wy1 weig 6 short wx2 wy1 weig 7 short wx3 wy1 line 2 xaddr 8 short ilon 1L xaddr 9 short ilon xaddr 10 short ilon 1L xaddr 11 short ilon 2L yaddr 8 short ilat 1L yaddr 9 short yaddr 8 short yaddr 10 short yaddr 8 short yaddr 11 short yaddr 8 short weig 8 short wx0 wy2 weig 9 short wx1 wy2 weig 10 short wx2 wy2 weig 11 short wx3 wy2 line 3 xaddr 12 short ilon 1L xaddr 13 short ilon xaddr 14 short ilon 1L xaddr 15 short ilon 2L yaddr 12 short ilat 2L yaddr 13 short yaddr 12 short yaddr 14 short yaddr 12 short yaddr 15 short yaddr 12 short weig 12 short wx0 wy3 weig 13 short wx1 wy3 weig 14 short wx2 wy3 weig 15 short wx3 wy3 mi min total weig short 1 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop for the ocean points located between the atm lines jpja 2 and jpja 1 or between the atm lines 0 and 1 linear interpolation between line 1 and line 2 short where indexlat EQ jpja 2L OR indexlat EQ 0 IF short 0 NE 1 THEN BEGIN ilon indexlon short ilat indexlat short delta alat ilat 1L alat ilat IF NOT keyword_set noregy THEN BEGIN IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 ENDIF d1 alat ilat olat short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wy1 1 temporary d1 d2 alat ilat 1L olat short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wy2 1 temporary d2 mi min wy1 wy2 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop but imoms3 along the longitude IF NOT keyword_set noregx THEN BEGIN delta alon ilon alon ilon 1L IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alon ilon 1L olon short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wx0 imoms3 temporary d0 d1 alon ilon olon short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wx1 imoms3 temporary d1 d2 alon ilon 1L olon short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wx2 imoms3 temporary d2 d3 alon ilon 2L olon short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wx3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wx0 fltarr nele wx1 fltarr nele wx2 fltarr nele wx3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlon spl_incr alon ilon i 1L:ilon i 2L 1 0 1 2 olon short i IF newlon LE 0 THEN stop IF newlon GT 1 THEN stop wx0 i imoms3 newlon 1 wx1 i imoms3 newlon wx2 i imoms3 1 newlon wx3 i imoms3 2 newlon ENDFOR ENDELSE mi min wx0 wx1 wx2 wx3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop line 1 xaddr 0 short ilon 1L xaddr 1 short ilon xaddr 2 short ilon 1L xaddr 3 short ilon 2L yaddr 0 short ilat yaddr 1 short ilat yaddr 2 short ilat yaddr 3 short ilat weig 0 short wx0 wy1 weig 1 short wx1 wy1 weig 2 short wx2 wy1 weig 3 short wx3 wy1 line 2 xaddr 4 short ilon 1L xaddr 5 short ilon xaddr 6 short ilon 1L xaddr 7 short ilon 2L yaddr 4 short ilat 1L yaddr 5 short yaddr 4 short yaddr 6 short yaddr 4 short yaddr 7 short yaddr 4 short weig 4 short wx0 wy2 weig 5 short wx1 wy2 weig 6 short wx2 wy2 weig 7 short wx3 wy2 mi min total weig short 1 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop ENDIF for the ocean points located below the line 0 Interpolation only along the longitude short where indexlat EQ 1 IF short 0 NE 1 THEN BEGIN ilon indexlon short IF NOT keyword_set noregx THEN BEGIN delta alon ilon alon ilon 1L IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alon ilon 1L olon short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wx0 imoms3 temporary d0 d1 alon ilon olon short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wx1 imoms3 temporary d1 d2 alon ilon 1L olon short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wx2 imoms3 temporary d2 d3 alon ilon 2L olon short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wx3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wx0 fltarr nele wx1 fltarr nele wx2 fltarr nele wx3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlon spl_incr alon ilon i 1L:ilon i 2L 1 0 1 2 olon short i IF newlon LE 0 THEN stop IF newlon GT 1 THEN stop wx0 i imoms3 newlon 1 wx1 i imoms3 newlon wx2 i imoms3 1 newlon wx3 i imoms3 2 newlon ENDFOR ENDELSE mi min wx0 wx1 wx2 wx3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop line 1 xaddr 0 short ilon 1L xaddr 1 short ilon xaddr 2 short ilon 1L xaddr 3 short ilon 2L yaddr 0:3 short 0 weig 0 short wx0 weig 1 short wx1 weig 2 short wx2 weig 3 short wx3 mi min total weig short 1 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop ENDIF for the ocean points located above jpia 1 Interpolation only along the longitude short where indexlat EQ jpja 1L IF short 0 NE 1 THEN BEGIN ilon indexlon short IF NOT keyword_set noregx THEN BEGIN delta alon ilon alon ilon 1L IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alon ilon 1L olon short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wx0 imoms3 temporary d0 d1 alon ilon olon short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wx1 imoms3 temporary d1 d2 alon ilon 1L olon short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wx2 imoms3 temporary d2 d3 alon ilon 2L olon short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wx3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wx0 fltarr nele wx1 fltarr nele wx2 fltarr nele wx3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlon spl_incr alon ilon i 1L:ilon i 2L 1 0 1 2 olon short i IF newlon LE 0 THEN stop IF newlon GT 1 THEN stop wx0 i imoms3 newlon 1 wx1 i imoms3 newlon wx2 i imoms3 1 newlon wx3 i imoms3 2 newlon ENDFOR ENDELSE mi min wx0 wx1 wx2 wx3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop line 1 xaddr 0 short ilon 1L xaddr 1 short ilon xaddr 2 short ilon 1L xaddr 3 short ilon 2L yaddr 0:3 short jpja 1L weig 0 short wx0 weig 1 short wx1 weig 2 short wx2 weig 3 short wx3 mi min total weig short 1 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop ENDIF Come back to the original index of atm grid without longitudinal overlap xaddr temporary xaddr toadd jpia jpia 2 toadd make sure all values are ge 0 xaddr temporary xaddr jpia range the values between 0 and jpia 1 xaddr temporary xaddr mod jpia take into account shiftx if needed IF shiftx NE 0 THEN xaddr temporary xaddr shiftx MOD jpia take into account nosouthernline and nonorthernline if keyword_set nosouthernline then BEGIN yaddr temporary yaddr 1L jpja jpja 1L ENDIF if keyword_set nonorthernline then jpja jpja 1L take into account revy if needed IF revy EQ 1 THEN yaddr jpja 1L temporary yaddr addr temporary yaddr jpia temporary xaddr RETURN END");37 a[35] = new Array("./Interpolation/compute_fromreg_imoms3_weigaddr.html", "compute_fromreg_imoms3_weigaddr.pro", "", " file_comments compute the weight and address neede to interpolate data from a regular grid to any grid using the imoms3 method categories interpolation param alonin in required longitude of the input data param alatin in required latitude of the input data param olonin in required longitude of the output data param olat in required latitude of the output data keyword NONORTHERNLINE and NOSOUTHERNLINE activate if you don t whant to take into account the northen southern line of the input data when perfoming the interpolation returns weig addr: 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpio jpjo over restrictions the input grid must be a regular rectangular grid defined as a grid for which each lontitudes lines have the same latitude and each latitudes columns have the same longitude We supposed the data are located on a sphere with a periodicity along the longitude points located between the first last 2 lines are interpolated using a imoms3 interpolation along the longitudinal direction and linear interpolation along the latitudinal direction points located out of the southern and northern boundaries are interpolated using a imoms3 interpolation only along the longitudinal direction history November 2005: Sebastien Masson smasson lodyc jussieu fr March 2006: works for rectangular grids PRO compute_fromreg_imoms3_weigaddr alonin alatin olonin olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt strictarr strictarrsubs alon alonin alat alatin olon olonin jpia n_elements alon jpja n_elements alat jpio size olon dimensions 0 jpjo size olon dimensions 1 alon minalon min alon max maxalon IF maxalon minalon GE 360 THEN stop alon must be monotonically increasing IF array_equal sort alon lindgen jpia NE 1 THEN BEGIN shiftx where alon EQ min alon 0 alon shift alon shiftx IF array_equal sort alon lindgen jpia NE 1 THEN stop ENDIF ELSE shiftx 0 alon is it regularly spaced step alon shift alon 1 step 0 step 0 360 IF total step step 0 GE 1 e 6 NE 0 THEN noregx 1 we extend the longitude range of alon easy interpolation even near minalon et maxalon toadd 10 jpia 360 1 alon alon jpia toadd:jpia 1 360 alon alon 0:toadd 1 360 jpia jpia 2 toadd alat revy alat 0 GT alat 1 IF revy THEN alat reverse alat alat must be monotonically increasing IF array_equal sort alat lindgen jpja NE 1 THEN stop alat is it regularly spaced step alat shift alat 1 step step 1:jpja 1L IF total step step 0 GE 1 e 6 NE 0 THEN noregy 1 if keyword_set nonorthernline then BEGIN jpja jpja 1L alat alat 0: jpja 1L ENDIF if keyword_set nosouthernline then BEGIN alat alat 1: jpja 1L jpja jpja 1L ENDIF olon between minalon et minalon 360 out where olon LT minalon WHILE out 0 NE 1 DO BEGIN olon out olon out 360 out where olon LT minalon ENDWHILE out where olon GE minalon 360 WHILE out 0 NE 1 DO BEGIN olon out olon out 360 out where olon GE minalon 360 ENDWHILE make sure that all values of olon are located within values of alon IF min olon max ma LT minalon THEN stop IF ma GE minalon 360 THEN stop xaddr lonarr 16 jpio jpjo yaddr lonarr 16 jpio jpjo weig fltarr 16 jpio jpjo indexlon value_locate alon olon IF total alon indexlon GT olon NE 0 THEN stop IF total alon indexlon 1L LE olon NE 0 THEN stop IF where indexlon LE 1L 0 NE 1 THEN stop IF where indexlon GE jpia 3L 0 NE 1 THEN stop indexlat value_locate alat olat for the ocean points located below the atm line jpja 2 and above the line 1 for those points we can always find 16 neighbors imoms interpolation along longitude and latitude short where indexlat LT jpja 2L AND indexlat GE 1L ilon indexlon short ilat indexlat short IF NOT keyword_set noregy THEN BEGIN delta alat ilat 1L alat ilat IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alat ilat 1L olat short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wy0 imoms3 temporary d0 d1 alat ilat olat short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wy1 imoms3 temporary d1 d2 alat ilat 1L olat short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wy2 imoms3 temporary d2 d3 alat ilat 2L olat short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wy3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wy0 fltarr nele wy1 fltarr nele wy2 fltarr nele wy3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlat spl_incr alat ilat i 1L:ilat i 2L 1 0 1 2 olat short i IF newlat LE 0 THEN stop IF newlat GT 1 THEN stop wy0 i imoms3 newlat 1 wy1 i imoms3 newlat wy2 i imoms3 1 newlat wy3 i imoms3 2 newlat ENDFOR ENDELSE mi min wy0 wy1 wy2 wy3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop IF NOT keyword_set noregx THEN BEGIN delta alon ilon alon ilon 1L IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alon ilon 1L olon short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wx0 imoms3 temporary d0 d1 alon ilon olon short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wx1 imoms3 temporary d1 d2 alon ilon 1L olon short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wx2 imoms3 temporary d2 d3 alon ilon 2L olon short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wx3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wx0 fltarr nele wx1 fltarr nele wx2 fltarr nele wx3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlon spl_incr alon ilon i 1L:ilon i 2L 1 0 1 2 olon short i IF newlon LE 0 THEN stop IF newlon GT 1 THEN stop wx0 i imoms3 newlon 1 wx1 i imoms3 newlon wx2 i imoms3 1 newlon wx3 i imoms3 2 newlon ENDFOR ENDELSE mi min wx0 wx1 wx2 wx3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop line 0 xaddr 0 short ilon 1L xaddr 1 short ilon xaddr 2 short ilon 1L xaddr 3 short ilon 2L yaddr 0 short ilat 1L yaddr 1 short yaddr 0 short yaddr 2 short yaddr 0 short yaddr 3 short yaddr 0 short weig 0 short wx0 wy0 weig 1 short wx1 wy0 weig 2 short wx2 wy0 weig 3 short wx3 wy0 line 1 xaddr 4 short ilon 1L xaddr 5 short ilon xaddr 6 short ilon 1L xaddr 7 short ilon 2L yaddr 4 short ilat yaddr 5 short ilat yaddr 6 short ilat yaddr 7 short ilat weig 4 short wx0 wy1 weig 5 short wx1 wy1 weig 6 short wx2 wy1 weig 7 short wx3 wy1 line 2 xaddr 8 short ilon 1L xaddr 9 short ilon xaddr 10 short ilon 1L xaddr 11 short ilon 2L yaddr 8 short ilat 1L yaddr 9 short yaddr 8 short yaddr 10 short yaddr 8 short yaddr 11 short yaddr 8 short weig 8 short wx0 wy2 weig 9 short wx1 wy2 weig 10 short wx2 wy2 weig 11 short wx3 wy2 line 3 xaddr 12 short ilon 1L xaddr 13 short ilon xaddr 14 short ilon 1L xaddr 15 short ilon 2L yaddr 12 short ilat 2L yaddr 13 short yaddr 12 short yaddr 14 short yaddr 12 short yaddr 15 short yaddr 12 short weig 12 short wx0 wy3 weig 13 short wx1 wy3 weig 14 short wx2 wy3 weig 15 short wx3 wy3 mi min total weig short 1 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop for the ocean points located between the atm lines jpja 2 and jpja 1 or between the atm lines 0 and 1 linear interpolation between line 1 and line 2 short where indexlat EQ jpja 2L OR indexlat EQ 0 IF short 0 NE 1 THEN BEGIN ilon indexlon short ilat indexlat short delta alat ilat 1L alat ilat IF NOT keyword_set noregy THEN BEGIN IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 ENDIF d1 alat ilat olat short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wy1 1 temporary d1 d2 alat ilat 1L olat short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wy2 1 temporary d2 mi min wy1 wy2 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop but imoms3 along the longitude IF NOT keyword_set noregx THEN BEGIN delta alon ilon alon ilon 1L IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alon ilon 1L olon short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wx0 imoms3 temporary d0 d1 alon ilon olon short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wx1 imoms3 temporary d1 d2 alon ilon 1L olon short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wx2 imoms3 temporary d2 d3 alon ilon 2L olon short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wx3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wx0 fltarr nele wx1 fltarr nele wx2 fltarr nele wx3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlon spl_incr alon ilon i 1L:ilon i 2L 1 0 1 2 olon short i IF newlon LE 0 THEN stop IF newlon GT 1 THEN stop wx0 i imoms3 newlon 1 wx1 i imoms3 newlon wx2 i imoms3 1 newlon wx3 i imoms3 2 newlon ENDFOR ENDELSE mi min wx0 wx1 wx2 wx3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop line 1 xaddr 0 short ilon 1L xaddr 1 short ilon xaddr 2 short ilon 1L xaddr 3 short ilon 2L yaddr 0 short ilat yaddr 1 short ilat yaddr 2 short ilat yaddr 3 short ilat weig 0 short wx0 wy1 weig 1 short wx1 wy1 weig 2 short wx2 wy1 weig 3 short wx3 wy1 line 2 xaddr 4 short ilon 1L xaddr 5 short ilon xaddr 6 short ilon 1L xaddr 7 short ilon 2L yaddr 4 short ilat 1L yaddr 5 short yaddr 4 short yaddr 6 short yaddr 4 short yaddr 7 short yaddr 4 short weig 4 short wx0 wy2 weig 5 short wx1 wy2 weig 6 short wx2 wy2 weig 7 short wx3 wy2 mi min total weig short 1 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop ENDIF for the ocean points located below the line 0 Interpolation only along the longitude short where indexlat EQ 1 IF short 0 NE 1 THEN BEGIN ilon indexlon short IF NOT keyword_set noregx THEN BEGIN delta alon ilon alon ilon 1L IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alon ilon 1L olon short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wx0 imoms3 temporary d0 d1 alon ilon olon short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wx1 imoms3 temporary d1 d2 alon ilon 1L olon short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wx2 imoms3 temporary d2 d3 alon ilon 2L olon short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wx3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wx0 fltarr nele wx1 fltarr nele wx2 fltarr nele wx3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlon spl_incr alon ilon i 1L:ilon i 2L 1 0 1 2 olon short i IF newlon LE 0 THEN stop IF newlon GT 1 THEN stop wx0 i imoms3 newlon 1 wx1 i imoms3 newlon wx2 i imoms3 1 newlon wx3 i imoms3 2 newlon ENDFOR ENDELSE mi min wx0 wx1 wx2 wx3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop line 1 xaddr 0 short ilon 1L xaddr 1 short ilon xaddr 2 short ilon 1L xaddr 3 short ilon 2L yaddr 0:3 short 0 weig 0 short wx0 weig 1 short wx1 weig 2 short wx2 weig 3 short wx3 mi min total weig short 1 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop ENDIF for the ocean points located above jpia 1 Interpolation only along the longitude short where indexlat EQ jpja 1L IF short 0 NE 1 THEN BEGIN ilon indexlon short IF NOT keyword_set noregx THEN BEGIN delta alon ilon alon ilon 1L IF max abs delta delta 0 GE 1 e 6 THEN stop delta delta 0 d0 alon ilon 1L olon short delta IF min d0 max ma LE 2 THEN stop IF ma GT 1 THEN stop wx0 imoms3 temporary d0 d1 alon ilon olon short delta IF min d1 max ma LE 1 THEN stop IF ma GT 0 THEN stop wx1 imoms3 temporary d1 d2 alon ilon 1L olon short delta IF min d2 max ma LE 0 THEN stop IF ma GT 1 THEN stop wx2 imoms3 temporary d2 d3 alon ilon 2L olon short delta IF min d3 max ma LE 1 THEN stop IF ma GT 2 THEN stop wx3 imoms3 temporary d3 ENDIF ELSE BEGIN nele n_elements short wx0 fltarr nele wx1 fltarr nele wx2 fltarr nele wx3 fltarr nele FOR i 0L nele 1 DO BEGIN IF i MOD 10000 EQ 0 THEN print i newlon spl_incr alon ilon i 1L:ilon i 2L 1 0 1 2 olon short i IF newlon LE 0 THEN stop IF newlon GT 1 THEN stop wx0 i imoms3 newlon 1 wx1 i imoms3 newlon wx2 i imoms3 1 newlon wx3 i imoms3 2 newlon ENDFOR ENDELSE mi min wx0 wx1 wx2 wx3 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop line 1 xaddr 0 short ilon 1L xaddr 1 short ilon xaddr 2 short ilon 1L xaddr 3 short ilon 2L yaddr 0:3 short jpja 1L weig 0 short wx0 weig 1 short wx1 weig 2 short wx2 weig 3 short wx3 mi min total weig short 1 max ma IF abs mi 1 GE 1 e 6 THEN stop IF abs ma 1 GE 1 e 6 THEN stop ENDIF Come back to the original index of atm grid without longitudinal overlap xaddr temporary xaddr toadd jpia jpia 2 toadd make sure all values are ge 0 xaddr temporary xaddr jpia range the values between 0 and jpia 1 xaddr temporary xaddr mod jpia take into account shiftx if needed IF shiftx NE 0 THEN xaddr temporary xaddr shiftx MOD jpia take into account nosouthernline and nonorthernline if keyword_set nosouthernline then BEGIN yaddr temporary yaddr 1L jpja jpja 1L ENDIF if keyword_set nonorthernline then jpja jpja 1L take into account revy if needed IF revy EQ 1 THEN yaddr jpja 1L temporary yaddr addr temporary yaddr jpia temporary xaddr RETURN END"); 38 38 a[36] = new Array("./Interpolation/cutpar.html", "cutpar.pro", "", " file_comments cut p parallelogram s into p n 2 parallelograms categories basic work examples res cutpar x0 y0 x1 y1 x2 y2 x3 y3 n param x0 y0 in required 1d arrays of p elements giving the edge positions The edges must be given as in plot to traw the parallelogram see example param n in required each parallelogram will be cutted in n 2 pieces keyword endpoints see outputs keyword onsphere to specify that the points are located on a sphere In this case x and y corresponds to longitude and latitude in degrees returns defaut: 3d array 2 n 2 p giving the center position of each piece of the parallelograms endpoints: 3d array 2 n 1 2 p giving the edge positions of each piece of the parallelograms uses cutsegment pro examples x0 2 6 2 y0 0 2 6 x1 3 8 4 y1 4 4 6 x2 1 6 4 y2 5 6 8 x3 0 4 2 y3 1 4 8 n 4 splot 0 10 0 10 xstyle 1 ystyle 1 nodata for i 0 2 do oplot x0 i x1 i x2 i x3 i x0 i y0 i y1 i y2 i y3 i y0 i res cutpar x0 y0 x1 y1 x2 y2 x3 y3 n for i 0 2 do oplot res 0 i res 1 i color 20 10 i psym 1 thick 3 history S Masson smasson lodyc jussieu fr July 5th 2002 FUNCTION cutpar x0 y0 x1 y1 x2 y2 x3 y3 n endpoints endpoints onsphere onsphere is it a parallelogram eps 1e 4 IF total abs x0 x2 2 x1 x3 2 GE eps GT 0 OR total abs y0 y2 2 y1 y3 2 GE eps GT 0 THEN stop print NOT a parallelogram x0 npar npar n_elements x0 firstborder 2 n keyword_set endpoints npar firstborder cutsegment x0 y0 x1 y1 n endpoints endpoints onsphere onsphere thirdborder cutsegment x3 y3 x2 y2 n endpoints endpoints onsphere onsphere res 2 n keyword_set endpoints n keyword_set endpoints npar res cutsegment firstborder 0 firstborder 1 thirdborder 0 thirdborder 1 n endpoints endpoints onsphere onsphere free memory firstborder 1 thirdborder 1 reform the result res reform res 2 n keyword_set endpoints 2 npar overwrite RETURN res END"); 39 39 a[37] = new Array("./Interpolation/cutsegment.html", "cutsegment.pro", "", " file_comments cut p segments into p n equal parts categories basic work examples res cutsegment x0 y0 x1 y1 n param x0 y0 and x1 y1 in required 1d arrays of p elements the coordinates of the endpoints of the p segmements param n in required the number of pieces we want to cut each segment keyword endpoints see ouputs keyword onsphere to specify that the points are located on a sphere In this case x and y corresponds to longitude and latitude in degrees returns defaut: a 3d array 2 n p that gives the coordinates of the middle of the cutted segments if endpoints a 3d array 2 n 1 p that gives the coordinates of the endpoints of the cutted segments examples IDL x0 2 5 IDL y0 5 1 IDL x1 9 3 IDL y1 1 8 IDL res cutsegment x0 y0 x1 y1 10 IDL splot 0 10 0 10 xstyle 1 ystyle 1 nodata IDL oplot x0 0 x1 0 y0 0 y1 0 IDL oplot res 0 0 res 1 0 color 20 psym 1 thick 3 IDL oplot x0 1 x1 1 y0 1 y1 1 IDL oplot res 0 1 res 1 1 color 40 psym 1 thick 3 history S Masson smasson lodyc jussieu fr July 5th 2002 FUNCTION cutsegment x0 y0 x1 y1 n endpoints endpoints onsphere onsphere number of segment nseg n_elements x0 number of point to find on each segment n2find n keyword_set endpoints IF keyword_set onsphere THEN BEGIN save the inputs arrays x0in temporary x0 y0in temporary y0 x1in temporary x1 y1in temporary y1 sp_cood transpose x0in transpose y0in replicate 1 1 nseg rect_coord CV_COORD FROM_SPHERE temporary sp_cood TO_RECT DEGREES x0 rect_coord 0 y0 rect_coord 1 z0 rect_coord 2 rect_coord 1 free memory sp_cood transpose x1in transpose y1in replicate 1 1 nseg rect_coord CV_COORD FROM_SPHERE temporary sp_cood TO_RECT DEGREES x1 rect_coord 0 y1 rect_coord 1 z1 rect_coord 2 rect_coord 1 free memory ENDIF resx replicate 1 n2find x0 resx temporary resx 1 n findgen n2find 5 1 keyword_set endpoints x1 x0 resx temporary resx resy replicate 1 n2find y0 resy temporary resy 1 n findgen n2find 5 1 keyword_set endpoints y1 y0 resy temporary resy IF keyword_set onsphere THEN BEGIN resz replicate 1 n2find z0 resz temporary resz 1 n findgen n2find 5 1 keyword_set endpoints z1 z0 resz temporary resz rec_cood transpose temporary resx transpose temporary resy transpose temporary resz res CV_COORD FROM_RECT temporary rec_cood TO_SPHERE DEGREES restore the input arrays x0 temporary x0in y0 temporary y0in x1 temporary x1in y1 temporary y1in ENDIF ELSE res transpose temporary resx transpose temporary resy res reform res 0:1 2 n2find nseg overwrite RETURN res END"); … … 51 51 a[49] = new Array("./Interpolation/spl_incr.html", "spl_incr.pro", "", " file_comments Given the arrays X and Y which tabulate a function with the X i AND Y i in ascending order and given an input value X2 the SPL_INCR function returns an interpolated value for the given values of X2 The interpolation method is based on cubic spline corrected in a way that interpolated values are also monotonically increasing examples y2 spl_incr x y x2 param x1 in required An n element at least 2 input vector that specifies the tabulate points in a strict ascending order param y1 in required f x y An n element input vector that specifies the values of the tabulated function F Xi corresponding to Xi As f is supposed to be monotonically increasing y values must be monotonically increasing y can have equal consecutive values param x2 in required The input values for which the interpolated values are desired Its values must be strictly monotonically increasing returns y2: f x2 y2 Double precision array restrictions It might be possible that y2 i 1 y2 i has very small negative values amplitude smaller than 1 e 6 examples n 100L x dindgen n 2 y abs randomn 0 n y n 2:n 2 1 0 y n n 3 0 y n n 6:n n 6 5 0 y total y cumulative double x2 dindgen n 1 2 n2 n_elements x2 print min y 1:n 1 y 0:n 2 LT 0 y2 spl_incr x y x2 splot x y xstyle 1 ystyle 1 ysurx 25 petit 1 2 1 land oplot x2 y2 color 100 c y2 1:n2 1 y2 0:n2 2 print min c LT 0 print min c max ma ma splot c xstyle 1 ystyle 1 yrange 01 05 ysurx 25 petit 1 2 2 noerase oplot 0 n_elements c 0 0 linestyle 1 history Sebastien Masson smasson lodyc jussieu fr : May Dec 2005 FUNCTION pure_concave x1 x2 y1 y2 der2 x X n type xx double x double x1 double x2 double x1 f double x2 double x1 double y2 double y1 n der2 temporary f res xx n IF check_math GT 0 THEN BEGIN zero where abs res LT 1 e 10 IF zero 0 NE 1 THEN res zero 0 0d END res temporary res double y2 double y1 y1 IF array_equal sort res lindgen n_elements res NE 1 THEN stop RETURN res END FUNCTION pure_convex x1 x2 y1 y2 der2 x 1 1 X n type xx 1 0d double x double x1 double x2 double x1 f double x2 double x1 double y2 double y1 n der2 temporary f res xx n IF check_math GT 0 THEN BEGIN zero where abs res LT 1 e 10 IF zero 0 NE 1 THEN res zero 0 0d END res 1 0d temporary res res temporary res y2 y1 y1 IF array_equal sort res lindgen n_elements res NE 1 THEN stop RETURN res END keyword YP0 The first derivative of the interpolating function at the point X0 If YP0 is omitted the second derivative at the boundary is set to zero resulting in a natural spline keyword YPN_1 The first derivative of the interpolating function at the point Xn 1 If YPN_1 is omitted the second derivative at the boundary is set to zero resulting in a natural spline FUNCTION spl_incr x y x2 YP0 yp0 YPN_1 ypn_1 check and initialisation nx n_elements x ny n_elements y nx2 n_elements x2 x must have at least 2 elements IF nx LT 2 THEN stop y must have the same number of elements than x IF nx NE ny THEN stop x be monotonically increasing IF min x 1:nx 1 x 0:nx 2 LE 0 THEN stop x2 be monotonically increasing IF N_ELEMENTS X2 GE 2 THEN IF min x2 1:nx2 1 x2 0:nx2 2 LE 0 THEN stop y be monotonically increasing IF min y 1:ny 1 y 0:ny 2 LT 0 THEN stop first check: check if two consecutive values are equal bad where y 1:ny 1 y 0:ny 2 EQ 0 cntbad IF cntbad NE 0 THEN BEGIN define the results: y2 y2 dblarr nx2 define xinx2: see help of value_locate if xinx2 i eq 1 : x bad i x2 nx2 1 else : x2 xinx2 i x2 nx2 1 else : x2 xinx2 i we have middle pieces for which we force yp0 0 0d and ypn_1 0 0d IF cntbad GT 1 THEN BEGIN we take care of the piece located wetween bad ib 1 and bad ib FOR ib 1 cntbad 1 DO BEGIN if there is x2 values smaller that x bad ib then the x2 values located between bad ib 1 and bad ib are xinx2 ib 1 1:xinx2 ib IF xinx2 ib NE 1 THEN begin y2 xinx2 ib 1 1 0 y i 1 y i 2 y reach its minimum value between x i and x i 1 0 y i 1 0 y i we do a first selection by looking for those points loc lindgen nx 1 maybebad where yscd loc LE 0 0d AND yscd loc 1 GE 0 0d cntbad IF cntbad NE 0 THEN BEGIN mbbloc loc maybebad aaa yscd mbbloc 1 yscd mbbloc 6 0d x mbbloc 1 x mbbloc bbb 0 5d yscd mbbloc ccc yifrst mbbloc ddd y mbbloc definitive selection: y can become negative if and only if 2b 2 4 3a c 0 y can become negative if and only if b 2 3a c 0 delta bbb bbb 3 0d aaa ccc bad where delta GT 0 cntbad IF cntbad NE 0 THEN BEGIN delta delta bad aaa aaa bad bbb bbb bad ccc ccc bad ddd ddd bad bad maybebad bad define xinx2_1: see help of value_locate if xinx2_1 i eq 1 : x bad i x2 nx2 1 else : x2 xinx2_1 i x2 nx2 1 else : x2 xinx2_2 i y bad ib 1 then we cannot applay the method we want to apply we use then convex concave case by changing by hand the value of yinfl and xinfl IF yzero GT y bad ib 1 THEN BEGIN yinfl 0 5d y bad ib 1 y bad ib xinfl 0 5d x bad ib 1 x bad ib GOTO convexconcave ENDIF define xinx2_3: see help of value_locate if xinx2_3 ib eq 1 : x bad ib xzero x2 nx2 1 else : x2 xinx2_3 we use then convex concave case by changing by hand the value of yinfl and xinfl IF yzero lt y bad ib THEN BEGIN yinfl 0 5d y bad ib 1 y bad ib xinfl 0 5d x bad ib 1 x bad ib GOTO convexconcave ENDIF define xinx2_3: see help of value_locate if xinx2_3 ib eq 1 : x bad ib xzero x2 nx2 1 else : x2 xinx2_3 x2 nx2 1 else : x2 xinx2_3 x bad ib xzero x2 xinx3_2 1 xinx2_3 value_locate x2 x bad ib xinfl IF xinx2_3 ge xinx2_1 ib 1 THEN BEGIN y2 xinx2_1 ib 1:xinx2_3 pure_convex x bad ib x bad ib xinfl y bad ib yinfl yifrst bad ib x2 xinx2_1 ib 1:xinx2_3 ENDIF IF xinx2_2 ib GE xinx2_3 1 THEN BEGIN y2 xinx2_3 1:xinx2_2 ib pure_concave x bad ib xinfl x bad ib 1 yinfl y bad ib 1 yifrst bad ib 1 x2 xinx2_3 1:xinx2_2 ib ENDIF END ENDCASE END ENDCASE ENDIF ENDFOR ENDIF ENDIF RETURN y2 END"); 52 52 a[50] = new Array("./Interpolation/spl_keep_mean.html", "spl_keep_mean.pro", "", " file_comments Given the arrays X and Y which tabulate a function with the X i AND Y i in ascending order and given an input value X2 the SPL_INCR function returns an interpolated value for the given values of X2 The interpolation method is based on cubic spline corrected in a way that integral of the interpolated values is the same as the integral of the input values for exemple to build daily data from monthly mean and keep the monthly mean of the computed daily data equa to the original values examples y2 spl_keep_mean x y x2 param x in required An n element at least 2 input vector that specifies the tabulate points in a strict ascending order param yin in required an array with one element less than x y i represents the mean value between x i and x i 1 if GE0 is activated y must have positive values param x2 in required The input values for which the interpolated values are desired Its values must be strictly monotonically increasing keyword GE0 to force that y2 is always GE than 0 In that case y must also be GE than 0 keyword YP0 The first derivative of the interpolating function at the point X0 If YP0 is omitted the second derivative at the boundary is set to zero resulting in a natural spline keyword YPN_1 The first derivative of the interpolating function at the point Xn 1 If YPN_1 is omitted the second derivative at the boundary is set to zero resulting in a natural spline returns y2: the meean value between two consecutive values of x2 This array has one element less than y2 y2 has double precision restrictions It might be possible that y2 has very small negative values amplitude smaller than 1 e 6 examples 12 monthly values of precipitations into daily values: yr1 1990 yr2 1992 nyr yr2 yr1 1 n1 12 nyr 1 x julday 1 findgen n1 replicate 1 n1 replicate yr1 n1 fltarr n1 n2 365 nyr total leapyr yr1 indgen nyr 1 x2 julday replicate 1 n2 1 findgen n2 replicate yr1 n2 fltarr n2 y abs randomn 0 n1 1 y2 spl_keep_mean x y x2 ge0 print min x max ma ma print min x2 max ma ma print vairdate min x max ma ma print total y x 1:n1 1 x 0:n1 2 print total y2 x2 1:n2 1 x2 0:n2 2 history Sebastien Masson smasson lodyc jussieu fr : May 2005 FUNCTION spl_keep_mean x yin x2 YP0 yp0 YPN_1 ypn_1 GE0 ge0 check and initialisation nx n_elements x ny n_elements yin nx2 n_elements x2 x must have at least 2 elements IF nx LT 2 THEN stop x2 must have at least 2 elements IF nx2 LT 2 THEN stop x be monotonically increasing IF min x 1:nx 1 x 0:nx 2 LE 0 THEN stop x2 be monotonically increasing IF min x2 1:nx2 1 x2 0:nx2 2 LE 0 THEN stop compute the integral of y if spl_keep_mean is called by the user and not by itself we must compute the integral of y yin must have one element less than x IF nx NE ny 1 THEN stop y double yin double x 1:nx 1 x 0:nx 2 y 0 0d temporary y y total temporary y cumulative double compute the spline interpolation IF keyword_set ge0 THEN BEGIN if the want that the interpolated values are always 0 we must have yin 0 0d IF min yin LT 0 THEN stop call spl_incr y2 spl_incr x temporary y x2 yp0 yp0 ypn_1 ypn_1 ENDIF ELSE BEGIN yscd spl_init x y yp0 yp0 ypn_1 ypn_1 double y2 spl_interp x y temporary yscd x2 double ENDELSE Compute the derivative of y yfrst y2 1:nx2 1 y2 0:nx2 2 x2 1:nx2 1 x2 0:nx2 2 it can happen that we have very small negative values 1 e 6 for ex yfrst 0 0d temporary yfrst RETURN yfrst END"); 53 a[51] = new Array("./Interpolation/square2quadrilateral.html", "square2quadrilateral.pro", "", " file_comments warm or map a unit square onto an arbitrary quadrilateral according to the 4 point correspondences: 0 0 x0 y0 1 0 x1 y1 1 1 x2 y2 0 1 x3 y3 The mapping is done using perspective transformation which preserve lines in all orientations and permit quadrilateral to quadrilateral mappings see ref bellow categories image grid manipulation examples res square2quadrilateral x0 y0 x1 y1 x2 y2 x3 y3 xin yin FUNCTION square2quadrilateral x0in y0in x1in y1in x2in y2in x3in y3in xxin yyinparam x0in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param y0in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param x1in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param y1in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param x2in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param y2in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param x3in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param y3in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param xxin in required the coordinates of the point s for which we want to do the mapping Can be scalar or array param yyin in required the coordinates of the point s for which we want to do the mapping Can be scalar or array returns 2 n array: the new coodinates xout yout of the xin yin point s after mapping If xin is a scalar then n is equal to the number of elements of x0 If xin is an array then n is equal to the number of elements of xin If xin and yin are omited square2quadrilateral returns the matrix A which is used for the inverse transformation restrictions I think degenerated quadrilateral e g flat of twisted is not work This has to be tested examples IDL splot 0 5 0 3 nodata xstyle 1 ystyle 1 IDL tracegrille findgen 11 1 findgen 11 1 color indgen 12 20 IDL xin findgen 11 1 replicate 1 11 IDL yin replicate 1 11 findgen 11 1 IDL out square2quadrilateral 2 1 3 0 5 1 2 3 xin yin IDL tracegrille reform out 0 11 11 reform out 1 11 11 color indgen 12 20 history Sebastien Masson smasson lodyc jussieu fr August 2003 Based on Digital Image Warping by G Wolberg IEEE Computer Society Press Los Alamitos California Chapter 3 see p 52 56 FUNCTION square2quadrilateral x0in y0in x1in y1in x2in y2in x3in y3in xxin yyin Warning wrong definition of x2 y2 and x3 y3 at the bottom of page 54 of Wolberg s book see figure 3 7 page 56 for the good definition IF keyword_set double THEN BEGIN x0 double x0in x1 double x1in x2 double x2in x3 double x3in y0 double y0in y1 double y1in y2 double y2in y3 double y3in IF arg_present xxin THEN BEGIN xin double xxin yin double yyin ENDIF ENDIF ELSE BEGIN x0 float x0in x1 float x1in x2 float x2in x3 float x3in y0 float y0in y1 float y1in y2 float y2in y3 float y3in IF arg_present xxin THEN BEGIN xin float xxin yin float yyin ENDIF ENDELSE IF keyword_set double THEN a dlbarr 8 n_elements x0 ELSE a fltarr 8 n_elements x0 delx3 x0 x1 x2 x3 dely3 y0 y1 y2 y3 affinemap where delx3 EQ 0 AND dely3 EQ 0 IF affinemap 0 NE 1 THEN BEGIN xx0 x0 affinemap xx1 x1 affinemap xx2 x2 affinemap yy0 y0 affinemap yy1 y1 affinemap yy2 y2 affinemap a 0 affinemap xx1 xx0 a 1 affinemap xx2 xx1 a 2 affinemap xx0 a 3 affinemap yy1 yy0 a 4 affinemap yy2 yy1 a 5 affinemap yy0 a 6 affinemap 0 a 7 affinemap 0 ENDIF projectivemap where delx3 NE 0 OR dely3 NE 0 IF projectivemap 0 NE 1 THEN BEGIN xx0 x0 projectivemap xx1 x1 projectivemap xx2 x2 projectivemap xx3 x3 projectivemap yy0 y0 projectivemap yy1 y1 projectivemap yy2 y2 projectivemap yy3 y3 projectivemap delx1 xx1 xx2 dely1 yy1 yy2 delx2 xx3 xx2 dely2 yy3 yy2 delx3 delx3 projectivemap dely3 dely3 projectivemap div delx1 dely2 dely1 delx2 zero where div EQ 0 IF zero 0 NE 1 THEN BEGIN stop ENDIF a13 delx3 dely2 dely3 delx2 div a23 delx1 dely3 dely1 delx3 div a 0 projectivemap xx1 xx0 a13 xx1 a 1 projectivemap xx3 xx0 a23 xx3 a 2 projectivemap xx0 a 3 projectivemap yy1 yy0 a13 yy1 a 4 projectivemap yy3 yy0 a23 yy3 a 5 projectivemap yy0 a 6 projectivemap a13 a 7 projectivemap a23 ENDIF IF NOT arg_present xxin THEN return a IF n_elements xin EQ 1 THEN BEGIN xin replicate xin n_elements x0 yin replicate yin n_elements x0 ENDIF IF keyword_set double THEN res dblarr 2 n_elements xin ELSE res fltarr 2 n_elements xin IF n_elements x0 EQ 1 THEN BEGIN div a 6 xin a 7 yin 1 zero where div EQ 0 IF zero 0 NE 1 THEN BEGIN stop ENDIF res 0 a 0 xin a 1 yin a 2 div res 1 a 3 xin a 4 yin a 5 div ENDIF ELSE BEGIN div a 6 xin a 7 yin 1 zero where div EQ 0 IF zero 0 NE 1 THEN BEGIN stop ENDIF res 0 a 0 xin a 1 yin a 2 div res 1 a 3 xin a 4 yin a 5 div ENDELSE RETURN res END");53 a[51] = new Array("./Interpolation/square2quadrilateral.html", "square2quadrilateral.pro", "", " file_comments warm or map a unit square onto an arbitrary quadrilateral according to the 4 point correspondences: 0 0 x0 y0 1 0 x1 y1 1 1 x2 y2 0 1 x3 y3 The mapping is done using perspective transformation which preserve lines in all orientations and permit quadrilateral to quadrilateral mappings see ref bellow categories image grid manipulation examples IDL res square2quadrilateral x0 y0 x1 y1 x2 y2 x3 y3 xin yin param x0in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param y0in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param x1in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param y1in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param x2in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param y2in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param x3in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param y3in in required the coordinates of the quadrilateral see above for correspondance with the unit square Can be scalar or array x0 y0 x1 y1 x2 y2 and x3 y3 are given in the anticlockwise order param xxin in required the coordinates of the point s for which we want to do the mapping Can be scalar or array param yyin in required the coordinates of the point s for which we want to do the mapping Can be scalar or array returns 2 n array: the new coodinates xout yout of the xin yin point s after mapping If xin is a scalar then n is equal to the number of elements of x0 If xin is an array then n is equal to the number of elements of xin If xin and yin are omited square2quadrilateral returns the matrix A which is used for the inverse transformation restrictions I think degenerated quadrilateral e g flat of twisted is not work This has to be tested examples IDL splot 0 5 0 3 nodata xstyle 1 ystyle 1 IDL tracegrille findgen 11 1 findgen 11 1 color indgen 12 20 IDL xin findgen 11 1 replicate 1 11 IDL yin replicate 1 11 findgen 11 1 IDL out square2quadrilateral 2 1 3 0 5 1 2 3 xin yin IDL tracegrille reform out 0 11 11 reform out 1 11 11 color indgen 12 20 history Sebastien Masson smasson lodyc jussieu fr August 2003 Based on Digital Image Warping by G Wolberg IEEE Computer Society Press Los Alamitos California Chapter 3 see p 52 56 FUNCTION square2quadrilateral x0in y0in x1in y1in x2in y2in x3in y3in xxin yyin Warning wrong definition of x2 y2 and x3 y3 at the bottom of page 54 of Wolberg s book see figure 3 7 page 56 for the good definition IF keyword_set double THEN BEGIN x0 double x0in x1 double x1in x2 double x2in x3 double x3in y0 double y0in y1 double y1in y2 double y2in y3 double y3in IF arg_present xxin THEN BEGIN xin double xxin yin double yyin ENDIF ENDIF ELSE BEGIN x0 float x0in x1 float x1in x2 float x2in x3 float x3in y0 float y0in y1 float y1in y2 float y2in y3 float y3in IF arg_present xxin THEN BEGIN xin float xxin yin float yyin ENDIF ENDELSE IF keyword_set double THEN a dlbarr 8 n_elements x0 ELSE a fltarr 8 n_elements x0 delx3 x0 x1 x2 x3 dely3 y0 y1 y2 y3 affinemap where delx3 EQ 0 AND dely3 EQ 0 IF affinemap 0 NE 1 THEN BEGIN xx0 x0 affinemap xx1 x1 affinemap xx2 x2 affinemap yy0 y0 affinemap yy1 y1 affinemap yy2 y2 affinemap a 0 affinemap xx1 xx0 a 1 affinemap xx2 xx1 a 2 affinemap xx0 a 3 affinemap yy1 yy0 a 4 affinemap yy2 yy1 a 5 affinemap yy0 a 6 affinemap 0 a 7 affinemap 0 ENDIF projectivemap where delx3 NE 0 OR dely3 NE 0 IF projectivemap 0 NE 1 THEN BEGIN xx0 x0 projectivemap xx1 x1 projectivemap xx2 x2 projectivemap xx3 x3 projectivemap yy0 y0 projectivemap yy1 y1 projectivemap yy2 y2 projectivemap yy3 y3 projectivemap delx1 xx1 xx2 dely1 yy1 yy2 delx2 xx3 xx2 dely2 yy3 yy2 delx3 delx3 projectivemap dely3 dely3 projectivemap div delx1 dely2 dely1 delx2 zero where div EQ 0 IF zero 0 NE 1 THEN BEGIN stop ENDIF a13 delx3 dely2 dely3 delx2 div a23 delx1 dely3 dely1 delx3 div a 0 projectivemap xx1 xx0 a13 xx1 a 1 projectivemap xx3 xx0 a23 xx3 a 2 projectivemap xx0 a 3 projectivemap yy1 yy0 a13 yy1 a 4 projectivemap yy3 yy0 a23 yy3 a 5 projectivemap yy0 a 6 projectivemap a13 a 7 projectivemap a23 ENDIF IF NOT arg_present xxin THEN return a IF n_elements xin EQ 1 THEN BEGIN xin replicate xin n_elements x0 yin replicate yin n_elements x0 ENDIF IF keyword_set double THEN res dblarr 2 n_elements xin ELSE res fltarr 2 n_elements xin IF n_elements x0 EQ 1 THEN BEGIN div a 6 xin a 7 yin 1 zero where div EQ 0 IF zero 0 NE 1 THEN BEGIN stop ENDIF res 0 a 0 xin a 1 yin a 2 div res 1 a 3 xin a 4 yin a 5 div ENDIF ELSE BEGIN div a 6 xin a 7 yin 1 zero where div EQ 0 IF zero 0 NE 1 THEN BEGIN stop ENDIF res 0 a 0 xin a 1 yin a 2 div res 1 a 3 xin a 4 yin a 5 div ENDELSE RETURN res END"); 54 54 a[52] = new Array("./Interpolation/testinterp.html", "testinterp.pro", "", " PRO testinterp method bilinear method imoms3 jpia 300L jpja 200L torg findgen jpia jpja xorg 20 d 360 d jpia dindgen jpia yorg 89 d 178 d jpja 1 dindgen jpja jpio 400L jpjo 150L xnew 0 d 360 d jpio dindgen jpio ynew 89 5d 179 d jpjo 1 dindgen jpjo outnorth where ynew GT yorg jpja 2 noutn outsouth where ynew LT yorg 1 nouts t2 fromreg method torg xorg yorg xnew ynew t3 fromreg method reverse torg 2 xorg reverse yorg xnew ynew IF array_equal t2 t3 EQ 0 THEN stop ELSE print ok1 xshift 20 torg2 shift torg xshift 0 xorg2 shift xorg xshift xorg2 0: xshift 1 xorg2 0: xshift 1 360 IF array_equal sort xorg2 lindgen n_elements xorg2 EQ 0 THEN stop t3 fromreg method torg2 xorg2 yorg xnew ynew IF array_equal t2 t3 EQ 0 THEN stop ELSE print ok2 xshift 20 torg2 shift torg xshift 0 xorg2 shift xorg xshift xorg2 0: xshift 1 xorg2 0: xshift 1 360 IF array_equal sort xorg2 lindgen n_elements xorg2 EQ 0 THEN stop t3 fromreg method reverse torg2 2 xorg2 reverse yorg xnew ynew IF array_equal t2 t3 EQ 0 THEN stop ELSE print ok3 xshift 20 torg2 shift torg xshift 0 xorg2 shift xorg xshift t3 fromreg method torg2 xorg2 yorg xnew ynew IF array_equal t2 t3 EQ 0 THEN stop ELSE print ok4 xshift 20 torg2 shift torg xshift 0 xorg2 shift xorg xshift t3 fromreg method reverse torg2 2 xorg2 reverse yorg xnew ynew IF array_equal t2 t3 EQ 0 THEN stop ELSE print ok5 t3 fromreg method torg xorg yorg xnew ynew nonorthernline IF array_equal t2 0:jpjo 1 noutn t3 0:jpjo 1 noutn EQ 0 THEN stop ELSE print ok6 FOR i 1 noutn 1 DO if array_equal t3 jpjo 1 t3 jpjo 1 i EQ 0 THEN stop ELSE print ok7 i t3 fromreg method torg xorg yorg xnew ynew nosouthernline IF array_equal t2 nouts: t3 nouts: EQ 0 THEN stop ELSE print ok8 FOR i 1 nouts 1 DO if array_equal t3 0 t3 i EQ 0 THEN stop ELSE print ok9 i t3 fromreg method reverse torg 2 xorg reverse yorg xnew ynew nonorthernline IF array_equal t2 0:jpjo 1 noutn t3 0:jpjo 1 noutn EQ 0 THEN stop ELSE print ok10 FOR i 1 noutn 1 DO if array_equal t3 jpjo 1 t3 jpjo 1 i EQ 0 THEN stop ELSE print ok11 i t3 fromreg method reverse torg 2 xorg reverse yorg xnew ynew nosouthernline IF array_equal t2 nouts: t3 nouts: EQ 0 THEN stop ELSE print ok12 FOR i 1 nouts 1 DO if array_equal t3 0 t3 i EQ 0 THEN stop ELSE print ok13 i xshift 20 torg2 shift torg xshift 0 xorg2 shift xorg xshift xorg2 0: xshift 1 xorg2 0: xshift 1 360 IF array_equal sort xorg2 lindgen n_elements xorg2 EQ 0 THEN stop t3 fromreg method torg2 xorg2 yorg xnew ynew nonorthernline IF array_equal t2 0:jpjo 1 noutn t3 0:jpjo 1 noutn EQ 0 THEN stop ELSE print ok14 FOR i 1 noutn 1 DO if array_equal t3 jpjo 1 t3 jpjo 1 i EQ 0 THEN stop ELSE print ok15 i xshift 20 torg2 shift torg xshift 0 xorg2 shift xorg xshift xorg2 0: xshift 1 xorg2 0: xshift 1 360 IF array_equal sort xorg2 lindgen n_elements xorg2 EQ 0 THEN stop t3 fromreg method torg2 xorg2 yorg xnew ynew nosouthernline IF array_equal t2 nouts: t3 nouts: EQ 0 THEN stop ELSE print ok16 FOR i 1 nouts 1 DO if array_equal t3 0 t3 i EQ 0 THEN stop ELSE print ok17 i xshift 20 torg2 shift torg xshift 0 xorg2 shift xorg xshift xorg2 0: xshift 1 xorg2 0: xshift 1 360 IF array_equal sort xorg2 lindgen n_elements xorg2 EQ 0 THEN stop t3 fromreg method reverse torg2 2 xorg2 reverse yorg xnew ynew nonorthernline IF array_equal t2 0:jpjo 1 noutn t3 0:jpjo 1 noutn EQ 0 THEN stop ELSE print ok18 FOR i 1 noutn 1 DO if array_equal t3 jpjo 1 t3 jpjo 1 i EQ 0 THEN stop ELSE print ok19 i xshift 20 torg2 shift torg xshift 0 xorg2 shift xorg xshift xorg2 0: xshift 1 xorg2 0: xshift 1 360 IF array_equal sort xorg2 lindgen n_elements xorg2 EQ 0 THEN stop t3 fromreg method reverse torg2 2 xorg2 reverse yorg xnew ynew nosouthernline IF array_equal t2 nouts: t3 nouts: EQ 0 THEN stop ELSE print ok20 FOR i 1 nouts 1 DO if array_equal t3 0 t3 i EQ 0 THEN stop ELSE print ok21 i return end"); 55 55 a[53] = new Array("./Obsolete/common.html", "common.pro", "", ""); … … 87 87 a[85] = new Array("./ReadWrite/idl-NetCDF/ncdf_struct.html", "ncdf_struct.pro", "", "FUNCTION ncdf_struct filename nodata nodata noattributes noattributes Read entire netcdf file into a structure Structure contains metadata actual array contents are on heap with pointers contained in the structure Heap variables not created if nodata specified Use ncdf_struct_free to free heap memory Some data is duplicated for ease of access in particular if there is a variable name matching a dimension name then a pointer to the variable contents is accessible via the substructures corresponding to the dimension and every other variable that uses it Alan Iwi 27 6 02 id ncdf_open filename g ncdf_inquire id ndim g ndims nvar g nvars natt g ngatts if ndim gt 0 then begin dnames strarr ndim dsizes lonarr ndim for idim 0 ndim 1 do begin ncdf_diminq id idim dname dsize dnames idim dname dsizes idim dsize endfor endif if natt gt 0 and not keyword_set noattributes then begin anames strarr natt for iatt 0 natt 1 do begin aname ncdf_attname id global iatt ainq ncdf_attinq id global aname ncdf_attget id global aname aval if ainq datatype eq CHAR then aval string aval if iatt eq 0 then begin atts create_struct aname aval endif else begin atts create_struct atts aname aval endelse anames iatt aname endfor g create_struct g gatts atts gattnames anames endif if nvar gt 0 then begin vnames strarr nvar for ivar 0 nvar 1 do begin v ncdf_varinq id ivar vname v name vndim v ndims vnatt v natts vname v name if vnatt gt 0 and not keyword_set noattributes then begin vanames strarr vnatt for iatt 0 vnatt 1 do begin aname ncdf_attname id ivar iatt ainq ncdf_attinq id ivar aname ncdf_attget id ivar aname aval if ainq datatype eq CHAR then aval string aval if iatt eq 0 then begin atts create_struct aname aval endif else begin atts create_struct atts aname aval endelse vanames iatt aname endfor v create_struct v atts atts attnames anames endif vdnames dnames v dim vdsizes dsizes v dim v create_struct v dimnames vdnames dimsizes vdsizes if not keyword_set nodata then begin ncdf_varget id ivar vdata v create_struct v data ptr_new vdata dimdata replicate ptr_new vndim endif if ivar eq 0 then begin vars create_struct vname v endif else begin vars create_struct vars vname v endelse vnames ivar vname endfor endif if ndim gt 0 then begin for idim 0 ndim 1 do begin dname dnames idim d name:dname size:dsizes idim if not keyword_set nodata and nvar gt 0 then begin matchvar 1 for ivar 0 nvar 1 do begin if vnames ivar eq dname then matchvar ivar endfor if matchvar ne 1 then d create_struct d data vars matchvar data endif if idim eq 0 then begin dims create_struct dname d endif else begin dims create_struct dims dname d endelse endfor g create_struct g dims dims dimnames dnames dimsizes dsizes endif if nvar gt 0 then begin if not keyword_set nodata then begin for ivar 0 nvar 1 do begin for idim 0 vars ivar ndims 1 do begin vars ivar dimdata idim dims vars ivar dim idim data endfor endfor endif g create_struct g vars vars varnames vnames endif ncdf_close id return g end"); 88 88 a[86] = new Array("./ReadWrite/idl-NetCDF/ncdf_struct_free.html", "ncdf_struct_free.pro", "", "PRO ncdf_struct_free s free heap memory associated with struct returned by ncdf_struct for i 0 s nvars 1 do ptr_free s vars i data end"); 89 a[87] = new Array("./ReadWrite/ncdf_timeget.html", "ncdf_timeget.pro", "", " NAME: ncdf_timeget PURPOSE: get the time axis fom a netcdf_file and transforms it in julian days of IDL CATEGORY: reading ncdf_file CALLING SEQUENCE: time ncdf_timeget cdfid timeid INPUTS:cdfid: the ID of the ncdf_file which is already open timeid: the ID or the name of the variable which describe the calendar KEYWORD PARAMETERS: YYYYMMDD: active to obtain the date as a longinterger with the format YearYearYearYearMonthMonthDayDay the keyword parameters of ncdf_varget OUTPUTS:a long array of IDL julian days COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: the calendar variable must have the units attribute folowing the syntaxe bellow: time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2001 FUNCTION ncdf_timeget cdfid timeid YYYYMMDD yyyymmdd _extra ex insidetime ncdf_varinq cdfid timeid if insidetime natts NE 0 then begin attnames strarr insidetime natts for attiq 0 insidetime natts 1 do attnames attiq strlowcase ncdf_attname cdfid timeid attiq ENDIF ELSE return report the variable timeid must have the units attribut reading of the time axis ncdf_varget cdfid timeid time _extra ex time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 if where attnames EQ units 0 NE 1 then begin ncdf_attget cdfid timeid units value value strtrim strcompress string value 2 words str_sep value unite words 0 start str_sep words 2 case strlowcase unite of seconds :time julday start 1 start 2 start 0 time long 24 3600 hours :time julday start 1 start 2 start 0 time long 24 days :time julday start 1 start 2 start 0 time months :BEGIN for t 0 n_elements time 1 do begin time t julday start 1 time t start 2 start 0 endfor END years :BEGIN for t 0 n_elements time 1 do begin time t julday start 1 start 2 start 0 time t endfor END ELSE:return report bad syntax of the units attribut of the variable timeid ENDCASE ENDIF ELSE return report the variable timeid must have the units attribut if keyword_set yyyymmdd then time jul2date time return time end");90 a[88] = new Array("./ReadWrite/read_grads.html", "read_grads.pro", "", " NAME:read_grads PURPOSE:reading grads file except data type station or grib from the grads control file even if there is multiple data files CATEGORY:reading function CALLING SEQUENCE: res read_grads var date1 date2 FILENAME filename INPUTS: var: the variable name date1: date of the beginning yyyymmdd if TIMESTEP is not activate date2: last date Optionnal if not scpecified date2 date1 KEYWORD PARAMETERS: FILENAME: the grads control file name: xxxx ctl GLAMBOUNDARY via computegrid pro :a 2 elements vector lon1 lon2 giving the longitute boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 eq 360 key_shift will be automatically defined according to GLAMBOUNDARY TIMESTEP: to specify that the dates are time steps instead of true calendar IODIRECTORY a string giving the name of iodirectory see isafile pro for all possibilities default value is common variable iodir NOT yet available BOX: a 4 or 6 elements 1d array lon1 lon2 lat1 lat2 depth1 depth2 that specifies the area where data must be read EVERYTHING NOSTRUCTURE OUTPUTS: an array COMMON BLOCKS:common pro SIDE EFFECTS:define all the grid parameters defined in common pro associated to the data RESTRICTIONS: this function call the procedure scanfile that use the unix commands grep and sed EXAMPLE: IDL a read_grads sst 19900101 19900131 filename outputs ctl IDL plt a MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr FUNCTION read_grads var date1 date2 FILENAME filename BOX box TIMESTEP timestep EVERYTHING everything NOSTRUCT nostruct _EXTRA ex cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF we find the filename filename isafile FILENAME filename IODIRECTORY iodir _EXTRA ex if size filename type NE 7 then return report read_ncdf cancelled we scan the control file called filename scanctl filename filesname jpt1file varsname varslev swapbytes bigendian littleendian f77sequential fileheader theader xyheader VARFMT varfmt _EXTRA ex if n_elements varfmt EQ 0 then varfmt float check date1 and date2 and found the starting index t1 and the ending index t2 that corresponds to the time series specified by date1 and date2 for the time axis defined in the ctl file if n_elements date1 EQ 0 then begin t0 0 t1 0 ENDIF if n_elements date2 EQ 0 then date2 date1 if keyword_set timestep then BEGIN if date1 GT date2 then begin print date2 must be larger than date1 return 1 endif t1 0 long date1 long date2 date2jul date2 grads if jdate1 GT jdate2 then begin print date2 must be larger than date1 return 1 endif t1 where time GE jdate1 0 tmp where time LE jdate2 t2 t2 t2 1 ENDELSE if t2 LT t1 then begin print There is no date between date1 and date2 return 1 endif jpt2read t2 t1 1 index of the variable varid where strlowcase varsname EQ strlowcase var varid varid 0 if varid EQ 1 then begin print var not found in the variable liste of filename return 1 ENDIF varname var if varslev varid EQ 1 then res fltarr jpi jpj jpt2read nozero ELSE res fltarr jpi jpj varslev varid jpt2read nozero find the first file to be read according to the lile list the number of time step in each file and t1 and t2 indf2read t1 jpt1file startread t1 indf2read jpt1file alreadyread 0 readagain: jpt2read1file min jpt1file startread jpt2read f2read filesname indf2read opening check the existance of the file f2read isafile filename f2read iodirectory iodir _EXTRA ex if the file is stored on tape if version os_family EQ unix then spawn file f2read dev null open the file openr unit f2read get_lun error err swap_if_little_endian bigendian swap_if_big_endian littleendian swap_endian swapbytes if err ne 0 then begin print err_string return 1 endif case varfmt of byte :fmtsz 1l uint :fmtsz 2l int :fmtsz 2l long :fmtsz 4l float :fmtsz 4l endcase check its size addf77sec long 4 2 f77sequential xyblocsize xyheader addf77sec xyheader NE 0 jpi jpj fmtsz addf77sec nxybloc long total varslev filesize fileheader addf77sec fileheader NE 0 theader addf77sec theader NE 0 nxybloc xyblocsize jpt1file infof2read fstat unit if infof2read size NE filesize then begin print According to filename the file size must be strtrim filesize 1 instead of strtrim infof2read size 1 print jpi: strtrim jpi 2 print jpj: strtrim jpj 2 print jpt: strtrim jpt 2 print format size in byte: strtrim fmtsz 2 print number of xy arrays: strtrim nxybloc 2 return 1 endif reading loop on the time steps to be read in one file for i 0 jpt2read1file 1 do begin computing the offset offset fileheader addf77sec fileheader NE 0 theader addf77sec theader NE 0 nxybloc xyblocsize startread i theader addf77sec theader NE 0 if varid NE 0 THEN offset offset long total varslev 0:varid 1 xyblocsize if there is only one level IF varslev varid EQ 1 then begin case varfmt of byte :a assoc unit bytarr jpi jpj nozero offset 4 f77sequential uint :a assoc unit uintarr jpi jpj nozero offset 4 f77sequential int :a assoc unit intarr jpi jpj nozero offset 4 f77sequential long :a assoc unit lonarr jpi jpj nozero offset 4 f77sequential float :a assoc unit fltarr jpi jpj nozero offset 4 f77sequential endcase res i alreadyread a 0 ENDIF ELSE BEGIN more than 1 level to be read if f77sequential then BEGIN sequential access case varfmt of byte :a assoc unit bytarr jpi jpj 8 varslev varid nozero offset uint :a assoc unit uintarr jpi jpj 4 varslev varid nozero offset int :a assoc unit intarr jpi jpj 4 varslev varid nozero offset long :a assoc unit lonarr jpi jpj 2 varslev varid nozero offset float :a assoc unit fltarr jpi jpj 2 varslev varid nozero offset endcase tmp a 0 case varfmt OF we cut the headers and tailers of f77 write byte : tmp tmp 4:jpi jpj 3 uint : tmp tmp 2:jpi jpj 1 int : tmp tmp 2:jpi jpj 1 long : tmp tmp 1:jpi jpj 0 float :tmp tmp 1:jpi jpj 0 endcase if keyword_set key_zreverse then res i alreadyread reverse reform tmp jpi jpj varslev varid over 3 ELSE res i alreadyread reform tmp jpi jpj varslev varid over ENDIF ELSE BEGIN direct acces case varfmt of byte :a assoc unit bytarr jpi jpj varslev varid nozero offset uint :a assoc unit uintarr jpi jpj varslev varid nozero offset int :a assoc unit intarr jpi jpj varslev varid nozero offset long :a assoc unit lonarr jpi jpj varslev varid nozero offset float :a assoc unit fltarr jpi jpj varslev varid nozero offset endcase if keyword_set key_zreverse then res i alreadyread reverse a 0 3 ELSE res i alreadyread a 0 ENDELSE ENDELSE endfor close the file free_lun unit close unit do we need to read a new file to complete the time series if jpt2read1file NE jpt2read then BEGIN indf2read indf2read 1 startread 0 alreadyread alreadyread jpt2read1file jpt2read jpt2read jpt2read1file GOTO readagain ENDIF post processing if keyword_set key_yreverse then res reverse res 2 if keyword_set key_shift then begin case size res 0 of 2:res shift res key_shift 0 3:res shift res key_shift 0 0 4:res shift res key_shift 0 0 0 endcase endif mask IF varslev varid EQ 1 then begin if abs valmask LE 1e5 then notgood where res 0 EQ valmask ELSE notgood where abs res 0 GE abs valmask 10 if notgood 0 NE 1 then tmask notgood 0b ENDIF ELSE BEGIN if abs valmask LE 1e5 then notgood where res 0 EQ valmask ELSE notgood where abs res 0 GE abs valmask 10 if notgood 0 NE 1 then tmask notgood 0b ENDELSE if abs valmask LE 1e5 then notgood where res EQ valmask ELSE notgood where abs res GE abs valmask 10 if notgood 0 NE 1 THEN res notgood values f_nan valmask 1e20 if abs valmask LE 1e5 then notgood where res EQ valmask ELSE notgood where abs res GE abs valmask 10 if notgood 0 NE 1 THEN res notgood 1e20 valmask 1e20 triangles_list triangule subdomain extration time aguments time time t1:t2 jpt t2 t1 1 if keyword_set timestep then vardate strtrim time 0 2 ELSE vardate date2string vairdate time 0 updateold return res end");91 a[89] = new Array("./ReadWrite/read_oasis.html", "read_oasis.pro", "", " NAME:read_oasis PURPOSE:read the f77 unformated files used in Oasis version a read_oasis grids_orca_t106 a106 lon 320 160 IDL m read_oasis masks_orca_t106 or1t msk 182 149 i4 see also IDL scanoasis grids_orca_t106 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr July 01 2002 FUNCTION read_oasis filename varname jpi jpj I2 I4 i4 I8 i8 R4 r4 openr unit filename f77_unformatted get_lun swap_if_little_endian error err if err ne 0 then begin print err_string return 1 endif char8 12345678 readu unit char8 print char8 found char8 EQ varname WHILE NOT EOF unit AND found NE 1 DO BEGIN readu unit if EOF unit then begin print varname not found in filename return 1 endif readu unit char8 print char8 found char8 EQ varname ENDWHILE case 1 of keyword_set i2 :res intarr jpi jpj keyword_set i4 :res lonarr jpi jpj keyword_set i8 :res lon64arr jpi jpj keyword_set r4 :res fltarr jpi jpj ELSE:res dblarr jpi jpj endcase readu unit res free_lun unit return res end");92 a[90] = new Array("./ReadWrite/readbat.html", "readbat.pro", "", " NAME: readbat PURPOSE: reading the bathymetry ASCII file of OPA CATEGORY: for OPA CALLING SEQUENCE: bat readbat filename INPUTS: filename: a string containing the filename KEYWORD PARAMETERS: ZERO: to put 0 on land instead of negatives values for the islands OUTPUTS: a 2d array COMMON BLOCKS:no SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr May 31 2002 based on batlec2 pro written by Maurice Imbard March 17 1998 FUNCTION readbat filename ZERO zero lecture de la bathymetrie iname_file findfile filename if iname_file 0 EQ then begin print Bad file name return 1 ENDIF ELSE iname_file iname_file 0 openr iunit iname_file get_lun readf iunit FORMAT 16x 2i8 iim ijm iim long iim ijm long ijm tmp readf iunit tmp tmp strsplit tmp extract iim long tmp n_elements tmp 2 ijm long tmp n_elements tmp 1 print iim ijm ifreq 40L ifin iim ifreq 1 irest iim ifin 1 ifreq print ifin irest ifreq zbati intarr ifreq zbati2 intarr irest zbat intarr iim ijm readf iunit FORMAT readf iunit FORMAT il1 0 FOR jn 1 ifin 1 DO BEGIN readf iunit FORMAT readf iunit FORMAT il2 min iim 1 il1 ifreq 1 readf iunit FORMAT readf iunit FORMAT readf iunit FORMAT il3 il2 jn 1 ifreq iformat string il3 2 i3 print jn il1 il2 il3 ifreq 1 FOR jj ijm 1 0 1 DO BEGIN readf iunit FORMAT iformat ij zbati zbat il1:il2 jj zbati ENDFOR il1 il1 ifreq ENDFOR readf iunit FORMAT readf iunit FORMAT il2 min iim 1 il1 ifreq 1 readf iunit FORMAT readf iunit FORMAT readf iunit FORMAT il3 il2 ifin 1 ifreq iformat string il3 2 i3 print irest 1 il1 il2 il3 FOR jj ijm 1 0 1 DO BEGIN readf iunit FORMAT iformat ij zbati2 zbat il1:il2 jj zbati2 ENDFOR close iunit free_lun iunit if keyword_set zero then zbat 0 zbat return zbat end");93 a[91] = new Array("./ReadWrite/readoldopadistcoast.html", "readoldopadistcoast.pro", "", " NAME:readoldopadistcoast PURPOSE: read the old binary direct access file that contains the distance to the coast in OPA based on the OPA subroutines dtacof and parctl CATEGORY:for OPA before NetCDF CALLING SEQUENCE:res readoldopadistcoast filename INPUTS: filename with the whole path if necessary jpiglo jpjglo jpk: dimensions of the opa grid KEYWORD PARAMETERS: IBLOC: ibloc size default: ibloc 4096L JPBYT: jpbyt size defalut: jpbyt 8L NUMREC: number of records in the file defalut: numrec 19L jpk OUTPUTS: a structure that contains two elements: tdistcoast the distance for the t points and fdiscoast the distance for the f points COMMON BLOCKS: no SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2002 FUNCTION read3fromopa unit params num offset params reclen params jpk num 1L a assoc unit dblarr params jpiglo params jpjglo params jpk nozero offset b a 0 return b endFUNCTION readoldopadistcoast filename jpiglo jpjglo jpk IBLOC ibloc JPBYT jpbyt NUMREC numrec iname_file findfile filename if iname_file 0 EQ then begin print Bad file name return 1 ENDIF ELSE iname_file iname_file 0 open the file openr numcost iname_file get_lun swap_if_little_endian check the size of the file filepamameters fstat numcost defaut parameter definition for ORCA2 IF keyword_set ibloc THEN ibloc long ibloc ELSE ibloc 4096L jpiglo long jpiglo jpjglo long jpjglo jpk long jpk IF keyword_set jpbyt THEN jpbyt long jpbyt ELSE jpbyt 8L record length computation reclen ibloc jpiglo jpjglo jpbyt 1 ibloc 1 number of records IF keyword_set numrec THEN numrec long numrec ELSE numrec 3L jpk difference between the record length and the size of the contened array toomuch reclen jpiglo jpjglo jpbyt expected size computation size numrec reclen toomuch if size NE filepamameters size then begin print The size of the file is not the expected one print Check your file or the values of ibloc jpiglo print jpjglo jpk jpbyt numrec in this program return 1 endif first record: six 64 bit integer to read default definition iimlu long64 999 ijmlu long64 999 ikmlu long64 999 read readu numcost iimlu ijmlu ikmlu if iimlu NE jpiglo then begin print iimlu strtrim iimlu 1 differs from jpiglo strtrim jpiglo 1 return 1 endif if ijmlu NE jpjglo then begin print ijmlu strtrim ijmlu 1 differs from jpjglo strtrim jpjglo 1 return 1 endif if ikmlu NE jpk then begin print ikmlu strtrim ikmlu 1 differs from jpk strtrim jpk 1 return 1 endif other records params jpiglo:jpiglo jpjglo:jpjglo jpk:jpk reclen:reclen tdistcoast read3fromopa numcost params 2 fdistcoast read3fromopa numcost params 3 close numcost free_lun numcost return tdistcoast:tdistcoast fdistcoast:fdistcoast end");94 a[92] = new Array("./ReadWrite/readoldoparestart.html", "readoldoparestart.pro", "", " NAME:readoldoparestart based on the OPA subroutine dtrlec included at the end of the file PURPOSE:read the old restart files of OPA before NetCDF CATEGORY:for OPA before NetCDF CALLING SEQUENCE:readoldoparestart filename jpiglo jpjglo jpk INPUTS: filename: with the whole path if necessary jpiglo jpjglo jpk: dimensions of the opa grid KEYWORD PARAMETERS: IBLOC: ibloc size default: ibloc 4096L JPBYT: jpbyt size defalut: jpbyt 8L NUMREC: number of records in the file defalut: numrec 19L jpk UB VB TB SB ROTB HDIVB UN VN TN SN ROTN HDIVN GCX GCXB ETAB TAN BSFB BSFN BSFD EN: the variable we want to read OUTPUTS:according to the given keywords COMMON BLOCKS:none SIDE EFFECTS: RESTRICTIONS:bug for etab and etan written on the same record EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2002 FUNCTION read2fromopa unit params num offset params reclen params jpk num 1L a assoc unit dblarr params jpiglo params jpjglo nozero offset return a 0 end FUNCTION read3fromopa unit params num offset params reclen params jpk num 1L a assoc unit dblarr params jpiglo params jpjglo params jpk nozero offset return a 0 endPRO readoldoparestart filename jpiglo jpjglo jpk IBLOC ibloc JPBYT jpbyt NUMREC numrec ub ub vb vb tb tb sb sb rotb rotb hdivb hdivb un un vn vn tn tn sn sn rotn rotn hdivn hdivn gcx gcx gcxb gcxb etab etab etan etan bsfb bsfb bsfn bsfn bsfd bsfd en en iname_file findfile filename if iname_file 0 EQ then begin print Bad file name return ENDIF ELSE iname_file iname_file 0 open the file openr numrst iname_file get_lun swap_if_little_endian check the size of the file filepamameters fstat numrst parameter definition IF keyword_set ibloc THEN ibloc long ibloc ELSE ibloc 4096L jpiglo long jpiglo jpjglo long jpjglo jpk long jpk IF keyword_set jpbyt THEN jpbyt long jpbyt ELSE jpbyt 8L record length computation reclen ibloc jpiglo jpjglo jpbyt 1 ibloc 1 IF keyword_set numrec THEN numrec long numrec ELSE numrec 19L jpk toomuch reclen jpiglo jpjglo jpbyt expected size computation size numrec reclen toomuch if size NE filepamameters size then begin print The size of the file is not the expected one print Check your file or the values of ibloc jpiglo print jpjglo jpk jpbyt numrec in this program return endif first record: six 64 bit integer to read default definition ino1 long64 9999 it1 long64 9999 isor1 long64 9999 ipcg1 long64 9999 itke1 long64 9999 idast1 long64 9999 read readu numrst ino1 it1 isor1 ipcg1 itke1 idast1 print ino1 it1 isor1 ipcg1 itke1 idast1 other records params jpiglo:jpiglo jpjglo:jpjglo jpk:jpk reclen:reclen CALL read3 numrst ub 2 IF arg_present ub THEN ub read3fromopa numrst params 2 CALL read3 numrst vb 3 IF arg_present vb THEN vb read3fromopa numrst params 3 CALL read3 numrst tb 5 IF arg_present tb THEN tb read3fromopa numrst params 5 CALL read3 numrst sb 6 IF arg_present sb THEN sb read3fromopa numrst params 6 CALL read3 numrst rotb 7 IF arg_present rotb THEN rotb read3fromopa numrst params 7 CALL read3 numrst hdivb 8 IF arg_present hdivb THEN hdivb read3fromopa numrst params 8 CALL read3 numrst un 9 IF arg_present un THEN un read3fromopa numrst params 9 CALL read3 numrst vn 10 IF arg_present vn THEN vn read3fromopa numrst params 10 CALL read3 numrst tn 12 IF arg_present tn THEN tn read3fromopa numrst params 12 CALL read3 numrst sn 13 IF arg_present sn THEN sn read3fromopa numrst params 13 CALL read3 numrst rotn 14 IF arg_present rotn THEN rotn read3fromopa numrst params 14 CALL read3 numrst hdivn 15 IF arg_present hdivn THEN hdivn read3fromopa numrst params 15 C C Read elliptic solver arrays C CALL read2 numrst gcx jpk 17 IF arg_present gcx THEN gcx read2fromopa numrst params 17 CALL read2 numrst gcxb jpk 18 IF arg_present gcxb THEN gcxb read2fromopa numrst params 18 C ifdef key_freesurf_cstvol C C free surface formulation eta C CALL read2 numrst etab jpk 4 IF arg_present etab THEN etab read2fromopa numrst params 4 CALL read2 numrst etan jpk 4 IF arg_present etan THEN etan read2fromopa numrst params 4 else C C Rigid lid formulation bsf C CALL read2 numrst bsfb jpk 4 IF arg_present bsfb THEN bsfb read2fromopa numrst params 4 CALL read2 numrst bsfn jpk 11 IF arg_present bsfn THEN bsfn read2fromopa numrst params 11 CALL read2 numrst bsfd jpk 16 IF arg_present bsfd THEN bsfd read2fromopa numrst params 16 endif ifdef key_zdftke CALL read3 numrst en 19 IF arg_present en THEN en read3fromopa numrst params 19 close numrst free_lun numrst return end CDIR LIST SUBROUTINE dtrlec CCC CCC CCC ROUTINE dtrlec CCC CCC CCC Purpose : CCC CCC Read files for restart CCC CC Method : CC CC Read the previous fields on the file numrst CC the first record indicates previous characterics CC after control with the present run we read : CC prognostic variables on the second record CC elliptic solver arrays CC barotropic stream function arrays default option CC or free surface arrays key_freesurf_cstvol defined CC tke arrays key_zdftke defined CC for this last three records the previous characteristics CC could be different with those used in the present run CC CC Input : CC CC common CC comrst : restart parameter CC comctl : parameters for the control CC CC Output : CC CC common CC combef : previous fields before CC comnow : present fields now CC combsf : barotropic stream function CC comspg : surface pressure CC comsol : diagonal preconditioned conjugate CC CC Modifications : CC CC original : 91 03 CC additions : 92 01 M Imbard CC : 92 06 correction restart file M Imbard CC : 98 02 M Guyon FETI method CC addition : 98 05 G Roullet free surface CC CC parameters and commons CC CDIR NOLIST include parameter h include common h CDIR LIST CC CC local declarations CC INTEGER ji jj jk jl INTEGER ino0 it0 ipcg0 isor0 itke0 INTEGER ino1 it1 isor1 ipcg1 itke1 idast1 CC CC statement functions CC CDIR NOLIST include stafun h CDIR LIST CCC CCC OPA8 LODYC 1997 CCC C C C 0 Initialisations C C ino0 no it0 nit000 ipcg0 0 isor0 0 itke0 0 isor0 nsolv 1 ipcg0 2 nsolv ifdef key_zdftke itke0 1 endif C FETI method IF nsolv EQ 3 THEN isor0 2 ipcg0 2 ENDIF C IF lwp THEN WRITE numout WRITE numout dtrlec: beginning of restart WRITE numout WRITE numout the present run : WRITE numout job number : no WRITE numout with nit000 : nit000 WRITE numout with pcg option ipcg0 : ipcg0 WRITE numout with sor option isor0 : isor0 WRITE numout with FETI solver option ipcg0 isor0 : ipcg0 isor0 WRITE numout with tke option itke0 : itke0 ENDIF C C 1 Read numrst C C C First record C READ numrst REC 1 ino1 it1 isor1 ipcg1 itke1 idast1 C IF lwp THEN WRITE numout WRITE numout READ numrst with WRITE numout job number : ino1 WRITE numout with time step it : it1 WRITE numout with pcg option ipcg1 : ipcg1 WRITE numout with sor option isor1 : isor1 WRITE numout with tke option itke1 : itke1 WRITE numout with FETI solver option ipcg1 isor1 : ipcg1 isor1 WRITE numout ENDIF C C Control of date C IF it0 it1 NE 1 AND abs nrstdt EQ 1 THEN IF lwp THEN WRITE numout : problem with nit000 for the restart WRITE numout WRITE numout we stop verify the file WRITE numout or rerun with the value 0 for the WRITE numout control of time parameter nrstdt WRITE numout ENDIF STOP dtrlec ENDIF IF nrstdt EQ 1 ndate0 idast1 C C Read prognostic variables C CALL read3 numrst ub 2 CALL read3 numrst vb 3 CALL read3 numrst tb 5 CALL read3 numrst sb 6 CALL read3 numrst rotb 7 CALL read3 numrst hdivb 8 CALL read3 numrst un 9 CALL read3 numrst vn 10 CALL read3 numrst tn 12 CALL read3 numrst sn 13 CALL read3 numrst rotn 14 CALL read3 numrst hdivn 15 C C Read elliptic solver arrays C CALL read2 numrst gcx jpk 17 CALL read2 numrst gcxb jpk 18 C ifdef key_freesurf_cstvol C C free surface formulation eta C CALL read2 numrst etab jpk 4 CALL read2 numrst etan jpk 4 else C C Rigid lid formulation bsf C CALL read2 numrst bsfb jpk 4 CALL read2 numrst bsfn jpk 11 CALL read2 numrst bsfd jpk 16 endif C ifdef key_zdftke C C Read tke arrays C IF itke1 eq 1 THEN CALL read3 numrst en 19 ELSE IF lwp THEN WRITE numout : the previous restart file didnt used tke scheme WRITE numout ENDIF nrstdt 2 ENDIF endif C C RETURN END");95 a[93] = new Array("./ReadWrite/scanctl.html", "scanctl.pro", "", " GLAMBOUNDARY:a 2 elements vector lon1 lon2 the longitute boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 le 360 key_shift will be defined according to GLAMBOUNDARYPRO scanctl filename filesname jpt1file varsname varslev swapbytes bigendian littleendian f77sequential fileheader theader xyheader VARFMT varfmt _EXTRA ex common time1 systime 1 for key_performance DTYPE spawn grep i DTYPE filename notgood if keyword_set notgood then begin print This program is not adapted to data type station or grib Sorry stop endif UNDEF define valmask spawn grep i UNDEF filename valmask valmask strtrim valmask 2 valmask strsplit valmask 0 extract valmask float valmask 1 Headers spawn grep i FILEHEADER filename fileheader fileheader strtrim fileheader 2 if keyword_set fileheader then BEGIN fileheader strsplit fileheader 0 extract fileheader long fileheader 1 ENDIF ELSE fileheader 0L spawn grep i THEADER filename theader theader strtrim theader 2 if keyword_set theader then BEGIN theader strsplit theader 0 extract theader long theader 1 ENDIF ELSE theader 0L spawn grep i XYHEADER filename xyheader xyheader strtrim xyheader 2 if keyword_set xyheader then BEGIN xyheader strsplit xyheader 0 extract xyheader long xyheader 1 ENDIF ELSE xyheader 0L find the x axis spawn sed n e d e Xx Dd Ee Ff Yy Dd Ee Ff p filename xdef if xdef 0 EQ then BEGIN print Bad definition of xdef or ydef stop ENDIF xdef xdef 0:n_elements xdef 2 if n_elements xdef NE 1 then begin xdef byte xdef replicate byte 1 n_elements xdef xdef xdef where xdef NE 0 xdef string xdef endif xdef strtrim xdef 0 2 xdef strsplit xdef extract jpi long xdef 1 case strupcase xdef 2 of LINEAR :xaxis float xdef 3 findgen jpi float xdef 4 LEVELS :xaxis float xdef 3:n_elements xdef 1 ENDCASE find the y axis spawn sed n e d e Yy Dd Ee Ff Zz Dd Ee Ff p filename ydef if ydef 0 EQ then BEGIN print Bad definition of ydef or zdef stop ENDIF ydef ydef 0:n_elements ydef 2 if n_elements ydef NE 1 then begin ydef byte ydef replicate byte 1 n_elements ydef ydef ydef where ydef NE 0 ydef string ydef endif ydef strtrim ydef 0 2 ydef strsplit ydef extract jpj long ydef 1 case strupcase ydef 2 of LINEAR :yaxis float ydef 3 findgen jpj float ydef 4 LEVELS :yaxis float ydef 3:n_elements ydef 1 GAUST62 :BEGIN print Not yet coded stop END GAUSR15 :BEGIN print Not yet coded stop END GAUSR20 :BEGIN print Not yet coded stop END GAUSR30 :BEGIN print Not yet coded stop END GAUSR40 :BEGIN print Not yet coded stop END ELSE:BEGIN print Not yet coded stop END endcase find the z axis spawn sed n e d e Zz Dd Ee Ff Tt Dd Ee Ff p filename zdef if zdef 0 EQ then BEGIN print Bad definition of zdef or tdef stop ENDIF zdef zdef 0:n_elements zdef 2 if n_elements zdef NE 1 then begin zdef byte zdef replicate byte 1 n_elements zdef zdef zdef where zdef NE 0 zdef string zdef endif zdef strtrim zdef 0 2 zdef strsplit zdef extract jpk long zdef 1 case strupcase zdef 2 of LINEAR :zaxis float zdef 3 findgen jpk float zdef 4 LEVELS :zaxis float zdef 3:n_elements zdef 1 ENDCASE compute the grid computegrid xaxis xaxis yaxis yaxis zaxis zaxis _EXTRA ex domdef find the time axis spawn grep i TDEF filename timedef timedef strupcase strtrim timedef 2 timedef strsplit timedef 0 extract jpt long timedef 1 initial date: y0 m0 d0 h0 mn0 julian day of IDL: julady m0 d0 y0 h0 mn0 00 t0 timedef 3 monthsname string format C CMOA 31 indgen 12 case 1 OF h h :mmZd d mmmyy yy strpos t0 : NE 1:BEGIN pp strpos t0 : h0 long strmid t0 0 pp mn0 long strmid t0 pp 1 2 pp strpos t0 Z dd byte strmid t0 pp 2 1 LT byte A d0 long strmid t0 pp 1 1 dd m0 where monthsname EQ strmid t0 pp 2 dd 3 0 1 y0 long strmid t0 pp 5 dd END m m Zd d mmmyy yy strpos t0 Z NE 1:BEGIN h0 0 12 pp strpos t0 Z mn0 long strmid t0 0 pp dd byte strmid t0 pp 2 1 LT byte A d0 long strmid t0 pp 1 1 dd m0 where monthsname EQ strmid t0 pp 2 dd 3 0 1 y0 long strmid t0 pp 5 dd END d d mmmyy yy byte strmid t0 0 1 LT byte A 0 :BEGIN h0 0 12 mn0 0 dd byte strmid t0 1 1 LT byte A d0 long strmid t0 0 1 dd m0 where monthsname EQ strmid t0 1 dd 3 0 1 y0 long strmid t0 4 dd END mmmyy yy ELSE:BEGIN h0 0 12 mn0 0 d0 1 m0 where monthsname EQ strmid t0 0 3 0 1 y0 long strmid t0 3 END ENDCASE if y0 is a two digit integer between 1950 and 2049 case 1 of y0 LE 49:y0 2000 y0 y0 LE 99:y0 1900 y0 ELSE: ENDCASE increment date and definition of the calendar with IDL julian days tstep timedef 4 tsval long strmid tstep 0 strlen tstep 2 case strlowcase strmid tstep 1 reverse of mn :time julday m0 d0 y0 h0 mn0 lindgen jpt tsval 0 hr :time julday m0 d0 y0 h0 lindgen jpt tsval mn0 0 dy :time julday m0 d0 lindgen jpt tsval y0 h0 mn0 0 mo :time julday m0 lindgen jpt tsval d0 y0 h0 mn0 0 yr :time julday m0 d0 y0 lindgen jpt tsval h0 mn0 0 ENDCASE shit the calendar to correspond to the time step case strlowcase strmid tstep 1 reverse of dy :time long time mo :time long time 14L yr :time long time 365L 2 ELSE: endcase OPTIONS spawn grep i OPTIONS filename options options strtrim options 2 options strlowcase options 0 key_yreverse strpos options yrev NE 1 key_zreverse strpos options zrev EQ 1 multifiles strpos options template NE 1 f77sequential strpos options sequential NE 1 swapbytes strpos options byteswapped NE 1 bigendian strpos options big_endian NE 1 littleendian strpos options little_endian NE 1 cray strpos options cray_32bit_ieee NE 1 IF cray THEN BEGIN print cray_32bit_ieee Not yet coded stop ENDIF cal365 strpos options 365_day_calendar NE 1 IF cal365 THEN BEGIN print 365_day_calenda Not yet coded stop ENDIF building the filesname spawn grep i DSET filename files files strtrim files 0 2 files strsplit files extract if n_elements files NE 2 then begin print Bad definition of the filename There shoud be 2 elements: print DEST and 1 filename that may define many files stop endif files files 1 files strmid files 0 strpos files 0 reverse_search 1 filesname files if keyword_set multifiles then begin minutes if stregex files i n2 0 NE 1 then begin filetsep mn mnend long mn0 jpt 1 tmp strarr hend h0 1 for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i n2 extract regex string mn0 i format i2 2 filesname strjoin tmp endif hours if stregex files i hf 123 0 NE 1 then begin filetsep hr case strlowcase strmid tstep 1 reverse of mn :hend long h0 jpt mn0 1 1 60 hr :hend long h0 jpt 1 endcase tmp strarr hend h0 1 case 1 of stregex files i h1 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i h1 extract regex strtrim h0 i 1 stregex files i h2 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i h2 extract regex string h0 i format i2 2 stregex files f2 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname f2 extract regex string h0 i format i3 2 stregex files i hf 3 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i hf 3 extract regex string h0 i format i3 3 endcase filesname strjoin tmp endif days if stregex files i d 12 0 NE 1 then begin filetsep dy case strlowcase strmid tstep 1 reverse of mn :dend long d0 jpt mn0 1 1 1440 hr :dend long d0 jpt h0 1 1 24 dy :dend long d0 jpt 1 endcase tmp strarr dend d0 1 case 1 of stregex files i d1 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i d1 extract regex strtrim d0 i 1 stregex files i d2 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i d2 extract regex string d0 i format i2 2 endcase filesname strjoin tmp endif months if stregex files i m 12c 0 NE 1 then begin filetsep mo tmp strarr 12 case 1 of stregex files i m1 NE 1:for i 1 12 do tmp i 1 strjoin strsplit filesname i m1 extract regex strtrim i 1 stregex files i m2 NE 1:for i 1 12 do tmp i 1 strjoin strsplit filesname i m2 extract regex string i format i2 2 stregex files i mc NE 1:for i 1 12 do tmp i 1 strjoin strsplit filesname i mc extract regex monthsname i 1 endcase filesname strjoin tmp endif years if stregex files i y 24 0 NE 1 then begin case strlowcase strmid tstep 1 reverse of dy :yend long y0 jpt d0 1 1 365 mo :yend long y0 jpt m0 1 1 12 yr :yend long y0 jpt 1 ELSE:yend y0 endcase tmp strarr yend y0 1 case 1 of stregex files i y2 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i y2 extract regex string y0 i 100 y0 i 100 format i2 2 stregex files i y4 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i y 4 extract regex string y0 i format i4 4 endcase filesname strjoin tmp endif filesname strsplit filesname extract time step unit of each file: case 1 of stregex files i n2 0 NE 1:filetsep mn stregex files i hf 123 0 NE 1:filetsep hr stregex files i d 12 0 NE 1:filetsep dy stregex files i m 12c 0 NE 1: filetsep mo stregex files i y 24 0 NE 1:filetsep yr ENDCASE number of time steps for each files case strlowcase strmid tstep 1 reverse of mn :BEGIN case filetsep of yr :jpt1file 60L 24L 365L mo :jpt1file 60L 24L 30L dy :jpt1file 60L 24L hr :jpt1file 60L mn :jpt1file 1L endcase END hr :BEGIN case filetsep of yr :jpt1file 24L 365L mo :jpt1file 24L 30L dy :jpt1file 24L hr :jpt1file 1L endcase END dy :BEGIN case filetsep of yr :jpt1file 365L mo :jpt1file 30L dy :jpt1file 1L endcase END mo :BEGIN case filetsep of yr :jpt1file 12L mo :jpt1file 1L endcase END yr :jpt1file 1L endcase number of files nof ceil jpt 1 jpt1file filesname filesname 0:nof 1 ENDIF ELSE BEGIN nof 1 jpt1file jpt ENDELSE first character if stregex files GE 0 THEN BEGIN iodir strmid filename 0 strpos filename reverse_search 1 for i 0 nof 1 do filesname i iodir strmid filesname i 1 ENDIF extracting the variables spawn grep i VARS filename nvars nvars strtrim nvars 2 nvars strsplit nvars 0 extract nvars long nvars 1 spawn sed n e d e Vv Aa Rr Ss Ee Nn Dd Vv Aa Rr Ss p filename varlist if n_elements varlist LE 2 then begin print No lines between vars and endvars stop endif varlist varlist 1:n_elements varlist 2 if n_elements varlist NE nvars then begin print Number of variables indicated by VARS strtrim nvars 1 differs from number of lines without at the beginning located between VARS and ENDVARS: strtrim n_elements varlist 1 stop ENDIF varsname strarr nvars varsdes strarr nvars varslev lonarr nvars for i 0 nvars 1 do BEGIN varlist i strtrim varlist i 2 tmp strsplit varlist i extract if strmid tmp 2 0 2 EQ 1 then BEGIN case long strmid tmp 2 3 2 of 10:BEGIN print Special data formats units 1 10 Not yet coded stop END 20:BEGIN print Special data formats units 1 20 Not yet coded stop END 30:BEGIN print Special data formats units 1 30 Not yet coded stop END 40:BEGIN case long strmid tmp 2 6 of 1:varfmt byte 2:varfmt uint 2:varfmt int 4:varfmt long ELSE:BEGIN print Bad definition of the special data formats: print long strmid tmp 2 6 should be equal to 1 2 2 or 4 stop END endcase END ELSE:BEGIN print Special data formats units 1 Not yet coded stop END endcase endif varsname i tmp 0 varsdes i strjoin tmp 3:n_elements tmp 1 varslev i long tmp 1 ENDFOR varslev 1 varslev ccmeshparameters filename filename ccmeshparameters filename Grads IF keyword_set key_performance EQ 1 THEN print time scanctl systime 1 time1 return end ");96 a[94] = new Array("./ReadWrite/scanoasis.html", "scanoasis.pro", "", " NAME:scanoasis PURPOSE:scan an Oasis file version scanoasis grids_orca_t106 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr July 01 2002 PRO scanoasis filename openr unit filename F77_UNFORMATTED GET_LUN SWAP_IF_LITTLE_ENDIAN error err if err ne 0 then begin print err_string return endif char8 12345678 WHILE NOT EOF unit DO BEGIN readu unit char8 print char8 readu unit ENDWHILE free_lun unit return end");97 a[95] = new Array("./ReadWrite/write_oasis.html", "write_oasis.pro", "", " NAME:write_oasis PURPOSE:write an Oasis file version 2 5 CATEGORY: CALLING SEQUENCE:write_oasis filename varname z2d INPUTS: filename:the filename varname: the name of the variable to be written z2d: the variable 2D array to be written KEYWORD PARAMETERS: I2 I4 I8 R4: to change the defaut format R8 of the data to be written APPEND: to open the file with the file pointer at the end of the file ready for data to be appended OUTPUTS: COMMON BLOCKS: SIDE EFFECTS:varname is automatically written as a charactere 8 by defaut z2d is written as an R8 array RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr July 01 2002 PRO write_oasis filename varname z2d I2 I4 i4 I8 i8 R4 r4 APPEND append openw unit filename F77_UNFORMATTED GET_LUN SWAP_IF_LITTLE_ENDIAN error err APPEND append if err ne 0 then begin print err_string return endif writeu unit string varname format a8 case 1 of keyword_set i2 :writeu unit fix z2d keyword_set i4 :writeu unit long z2d keyword_set i8 :writeu unit long64 z2d keyword_set r4 :writeu unit float z2d ELSE:writeu unit double z2d endcase free_lun unit return end");98 a[96] = new Array("./ReadWrite/writebat.html", "writebat.pro", "", " NAME: writebat PURPOSE: write the bathymetry ASCII file of OPA CATEGORY: for OPA CALLING SEQUENCE: writebat bat filename INPUTS: bat: the bathymetry a 2d array filename: a string containing the filename KEYWORD PARAMETERS: OUTPUTS:no COMMON BLOCKS:no SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr Sept 30 2003 based on batsav2 pro written by Maurice Imbard March 17 1998 PRO writebat zbat filename basic checks IF n_params NE 2 THEN BEGIN print bad number of aguments in the call of writebat return ENDIF IF size filename type NE 7 THEN BEGIN print the filename should be a string return ENDIF sbat size zbat IF sbat 0 NE 2 THEN BEGIN print bathymetry array should be 2d array return ENDIF jpi2 sbat 1 jpj2 sbat 2 parameters def ifreq 40 ifin jpi2 ifreq 1 irest jpi2 ifin 1 ifreq zbati intarr ifreq zbati2 intarr irest i0 intarr ifreq 5 i1 intarr max 1 irest 5 openw iunit filename get_lun fill the file printf iunit FORMAT 1x bathy IDL 2i8 jpi2 jpj2 printf iunit FORMAT il1 0 FOR jn 1 ifin 1 DO BEGIN printf iunit FORMAT il2 min jpi2 1 il1 ifreq 1 i0 0 il1 1 FOR jj 1 ifreq 5 1 DO BEGIN i0 jj i0 jj 1 5 END printf iunit FORMAT 3x 13 i3 12x i0 printf iunit FORMAT il3 il2 jn 1 ifreq iformat string il3 2 i3 FOR jj jpj2 1 0 1 DO BEGIN zbati 0:il3 zbat il1:il2 jj printf iunit FORMAT iformat jj 1 zbati END il1 il1 ifreq END printf iunit FORMAT il2 min jpi2 1 il1 ifreq 1 i1 0 il1 1 FOR jj 1 irest 5 1 DO BEGIN i1 jj i1 jj 1 5 END printf iunit FORMAT 3x 13 i3 12x i1 printf iunit FORMAT il3 il2 ifin 1 ifreq iformat string il3 2 i3 FOR jj jpj2 1 0 1 DO BEGIN zbati2 0:irest 1 0 zbati2 0:il3 zbat il1:il2 jj printf iunit FORMAT iformat jj 1 zbati2 END end close iunit free_lun iunit return end");89 a[87] = new Array("./ReadWrite/ncdf_timeget.html", "ncdf_timeget.pro", "", " file_comments get the time axis fom a netcdf_file and transforms it in julian days of IDL categories reading ncdf_file param cdfid in required the ID of the ncdf_file which is already open param timeid in required the ID or the name of the variable which describe the calendar keyword YYYYMMDD active to obtain the date as a longinterger with the format YearYearYearYearMonthMonthDayDay file_comments the keyword parameters of ncdf_varget returns a long array of IDL julian days restrictions the calendar variable must have the units attribute following the syntaxe bellow: time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 history Sebastien Masson smasson lodyc jussieu fr June 2001 FUNCTION ncdf_timeget cdfid timeid YYYYMMDD yyyymmdd _extra ex insidetime ncdf_varinq cdfid timeid if insidetime natts NE 0 then begin attnames strarr insidetime natts for attiq 0 insidetime natts 1 do attnames attiq strlowcase ncdf_attname cdfid timeid attiq ENDIF ELSE return report the variable timeid must have the units attribut reading of the time axis ncdf_varget cdfid timeid time _extra ex time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 if where attnames EQ units 0 NE 1 then begin ncdf_attget cdfid timeid units value value strtrim strcompress string value 2 words str_sep value unite words 0 start str_sep words 2 case strlowcase unite of seconds :time julday start 1 start 2 start 0 time long 24 3600 hours :time julday start 1 start 2 start 0 time long 24 days :time julday start 1 start 2 start 0 time months :BEGIN for t 0 n_elements time 1 do begin time t julday start 1 time t start 2 start 0 endfor END years :BEGIN for t 0 n_elements time 1 do begin time t julday start 1 start 2 start 0 time t endfor END ELSE:return report bad syntax of the units attribut of the variable timeid ENDCASE ENDIF ELSE return report the variable timeid must have the units attribut if keyword_set yyyymmdd then time jul2date time return time end"); 90 a[88] = new Array("./ReadWrite/read_grads.html", "read_grads.pro", "", " file_comments reading grads file except data type station or grib from the grads control file even if there is multiple data files categories reading function param var in required the variable name param date1 in required date of the beginning yyyymmdd if TIMESTEP is not activate param date2 in optional last date Optionnal if not scpecified date2 date1 keyword FILENAME the grads control file name: xxxx ctl file_comment keyword GLAMBOUNDARY via computegrid pro a 2 elements vector lon1 lon2 giving the longitute boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 eq 360 key_shift will be automatically defined according to GLAMBOUNDARY keyword TIMESTEP to specify that the dates are time steps instead of true calendar file_comment keyword IODIRECTORY a string giving the name of iodirectory see isafile pro for all possibilities default value is common variable iodir file_comments NOT yet available hidden BOX: a 4 or 6 elements 1d array lon1 lon2 lat1 lat2 depth1 depth2 that specifies the area where data must be read hidden EVERYTHING hidden NOSTRUCTURE returns an array uses common restriction define all the grid parameters defined in common pro associated to the data restrictions this function call the procedure scanfile that use the unix commands grep and sed examples IDL a read_grads sst 19900101 19900131 filename outputs ctl IDL plt a history Sebastien Masson smasson lodyc jussieu fr FUNCTION read_grads var date1 date2 FILENAME filename BOX box TIMESTEP timestep EVERYTHING everything NOSTRUCT nostruct _EXTRA ex cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF we find the filename filename isafile FILENAME filename IODIRECTORY iodir _EXTRA ex if size filename type NE 7 then return report read_ncdf cancelled we scan the control file called filename scanctl filename filesname jpt1file varsname varslev swapbytes bigendian littleendian f77sequential fileheader theader xyheader VARFMT varfmt _EXTRA ex if n_elements varfmt EQ 0 then varfmt float check date1 and date2 and found the starting index t1 and the ending index t2 that corresponds to the time series specified by date1 and date2 for the time axis defined in the ctl file if n_elements date1 EQ 0 then begin t0 0 t1 0 ENDIF if n_elements date2 EQ 0 then date2 date1 if keyword_set timestep then BEGIN if date1 GT date2 then begin print date2 must be larger than date1 return 1 endif t1 0 long date1 long date2 date2jul date2 grads if jdate1 GT jdate2 then begin print date2 must be larger than date1 return 1 endif t1 where time GE jdate1 0 tmp where time LE jdate2 t2 t2 t2 1 ENDELSE if t2 LT t1 then begin print There is no date between date1 and date2 return 1 endif jpt2read t2 t1 1 index of the variable varid where strlowcase varsname EQ strlowcase var varid varid 0 if varid EQ 1 then begin print var not found in the variable liste of filename return 1 ENDIF varname var if varslev varid EQ 1 then res fltarr jpi jpj jpt2read nozero ELSE res fltarr jpi jpj varslev varid jpt2read nozero find the first file to be read according to the lile list the number of time step in each file and t1 and t2 indf2read t1 jpt1file startread t1 indf2read jpt1file alreadyread 0 readagain: jpt2read1file min jpt1file startread jpt2read f2read filesname indf2read opening check the existance of the file f2read isafile filename f2read iodirectory iodir _EXTRA ex if the file is stored on tape if version os_family EQ unix then spawn file f2read dev null open the file openr unit f2read get_lun error err swap_if_little_endian bigendian swap_if_big_endian littleendian swap_endian swapbytes if err ne 0 then begin print err_string return 1 endif case varfmt of byte :fmtsz 1l uint :fmtsz 2l int :fmtsz 2l long :fmtsz 4l float :fmtsz 4l endcase check its size addf77sec long 4 2 f77sequential xyblocsize xyheader addf77sec xyheader NE 0 jpi jpj fmtsz addf77sec nxybloc long total varslev filesize fileheader addf77sec fileheader NE 0 theader addf77sec theader NE 0 nxybloc xyblocsize jpt1file infof2read fstat unit if infof2read size NE filesize then begin print According to filename the file size must be strtrim filesize 1 instead of strtrim infof2read size 1 print jpi: strtrim jpi 2 print jpj: strtrim jpj 2 print jpt: strtrim jpt 2 print format size in byte: strtrim fmtsz 2 print number of xy arrays: strtrim nxybloc 2 return 1 endif reading loop on the time steps to be read in one file for i 0 jpt2read1file 1 do begin computing the offset offset fileheader addf77sec fileheader NE 0 theader addf77sec theader NE 0 nxybloc xyblocsize startread i theader addf77sec theader NE 0 if varid NE 0 THEN offset offset long total varslev 0:varid 1 xyblocsize if there is only one level IF varslev varid EQ 1 then begin case varfmt of byte :a assoc unit bytarr jpi jpj nozero offset 4 f77sequential uint :a assoc unit uintarr jpi jpj nozero offset 4 f77sequential int :a assoc unit intarr jpi jpj nozero offset 4 f77sequential long :a assoc unit lonarr jpi jpj nozero offset 4 f77sequential float :a assoc unit fltarr jpi jpj nozero offset 4 f77sequential endcase res i alreadyread a 0 ENDIF ELSE BEGIN more than 1 level to be read if f77sequential then BEGIN sequential access case varfmt of byte :a assoc unit bytarr jpi jpj 8 varslev varid nozero offset uint :a assoc unit uintarr jpi jpj 4 varslev varid nozero offset int :a assoc unit intarr jpi jpj 4 varslev varid nozero offset long :a assoc unit lonarr jpi jpj 2 varslev varid nozero offset float :a assoc unit fltarr jpi jpj 2 varslev varid nozero offset endcase tmp a 0 case varfmt OF we cut the headers and tailers of f77 write byte : tmp tmp 4:jpi jpj 3 uint : tmp tmp 2:jpi jpj 1 int : tmp tmp 2:jpi jpj 1 long : tmp tmp 1:jpi jpj 0 float :tmp tmp 1:jpi jpj 0 endcase if keyword_set key_zreverse then res i alreadyread reverse reform tmp jpi jpj varslev varid over 3 ELSE res i alreadyread reform tmp jpi jpj varslev varid over ENDIF ELSE BEGIN direct acces case varfmt of byte :a assoc unit bytarr jpi jpj varslev varid nozero offset uint :a assoc unit uintarr jpi jpj varslev varid nozero offset int :a assoc unit intarr jpi jpj varslev varid nozero offset long :a assoc unit lonarr jpi jpj varslev varid nozero offset float :a assoc unit fltarr jpi jpj varslev varid nozero offset endcase if keyword_set key_zreverse then res i alreadyread reverse a 0 3 ELSE res i alreadyread a 0 ENDELSE ENDELSE endfor close the file free_lun unit close unit do we need to read a new file to complete the time series if jpt2read1file NE jpt2read then BEGIN indf2read indf2read 1 startread 0 alreadyread alreadyread jpt2read1file jpt2read jpt2read jpt2read1file GOTO readagain ENDIF post processing if keyword_set key_yreverse then res reverse res 2 if keyword_set key_shift then begin case size res 0 of 2:res shift res key_shift 0 3:res shift res key_shift 0 0 4:res shift res key_shift 0 0 0 endcase endif mask IF varslev varid EQ 1 then begin if abs valmask LE 1e5 then notgood where res 0 EQ valmask ELSE notgood where abs res 0 GE abs valmask 10 if notgood 0 NE 1 then tmask notgood 0b ENDIF ELSE BEGIN if abs valmask LE 1e5 then notgood where res 0 EQ valmask ELSE notgood where abs res 0 GE abs valmask 10 if notgood 0 NE 1 then tmask notgood 0b ENDELSE if abs valmask LE 1e5 then notgood where res EQ valmask ELSE notgood where abs res GE abs valmask 10 if notgood 0 NE 1 THEN res notgood values f_nan valmask 1e20 if abs valmask LE 1e5 then notgood where res EQ valmask ELSE notgood where abs res GE abs valmask 10 if notgood 0 NE 1 THEN res notgood 1e20 valmask 1e20 triangles_list triangule subdomain extration time aguments time time t1:t2 jpt t2 t1 1 if keyword_set timestep then vardate strtrim time 0 2 ELSE vardate date2string vairdate time 0 updateold return res end"); 91 a[89] = new Array("./ReadWrite/read_oasis.html", "read_oasis.pro", "", " file_comments read the f77 unformated files used in Oasis version a read_oasis grids_orca_t106 a106 lon 320 160 IDL m read_oasis masks_orca_t106 or1t msk 182 149 i4 see also IDL scanoasis grids_orca_t106 history Sebastien Masson smasson lodyc jussieu fr July 01 2002 FUNCTION read_oasis filename varname jpi jpj I2 I4 i4 I8 i8 R4 r4 openr unit filename f77_unformatted get_lun swap_if_little_endian error err if err ne 0 then begin print err_string return 1 endif char8 12345678 readu unit char8 print char8 found char8 EQ varname WHILE NOT EOF unit AND found NE 1 DO BEGIN readu unit if EOF unit then begin print varname not found in filename return 1 endif readu unit char8 print char8 found char8 EQ varname ENDWHILE case 1 of keyword_set i2 :res intarr jpi jpj keyword_set i4 :res lonarr jpi jpj keyword_set i8 :res lon64arr jpi jpj keyword_set r4 :res fltarr jpi jpj ELSE:res dblarr jpi jpj endcase readu unit res free_lun unit return res end"); 92 a[90] = new Array("./ReadWrite/readbat.html", "readbat.pro", "", " file_comments reading the bathymetry ASCII file of OPA categories for OPA param filename in required a string containing the filename keyword ZERO to put 0 on land instead of negatives values for the islands returns a 2d array history Sebastien Masson smasson lodyc jussieu fr May 31 2002 based on batlec2 pro written by Maurice Imbard March 17 1998 FUNCTION readbat filename ZERO zero lecture de la bathymetrie iname_file findfile filename if iname_file 0 EQ then begin print Bad file name return 1 ENDIF ELSE iname_file iname_file 0 openr iunit iname_file get_lun readf iunit FORMAT 16x 2i8 iim ijm iim long iim ijm long ijm tmp readf iunit tmp tmp strsplit tmp extract iim long tmp n_elements tmp 2 ijm long tmp n_elements tmp 1 print iim ijm ifreq 40L ifin iim ifreq 1 irest iim ifin 1 ifreq print ifin irest ifreq zbati intarr ifreq zbati2 intarr irest zbat intarr iim ijm readf iunit FORMAT readf iunit FORMAT il1 0 FOR jn 1 ifin 1 DO BEGIN readf iunit FORMAT readf iunit FORMAT il2 min iim 1 il1 ifreq 1 readf iunit FORMAT readf iunit FORMAT readf iunit FORMAT il3 il2 jn 1 ifreq iformat string il3 2 i3 print jn il1 il2 il3 ifreq 1 FOR jj ijm 1 0 1 DO BEGIN readf iunit FORMAT iformat ij zbati zbat il1:il2 jj zbati ENDFOR il1 il1 ifreq ENDFOR readf iunit FORMAT readf iunit FORMAT il2 min iim 1 il1 ifreq 1 readf iunit FORMAT readf iunit FORMAT readf iunit FORMAT il3 il2 ifin 1 ifreq iformat string il3 2 i3 print irest 1 il1 il2 il3 FOR jj ijm 1 0 1 DO BEGIN readf iunit FORMAT iformat ij zbati2 zbat il1:il2 jj zbati2 ENDFOR close iunit free_lun iunit if keyword_set zero then zbat 0 zbat return zbat end"); 93 a[91] = new Array("./ReadWrite/readoldopadistcoast.html", "readoldopadistcoast.pro", "", " file_comments read the old binary direct access file that contains the distance to the coast in OPA based on the OPA subroutines dtacof and parctl categories for OPA before NetCDF returns a structure that contains two elements: tdistcoast the distance for the t points and fdiscoast the distance for the f points history Sebastien Masson smasson lodyc jussieu fr June 2002 FUNCTION read3fromopa unit params num offset params reclen params jpk num 1L a assoc unit dblarr params jpiglo params jpjglo params jpk nozero offset b a 0 return b end param filename in required filename with the whole path if necessary param jpiglo in required param jpjglo in required param jpk in required dimensions of the opa grid keyword IBLOC ibloc size default: ibloc 4096L keyword JPBYT jpbyt size default: jpbyt 8L keyword NUMREC number of records in the file default: numrec 19L jpk history Sebastien Masson smasson lodyc jussieu fr June 2002 FUNCTION readoldopadistcoast filename jpiglo jpjglo jpk IBLOC ibloc JPBYT jpbyt NUMREC numrec iname_file findfile filename if iname_file 0 EQ then begin print Bad file name return 1 ENDIF ELSE iname_file iname_file 0 open the file openr numcost iname_file get_lun swap_if_little_endian check the size of the file filepamameters fstat numcost defaut parameter definition for ORCA2 IF keyword_set ibloc THEN ibloc long ibloc ELSE ibloc 4096L jpiglo long jpiglo jpjglo long jpjglo jpk long jpk IF keyword_set jpbyt THEN jpbyt long jpbyt ELSE jpbyt 8L record length computation reclen ibloc jpiglo jpjglo jpbyt 1 ibloc 1 number of records IF keyword_set numrec THEN numrec long numrec ELSE numrec 3L jpk difference between the record length and the size of the contened array toomuch reclen jpiglo jpjglo jpbyt expected size computation size numrec reclen toomuch if size NE filepamameters size then begin print The size of the file is not the expected one print Check your file or the values of ibloc jpiglo print jpjglo jpk jpbyt numrec in this program return 1 endif first record: six 64 bit integer to read default definition iimlu long64 999 ijmlu long64 999 ikmlu long64 999 read readu numcost iimlu ijmlu ikmlu if iimlu NE jpiglo then begin print iimlu strtrim iimlu 1 differs from jpiglo strtrim jpiglo 1 return 1 endif if ijmlu NE jpjglo then begin print ijmlu strtrim ijmlu 1 differs from jpjglo strtrim jpjglo 1 return 1 endif if ikmlu NE jpk then begin print ikmlu strtrim ikmlu 1 differs from jpk strtrim jpk 1 return 1 endif other records params jpiglo:jpiglo jpjglo:jpjglo jpk:jpk reclen:reclen tdistcoast read3fromopa numcost params 2 fdistcoast read3fromopa numcost params 3 close numcost free_lun numcost return tdistcoast:tdistcoast fdistcoast:fdistcoast end"); 94 a[92] = new Array("./ReadWrite/readoldoparestart.html", "readoldoparestart.pro", "", " categories for OPA before NetCDF restrictions bug for etab and etan written on the same record history Sebastien Masson smasson lodyc jussieu fr June 2002 FUNCTION read2fromopa unit params num offset params reclen params jpk num 1L a assoc unit dblarr params jpiglo params jpjglo nozero offset return a 0 end history Sebastien Masson smasson lodyc jussieu fr June 2002 FUNCTION read3fromopa unit params num offset params reclen params jpk num 1L a assoc unit dblarr params jpiglo params jpjglo params jpk nozero offset return a 0 end file_comments read the old restart files of OPA before NetCDF based on the OPA subroutine dtrlec included at the end of the file categories for OPA before NetCDF param filename in required with the whole path if necessary param jpiglo in required param jpjglo in required param jpk in required dimensions of the opa grid keyword IBLOC ibloc size default: ibloc 4096L keyword JPBYT jpbyt size defalut: jpbyt 8L keyword NUMREC number of records in the file defalut: numrec 19L jpk keyword UB keyword VB keyword TB keyword SB keyword ROTB keyword HDIVB keyword UN keyword VN keyword TN keyword SN keyword ROTN keyword HDIVN keyword GCX keyword GCXB keyword ETAB keyword ETAN keyword BSFB keyword BSFN keyword BSFD keyword EN the variable we want to read returns according to the given keywords restrictions bug for etab and etan written on the same record history Sebastien Masson smasson lodyc jussieu fr June 2002 PRO readoldoparestart filename jpiglo jpjglo jpk IBLOC ibloc JPBYT jpbyt NUMREC numrec ub ub vb vb tb tb sb sb rotb rotb hdivb hdivb un un vn vn tn tn sn sn rotn rotn hdivn hdivn gcx gcx gcxb gcxb etab etab etan etan bsfb bsfb bsfn bsfn bsfd bsfd en en iname_file findfile filename if iname_file 0 EQ then begin print Bad file name return ENDIF ELSE iname_file iname_file 0 open the file openr numrst iname_file get_lun swap_if_little_endian check the size of the file filepamameters fstat numrst parameter definition IF keyword_set ibloc THEN ibloc long ibloc ELSE ibloc 4096L jpiglo long jpiglo jpjglo long jpjglo jpk long jpk IF keyword_set jpbyt THEN jpbyt long jpbyt ELSE jpbyt 8L record length computation reclen ibloc jpiglo jpjglo jpbyt 1 ibloc 1 IF keyword_set numrec THEN numrec long numrec ELSE numrec 19L jpk toomuch reclen jpiglo jpjglo jpbyt expected size computation size numrec reclen toomuch if size NE filepamameters size then begin print The size of the file is not the expected one print Check your file or the values of ibloc jpiglo print jpjglo jpk jpbyt numrec in this program return endif first record: six 64 bit integer to read default definition ino1 long64 9999 it1 long64 9999 isor1 long64 9999 ipcg1 long64 9999 itke1 long64 9999 idast1 long64 9999 read readu numrst ino1 it1 isor1 ipcg1 itke1 idast1 print ino1 it1 isor1 ipcg1 itke1 idast1 other records params jpiglo:jpiglo jpjglo:jpjglo jpk:jpk reclen:reclen CALL read3 numrst ub 2 IF arg_present ub THEN ub read3fromopa numrst params 2 CALL read3 numrst vb 3 IF arg_present vb THEN vb read3fromopa numrst params 3 CALL read3 numrst tb 5 IF arg_present tb THEN tb read3fromopa numrst params 5 CALL read3 numrst sb 6 IF arg_present sb THEN sb read3fromopa numrst params 6 CALL read3 numrst rotb 7 IF arg_present rotb THEN rotb read3fromopa numrst params 7 CALL read3 numrst hdivb 8 IF arg_present hdivb THEN hdivb read3fromopa numrst params 8 CALL read3 numrst un 9 IF arg_present un THEN un read3fromopa numrst params 9 CALL read3 numrst vn 10 IF arg_present vn THEN vn read3fromopa numrst params 10 CALL read3 numrst tn 12 IF arg_present tn THEN tn read3fromopa numrst params 12 CALL read3 numrst sn 13 IF arg_present sn THEN sn read3fromopa numrst params 13 CALL read3 numrst rotn 14 IF arg_present rotn THEN rotn read3fromopa numrst params 14 CALL read3 numrst hdivn 15 IF arg_present hdivn THEN hdivn read3fromopa numrst params 15 C C Read elliptic solver arrays C CALL read2 numrst gcx jpk 17 IF arg_present gcx THEN gcx read2fromopa numrst params 17 CALL read2 numrst gcxb jpk 18 IF arg_present gcxb THEN gcxb read2fromopa numrst params 18 C ifdef key_freesurf_cstvol C C free surface formulation eta C CALL read2 numrst etab jpk 4 IF arg_present etab THEN etab read2fromopa numrst params 4 CALL read2 numrst etan jpk 4 IF arg_present etan THEN etan read2fromopa numrst params 4 else C C Rigid lid formulation bsf C CALL read2 numrst bsfb jpk 4 IF arg_present bsfb THEN bsfb read2fromopa numrst params 4 CALL read2 numrst bsfn jpk 11 IF arg_present bsfn THEN bsfn read2fromopa numrst params 11 CALL read2 numrst bsfd jpk 16 IF arg_present bsfd THEN bsfd read2fromopa numrst params 16 endif ifdef key_zdftke CALL read3 numrst en 19 IF arg_present en THEN en read3fromopa numrst params 19 close numrst free_lun numrst return end CDIR LIST SUBROUTINE dtrlec CCC CCC CCC ROUTINE dtrlec CCC CCC CCC Purpose : CCC CCC Read files for restart CCC CC Method : CC CC Read the previous fields on the file numrst CC the first record indicates previous characterics CC after control with the present run we read : CC prognostic variables on the second record CC elliptic solver arrays CC barotropic stream function arrays default option CC or free surface arrays key_freesurf_cstvol defined CC tke arrays key_zdftke defined CC for this last three records the previous characteristics CC could be different with those used in the present run CC CC Input : CC CC common CC comrst : restart parameter CC comctl : parameters for the control CC CC Output : CC CC common CC combef : previous fields before CC comnow : present fields now CC combsf : barotropic stream function CC comspg : surface pressure CC comsol : diagonal preconditioned conjugate CC CC Modifications : CC CC original : 91 03 CC additions : 92 01 M Imbard CC : 92 06 correction restart file M Imbard CC : 98 02 M Guyon FETI method CC addition : 98 05 G Roullet free surface CC CC parameters and commons CC CDIR NOLIST include parameter h include common h CDIR LIST CC CC local declarations CC INTEGER ji jj jk jl INTEGER ino0 it0 ipcg0 isor0 itke0 INTEGER ino1 it1 isor1 ipcg1 itke1 idast1 CC CC statement functions CC CDIR NOLIST include stafun h CDIR LIST CCC CCC OPA8 LODYC 1997 CCC C C C 0 Initialisations C C ino0 no it0 nit000 ipcg0 0 isor0 0 itke0 0 isor0 nsolv 1 ipcg0 2 nsolv ifdef key_zdftke itke0 1 endif C FETI method IF nsolv EQ 3 THEN isor0 2 ipcg0 2 ENDIF C IF lwp THEN WRITE numout WRITE numout dtrlec: beginning of restart WRITE numout WRITE numout the present run : WRITE numout job number : no WRITE numout with nit000 : nit000 WRITE numout with pcg option ipcg0 : ipcg0 WRITE numout with sor option isor0 : isor0 WRITE numout with FETI solver option ipcg0 isor0 : ipcg0 isor0 WRITE numout with tke option itke0 : itke0 ENDIF C C 1 Read numrst C C C First record C READ numrst REC 1 ino1 it1 isor1 ipcg1 itke1 idast1 C IF lwp THEN WRITE numout WRITE numout READ numrst with WRITE numout job number : ino1 WRITE numout with time step it : it1 WRITE numout with pcg option ipcg1 : ipcg1 WRITE numout with sor option isor1 : isor1 WRITE numout with tke option itke1 : itke1 WRITE numout with FETI solver option ipcg1 isor1 : ipcg1 isor1 WRITE numout ENDIF C C Control of date C IF it0 it1 NE 1 AND abs nrstdt EQ 1 THEN IF lwp THEN WRITE numout : problem with nit000 for the restart WRITE numout WRITE numout we stop verify the file WRITE numout or rerun with the value 0 for the WRITE numout control of time parameter nrstdt WRITE numout ENDIF STOP dtrlec ENDIF IF nrstdt EQ 1 ndate0 idast1 C C Read prognostic variables C CALL read3 numrst ub 2 CALL read3 numrst vb 3 CALL read3 numrst tb 5 CALL read3 numrst sb 6 CALL read3 numrst rotb 7 CALL read3 numrst hdivb 8 CALL read3 numrst un 9 CALL read3 numrst vn 10 CALL read3 numrst tn 12 CALL read3 numrst sn 13 CALL read3 numrst rotn 14 CALL read3 numrst hdivn 15 C C Read elliptic solver arrays C CALL read2 numrst gcx jpk 17 CALL read2 numrst gcxb jpk 18 C ifdef key_freesurf_cstvol C C free surface formulation eta C CALL read2 numrst etab jpk 4 CALL read2 numrst etan jpk 4 else C C Rigid lid formulation bsf C CALL read2 numrst bsfb jpk 4 CALL read2 numrst bsfn jpk 11 CALL read2 numrst bsfd jpk 16 endif C ifdef key_zdftke C C Read tke arrays C IF itke1 eq 1 THEN CALL read3 numrst en 19 ELSE IF lwp THEN WRITE numout : the previous restart file didnt used tke scheme WRITE numout ENDIF nrstdt 2 ENDIF endif C C RETURN END"); 95 a[93] = new Array("./ReadWrite/scanctl.html", "scanctl.pro", "", " file_comments GLAMBOUNDARY 2 elements vector lon1 lon2 the longitute boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 le 360 key_shift will be defined according to GLAMBOUNDARY PRO scanctl filename filesname jpt1file varsname varslev swapbytes bigendian littleendian f77sequential fileheader theader xyheader VARFMT varfmt _EXTRA ex common time1 systime 1 for key_performance DTYPE spawn grep i DTYPE filename notgood if keyword_set notgood then begin print This program is not adapted to data type station or grib Sorry stop endif UNDEF define valmask spawn grep i UNDEF filename valmask valmask strtrim valmask 2 valmask strsplit valmask 0 extract valmask float valmask 1 Headers spawn grep i FILEHEADER filename fileheader fileheader strtrim fileheader 2 if keyword_set fileheader then BEGIN fileheader strsplit fileheader 0 extract fileheader long fileheader 1 ENDIF ELSE fileheader 0L spawn grep i THEADER filename theader theader strtrim theader 2 if keyword_set theader then BEGIN theader strsplit theader 0 extract theader long theader 1 ENDIF ELSE theader 0L spawn grep i XYHEADER filename xyheader xyheader strtrim xyheader 2 if keyword_set xyheader then BEGIN xyheader strsplit xyheader 0 extract xyheader long xyheader 1 ENDIF ELSE xyheader 0L find the x axis spawn sed n e d e Xx Dd Ee Ff Yy Dd Ee Ff p filename xdef if xdef 0 EQ then BEGIN print Bad definition of xdef or ydef stop ENDIF xdef xdef 0:n_elements xdef 2 if n_elements xdef NE 1 then begin xdef byte xdef replicate byte 1 n_elements xdef xdef xdef where xdef NE 0 xdef string xdef endif xdef strtrim xdef 0 2 xdef strsplit xdef extract jpi long xdef 1 case strupcase xdef 2 of LINEAR :xaxis float xdef 3 findgen jpi float xdef 4 LEVELS :xaxis float xdef 3:n_elements xdef 1 ENDCASE find the y axis spawn sed n e d e Yy Dd Ee Ff Zz Dd Ee Ff p filename ydef if ydef 0 EQ then BEGIN print Bad definition of ydef or zdef stop ENDIF ydef ydef 0:n_elements ydef 2 if n_elements ydef NE 1 then begin ydef byte ydef replicate byte 1 n_elements ydef ydef ydef where ydef NE 0 ydef string ydef endif ydef strtrim ydef 0 2 ydef strsplit ydef extract jpj long ydef 1 case strupcase ydef 2 of LINEAR :yaxis float ydef 3 findgen jpj float ydef 4 LEVELS :yaxis float ydef 3:n_elements ydef 1 GAUST62 :BEGIN print Not yet coded stop END GAUSR15 :BEGIN print Not yet coded stop END GAUSR20 :BEGIN print Not yet coded stop END GAUSR30 :BEGIN print Not yet coded stop END GAUSR40 :BEGIN print Not yet coded stop END ELSE:BEGIN print Not yet coded stop END endcase find the z axis spawn sed n e d e Zz Dd Ee Ff Tt Dd Ee Ff p filename zdef if zdef 0 EQ then BEGIN print Bad definition of zdef or tdef stop ENDIF zdef zdef 0:n_elements zdef 2 if n_elements zdef NE 1 then begin zdef byte zdef replicate byte 1 n_elements zdef zdef zdef where zdef NE 0 zdef string zdef endif zdef strtrim zdef 0 2 zdef strsplit zdef extract jpk long zdef 1 case strupcase zdef 2 of LINEAR :zaxis float zdef 3 findgen jpk float zdef 4 LEVELS :zaxis float zdef 3:n_elements zdef 1 ENDCASE compute the grid computegrid xaxis xaxis yaxis yaxis zaxis zaxis _EXTRA ex domdef find the time axis spawn grep i TDEF filename timedef timedef strupcase strtrim timedef 2 timedef strsplit timedef 0 extract jpt long timedef 1 initial date: y0 m0 d0 h0 mn0 julian day of IDL: julady m0 d0 y0 h0 mn0 00 t0 timedef 3 monthsname string format C CMOA 31 indgen 12 case 1 OF h h :mmZd d mmmyy yy strpos t0 : NE 1:BEGIN pp strpos t0 : h0 long strmid t0 0 pp mn0 long strmid t0 pp 1 2 pp strpos t0 Z dd byte strmid t0 pp 2 1 LT byte A d0 long strmid t0 pp 1 1 dd m0 where monthsname EQ strmid t0 pp 2 dd 3 0 1 y0 long strmid t0 pp 5 dd END m m Zd d mmmyy yy strpos t0 Z NE 1:BEGIN h0 0 12 pp strpos t0 Z mn0 long strmid t0 0 pp dd byte strmid t0 pp 2 1 LT byte A d0 long strmid t0 pp 1 1 dd m0 where monthsname EQ strmid t0 pp 2 dd 3 0 1 y0 long strmid t0 pp 5 dd END d d mmmyy yy byte strmid t0 0 1 LT byte A 0 :BEGIN h0 0 12 mn0 0 dd byte strmid t0 1 1 LT byte A d0 long strmid t0 0 1 dd m0 where monthsname EQ strmid t0 1 dd 3 0 1 y0 long strmid t0 4 dd END mmmyy yy ELSE:BEGIN h0 0 12 mn0 0 d0 1 m0 where monthsname EQ strmid t0 0 3 0 1 y0 long strmid t0 3 END ENDCASE if y0 is a two digit integer between 1950 and 2049 case 1 of y0 LE 49:y0 2000 y0 y0 LE 99:y0 1900 y0 ELSE: ENDCASE increment date and definition of the calendar with IDL julian days tstep timedef 4 tsval long strmid tstep 0 strlen tstep 2 case strlowcase strmid tstep 1 reverse of mn :time julday m0 d0 y0 h0 mn0 lindgen jpt tsval 0 hr :time julday m0 d0 y0 h0 lindgen jpt tsval mn0 0 dy :time julday m0 d0 lindgen jpt tsval y0 h0 mn0 0 mo :time julday m0 lindgen jpt tsval d0 y0 h0 mn0 0 yr :time julday m0 d0 y0 lindgen jpt tsval h0 mn0 0 ENDCASE shit the calendar to correspond to the time step case strlowcase strmid tstep 1 reverse of dy :time long time mo :time long time 14L yr :time long time 365L 2 ELSE: endcase OPTIONS spawn grep i OPTIONS filename options options strtrim options 2 options strlowcase options 0 key_yreverse strpos options yrev NE 1 key_zreverse strpos options zrev EQ 1 multifiles strpos options template NE 1 f77sequential strpos options sequential NE 1 swapbytes strpos options byteswapped NE 1 bigendian strpos options big_endian NE 1 littleendian strpos options little_endian NE 1 cray strpos options cray_32bit_ieee NE 1 IF cray THEN BEGIN print cray_32bit_ieee Not yet coded stop ENDIF cal365 strpos options 365_day_calendar NE 1 IF cal365 THEN BEGIN print 365_day_calenda Not yet coded stop ENDIF building the filesname spawn grep i DSET filename files files strtrim files 0 2 files strsplit files extract if n_elements files NE 2 then begin print Bad definition of the filename There shoud be 2 elements: print DEST and 1 filename that may define many files stop endif files files 1 files strmid files 0 strpos files 0 reverse_search 1 filesname files if keyword_set multifiles then begin minutes if stregex files i n2 0 NE 1 then begin filetsep mn mnend long mn0 jpt 1 tmp strarr hend h0 1 for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i n2 extract regex string mn0 i format i2 2 filesname strjoin tmp endif hours if stregex files i hf 123 0 NE 1 then begin filetsep hr case strlowcase strmid tstep 1 reverse of mn :hend long h0 jpt mn0 1 1 60 hr :hend long h0 jpt 1 endcase tmp strarr hend h0 1 case 1 of stregex files i h1 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i h1 extract regex strtrim h0 i 1 stregex files i h2 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i h2 extract regex string h0 i format i2 2 stregex files f2 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname f2 extract regex string h0 i format i3 2 stregex files i hf 3 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i hf 3 extract regex string h0 i format i3 3 endcase filesname strjoin tmp endif days if stregex files i d 12 0 NE 1 then begin filetsep dy case strlowcase strmid tstep 1 reverse of mn :dend long d0 jpt mn0 1 1 1440 hr :dend long d0 jpt h0 1 1 24 dy :dend long d0 jpt 1 endcase tmp strarr dend d0 1 case 1 of stregex files i d1 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i d1 extract regex strtrim d0 i 1 stregex files i d2 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i d2 extract regex string d0 i format i2 2 endcase filesname strjoin tmp endif months if stregex files i m 12c 0 NE 1 then begin filetsep mo tmp strarr 12 case 1 of stregex files i m1 NE 1:for i 1 12 do tmp i 1 strjoin strsplit filesname i m1 extract regex strtrim i 1 stregex files i m2 NE 1:for i 1 12 do tmp i 1 strjoin strsplit filesname i m2 extract regex string i format i2 2 stregex files i mc NE 1:for i 1 12 do tmp i 1 strjoin strsplit filesname i mc extract regex monthsname i 1 endcase filesname strjoin tmp endif years if stregex files i y 24 0 NE 1 then begin case strlowcase strmid tstep 1 reverse of dy :yend long y0 jpt d0 1 1 365 mo :yend long y0 jpt m0 1 1 12 yr :yend long y0 jpt 1 ELSE:yend y0 endcase tmp strarr yend y0 1 case 1 of stregex files i y2 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i y2 extract regex string y0 i 100 y0 i 100 format i2 2 stregex files i y4 NE 1:for i 0 n_elements tmp 1 do tmp i strjoin strsplit filesname i y 4 extract regex string y0 i format i4 4 endcase filesname strjoin tmp endif filesname strsplit filesname extract time step unit of each file: case 1 of stregex files i n2 0 NE 1:filetsep mn stregex files i hf 123 0 NE 1:filetsep hr stregex files i d 12 0 NE 1:filetsep dy stregex files i m 12c 0 NE 1: filetsep mo stregex files i y 24 0 NE 1:filetsep yr ENDCASE number of time steps for each files case strlowcase strmid tstep 1 reverse of mn :BEGIN case filetsep of yr :jpt1file 60L 24L 365L mo :jpt1file 60L 24L 30L dy :jpt1file 60L 24L hr :jpt1file 60L mn :jpt1file 1L endcase END hr :BEGIN case filetsep of yr :jpt1file 24L 365L mo :jpt1file 24L 30L dy :jpt1file 24L hr :jpt1file 1L endcase END dy :BEGIN case filetsep of yr :jpt1file 365L mo :jpt1file 30L dy :jpt1file 1L endcase END mo :BEGIN case filetsep of yr :jpt1file 12L mo :jpt1file 1L endcase END yr :jpt1file 1L endcase number of files nof ceil jpt 1 jpt1file filesname filesname 0:nof 1 ENDIF ELSE BEGIN nof 1 jpt1file jpt ENDELSE first character if stregex files GE 0 THEN BEGIN iodir strmid filename 0 strpos filename reverse_search 1 for i 0 nof 1 do filesname i iodir strmid filesname i 1 ENDIF extracting the variables spawn grep i VARS filename nvars nvars strtrim nvars 2 nvars strsplit nvars 0 extract nvars long nvars 1 spawn sed n e d e Vv Aa Rr Ss Ee Nn Dd Vv Aa Rr Ss p filename varlist if n_elements varlist LE 2 then begin print No lines between vars and endvars stop endif varlist varlist 1:n_elements varlist 2 if n_elements varlist NE nvars then begin print Number of variables indicated by VARS strtrim nvars 1 differs from number of lines without at the beginning located between VARS and ENDVARS: strtrim n_elements varlist 1 stop ENDIF varsname strarr nvars varsdes strarr nvars varslev lonarr nvars for i 0 nvars 1 do BEGIN varlist i strtrim varlist i 2 tmp strsplit varlist i extract if strmid tmp 2 0 2 EQ 1 then BEGIN case long strmid tmp 2 3 2 of 10:BEGIN print Special data formats units 1 10 Not yet coded stop END 20:BEGIN print Special data formats units 1 20 Not yet coded stop END 30:BEGIN print Special data formats units 1 30 Not yet coded stop END 40:BEGIN case long strmid tmp 2 6 of 1:varfmt byte 2:varfmt uint 2:varfmt int 4:varfmt long ELSE:BEGIN print Bad definition of the special data formats: print long strmid tmp 2 6 should be equal to 1 2 2 or 4 stop END endcase END ELSE:BEGIN print Special data formats units 1 Not yet coded stop END endcase endif varsname i tmp 0 varsdes i strjoin tmp 3:n_elements tmp 1 varslev i long tmp 1 ENDFOR varslev 1 varslev ccmeshparameters filename filename ccmeshparameters filename Grads IF keyword_set key_performance EQ 1 THEN print time scanctl systime 1 time1 return end "); 96 a[94] = new Array("./ReadWrite/scanoasis.html", "scanoasis.pro", "", " file_comments scan an Oasis file version scanoasis grids_orca_t106 history Sebastien Masson smasson lodyc jussieu fr July 01 2002 PRO scanoasis filename openr unit filename F77_UNFORMATTED GET_LUN SWAP_IF_LITTLE_ENDIAN error err if err ne 0 then begin print err_string return endif char8 12345678 WHILE NOT EOF unit DO BEGIN readu unit char8 print char8 readu unit ENDWHILE free_lun unit return end"); 97 a[95] = new Array("./ReadWrite/write_oasis.html", "write_oasis.pro", "", " file_comments write an Oasis file version 2 5 param filename in required the filename param varname in required the name of the variable to be written param z2d in required the variable 2D array to be written keyword I2 param ou mot clef keyword I4 keyword I8 keyword R4 to change the defaut format R8 of the data to be written keyword APPEND to open the file with the file pointer at the end of the file ready for data to be appended restrictions varname is automatically written as a charactere 8 by defaut z2d is written as an R8 array history Sebastien Masson smasson lodyc jussieu fr July 01 2002 PRO write_oasis filename varname z2d I2 I4 i4 I8 i8 R4 r4 APPEND append openw unit filename F77_UNFORMATTED GET_LUN SWAP_IF_LITTLE_ENDIAN error err APPEND append if err ne 0 then begin print err_string return endif writeu unit string varname format a8 case 1 of keyword_set i2 :writeu unit fix z2d keyword_set i4 :writeu unit long z2d keyword_set i8 :writeu unit long64 z2d keyword_set r4 :writeu unit float z2d ELSE:writeu unit double z2d endcase free_lun unit return end"); 98 a[96] = new Array("./ReadWrite/writebat.html", "writebat.pro", "", " file_comments write the bathymetry ASCII file of OPA categories for OPA param zbat in required the bathymetry a 2d array param filename in required a string containing the filename history Sebastien Masson smasson lodyc jussieu fr Sept 30 2003 based on batsav2 pro written by Maurice Imbard March 17 1998 PRO writebat zbat filename basic checks IF n_params NE 2 THEN BEGIN print bad number of aguments in the call of writebat return ENDIF IF size filename type NE 7 THEN BEGIN print the filename should be a string return ENDIF sbat size zbat IF sbat 0 NE 2 THEN BEGIN print bathymetry array should be 2d array return ENDIF jpi2 sbat 1 jpj2 sbat 2 parameters def ifreq 40 ifin jpi2 ifreq 1 irest jpi2 ifin 1 ifreq zbati intarr ifreq zbati2 intarr irest i0 intarr ifreq 5 i1 intarr max 1 irest 5 openw iunit filename get_lun fill the file printf iunit FORMAT 1x bathy IDL 2i8 jpi2 jpj2 printf iunit FORMAT il1 0 FOR jn 1 ifin 1 DO BEGIN printf iunit FORMAT il2 min jpi2 1 il1 ifreq 1 i0 0 il1 1 FOR jj 1 ifreq 5 1 DO BEGIN i0 jj i0 jj 1 5 END printf iunit FORMAT 3x 13 i3 12x i0 printf iunit FORMAT il3 il2 jn 1 ifreq iformat string il3 2 i3 FOR jj jpj2 1 0 1 DO BEGIN zbati 0:il3 zbat il1:il2 jj printf iunit FORMAT iformat jj 1 zbati END il1 il1 ifreq END printf iunit FORMAT il2 min jpi2 1 il1 ifreq 1 i1 0 il1 1 FOR jj 1 irest 5 1 DO BEGIN i1 jj i1 jj 1 5 END printf iunit FORMAT 3x 13 i3 12x i1 printf iunit FORMAT il3 il2 ifin 1 ifreq iformat string il3 2 i3 FOR jj jpj2 1 0 1 DO BEGIN zbati2 0:irest 1 0 zbati2 0:il3 zbat il1:il2 jj printf iunit FORMAT iformat jj 1 zbati2 END end close iunit free_lun iunit return end"); 99 99 a[97] = new Array("./Tests/TestsOld/tst_basic_old.html", "tst_basic_old.pro", "", "PRO tst_basic_old figure 1: basics plots 1 plot n 10 y findgen n basic plot splot y petit 2 2 1 portrait improved plot by using plot and graphic keywords splot y petit 2 2 2 noerase yrange 0 n 1 2 title x and x 2 oplot y 2 color 100 linestyle 2 thick 3 2 contour z dist n basic plot scontour z fill nlevels 15 petit 2 2 3 noerase improved plot by using contour and graphic keywords ind findgen 2 n 2 n scontour z levels n ind c_orientation 180 ind c_spacing 2 ind petit 2 2 4 noerase contour z overplot c_label rebin 1 0 2 n levels n ind c_charthick 2 c_charsize 1 5 c_colors 250 ind return end"); 100 100 a[98] = new Array("./Tests/TestsOld/tst_initlev_index_old.html", "tst_initlev_index_old.pro", "", "");
Note: See TracChangeset
for help on using the changeset viewer.